gamestage 0.35.12 → 0.35.13
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/cli.mjs +64 -64
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* A single bundled file, minified. Nothing here phones home, and inspect,
|
|
11
11
|
* create and manifest validate all run without an account.
|
|
12
12
|
*/
|
|
13
|
-
var XA=Object.defineProperty;var w=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var Gt=(e,t)=>{for(var r in t)XA(e,r,{get:t[r],enumerable:!0})};function Xn(e,t={}){let r=e?.trim()||Sr;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var Sr,Fo=w(()=>{"use strict";Sr="Round"});function qe(e){return oI[e]??e}function Pb(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=qe(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Bt,oI,nd,Ob,rn=w(()=>{"use strict";Bt=["hunt","push","group","predict","bingo","shoot","place"],oI={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};nd={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element"},Ob={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face"}});function k(e,t,r){function o(s,d){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,d);let l=a.prototype,p=Object.keys(l);for(let h=0;h<p.length;h++){let m=p[h];m in s||(s[m]=l[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var d;let l=r?.Parent?new i:this;o(l,s),(d=l._zod).deferred??(d.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Oe(e){return e&&Object.assign(Qn,e),Qn}var Nb,rd,od,Lt,xn,Qn,er=w(()=>{rd=Object.freeze({status:"aborted"});od=Symbol("zod_brand"),Lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Nb=globalThis).__zod_globalConfig??(Nb.__zod_globalConfig={});Qn=globalThis.__zod_globalConfig});var W={};Gt(W,{BIGINT_FORMAT_RANGES:()=>md,Class:()=>ad,NUMBER_FORMAT_RANGES:()=>hd,aborted:()=>$n,allowsEval:()=>ld,assert:()=>lI,assertEqual:()=>iI,assertIs:()=>sI,assertNever:()=>cI,assertNotEqual:()=>aI,assignProp:()=>En,base64ToUint8Array:()=>Lb,base64urlToUint8Array:()=>TI,cached:()=>Tr,captureStackTrace:()=>Ta,cleanEnum:()=>EI,cleanRegex:()=>Wo,clone:()=>it,cloneDef:()=>uI,createTransparentProxy:()=>yI,defineLazy:()=>ge,esc:()=>Ea,escapeRegex:()=>Ct,explicitlyAborted:()=>fd,extend:()=>wI,finalizeIssue:()=>at,floatSafeRemainder:()=>sd,getElementAtPath:()=>pI,getEnumValues:()=>Bo,getLengthableOrigin:()=>Vo,getParsedType:()=>gI,getSizableOrigin:()=>Ho,hexToUint8Array:()=>AI,isObject:()=>tr,isPlainObject:()=>Tn,issue:()=>$r,joinValues:()=>I,jsonStringifyReplacer:()=>Er,merge:()=>kI,mergeDefs:()=>on,normalizeParams:()=>Z,nullish:()=>Sn,numKeys:()=>fI,objectClone:()=>dI,omit:()=>vI,optionalKeys:()=>pd,parsedType:()=>G,partial:()=>xI,pick:()=>bI,prefixIssues:()=>gt,primitiveTypes:()=>ud,promiseAllObject:()=>hI,propertyKeyTypes:()=>Ko,randomString:()=>mI,required:()=>SI,safeExtend:()=>_I,shallowClone:()=>dd,slugify:()=>cd,stringifyPrimitive:()=>F,uint8ArrayToBase64:()=>Db,uint8ArrayToBase64url:()=>$I,uint8ArrayToHex:()=>II,unwrapMessage:()=>Go});function iI(e){return e}function aI(e){return e}function sI(e){}function cI(e){throw new Error("Unexpected value in exhaustive check")}function lI(e){}function Bo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function I(e,t="|"){return e.map(r=>F(r)).join(t)}function Er(e,t){return typeof t=="bigint"?t.toString():t}function Tr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Sn(e){return e==null}function Wo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function sd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function ge(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Rb)return o===void 0&&(o=Rb,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dI(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function En(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function on(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function uI(e){return on(e._zod.def)}function pI(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function hI(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function mI(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ea(e){return JSON.stringify(e)}function cd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Tn(e){if(tr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dd(e){return Tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function fI(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function yI(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function F(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function pd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function bI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=on(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return En(this,"shape",a),a},checks:[]});return it(e,i)}function vI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=on(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return En(this,"shape",a),a},checks:[]});return it(e,i)}function wI(e,t){if(!Tn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=on(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return En(this,"shape",i),i}});return it(e,n)}function _I(e,t){if(!Tn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=on(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return En(this,"shape",o),o}});return it(e,r)}function kI(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=on(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return En(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,r)}function xI(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=on(t._zod.def,{get shape(){let s=t._zod.def.shape,d={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(d[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)d[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return En(this,"shape",d),d},checks:[]});return it(t,a)}function SI(e,t,r){let o=on(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return En(this,"shape",i),i}});return it(t,o)}function $n(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function fd(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function gt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Go(e){return typeof e=="string"?e:e?.message}function at(e,t,r){let o=e.message?e.message:Go(e.inst?._zod.def?.error?.(e))??Go(t?.error?.(e))??Go(r.customError?.(e))??Go(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Ho(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Vo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function $r(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function EI(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Lb(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Db(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function TI(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Lb(t+r)}function $I(e){return Db(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AI(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function II(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Rb,Ta,ld,gI,Ko,ud,hd,md,ad,oe=w(()=>{er();Rb=Symbol("evaluating");Ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};ld=Tr(()=>{if(Qn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});gI=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ko=new Set(["string","number","symbol"]),ud=new Set(["string","number","bigint","boolean","symbol","undefined"]);hd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},md={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};ad=class{constructor(...t){}}});function Yo(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function qo(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let d=r,l=0;for(;l<s.length;){let p=s[l];l===s.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],l++}}}};return o(e),r}function gd(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let d of n.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(l=>o({issues:l},[...i,...d.path]));else if(d.code==="invalid_key")o({issues:d.issues},[...i,...d.path]);else if(d.code==="invalid_element")o({issues:d.issues},[...i,...d.path]);else{let l=[...i,...d.path];if(l.length===0){r.errors.push(t(d));continue}let p=r,h=0;for(;h<l.length;){let m=l[h],y=h===l.length-1;typeof m=="string"?(p.properties??(p.properties={}),(a=p.properties)[m]??(a[m]={errors:[]}),p=p.properties[m]):(p.items??(p.items=[]),(s=p.items)[m]??(s[m]={errors:[]}),p=p.items[m]),y&&p.errors.push(t(d)),h++}}};return o(e),r}function Mb(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function yd(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Mb(o.path)}`);return t.join(`
|
|
14
|
-
`)}var jb,Zo,yt,bd=w(()=>{er();oe();jb=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zo=k("$ZodError",jb),yt=k("$ZodError",jb,{Parent:Error})});var Ar,$a,Ir,Aa,Cr,vd,Pr,wd,Ia,PI,Ca,OI,Pa,NI,Oa,RI,Na,LI,Ra,DI,La,jI,Da,MI,_d=w(()=>{er();bd();oe();Ar=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Lt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(d=>at(d,i,Oe())));throw Ta(s,n?.callee),s}return a.value},$a=Ar(yt),Ir=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(d=>at(d,i,Oe())));throw Ta(s,n?.callee),s}return a.value},Aa=Ir(yt),Cr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Lt;return i.issues.length?{success:!1,error:new(e??Zo)(i.issues.map(a=>at(a,n,Oe())))}:{success:!0,data:i.value}},vd=Cr(yt),Pr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>at(a,n,Oe())))}:{success:!0,data:i.value}},wd=Pr(yt),Ia=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ar(e)(t,r,n)},PI=Ia(yt),Ca=e=>(t,r,o)=>Ar(e)(t,r,o),OI=Ca(yt),Pa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ir(e)(t,r,n)},NI=Pa(yt),Oa=e=>async(t,r,o)=>Ir(e)(t,r,o),RI=Oa(yt),Na=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Cr(e)(t,r,n)},LI=Na(yt),Ra=e=>(t,r,o)=>Cr(e)(t,r,o),DI=Ra(yt),La=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Pr(e)(t,r,n)},jI=La(yt),Da=e=>async(t,r,o)=>Pr(e)(t,r,o),MI=Da(yt)});var St={};Gt(St,{base64:()=>jd,base64url:()=>ja,bigint:()=>Wd,boolean:()=>Hd,browserEmail:()=>HI,cidrv4:()=>Ld,cidrv6:()=>Dd,cuid:()=>kd,cuid2:()=>xd,date:()=>zd,datetime:()=>Gd,domain:()=>YI,duration:()=>Ad,e164:()=>Ud,email:()=>Cd,emoji:()=>Pd,extendedDuration:()=>UI,guid:()=>Id,hex:()=>qI,hostname:()=>ZI,html5Email:()=>BI,httpProtocol:()=>Md,idnEmail:()=>KI,integer:()=>Kd,ipv4:()=>Od,ipv6:()=>Nd,ksuid:()=>Td,lowercase:()=>Yd,mac:()=>Rd,md5_base64:()=>XI,md5_base64url:()=>QI,md5_hex:()=>JI,nanoid:()=>$d,null:()=>Vd,number:()=>Ma,rfc5322Email:()=>WI,sha1_base64:()=>tC,sha1_base64url:()=>nC,sha1_hex:()=>eC,sha256_base64:()=>oC,sha256_base64url:()=>iC,sha256_hex:()=>rC,sha384_base64:()=>sC,sha384_base64url:()=>cC,sha384_hex:()=>aC,sha512_base64:()=>dC,sha512_base64url:()=>uC,sha512_hex:()=>lC,string:()=>Bd,time:()=>Fd,ulid:()=>Sd,undefined:()=>Zd,unicodeEmail:()=>Ub,uppercase:()=>qd,uuid:()=>nr,uuid4:()=>zI,uuid6:()=>FI,uuid7:()=>GI,xid:()=>Ed});function Pd(){return new RegExp(VI,"u")}function Fb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fd(e){return new RegExp(`^${Fb(e)}$`)}function Gd(e){let t=Fb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${zb}T(?:${o})$`)}function Jo(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Xo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var kd,xd,Sd,Ed,Td,$d,Ad,UI,Id,nr,zI,FI,GI,Cd,BI,WI,Ub,KI,HI,VI,Od,Nd,Rd,Ld,Dd,jd,ja,ZI,YI,Md,Ud,zb,zd,Bd,Wd,Kd,Ma,Hd,Vd,Zd,Yd,qd,qI,JI,XI,QI,eC,tC,nC,rC,oC,iC,aC,sC,cC,lC,dC,uC,Ua=w(()=>{oe();kd=/^[cC][0-9a-z]{6,}$/,xd=/^[0-9a-z]+$/,Sd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ed=/^[0-9a-vA-V]{20}$/,Td=/^[A-Za-z0-9]{27}$/,$d=/^[a-zA-Z0-9_-]{21}$/,Ad=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UI=/^[-+]?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)?)??$/,Id=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,zI=nr(4),FI=nr(6),GI=nr(7),Cd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,WI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Ub=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,KI=Ub,HI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,VI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Od=/^(?:(?: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])$/,Nd=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Rd=e=>{let t=Ct(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ld=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Dd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ja=/^[A-Za-z0-9_-]*$/,ZI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,YI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Md=/^https?$/,Ud=/^\+[1-9]\d{6,14}$/,zb="(?:(?:\\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])))",zd=new RegExp(`^${zb}$`);Bd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Wd=/^-?\d+n?$/,Kd=/^-?\d+$/,Ma=/^-?\d+(?:\.\d+)?$/,Hd=/^(?:true|false)$/i,Vd=/^null$/i,Zd=/^undefined$/i,Yd=/^[^A-Z]*$/,qd=/^[^a-z]*$/,qI=/^[0-9a-fA-F]*$/;JI=/^[0-9a-fA-F]{32}$/,XI=Jo(22,"=="),QI=Xo(22),eC=/^[0-9a-fA-F]{40}$/,tC=Jo(27,"="),nC=Xo(27),rC=/^[0-9a-fA-F]{64}$/,oC=Jo(43,"="),iC=Xo(43),aC=/^[0-9a-fA-F]{96}$/,sC=Jo(64,""),cC=Xo(64),lC=/^[0-9a-fA-F]{128}$/,dC=Jo(86,"=="),uC=Xo(86)});function Gb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues))}var Ee,Bb,za,Fa,Jd,Xd,Qd,eu,tu,nu,ru,ou,iu,Or,au,su,cu,lu,du,uu,pu,hu,mu,Ga=w(()=>{er();Ua();oe();Ee=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Bb={number:"number",bigint:"bigint",object:"date"},za=k("$ZodCheckLessThan",(e,t)=>{Ee.init(e,t);let r=Bb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=k("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=Bb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jd=k("$ZodCheckMultipleOf",(e,t)=>{Ee.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):sd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Xd=k("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=hd[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Kd)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Qd=k("$ZodCheckBigIntFormat",(e,t)=>{Ee.init(e,t);let[r,o]=md[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eu=k("$ZodCheckMaxSize",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Ho(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tu=k("$ZodCheckMinSize",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Ho(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nu=k("$ZodCheckSizeEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Ho(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ru=k("$ZodCheckMaxLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Vo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ou=k("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Vo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),iu=k("$ZodCheckLengthEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Vo(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Or=k("$ZodCheckStringFormat",(e,t)=>{var r,o;Ee.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),au=k("$ZodCheckRegex",(e,t)=>{Or.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),su=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yd),Or.init(e,t)}),cu=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qd),Or.init(e,t)}),lu=k("$ZodCheckIncludes",(e,t)=>{Ee.init(e,t);let r=Ct(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),du=k("$ZodCheckStartsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`^${Ct(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),uu=k("$ZodCheckEndsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`.*${Ct(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});pu=k("$ZodCheckProperty",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Gb(n,r,t.property));Gb(o,r,t.property)}}),hu=k("$ZodCheckMimeType",(e,t)=>{Ee.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),mu=k("$ZodCheckOverwrite",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Qo,fu=w(()=>{Qo=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
13
|
+
var QA=Object.defineProperty;var w=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var Gt=(e,t)=>{for(var r in t)QA(e,r,{get:t[r],enumerable:!0})};function Xn(e,t={}){let r=e?.trim()||Sr;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var Sr,Fo=w(()=>{"use strict";Sr="Round"});function qe(e){return iI[e]??e}function Ob(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=qe(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Bt,iI,nd,Nb,rn=w(()=>{"use strict";Bt=["hunt","push","group","predict","bingo","shoot","place"],iI={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};nd={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element"},Nb={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face"}});function k(e,t,r){function o(s,d){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,d);let l=a.prototype,p=Object.keys(l);for(let h=0;h<p.length;h++){let m=p[h];m in s||(s[m]=l[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var d;let l=r?.Parent?new i:this;o(l,s),(d=l._zod).deferred??(d.deferred=[]);for(let p of l._zod.deferred)p();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Oe(e){return e&&Object.assign(Qn,e),Qn}var Rb,rd,od,Lt,xn,Qn,er=w(()=>{rd=Object.freeze({status:"aborted"});od=Symbol("zod_brand"),Lt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Rb=globalThis).__zod_globalConfig??(Rb.__zod_globalConfig={});Qn=globalThis.__zod_globalConfig});var W={};Gt(W,{BIGINT_FORMAT_RANGES:()=>md,Class:()=>ad,NUMBER_FORMAT_RANGES:()=>hd,aborted:()=>$n,allowsEval:()=>ld,assert:()=>dI,assertEqual:()=>aI,assertIs:()=>cI,assertNever:()=>lI,assertNotEqual:()=>sI,assignProp:()=>En,base64ToUint8Array:()=>Db,base64urlToUint8Array:()=>$I,cached:()=>Tr,captureStackTrace:()=>Ta,cleanEnum:()=>TI,cleanRegex:()=>Wo,clone:()=>it,cloneDef:()=>pI,createTransparentProxy:()=>bI,defineLazy:()=>ge,esc:()=>Ea,escapeRegex:()=>Ct,explicitlyAborted:()=>fd,extend:()=>_I,finalizeIssue:()=>at,floatSafeRemainder:()=>sd,getElementAtPath:()=>hI,getEnumValues:()=>Bo,getLengthableOrigin:()=>Vo,getParsedType:()=>yI,getSizableOrigin:()=>Ho,hexToUint8Array:()=>II,isObject:()=>tr,isPlainObject:()=>Tn,issue:()=>$r,joinValues:()=>I,jsonStringifyReplacer:()=>Er,merge:()=>xI,mergeDefs:()=>on,normalizeParams:()=>Z,nullish:()=>Sn,numKeys:()=>gI,objectClone:()=>uI,omit:()=>wI,optionalKeys:()=>pd,parsedType:()=>G,partial:()=>SI,pick:()=>vI,prefixIssues:()=>gt,primitiveTypes:()=>ud,promiseAllObject:()=>mI,propertyKeyTypes:()=>Ko,randomString:()=>fI,required:()=>EI,safeExtend:()=>kI,shallowClone:()=>dd,slugify:()=>cd,stringifyPrimitive:()=>F,uint8ArrayToBase64:()=>jb,uint8ArrayToBase64url:()=>AI,uint8ArrayToHex:()=>CI,unwrapMessage:()=>Go});function aI(e){return e}function sI(e){return e}function cI(e){}function lI(e){throw new Error("Unexpected value in exhaustive check")}function dI(e){}function Bo(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function I(e,t="|"){return e.map(r=>F(r)).join(t)}function Er(e,t){return typeof t=="bigint"?t.toString():t}function Tr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Sn(e){return e==null}function Wo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function sd(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function ge(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Lb)return o===void 0&&(o=Lb,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function uI(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function En(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function on(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function pI(e){return on(e._zod.def)}function hI(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function mI(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function fI(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Ea(e){return JSON.stringify(e)}function cd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Tn(e){if(tr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dd(e){return Tn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function gI(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bI(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function F(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function pd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=on(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return En(this,"shape",a),a},checks:[]});return it(e,i)}function wI(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=on(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return En(this,"shape",a),a},checks:[]});return it(e,i)}function _I(e,t){if(!Tn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=on(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return En(this,"shape",i),i}});return it(e,n)}function kI(e,t){if(!Tn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=on(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return En(this,"shape",o),o}});return it(e,r)}function xI(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=on(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return En(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return it(e,r)}function SI(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=on(t._zod.def,{get shape(){let s=t._zod.def.shape,d={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(d[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)d[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return En(this,"shape",d),d},checks:[]});return it(t,a)}function EI(e,t,r){let o=on(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return En(this,"shape",i),i}});return it(t,o)}function $n(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function fd(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function gt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Go(e){return typeof e=="string"?e:e?.message}function at(e,t,r){let o=e.message?e.message:Go(e.inst?._zod.def?.error?.(e))??Go(t?.error?.(e))??Go(r.customError?.(e))??Go(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function Ho(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Vo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function G(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function $r(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function TI(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Db(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function jb(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function $I(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Db(t+r)}function AI(e){return jb(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function II(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function CI(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Lb,Ta,ld,yI,Ko,ud,hd,md,ad,oe=w(()=>{er();Lb=Symbol("evaluating");Ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};ld=Tr(()=>{if(Qn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});yI=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ko=new Set(["string","number","symbol"]),ud=new Set(["string","number","bigint","boolean","symbol","undefined"]);hd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},md={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};ad=class{constructor(...t){}}});function Yo(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function qo(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let d=r,l=0;for(;l<s.length;){let p=s[l];l===s.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(t(a))):d[p]=d[p]||{_errors:[]},d=d[p],l++}}}};return o(e),r}function gd(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let d of n.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(l=>o({issues:l},[...i,...d.path]));else if(d.code==="invalid_key")o({issues:d.issues},[...i,...d.path]);else if(d.code==="invalid_element")o({issues:d.issues},[...i,...d.path]);else{let l=[...i,...d.path];if(l.length===0){r.errors.push(t(d));continue}let p=r,h=0;for(;h<l.length;){let m=l[h],y=h===l.length-1;typeof m=="string"?(p.properties??(p.properties={}),(a=p.properties)[m]??(a[m]={errors:[]}),p=p.properties[m]):(p.items??(p.items=[]),(s=p.items)[m]??(s[m]={errors:[]}),p=p.items[m]),y&&p.errors.push(t(d)),h++}}};return o(e),r}function Ub(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function yd(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Ub(o.path)}`);return t.join(`
|
|
14
|
+
`)}var Mb,Zo,yt,bd=w(()=>{er();oe();Mb=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Er,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zo=k("$ZodError",Mb),yt=k("$ZodError",Mb,{Parent:Error})});var Ar,$a,Ir,Aa,Cr,vd,Pr,wd,Ia,OI,Ca,NI,Pa,RI,Oa,LI,Na,DI,Ra,jI,La,MI,Da,UI,_d=w(()=>{er();bd();oe();Ar=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Lt;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(d=>at(d,i,Oe())));throw Ta(s,n?.callee),s}return a.value},$a=Ar(yt),Ir=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(d=>at(d,i,Oe())));throw Ta(s,n?.callee),s}return a.value},Aa=Ir(yt),Cr=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Lt;return i.issues.length?{success:!1,error:new(e??Zo)(i.issues.map(a=>at(a,n,Oe())))}:{success:!0,data:i.value}},vd=Cr(yt),Pr=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>at(a,n,Oe())))}:{success:!0,data:i.value}},wd=Pr(yt),Ia=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ar(e)(t,r,n)},OI=Ia(yt),Ca=e=>(t,r,o)=>Ar(e)(t,r,o),NI=Ca(yt),Pa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ir(e)(t,r,n)},RI=Pa(yt),Oa=e=>async(t,r,o)=>Ir(e)(t,r,o),LI=Oa(yt),Na=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Cr(e)(t,r,n)},DI=Na(yt),Ra=e=>(t,r,o)=>Cr(e)(t,r,o),jI=Ra(yt),La=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Pr(e)(t,r,n)},MI=La(yt),Da=e=>async(t,r,o)=>Pr(e)(t,r,o),UI=Da(yt)});var St={};Gt(St,{base64:()=>jd,base64url:()=>ja,bigint:()=>Wd,boolean:()=>Hd,browserEmail:()=>VI,cidrv4:()=>Ld,cidrv6:()=>Dd,cuid:()=>kd,cuid2:()=>xd,date:()=>zd,datetime:()=>Gd,domain:()=>qI,duration:()=>Ad,e164:()=>Ud,email:()=>Cd,emoji:()=>Pd,extendedDuration:()=>zI,guid:()=>Id,hex:()=>JI,hostname:()=>YI,html5Email:()=>WI,httpProtocol:()=>Md,idnEmail:()=>HI,integer:()=>Kd,ipv4:()=>Od,ipv6:()=>Nd,ksuid:()=>Td,lowercase:()=>Yd,mac:()=>Rd,md5_base64:()=>QI,md5_base64url:()=>eC,md5_hex:()=>XI,nanoid:()=>$d,null:()=>Vd,number:()=>Ma,rfc5322Email:()=>KI,sha1_base64:()=>nC,sha1_base64url:()=>rC,sha1_hex:()=>tC,sha256_base64:()=>iC,sha256_base64url:()=>aC,sha256_hex:()=>oC,sha384_base64:()=>cC,sha384_base64url:()=>lC,sha384_hex:()=>sC,sha512_base64:()=>uC,sha512_base64url:()=>pC,sha512_hex:()=>dC,string:()=>Bd,time:()=>Fd,ulid:()=>Sd,undefined:()=>Zd,unicodeEmail:()=>zb,uppercase:()=>qd,uuid:()=>nr,uuid4:()=>FI,uuid6:()=>GI,uuid7:()=>BI,xid:()=>Ed});function Pd(){return new RegExp(ZI,"u")}function Gb(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fd(e){return new RegExp(`^${Gb(e)}$`)}function Gd(e){let t=Gb({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Fb}T(?:${o})$`)}function Jo(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Xo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var kd,xd,Sd,Ed,Td,$d,Ad,zI,Id,nr,FI,GI,BI,Cd,WI,KI,zb,HI,VI,ZI,Od,Nd,Rd,Ld,Dd,jd,ja,YI,qI,Md,Ud,Fb,zd,Bd,Wd,Kd,Ma,Hd,Vd,Zd,Yd,qd,JI,XI,QI,eC,tC,nC,rC,oC,iC,aC,sC,cC,lC,dC,uC,pC,Ua=w(()=>{oe();kd=/^[cC][0-9a-z]{6,}$/,xd=/^[0-9a-z]+$/,Sd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ed=/^[0-9a-vA-V]{20}$/,Td=/^[A-Za-z0-9]{27}$/,$d=/^[a-zA-Z0-9_-]{21}$/,Ad=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zI=/^[-+]?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)?)??$/,Id=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,FI=nr(4),GI=nr(6),BI=nr(7),Cd=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,WI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,KI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,zb=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,HI=zb,VI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ZI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Od=/^(?:(?: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])$/,Nd=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Rd=e=>{let t=Ct(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ld=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Dd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ja=/^[A-Za-z0-9_-]*$/,YI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,qI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Md=/^https?$/,Ud=/^\+[1-9]\d{6,14}$/,Fb="(?:(?:\\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])))",zd=new RegExp(`^${Fb}$`);Bd=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Wd=/^-?\d+n?$/,Kd=/^-?\d+$/,Ma=/^-?\d+(?:\.\d+)?$/,Hd=/^(?:true|false)$/i,Vd=/^null$/i,Zd=/^undefined$/i,Yd=/^[^A-Z]*$/,qd=/^[^a-z]*$/,JI=/^[0-9a-fA-F]*$/;XI=/^[0-9a-fA-F]{32}$/,QI=Jo(22,"=="),eC=Xo(22),tC=/^[0-9a-fA-F]{40}$/,nC=Jo(27,"="),rC=Xo(27),oC=/^[0-9a-fA-F]{64}$/,iC=Jo(43,"="),aC=Xo(43),sC=/^[0-9a-fA-F]{96}$/,cC=Jo(64,""),lC=Xo(64),dC=/^[0-9a-fA-F]{128}$/,uC=Jo(86,"=="),pC=Xo(86)});function Bb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues))}var Ee,Wb,za,Fa,Jd,Xd,Qd,eu,tu,nu,ru,ou,iu,Or,au,su,cu,lu,du,uu,pu,hu,mu,Ga=w(()=>{er();Ua();oe();Ee=k("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Wb={number:"number",bigint:"bigint",object:"date"},za=k("$ZodCheckLessThan",(e,t)=>{Ee.init(e,t);let r=Wb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=k("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=Wb[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jd=k("$ZodCheckMultipleOf",(e,t)=>{Ee.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):sd(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Xd=k("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=hd[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Kd)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Qd=k("$ZodCheckBigIntFormat",(e,t)=>{Ee.init(e,t);let[r,o]=md[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),eu=k("$ZodCheckMaxSize",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Ho(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tu=k("$ZodCheckMinSize",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Ho(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nu=k("$ZodCheckSizeEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Ho(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ru=k("$ZodCheckMaxLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Vo(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ou=k("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Vo(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),iu=k("$ZodCheckLengthEquals",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Sn(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Vo(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Or=k("$ZodCheckStringFormat",(e,t)=>{var r,o;Ee.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),au=k("$ZodCheckRegex",(e,t)=>{Or.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),su=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Yd),Or.init(e,t)}),cu=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=qd),Or.init(e,t)}),lu=k("$ZodCheckIncludes",(e,t)=>{Ee.init(e,t);let r=Ct(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),du=k("$ZodCheckStartsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`^${Ct(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),uu=k("$ZodCheckEndsWith",(e,t)=>{Ee.init(e,t);let r=new RegExp(`.*${Ct(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});pu=k("$ZodCheckProperty",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Bb(n,r,t.property));Bb(o,r,t.property)}}),hu=k("$ZodCheckMimeType",(e,t)=>{Ee.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),mu=k("$ZodCheckOverwrite",(e,t)=>{Ee.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Qo,fu=w(()=>{Qo=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
15
15
|
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
16
|
-
`))}}});var gu,yu=w(()=>{gu={major:4,minor:4,patch:3}});function Uu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function iv(e){if(!ja.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Uu(r)}function av(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function Kb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues)),t.value[r]=e.value}function Ha(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...gt(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function sv(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=pd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function cv(e,t,r,o,n,i){let a=[],s=n.keySet,d=n.catchall._zod,l=d.def.type,p=d.optin==="optional",h=d.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(l==="never"){a.push(m);continue}let y=d.run({value:t[m],issues:[]},o);y instanceof Promise?e.push(y.then(x=>Ha(x,r,m,t,p,h))):Ha(y,r,m,t,p,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Hb(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!$n(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>at(a,o,Oe())))}),t)}function Vb(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>at(a,o,Oe())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function bu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tn(e)&&Tn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=bu(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=bu(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Zb(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let d of s.keys)o.has(d)||o.set(d,{}),o.get(d).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let d of s.keys)o.has(d)||o.set(d,{}),o.get(d).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),$n(e))return e;let a=bu(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function Yb(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function qb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues)),t.value[r]=e.value}function Jb(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...gt(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Xb(e,t,r,o,n,i,a){e.issues.length&&(Ko.has(typeof o)?r.issues.push(...gt(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>at(s,a,Oe()))})),t.issues.length&&(Ko.has(typeof o)?r.issues.push(...gt(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>at(s,a,Oe()))})),r.value.set(e.value,t.value)}function Qb(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function ev(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function tv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function nv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Ba(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Wa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ka(e,i,t.out,r)):Ka(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ka(e,i,t.in,r)):Ka(e,n,t.in,r)}}function Ka(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function rv(e){return e.value=Object.freeze(e.value),e}function ov(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push($r(n))}}var de,rr,ke,vu,wu,_u,ku,xu,Su,Eu,Tu,$u,Au,Iu,Cu,Pu,Ou,Nu,Ru,Lu,Du,ju,Mu,zu,Fu,Gu,Bu,Wu,Va,Ku,ei,Za,Hu,Vu,Zu,Yu,qu,Ju,Xu,Qu,ep,tp,lv,np,ti,rp,op,ip,Ya,ap,sp,cp,lp,dp,up,pp,qa,hp,mp,fp,gp,yp,bp,vp,wp,Ja,ni,_p,kp,xp,Sp,Ep,Tp,$p,Ap=w(()=>{Ga();er();fu();_d();Ua();oe();yu();oe();de=k("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gu;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,d)=>{let l=$n(a),p;for(let h of s){if(h._zod.def.when){if(fd(a)||!h._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&d?.async===!1)throw new Lt;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(l||(l=$n(a,m)))});else{if(a.issues.length===m)continue;l||(l=$n(a,m))}}return p?p.then(()=>a):a},i=(a,s,d)=>{if($n(a))return a.aborted=!0,a;let l=n(s,o,d);if(l instanceof Promise){if(d.async===!1)throw new Lt;return l.then(p=>e._zod.parse(p,d))}return e._zod.parse(l,d)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(p=>i(p,a,s)):i(l,a,s)}let d=e._zod.parse(a,s);if(d instanceof Promise){if(s.async===!1)throw new Lt;return d.then(l=>n(l,o,s))}return n(d,o,s)}}ge(e,"~standard",()=>({validate:n=>{try{let i=vd(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return wd(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),rr=k("$ZodString",(e,t)=>{de.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ke=k("$ZodStringFormat",(e,t)=>{Or.init(e,t),rr.init(e,t)}),vu=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Id),ke.init(e,t)}),wu=k("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nr(o))}else t.pattern??(t.pattern=nr());ke.init(e,t)}),_u=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Cd),ke.init(e,t)}),ku=k("$ZodURL",(e,t)=>{ke.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Md.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),xu=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pd()),ke.init(e,t)}),Su=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$d),ke.init(e,t)}),Eu=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=kd),ke.init(e,t)}),Tu=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xd),ke.init(e,t)}),$u=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Sd),ke.init(e,t)}),Au=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ed),ke.init(e,t)}),Iu=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Td),ke.init(e,t)}),Cu=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Gd(t)),ke.init(e,t)}),Pu=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zd),ke.init(e,t)}),Ou=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Fd(t)),ke.init(e,t)}),Nu=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ad),ke.init(e,t)}),Ru=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Od),ke.init(e,t),e._zod.bag.format="ipv4"}),Lu=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Nd),ke.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Du=k("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Rd(t.delimiter)),ke.init(e,t),e._zod.bag.format="mac"}),ju=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ld),ke.init(e,t)}),Mu=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Dd),ke.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});zu=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=jd),ke.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Uu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Fu=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ja),ke.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{iv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Gu=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ud),ke.init(e,t)});Bu=k("$ZodJWT",(e,t)=>{ke.init(e,t),e._zod.check=r=>{av(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Wu=k("$ZodCustomStringFormat",(e,t)=>{ke.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Va=k("$ZodNumber",(e,t)=>{de.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ma,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Ku=k("$ZodNumberFormat",(e,t)=>{Xd.init(e,t),Va.init(e,t)}),ei=k("$ZodBoolean",(e,t)=>{de.init(e,t),e._zod.pattern=Hd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Za=k("$ZodBigInt",(e,t)=>{de.init(e,t),e._zod.pattern=Wd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Hu=k("$ZodBigIntFormat",(e,t)=>{Qd.init(e,t),Za.init(e,t)}),Vu=k("$ZodSymbol",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Zu=k("$ZodUndefined",(e,t)=>{de.init(e,t),e._zod.pattern=Zd,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Yu=k("$ZodNull",(e,t)=>{de.init(e,t),e._zod.pattern=Vd,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),qu=k("$ZodAny",(e,t)=>{de.init(e,t),e._zod.parse=r=>r}),Ju=k("$ZodUnknown",(e,t)=>{de.init(e,t),e._zod.parse=r=>r}),Xu=k("$ZodNever",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Qu=k("$ZodVoid",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ep=k("$ZodDate",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});tp=k("$ZodArray",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],d=t.element._zod.run({value:s,issues:[]},o);d instanceof Promise?i.push(d.then(l=>Kb(l,r,a))):Kb(d,r,a)}return i.length?Promise.all(i).then(()=>r):r}});lv=k("$ZodObject",(e,t)=>{if(de.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let d={...s};return Object.defineProperty(t,"shape",{value:d}),d}})}let o=Tr(()=>sv(t));ge(e._zod,"propValues",()=>{let s=t.shape,d={};for(let l in s){let p=s[l]._zod;if(p.values){d[l]??(d[l]=new Set);for(let h of p.values)d[l].add(h)}}return d});let n=tr,i=t.catchall,a;e._zod.parse=(s,d)=>{a??(a=o.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let p=[],h=a.shape;for(let m of a.keys){let y=h[m],x=y._zod.optin==="optional",O=y._zod.optout==="optional",M=y._zod.run({value:l[m],issues:[]},d);M instanceof Promise?p.push(M.then(H=>Ha(H,s,m,l,x,O))):Ha(M,s,m,l,x,O)}return i?cv(p,l,s,d,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),np=k("$ZodObjectJIT",(e,t)=>{lv.init(e,t);let r=e._zod.parse,o=Tr(()=>sv(t)),n=m=>{let y=new Qo(["shape","payload","ctx"]),x=o.value,O=_=>{let b=Ea(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};y.write("const input = payload.value;");let M=Object.create(null),H=0;for(let _ of x.keys)M[_]=`key_${H++}`;y.write("const newResult = {};");for(let _ of x.keys){let b=M[_],v=Ea(_),j=m[_],Y=j?._zod?.optin==="optional",X=j?._zod?.optout==="optional";y.write(`const ${b} = ${O(_)};`),Y&&X?y.write(`
|
|
16
|
+
`))}}});var gu,yu=w(()=>{gu={major:4,minor:4,patch:3}});function Uu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function av(e){if(!ja.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Uu(r)}function sv(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function Hb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues)),t.value[r]=e.value}function Ha(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...gt(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function cv(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=pd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function lv(e,t,r,o,n,i){let a=[],s=n.keySet,d=n.catchall._zod,l=d.def.type,p=d.optin==="optional",h=d.optout==="optional";for(let m in t){if(m==="__proto__"||s.has(m))continue;if(l==="never"){a.push(m);continue}let y=d.run({value:t[m],issues:[]},o);y instanceof Promise?e.push(y.then(x=>Ha(x,r,m,t,p,h))):Ha(y,r,m,t,p,h)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function Vb(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!$n(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>at(a,o,Oe())))}),t)}function Zb(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>at(a,o,Oe())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function bu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tn(e)&&Tn(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=bu(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=bu(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Yb(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let d of s.keys)o.has(d)||o.set(d,{}),o.get(d).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let d of s.keys)o.has(d)||o.set(d,{}),o.get(d).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),$n(e))return e;let a=bu(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function qb(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Jb(e,t,r){e.issues.length&&t.issues.push(...gt(r,e.issues)),t.value[r]=e.value}function Xb(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...gt(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function Qb(e,t,r,o,n,i,a){e.issues.length&&(Ko.has(typeof o)?r.issues.push(...gt(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>at(s,a,Oe()))})),t.issues.length&&(Ko.has(typeof o)?r.issues.push(...gt(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>at(s,a,Oe()))})),r.value.set(e.value,t.value)}function ev(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function tv(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function nv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function rv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Ba(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Wa(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ka(e,i,t.out,r)):Ka(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ka(e,i,t.in,r)):Ka(e,n,t.in,r)}}function Ka(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function ov(e){return e.value=Object.freeze(e.value),e}function iv(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push($r(n))}}var de,rr,ke,vu,wu,_u,ku,xu,Su,Eu,Tu,$u,Au,Iu,Cu,Pu,Ou,Nu,Ru,Lu,Du,ju,Mu,zu,Fu,Gu,Bu,Wu,Va,Ku,ei,Za,Hu,Vu,Zu,Yu,qu,Ju,Xu,Qu,ep,tp,dv,np,ti,rp,op,ip,Ya,ap,sp,cp,lp,dp,up,pp,qa,hp,mp,fp,gp,yp,bp,vp,wp,Ja,ni,_p,kp,xp,Sp,Ep,Tp,$p,Ap=w(()=>{Ga();er();fu();_d();Ua();oe();yu();oe();de=k("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gu;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,d)=>{let l=$n(a),p;for(let h of s){if(h._zod.def.when){if(fd(a)||!h._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,y=h._zod.check(a);if(y instanceof Promise&&d?.async===!1)throw new Lt;if(p||y instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await y,a.issues.length!==m&&(l||(l=$n(a,m)))});else{if(a.issues.length===m)continue;l||(l=$n(a,m))}}return p?p.then(()=>a):a},i=(a,s,d)=>{if($n(a))return a.aborted=!0,a;let l=n(s,o,d);if(l instanceof Promise){if(d.async===!1)throw new Lt;return l.then(p=>e._zod.parse(p,d))}return e._zod.parse(l,d)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(p=>i(p,a,s)):i(l,a,s)}let d=e._zod.parse(a,s);if(d instanceof Promise){if(s.async===!1)throw new Lt;return d.then(l=>n(l,o,s))}return n(d,o,s)}}ge(e,"~standard",()=>({validate:n=>{try{let i=vd(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return wd(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),rr=k("$ZodString",(e,t)=>{de.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bd(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ke=k("$ZodStringFormat",(e,t)=>{Or.init(e,t),rr.init(e,t)}),vu=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Id),ke.init(e,t)}),wu=k("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nr(o))}else t.pattern??(t.pattern=nr());ke.init(e,t)}),_u=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Cd),ke.init(e,t)}),ku=k("$ZodURL",(e,t)=>{ke.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Md.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),xu=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Pd()),ke.init(e,t)}),Su=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$d),ke.init(e,t)}),Eu=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=kd),ke.init(e,t)}),Tu=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xd),ke.init(e,t)}),$u=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Sd),ke.init(e,t)}),Au=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ed),ke.init(e,t)}),Iu=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Td),ke.init(e,t)}),Cu=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Gd(t)),ke.init(e,t)}),Pu=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zd),ke.init(e,t)}),Ou=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Fd(t)),ke.init(e,t)}),Nu=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ad),ke.init(e,t)}),Ru=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Od),ke.init(e,t),e._zod.bag.format="ipv4"}),Lu=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Nd),ke.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Du=k("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Rd(t.delimiter)),ke.init(e,t),e._zod.bag.format="mac"}),ju=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ld),ke.init(e,t)}),Mu=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Dd),ke.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});zu=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=jd),ke.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Uu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Fu=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ja),ke.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{av(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Gu=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ud),ke.init(e,t)});Bu=k("$ZodJWT",(e,t)=>{ke.init(e,t),e._zod.check=r=>{sv(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Wu=k("$ZodCustomStringFormat",(e,t)=>{ke.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Va=k("$ZodNumber",(e,t)=>{de.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ma,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Ku=k("$ZodNumberFormat",(e,t)=>{Xd.init(e,t),Va.init(e,t)}),ei=k("$ZodBoolean",(e,t)=>{de.init(e,t),e._zod.pattern=Hd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Za=k("$ZodBigInt",(e,t)=>{de.init(e,t),e._zod.pattern=Wd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Hu=k("$ZodBigIntFormat",(e,t)=>{Qd.init(e,t),Za.init(e,t)}),Vu=k("$ZodSymbol",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Zu=k("$ZodUndefined",(e,t)=>{de.init(e,t),e._zod.pattern=Zd,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Yu=k("$ZodNull",(e,t)=>{de.init(e,t),e._zod.pattern=Vd,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),qu=k("$ZodAny",(e,t)=>{de.init(e,t),e._zod.parse=r=>r}),Ju=k("$ZodUnknown",(e,t)=>{de.init(e,t),e._zod.parse=r=>r}),Xu=k("$ZodNever",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Qu=k("$ZodVoid",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),ep=k("$ZodDate",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});tp=k("$ZodArray",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],d=t.element._zod.run({value:s,issues:[]},o);d instanceof Promise?i.push(d.then(l=>Hb(l,r,a))):Hb(d,r,a)}return i.length?Promise.all(i).then(()=>r):r}});dv=k("$ZodObject",(e,t)=>{if(de.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let d={...s};return Object.defineProperty(t,"shape",{value:d}),d}})}let o=Tr(()=>cv(t));ge(e._zod,"propValues",()=>{let s=t.shape,d={};for(let l in s){let p=s[l]._zod;if(p.values){d[l]??(d[l]=new Set);for(let h of p.values)d[l].add(h)}}return d});let n=tr,i=t.catchall,a;e._zod.parse=(s,d)=>{a??(a=o.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let p=[],h=a.shape;for(let m of a.keys){let y=h[m],x=y._zod.optin==="optional",O=y._zod.optout==="optional",M=y._zod.run({value:l[m],issues:[]},d);M instanceof Promise?p.push(M.then(H=>Ha(H,s,m,l,x,O))):Ha(M,s,m,l,x,O)}return i?lv(p,l,s,d,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),np=k("$ZodObjectJIT",(e,t)=>{dv.init(e,t);let r=e._zod.parse,o=Tr(()=>cv(t)),n=m=>{let y=new Qo(["shape","payload","ctx"]),x=o.value,O=_=>{let b=Ea(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};y.write("const input = payload.value;");let M=Object.create(null),H=0;for(let _ of x.keys)M[_]=`key_${H++}`;y.write("const newResult = {};");for(let _ of x.keys){let b=M[_],v=Ea(_),j=m[_],Y=j?._zod?.optin==="optional",X=j?._zod?.optout==="optional";y.write(`const ${b} = ${O(_)};`),Y&&X?y.write(`
|
|
17
17
|
if (${b}.issues.length) {
|
|
18
18
|
if (${v} in input) {
|
|
19
19
|
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
@@ -72,16 +72,16 @@ var XA=Object.defineProperty;var w=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
`)}y.write("payload.value = newResult;"),y.write("return payload;");let T=y.compile();return(_,b)=>T(m,_,b)},i,a=tr,s=!Qn.jitless,l=s&&ld.value,p=t.catchall,h;e._zod.parse=(m,y)=>{h??(h=o.value);let x=m.value;return a(x)?s&&l&&y?.async===!1&&y.jitless!==!0?(i||(i=n(t.shape)),m=i(m,y),p?cv([],x,m,y,h,e):m):r(m,y):(m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m)}});ti=k("$ZodUnion",(e,t)=>{de.init(e,t),ge(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ge(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ge(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ge(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Wo(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let d=s._zod.run({value:o.value,issues:[]},n);if(d instanceof Promise)a.push(d),i=!0;else{if(d.issues.length===0)return d;a.push(d)}}return i?Promise.all(a).then(s=>Hb(s,o,e,n)):Hb(a,o,e,n)}});rp=k("$ZodXor",(e,t)=>{ti.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let d=s._zod.run({value:o.value,issues:[]},n);d instanceof Promise?(a.push(d),i=!0):a.push(d)}return i?Promise.all(a).then(s=>Vb(s,o,e,n)):Vb(a,o,e,n)}}),op=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ti.init(e,t);let r=e._zod.parse;ge(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,d]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of d)n[s].add(l)}}return n});let o=Tr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of s){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!tr(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),ip=k("$ZodIntersection",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([d,l])=>Zb(r,d,l)):Zb(r,i,a)}});Ya=k("$ZodTuple",(e,t)=>{de.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=Yb(r,"optin"),d=Yb(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let l=new Array(r.length);for(let p=0;p<r.length;p++){let h=r[p]._zod.run({value:i[p],issues:[]},n);h instanceof Promise?a.push(h.then(m=>{l[p]=m})):l[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let m of h){p++;let y=t.rest._zod.run({value:m,issues:[]},n);y instanceof Promise?a.push(y.then(x=>qb(x,o,p))):qb(y,o,p)}}return a.length?Promise.all(a).then(()=>Jb(l,o,r,i,d)):Jb(l,o,r,i,d)}});ap=k("$ZodRecord",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Tn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let p=t.keyType._zod.run({value:l,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>at(y,o,Oe())),input:l,path:[l],inst:e});continue}let h=p.value,m=t.valueType._zod.run({value:n[l],issues:[]},o);m instanceof Promise?i.push(m.then(y=>{y.issues.length&&r.issues.push(...gt(l,y.issues)),r.value[h]=y.value})):(m.issues.length&&r.issues.push(...gt(l,m.issues)),r.value[h]=m.value)}let d;for(let l in n)s.has(l)||(d=d??[],d.push(l));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:d})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let d=t.keyType._zod.run({value:s,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Ma.test(s)&&d.issues.length){let h=t.keyType._zod.run({value:Number(s),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>at(h,o,Oe())),input:s,path:[s],inst:e});continue}let p=t.valueType._zod.run({value:n[s],issues:[]},o);p instanceof Promise?i.push(p.then(h=>{h.issues.length&&r.issues.push(...gt(s,h.issues)),r.value[d.value]=h.value})):(p.issues.length&&r.issues.push(...gt(s,p.issues)),r.value[d.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),sp=k("$ZodMap",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let d=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);d instanceof Promise||l instanceof Promise?i.push(Promise.all([d,l]).then(([p,h])=>{Xb(p,h,r,a,n,e,o)})):Xb(d,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});cp=k("$ZodSet",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(d=>Qb(d,r))):Qb(s,r)}return i.length?Promise.all(i).then(()=>r):r}});lp=k("$ZodEnum",(e,t)=>{de.init(e,t);let r=Bo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ko.has(typeof n)).map(n=>typeof n=="string"?Ct(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),dp=k("$ZodLiteral",(e,t)=>{if(de.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ct(o):o?Ct(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),up=k("$ZodFile",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),pp=k("$ZodTransform",(e,t)=>{de.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Lt;return r.value=n,r.fallback=!0,r}});qa=k("$ZodOptional",(e,t)=>{de.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Wo(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>ev(a,n)):ev(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),hp=k("$ZodExactOptional",(e,t)=>{qa.init(e,t),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),mp=k("$ZodNullable",(e,t)=>{de.init(e,t),ge(e._zod,"optin",()=>t.innerType._zod.optin),ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Wo(r.source)}|null)$`):void 0}),ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),fp=k("$ZodDefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>tv(i,t)):tv(n,t)}});gp=k("$ZodPrefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),yp=k("$ZodNonOptional",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>nv(i,e)):nv(n,e)}});bp=k("$ZodSuccess",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),vp=k("$ZodCatch",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>at(a,o,Oe()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>at(i,o,Oe()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),wp=k("$ZodNaN",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Ja=k("$ZodPipe",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ba(a,t.in,o)):Ba(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Ba(i,t.out,o)):Ba(n,t.out,o)}});ni=k("$ZodCodec",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Wa(a,t,o)):Wa(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Wa(a,t,o)):Wa(i,t,o)}}});_p=k("$ZodPreprocess",(e,t)=>{Ja.init(e,t)}),kp=k("$ZodReadonly",(e,t)=>{de.init(e,t),ge(e._zod,"propValues",()=>t.innerType._zod.propValues),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"optin",()=>t.innerType?._zod?.optin),ge(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(rv):rv(n)}});xp=k("$ZodTemplateLiteral",(e,t)=>{de.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||ud.has(typeof o))r.push(Ct(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Sp=k("$ZodFunction",(e,t)=>(de.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?$a(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?$a(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Aa(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Aa(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ya({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Ep=k("$ZodPromise",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Tp=k("$ZodLazy",(e,t)=>{de.init(e,t),ge(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ge(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ge(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ge(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ge(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),$p=k("$ZodCustom",(e,t)=>{Ee.init(e,t),de.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>ov(i,r,o,e));ov(n,r,o,e)}})});function dv(){return{localeError:hC()}}var hC,uv=w(()=>{oe();hC=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${F(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${I(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function pv(){return{localeError:mC()}}var mC,hv=w(()=>{oe();mC=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${F(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function mv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function fv(){return{localeError:fC()}}var fC,gv=w(()=>{oe();fC=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${F(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=mv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=mv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function yv(){return{localeError:gC()}}var gC,bv=w(()=>{oe();gC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${F(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function vv(){return{localeError:yC()}}var yC,wv=w(()=>{oe();yC=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${F(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${I(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function _v(){return{localeError:bC()}}var bC,kv=w(()=>{oe();bC=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${F(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${I(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function xv(){return{localeError:vC()}}var vC,Sv=w(()=>{oe();vC=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${F(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function Ev(){return{localeError:wC()}}var wC,Tv=w(()=>{oe();wC=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${F(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function $v(){return{localeError:_C()}}var _C,Av=w(()=>{oe();_C=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${F(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Xa(){return{localeError:kC()}}var kC,Ip=w(()=>{oe();kC=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${F(n.values[0])}`:`Invalid option: expected one of ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function Iv(){return{localeError:xC()}}var xC,Cv=w(()=>{oe();xC=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${F(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function Pv(){return{localeError:SC()}}var SC,Ov=w(()=>{oe();SC=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${F(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function Nv(){return{localeError:EC()}}var EC,Rv=w(()=>{oe();EC=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${F(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${I(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${I(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function Lv(){return{localeError:TC()}}var TC,Dv=w(()=>{oe();TC=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${F(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function jv(){return{localeError:$C()}}var $C,Mv=w(()=>{oe();$C=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${F(n.values[0])} attendu`:`Option invalide : une valeur parmi ${I(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${I(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Uv(){return{localeError:AC()}}var AC,zv=w(()=>{oe();AC=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${F(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${I(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Fv(){return{localeError:IC()}}var IC,Gv=w(()=>{oe();IC=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,o=l=>{let p=r(l);return p?p.label:l??e.unknown.label},n=l=>`\u05D4${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,h=d[p??""]??o(p),m=G(l.input),y=d[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${F(l.values[0])}`;let p=l.values.map(y=>F(y));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let h=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let p=a(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let x=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}`}if(l.origin==="array"||l.origin==="set"){let x=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",O=l.inclusive?`${l.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${O}`.trim()}let m=l.inclusive?"<=":"<",y=i(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.maximum.toString()}`}case"too_small":{let p=a(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let x=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}`}if(l.origin==="array"||l.origin==="set"){let x=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let M=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${M}`}let O=l.inclusive?`${l.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${O}`.trim()}let m=l.inclusive?">=":">",y=i(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.minimum.toString()}`}case"invalid_format":{let p=l;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let h=s[p.format],m=h?.label??p.format,x=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${x}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${I(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Bv(){return{localeError:CC()}}var CC,Wv=w(()=>{oe();CC=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${F(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${I(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function Kv(){return{localeError:PC()}}var PC,Hv=w(()=>{oe();PC=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${F(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Vv(e,t,r){return Math.abs(e)===1?t:r}function Nr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Zv(){return{localeError:OC()}}var OC,Yv=w(()=>{oe();OC=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${F(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=Vv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=Vv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${I(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Nr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Nr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function qv(){return{localeError:NC()}}var NC,Jv=w(()=>{oe();NC=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${F(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function Xv(){return{localeError:RC()}}var RC,Qv=w(()=>{oe();RC=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${F(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${I(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function ew(){return{localeError:LC()}}var LC,tw=w(()=>{oe();LC=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${F(n.values[0])}`:`Opzione non valida: atteso uno tra ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${I(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function nw(){return{localeError:DC()}}var DC,rw=w(()=>{oe();DC=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${F(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${I(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${I(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function ow(){return{localeError:jC()}}var jC,iw=w(()=>{oe();jC=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${F(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${I(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Qa(){return{localeError:MC()}}var MC,Cp=w(()=>{oe();MC=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${F(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${I(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function aw(){return Qa()}var sw=w(()=>{Cp()});function cw(){return{localeError:UC()}}var UC,lw=w(()=>{oe();UC=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${F(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${I(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),d=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${d} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),d=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${d} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${I(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function dw(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function uw(){return{localeError:zC()}}var ri,zC,pw=w(()=>{oe();ri=e=>e.charAt(0).toUpperCase()+e.slice(1);zC=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let d=e[n]??null;return d===null?d:{unit:d.unit[i],verb:d.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${F(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${I(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,dw(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${ri(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${ri(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,dw(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${ri(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${ri(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${I(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${ri(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function hw(){return{localeError:FC()}}var FC,mw=w(()=>{oe();FC=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${F(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function fw(){return{localeError:GC()}}var GC,gw=w(()=>{oe();GC=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${F(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function yw(){return{localeError:BC()}}var BC,bw=w(()=>{oe();BC=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${F(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function vw(){return{localeError:WC()}}var WC,ww=w(()=>{oe();WC=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${F(n.values[0])}`:`Ugyldig valg: forventet en av ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function _w(){return{localeError:KC()}}var KC,kw=w(()=>{oe();KC=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${F(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function xw(){return{localeError:HC()}}var HC,Sw=w(()=>{oe();HC=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${F(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${I(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Ew(){return{localeError:VC()}}var VC,Tw=w(()=>{oe();VC=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${F(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function $w(){return{localeError:ZC()}}var ZC,Aw=w(()=>{oe();ZC=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${F(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function Iw(){return{localeError:YC()}}var YC,Cw=w(()=>{oe();YC=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${F(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${I(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function Pw(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function Ow(){return{localeError:qC()}}var qC,Nw=w(()=>{oe();qC=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${F(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=Pw(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=Pw(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Rw(){return{localeError:JC()}}var JC,Lw=w(()=>{oe();JC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${F(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${I(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function Dw(){return{localeError:XC()}}var XC,jw=w(()=>{oe();XC=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${F(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Mw(){return{localeError:QC()}}var QC,Uw=w(()=>{oe();QC=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${F(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${I(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function zw(){return{localeError:eP()}}var eP,Fw=w(()=>{oe();eP=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${F(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${I(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Gw(){return{localeError:tP()}}var tP,Bw=w(()=>{oe();tP=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${F(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function es(){return{localeError:nP()}}var nP,Pp=w(()=>{oe();nP=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${F(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Ww(){return es()}var Kw=w(()=>{Pp()});function Hw(){return{localeError:rP()}}var rP,Vw=w(()=>{oe();rP=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${F(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${I(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${I(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Zw(){return{localeError:oP()}}var oP,Yw=w(()=>{oe();oP=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${F(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function qw(){return{localeError:iP()}}var iP,Jw=w(()=>{oe();iP=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${F(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${I(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Xw(){return{localeError:aP()}}var aP,Qw=w(()=>{oe();aP=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${F(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function e_(){return{localeError:sP()}}var sP,t_=w(()=>{oe();sP=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${F(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${I(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function n_(){return{localeError:cP()}}var cP,r_=w(()=>{oe();cP=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${F(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${I(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var oi={};Gt(oi,{ar:()=>dv,az:()=>pv,be:()=>fv,bg:()=>yv,ca:()=>vv,cs:()=>_v,da:()=>xv,de:()=>Ev,el:()=>$v,en:()=>Xa,eo:()=>Iv,es:()=>Pv,fa:()=>Nv,fi:()=>Lv,fr:()=>jv,frCA:()=>Uv,he:()=>Fv,hr:()=>Bv,hu:()=>Kv,hy:()=>Zv,id:()=>qv,is:()=>Xv,it:()=>ew,ja:()=>nw,ka:()=>ow,kh:()=>aw,km:()=>Qa,ko:()=>cw,lt:()=>uw,mk:()=>hw,ms:()=>fw,nl:()=>yw,no:()=>vw,ota:()=>_w,pl:()=>Ew,ps:()=>xw,pt:()=>$w,ro:()=>Iw,ru:()=>Ow,sl:()=>Rw,sv:()=>Dw,ta:()=>Mw,th:()=>zw,tr:()=>Gw,ua:()=>Ww,uk:()=>es,ur:()=>Hw,uz:()=>Zw,vi:()=>qw,yo:()=>n_,zhCN:()=>Xw,zhTW:()=>e_});var Op=w(()=>{uv();hv();gv();bv();wv();kv();Sv();Tv();Av();Ip();Cv();Ov();Rv();Dv();Mv();zv();Gv();Wv();Hv();Yv();Jv();Qv();tw();rw();iw();sw();Cp();lw();pw();mw();gw();bw();ww();kw();Sw();Tw();Aw();Cw();Nw();Lw();jw();Uw();Fw();Bw();Kw();Pp();Vw();Yw();Jw();Qw();t_();r_()});function ns(){return new ts}var o_,Np,Rp,ts,We,ii=w(()=>{Np=Symbol("ZodOutput"),Rp=Symbol("ZodInput"),ts=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(o_=globalThis).__zod_globalRegistry??(o_.__zod_globalRegistry=ns());We=globalThis.__zod_globalRegistry});function Lp(e,t){return new e({type:"string",...Z(t)})}function Dp(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function rs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function ai(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function os(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function is(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function as(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function si(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function cs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function ls(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function ds(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function us(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function ps(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function hs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function ms(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function fs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function gs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function jp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Z(t)})}function ys(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function bs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function vs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function ws(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function _s(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function ks(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function Up(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function zp(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function Fp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function Gp(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function Bp(e,t){return new e({type:"number",checks:[],...Z(t)})}function Wp(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}function Kp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function Hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Z(t)})}function Vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Z(t)})}function Zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Z(t)})}function Yp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(t)})}function qp(e,t){return new e({type:"boolean",...Z(t)})}function Jp(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}function Xp(e,t){return new e({type:"bigint",...Z(t)})}function Qp(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}function eh(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(t)})}function th(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(t)})}function nh(e,t){return new e({type:"symbol",...Z(t)})}function rh(e,t){return new e({type:"undefined",...Z(t)})}function oh(e,t){return new e({type:"null",...Z(t)})}function ih(e){return new e({type:"any"})}function ah(e){return new e({type:"unknown"})}function sh(e,t){return new e({type:"never",...Z(t)})}function ch(e,t){return new e({type:"void",...Z(t)})}function lh(e,t){return new e({type:"date",...Z(t)})}function dh(e,t){return new e({type:"date",coerce:!0,...Z(t)})}function uh(e,t){return new e({type:"nan",...Z(t)})}function Wt(e,t){return new za({check:"less_than",...Z(t),value:e,inclusive:!1})}function Et(e,t){return new za({check:"less_than",...Z(t),value:e,inclusive:!0})}function Kt(e,t){return new Fa({check:"greater_than",...Z(t),value:e,inclusive:!1})}function st(e,t){return new Fa({check:"greater_than",...Z(t),value:e,inclusive:!0})}function xs(e){return Kt(0,e)}function Ss(e){return Wt(0,e)}function Es(e){return Et(0,e)}function Ts(e){return st(0,e)}function An(e,t){return new Jd({check:"multiple_of",...Z(t),value:e})}function In(e,t){return new eu({check:"max_size",...Z(t),maximum:e})}function Ht(e,t){return new tu({check:"min_size",...Z(t),minimum:e})}function or(e,t){return new nu({check:"size_equals",...Z(t),size:e})}function ir(e,t){return new ru({check:"max_length",...Z(t),maximum:e})}function an(e,t){return new ou({check:"min_length",...Z(t),minimum:e})}function ar(e,t){return new iu({check:"length_equals",...Z(t),length:e})}function Rr(e,t){return new au({check:"string_format",format:"regex",...Z(t),pattern:e})}function Lr(e){return new su({check:"string_format",format:"lowercase",...Z(e)})}function Dr(e){return new cu({check:"string_format",format:"uppercase",...Z(e)})}function jr(e,t){return new lu({check:"string_format",format:"includes",...Z(t),includes:e})}function Mr(e,t){return new du({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function Ur(e,t){return new uu({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function $s(e,t,r){return new pu({check:"property",property:e,schema:t,...Z(r)})}function zr(e,t){return new hu({check:"mime_type",mime:e,...Z(t)})}function Dt(e){return new mu({check:"overwrite",tx:e})}function Fr(e){return Dt(t=>t.normalize(e))}function Gr(){return Dt(e=>e.trim())}function Br(){return Dt(e=>e.toLowerCase())}function Wr(){return Dt(e=>e.toUpperCase())}function Kr(){return Dt(e=>cd(e))}function ph(e,t,r){return new e({type:"array",element:t,...Z(r)})}function dP(e,t,r){return new e({type:"union",options:t,...Z(r)})}function uP(e,t,r){return new e({type:"union",options:t,inclusive:!1,...Z(r)})}function pP(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...Z(o)})}function hP(e,t,r){return new e({type:"intersection",left:t,right:r})}function mP(e,t,r,o){let n=r instanceof de,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...Z(i)})}function fP(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...Z(o)})}function gP(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...Z(o)})}function yP(e,t,r){return new e({type:"set",valueType:t,...Z(r)})}function bP(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...Z(r)})}function vP(e,t,r){return new e({type:"enum",entries:t,...Z(r)})}function wP(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Z(r)})}function hh(e,t){return new e({type:"file",...Z(t)})}function _P(e,t){return new e({type:"transform",transform:t})}function kP(e,t){return new e({type:"optional",innerType:t})}function xP(e,t){return new e({type:"nullable",innerType:t})}function SP(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():dd(r)}})}function EP(e,t,r){return new e({type:"nonoptional",innerType:t,...Z(r)})}function TP(e,t){return new e({type:"success",innerType:t})}function $P(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function AP(e,t,r){return new e({type:"pipe",in:t,out:r})}function IP(e,t){return new e({type:"readonly",innerType:t})}function CP(e,t,r){return new e({type:"template_literal",parts:t,...Z(r)})}function PP(e,t){return new e({type:"lazy",getter:t})}function OP(e,t){return new e({type:"promise",innerType:t})}function mh(e,t,r){let o=Z(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function fh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}function gh(e,t){let r=i_(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push($r(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push($r(i))}},e(o.value,o)),t);return r}function i_(e,t){let r=new Ee({check:"custom",...Z(t)});return r._zod.check=e,r}function yh(e){let t=new Ee({check:"describe"});return t._zod.onattach=[r=>{let o=We.get(r)??{};We.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function bh(e){let t=new Ee({check:"meta"});return t._zod.onattach=[r=>{let o=We.get(r)??{};We.add(r,{...o,...e})}],t._zod.check=()=>{},t}function vh(e,t){let r=Z(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let i=new Set(o),a=new Set(n),s=e.Codec??ni,d=e.Boolean??ei,l=e.String??rr,p=new l({type:"string",error:r.error}),h=new d({type:"boolean",error:r.error}),m=new s({type:"pipe",in:p,out:h,transform:((y,x)=>{let O=y;return r.case!=="sensitive"&&(O=O.toLowerCase()),i.has(O)?!0:a.has(O)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:x.value,inst:m,continue:!1}),{})}),reverseTransform:((y,x)=>y===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function Hr(e,t,r,o={}){let n=Z(o),i={...Z(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var Mp,a_=w(()=>{Ga();ii();Ap();oe();Mp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Cn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??We,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function _e(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,p);else{let m=a.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,m,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),_e(h,t,p),t.seen.get(h).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&ct(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Pn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let d=o.get(s);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let h=e.external.registry.get(a[0])?.id,m=e.external.uri??(x=>x);if(h)return{ref:m(h)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${m("__shared")}#/${s}/${y}`}}if(a[1]===r)return{ref:"#"};let l=`#/${s}/`,p=a[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:l+p}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:d,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let p=s.schema;for(let h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
75
|
+
`)}y.write("payload.value = newResult;"),y.write("return payload;");let T=y.compile();return(_,b)=>T(m,_,b)},i,a=tr,s=!Qn.jitless,l=s&&ld.value,p=t.catchall,h;e._zod.parse=(m,y)=>{h??(h=o.value);let x=m.value;return a(x)?s&&l&&y?.async===!1&&y.jitless!==!0?(i||(i=n(t.shape)),m=i(m,y),p?lv([],x,m,y,h,e):m):r(m,y):(m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m)}});ti=k("$ZodUnion",(e,t)=>{de.init(e,t),ge(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ge(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ge(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ge(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>Wo(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let d=s._zod.run({value:o.value,issues:[]},n);if(d instanceof Promise)a.push(d),i=!0;else{if(d.issues.length===0)return d;a.push(d)}}return i?Promise.all(a).then(s=>Vb(s,o,e,n)):Vb(a,o,e,n)}});rp=k("$ZodXor",(e,t)=>{ti.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let d=s._zod.run({value:o.value,issues:[]},n);d instanceof Promise?(a.push(d),i=!0):a.push(d)}return i?Promise.all(a).then(s=>Zb(s,o,e,n)):Zb(a,o,e,n)}}),op=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ti.init(e,t);let r=e._zod.parse;ge(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,d]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of d)n[s].add(l)}}return n});let o=Tr(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let d of s){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!tr(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),ip=k("$ZodIntersection",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([d,l])=>Yb(r,d,l)):Yb(r,i,a)}});Ya=k("$ZodTuple",(e,t)=>{de.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=qb(r,"optin"),d=qb(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let l=new Array(r.length);for(let p=0;p<r.length;p++){let h=r[p]._zod.run({value:i[p],issues:[]},n);h instanceof Promise?a.push(h.then(m=>{l[p]=m})):l[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let m of h){p++;let y=t.rest._zod.run({value:m,issues:[]},n);y instanceof Promise?a.push(y.then(x=>Jb(x,o,p))):Jb(y,o,p)}}return a.length?Promise.all(a).then(()=>Xb(l,o,r,i,d)):Xb(l,o,r,i,d)}});ap=k("$ZodRecord",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Tn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let p=t.keyType._zod.run({value:l,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(y=>at(y,o,Oe())),input:l,path:[l],inst:e});continue}let h=p.value,m=t.valueType._zod.run({value:n[l],issues:[]},o);m instanceof Promise?i.push(m.then(y=>{y.issues.length&&r.issues.push(...gt(l,y.issues)),r.value[h]=y.value})):(m.issues.length&&r.issues.push(...gt(l,m.issues)),r.value[h]=m.value)}let d;for(let l in n)s.has(l)||(d=d??[],d.push(l));d&&d.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:d})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let d=t.keyType._zod.run({value:s,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Ma.test(s)&&d.issues.length){let h=t.keyType._zod.run({value:Number(s),issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(d=h)}if(d.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>at(h,o,Oe())),input:s,path:[s],inst:e});continue}let p=t.valueType._zod.run({value:n[s],issues:[]},o);p instanceof Promise?i.push(p.then(h=>{h.issues.length&&r.issues.push(...gt(s,h.issues)),r.value[d.value]=h.value})):(p.issues.length&&r.issues.push(...gt(s,p.issues)),r.value[d.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),sp=k("$ZodMap",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let d=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);d instanceof Promise||l instanceof Promise?i.push(Promise.all([d,l]).then(([p,h])=>{Qb(p,h,r,a,n,e,o)})):Qb(d,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});cp=k("$ZodSet",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(d=>ev(d,r))):ev(s,r)}return i.length?Promise.all(i).then(()=>r):r}});lp=k("$ZodEnum",(e,t)=>{de.init(e,t);let r=Bo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Ko.has(typeof n)).map(n=>typeof n=="string"?Ct(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),dp=k("$ZodLiteral",(e,t)=>{if(de.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ct(o):o?Ct(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),up=k("$ZodFile",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),pp=k("$ZodTransform",(e,t)=>{de.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new Lt;return r.value=n,r.fallback=!0,r}});qa=k("$ZodOptional",(e,t)=>{de.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Wo(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>tv(a,n)):tv(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),hp=k("$ZodExactOptional",(e,t)=>{qa.init(e,t),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),mp=k("$ZodNullable",(e,t)=>{de.init(e,t),ge(e._zod,"optin",()=>t.innerType._zod.optin),ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Wo(r.source)}|null)$`):void 0}),ge(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),fp=k("$ZodDefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>nv(i,t)):nv(n,t)}});gp=k("$ZodPrefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),yp=k("$ZodNonOptional",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>rv(i,e)):rv(n,e)}});bp=k("$ZodSuccess",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),vp=k("$ZodCatch",(e,t)=>{de.init(e,t),e._zod.optin="optional",ge(e._zod,"optout",()=>t.innerType._zod.optout),ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>at(a,o,Oe()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>at(i,o,Oe()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),wp=k("$ZodNaN",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Ja=k("$ZodPipe",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Ba(a,t.in,o)):Ba(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Ba(i,t.out,o)):Ba(n,t.out,o)}});ni=k("$ZodCodec",(e,t)=>{de.init(e,t),ge(e._zod,"values",()=>t.in._zod.values),ge(e._zod,"optin",()=>t.in._zod.optin),ge(e._zod,"optout",()=>t.out._zod.optout),ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>Wa(a,t,o)):Wa(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Wa(a,t,o)):Wa(i,t,o)}}});_p=k("$ZodPreprocess",(e,t)=>{Ja.init(e,t)}),kp=k("$ZodReadonly",(e,t)=>{de.init(e,t),ge(e._zod,"propValues",()=>t.innerType._zod.propValues),ge(e._zod,"values",()=>t.innerType._zod.values),ge(e._zod,"optin",()=>t.innerType?._zod?.optin),ge(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(ov):ov(n)}});xp=k("$ZodTemplateLiteral",(e,t)=>{de.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||ud.has(typeof o))r.push(Ct(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),Sp=k("$ZodFunction",(e,t)=>(de.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?$a(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?$a(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Aa(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Aa(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Ya({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),Ep=k("$ZodPromise",(e,t)=>{de.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Tp=k("$ZodLazy",(e,t)=>{de.init(e,t),ge(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),ge(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),ge(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),ge(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),ge(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),$p=k("$ZodCustom",(e,t)=>{Ee.init(e,t),de.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>iv(i,r,o,e));iv(n,r,o,e)}})});function uv(){return{localeError:mC()}}var mC,pv=w(()=>{oe();mC=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${F(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${I(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function hv(){return{localeError:fC()}}var fC,mv=w(()=>{oe();fC=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${F(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function fv(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function gv(){return{localeError:gC()}}var gC,yv=w(()=>{oe();gC=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${F(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=fv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=fv(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function bv(){return{localeError:yC()}}var yC,vv=w(()=>{oe();yC=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${F(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function wv(){return{localeError:bC()}}var bC,_v=w(()=>{oe();bC=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${F(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${I(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function kv(){return{localeError:vC()}}var vC,xv=w(()=>{oe();vC=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${F(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${I(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function Sv(){return{localeError:wC()}}var wC,Ev=w(()=>{oe();wC=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${F(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function Tv(){return{localeError:_C()}}var _C,$v=w(()=>{oe();_C=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${F(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Av(){return{localeError:kC()}}var kC,Iv=w(()=>{oe();kC=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${F(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Xa(){return{localeError:xC()}}var xC,Ip=w(()=>{oe();xC=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${F(n.values[0])}`:`Invalid option: expected one of ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function Cv(){return{localeError:SC()}}var SC,Pv=w(()=>{oe();SC=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${F(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function Ov(){return{localeError:EC()}}var EC,Nv=w(()=>{oe();EC=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${F(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function Rv(){return{localeError:TC()}}var TC,Lv=w(()=>{oe();TC=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${F(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${I(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${I(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function Dv(){return{localeError:$C()}}var $C,jv=w(()=>{oe();$C=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${F(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${I(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function Mv(){return{localeError:AC()}}var AC,Uv=w(()=>{oe();AC=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${F(n.values[0])} attendu`:`Option invalide : une valeur parmi ${I(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${I(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function zv(){return{localeError:IC()}}var IC,Fv=w(()=>{oe();IC=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${F(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${I(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Gv(){return{localeError:CC()}}var CC,Bv=w(()=>{oe();CC=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?e[l]:void 0,o=l=>{let p=r(l);return p?p.label:l??e.unknown.label},n=l=>`\u05D4${o(l)}`,i=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,h=d[p??""]??o(p),m=G(l.input),y=d[m]??e[m]?.label??m;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${F(l.values[0])}`;let p=l.values.map(y=>F(y));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p[0]} \u05D0\u05D5 ${p[1]}`;let h=p[p.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${h}`}case"too_big":{let p=a(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let x=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}`}if(l.origin==="array"||l.origin==="set"){let x=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",O=l.inclusive?`${l.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${O}`.trim()}let m=l.inclusive?"<=":"<",y=i(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.maximum.toString()}`}case"too_small":{let p=a(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${p?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let x=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}`}if(l.origin==="array"||l.origin==="set"){let x=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let M=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${M}`}let O=l.inclusive?`${l.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${x} \u05DC\u05D4\u05DB\u05D9\u05DC ${O}`.trim()}let m=l.inclusive?">=":">",y=i(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${y} ${m}${l.minimum.toString()}`}case"invalid_format":{let p=l;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${p.pattern}`;let h=s[p.format],m=h?.label??p.format,x=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${x}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${I(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Wv(){return{localeError:PC()}}var PC,Kv=w(()=>{oe();PC=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${F(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${I(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function Hv(){return{localeError:OC()}}var OC,Vv=w(()=>{oe();OC=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${F(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Zv(e,t,r){return Math.abs(e)===1?t:r}function Nr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function Yv(){return{localeError:NC()}}var NC,qv=w(()=>{oe();NC=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${F(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=Zv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=Zv(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Nr(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${I(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Nr(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Nr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Jv(){return{localeError:RC()}}var RC,Xv=w(()=>{oe();RC=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${F(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function Qv(){return{localeError:LC()}}var LC,ew=w(()=>{oe();LC=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${F(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${I(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function tw(){return{localeError:DC()}}var DC,nw=w(()=>{oe();DC=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${F(n.values[0])}`:`Opzione non valida: atteso uno tra ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${I(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function rw(){return{localeError:jC()}}var jC,ow=w(()=>{oe();jC=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${F(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${I(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${I(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function iw(){return{localeError:MC()}}var MC,aw=w(()=>{oe();MC=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${F(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${I(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Qa(){return{localeError:UC()}}var UC,Cp=w(()=>{oe();UC=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${F(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${I(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function sw(){return Qa()}var cw=w(()=>{Cp()});function lw(){return{localeError:zC()}}var zC,dw=w(()=>{oe();zC=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${F(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${I(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),d=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${d} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),d=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${d} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${I(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function uw(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}function pw(){return{localeError:FC()}}var ri,FC,hw=w(()=>{oe();ri=e=>e.charAt(0).toUpperCase()+e.slice(1);FC=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,a,s){let d=e[n]??null;return d===null?d:{unit:d.unit[i],verb:d.verb[s][a?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${F(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${I(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,uw(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${ri(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${ri(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,uw(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${ri(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${ri(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${I(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${ri(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function mw(){return{localeError:GC()}}var GC,fw=w(()=>{oe();GC=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${F(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function gw(){return{localeError:BC()}}var BC,yw=w(()=>{oe();BC=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${F(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${I(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function bw(){return{localeError:WC()}}var WC,vw=w(()=>{oe();WC=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${F(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function ww(){return{localeError:KC()}}var KC,_w=w(()=>{oe();KC=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${F(n.values[0])}`:`Ugyldig valg: forventet en av ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function kw(){return{localeError:HC()}}var HC,xw=w(()=>{oe();HC=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${F(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Sw(){return{localeError:VC()}}var VC,Ew=w(()=>{oe();VC=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${F(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${I(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${I(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Tw(){return{localeError:ZC()}}var ZC,$w=w(()=>{oe();ZC=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${F(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Aw(){return{localeError:YC()}}var YC,Iw=w(()=>{oe();YC=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${F(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${I(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function Cw(){return{localeError:qC()}}var qC,Pw=w(()=>{oe();qC=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${F(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${I(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function Ow(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}function Nw(){return{localeError:JC()}}var JC,Rw=w(()=>{oe();JC=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${F(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),d=Ow(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),d=Ow(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Lw(){return{localeError:XC()}}var XC,Dw=w(()=>{oe();XC=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${F(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${I(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function jw(){return{localeError:QC()}}var QC,Mw=w(()=>{oe();QC=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${F(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${I(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Uw(){return{localeError:eP()}}var eP,zw=w(()=>{oe();eP=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${F(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${I(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function Fw(){return{localeError:tP()}}var tP,Gw=w(()=>{oe();tP=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${F(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${I(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Bw(){return{localeError:nP()}}var nP,Ww=w(()=>{oe();nP=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${F(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function es(){return{localeError:rP()}}var rP,Pp=w(()=>{oe();rP=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${F(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${I(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function Kw(){return es()}var Hw=w(()=>{Pp()});function Vw(){return{localeError:oP()}}var oP,Zw=w(()=>{oe();oP=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${F(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${I(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${I(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Yw(){return{localeError:iP()}}var iP,qw=w(()=>{oe();iP=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${F(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function Jw(){return{localeError:aP()}}var aP,Xw=w(()=>{oe();aP=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${F(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${I(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Qw(){return{localeError:sP()}}var sP,e_=w(()=>{oe();sP=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${F(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${I(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function t_(){return{localeError:cP()}}var cP,n_=w(()=>{oe();cP=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${F(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${I(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function r_(){return{localeError:lP()}}var lP,o_=w(()=>{oe();lP=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=G(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${F(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${I(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${I(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var oi={};Gt(oi,{ar:()=>uv,az:()=>hv,be:()=>gv,bg:()=>bv,ca:()=>wv,cs:()=>kv,da:()=>Sv,de:()=>Tv,el:()=>Av,en:()=>Xa,eo:()=>Cv,es:()=>Ov,fa:()=>Rv,fi:()=>Dv,fr:()=>Mv,frCA:()=>zv,he:()=>Gv,hr:()=>Wv,hu:()=>Hv,hy:()=>Yv,id:()=>Jv,is:()=>Qv,it:()=>tw,ja:()=>rw,ka:()=>iw,kh:()=>sw,km:()=>Qa,ko:()=>lw,lt:()=>pw,mk:()=>mw,ms:()=>gw,nl:()=>bw,no:()=>ww,ota:()=>kw,pl:()=>Tw,ps:()=>Sw,pt:()=>Aw,ro:()=>Cw,ru:()=>Nw,sl:()=>Lw,sv:()=>jw,ta:()=>Uw,th:()=>Fw,tr:()=>Bw,ua:()=>Kw,uk:()=>es,ur:()=>Vw,uz:()=>Yw,vi:()=>Jw,yo:()=>r_,zhCN:()=>Qw,zhTW:()=>t_});var Op=w(()=>{pv();mv();yv();vv();_v();xv();Ev();$v();Iv();Ip();Pv();Nv();Lv();jv();Uv();Fv();Bv();Kv();Vv();qv();Xv();ew();nw();ow();aw();cw();Cp();dw();hw();fw();yw();vw();_w();xw();Ew();$w();Iw();Pw();Rw();Dw();Mw();zw();Gw();Ww();Hw();Pp();Zw();qw();Xw();e_();n_();o_()});function ns(){return new ts}var i_,Np,Rp,ts,We,ii=w(()=>{Np=Symbol("ZodOutput"),Rp=Symbol("ZodInput"),ts=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(i_=globalThis).__zod_globalRegistry??(i_.__zod_globalRegistry=ns());We=globalThis.__zod_globalRegistry});function Lp(e,t){return new e({type:"string",...Z(t)})}function Dp(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function rs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function ai(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function os(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function is(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function as(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function si(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function cs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function ls(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function ds(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function us(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function ps(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function hs(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function ms(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function fs(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function gs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function jp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Z(t)})}function ys(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function bs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function vs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function ws(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function _s(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function ks(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function Up(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function zp(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function Fp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function Gp(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function Bp(e,t){return new e({type:"number",checks:[],...Z(t)})}function Wp(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}function Kp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function Hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Z(t)})}function Vp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Z(t)})}function Zp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Z(t)})}function Yp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(t)})}function qp(e,t){return new e({type:"boolean",...Z(t)})}function Jp(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}function Xp(e,t){return new e({type:"bigint",...Z(t)})}function Qp(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}function eh(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(t)})}function th(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(t)})}function nh(e,t){return new e({type:"symbol",...Z(t)})}function rh(e,t){return new e({type:"undefined",...Z(t)})}function oh(e,t){return new e({type:"null",...Z(t)})}function ih(e){return new e({type:"any"})}function ah(e){return new e({type:"unknown"})}function sh(e,t){return new e({type:"never",...Z(t)})}function ch(e,t){return new e({type:"void",...Z(t)})}function lh(e,t){return new e({type:"date",...Z(t)})}function dh(e,t){return new e({type:"date",coerce:!0,...Z(t)})}function uh(e,t){return new e({type:"nan",...Z(t)})}function Wt(e,t){return new za({check:"less_than",...Z(t),value:e,inclusive:!1})}function Et(e,t){return new za({check:"less_than",...Z(t),value:e,inclusive:!0})}function Kt(e,t){return new Fa({check:"greater_than",...Z(t),value:e,inclusive:!1})}function st(e,t){return new Fa({check:"greater_than",...Z(t),value:e,inclusive:!0})}function xs(e){return Kt(0,e)}function Ss(e){return Wt(0,e)}function Es(e){return Et(0,e)}function Ts(e){return st(0,e)}function An(e,t){return new Jd({check:"multiple_of",...Z(t),value:e})}function In(e,t){return new eu({check:"max_size",...Z(t),maximum:e})}function Ht(e,t){return new tu({check:"min_size",...Z(t),minimum:e})}function or(e,t){return new nu({check:"size_equals",...Z(t),size:e})}function ir(e,t){return new ru({check:"max_length",...Z(t),maximum:e})}function an(e,t){return new ou({check:"min_length",...Z(t),minimum:e})}function ar(e,t){return new iu({check:"length_equals",...Z(t),length:e})}function Rr(e,t){return new au({check:"string_format",format:"regex",...Z(t),pattern:e})}function Lr(e){return new su({check:"string_format",format:"lowercase",...Z(e)})}function Dr(e){return new cu({check:"string_format",format:"uppercase",...Z(e)})}function jr(e,t){return new lu({check:"string_format",format:"includes",...Z(t),includes:e})}function Mr(e,t){return new du({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function Ur(e,t){return new uu({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function $s(e,t,r){return new pu({check:"property",property:e,schema:t,...Z(r)})}function zr(e,t){return new hu({check:"mime_type",mime:e,...Z(t)})}function Dt(e){return new mu({check:"overwrite",tx:e})}function Fr(e){return Dt(t=>t.normalize(e))}function Gr(){return Dt(e=>e.trim())}function Br(){return Dt(e=>e.toLowerCase())}function Wr(){return Dt(e=>e.toUpperCase())}function Kr(){return Dt(e=>cd(e))}function ph(e,t,r){return new e({type:"array",element:t,...Z(r)})}function uP(e,t,r){return new e({type:"union",options:t,...Z(r)})}function pP(e,t,r){return new e({type:"union",options:t,inclusive:!1,...Z(r)})}function hP(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...Z(o)})}function mP(e,t,r){return new e({type:"intersection",left:t,right:r})}function fP(e,t,r,o){let n=r instanceof de,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...Z(i)})}function gP(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...Z(o)})}function yP(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...Z(o)})}function bP(e,t,r){return new e({type:"set",valueType:t,...Z(r)})}function vP(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...Z(r)})}function wP(e,t,r){return new e({type:"enum",entries:t,...Z(r)})}function _P(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Z(r)})}function hh(e,t){return new e({type:"file",...Z(t)})}function kP(e,t){return new e({type:"transform",transform:t})}function xP(e,t){return new e({type:"optional",innerType:t})}function SP(e,t){return new e({type:"nullable",innerType:t})}function EP(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():dd(r)}})}function TP(e,t,r){return new e({type:"nonoptional",innerType:t,...Z(r)})}function $P(e,t){return new e({type:"success",innerType:t})}function AP(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function IP(e,t,r){return new e({type:"pipe",in:t,out:r})}function CP(e,t){return new e({type:"readonly",innerType:t})}function PP(e,t,r){return new e({type:"template_literal",parts:t,...Z(r)})}function OP(e,t){return new e({type:"lazy",getter:t})}function NP(e,t){return new e({type:"promise",innerType:t})}function mh(e,t,r){let o=Z(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function fh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}function gh(e,t){let r=a_(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push($r(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push($r(i))}},e(o.value,o)),t);return r}function a_(e,t){let r=new Ee({check:"custom",...Z(t)});return r._zod.check=e,r}function yh(e){let t=new Ee({check:"describe"});return t._zod.onattach=[r=>{let o=We.get(r)??{};We.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function bh(e){let t=new Ee({check:"meta"});return t._zod.onattach=[r=>{let o=We.get(r)??{};We.add(r,{...o,...e})}],t._zod.check=()=>{},t}function vh(e,t){let r=Z(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(y=>typeof y=="string"?y.toLowerCase():y),n=n.map(y=>typeof y=="string"?y.toLowerCase():y));let i=new Set(o),a=new Set(n),s=e.Codec??ni,d=e.Boolean??ei,l=e.String??rr,p=new l({type:"string",error:r.error}),h=new d({type:"boolean",error:r.error}),m=new s({type:"pipe",in:p,out:h,transform:((y,x)=>{let O=y;return r.case!=="sensitive"&&(O=O.toLowerCase()),i.has(O)?!0:a.has(O)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:x.value,inst:m,continue:!1}),{})}),reverseTransform:((y,x)=>y===!0?o[0]||"true":n[0]||"false"),error:r.error});return m}function Hr(e,t,r,o={}){let n=Z(o),i={...Z(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}var Mp,s_=w(()=>{Ga();ii();Ap();oe();Mp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Cn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??We,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function _e(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,p);else{let m=a.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,m,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),_e(h,t,p),t.seen.get(h).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(a.schema,d),t.io==="input"&&ct(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Pn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let d=o.get(s);if(d&&d!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let h=e.external.registry.get(a[0])?.id,m=e.external.uri??(x=>x);if(h)return{ref:m(h)};let y=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=y,{defId:y,ref:`${m("__shared")}#/${s}/${y}`}}if(a[1]===r)return{ref:"#"};let l=`#/${s}/`,p=a[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:l+p}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:d,defId:l}=n(a);s.def={...s.schema},l&&(s.defId=l);let p=s.schema;for(let h in p)delete p[h];p.$ref=d};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
76
76
|
|
|
77
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function On(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let d=e.seen.get(s);if(d.ref===null)return;let l=d.def??d.schema,p={...l},h=d.ref;if(d.ref=null,h){o(h);let y=e.seen.get(h),x=y.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(x)):Object.assign(l,x),Object.assign(l,p),s._zod.parent===h)for(let M in l)M==="$ref"||M==="allOf"||M in p||delete l[M];if(x.$ref&&y.def)for(let M in l)M==="$ref"||M==="allOf"||M in y.def&&JSON.stringify(l[M])===JSON.stringify(y.def[M])&&delete l[M]}let m=s._zod.parent;if(m&&m!==h){o(m);let y=e.seen.get(m);if(y?.schema.$ref&&(l.$ref=y.schema.$ref,y.def))for(let x in l)x==="$ref"||x==="allOf"||x in y.def&&JSON.stringify(l[x])===JSON.stringify(y.def[x])&&delete l[x]}e.override({zodSchema:s,jsonSchema:l,path:d.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let d=s[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vr(t,"input",e.processors),output:Vr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ct(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ct(o.element,r);if(o.type==="set")return ct(o.valueType,r);if(o.type==="lazy")return ct(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ct(o.innerType,r);if(o.type==="intersection")return ct(o.left,r)||ct(o.right,r);if(o.type==="record"||o.type==="map")return ct(o.keyType,r)||ct(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ct(o.in,r)||ct(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ct(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ct(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ct(n,r))return!0;return!!(o.rest&&ct(o.rest,r))}return!1}var wh,Vr,ci=w(()=>{ii();wh=(e,t={})=>r=>{let o=Cn({...r,processors:t});return _e(e,o),Pn(o,e),On(o,e)},Vr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Cn({...n??{},target:i,io:t,processors:r});return _e(e,a),Pn(a,e),On(a,e)}});function Ps(e,t){if("_idmap"in e){let o=e,n=Cn({...t,processors:As}),i={};for(let d of o._idmap.entries()){let[l,p]=d;_e(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let d of o._idmap.entries()){let[l,p]=d;Pn(n,p),a[l]=On(n,p)}if(Object.keys(i).length>0){let d=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:i}}return{schemas:a}}let r=Cn({...t,processors:As});return _e(e,r),Pn(r,e),On(r,e)}var NP,_h,kh,xh,Sh,Eh,Th,$h,Ah,Ih,Ch,Ph,Oh,Nh,Rh,Lh,Dh,jh,Mh,Uh,zh,Fh,Gh,Bh,Wh,Kh,Is,Hh,Vh,Zh,Yh,qh,Jh,Xh,Qh,em,tm,nm,Cs,rm,As,li=w(()=>{ci();oe();NP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_h=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:d,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=NP[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},kh=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:d,exclusiveMaximum:l,exclusiveMinimum:p}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let h=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";h?y?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),m?y?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof d=="number"&&(n.multipleOf=d)},xh=(e,t,r,o)=>{r.type="boolean"},Sh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Eh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Th=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},$h=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ah=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Ih=(e,t,r,o)=>{r.not={}},Ch=(e,t,r,o)=>{},Ph=(e,t,r,o)=>{},Oh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Nh=(e,t,r,o)=>{let n=e._zod.def,i=Bo(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Rh=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Lh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Dh=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},jh=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:d}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),d?d.length===1?(i.contentMediaType=d[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=d.map(l=>({contentMediaType:l}))):Object.assign(n,i)},Mh=(e,t,r,o)=>{r.type="boolean"},Uh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Fh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Bh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Wh=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=_e(i.element,t,{...o,path:[...o.path,"items"]})},Kh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let l in a)n.properties[l]=_e(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),d=new Set([...s].filter(l=>{let p=i.shape[l]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(n.required=Array.from(d)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=_e(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Is=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,d)=>_e(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",d]}));i?r.oneOf=a:r.anyOf=a},Hh=(e,t,r,o)=>{let n=e._zod.def,i=_e(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=_e(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,d=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=d},Vh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((m,y)=>_e(m,t,{...o,path:[...o.path,a,y]})),l=i.rest?_e(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=d,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:d},l&&n.items.anyOf.push(l),n.minItems=d.length,l||(n.maxItems=d.length)):(n.items=d,l&&(n.additionalItems=l));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},Zh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,d=a._zod.bag?.patterns;if(i.mode==="loose"&&d&&d.size>0){let p=_e(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of d)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=_e(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=_e(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=a._zod.values;if(l){let p=[...l].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(n.required=p)}},Yh=(e,t,r,o)=>{let n=e._zod.def,i=_e(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},qh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Jh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Xh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Qh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},em=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;_e(a,t,o);let s=t.seen.get(e);s.ref=a},tm=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},nm=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Cs=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},rm=(e,t,r,o)=>{let n=e._zod.innerType;_e(n,t,o);let i=t.seen.get(e);i.ref=n},As={string:_h,number:kh,boolean:xh,bigint:Sh,symbol:Eh,null:Th,undefined:$h,void:Ah,never:Ih,any:Ch,unknown:Ph,date:Oh,enum:Nh,literal:Rh,nan:Lh,template_literal:Dh,file:jh,success:Mh,custom:Uh,function:zh,transform:Fh,map:Gh,set:Bh,array:Wh,object:Kh,union:Is,intersection:Hh,tuple:Vh,record:Zh,nullable:Yh,nonoptional:qh,default:Jh,prefault:Xh,catch:Qh,pipe:em,readonly:tm,promise:nm,optional:Cs,lazy:rm}});var Os,s_=w(()=>{li();ci();Os=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Cn({processors:As,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return _e(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Pn(this.ctx,t);let o=On(this.ctx,t),{"~standard":n,...i}=o;return i}}});var c_={};var l_=w(()=>{});var sn={};Gt(sn,{$ZodAny:()=>qu,$ZodArray:()=>tp,$ZodAsyncError:()=>Lt,$ZodBase64:()=>zu,$ZodBase64URL:()=>Fu,$ZodBigInt:()=>Za,$ZodBigIntFormat:()=>Hu,$ZodBoolean:()=>ei,$ZodCIDRv4:()=>ju,$ZodCIDRv6:()=>Mu,$ZodCUID:()=>Eu,$ZodCUID2:()=>Tu,$ZodCatch:()=>vp,$ZodCheck:()=>Ee,$ZodCheckBigIntFormat:()=>Qd,$ZodCheckEndsWith:()=>uu,$ZodCheckGreaterThan:()=>Fa,$ZodCheckIncludes:()=>lu,$ZodCheckLengthEquals:()=>iu,$ZodCheckLessThan:()=>za,$ZodCheckLowerCase:()=>su,$ZodCheckMaxLength:()=>ru,$ZodCheckMaxSize:()=>eu,$ZodCheckMimeType:()=>hu,$ZodCheckMinLength:()=>ou,$ZodCheckMinSize:()=>tu,$ZodCheckMultipleOf:()=>Jd,$ZodCheckNumberFormat:()=>Xd,$ZodCheckOverwrite:()=>mu,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>au,$ZodCheckSizeEquals:()=>nu,$ZodCheckStartsWith:()=>du,$ZodCheckStringFormat:()=>Or,$ZodCheckUpperCase:()=>cu,$ZodCodec:()=>ni,$ZodCustom:()=>$p,$ZodCustomStringFormat:()=>Wu,$ZodDate:()=>ep,$ZodDefault:()=>fp,$ZodDiscriminatedUnion:()=>op,$ZodE164:()=>Gu,$ZodEmail:()=>_u,$ZodEmoji:()=>xu,$ZodEncodeError:()=>xn,$ZodEnum:()=>lp,$ZodError:()=>Zo,$ZodExactOptional:()=>hp,$ZodFile:()=>up,$ZodFunction:()=>Sp,$ZodGUID:()=>vu,$ZodIPv4:()=>Ru,$ZodIPv6:()=>Lu,$ZodISODate:()=>Pu,$ZodISODateTime:()=>Cu,$ZodISODuration:()=>Nu,$ZodISOTime:()=>Ou,$ZodIntersection:()=>ip,$ZodJWT:()=>Bu,$ZodKSUID:()=>Iu,$ZodLazy:()=>Tp,$ZodLiteral:()=>dp,$ZodMAC:()=>Du,$ZodMap:()=>sp,$ZodNaN:()=>wp,$ZodNanoID:()=>Su,$ZodNever:()=>Xu,$ZodNonOptional:()=>yp,$ZodNull:()=>Yu,$ZodNullable:()=>mp,$ZodNumber:()=>Va,$ZodNumberFormat:()=>Ku,$ZodObject:()=>lv,$ZodObjectJIT:()=>np,$ZodOptional:()=>qa,$ZodPipe:()=>Ja,$ZodPrefault:()=>gp,$ZodPreprocess:()=>_p,$ZodPromise:()=>Ep,$ZodReadonly:()=>kp,$ZodRealError:()=>yt,$ZodRecord:()=>ap,$ZodRegistry:()=>ts,$ZodSet:()=>cp,$ZodString:()=>rr,$ZodStringFormat:()=>ke,$ZodSuccess:()=>bp,$ZodSymbol:()=>Vu,$ZodTemplateLiteral:()=>xp,$ZodTransform:()=>pp,$ZodTuple:()=>Ya,$ZodType:()=>de,$ZodULID:()=>$u,$ZodURL:()=>ku,$ZodUUID:()=>wu,$ZodUndefined:()=>Zu,$ZodUnion:()=>ti,$ZodUnknown:()=>Ju,$ZodVoid:()=>Qu,$ZodXID:()=>Au,$ZodXor:()=>rp,$brand:()=>od,$constructor:()=>k,$input:()=>Rp,$output:()=>Np,Doc:()=>Qo,JSONSchema:()=>c_,JSONSchemaGenerator:()=>Os,NEVER:()=>rd,TimePrecision:()=>Mp,_any:()=>ih,_array:()=>ph,_base64:()=>vs,_base64url:()=>ws,_bigint:()=>Xp,_boolean:()=>qp,_catch:()=>$P,_check:()=>i_,_cidrv4:()=>ys,_cidrv6:()=>bs,_coercedBigint:()=>Qp,_coercedBoolean:()=>Jp,_coercedDate:()=>dh,_coercedNumber:()=>Wp,_coercedString:()=>Dp,_cuid:()=>ds,_cuid2:()=>us,_custom:()=>mh,_date:()=>lh,_decode:()=>Ca,_decodeAsync:()=>Oa,_default:()=>SP,_discriminatedUnion:()=>pP,_e164:()=>_s,_email:()=>rs,_emoji:()=>cs,_encode:()=>Ia,_encodeAsync:()=>Pa,_endsWith:()=>Ur,_enum:()=>bP,_file:()=>hh,_float32:()=>Hp,_float64:()=>Vp,_gt:()=>Kt,_gte:()=>st,_guid:()=>ai,_includes:()=>jr,_int:()=>Kp,_int32:()=>Zp,_int64:()=>eh,_intersection:()=>hP,_ipv4:()=>fs,_ipv6:()=>gs,_isoDate:()=>zp,_isoDateTime:()=>Up,_isoDuration:()=>Gp,_isoTime:()=>Fp,_jwt:()=>ks,_ksuid:()=>ms,_lazy:()=>PP,_length:()=>ar,_literal:()=>wP,_lowercase:()=>Lr,_lt:()=>Wt,_lte:()=>Et,_mac:()=>jp,_map:()=>gP,_max:()=>Et,_maxLength:()=>ir,_maxSize:()=>In,_mime:()=>zr,_min:()=>st,_minLength:()=>an,_minSize:()=>Ht,_multipleOf:()=>An,_nan:()=>uh,_nanoid:()=>ls,_nativeEnum:()=>vP,_negative:()=>Ss,_never:()=>sh,_nonnegative:()=>Ts,_nonoptional:()=>EP,_nonpositive:()=>Es,_normalize:()=>Fr,_null:()=>oh,_nullable:()=>xP,_number:()=>Bp,_optional:()=>kP,_overwrite:()=>Dt,_parse:()=>Ar,_parseAsync:()=>Ir,_pipe:()=>AP,_positive:()=>xs,_promise:()=>OP,_property:()=>$s,_readonly:()=>IP,_record:()=>fP,_refine:()=>fh,_regex:()=>Rr,_safeDecode:()=>Ra,_safeDecodeAsync:()=>Da,_safeEncode:()=>Na,_safeEncodeAsync:()=>La,_safeParse:()=>Cr,_safeParseAsync:()=>Pr,_set:()=>yP,_size:()=>or,_slugify:()=>Kr,_startsWith:()=>Mr,_string:()=>Lp,_stringFormat:()=>Hr,_stringbool:()=>vh,_success:()=>TP,_superRefine:()=>gh,_symbol:()=>nh,_templateLiteral:()=>CP,_toLowerCase:()=>Br,_toUpperCase:()=>Wr,_transform:()=>_P,_trim:()=>Gr,_tuple:()=>mP,_uint32:()=>Yp,_uint64:()=>th,_ulid:()=>ps,_undefined:()=>rh,_union:()=>dP,_unknown:()=>ah,_uppercase:()=>Dr,_url:()=>si,_uuid:()=>os,_uuidv4:()=>is,_uuidv6:()=>as,_uuidv7:()=>ss,_void:()=>ch,_xid:()=>hs,_xor:()=>uP,clone:()=>it,config:()=>Oe,createStandardJSONSchemaMethod:()=>Vr,createToJSONSchemaMethod:()=>wh,decode:()=>OI,decodeAsync:()=>RI,describe:()=>yh,encode:()=>PI,encodeAsync:()=>NI,extractDefs:()=>Pn,finalize:()=>On,flattenError:()=>Yo,formatError:()=>qo,globalConfig:()=>Qn,globalRegistry:()=>We,initializeContext:()=>Cn,isValidBase64:()=>Uu,isValidBase64URL:()=>iv,isValidJWT:()=>av,locales:()=>oi,meta:()=>bh,parse:()=>$a,parseAsync:()=>Aa,prettifyError:()=>yd,process:()=>_e,regexes:()=>St,registry:()=>ns,safeDecode:()=>DI,safeDecodeAsync:()=>MI,safeEncode:()=>LI,safeEncodeAsync:()=>jI,safeParse:()=>vd,safeParseAsync:()=>wd,toDotPath:()=>Mb,toJSONSchema:()=>Ps,treeifyError:()=>gd,util:()=>W,version:()=>gu});var Tt=w(()=>{er();_d();bd();Ap();Ga();yu();oe();Ua();Op();ii();fu();a_();ci();li();s_();l_()});var Ns={};Gt(Ns,{endsWith:()=>Ur,gt:()=>Kt,gte:()=>st,includes:()=>jr,length:()=>ar,lowercase:()=>Lr,lt:()=>Wt,lte:()=>Et,maxLength:()=>ir,maxSize:()=>In,mime:()=>zr,minLength:()=>an,minSize:()=>Ht,multipleOf:()=>An,negative:()=>Ss,nonnegative:()=>Ts,nonpositive:()=>Es,normalize:()=>Fr,overwrite:()=>Dt,positive:()=>xs,property:()=>$s,regex:()=>Rr,size:()=>or,slugify:()=>Kr,startsWith:()=>Mr,toLowerCase:()=>Br,toUpperCase:()=>Wr,trim:()=>Gr,uppercase:()=>Dr});var Rs=w(()=>{Tt()});var Zr={};Gt(Zr,{ZodISODate:()=>Ds,ZodISODateTime:()=>Ls,ZodISODuration:()=>Ms,ZodISOTime:()=>js,date:()=>im,datetime:()=>om,duration:()=>sm,time:()=>am});function om(e){return Up(Ls,e)}function im(e){return zp(Ds,e)}function am(e){return Fp(js,e)}function sm(e){return Gp(Ms,e)}var Ls,Ds,js,Ms,di=w(()=>{Tt();pi();Ls=k("ZodISODateTime",(e,t)=>{Cu.init(e,t),xe.init(e,t)});Ds=k("ZodISODate",(e,t)=>{Pu.init(e,t),xe.init(e,t)});js=k("ZodISOTime",(e,t)=>{Ou.init(e,t),xe.init(e,t)});Ms=k("ZodISODuration",(e,t)=>{Nu.init(e,t),xe.init(e,t)})});var d_,LP,bt,cm=w(()=>{Tt();Tt();oe();d_=(e,t)=>{Zo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>qo(e,r)},flatten:{value:r=>Yo(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Er,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Er,2)}},isEmpty:{get(){return e.issues.length===0}}})},LP=k("ZodError",d_),bt=k("ZodError",d_,{Parent:Error})});var lm,dm,um,pm,hm,mm,fm,gm,ym,bm,vm,wm,_m=w(()=>{Tt();cm();lm=Ar(bt),dm=Ir(bt),um=Cr(bt),pm=Pr(bt),hm=Ia(bt),mm=Ca(bt),fm=Pa(bt),gm=Oa(bt),ym=Na(bt),bm=Ra(bt),vm=La(bt),wm=Da(bt)});var ui={};Gt(ui,{ZodAny:()=>Im,ZodArray:()=>Nm,ZodBase64:()=>ec,ZodBase64URL:()=>tc,ZodBigInt:()=>to,ZodBigIntFormat:()=>oc,ZodBoolean:()=>eo,ZodCIDRv4:()=>Xs,ZodCIDRv6:()=>Qs,ZodCUID:()=>Ks,ZodCUID2:()=>Hs,ZodCatch:()=>tf,ZodCodec:()=>Si,ZodCustom:()=>Ei,ZodCustomStringFormat:()=>Xr,ZodDate:()=>vi,ZodDefault:()=>Ym,ZodDiscriminatedUnion:()=>Lm,ZodE164:()=>nc,ZodEmail:()=>Gs,ZodEmoji:()=>Bs,ZodEnum:()=>qr,ZodExactOptional:()=>Hm,ZodFile:()=>Wm,ZodFunction:()=>pf,ZodGUID:()=>mi,ZodIPv4:()=>qs,ZodIPv6:()=>Js,ZodIntersection:()=>Dm,ZodJWT:()=>rc,ZodKSUID:()=>Ys,ZodLazy:()=>lf,ZodLiteral:()=>Bm,ZodMAC:()=>km,ZodMap:()=>Fm,ZodNaN:()=>rf,ZodNanoID:()=>Ws,ZodNever:()=>Pm,ZodNonOptional:()=>dc,ZodNull:()=>$m,ZodNullable:()=>Zm,ZodNumber:()=>Qr,ZodNumberFormat:()=>cr,ZodObject:()=>_i,ZodOptional:()=>lc,ZodPipe:()=>xi,ZodPrefault:()=>Jm,ZodPreprocess:()=>of,ZodPromise:()=>uf,ZodReadonly:()=>af,ZodRecord:()=>Yr,ZodSet:()=>Gm,ZodString:()=>Jr,ZodStringFormat:()=>xe,ZodSuccess:()=>ef,ZodSymbol:()=>Em,ZodTemplateLiteral:()=>cf,ZodTransform:()=>Km,ZodTuple:()=>Mm,ZodType:()=>pe,ZodULID:()=>Vs,ZodURL:()=>bi,ZodUUID:()=>Vt,ZodUndefined:()=>Tm,ZodUnion:()=>ki,ZodUnknown:()=>Cm,ZodVoid:()=>Om,ZodXID:()=>Zs,ZodXor:()=>Rm,_ZodString:()=>Fs,_default:()=>qm,_function:()=>bk,any:()=>Y_,array:()=>wi,base64:()=>O_,base64url:()=>N_,bigint:()=>W_,boolean:()=>Sm,catch:()=>nf,check:()=>vk,cidrv4:()=>C_,cidrv6:()=>P_,codec:()=>mk,cuid:()=>k_,cuid2:()=>x_,custom:()=>wk,date:()=>J_,describe:()=>_k,discriminatedUnion:()=>rk,e164:()=>R_,email:()=>p_,emoji:()=>w_,enum:()=>sc,exactOptional:()=>Vm,file:()=>dk,float32:()=>z_,float64:()=>F_,function:()=>bk,guid:()=>h_,hash:()=>U_,hex:()=>M_,hostname:()=>j_,httpUrl:()=>v_,instanceof:()=>xk,int:()=>Us,int32:()=>G_,int64:()=>K_,intersection:()=>jm,invertCodec:()=>fk,ipv4:()=>$_,ipv6:()=>I_,json:()=>Ek,jwt:()=>L_,keyof:()=>X_,ksuid:()=>T_,lazy:()=>df,literal:()=>lk,looseObject:()=>tk,looseRecord:()=>ik,mac:()=>A_,map:()=>ak,meta:()=>kk,nan:()=>hk,nanoid:()=>__,nativeEnum:()=>ck,never:()=>ic,nonoptional:()=>Qm,null:()=>Am,nullable:()=>gi,nullish:()=>uk,number:()=>xm,object:()=>Q_,optional:()=>fi,partialRecord:()=>ok,pipe:()=>zs,prefault:()=>Xm,preprocess:()=>Tk,promise:()=>yk,readonly:()=>sf,record:()=>zm,refine:()=>hf,set:()=>sk,strictObject:()=>ek,string:()=>hi,stringFormat:()=>D_,stringbool:()=>Sk,success:()=>pk,superRefine:()=>mf,symbol:()=>V_,templateLiteral:()=>gk,transform:()=>cc,tuple:()=>Um,uint32:()=>B_,uint64:()=>H_,ulid:()=>S_,undefined:()=>Z_,union:()=>ac,unknown:()=>sr,url:()=>b_,uuid:()=>m_,uuidv4:()=>f_,uuidv6:()=>g_,uuidv7:()=>y_,void:()=>q_,xid:()=>E_,xor:()=>nk});function yi(e,t,r){let o=Object.getPrototypeOf(e),n=u_.get(o);if(n||(n=new Set,u_.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function hi(e){return Lp(Jr,e)}function p_(e){return rs(Gs,e)}function h_(e){return ai(mi,e)}function m_(e){return os(Vt,e)}function f_(e){return is(Vt,e)}function g_(e){return as(Vt,e)}function y_(e){return ss(Vt,e)}function b_(e){return si(bi,e)}function v_(e){return si(bi,{protocol:St.httpProtocol,hostname:St.domain,...W.normalizeParams(e)})}function w_(e){return cs(Bs,e)}function __(e){return ls(Ws,e)}function k_(e){return ds(Ks,e)}function x_(e){return us(Hs,e)}function S_(e){return ps(Vs,e)}function E_(e){return hs(Zs,e)}function T_(e){return ms(Ys,e)}function $_(e){return fs(qs,e)}function A_(e){return jp(km,e)}function I_(e){return gs(Js,e)}function C_(e){return ys(Xs,e)}function P_(e){return bs(Qs,e)}function O_(e){return vs(ec,e)}function N_(e){return ws(tc,e)}function R_(e){return _s(nc,e)}function L_(e){return ks(rc,e)}function D_(e,t,r={}){return Hr(Xr,e,t,r)}function j_(e){return Hr(Xr,"hostname",St.hostname,e)}function M_(e){return Hr(Xr,"hex",St.hex,e)}function U_(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=St[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Hr(Xr,o,n,t)}function xm(e){return Bp(Qr,e)}function Us(e){return Kp(cr,e)}function z_(e){return Hp(cr,e)}function F_(e){return Vp(cr,e)}function G_(e){return Zp(cr,e)}function B_(e){return Yp(cr,e)}function Sm(e){return qp(eo,e)}function W_(e){return Xp(to,e)}function K_(e){return eh(oc,e)}function H_(e){return th(oc,e)}function V_(e){return nh(Em,e)}function Z_(e){return rh(Tm,e)}function Am(e){return oh($m,e)}function Y_(){return ih(Im)}function sr(){return ah(Cm)}function ic(e){return sh(Pm,e)}function q_(e){return ch(Om,e)}function J_(e){return lh(vi,e)}function wi(e,t){return ph(Nm,e,t)}function X_(e){let t=e._zod.def.shape;return sc(Object.keys(t))}function Q_(e,t){let r={type:"object",shape:e??{},...W.normalizeParams(t)};return new _i(r)}function ek(e,t){return new _i({type:"object",shape:e,catchall:ic(),...W.normalizeParams(t)})}function tk(e,t){return new _i({type:"object",shape:e,catchall:sr(),...W.normalizeParams(t)})}function ac(e,t){return new ki({type:"union",options:e,...W.normalizeParams(t)})}function nk(e,t){return new Rm({type:"union",options:e,inclusive:!1,...W.normalizeParams(t)})}function rk(e,t,r){return new Lm({type:"union",options:t,discriminator:e,...W.normalizeParams(r)})}function jm(e,t){return new Dm({type:"intersection",left:e,right:t})}function Um(e,t,r){let o=t instanceof de,n=o?r:t,i=o?t:null;return new Mm({type:"tuple",items:e,rest:i,...W.normalizeParams(n)})}function zm(e,t,r){return!t||!t._zod?new Yr({type:"record",keyType:hi(),valueType:e,...W.normalizeParams(t)}):new Yr({type:"record",keyType:e,valueType:t,...W.normalizeParams(r)})}function ok(e,t,r){let o=it(e);return o._zod.values=void 0,new Yr({type:"record",keyType:o,valueType:t,...W.normalizeParams(r)})}function ik(e,t,r){return new Yr({type:"record",keyType:e,valueType:t,mode:"loose",...W.normalizeParams(r)})}function ak(e,t,r){return new Fm({type:"map",keyType:e,valueType:t,...W.normalizeParams(r)})}function sk(e,t){return new Gm({type:"set",valueType:e,...W.normalizeParams(t)})}function sc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new qr({type:"enum",entries:r,...W.normalizeParams(t)})}function ck(e,t){return new qr({type:"enum",entries:e,...W.normalizeParams(t)})}function lk(e,t){return new Bm({type:"literal",values:Array.isArray(e)?e:[e],...W.normalizeParams(t)})}function dk(e){return hh(Wm,e)}function cc(e){return new Km({type:"transform",transform:e})}function fi(e){return new lc({type:"optional",innerType:e})}function Vm(e){return new Hm({type:"optional",innerType:e})}function gi(e){return new Zm({type:"nullable",innerType:e})}function uk(e){return fi(gi(e))}function qm(e,t){return new Ym({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}function Xm(e,t){return new Jm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}function Qm(e,t){return new dc({type:"nonoptional",innerType:e,...W.normalizeParams(t)})}function pk(e){return new ef({type:"success",innerType:e})}function nf(e,t){return new tf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function hk(e){return uh(rf,e)}function zs(e,t){return new xi({type:"pipe",in:e,out:t})}function mk(e,t,r){return new Si({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function fk(e){let t=e._zod.def;return new Si({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function sf(e){return new af({type:"readonly",innerType:e})}function gk(e,t){return new cf({type:"template_literal",parts:e,...W.normalizeParams(t)})}function df(e){return new lf({type:"lazy",getter:e})}function yk(e){return new uf({type:"promise",innerType:e})}function bk(e){return new pf({type:"function",input:Array.isArray(e?.input)?Um(e?.input):e?.input??wi(sr()),output:e?.output??sr()})}function vk(e){let t=new Ee({check:"custom"});return t._zod.check=e,t}function wk(e,t){return mh(Ei,e??(()=>!0),t)}function hf(e,t={}){return fh(Ei,e,t)}function mf(e,t){return gh(e,t)}function xk(e,t={}){let r=new Ei({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...W.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function Ek(e){let t=df(()=>ac([hi(e),xm(),Sm(),Am(),wi(t),zm(hi(),t)]));return t}function Tk(e,t){return new of({type:"pipe",in:cc(e),out:t})}var u_,pe,Fs,Jr,xe,Gs,mi,Vt,bi,Bs,Ws,Ks,Hs,Vs,Zs,Ys,qs,km,Js,Xs,Qs,ec,tc,nc,rc,Xr,Qr,cr,eo,to,oc,Em,Tm,$m,Im,Cm,Pm,Om,vi,Nm,_i,ki,Rm,Lm,Dm,Mm,Yr,Fm,Gm,qr,Bm,Wm,Km,lc,Hm,Zm,Ym,Jm,dc,ef,tf,rf,xi,Si,of,af,cf,lf,uf,pf,Ei,_k,kk,Sk,pi=w(()=>{Tt();Tt();li();ci();Rs();di();_m();u_=new WeakMap;pe=k("ZodType",(e,t)=>(de.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vr(e,"input"),output:Vr(e,"output")}}),e.toJSONSchema=wh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>lm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>um(e,r,o),e.parseAsync=async(r,o)=>dm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>pm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>hm(e,r,o),e.decode=(r,o)=>mm(e,r,o),e.encodeAsync=async(r,o)=>fm(e,r,o),e.decodeAsync=async(r,o)=>gm(e,r,o),e.safeEncode=(r,o)=>ym(e,r,o),e.safeDecode=(r,o)=>bm(e,r,o),e.safeEncodeAsync=async(r,o)=>vm(e,r,o),e.safeDecodeAsync=async(r,o)=>wm(e,r,o),yi(e,"ZodType",{check(...r){let o=this.def;return this.clone(W.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return it(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(hf(r,o))},superRefine(r,o){return this.check(mf(r,o))},overwrite(r){return this.check(Dt(r))},optional(){return fi(this)},exactOptional(){return Vm(this)},nullable(){return gi(this)},nullish(){return fi(gi(this))},nonoptional(r){return Qm(this,r)},array(){return wi(this)},or(r){return ac([this,r])},and(r){return jm(this,r)},transform(r){return zs(this,cc(r))},default(r){return qm(this,r)},prefault(r){return Xm(this,r)},catch(r){return nf(this,r)},pipe(r){return zs(this,r)},readonly(){return sf(this)},describe(r){let o=this.clone();return We.add(o,{description:r}),o},meta(...r){if(r.length===0)return We.get(this);let o=this.clone();return We.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return We.get(e)?.description},configurable:!0}),e)),Fs=k("_ZodString",(e,t)=>{rr.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>_h(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,yi(e,"_ZodString",{regex(...o){return this.check(Rr(...o))},includes(...o){return this.check(jr(...o))},startsWith(...o){return this.check(Mr(...o))},endsWith(...o){return this.check(Ur(...o))},min(...o){return this.check(an(...o))},max(...o){return this.check(ir(...o))},length(...o){return this.check(ar(...o))},nonempty(...o){return this.check(an(1,...o))},lowercase(o){return this.check(Lr(o))},uppercase(o){return this.check(Dr(o))},trim(){return this.check(Gr())},normalize(...o){return this.check(Fr(...o))},toLowerCase(){return this.check(Br())},toUpperCase(){return this.check(Wr())},slugify(){return this.check(Kr())}})}),Jr=k("ZodString",(e,t)=>{rr.init(e,t),Fs.init(e,t),e.email=r=>e.check(rs(Gs,r)),e.url=r=>e.check(si(bi,r)),e.jwt=r=>e.check(ks(rc,r)),e.emoji=r=>e.check(cs(Bs,r)),e.guid=r=>e.check(ai(mi,r)),e.uuid=r=>e.check(os(Vt,r)),e.uuidv4=r=>e.check(is(Vt,r)),e.uuidv6=r=>e.check(as(Vt,r)),e.uuidv7=r=>e.check(ss(Vt,r)),e.nanoid=r=>e.check(ls(Ws,r)),e.guid=r=>e.check(ai(mi,r)),e.cuid=r=>e.check(ds(Ks,r)),e.cuid2=r=>e.check(us(Hs,r)),e.ulid=r=>e.check(ps(Vs,r)),e.base64=r=>e.check(vs(ec,r)),e.base64url=r=>e.check(ws(tc,r)),e.xid=r=>e.check(hs(Zs,r)),e.ksuid=r=>e.check(ms(Ys,r)),e.ipv4=r=>e.check(fs(qs,r)),e.ipv6=r=>e.check(gs(Js,r)),e.cidrv4=r=>e.check(ys(Xs,r)),e.cidrv6=r=>e.check(bs(Qs,r)),e.e164=r=>e.check(_s(nc,r)),e.datetime=r=>e.check(om(r)),e.date=r=>e.check(im(r)),e.time=r=>e.check(am(r)),e.duration=r=>e.check(sm(r))});xe=k("ZodStringFormat",(e,t)=>{ke.init(e,t),Fs.init(e,t)}),Gs=k("ZodEmail",(e,t)=>{_u.init(e,t),xe.init(e,t)});mi=k("ZodGUID",(e,t)=>{vu.init(e,t),xe.init(e,t)});Vt=k("ZodUUID",(e,t)=>{wu.init(e,t),xe.init(e,t)});bi=k("ZodURL",(e,t)=>{ku.init(e,t),xe.init(e,t)});Bs=k("ZodEmoji",(e,t)=>{xu.init(e,t),xe.init(e,t)});Ws=k("ZodNanoID",(e,t)=>{Su.init(e,t),xe.init(e,t)});Ks=k("ZodCUID",(e,t)=>{Eu.init(e,t),xe.init(e,t)});Hs=k("ZodCUID2",(e,t)=>{Tu.init(e,t),xe.init(e,t)});Vs=k("ZodULID",(e,t)=>{$u.init(e,t),xe.init(e,t)});Zs=k("ZodXID",(e,t)=>{Au.init(e,t),xe.init(e,t)});Ys=k("ZodKSUID",(e,t)=>{Iu.init(e,t),xe.init(e,t)});qs=k("ZodIPv4",(e,t)=>{Ru.init(e,t),xe.init(e,t)});km=k("ZodMAC",(e,t)=>{Du.init(e,t),xe.init(e,t)});Js=k("ZodIPv6",(e,t)=>{Lu.init(e,t),xe.init(e,t)});Xs=k("ZodCIDRv4",(e,t)=>{ju.init(e,t),xe.init(e,t)});Qs=k("ZodCIDRv6",(e,t)=>{Mu.init(e,t),xe.init(e,t)});ec=k("ZodBase64",(e,t)=>{zu.init(e,t),xe.init(e,t)});tc=k("ZodBase64URL",(e,t)=>{Fu.init(e,t),xe.init(e,t)});nc=k("ZodE164",(e,t)=>{Gu.init(e,t),xe.init(e,t)});rc=k("ZodJWT",(e,t)=>{Bu.init(e,t),xe.init(e,t)});Xr=k("ZodCustomStringFormat",(e,t)=>{Wu.init(e,t),xe.init(e,t)});Qr=k("ZodNumber",(e,t)=>{Va.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>kh(e,o,n,i),yi(e,"ZodNumber",{gt(o,n){return this.check(Kt(o,n))},gte(o,n){return this.check(st(o,n))},min(o,n){return this.check(st(o,n))},lt(o,n){return this.check(Wt(o,n))},lte(o,n){return this.check(Et(o,n))},max(o,n){return this.check(Et(o,n))},int(o){return this.check(Us(o))},safe(o){return this.check(Us(o))},positive(o){return this.check(Kt(0,o))},nonnegative(o){return this.check(st(0,o))},negative(o){return this.check(Wt(0,o))},nonpositive(o){return this.check(Et(0,o))},multipleOf(o,n){return this.check(An(o,n))},step(o,n){return this.check(An(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});cr=k("ZodNumberFormat",(e,t)=>{Ku.init(e,t),Qr.init(e,t)});eo=k("ZodBoolean",(e,t)=>{ei.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xh(e,r,o,n)});to=k("ZodBigInt",(e,t)=>{Za.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Sh(e,o,n,i),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.gt=(o,n)=>e.check(Kt(o,n)),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.lt=(o,n)=>e.check(Wt(o,n)),e.lte=(o,n)=>e.check(Et(o,n)),e.max=(o,n)=>e.check(Et(o,n)),e.positive=o=>e.check(Kt(BigInt(0),o)),e.negative=o=>e.check(Wt(BigInt(0),o)),e.nonpositive=o=>e.check(Et(BigInt(0),o)),e.nonnegative=o=>e.check(st(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(An(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});oc=k("ZodBigIntFormat",(e,t)=>{Hu.init(e,t),to.init(e,t)});Em=k("ZodSymbol",(e,t)=>{Vu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eh(e,r,o,n)});Tm=k("ZodUndefined",(e,t)=>{Zu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$h(e,r,o,n)});$m=k("ZodNull",(e,t)=>{Yu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Th(e,r,o,n)});Im=k("ZodAny",(e,t)=>{qu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ch(e,r,o,n)});Cm=k("ZodUnknown",(e,t)=>{Ju.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ph(e,r,o,n)});Pm=k("ZodNever",(e,t)=>{Xu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ih(e,r,o,n)});Om=k("ZodVoid",(e,t)=>{Qu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ah(e,r,o,n)});vi=k("ZodDate",(e,t)=>{ep.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Oh(e,o,n,i),e.min=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(Et(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});Nm=k("ZodArray",(e,t)=>{tp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wh(e,r,o,n),e.element=t.element,yi(e,"ZodArray",{min(r,o){return this.check(an(r,o))},nonempty(r){return this.check(an(1,r))},max(r,o){return this.check(ir(r,o))},length(r,o){return this.check(ar(r,o))},unwrap(){return this.element}})});_i=k("ZodObject",(e,t)=>{np.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kh(e,r,o,n),W.defineLazy(e,"shape",()=>t.shape),yi(e,"ZodObject",{keyof(){return sc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:sr()})},loose(){return this.clone({...this._zod.def,catchall:sr()})},strict(){return this.clone({...this._zod.def,catchall:ic()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return W.extend(this,r)},safeExtend(r){return W.safeExtend(this,r)},merge(r){return W.merge(this,r)},pick(r){return W.pick(this,r)},omit(r){return W.omit(this,r)},partial(...r){return W.partial(lc,this,r[0])},required(...r){return W.required(dc,this,r[0])}})});ki=k("ZodUnion",(e,t)=>{ti.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n),e.options=t.options});Rm=k("ZodXor",(e,t)=>{ki.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n),e.options=t.options});Lm=k("ZodDiscriminatedUnion",(e,t)=>{ki.init(e,t),op.init(e,t)});Dm=k("ZodIntersection",(e,t)=>{ip.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hh(e,r,o,n)});Mm=k("ZodTuple",(e,t)=>{Ya.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vh(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});Yr=k("ZodRecord",(e,t)=>{ap.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zh(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});Fm=k("ZodMap",(e,t)=>{sp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gh(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(In(...r)),e.size=(...r)=>e.check(or(...r))});Gm=k("ZodSet",(e,t)=>{cp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bh(e,r,o,n),e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(In(...r)),e.size=(...r)=>e.check(or(...r))});qr=k("ZodEnum",(e,t)=>{lp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Nh(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new qr({...t,checks:[],...W.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new qr({...t,checks:[],...W.normalizeParams(n),entries:i})}});Bm=k("ZodLiteral",(e,t)=>{dp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rh(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Wm=k("ZodFile",(e,t)=>{up.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jh(e,r,o,n),e.min=(r,o)=>e.check(Ht(r,o)),e.max=(r,o)=>e.check(In(r,o)),e.mime=(r,o)=>e.check(zr(Array.isArray(r)?r:[r],o))});Km=k("ZodTransform",(e,t)=>{pp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fh(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(W.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(W.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});lc=k("ZodOptional",(e,t)=>{qa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Hm=k("ZodExactOptional",(e,t)=>{hp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Zm=k("ZodNullable",(e,t)=>{mp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ym=k("ZodDefault",(e,t)=>{fp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Jm=k("ZodPrefault",(e,t)=>{gp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dc=k("ZodNonOptional",(e,t)=>{yp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});ef=k("ZodSuccess",(e,t)=>{bp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});tf=k("ZodCatch",(e,t)=>{vp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});rf=k("ZodNaN",(e,t)=>{wp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lh(e,r,o,n)});xi=k("ZodPipe",(e,t)=>{Ja.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>em(e,r,o,n),e.in=t.in,e.out=t.out});Si=k("ZodCodec",(e,t)=>{xi.init(e,t),ni.init(e,t)});of=k("ZodPreprocess",(e,t)=>{xi.init(e,t),_p.init(e,t)}),af=k("ZodReadonly",(e,t)=>{kp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});cf=k("ZodTemplateLiteral",(e,t)=>{xp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dh(e,r,o,n)});lf=k("ZodLazy",(e,t)=>{Tp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});uf=k("ZodPromise",(e,t)=>{Ep.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});pf=k("ZodFunction",(e,t)=>{Sp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zh(e,r,o,n)});Ei=k("ZodCustom",(e,t)=>{$p.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uh(e,r,o,n)});_k=yh,kk=bh;Sk=(...e)=>vh({Codec:Si,Boolean:eo,String:Jr},...e)});function MP(e){Oe({customError:e})}function UP(){return Oe().customError}var jP,ff,$k=w(()=>{Tt();jP={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};ff||(ff={})});function FP(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function GP(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Ak(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ee.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return ee.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=GP(n,t),a=Je(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return ee.null();if(n.length===0)return ee.never();if(n.length===1)return ee.literal(n[0]);if(n.every(a=>typeof a=="string"))return ee.enum(n);let i=n.map(a=>ee.literal(a));return i.length<2?i[0]:ee.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return ee.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return Ak(a,t)});return n.length===0?ee.never():n.length===1?n[0]:ee.union(n)}if(!r)return ee.any();let o;switch(r){case"string":{let n=ee.string();if(e.format){let i=e.format;i==="email"?n=n.check(ee.email()):i==="uri"||i==="uri-reference"?n=n.check(ee.url()):i==="uuid"||i==="guid"?n=n.check(ee.uuid()):i==="date-time"?n=n.check(ee.iso.datetime()):i==="date"?n=n.check(ee.iso.date()):i==="time"?n=n.check(ee.iso.time()):i==="duration"?n=n.check(ee.iso.duration()):i==="ipv4"?n=n.check(ee.ipv4()):i==="ipv6"?n=n.check(ee.ipv6()):i==="mac"?n=n.check(ee.mac()):i==="cidr"?n=n.check(ee.cidrv4()):i==="cidr-v6"?n=n.check(ee.cidrv6()):i==="base64"?n=n.check(ee.base64()):i==="base64url"?n=n.check(ee.base64url()):i==="e164"?n=n.check(ee.e164()):i==="jwt"?n=n.check(ee.jwt()):i==="emoji"?n=n.check(ee.emoji()):i==="nanoid"?n=n.check(ee.nanoid()):i==="cuid"?n=n.check(ee.cuid()):i==="cuid2"?n=n.check(ee.cuid2()):i==="ulid"?n=n.check(ee.ulid()):i==="xid"?n=n.check(ee.xid()):i==="ksuid"&&(n=n.check(ee.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?ee.number().int():ee.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=ee.boolean();break}case"null":{o=ee.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[d,l]of Object.entries(i)){let p=Je(l,t);n[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=Je(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Je(e.additionalProperties,t):ee.any();if(Object.keys(n).length===0){o=ee.record(d,l);break}let p=ee.object(n).passthrough(),h=ee.looseRecord(d,l);o=ee.intersection(p,h);break}if(e.patternProperties){let d=e.patternProperties,l=Object.keys(d),p=[];for(let m of l){let y=Je(d[m],t),x=ee.string().regex(new RegExp(m));p.push(ee.looseRecord(x,y))}let h=[];if(Object.keys(n).length>0&&h.push(ee.object(n).passthrough()),h.push(...p),h.length===0)o=ee.object({}).passthrough();else if(h.length===1)o=h[0];else{let m=ee.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)m=ee.intersection(m,h[y]);o=m}break}let s=ee.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Je(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(d=>Je(d,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Je(i,t):void 0;s?o=ee.tuple(a).rest(s):o=ee.tuple(a),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(d=>Je(d,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Je(e.additionalItems,t):void 0;s?o=ee.tuple(a).rest(s):o=ee.tuple(a),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(i!==void 0){let a=Je(i,t),s=ee.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=ee.array(ee.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Je(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let r=Ak(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>Je(l,t)),d=ee.union(s);r=o?ee.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>Je(l,t)),d=ee.xor(s);r=o?ee.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:ee.any();else{let s=o?r:Je(e.allOf[0],t),d=o?0:1;for(let l=d;l<e.allOf.length;l++)s=ee.intersection(s,Je(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=ee.nullable(r)),e.readOnly===!0&&(r=ee.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))zP.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function Ik(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=FP(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??We};return Je(r,i)}var ee,zP,Ck=w(()=>{ii();Rs();di();pi();ee={...ui,...Ns,iso:Zr},zP=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var gf={};Gt(gf,{bigint:()=>HP,boolean:()=>KP,date:()=>VP,number:()=>WP,string:()=>BP});function BP(e){return Dp(Jr,e)}function WP(e){return Wp(Qr,e)}function KP(e){return Jp(eo,e)}function HP(e){return Qp(to,e)}function VP(e){return dh(vi,e)}var Pk=w(()=>{Tt();pi()});var c={};Gt(c,{$brand:()=>od,$input:()=>Rp,$output:()=>Np,NEVER:()=>rd,TimePrecision:()=>Mp,ZodAny:()=>Im,ZodArray:()=>Nm,ZodBase64:()=>ec,ZodBase64URL:()=>tc,ZodBigInt:()=>to,ZodBigIntFormat:()=>oc,ZodBoolean:()=>eo,ZodCIDRv4:()=>Xs,ZodCIDRv6:()=>Qs,ZodCUID:()=>Ks,ZodCUID2:()=>Hs,ZodCatch:()=>tf,ZodCodec:()=>Si,ZodCustom:()=>Ei,ZodCustomStringFormat:()=>Xr,ZodDate:()=>vi,ZodDefault:()=>Ym,ZodDiscriminatedUnion:()=>Lm,ZodE164:()=>nc,ZodEmail:()=>Gs,ZodEmoji:()=>Bs,ZodEnum:()=>qr,ZodError:()=>LP,ZodExactOptional:()=>Hm,ZodFile:()=>Wm,ZodFirstPartyTypeKind:()=>ff,ZodFunction:()=>pf,ZodGUID:()=>mi,ZodIPv4:()=>qs,ZodIPv6:()=>Js,ZodISODate:()=>Ds,ZodISODateTime:()=>Ls,ZodISODuration:()=>Ms,ZodISOTime:()=>js,ZodIntersection:()=>Dm,ZodIssueCode:()=>jP,ZodJWT:()=>rc,ZodKSUID:()=>Ys,ZodLazy:()=>lf,ZodLiteral:()=>Bm,ZodMAC:()=>km,ZodMap:()=>Fm,ZodNaN:()=>rf,ZodNanoID:()=>Ws,ZodNever:()=>Pm,ZodNonOptional:()=>dc,ZodNull:()=>$m,ZodNullable:()=>Zm,ZodNumber:()=>Qr,ZodNumberFormat:()=>cr,ZodObject:()=>_i,ZodOptional:()=>lc,ZodPipe:()=>xi,ZodPrefault:()=>Jm,ZodPreprocess:()=>of,ZodPromise:()=>uf,ZodReadonly:()=>af,ZodRealError:()=>bt,ZodRecord:()=>Yr,ZodSet:()=>Gm,ZodString:()=>Jr,ZodStringFormat:()=>xe,ZodSuccess:()=>ef,ZodSymbol:()=>Em,ZodTemplateLiteral:()=>cf,ZodTransform:()=>Km,ZodTuple:()=>Mm,ZodType:()=>pe,ZodULID:()=>Vs,ZodURL:()=>bi,ZodUUID:()=>Vt,ZodUndefined:()=>Tm,ZodUnion:()=>ki,ZodUnknown:()=>Cm,ZodVoid:()=>Om,ZodXID:()=>Zs,ZodXor:()=>Rm,_ZodString:()=>Fs,_default:()=>qm,_function:()=>bk,any:()=>Y_,array:()=>wi,base64:()=>O_,base64url:()=>N_,bigint:()=>W_,boolean:()=>Sm,catch:()=>nf,check:()=>vk,cidrv4:()=>C_,cidrv6:()=>P_,clone:()=>it,codec:()=>mk,coerce:()=>gf,config:()=>Oe,core:()=>sn,cuid:()=>k_,cuid2:()=>x_,custom:()=>wk,date:()=>J_,decode:()=>mm,decodeAsync:()=>gm,describe:()=>_k,discriminatedUnion:()=>rk,e164:()=>R_,email:()=>p_,emoji:()=>w_,encode:()=>hm,encodeAsync:()=>fm,endsWith:()=>Ur,enum:()=>sc,exactOptional:()=>Vm,file:()=>dk,flattenError:()=>Yo,float32:()=>z_,float64:()=>F_,formatError:()=>qo,fromJSONSchema:()=>Ik,function:()=>bk,getErrorMap:()=>UP,globalRegistry:()=>We,gt:()=>Kt,gte:()=>st,guid:()=>h_,hash:()=>U_,hex:()=>M_,hostname:()=>j_,httpUrl:()=>v_,includes:()=>jr,instanceof:()=>xk,int:()=>Us,int32:()=>G_,int64:()=>K_,intersection:()=>jm,invertCodec:()=>fk,ipv4:()=>$_,ipv6:()=>I_,iso:()=>Zr,json:()=>Ek,jwt:()=>L_,keyof:()=>X_,ksuid:()=>T_,lazy:()=>df,length:()=>ar,literal:()=>lk,locales:()=>oi,looseObject:()=>tk,looseRecord:()=>ik,lowercase:()=>Lr,lt:()=>Wt,lte:()=>Et,mac:()=>A_,map:()=>ak,maxLength:()=>ir,maxSize:()=>In,meta:()=>kk,mime:()=>zr,minLength:()=>an,minSize:()=>Ht,multipleOf:()=>An,nan:()=>hk,nanoid:()=>__,nativeEnum:()=>ck,negative:()=>Ss,never:()=>ic,nonnegative:()=>Ts,nonoptional:()=>Qm,nonpositive:()=>Es,normalize:()=>Fr,null:()=>Am,nullable:()=>gi,nullish:()=>uk,number:()=>xm,object:()=>Q_,optional:()=>fi,overwrite:()=>Dt,parse:()=>lm,parseAsync:()=>dm,partialRecord:()=>ok,pipe:()=>zs,positive:()=>xs,prefault:()=>Xm,preprocess:()=>Tk,prettifyError:()=>yd,promise:()=>yk,property:()=>$s,readonly:()=>sf,record:()=>zm,refine:()=>hf,regex:()=>Rr,regexes:()=>St,registry:()=>ns,safeDecode:()=>bm,safeDecodeAsync:()=>wm,safeEncode:()=>ym,safeEncodeAsync:()=>vm,safeParse:()=>um,safeParseAsync:()=>pm,set:()=>sk,setErrorMap:()=>MP,size:()=>or,slugify:()=>Kr,startsWith:()=>Mr,strictObject:()=>ek,string:()=>hi,stringFormat:()=>D_,stringbool:()=>Sk,success:()=>pk,superRefine:()=>mf,symbol:()=>V_,templateLiteral:()=>gk,toJSONSchema:()=>Ps,toLowerCase:()=>Br,toUpperCase:()=>Wr,transform:()=>cc,treeifyError:()=>gd,trim:()=>Gr,tuple:()=>Um,uint32:()=>B_,uint64:()=>H_,ulid:()=>S_,undefined:()=>Z_,union:()=>ac,unknown:()=>sr,uppercase:()=>Dr,url:()=>b_,util:()=>W,uuid:()=>m_,uuidv4:()=>f_,uuidv6:()=>g_,uuidv7:()=>y_,void:()=>q_,xid:()=>E_,xor:()=>nk});var yf=w(()=>{Tt();pi();Rs();cm();_m();$k();Tt();Ip();Tt();li();Ck();Op();di();di();Pk();Oe(Xa())});var ze=w(()=>{yf();yf()});function mc(e,t){return t==="article-launch"||t==="article-embed"?t==="article-embed"?"card":"launch":e==="predict"?"page":"screen"}var uc,pc,lr,hc,bf,vf,wf,Ok,_f,kf,dr,xf=w(()=>{"use strict";ze();uc=c.enum(["screen","canvas","launch","card","page","sheet"]),pc=c.enum(["fullscreen","article-launch","article-embed","app-webview"]),lr={screen:{name:"Screen",summary:"fills the phone and nothing scrolls; the layout adapts to the phone's size"},canvas:{name:"Scaled canvas",summary:"drawn at one size and scaled to fit the phone, with bars where the shape differs"},launch:{name:"Card that opens to full screen",summary:"a preview in the host page; tapping it opens the game full screen over the page"},card:{name:"Card",summary:"a fixed box inside a page that scrolls, with no scrolling inside the box"},page:{name:"Page",summary:"scrolls like a web page; for long question lists and results tables"},sheet:{name:"Sheet",summary:"slides up over part of a host app for one quick question"}},hc={fullscreen:{name:"Full screen",summary:"opened full screen, from a carousel, a Hub or a link"},"article-launch":{name:"Article, opening full screen",summary:"a card in an article that opens the game full screen over it"},"article-embed":{name:"Article embed",summary:"a box inside an article, played where it sits"},"app-webview":{name:"Web view in a native app",summary:"inside a club's or publisher's own app, in a web view"}},bf="Players come back to a game they can play properly. Full screen, a game feels like an app and gets played; a widget in an article reads as throwaway and gets scrolled past. Choose full screen unless your host can't allow it.",vf="An article box is small, easy to scroll past, and the page's own scrolling fights swipes inside the game. Use it only where the host can't open the game full screen.",wf="Inside a native app, set the web view's own background to the game's background colour and create it before the player taps, so nothing flashes white while it loads.";Ok=["screen","canvas","card","sheet"],_f={screen:{jsKb:350,cssKb:60,fontKb:150,totalKb:900,firstRenderMs:1800,playableMs:3500},canvas:{jsKb:500,cssKb:60,fontKb:150,totalKb:1500,firstRenderMs:1800,playableMs:4500},launch:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},card:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},page:{jsKb:400,cssKb:80,fontKb:150,totalKb:1100,firstRenderMs:1800,playableMs:4e3},sheet:{jsKb:250,cssKb:40,fontKb:100,totalKb:600,firstRenderMs:1200,playableMs:2500}},kf={name:"mid-range phone on 4G",cpuSlowdown:4,latencyMs:60,downloadKbps:9e3,uploadKbps:1500},dr="gamestage:playable"});function Nk(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(YP.has(t)||ZP.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return Nk(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function Rk(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(Nk(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var ZP,YP,Sf=w(()=>{"use strict";ZP=[".localhost",".local",".internal",".test",".localdomain"],YP=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var Ti,$i=w(()=>{"use strict";ze();Ti=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var Ai,fc=w(()=>{"use strict";ze();Ai=c.discriminatedUnion("source",[c.object({source:c.literal("manifest")}),c.object({source:c.literal("studio"),element_id:c.string().min(1),edition_id:c.string().min(1)})])});var Nn,Ef,Ii,lt,Zt,no,ro=w(()=>{"use strict";Nn="penalty_v1",Ef=["easy_v1","balanced_v1","hard_v1"],Ii="balanced_v1",lt={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Zt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},no="shoot"});function Uk(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function bc(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function cn(e){return`round-${e.number}`}var ur,oo,gc,Lk,qP,yc,JP,XP,QP,eO,Tf,Dk,tO,$f,jk,nO,Mk,rO,vc,oO,iO,aO,sO,cO,Xe,nF,rF,oF,Yt=w(()=>{"use strict";ze();rn();$i();fc();ro();ur={scoreOrder:c.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},oo=c.object({source:c.string().min(1),date:c.string().optional(),url:c.string().optional()}),gc=c.object({text:c.string().min(1),sources:c.array(oo).default([])}),Lk=c.enum(["highest","lowest","only_nonzero","only_zero"]),qP=c.object({measure:c.string().min(1),label:c.string().default(""),rule:Lk,scale:c.number().int().positive().default(1),values:c.record(c.string(),c.number().int().nonnegative()),perGuess:c.boolean().default(!0),sources:c.record(c.string(),oo).optional()}),yc=c.object({archetype:c.literal("hunt"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(2),targets:c.array(c.string().min(1)).min(1),required:c.number().int().positive().optional(),figures:qP.optional(),facts:c.array(gc).optional(),pointsPerTarget:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),JP=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative(),source:oo.optional()}),XP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(JP).min(1)}),QP=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),eO=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],Tf=c.object({mode:c.literal("proximity"),pointsPer:c.number().int().positive().default(1e3),exactBonus:c.number().int().nonnegative().default(500)}),Dk=c.object({archetype:c.literal("push"),scoring:Tf.optional(),facts:c.array(gc).optional(),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),theme:c.string().default(""),slates:c.array(XP).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(QP).default(eO),floorLabel:c.string().default("Rookie"),bustLabel:c.string().default("Busted"),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{if(e.line)if(e.line.length!==e.slates.length)t.addIssue({code:"custom",path:["line"],message:`The line has ${e.line.length} pick(s) for ${e.slates.length} slate(s). A perfect line is one pick per slate.`});else{let s=0,d=!1;for(let l of e.line){let h=e.slates.find(m=>m.id===l.slate)?.entries.find(m=>m.key===l.key);if(!h){d=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${l.key}" on slate "${l.slate}", which the round does not hold.`});break}s+=h.value}!d&&s!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${s}, not the target ${e.target}. A perfect line lands exactly.`})}let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(d=>d.key)),n=[...new Set(o.filter((s,d)=>o.indexOf(s)!==d))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,d)=>s+Math.min(...d.entries.map(l=>l.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,d)=>d===0||s.within>e.tiers[d-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),tO=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),$f=c.object({archetype:c.literal("group"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(tO).min(2),pointsPerGroup:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let d=r.get(s);d&&d!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${d} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),jk=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),nO=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(jk).optional(),min:c.number().optional(),max:c.number().optional(),step:c.number().positive().optional(),result:c.union([c.string().min(1),c.number()]).optional(),points:c.number().int().nonnegative().optional(),tolerance:c.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),Mk=c.object({archetype:c.literal("predict"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(jk).min(2).optional(),questions:c.array(nO).min(1).optional(),result:c.string().min(1).optional(),pointsForCorrect:c.number().int().nonnegative().default(10),attemptsAllowed:c.number().int().positive().default(1),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});rO=c.object({archetype:c.literal("bingo"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),rows:c.number().int().min(2),columns:c.number().int().min(2),centreMode:c.enum(["none","free","choice"]).default("none"),centreOptions:c.array(c.string().min(1)).optional(),allowCentreDuplicate:c.boolean().default(!1),lineTypes:c.array(c.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:c.array(c.object({key:c.string().min(1),label:c.string().min(1),note:c.string().optional(),result:c.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:c.number().int().nonnegative().default(10),pointsForFullBoard:c.number().int().nonnegative().default(0),shuffleAllowance:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),locksAt:c.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),vc=c.object({archetype:c.literal("shoot"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(Nn).default(Nn),difficulty:c.enum(Ef).default(Ii),shotsAllowed:c.number().int().min(1).max(20).default(5),goalsToWin:c.number().int().min(1).default(3),pointsPerGoal:c.number().int().nonnegative().default(100),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{e.goalsToWin>e.shotsAllowed&&t.addIssue({code:"custom",path:["goalsToWin"],message:`Asks for ${e.goalsToWin} goals from ${e.shotsAllowed} shots, which cannot be reached.`})}),oO=c.object({key:c.string().min(1),label:c.string().min(1),art:c.string().optional()}),iO=c.object({key:c.string().min(1),name:c.string().min(1),image:c.string().optional()}),aO=c.object({item:c.string().min(1),cells:c.array(c.string().min(1))}),sO=c.object({archetype:c.literal("place"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(oO).min(1),deck:c.array(iO).min(1),qualifies:c.array(aO).default([]),pointsPerPlacement:c.number().int().nonnegative().default(1),fullHouseBonus:c.number().int().nonnegative().default(0),mistakesAllowed:c.number().int().positive().default(4),skipsAllowed:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Set;for(let s of e.board)r.has(s.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${s.key}. Each one needs its own.`}),r.add(s.key);let o=new Set;for(let s of e.deck)o.has(s.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${s.key}. Each one needs its own.`}),o.add(s.key);let n=new Set,i=new Set;for(let s of e.qualifies){o.has(s.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is not a card in the deck.`}),n.has(s.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is listed twice. Give each card one row.`}),n.add(s.item);for(let d of s.cells)r.has(d)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} qualifies for ${d}, which is not on the board.`}),i.add(d)}let a=e.board.filter(s=>!i.has(s.key)).map(s=>s.key);a.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${a.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),cO=c.discriminatedUnion("archetype",[yc,Dk,$f,Mk,rO,vc,sO]),Xe=c.preprocess(Pb,cO);nF=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),rF=c.object({game:c.string().min(1),round:Xe,origin:Ai.optional(),snapshot:c.string().default(""),source:c.string().optional(),roundId:c.string().min(1).optional(),selection:c.object({mode:c.literal("rotation"),windowSeconds:c.number().int().positive(),rounds:c.array(c.object({id:c.string().min(1),round:Xe,origin:Ai.optional()})).min(1)}).optional()}),oF=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(Ti).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function hO(e){return Bk.includes(e)}function mO(e){return Kk.includes(qe(e))}function Hk(e){let t=[],r=e.backend.archetype;r&&mO(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Bt.join(", ")}. Name one of those, or say what your game does and ask us: a mechanic no format fits is a format we have not built, not a setting you are missing.`});let o=e.backend.route;o&&hO(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Cf}\`: every game runs on our Engine, and there is no route that runs a game on an engine of your own.`}),e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let n=e.operations.promotion;if(n.offers_prize&&(n.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),n.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!n.skill_based&&!n.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let a=e.identity.jwt[i],s=Rk(a);s&&t.push({path:`identity.jwt.${i}`,message:s==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":s==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var Ci,Af,If,io,zk,Pi,Rn,Ln,Fk,lO,qt,dO,uO,pO,Gk,Cf,Bk,Wk,Dn,Kk,fO,gO,yO,bO,vO,wO,_O,kO,Pf,xO,SO,EO,TO,jn,ao,ln=w(()=>{"use strict";ze();xf();Sf();Fo();rn();Yt();Ci="1.0",Af=c.enum(["missing","proposed","confirmed","verified","approved"]),If={missing:0,proposed:1,confirmed:2,verified:3,approved:4},io=c.enum(["runtime","live","enterprise"]),zk="Accounts must be approved before the first deploy.",Pi={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},Rn=c.enum(["L0","L1","L2","L3","L4","L5"]),Ln={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},Fk={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},lO=c.discriminatedUnion("kind",[c.object({kind:c.literal("human_decision"),owner:c.string(),date:c.string(),note:c.string().optional()}),c.object({kind:c.literal("generated_proposal"),tool:c.string(),model:c.string().optional(),source_context:c.string().optional()}),c.object({kind:c.literal("repository_evidence"),file:c.string(),commit:c.string().optional(),package:c.string().optional()}),c.object({kind:c.literal("platform_evidence"),system:c.string(),id:c.string()}),c.object({kind:c.literal("external_evidence"),supplier:c.string(),licence:c.string().optional(),dataset_version:c.string().optional()})]),qt={status:Af.default("missing"),provenance:c.array(lO).default([])},dO=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:Rn.default("L0")}),uO=c.object({repository:c.string().url(),branch:c.string().default("main")}),pO=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:uO.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...qt}),Gk=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Cf="managed_runtime",Bk=Gk.options.filter(e=>e!==Cf);Wk=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place"]),Dn=c.preprocess(e=>typeof e=="string"?qe(e):e,Wk),Kk=Wk.options.filter(e=>!Bt.includes(e));fO=c.object({route:Gk.optional().describe(`Only ${Cf} is a route Gamestage implements: every game runs on our Engine. ${Bk.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:Dn.optional().describe(`The formats the Engine marks are ${Bt.join(", ")}. ${Kk.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:c.string().optional(),version:c.string().optional(),variant:c.string().optional(),configuration:c.record(c.string(),c.unknown()).default({}),round:Xe.optional(),...qt}),gO=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(Sr),layout:uc.optional(),host:pc.optional(),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:Rn.optional()}).optional(),...qt}),yO=c.object({spec_url:c.string().optional(),version:c.string().optional(),...qt}),bO=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...qt}),vO=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...qt}),wO=c.object({required:c.boolean().default(!1),minimum_age:c.number().int().positive().max(120).optional(),method:c.enum(["self_declared","verified"]).default("self_declared"),verifier:c.string().optional()}),_O=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),kO=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:_O.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:wO.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...qt}),Pf=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),xO=c.object({destinations:c.array(Pf).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:c.array(c.string()).default([]),signal:c.object({enabled:c.boolean().default(!1),application_id:c.string().optional(),write_key:c.string().optional(),monterosa:c.object({enabled:c.boolean().default(!1),organisation_id:c.string().optional(),project_id:c.string().optional()}).prefault({})}).prefault({}),...qt}),SO=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...qt}),EO=c.object({offers_prize:c.boolean().default(!1),free_entry_route:c.string().optional(),skill_based:c.boolean().default(!1),terms_url:c.string().optional(),jurisdictions:c.array(c.string()).default([])}),TO=c.object({support_tier:io.optional(),runbook:c.string().optional(),promotion:EO.prefault({}),...qt}),jn=c.object({manifest:dO,app:pO,experience:gO.prefault({}),studio_app:yO.prefault({}),studio_surface:bO.prefault({}),backend:fO.prefault({}),interaction_cloud:vO.prefault({}),identity:kO.prefault({}),measurement:xO.prefault({}),deployment:SO.prefault({}),operations:TO.prefault({})});ao=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function vt(e,t={}){let r=m=>({id:m.id,level:m.level,requirement:m.requirement,advice:m.advice,owner:m.owner,passed:m.check(e,t)}),o=Of.filter(m=>m.checkable).map(r),n=Of.filter(m=>!m.checkable).map(r),i="L0",a=!0;for(let m of Nf){let y=o.filter(O=>O.level===m);y.length>0&&y.every(O=>O.passed)&&a?i=m:a=!1}let s=o.filter(m=>m.level==="L0").every(m=>m.passed),d=Ln[i]+1,l=Nf[d],p=l?o.filter(m=>m.level===l&&!m.passed):[],h=e.manifest.conformance;return{computed:i,computedName:Fk[i],claimed:h,overclaimed:!s||Math.min(Ln[h],Ln[Vk])>Ln[i],results:o,blockers:s?p:o.filter(m=>m.level==="L0"&&!m.passed),ceiling:Vk,advice:n}}function Zk(e,t){let o=vt(e).results.filter(n=>!n.passed&&Ln[n.level]<=Ln[t]);return{ok:o.length===0,missing:o}}var pr,Ke,Of,Nf,$O,mF,Vk,wc=w(()=>{"use strict";ln();pr=(e,t,r)=>{let o=e[t];return If[o?.status??"missing"]>=If[r]},Ke=e=>typeof e=="string"?e.trim().length>0:e!=null,Of=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>Ke(e.app.id)&&Ke(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>pr(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>Ke(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>Ke(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>pr(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>Ke(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>Ke(t.backendComponent)||Ke(e.backend.component)&&Ke(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>Ke(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>Ke(t.platformProject)||Ke(e.studio_app.spec_url)||Ke(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>Ke(t.playgroundUrl)||Ke(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>Ke(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>pr(e,"experience","confirmed")&&pr(e,"backend","confirmed")&&pr(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>pr(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>Ke(e.operations.support_tier)&&Ke(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Approve the game for prod, and move your workspace onto a paid plan. Monterosa does the second part.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>pr(e,"operations","approved")&&e.deployment.environments.includes("production")}],Nf=["L0","L1","L2","L3","L4","L5"],$O=[{level:"L0",name:"Concept",means:"the game has a name and a description we hold for it"},{level:"L1",name:"Experience built",means:"there is something to play, and scoring runs on our server rather than in the browser"},{level:"L2",name:"Wired to the platform",means:"it is set up on the Monterosa platform, knows who each player is, and sends its numbers to your analytics"},{level:"L3",name:"Fans can reach it",means:"it is deployed at an address a fan can open"},{level:"L4",name:"Production ready",means:"checked with evidence, with someone to call and a page saying what to do if it breaks"},{level:"L5",name:"Operating live",means:"reviewed with you, and running in production"}],mF=new Map($O.map(e=>[e.level,e])),Vk=[...Nf].reverse().find(e=>Of.some(t=>t.level===e&&t.checkable))??"L0"});function AO(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Oi(){if(Yk)return Mn;Yk=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}function o(a,s){if(s){let d=Object.keys(s);for(let l=0,p=d.length;l<p;l+=1){let h=d[l];a[h]=s[h]}}return a}function n(a,s){let d="";for(let l=0;l<s;l+=1)d+=a;return d}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return Mn.isNothing=e,Mn.isObject=t,Mn.toArray=r,Mn.repeat=n,Mn.isNegativeZero=i,Mn.extend=o,Mn}function Ni(){if(qk)return Rf;qk=1;function e(r,o){let n="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(n+='in "'+r.mark.name+'" '),n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!o&&r.mark.snippet&&(n+=`
|
|
77
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function On(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let d=e.seen.get(s);if(d.ref===null)return;let l=d.def??d.schema,p={...l},h=d.ref;if(d.ref=null,h){o(h);let y=e.seen.get(h),x=y.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(x)):Object.assign(l,x),Object.assign(l,p),s._zod.parent===h)for(let M in l)M==="$ref"||M==="allOf"||M in p||delete l[M];if(x.$ref&&y.def)for(let M in l)M==="$ref"||M==="allOf"||M in y.def&&JSON.stringify(l[M])===JSON.stringify(y.def[M])&&delete l[M]}let m=s._zod.parent;if(m&&m!==h){o(m);let y=e.seen.get(m);if(y?.schema.$ref&&(l.$ref=y.schema.$ref,y.def))for(let x in l)x==="$ref"||x==="allOf"||x in y.def&&JSON.stringify(l[x])===JSON.stringify(y.def[x])&&delete l[x]}e.override({zodSchema:s,jsonSchema:l,path:d.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let d=s[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,a[d.defId]=d.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vr(t,"input",e.processors),output:Vr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ct(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ct(o.element,r);if(o.type==="set")return ct(o.valueType,r);if(o.type==="lazy")return ct(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ct(o.innerType,r);if(o.type==="intersection")return ct(o.left,r)||ct(o.right,r);if(o.type==="record"||o.type==="map")return ct(o.keyType,r)||ct(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ct(o.in,r)||ct(o.out,r);if(o.type==="object"){for(let n in o.shape)if(ct(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(ct(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(ct(n,r))return!0;return!!(o.rest&&ct(o.rest,r))}return!1}var wh,Vr,ci=w(()=>{ii();wh=(e,t={})=>r=>{let o=Cn({...r,processors:t});return _e(e,o),Pn(o,e),On(o,e)},Vr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Cn({...n??{},target:i,io:t,processors:r});return _e(e,a),Pn(a,e),On(a,e)}});function Ps(e,t){if("_idmap"in e){let o=e,n=Cn({...t,processors:As}),i={};for(let d of o._idmap.entries()){let[l,p]=d;_e(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let d of o._idmap.entries()){let[l,p]=d;Pn(n,p),a[l]=On(n,p)}if(Object.keys(i).length>0){let d=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[d]:i}}return{schemas:a}}let r=Cn({...t,processors:As});return _e(e,r),Pn(r,e),On(r,e)}var RP,_h,kh,xh,Sh,Eh,Th,$h,Ah,Ih,Ch,Ph,Oh,Nh,Rh,Lh,Dh,jh,Mh,Uh,zh,Fh,Gh,Bh,Wh,Kh,Is,Hh,Vh,Zh,Yh,qh,Jh,Xh,Qh,em,tm,nm,Cs,rm,As,li=w(()=>{ci();oe();RP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_h=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:d,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=RP[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:p.length>1&&(n.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},kh=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:d,exclusiveMaximum:l,exclusiveMinimum:p}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let h=typeof p=="number"&&p>=(i??Number.NEGATIVE_INFINITY),m=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";h?y?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),m?y?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof d=="number"&&(n.multipleOf=d)},xh=(e,t,r,o)=>{r.type="boolean"},Sh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Eh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Th=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},$h=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ah=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Ih=(e,t,r,o)=>{r.not={}},Ch=(e,t,r,o)=>{},Ph=(e,t,r,o)=>{},Oh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Nh=(e,t,r,o)=>{let n=e._zod.def,i=Bo(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Rh=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Lh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Dh=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},jh=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:d}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),d?d.length===1?(i.contentMediaType=d[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=d.map(l=>({contentMediaType:l}))):Object.assign(n,i)},Mh=(e,t,r,o)=>{r.type="boolean"},Uh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Fh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Bh=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Wh=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=_e(i.element,t,{...o,path:[...o.path,"items"]})},Kh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let l in a)n.properties[l]=_e(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),d=new Set([...s].filter(l=>{let p=i.shape[l]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(n.required=Array.from(d)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=_e(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Is=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,d)=>_e(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",d]}));i?r.oneOf=a:r.anyOf=a},Hh=(e,t,r,o)=>{let n=e._zod.def,i=_e(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=_e(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,d=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=d},Vh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((m,y)=>_e(m,t,{...o,path:[...o.path,a,y]})),l=i.rest?_e(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=d,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:d},l&&n.items.anyOf.push(l),n.minItems=d.length,l||(n.maxItems=d.length)):(n.items=d,l&&(n.additionalItems=l));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},Zh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,d=a._zod.bag?.patterns;if(i.mode==="loose"&&d&&d.size>0){let p=_e(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of d)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=_e(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=_e(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let l=a._zod.values;if(l){let p=[...l].filter(h=>typeof h=="string"||typeof h=="number");p.length>0&&(n.required=p)}},Yh=(e,t,r,o)=>{let n=e._zod.def,i=_e(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},qh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Jh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Xh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Qh=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},em=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;_e(a,t,o);let s=t.seen.get(e);s.ref=a},tm=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},nm=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Cs=(e,t,r,o)=>{let n=e._zod.def;_e(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},rm=(e,t,r,o)=>{let n=e._zod.innerType;_e(n,t,o);let i=t.seen.get(e);i.ref=n},As={string:_h,number:kh,boolean:xh,bigint:Sh,symbol:Eh,null:Th,undefined:$h,void:Ah,never:Ih,any:Ch,unknown:Ph,date:Oh,enum:Nh,literal:Rh,nan:Lh,template_literal:Dh,file:jh,success:Mh,custom:Uh,function:zh,transform:Fh,map:Gh,set:Bh,array:Wh,object:Kh,union:Is,intersection:Hh,tuple:Vh,record:Zh,nullable:Yh,nonoptional:qh,default:Jh,prefault:Xh,catch:Qh,pipe:em,readonly:tm,promise:nm,optional:Cs,lazy:rm}});var Os,c_=w(()=>{li();ci();Os=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Cn({processors:As,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return _e(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Pn(this.ctx,t);let o=On(this.ctx,t),{"~standard":n,...i}=o;return i}}});var l_={};var d_=w(()=>{});var sn={};Gt(sn,{$ZodAny:()=>qu,$ZodArray:()=>tp,$ZodAsyncError:()=>Lt,$ZodBase64:()=>zu,$ZodBase64URL:()=>Fu,$ZodBigInt:()=>Za,$ZodBigIntFormat:()=>Hu,$ZodBoolean:()=>ei,$ZodCIDRv4:()=>ju,$ZodCIDRv6:()=>Mu,$ZodCUID:()=>Eu,$ZodCUID2:()=>Tu,$ZodCatch:()=>vp,$ZodCheck:()=>Ee,$ZodCheckBigIntFormat:()=>Qd,$ZodCheckEndsWith:()=>uu,$ZodCheckGreaterThan:()=>Fa,$ZodCheckIncludes:()=>lu,$ZodCheckLengthEquals:()=>iu,$ZodCheckLessThan:()=>za,$ZodCheckLowerCase:()=>su,$ZodCheckMaxLength:()=>ru,$ZodCheckMaxSize:()=>eu,$ZodCheckMimeType:()=>hu,$ZodCheckMinLength:()=>ou,$ZodCheckMinSize:()=>tu,$ZodCheckMultipleOf:()=>Jd,$ZodCheckNumberFormat:()=>Xd,$ZodCheckOverwrite:()=>mu,$ZodCheckProperty:()=>pu,$ZodCheckRegex:()=>au,$ZodCheckSizeEquals:()=>nu,$ZodCheckStartsWith:()=>du,$ZodCheckStringFormat:()=>Or,$ZodCheckUpperCase:()=>cu,$ZodCodec:()=>ni,$ZodCustom:()=>$p,$ZodCustomStringFormat:()=>Wu,$ZodDate:()=>ep,$ZodDefault:()=>fp,$ZodDiscriminatedUnion:()=>op,$ZodE164:()=>Gu,$ZodEmail:()=>_u,$ZodEmoji:()=>xu,$ZodEncodeError:()=>xn,$ZodEnum:()=>lp,$ZodError:()=>Zo,$ZodExactOptional:()=>hp,$ZodFile:()=>up,$ZodFunction:()=>Sp,$ZodGUID:()=>vu,$ZodIPv4:()=>Ru,$ZodIPv6:()=>Lu,$ZodISODate:()=>Pu,$ZodISODateTime:()=>Cu,$ZodISODuration:()=>Nu,$ZodISOTime:()=>Ou,$ZodIntersection:()=>ip,$ZodJWT:()=>Bu,$ZodKSUID:()=>Iu,$ZodLazy:()=>Tp,$ZodLiteral:()=>dp,$ZodMAC:()=>Du,$ZodMap:()=>sp,$ZodNaN:()=>wp,$ZodNanoID:()=>Su,$ZodNever:()=>Xu,$ZodNonOptional:()=>yp,$ZodNull:()=>Yu,$ZodNullable:()=>mp,$ZodNumber:()=>Va,$ZodNumberFormat:()=>Ku,$ZodObject:()=>dv,$ZodObjectJIT:()=>np,$ZodOptional:()=>qa,$ZodPipe:()=>Ja,$ZodPrefault:()=>gp,$ZodPreprocess:()=>_p,$ZodPromise:()=>Ep,$ZodReadonly:()=>kp,$ZodRealError:()=>yt,$ZodRecord:()=>ap,$ZodRegistry:()=>ts,$ZodSet:()=>cp,$ZodString:()=>rr,$ZodStringFormat:()=>ke,$ZodSuccess:()=>bp,$ZodSymbol:()=>Vu,$ZodTemplateLiteral:()=>xp,$ZodTransform:()=>pp,$ZodTuple:()=>Ya,$ZodType:()=>de,$ZodULID:()=>$u,$ZodURL:()=>ku,$ZodUUID:()=>wu,$ZodUndefined:()=>Zu,$ZodUnion:()=>ti,$ZodUnknown:()=>Ju,$ZodVoid:()=>Qu,$ZodXID:()=>Au,$ZodXor:()=>rp,$brand:()=>od,$constructor:()=>k,$input:()=>Rp,$output:()=>Np,Doc:()=>Qo,JSONSchema:()=>l_,JSONSchemaGenerator:()=>Os,NEVER:()=>rd,TimePrecision:()=>Mp,_any:()=>ih,_array:()=>ph,_base64:()=>vs,_base64url:()=>ws,_bigint:()=>Xp,_boolean:()=>qp,_catch:()=>AP,_check:()=>a_,_cidrv4:()=>ys,_cidrv6:()=>bs,_coercedBigint:()=>Qp,_coercedBoolean:()=>Jp,_coercedDate:()=>dh,_coercedNumber:()=>Wp,_coercedString:()=>Dp,_cuid:()=>ds,_cuid2:()=>us,_custom:()=>mh,_date:()=>lh,_decode:()=>Ca,_decodeAsync:()=>Oa,_default:()=>EP,_discriminatedUnion:()=>hP,_e164:()=>_s,_email:()=>rs,_emoji:()=>cs,_encode:()=>Ia,_encodeAsync:()=>Pa,_endsWith:()=>Ur,_enum:()=>vP,_file:()=>hh,_float32:()=>Hp,_float64:()=>Vp,_gt:()=>Kt,_gte:()=>st,_guid:()=>ai,_includes:()=>jr,_int:()=>Kp,_int32:()=>Zp,_int64:()=>eh,_intersection:()=>mP,_ipv4:()=>fs,_ipv6:()=>gs,_isoDate:()=>zp,_isoDateTime:()=>Up,_isoDuration:()=>Gp,_isoTime:()=>Fp,_jwt:()=>ks,_ksuid:()=>ms,_lazy:()=>OP,_length:()=>ar,_literal:()=>_P,_lowercase:()=>Lr,_lt:()=>Wt,_lte:()=>Et,_mac:()=>jp,_map:()=>yP,_max:()=>Et,_maxLength:()=>ir,_maxSize:()=>In,_mime:()=>zr,_min:()=>st,_minLength:()=>an,_minSize:()=>Ht,_multipleOf:()=>An,_nan:()=>uh,_nanoid:()=>ls,_nativeEnum:()=>wP,_negative:()=>Ss,_never:()=>sh,_nonnegative:()=>Ts,_nonoptional:()=>TP,_nonpositive:()=>Es,_normalize:()=>Fr,_null:()=>oh,_nullable:()=>SP,_number:()=>Bp,_optional:()=>xP,_overwrite:()=>Dt,_parse:()=>Ar,_parseAsync:()=>Ir,_pipe:()=>IP,_positive:()=>xs,_promise:()=>NP,_property:()=>$s,_readonly:()=>CP,_record:()=>gP,_refine:()=>fh,_regex:()=>Rr,_safeDecode:()=>Ra,_safeDecodeAsync:()=>Da,_safeEncode:()=>Na,_safeEncodeAsync:()=>La,_safeParse:()=>Cr,_safeParseAsync:()=>Pr,_set:()=>bP,_size:()=>or,_slugify:()=>Kr,_startsWith:()=>Mr,_string:()=>Lp,_stringFormat:()=>Hr,_stringbool:()=>vh,_success:()=>$P,_superRefine:()=>gh,_symbol:()=>nh,_templateLiteral:()=>PP,_toLowerCase:()=>Br,_toUpperCase:()=>Wr,_transform:()=>kP,_trim:()=>Gr,_tuple:()=>fP,_uint32:()=>Yp,_uint64:()=>th,_ulid:()=>ps,_undefined:()=>rh,_union:()=>uP,_unknown:()=>ah,_uppercase:()=>Dr,_url:()=>si,_uuid:()=>os,_uuidv4:()=>is,_uuidv6:()=>as,_uuidv7:()=>ss,_void:()=>ch,_xid:()=>hs,_xor:()=>pP,clone:()=>it,config:()=>Oe,createStandardJSONSchemaMethod:()=>Vr,createToJSONSchemaMethod:()=>wh,decode:()=>NI,decodeAsync:()=>LI,describe:()=>yh,encode:()=>OI,encodeAsync:()=>RI,extractDefs:()=>Pn,finalize:()=>On,flattenError:()=>Yo,formatError:()=>qo,globalConfig:()=>Qn,globalRegistry:()=>We,initializeContext:()=>Cn,isValidBase64:()=>Uu,isValidBase64URL:()=>av,isValidJWT:()=>sv,locales:()=>oi,meta:()=>bh,parse:()=>$a,parseAsync:()=>Aa,prettifyError:()=>yd,process:()=>_e,regexes:()=>St,registry:()=>ns,safeDecode:()=>jI,safeDecodeAsync:()=>UI,safeEncode:()=>DI,safeEncodeAsync:()=>MI,safeParse:()=>vd,safeParseAsync:()=>wd,toDotPath:()=>Ub,toJSONSchema:()=>Ps,treeifyError:()=>gd,util:()=>W,version:()=>gu});var Tt=w(()=>{er();_d();bd();Ap();Ga();yu();oe();Ua();Op();ii();fu();s_();ci();li();c_();d_()});var Ns={};Gt(Ns,{endsWith:()=>Ur,gt:()=>Kt,gte:()=>st,includes:()=>jr,length:()=>ar,lowercase:()=>Lr,lt:()=>Wt,lte:()=>Et,maxLength:()=>ir,maxSize:()=>In,mime:()=>zr,minLength:()=>an,minSize:()=>Ht,multipleOf:()=>An,negative:()=>Ss,nonnegative:()=>Ts,nonpositive:()=>Es,normalize:()=>Fr,overwrite:()=>Dt,positive:()=>xs,property:()=>$s,regex:()=>Rr,size:()=>or,slugify:()=>Kr,startsWith:()=>Mr,toLowerCase:()=>Br,toUpperCase:()=>Wr,trim:()=>Gr,uppercase:()=>Dr});var Rs=w(()=>{Tt()});var Zr={};Gt(Zr,{ZodISODate:()=>Ds,ZodISODateTime:()=>Ls,ZodISODuration:()=>Ms,ZodISOTime:()=>js,date:()=>im,datetime:()=>om,duration:()=>sm,time:()=>am});function om(e){return Up(Ls,e)}function im(e){return zp(Ds,e)}function am(e){return Fp(js,e)}function sm(e){return Gp(Ms,e)}var Ls,Ds,js,Ms,di=w(()=>{Tt();pi();Ls=k("ZodISODateTime",(e,t)=>{Cu.init(e,t),xe.init(e,t)});Ds=k("ZodISODate",(e,t)=>{Pu.init(e,t),xe.init(e,t)});js=k("ZodISOTime",(e,t)=>{Ou.init(e,t),xe.init(e,t)});Ms=k("ZodISODuration",(e,t)=>{Nu.init(e,t),xe.init(e,t)})});var u_,DP,bt,cm=w(()=>{Tt();Tt();oe();u_=(e,t)=>{Zo.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>qo(e,r)},flatten:{value:r=>Yo(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Er,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Er,2)}},isEmpty:{get(){return e.issues.length===0}}})},DP=k("ZodError",u_),bt=k("ZodError",u_,{Parent:Error})});var lm,dm,um,pm,hm,mm,fm,gm,ym,bm,vm,wm,_m=w(()=>{Tt();cm();lm=Ar(bt),dm=Ir(bt),um=Cr(bt),pm=Pr(bt),hm=Ia(bt),mm=Ca(bt),fm=Pa(bt),gm=Oa(bt),ym=Na(bt),bm=Ra(bt),vm=La(bt),wm=Da(bt)});var ui={};Gt(ui,{ZodAny:()=>Im,ZodArray:()=>Nm,ZodBase64:()=>ec,ZodBase64URL:()=>tc,ZodBigInt:()=>to,ZodBigIntFormat:()=>oc,ZodBoolean:()=>eo,ZodCIDRv4:()=>Xs,ZodCIDRv6:()=>Qs,ZodCUID:()=>Ks,ZodCUID2:()=>Hs,ZodCatch:()=>tf,ZodCodec:()=>Si,ZodCustom:()=>Ei,ZodCustomStringFormat:()=>Xr,ZodDate:()=>vi,ZodDefault:()=>Ym,ZodDiscriminatedUnion:()=>Lm,ZodE164:()=>nc,ZodEmail:()=>Gs,ZodEmoji:()=>Bs,ZodEnum:()=>qr,ZodExactOptional:()=>Hm,ZodFile:()=>Wm,ZodFunction:()=>pf,ZodGUID:()=>mi,ZodIPv4:()=>qs,ZodIPv6:()=>Js,ZodIntersection:()=>Dm,ZodJWT:()=>rc,ZodKSUID:()=>Ys,ZodLazy:()=>lf,ZodLiteral:()=>Bm,ZodMAC:()=>km,ZodMap:()=>Fm,ZodNaN:()=>rf,ZodNanoID:()=>Ws,ZodNever:()=>Pm,ZodNonOptional:()=>dc,ZodNull:()=>$m,ZodNullable:()=>Zm,ZodNumber:()=>Qr,ZodNumberFormat:()=>cr,ZodObject:()=>_i,ZodOptional:()=>lc,ZodPipe:()=>xi,ZodPrefault:()=>Jm,ZodPreprocess:()=>of,ZodPromise:()=>uf,ZodReadonly:()=>af,ZodRecord:()=>Yr,ZodSet:()=>Gm,ZodString:()=>Jr,ZodStringFormat:()=>xe,ZodSuccess:()=>ef,ZodSymbol:()=>Em,ZodTemplateLiteral:()=>cf,ZodTransform:()=>Km,ZodTuple:()=>Mm,ZodType:()=>pe,ZodULID:()=>Vs,ZodURL:()=>bi,ZodUUID:()=>Vt,ZodUndefined:()=>Tm,ZodUnion:()=>ki,ZodUnknown:()=>Cm,ZodVoid:()=>Om,ZodXID:()=>Zs,ZodXor:()=>Rm,_ZodString:()=>Fs,_default:()=>qm,_function:()=>vk,any:()=>q_,array:()=>wi,base64:()=>N_,base64url:()=>R_,bigint:()=>K_,boolean:()=>Sm,catch:()=>nf,check:()=>wk,cidrv4:()=>P_,cidrv6:()=>O_,codec:()=>fk,cuid:()=>x_,cuid2:()=>S_,custom:()=>_k,date:()=>X_,describe:()=>kk,discriminatedUnion:()=>ok,e164:()=>L_,email:()=>h_,emoji:()=>__,enum:()=>sc,exactOptional:()=>Vm,file:()=>uk,float32:()=>F_,float64:()=>G_,function:()=>vk,guid:()=>m_,hash:()=>z_,hex:()=>U_,hostname:()=>M_,httpUrl:()=>w_,instanceof:()=>Sk,int:()=>Us,int32:()=>B_,int64:()=>H_,intersection:()=>jm,invertCodec:()=>gk,ipv4:()=>A_,ipv6:()=>C_,json:()=>Tk,jwt:()=>D_,keyof:()=>Q_,ksuid:()=>$_,lazy:()=>df,literal:()=>dk,looseObject:()=>nk,looseRecord:()=>ak,mac:()=>I_,map:()=>sk,meta:()=>xk,nan:()=>mk,nanoid:()=>k_,nativeEnum:()=>lk,never:()=>ic,nonoptional:()=>Qm,null:()=>Am,nullable:()=>gi,nullish:()=>pk,number:()=>xm,object:()=>ek,optional:()=>fi,partialRecord:()=>ik,pipe:()=>zs,prefault:()=>Xm,preprocess:()=>$k,promise:()=>bk,readonly:()=>sf,record:()=>zm,refine:()=>hf,set:()=>ck,strictObject:()=>tk,string:()=>hi,stringFormat:()=>j_,stringbool:()=>Ek,success:()=>hk,superRefine:()=>mf,symbol:()=>Z_,templateLiteral:()=>yk,transform:()=>cc,tuple:()=>Um,uint32:()=>W_,uint64:()=>V_,ulid:()=>E_,undefined:()=>Y_,union:()=>ac,unknown:()=>sr,url:()=>v_,uuid:()=>f_,uuidv4:()=>g_,uuidv6:()=>y_,uuidv7:()=>b_,void:()=>J_,xid:()=>T_,xor:()=>rk});function yi(e,t,r){let o=Object.getPrototypeOf(e),n=p_.get(o);if(n||(n=new Set,p_.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}function hi(e){return Lp(Jr,e)}function h_(e){return rs(Gs,e)}function m_(e){return ai(mi,e)}function f_(e){return os(Vt,e)}function g_(e){return is(Vt,e)}function y_(e){return as(Vt,e)}function b_(e){return ss(Vt,e)}function v_(e){return si(bi,e)}function w_(e){return si(bi,{protocol:St.httpProtocol,hostname:St.domain,...W.normalizeParams(e)})}function __(e){return cs(Bs,e)}function k_(e){return ls(Ws,e)}function x_(e){return ds(Ks,e)}function S_(e){return us(Hs,e)}function E_(e){return ps(Vs,e)}function T_(e){return hs(Zs,e)}function $_(e){return ms(Ys,e)}function A_(e){return fs(qs,e)}function I_(e){return jp(km,e)}function C_(e){return gs(Js,e)}function P_(e){return ys(Xs,e)}function O_(e){return bs(Qs,e)}function N_(e){return vs(ec,e)}function R_(e){return ws(tc,e)}function L_(e){return _s(nc,e)}function D_(e){return ks(rc,e)}function j_(e,t,r={}){return Hr(Xr,e,t,r)}function M_(e){return Hr(Xr,"hostname",St.hostname,e)}function U_(e){return Hr(Xr,"hex",St.hex,e)}function z_(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=St[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Hr(Xr,o,n,t)}function xm(e){return Bp(Qr,e)}function Us(e){return Kp(cr,e)}function F_(e){return Hp(cr,e)}function G_(e){return Vp(cr,e)}function B_(e){return Zp(cr,e)}function W_(e){return Yp(cr,e)}function Sm(e){return qp(eo,e)}function K_(e){return Xp(to,e)}function H_(e){return eh(oc,e)}function V_(e){return th(oc,e)}function Z_(e){return nh(Em,e)}function Y_(e){return rh(Tm,e)}function Am(e){return oh($m,e)}function q_(){return ih(Im)}function sr(){return ah(Cm)}function ic(e){return sh(Pm,e)}function J_(e){return ch(Om,e)}function X_(e){return lh(vi,e)}function wi(e,t){return ph(Nm,e,t)}function Q_(e){let t=e._zod.def.shape;return sc(Object.keys(t))}function ek(e,t){let r={type:"object",shape:e??{},...W.normalizeParams(t)};return new _i(r)}function tk(e,t){return new _i({type:"object",shape:e,catchall:ic(),...W.normalizeParams(t)})}function nk(e,t){return new _i({type:"object",shape:e,catchall:sr(),...W.normalizeParams(t)})}function ac(e,t){return new ki({type:"union",options:e,...W.normalizeParams(t)})}function rk(e,t){return new Rm({type:"union",options:e,inclusive:!1,...W.normalizeParams(t)})}function ok(e,t,r){return new Lm({type:"union",options:t,discriminator:e,...W.normalizeParams(r)})}function jm(e,t){return new Dm({type:"intersection",left:e,right:t})}function Um(e,t,r){let o=t instanceof de,n=o?r:t,i=o?t:null;return new Mm({type:"tuple",items:e,rest:i,...W.normalizeParams(n)})}function zm(e,t,r){return!t||!t._zod?new Yr({type:"record",keyType:hi(),valueType:e,...W.normalizeParams(t)}):new Yr({type:"record",keyType:e,valueType:t,...W.normalizeParams(r)})}function ik(e,t,r){let o=it(e);return o._zod.values=void 0,new Yr({type:"record",keyType:o,valueType:t,...W.normalizeParams(r)})}function ak(e,t,r){return new Yr({type:"record",keyType:e,valueType:t,mode:"loose",...W.normalizeParams(r)})}function sk(e,t,r){return new Fm({type:"map",keyType:e,valueType:t,...W.normalizeParams(r)})}function ck(e,t){return new Gm({type:"set",valueType:e,...W.normalizeParams(t)})}function sc(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new qr({type:"enum",entries:r,...W.normalizeParams(t)})}function lk(e,t){return new qr({type:"enum",entries:e,...W.normalizeParams(t)})}function dk(e,t){return new Bm({type:"literal",values:Array.isArray(e)?e:[e],...W.normalizeParams(t)})}function uk(e){return hh(Wm,e)}function cc(e){return new Km({type:"transform",transform:e})}function fi(e){return new lc({type:"optional",innerType:e})}function Vm(e){return new Hm({type:"optional",innerType:e})}function gi(e){return new Zm({type:"nullable",innerType:e})}function pk(e){return fi(gi(e))}function qm(e,t){return new Ym({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}function Xm(e,t){return new Jm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}function Qm(e,t){return new dc({type:"nonoptional",innerType:e,...W.normalizeParams(t)})}function hk(e){return new ef({type:"success",innerType:e})}function nf(e,t){return new tf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function mk(e){return uh(rf,e)}function zs(e,t){return new xi({type:"pipe",in:e,out:t})}function fk(e,t,r){return new Si({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function gk(e){let t=e._zod.def;return new Si({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function sf(e){return new af({type:"readonly",innerType:e})}function yk(e,t){return new cf({type:"template_literal",parts:e,...W.normalizeParams(t)})}function df(e){return new lf({type:"lazy",getter:e})}function bk(e){return new uf({type:"promise",innerType:e})}function vk(e){return new pf({type:"function",input:Array.isArray(e?.input)?Um(e?.input):e?.input??wi(sr()),output:e?.output??sr()})}function wk(e){let t=new Ee({check:"custom"});return t._zod.check=e,t}function _k(e,t){return mh(Ei,e??(()=>!0),t)}function hf(e,t={}){return fh(Ei,e,t)}function mf(e,t){return gh(e,t)}function Sk(e,t={}){let r=new Ei({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...W.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function Tk(e){let t=df(()=>ac([hi(e),xm(),Sm(),Am(),wi(t),zm(hi(),t)]));return t}function $k(e,t){return new of({type:"pipe",in:cc(e),out:t})}var p_,pe,Fs,Jr,xe,Gs,mi,Vt,bi,Bs,Ws,Ks,Hs,Vs,Zs,Ys,qs,km,Js,Xs,Qs,ec,tc,nc,rc,Xr,Qr,cr,eo,to,oc,Em,Tm,$m,Im,Cm,Pm,Om,vi,Nm,_i,ki,Rm,Lm,Dm,Mm,Yr,Fm,Gm,qr,Bm,Wm,Km,lc,Hm,Zm,Ym,Jm,dc,ef,tf,rf,xi,Si,of,af,cf,lf,uf,pf,Ei,kk,xk,Ek,pi=w(()=>{Tt();Tt();li();ci();Rs();di();_m();p_=new WeakMap;pe=k("ZodType",(e,t)=>(de.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vr(e,"input"),output:Vr(e,"output")}}),e.toJSONSchema=wh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>lm(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>um(e,r,o),e.parseAsync=async(r,o)=>dm(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>pm(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>hm(e,r,o),e.decode=(r,o)=>mm(e,r,o),e.encodeAsync=async(r,o)=>fm(e,r,o),e.decodeAsync=async(r,o)=>gm(e,r,o),e.safeEncode=(r,o)=>ym(e,r,o),e.safeDecode=(r,o)=>bm(e,r,o),e.safeEncodeAsync=async(r,o)=>vm(e,r,o),e.safeDecodeAsync=async(r,o)=>wm(e,r,o),yi(e,"ZodType",{check(...r){let o=this.def;return this.clone(W.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return it(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(hf(r,o))},superRefine(r,o){return this.check(mf(r,o))},overwrite(r){return this.check(Dt(r))},optional(){return fi(this)},exactOptional(){return Vm(this)},nullable(){return gi(this)},nullish(){return fi(gi(this))},nonoptional(r){return Qm(this,r)},array(){return wi(this)},or(r){return ac([this,r])},and(r){return jm(this,r)},transform(r){return zs(this,cc(r))},default(r){return qm(this,r)},prefault(r){return Xm(this,r)},catch(r){return nf(this,r)},pipe(r){return zs(this,r)},readonly(){return sf(this)},describe(r){let o=this.clone();return We.add(o,{description:r}),o},meta(...r){if(r.length===0)return We.get(this);let o=this.clone();return We.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return We.get(e)?.description},configurable:!0}),e)),Fs=k("_ZodString",(e,t)=>{rr.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>_h(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,yi(e,"_ZodString",{regex(...o){return this.check(Rr(...o))},includes(...o){return this.check(jr(...o))},startsWith(...o){return this.check(Mr(...o))},endsWith(...o){return this.check(Ur(...o))},min(...o){return this.check(an(...o))},max(...o){return this.check(ir(...o))},length(...o){return this.check(ar(...o))},nonempty(...o){return this.check(an(1,...o))},lowercase(o){return this.check(Lr(o))},uppercase(o){return this.check(Dr(o))},trim(){return this.check(Gr())},normalize(...o){return this.check(Fr(...o))},toLowerCase(){return this.check(Br())},toUpperCase(){return this.check(Wr())},slugify(){return this.check(Kr())}})}),Jr=k("ZodString",(e,t)=>{rr.init(e,t),Fs.init(e,t),e.email=r=>e.check(rs(Gs,r)),e.url=r=>e.check(si(bi,r)),e.jwt=r=>e.check(ks(rc,r)),e.emoji=r=>e.check(cs(Bs,r)),e.guid=r=>e.check(ai(mi,r)),e.uuid=r=>e.check(os(Vt,r)),e.uuidv4=r=>e.check(is(Vt,r)),e.uuidv6=r=>e.check(as(Vt,r)),e.uuidv7=r=>e.check(ss(Vt,r)),e.nanoid=r=>e.check(ls(Ws,r)),e.guid=r=>e.check(ai(mi,r)),e.cuid=r=>e.check(ds(Ks,r)),e.cuid2=r=>e.check(us(Hs,r)),e.ulid=r=>e.check(ps(Vs,r)),e.base64=r=>e.check(vs(ec,r)),e.base64url=r=>e.check(ws(tc,r)),e.xid=r=>e.check(hs(Zs,r)),e.ksuid=r=>e.check(ms(Ys,r)),e.ipv4=r=>e.check(fs(qs,r)),e.ipv6=r=>e.check(gs(Js,r)),e.cidrv4=r=>e.check(ys(Xs,r)),e.cidrv6=r=>e.check(bs(Qs,r)),e.e164=r=>e.check(_s(nc,r)),e.datetime=r=>e.check(om(r)),e.date=r=>e.check(im(r)),e.time=r=>e.check(am(r)),e.duration=r=>e.check(sm(r))});xe=k("ZodStringFormat",(e,t)=>{ke.init(e,t),Fs.init(e,t)}),Gs=k("ZodEmail",(e,t)=>{_u.init(e,t),xe.init(e,t)});mi=k("ZodGUID",(e,t)=>{vu.init(e,t),xe.init(e,t)});Vt=k("ZodUUID",(e,t)=>{wu.init(e,t),xe.init(e,t)});bi=k("ZodURL",(e,t)=>{ku.init(e,t),xe.init(e,t)});Bs=k("ZodEmoji",(e,t)=>{xu.init(e,t),xe.init(e,t)});Ws=k("ZodNanoID",(e,t)=>{Su.init(e,t),xe.init(e,t)});Ks=k("ZodCUID",(e,t)=>{Eu.init(e,t),xe.init(e,t)});Hs=k("ZodCUID2",(e,t)=>{Tu.init(e,t),xe.init(e,t)});Vs=k("ZodULID",(e,t)=>{$u.init(e,t),xe.init(e,t)});Zs=k("ZodXID",(e,t)=>{Au.init(e,t),xe.init(e,t)});Ys=k("ZodKSUID",(e,t)=>{Iu.init(e,t),xe.init(e,t)});qs=k("ZodIPv4",(e,t)=>{Ru.init(e,t),xe.init(e,t)});km=k("ZodMAC",(e,t)=>{Du.init(e,t),xe.init(e,t)});Js=k("ZodIPv6",(e,t)=>{Lu.init(e,t),xe.init(e,t)});Xs=k("ZodCIDRv4",(e,t)=>{ju.init(e,t),xe.init(e,t)});Qs=k("ZodCIDRv6",(e,t)=>{Mu.init(e,t),xe.init(e,t)});ec=k("ZodBase64",(e,t)=>{zu.init(e,t),xe.init(e,t)});tc=k("ZodBase64URL",(e,t)=>{Fu.init(e,t),xe.init(e,t)});nc=k("ZodE164",(e,t)=>{Gu.init(e,t),xe.init(e,t)});rc=k("ZodJWT",(e,t)=>{Bu.init(e,t),xe.init(e,t)});Xr=k("ZodCustomStringFormat",(e,t)=>{Wu.init(e,t),xe.init(e,t)});Qr=k("ZodNumber",(e,t)=>{Va.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>kh(e,o,n,i),yi(e,"ZodNumber",{gt(o,n){return this.check(Kt(o,n))},gte(o,n){return this.check(st(o,n))},min(o,n){return this.check(st(o,n))},lt(o,n){return this.check(Wt(o,n))},lte(o,n){return this.check(Et(o,n))},max(o,n){return this.check(Et(o,n))},int(o){return this.check(Us(o))},safe(o){return this.check(Us(o))},positive(o){return this.check(Kt(0,o))},nonnegative(o){return this.check(st(0,o))},negative(o){return this.check(Wt(0,o))},nonpositive(o){return this.check(Et(0,o))},multipleOf(o,n){return this.check(An(o,n))},step(o,n){return this.check(An(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});cr=k("ZodNumberFormat",(e,t)=>{Ku.init(e,t),Qr.init(e,t)});eo=k("ZodBoolean",(e,t)=>{ei.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xh(e,r,o,n)});to=k("ZodBigInt",(e,t)=>{Za.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Sh(e,o,n,i),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.gt=(o,n)=>e.check(Kt(o,n)),e.gte=(o,n)=>e.check(st(o,n)),e.min=(o,n)=>e.check(st(o,n)),e.lt=(o,n)=>e.check(Wt(o,n)),e.lte=(o,n)=>e.check(Et(o,n)),e.max=(o,n)=>e.check(Et(o,n)),e.positive=o=>e.check(Kt(BigInt(0),o)),e.negative=o=>e.check(Wt(BigInt(0),o)),e.nonpositive=o=>e.check(Et(BigInt(0),o)),e.nonnegative=o=>e.check(st(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(An(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});oc=k("ZodBigIntFormat",(e,t)=>{Hu.init(e,t),to.init(e,t)});Em=k("ZodSymbol",(e,t)=>{Vu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Eh(e,r,o,n)});Tm=k("ZodUndefined",(e,t)=>{Zu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$h(e,r,o,n)});$m=k("ZodNull",(e,t)=>{Yu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Th(e,r,o,n)});Im=k("ZodAny",(e,t)=>{qu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ch(e,r,o,n)});Cm=k("ZodUnknown",(e,t)=>{Ju.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ph(e,r,o,n)});Pm=k("ZodNever",(e,t)=>{Xu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ih(e,r,o,n)});Om=k("ZodVoid",(e,t)=>{Qu.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ah(e,r,o,n)});vi=k("ZodDate",(e,t)=>{ep.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Oh(e,o,n,i),e.min=(o,n)=>e.check(st(o,n)),e.max=(o,n)=>e.check(Et(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});Nm=k("ZodArray",(e,t)=>{tp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wh(e,r,o,n),e.element=t.element,yi(e,"ZodArray",{min(r,o){return this.check(an(r,o))},nonempty(r){return this.check(an(1,r))},max(r,o){return this.check(ir(r,o))},length(r,o){return this.check(ar(r,o))},unwrap(){return this.element}})});_i=k("ZodObject",(e,t)=>{np.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kh(e,r,o,n),W.defineLazy(e,"shape",()=>t.shape),yi(e,"ZodObject",{keyof(){return sc(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:sr()})},loose(){return this.clone({...this._zod.def,catchall:sr()})},strict(){return this.clone({...this._zod.def,catchall:ic()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return W.extend(this,r)},safeExtend(r){return W.safeExtend(this,r)},merge(r){return W.merge(this,r)},pick(r){return W.pick(this,r)},omit(r){return W.omit(this,r)},partial(...r){return W.partial(lc,this,r[0])},required(...r){return W.required(dc,this,r[0])}})});ki=k("ZodUnion",(e,t)=>{ti.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n),e.options=t.options});Rm=k("ZodXor",(e,t)=>{ki.init(e,t),rp.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Is(e,r,o,n),e.options=t.options});Lm=k("ZodDiscriminatedUnion",(e,t)=>{ki.init(e,t),op.init(e,t)});Dm=k("ZodIntersection",(e,t)=>{ip.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hh(e,r,o,n)});Mm=k("ZodTuple",(e,t)=>{Ya.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vh(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});Yr=k("ZodRecord",(e,t)=>{ap.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zh(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});Fm=k("ZodMap",(e,t)=>{sp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gh(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(In(...r)),e.size=(...r)=>e.check(or(...r))});Gm=k("ZodSet",(e,t)=>{cp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bh(e,r,o,n),e.min=(...r)=>e.check(Ht(...r)),e.nonempty=r=>e.check(Ht(1,r)),e.max=(...r)=>e.check(In(...r)),e.size=(...r)=>e.check(or(...r))});qr=k("ZodEnum",(e,t)=>{lp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Nh(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new qr({...t,checks:[],...W.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new qr({...t,checks:[],...W.normalizeParams(n),entries:i})}});Bm=k("ZodLiteral",(e,t)=>{dp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rh(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Wm=k("ZodFile",(e,t)=>{up.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jh(e,r,o,n),e.min=(r,o)=>e.check(Ht(r,o)),e.max=(r,o)=>e.check(In(r,o)),e.mime=(r,o)=>e.check(zr(Array.isArray(r)?r:[r],o))});Km=k("ZodTransform",(e,t)=>{pp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fh(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new xn(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(W.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(W.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});lc=k("ZodOptional",(e,t)=>{qa.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Hm=k("ZodExactOptional",(e,t)=>{hp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cs(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Zm=k("ZodNullable",(e,t)=>{mp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ym=k("ZodDefault",(e,t)=>{fp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Jm=k("ZodPrefault",(e,t)=>{gp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dc=k("ZodNonOptional",(e,t)=>{yp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});ef=k("ZodSuccess",(e,t)=>{bp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});tf=k("ZodCatch",(e,t)=>{vp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});rf=k("ZodNaN",(e,t)=>{wp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lh(e,r,o,n)});xi=k("ZodPipe",(e,t)=>{Ja.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>em(e,r,o,n),e.in=t.in,e.out=t.out});Si=k("ZodCodec",(e,t)=>{xi.init(e,t),ni.init(e,t)});of=k("ZodPreprocess",(e,t)=>{xi.init(e,t),_p.init(e,t)}),af=k("ZodReadonly",(e,t)=>{kp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});cf=k("ZodTemplateLiteral",(e,t)=>{xp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dh(e,r,o,n)});lf=k("ZodLazy",(e,t)=>{Tp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rm(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});uf=k("ZodPromise",(e,t)=>{Ep.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nm(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});pf=k("ZodFunction",(e,t)=>{Sp.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zh(e,r,o,n)});Ei=k("ZodCustom",(e,t)=>{$p.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uh(e,r,o,n)});kk=yh,xk=bh;Ek=(...e)=>vh({Codec:Si,Boolean:eo,String:Jr},...e)});function UP(e){Oe({customError:e})}function zP(){return Oe().customError}var MP,ff,Ak=w(()=>{Tt();MP={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};ff||(ff={})});function GP(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function BP(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function Ik(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ee.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return ee.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=BP(n,t),a=Je(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return ee.null();if(n.length===0)return ee.never();if(n.length===1)return ee.literal(n[0]);if(n.every(a=>typeof a=="string"))return ee.enum(n);let i=n.map(a=>ee.literal(a));return i.length<2?i[0]:ee.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return ee.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return Ik(a,t)});return n.length===0?ee.never():n.length===1?n[0]:ee.union(n)}if(!r)return ee.any();let o;switch(r){case"string":{let n=ee.string();if(e.format){let i=e.format;i==="email"?n=n.check(ee.email()):i==="uri"||i==="uri-reference"?n=n.check(ee.url()):i==="uuid"||i==="guid"?n=n.check(ee.uuid()):i==="date-time"?n=n.check(ee.iso.datetime()):i==="date"?n=n.check(ee.iso.date()):i==="time"?n=n.check(ee.iso.time()):i==="duration"?n=n.check(ee.iso.duration()):i==="ipv4"?n=n.check(ee.ipv4()):i==="ipv6"?n=n.check(ee.ipv6()):i==="mac"?n=n.check(ee.mac()):i==="cidr"?n=n.check(ee.cidrv4()):i==="cidr-v6"?n=n.check(ee.cidrv6()):i==="base64"?n=n.check(ee.base64()):i==="base64url"?n=n.check(ee.base64url()):i==="e164"?n=n.check(ee.e164()):i==="jwt"?n=n.check(ee.jwt()):i==="emoji"?n=n.check(ee.emoji()):i==="nanoid"?n=n.check(ee.nanoid()):i==="cuid"?n=n.check(ee.cuid()):i==="cuid2"?n=n.check(ee.cuid2()):i==="ulid"?n=n.check(ee.ulid()):i==="xid"?n=n.check(ee.xid()):i==="ksuid"&&(n=n.check(ee.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?ee.number().int():ee.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=ee.boolean();break}case"null":{o=ee.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[d,l]of Object.entries(i)){let p=Je(l,t);n[d]=a.has(d)?p:p.optional()}if(e.propertyNames){let d=Je(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Je(e.additionalProperties,t):ee.any();if(Object.keys(n).length===0){o=ee.record(d,l);break}let p=ee.object(n).passthrough(),h=ee.looseRecord(d,l);o=ee.intersection(p,h);break}if(e.patternProperties){let d=e.patternProperties,l=Object.keys(d),p=[];for(let m of l){let y=Je(d[m],t),x=ee.string().regex(new RegExp(m));p.push(ee.looseRecord(x,y))}let h=[];if(Object.keys(n).length>0&&h.push(ee.object(n).passthrough()),h.push(...p),h.length===0)o=ee.object({}).passthrough();else if(h.length===1)o=h[0];else{let m=ee.intersection(h[0],h[1]);for(let y=2;y<h.length;y++)m=ee.intersection(m,h[y]);o=m}break}let s=ee.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Je(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(d=>Je(d,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Je(i,t):void 0;s?o=ee.tuple(a).rest(s):o=ee.tuple(a),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(d=>Je(d,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Je(e.additionalItems,t):void 0;s?o=ee.tuple(a).rest(s):o=ee.tuple(a),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(i!==void 0){let a=Je(i,t),s=ee.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=ee.array(ee.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Je(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let r=Ik(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>Je(l,t)),d=ee.union(s);r=o?ee.intersection(r,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>Je(l,t)),d=ee.xor(s);r=o?ee.intersection(r,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:ee.any();else{let s=o?r:Je(e.allOf[0],t),d=o?0:1;for(let l=d;l<e.allOf.length;l++)s=ee.intersection(s,Je(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=ee.nullable(r)),e.readOnly===!0&&(r=ee.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))FP.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function Ck(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=GP(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??We};return Je(r,i)}var ee,FP,Pk=w(()=>{ii();Rs();di();pi();ee={...ui,...Ns,iso:Zr},FP=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var gf={};Gt(gf,{bigint:()=>VP,boolean:()=>HP,date:()=>ZP,number:()=>KP,string:()=>WP});function WP(e){return Dp(Jr,e)}function KP(e){return Wp(Qr,e)}function HP(e){return Jp(eo,e)}function VP(e){return Qp(to,e)}function ZP(e){return dh(vi,e)}var Ok=w(()=>{Tt();pi()});var c={};Gt(c,{$brand:()=>od,$input:()=>Rp,$output:()=>Np,NEVER:()=>rd,TimePrecision:()=>Mp,ZodAny:()=>Im,ZodArray:()=>Nm,ZodBase64:()=>ec,ZodBase64URL:()=>tc,ZodBigInt:()=>to,ZodBigIntFormat:()=>oc,ZodBoolean:()=>eo,ZodCIDRv4:()=>Xs,ZodCIDRv6:()=>Qs,ZodCUID:()=>Ks,ZodCUID2:()=>Hs,ZodCatch:()=>tf,ZodCodec:()=>Si,ZodCustom:()=>Ei,ZodCustomStringFormat:()=>Xr,ZodDate:()=>vi,ZodDefault:()=>Ym,ZodDiscriminatedUnion:()=>Lm,ZodE164:()=>nc,ZodEmail:()=>Gs,ZodEmoji:()=>Bs,ZodEnum:()=>qr,ZodError:()=>DP,ZodExactOptional:()=>Hm,ZodFile:()=>Wm,ZodFirstPartyTypeKind:()=>ff,ZodFunction:()=>pf,ZodGUID:()=>mi,ZodIPv4:()=>qs,ZodIPv6:()=>Js,ZodISODate:()=>Ds,ZodISODateTime:()=>Ls,ZodISODuration:()=>Ms,ZodISOTime:()=>js,ZodIntersection:()=>Dm,ZodIssueCode:()=>MP,ZodJWT:()=>rc,ZodKSUID:()=>Ys,ZodLazy:()=>lf,ZodLiteral:()=>Bm,ZodMAC:()=>km,ZodMap:()=>Fm,ZodNaN:()=>rf,ZodNanoID:()=>Ws,ZodNever:()=>Pm,ZodNonOptional:()=>dc,ZodNull:()=>$m,ZodNullable:()=>Zm,ZodNumber:()=>Qr,ZodNumberFormat:()=>cr,ZodObject:()=>_i,ZodOptional:()=>lc,ZodPipe:()=>xi,ZodPrefault:()=>Jm,ZodPreprocess:()=>of,ZodPromise:()=>uf,ZodReadonly:()=>af,ZodRealError:()=>bt,ZodRecord:()=>Yr,ZodSet:()=>Gm,ZodString:()=>Jr,ZodStringFormat:()=>xe,ZodSuccess:()=>ef,ZodSymbol:()=>Em,ZodTemplateLiteral:()=>cf,ZodTransform:()=>Km,ZodTuple:()=>Mm,ZodType:()=>pe,ZodULID:()=>Vs,ZodURL:()=>bi,ZodUUID:()=>Vt,ZodUndefined:()=>Tm,ZodUnion:()=>ki,ZodUnknown:()=>Cm,ZodVoid:()=>Om,ZodXID:()=>Zs,ZodXor:()=>Rm,_ZodString:()=>Fs,_default:()=>qm,_function:()=>vk,any:()=>q_,array:()=>wi,base64:()=>N_,base64url:()=>R_,bigint:()=>K_,boolean:()=>Sm,catch:()=>nf,check:()=>wk,cidrv4:()=>P_,cidrv6:()=>O_,clone:()=>it,codec:()=>fk,coerce:()=>gf,config:()=>Oe,core:()=>sn,cuid:()=>x_,cuid2:()=>S_,custom:()=>_k,date:()=>X_,decode:()=>mm,decodeAsync:()=>gm,describe:()=>kk,discriminatedUnion:()=>ok,e164:()=>L_,email:()=>h_,emoji:()=>__,encode:()=>hm,encodeAsync:()=>fm,endsWith:()=>Ur,enum:()=>sc,exactOptional:()=>Vm,file:()=>uk,flattenError:()=>Yo,float32:()=>F_,float64:()=>G_,formatError:()=>qo,fromJSONSchema:()=>Ck,function:()=>vk,getErrorMap:()=>zP,globalRegistry:()=>We,gt:()=>Kt,gte:()=>st,guid:()=>m_,hash:()=>z_,hex:()=>U_,hostname:()=>M_,httpUrl:()=>w_,includes:()=>jr,instanceof:()=>Sk,int:()=>Us,int32:()=>B_,int64:()=>H_,intersection:()=>jm,invertCodec:()=>gk,ipv4:()=>A_,ipv6:()=>C_,iso:()=>Zr,json:()=>Tk,jwt:()=>D_,keyof:()=>Q_,ksuid:()=>$_,lazy:()=>df,length:()=>ar,literal:()=>dk,locales:()=>oi,looseObject:()=>nk,looseRecord:()=>ak,lowercase:()=>Lr,lt:()=>Wt,lte:()=>Et,mac:()=>I_,map:()=>sk,maxLength:()=>ir,maxSize:()=>In,meta:()=>xk,mime:()=>zr,minLength:()=>an,minSize:()=>Ht,multipleOf:()=>An,nan:()=>mk,nanoid:()=>k_,nativeEnum:()=>lk,negative:()=>Ss,never:()=>ic,nonnegative:()=>Ts,nonoptional:()=>Qm,nonpositive:()=>Es,normalize:()=>Fr,null:()=>Am,nullable:()=>gi,nullish:()=>pk,number:()=>xm,object:()=>ek,optional:()=>fi,overwrite:()=>Dt,parse:()=>lm,parseAsync:()=>dm,partialRecord:()=>ik,pipe:()=>zs,positive:()=>xs,prefault:()=>Xm,preprocess:()=>$k,prettifyError:()=>yd,promise:()=>bk,property:()=>$s,readonly:()=>sf,record:()=>zm,refine:()=>hf,regex:()=>Rr,regexes:()=>St,registry:()=>ns,safeDecode:()=>bm,safeDecodeAsync:()=>wm,safeEncode:()=>ym,safeEncodeAsync:()=>vm,safeParse:()=>um,safeParseAsync:()=>pm,set:()=>ck,setErrorMap:()=>UP,size:()=>or,slugify:()=>Kr,startsWith:()=>Mr,strictObject:()=>tk,string:()=>hi,stringFormat:()=>j_,stringbool:()=>Ek,success:()=>hk,superRefine:()=>mf,symbol:()=>Z_,templateLiteral:()=>yk,toJSONSchema:()=>Ps,toLowerCase:()=>Br,toUpperCase:()=>Wr,transform:()=>cc,treeifyError:()=>gd,trim:()=>Gr,tuple:()=>Um,uint32:()=>W_,uint64:()=>V_,ulid:()=>E_,undefined:()=>Y_,union:()=>ac,unknown:()=>sr,uppercase:()=>Dr,url:()=>v_,util:()=>W,uuid:()=>f_,uuidv4:()=>g_,uuidv6:()=>y_,uuidv7:()=>b_,void:()=>J_,xid:()=>T_,xor:()=>rk});var yf=w(()=>{Tt();pi();Rs();cm();_m();Ak();Tt();Ip();Tt();li();Pk();Op();di();di();Ok();Oe(Xa())});var ze=w(()=>{yf();yf()});function mc(e,t){return t==="article-launch"||t==="article-embed"?t==="article-embed"?"card":"launch":e==="predict"?"page":"screen"}var uc,pc,lr,hc,bf,vf,wf,Nk,_f,kf,dr,xf=w(()=>{"use strict";ze();uc=c.enum(["screen","canvas","launch","card","page","sheet"]),pc=c.enum(["fullscreen","article-launch","article-embed","app-webview"]),lr={screen:{name:"Screen",summary:"fills the phone and nothing scrolls; the layout adapts to the phone's size"},canvas:{name:"Scaled canvas",summary:"drawn at one size and scaled to fit the phone, with bars where the shape differs"},launch:{name:"Card that opens to full screen",summary:"a preview in the host page; tapping it opens the game full screen over the page"},card:{name:"Card",summary:"a fixed box inside a page that scrolls, with no scrolling inside the box"},page:{name:"Page",summary:"scrolls like a web page; for long question lists and results tables"},sheet:{name:"Sheet",summary:"slides up over part of a host app for one quick question"}},hc={fullscreen:{name:"Full screen",summary:"opened full screen, from a carousel, a Hub or a link"},"article-launch":{name:"Article, opening full screen",summary:"a card in an article that opens the game full screen over it"},"article-embed":{name:"Article embed",summary:"a box inside an article, played where it sits"},"app-webview":{name:"Web view in a native app",summary:"inside a club's or publisher's own app, in a web view"}},bf="Players come back to a game they can play properly. Full screen, a game feels like an app and gets played; a widget in an article reads as throwaway and gets scrolled past. Choose full screen unless your host can't allow it.",vf="An article box is small, easy to scroll past, and the page's own scrolling fights swipes inside the game. Use it only where the host can't open the game full screen.",wf="Inside a native app, set the web view's own background to the game's background colour and create it before the player taps, so nothing flashes white while it loads.";Nk=["screen","canvas","card","sheet"],_f={screen:{jsKb:350,cssKb:60,fontKb:150,totalKb:900,firstRenderMs:1800,playableMs:3500},canvas:{jsKb:500,cssKb:60,fontKb:150,totalKb:1500,firstRenderMs:1800,playableMs:4500},launch:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},card:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},page:{jsKb:400,cssKb:80,fontKb:150,totalKb:1100,firstRenderMs:1800,playableMs:4e3},sheet:{jsKb:250,cssKb:40,fontKb:100,totalKb:600,firstRenderMs:1200,playableMs:2500}},kf={name:"mid-range phone on 4G",cpuSlowdown:4,latencyMs:60,downloadKbps:9e3,uploadKbps:1500},dr="gamestage:playable"});function Rk(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(qP.has(t)||YP.some(o=>t.endsWith(o))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let r=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(r){let o=Number.parseInt(r[1],16),n=Number.parseInt(r[2],16),i=`${o>>8}.${o&255}.${n>>8}.${n&255}`;if(i!==t)return Rk(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function Lk(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(Rk(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var YP,qP,Sf=w(()=>{"use strict";YP=[".localhost",".local",".internal",".test",".localdomain"],qP=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var Ti,$i=w(()=>{"use strict";ze();Ti=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var Ai,fc=w(()=>{"use strict";ze();Ai=c.discriminatedUnion("source",[c.object({source:c.literal("manifest")}),c.object({source:c.literal("studio"),element_id:c.string().min(1),edition_id:c.string().min(1)})])});var Nn,Ef,Ii,lt,Zt,no,ro=w(()=>{"use strict";Nn="penalty_v1",Ef=["easy_v1","balanced_v1","hard_v1"],Ii="balanced_v1",lt={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Zt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},no="shoot"});function zk(e){return e.questions?e.questions:[{id:"1",kind:"choice",prompt:e.prompt,options:e.options??[],result:e.result,points:void 0,min:void 0,max:void 0,step:void 0,tolerance:void 0}]}function bc(e,t,r){if(e.result===void 0)return 0;let n=(e.kind==="choice"?(e.options??[]).find(i=>i.key===e.result):void 0)?.points??e.points??r;if(e.kind==="number"){if(typeof t!="number"||typeof e.result!="number")return 0;let i=Math.abs(t-e.result);return i===0?n:e.tolerance===void 0||i>=e.tolerance?0:Math.round(n*(1-i/e.tolerance))}return t===e.result?n:0}function cn(e){return`round-${e.number}`}var ur,oo,gc,Dk,JP,yc,XP,QP,Tf,eO,$f,jk,tO,Af,Mk,nO,Uk,rO,vc,oO,iO,aO,sO,cO,Xe,nF,rF,oF,Yt=w(()=>{"use strict";ze();rn();$i();fc();ro();ur={scoreOrder:c.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},oo=c.object({source:c.string().min(1),date:c.string().optional(),url:c.string().optional()}),gc=c.object({text:c.string().min(1),sources:c.array(oo).default([])}),Dk=c.enum(["highest","lowest","only_nonzero","only_zero"]),JP=c.object({measure:c.string().min(1),label:c.string().default(""),rule:Dk,scale:c.number().int().positive().default(1),values:c.record(c.string(),c.number().int().nonnegative()),perGuess:c.boolean().default(!0),sources:c.record(c.string(),oo).optional()}),yc=c.object({archetype:c.literal("hunt"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(2),targets:c.array(c.string().min(1)).min(1),required:c.number().int().positive().optional(),figures:JP.optional(),facts:c.array(gc).optional(),pointsPerTarget:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),mistakePenalty:c.number().int().nonnegative().optional(),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.targets.filter(o=>!e.board.includes(o));r.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${r.join(", ")}. Every target must be pickable.`}),new Set(e.targets).size!==e.targets.length&&t.addIssue({code:"custom",path:["targets"],message:"The same target twice. Each one counts once."}),e.required!==void 0&&e.required>e.targets.length&&t.addIssue({code:"custom",path:["required"],message:`Asks for ${e.required} of ${e.targets.length} targets, which cannot be reached.`})}),XP=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative(),source:oo.optional()}),QP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(XP).min(1)}),Tf=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),eO=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],$f=c.object({mode:c.literal("proximity"),pointsPer:c.number().int().positive().default(1e3),exactBonus:c.number().int().nonnegative().default(500)}),jk=c.object({archetype:c.literal("push"),scoring:$f.optional(),facts:c.array(gc).optional(),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),target:c.number().int().positive(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),theme:c.string().default(""),slates:c.array(QP).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(Tf).default(eO),floorLabel:c.string().default("Rookie"),bustLabel:c.string().default("Busted"),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{if(e.line)if(e.line.length!==e.slates.length)t.addIssue({code:"custom",path:["line"],message:`The line has ${e.line.length} pick(s) for ${e.slates.length} slate(s). A perfect line is one pick per slate.`});else{let s=0,d=!1;for(let l of e.line){let h=e.slates.find(m=>m.id===l.slate)?.entries.find(m=>m.key===l.key);if(!h){d=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${l.key}" on slate "${l.slate}", which the round does not hold.`});break}s+=h.value}!d&&s!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${s}, not the target ${e.target}. A perfect line lands exactly.`})}let r=e.slates.map(s=>s.id);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let o=e.slates.flatMap(s=>s.entries.map(d=>d.key)),n=[...new Set(o.filter((s,d)=>o.indexOf(s)!==d))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let i=e.slates.reduce((s,d)=>s+Math.min(...d.entries.map(l=>l.value)),0);i>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${i}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((s,d)=>d===0||s.within>e.tiers[d-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),tO=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),Af=c.object({archetype:c.literal("group"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(tO).min(2),pointsPerGroup:c.number().int().nonnegative().default(10),completionBonus:c.number().int().nonnegative().default(0),attemptsAllowed:c.number().int().positive().default(10),mistakesAllowed:c.number().int().positive().default(4),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Map;for(let i of e.groups){let a=i.members.filter(s=>!e.board.includes(s));a.length&&t.addIssue({code:"custom",path:["groups"],message:`${i.key} has members that are not on the board: ${a.join(", ")}.`});for(let s of i.members){let d=r.get(s);d&&d!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${d} and ${i.key}. Groups cannot overlap.`}),r.set(s,i.key)}}new Set(e.groups.map(i=>i.key)).size!==e.groups.length&&t.addIssue({code:"custom",path:["groups"],message:"Two groups share a key. Each one needs its own."}),e.groups.length>e.attemptsAllowed&&t.addIssue({code:"custom",path:["attemptsAllowed"],message:`${e.groups.length} groups cannot be found in ${e.attemptsAllowed} attempts.`});let o=new Set(e.groups.flatMap(i=>i.members)),n=e.board.filter(i=>!o.has(i));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),Mk=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),nO=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(Mk).optional(),min:c.number().optional(),max:c.number().optional(),step:c.number().positive().optional(),result:c.union([c.string().min(1),c.number()]).optional(),points:c.number().int().nonnegative().optional(),tolerance:c.number().positive().optional()}).superRefine((e,t)=>{if(e.kind==="choice"){if(!e.options||e.options.length<2){t.addIssue({code:"custom",path:["options"],message:"A choice needs at least two options, or there is nothing to predict."});return}new Set(e.options.map(r=>r.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),typeof e.result=="string"&&!e.options.some(r=>r.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),typeof e.result=="number"&&t.addIssue({code:"custom",path:["result"],message:"A choice settles to one of its option keys, not to a number."});return}e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A number question has no options: a fan gives a value."}),e.min===void 0||e.max===void 0?t.addIssue({code:"custom",path:["min"],message:"A number needs a min and a max, or a fan is given a control with no ends."}):e.max<=e.min&&t.addIssue({code:"custom",path:["max"],message:"The maximum has to be above the minimum."}),typeof e.result=="string"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),Uk=c.object({archetype:c.literal("predict"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(Mk).min(2).optional(),questions:c.array(nO).min(1).optional(),result:c.string().min(1).optional(),pointsForCorrect:c.number().int().nonnegative().default(10),attemptsAllowed:c.number().int().positive().default(1),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=e.options!==void 0,o=e.questions!==void 0;if(r&&o&&t.addIssue({code:"custom",path:["questions"],message:"A round declares options or questions, not both. Two homes for one question is how they drift apart."}),!r&&!o&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),o&&e.questions){let n=e.questions.map(i=>i.id);new Set(n).size!==n.length&&t.addIssue({code:"custom",path:["questions"],message:"Two questions share an id. A play names the question it answered."})}e.options&&new Set(e.options.map(n=>n.key)).size!==e.options.length&&t.addIssue({code:"custom",path:["options"],message:"Two options share a key. Each one needs its own."}),e.result!==void 0&&e.options!==void 0&&!e.options.some(n=>n.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`})});rO=c.object({archetype:c.literal("bingo"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),rows:c.number().int().min(2),columns:c.number().int().min(2),centreMode:c.enum(["none","free","choice"]).default("none"),centreOptions:c.array(c.string().min(1)).optional(),allowCentreDuplicate:c.boolean().default(!1),lineTypes:c.array(c.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:c.array(c.object({key:c.string().min(1),label:c.string().min(1),note:c.string().optional(),result:c.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:c.number().int().nonnegative().default(10),pointsForFullBoard:c.number().int().nonnegative().default(0),shuffleAllowance:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),locksAt:c.string().optional()}).superRefine((e,t)=>{let r=e.cardPool.map(n=>n.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let o=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<o&&t.addIssue({code:"custom",path:["cardPool"],message:`The pool has ${e.cardPool.length} card${e.cardPool.length===1?"":"s"}, and a ${e.rows}x${e.columns} board needs ${o}. Add more cards or shrink the board.`}),e.centreMode==="choice")if(!e.centreOptions||e.centreOptions.length===0)t.addIssue({code:"custom",path:["centreOptions"],message:"The centre is a player's choice, so at least one option is required."});else{let n=e.centreOptions.filter(i=>!r.includes(i));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),vc=c.object({archetype:c.literal("shoot"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(Nn).default(Nn),difficulty:c.enum(Ef).default(Ii),shotsAllowed:c.number().int().min(1).max(20).default(5),goalsToWin:c.number().int().min(1).default(3),pointsPerGoal:c.number().int().nonnegative().default(100),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{e.goalsToWin>e.shotsAllowed&&t.addIssue({code:"custom",path:["goalsToWin"],message:`Asks for ${e.goalsToWin} goals from ${e.shotsAllowed} shots, which cannot be reached.`})}),oO=c.object({key:c.string().min(1),label:c.string().min(1),art:c.string().optional()}),iO=c.object({key:c.string().min(1),name:c.string().min(1),image:c.string().optional()}),aO=c.object({item:c.string().min(1),cells:c.array(c.string().min(1))}),sO=c.object({archetype:c.literal("place"),...ur,number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(oO).min(1),deck:c.array(iO).min(1),qualifies:c.array(aO).default([]),pointsPerPlacement:c.number().int().nonnegative().default(1),fullHouseBonus:c.number().int().nonnegative().default(0),mistakesAllowed:c.number().int().positive().default(4),skipsAllowed:c.number().int().nonnegative().default(3),open:c.boolean().default(!0),playsPerSecond:c.number().int().positive().optional(),playsPerDay:c.number().int().positive().optional(),timerSeconds:c.number().int().positive().optional()}).superRefine((e,t)=>{let r=new Set;for(let s of e.board)r.has(s.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${s.key}. Each one needs its own.`}),r.add(s.key);let o=new Set;for(let s of e.deck)o.has(s.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${s.key}. Each one needs its own.`}),o.add(s.key);let n=new Set,i=new Set;for(let s of e.qualifies){o.has(s.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is not a card in the deck.`}),n.has(s.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} is listed twice. Give each card one row.`}),n.add(s.item);for(let d of s.cells)r.has(d)||t.addIssue({code:"custom",path:["qualifies"],message:`${s.item} qualifies for ${d}, which is not on the board.`}),i.add(d)}let a=e.board.filter(s=>!i.has(s.key)).map(s=>s.key);a.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${a.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),cO=c.discriminatedUnion("archetype",[yc,jk,Af,Uk,rO,vc,sO]),Xe=c.preprocess(Ob,cO);nF=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),rF=c.object({game:c.string().min(1),round:Xe,origin:Ai.optional(),snapshot:c.string().default(""),source:c.string().optional(),roundId:c.string().min(1).optional(),selection:c.object({mode:c.literal("rotation"),windowSeconds:c.number().int().positive(),rounds:c.array(c.object({id:c.string().min(1),round:Xe,origin:Ai.optional()})).min(1)}).optional()}),oF=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(Ti).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function hO(e){return Wk.includes(e)}function mO(e){return Hk.includes(qe(e))}function Vk(e){let t=[],r=e.backend.archetype;r&&mO(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Bt.join(", ")}. Name one of those, or say what your game does and ask us: a mechanic no format fits is a format we have not built, not a setting you are missing.`});let o=e.backend.route;o&&hO(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Pf}\`: every game runs on our Engine, and there is no route that runs a game on an engine of your own.`}),e.measurement.signal.enabled&&!e.identity.consent.analytics_requires_consent&&t.push({path:"identity.consent.analytics_requires_consent",message:"Cannot be false while measurement.signal.enabled is true. Signal collects player engagement under Monterosa's own controllership, so consent is required and is not the game's to waive. Turn Signal off, or leave consent required."});let n=e.operations.promotion;if(n.offers_prize&&(n.terms_url||t.push({path:"operations.promotion.terms_url",message:"Required when the game offers a prize."}),n.jurisdictions.length===0&&t.push({path:"operations.promotion.jurisdictions",message:"Name the countries the promotion is open in. An unbounded prize draw is open in jurisdictions whose rules you have not read."}),!n.skill_based&&!n.free_entry_route&&t.push({path:"operations.promotion.free_entry_route",message:"A paid-entry prize needs either a published free entry route or a real skill test. Set `free_entry_route`, or set `skill_based` if entry turns on skill, knowledge or judgement."})),e.identity.provider==="jwt"&&!e.identity.jwt&&t.push({path:"identity.jwt",message:"Required when identity.provider is `jwt`. Name the `issuer` and the `jwks_uri` of the login system whose tokens this game accepts. Gamestage provides no identity provider."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let a=e.identity.jwt[i],s=Lk(a);s&&t.push({path:`identity.jwt.${i}`,message:s==="local"?"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness. That harness signs its own tokens, so a deployed game pointed at it would let anyone who can reach the key be any player. Name the login system a real fan signs in to. `gamestage dev` supplies its own and needs nothing here.":s==="insecure"?"Must be https. A key set fetched in clear text is a key set the network chooses, and a token checked against it has proved nothing.":"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."})}return e.identity.age_gate.required&&!e.identity.age_gate.minimum_age&&t.push({path:"identity.age_gate.minimum_age",message:"Required when identity.age_gate.required is true."}),e.identity.age_gate.method==="verified"&&!e.identity.age_gate.verifier&&t.push({path:"identity.age_gate.verifier",message:"Name the verifier when the method is `verified`. Gamestage provides no age verification, so an unnamed verifier is an unevidenced claim."}),t}var Ci,If,Cf,io,Fk,Pi,Rn,Ln,Gk,lO,qt,dO,uO,pO,Bk,Pf,Wk,Kk,Dn,Hk,fO,gO,yO,bO,vO,wO,_O,kO,Of,xO,SO,EO,TO,jn,ao,ln=w(()=>{"use strict";ze();xf();Sf();Fo();rn();Yt();Ci="1.0",If=c.enum(["missing","proposed","confirmed","verified","approved"]),Cf={missing:0,proposed:1,confirmed:2,verified:3,approved:4},io=c.enum(["runtime","live","enterprise"]),Fk="Accounts must be approved before the first deploy.",Pi={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},Rn=c.enum(["L0","L1","L2","L3","L4","L5"]),Ln={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},Gk={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},lO=c.discriminatedUnion("kind",[c.object({kind:c.literal("human_decision"),owner:c.string(),date:c.string(),note:c.string().optional()}),c.object({kind:c.literal("generated_proposal"),tool:c.string(),model:c.string().optional(),source_context:c.string().optional()}),c.object({kind:c.literal("repository_evidence"),file:c.string(),commit:c.string().optional(),package:c.string().optional()}),c.object({kind:c.literal("platform_evidence"),system:c.string(),id:c.string()}),c.object({kind:c.literal("external_evidence"),supplier:c.string(),licence:c.string().optional(),dataset_version:c.string().optional()})]),qt={status:If.default("missing"),provenance:c.array(lO).default([])},dO=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:Rn.default("L0")}),uO=c.object({repository:c.string().url(),branch:c.string().default("main")}),pO=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:uO.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...qt}),Bk=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Pf="managed_runtime",Wk=Bk.options.filter(e=>e!==Pf);Kk=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place"]),Dn=c.preprocess(e=>typeof e=="string"?qe(e):e,Kk),Hk=Kk.options.filter(e=>!Bt.includes(e));fO=c.object({route:Bk.optional().describe(`Only ${Pf} is a route Gamestage implements: every game runs on our Engine. ${Wk.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:Dn.optional().describe(`The formats the Engine marks are ${Bt.join(", ")}. ${Hk.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:c.string().optional(),version:c.string().optional(),variant:c.string().optional(),configuration:c.record(c.string(),c.unknown()).default({}),round:Xe.optional(),...qt}),gO=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(Sr),layout:uc.optional(),host:pc.optional(),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:Rn.optional()}).optional(),...qt}),yO=c.object({spec_url:c.string().optional(),version:c.string().optional(),...qt}),bO=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...qt}),vO=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...qt}),wO=c.object({required:c.boolean().default(!1),minimum_age:c.number().int().positive().max(120).optional(),method:c.enum(["self_declared","verified"]).default("self_declared"),verifier:c.string().optional()}),_O=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),kO=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:_O.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:wO.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...qt}),Of=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),xO=c.object({destinations:c.array(Of).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:c.array(c.string()).default([]),signal:c.object({enabled:c.boolean().default(!1),application_id:c.string().optional(),write_key:c.string().optional(),monterosa:c.object({enabled:c.boolean().default(!1),organisation_id:c.string().optional(),project_id:c.string().optional()}).prefault({})}).prefault({}),...qt}),SO=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...qt}),EO=c.object({offers_prize:c.boolean().default(!1),free_entry_route:c.string().optional(),skill_based:c.boolean().default(!1),terms_url:c.string().optional(),jurisdictions:c.array(c.string()).default([])}),TO=c.object({support_tier:io.optional(),runbook:c.string().optional(),promotion:EO.prefault({}),...qt}),jn=c.object({manifest:dO,app:pO,experience:gO.prefault({}),studio_app:yO.prefault({}),studio_surface:bO.prefault({}),backend:fO.prefault({}),interaction_cloud:vO.prefault({}),identity:kO.prefault({}),measurement:xO.prefault({}),deployment:SO.prefault({}),operations:TO.prefault({})});ao=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function vt(e,t={}){let r=m=>({id:m.id,level:m.level,requirement:m.requirement,advice:m.advice,owner:m.owner,passed:m.check(e,t)}),o=Nf.filter(m=>m.checkable).map(r),n=Nf.filter(m=>!m.checkable).map(r),i="L0",a=!0;for(let m of Rf){let y=o.filter(O=>O.level===m);y.length>0&&y.every(O=>O.passed)&&a?i=m:a=!1}let s=o.filter(m=>m.level==="L0").every(m=>m.passed),d=Ln[i]+1,l=Rf[d],p=l?o.filter(m=>m.level===l&&!m.passed):[],h=e.manifest.conformance;return{computed:i,computedName:Gk[i],claimed:h,overclaimed:!s||Math.min(Ln[h],Ln[Zk])>Ln[i],results:o,blockers:s?p:o.filter(m=>m.level==="L0"&&!m.passed),ceiling:Zk,advice:n}}function Yk(e,t){let o=vt(e).results.filter(n=>!n.passed&&Ln[n.level]<=Ln[t]);return{ok:o.length===0,missing:o}}var pr,Ke,Nf,Rf,$O,mF,Zk,wc=w(()=>{"use strict";ln();pr=(e,t,r)=>{let o=e[t];return Cf[o?.status??"missing"]>=Cf[r]},Ke=e=>typeof e=="string"?e.trim().length>0:e!=null,Nf=[{level:"L0",id:"L0.app.identity",checkable:!0,advice:"Give the game a name, and a short id we can use in web addresses.",owner:"creator",requirement:"app.id and app.title are set",check:e=>Ke(e.app.id)&&Ke(e.app.title)},{level:"L0",id:"L0.app.status",checkable:!0,advice:"Mark the game as started.",owner:"creator",requirement:"app section is at least proposed",check:e=>pr(e,"app","proposed")},{level:"L0",id:"L0.schema.version",checkable:!0,advice:"The version of the format this game is described in. Set when the game was created.",owner:"creator",requirement:"manifest.schema_version is set",check:e=>Ke(e.manifest.schema_version)},{level:"L1",id:"L1.experience.defined",checkable:!0,advice:"Describe the screens in the game.",owner:"creator",requirement:"experience declares a screen graph or at least one player surface",check:e=>Ke(e.experience.screen_graph)||e.experience.surfaces.length>0},{level:"L1",id:"L1.experience.status",checkable:!0,advice:"Mark the design as started.",owner:"creator",requirement:"experience section is at least proposed",check:e=>pr(e,"experience","proposed")},{level:"L1",id:"L1.backend.route",checkable:!0,advice:"Choose which engine runs the game: one we manage, or one you bring.",owner:"creator",requirement:"backend.route is chosen, so authority is decided before client code",check:e=>Ke(e.backend.route)},{level:"L2",id:"L2.backend.pinned",checkable:!0,advice:"Deploy the game. We record which engine answered.",owner:"creator",requirement:"a component is serving this game's rounds",check:(e,t)=>Ke(t.backendComponent)||Ke(e.backend.component)&&Ke(e.backend.version)},{level:"L2",id:"L2.identity.policy",checkable:!0,advice:"Say how a fan signs in. If they don't sign in, say that. Gamestage does not provide sign-in, so this names the one a fan meets.",owner:"creator",requirement:"an identity provider is named",check:e=>Ke(e.identity.provider)},{level:"L2",id:"L2.measurement.destination",checkable:!0,advice:"Switch on somewhere to send the data, on this game's Integrations tab. This checks the switch is on. Whether events are arriving is a separate question.",owner:"creator",requirement:"an analytics destination is switched on",check:(e,t)=>t.destinationsEnabled===!0||e.measurement.destinations.some(r=>r.enabled)},{level:"L2",id:"L2.platform.identifiers",checkable:!0,advice:"Deploy the game. That puts it on Monterosa's platform and gives you a place to manage content.",owner:"creator",requirement:"the game exists on Interaction Cloud",check:(e,t)=>Ke(t.platformProject)||Ke(e.studio_app.spec_url)||Ke(e.interaction_cloud.project_id)},{level:"L3",id:"L3.deployment.space",checkable:!0,advice:"Deploy the game with a URL.",owner:"creator",requirement:"the game is deployed somewhere a fan can reach",check:(e,t)=>Ke(t.playgroundUrl)||Ke(e.deployment.space_spec)&&e.deployment.environments.some(r=>r!=="local")},{level:"L3",id:"L3.surface.declared",checkable:!1,advice:"Say what the person running your game can change: rounds, wording, or both.",owner:"creator",requirement:"a Studio Surface family is declared for operator control",check:e=>Ke(e.studio_surface.family)},{level:"L3",id:"L3.sections.confirmed",checkable:!1,advice:"Mark which parts you have finished: the play, the scoring, and the hosting.",owner:"creator",requirement:"experience, backend and deployment are all confirmed or better",check:e=>pr(e,"experience","confirmed")&&pr(e,"backend","confirmed")&&pr(e,"deployment","confirmed")},{level:"L4",id:"L4.sections.verified",checkable:!1,advice:"Link proof it works: a play-through recording, or a test result.",owner:"creator",requirement:"experience, backend, identity and deployment are verified with evidence attached",check:e=>["experience","backend","identity","deployment"].every(t=>pr(e,t,"verified")&&e[t].provenance.length>0)},{level:"L4",id:"L4.operations.runbook",checkable:!1,advice:"Name who to call when it breaks, and link the instructions they follow.",owner:"creator",requirement:"operations declares a support tier and a runbook",check:e=>Ke(e.operations.support_tier)&&Ke(e.operations.runbook)},{level:"L5",id:"L5.production.approved",checkable:!1,advice:"Approve the game for prod, and move your workspace onto a paid plan. Monterosa does the second part.",owner:"monterosa",requirement:"the manifest is approved and deployed to a production environment",check:e=>pr(e,"operations","approved")&&e.deployment.environments.includes("production")}],Rf=["L0","L1","L2","L3","L4","L5"],$O=[{level:"L0",name:"Concept",means:"the game has a name and a description we hold for it"},{level:"L1",name:"Experience built",means:"there is something to play, and scoring runs on our server rather than in the browser"},{level:"L2",name:"Wired to the platform",means:"it is set up on the Monterosa platform, knows who each player is, and sends its numbers to your analytics"},{level:"L3",name:"Fans can reach it",means:"it is deployed at an address a fan can open"},{level:"L4",name:"Production ready",means:"checked with evidence, with someone to call and a page saying what to do if it breaks"},{level:"L5",name:"Operating live",means:"reviewed with you, and running in production"}],mF=new Map($O.map(e=>[e.level,e])),Zk=[...Rf].reverse().find(e=>Nf.some(t=>t.level===e&&t.checkable))??"L0"});function AO(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Oi(){if(qk)return Mn;qk=1;function e(a){return typeof a>"u"||a===null}function t(a){return typeof a=="object"&&a!==null}function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}function o(a,s){if(s){let d=Object.keys(s);for(let l=0,p=d.length;l<p;l+=1){let h=d[l];a[h]=s[h]}}return a}function n(a,s){let d="";for(let l=0;l<s;l+=1)d+=a;return d}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return Mn.isNothing=e,Mn.isObject=t,Mn.toArray=r,Mn.repeat=n,Mn.isNegativeZero=i,Mn.extend=o,Mn}function Ni(){if(Jk)return Lf;Jk=1;function e(r,o){let n="",i=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(n+='in "'+r.mark.name+'" '),n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!o&&r.mark.snippet&&(n+=`
|
|
78
78
|
|
|
79
|
-
`+r.mark.snippet),i+" "+n):i}function t(r,o){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=o,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(o){return this.name+": "+e(this,o)},
|
|
79
|
+
`+r.mark.snippet),i+" "+n):i}function t(r,o){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=o,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(o){return this.name+": "+e(this,o)},Lf=t,Lf}function IO(){if(Xk)return Df;Xk=1;let e=Oi();function t(n,i,a,s,d){let l="",p="",h=Math.floor(d/2)-1;return s-i>h&&(l=" ... ",i=s-h+l.length),a-s>h&&(p=" ...",a=s+h-p.length),{str:l+n.slice(i,a).replace(/\t/g,"\u2192")+p,pos:s-i+l.length}}function r(n,i){return e.repeat(" ",i-n.length)+n}function o(n,i){if(i=Object.create(i||null),!n.buffer)return null;i.maxLength||(i.maxLength=79),typeof i.indent!="number"&&(i.indent=1),typeof i.linesBefore!="number"&&(i.linesBefore=3),typeof i.linesAfter!="number"&&(i.linesAfter=2);let a=/\r?\n|\r|\0/g,s=[0],d=[],l,p=-1;for(;l=a.exec(n.buffer);)d.push(l.index),s.push(l.index+l[0].length),n.position<=l.index&&p<0&&(p=s.length-2);p<0&&(p=s.length-1);let h="",m=Math.min(n.line+i.linesAfter,d.length).toString().length,y=i.maxLength-(i.indent+m+3);for(let O=1;O<=i.linesBefore&&!(p-O<0);O++){let M=t(n.buffer,s[p-O],d[p-O],n.position-(s[p]-s[p-O]),y);h=e.repeat(" ",i.indent)+r((n.line-O+1).toString(),m)+" | "+M.str+`
|
|
80
80
|
`+h}let x=t(n.buffer,s[p],d[p],n.position,y);h+=e.repeat(" ",i.indent)+r((n.line+1).toString(),m)+" | "+x.str+`
|
|
81
81
|
`,h+=e.repeat("-",i.indent+m+3+x.pos)+`^
|
|
82
82
|
`;for(let O=1;O<=i.linesAfter&&!(p+O>=d.length);O++){let M=t(n.buffer,s[p+O],d[p+O],n.position-(s[p]-s[p+O]),y);h+=e.repeat(" ",i.indent)+r((n.line+O+1).toString(),m)+" | "+M.str+`
|
|
83
|
-
`}return h.replace(/\n$/,"")}return
|
|
84
|
-
\r`;function r(a){if(a===null)return!1;let s=0,d=a.length,l=t;for(let p=0;p<d;p++){let h=l.indexOf(a.charAt(p));if(!(h>64)){if(h<0)return!1;s+=6}}return s%8===0}function o(a){let s=a.replace(/[\r\n=]/g,""),d=s.length,l=t,p=0,h=[];for(let y=0;y<d;y++)y%4===0&&y&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|l.indexOf(s.charAt(y));let m=d%4*6;return m===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):m===18?(h.push(p>>10&255),h.push(p>>2&255)):m===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",d=0,l=a.length,p=t;for(let m=0;m<l;m++)m%3===0&&m&&(s+=p[d>>18&63],s+=p[d>>12&63],s+=p[d>>6&63],s+=p[d&63]),d=(d<<8)+a[m];let h=l%3;return h===0?(s+=p[d>>18&63],s+=p[d>>12&63],s+=p[d>>6&63],s+=p[d&63]):h===2?(s+=p[d>>10&63],s+=p[d>>4&63],s+=p[d<<2&63],s+=p[64]):h===1&&(s+=p[d>>2&63],s+=p[d<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return
|
|
83
|
+
`}return h.replace(/\n$/,"")}return Df=o,Df}function dt(){if(Qk)return jf;Qk=1;let e=Ni(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function o(i){let a={};return i!==null&&Object.keys(i).forEach(function(s){i[s].forEach(function(d){a[String(d)]=s})}),a}function n(i,a){if(a=a||{},Object.keys(a).forEach(function(s){if(t.indexOf(s)===-1)throw new e('Unknown option "'+s+'" is met in definition of "'+i+'" YAML type.')}),this.options=a,this.tag=i,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(s){return s},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=o(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}return jf=n,jf}function _x(){if(ex)return Mf;ex=1;let e=Ni(),t=dt();function r(i,a){let s=[];return i[a].forEach(function(d){let l=s.length;s.forEach(function(p,h){p.tag===d.tag&&p.kind===d.kind&&p.multi===d.multi&&(l=h)}),s[l]=d}),s}function o(){let i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(s){s.multi?(i.multi[s.kind].push(s),i.multi.fallback.push(s)):i[s.kind][s.tag]=i.fallback[s.tag]=s}for(let s=0,d=arguments.length;s<d;s+=1)arguments[s].forEach(a);return i}function n(i){return this.extend(i)}return n.prototype.extend=function(a){let s=[],d=[];if(a instanceof t)d.push(a);else if(Array.isArray(a))d=d.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(s=s.concat(a.implicit)),a.explicit&&(d=d.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");s.forEach(function(p){if(!(p instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(p.loadKind&&p.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(p.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),d.forEach(function(p){if(!(p instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let l=Object.create(n.prototype);return l.implicit=(this.implicit||[]).concat(s),l.explicit=(this.explicit||[]).concat(d),l.compiledImplicit=r(l,"implicit"),l.compiledExplicit=r(l,"explicit"),l.compiledTypeMap=o(l.compiledImplicit,l.compiledExplicit),l},Mf=n,Mf}function kx(){if(tx)return Uf;tx=1;let e=dt();return Uf=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Uf}function xx(){if(nx)return zf;nx=1;let e=dt();return zf=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),zf}function Sx(){if(rx)return Ff;rx=1;let e=dt();return Ff=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Ff}function Ex(){if(ox)return Gf;ox=1;let e=_x();return Gf=new e({explicit:[kx(),xx(),Sx()]}),Gf}function Tx(){if(ix)return Bf;ix=1;let e=dt();function t(n){if(n===null)return!0;let i=n.length;return i===1&&n==="~"||i===4&&(n==="null"||n==="Null"||n==="NULL")}function r(){return null}function o(n){return n===null}return Bf=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Bf}function $x(){if(ax)return Wf;ax=1;let e=dt();function t(n){if(n===null)return!1;let i=n.length;return i===4&&(n==="true"||n==="True"||n==="TRUE")||i===5&&(n==="false"||n==="False"||n==="FALSE")}function r(n){return n==="true"||n==="True"||n==="TRUE"}function o(n){return Object.prototype.toString.call(n)==="[object Boolean]"}return Wf=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{lowercase:function(n){return n?"true":"false"},uppercase:function(n){return n?"TRUE":"FALSE"},camelcase:function(n){return n?"True":"False"}},defaultStyle:"lowercase"}),Wf}function Ax(){if(sx)return Kf;sx=1;let e=Oi(),t=dt();function r(l){return l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102}function o(l){return l>=48&&l<=55}function n(l){return l>=48&&l<=57}function i(l){if(l===null)return!1;let p=l.length,h=0,m=!1;if(!p)return!1;let y=l[h];if((y==="-"||y==="+")&&(y=l[++h]),y==="0"){if(h+1===p)return!0;if(y=l[++h],y==="b"){for(h++;h<p;h++){if(y=l[h],y!=="0"&&y!=="1")return!1;m=!0}return m&&isFinite(a(l))}if(y==="x"){for(h++;h<p;h++){if(!r(l.charCodeAt(h)))return!1;m=!0}return m&&isFinite(a(l))}if(y==="o"){for(h++;h<p;h++){if(!o(l.charCodeAt(h)))return!1;m=!0}return m&&isFinite(a(l))}}for(;h<p;h++){if(!n(l.charCodeAt(h)))return!1;m=!0}return m?isFinite(a(l)):!1}function a(l){let p=l,h=1,m=p[0];if((m==="-"||m==="+")&&(m==="-"&&(h=-1),p=p.slice(1),m=p[0]),p==="0")return 0;if(m==="0"){if(p[1]==="b")return h*parseInt(p.slice(2),2);if(p[1]==="x")return h*parseInt(p.slice(2),16);if(p[1]==="o")return h*parseInt(p.slice(2),8)}return h*parseInt(p,10)}function s(l){return a(l)}function d(l){return Object.prototype.toString.call(l)==="[object Number]"&&l%1===0&&!e.isNegativeZero(l)}return Kf=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:s,predicate:d,represent:{binary:function(l){return l>=0?"0b"+l.toString(2):"-0b"+l.toString(2).slice(1)},octal:function(l){return l>=0?"0o"+l.toString(8):"-0o"+l.toString(8).slice(1)},decimal:function(l){return l.toString(10)},hexadecimal:function(l){return l>=0?"0x"+l.toString(16).toUpperCase():"-0x"+l.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Kf}function Ix(){if(cx)return Hf;cx=1;let e=Oi(),t=dt(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function n(l){return l===null||!r.test(l)?!1:isFinite(parseFloat(l,10))?!0:o.test(l)}function i(l){let p=l.toLowerCase(),h=p[0]==="-"?-1:1;return"+-".indexOf(p[0])>=0&&(p=p.slice(1)),p===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:p===".nan"?NaN:h*parseFloat(p,10)}let a=/^[-+]?[0-9]+e/;function s(l,p){if(isNaN(l))switch(p){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===l)switch(p){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===l)switch(p){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(l))return"-0.0";let h=l.toString(10);return a.test(h)?h.replace("e",".e"):h}function d(l){return Object.prototype.toString.call(l)==="[object Number]"&&(l%1!==0||e.isNegativeZero(l))}return Hf=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:d,represent:s,defaultStyle:"lowercase"}),Hf}function Cx(){return lx||(lx=1,Vf=Ex().extend({implicit:[Tx(),$x(),Ax(),Ix()]})),Vf}function Px(){return dx||(dx=1,Zf=Cx()),Zf}function Ox(){if(ux)return Yf;ux=1;let e=dt(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function o(a){return a===null?!1:t.exec(a)!==null||r.exec(a)!==null}function n(a){let s=0,d=null,l=t.exec(a);if(l===null&&(l=r.exec(a)),l===null)throw new Error("Date resolve error");let p=+l[1],h=+l[2]-1,m=+l[3];if(!l[4])return new Date(Date.UTC(p,h,m));let y=+l[4],x=+l[5],O=+l[6];if(l[7]){for(s=l[7].slice(0,3);s.length<3;)s+="0";s=+s}if(l[9]){let H=+l[10],T=+(l[11]||0);d=(H*60+T)*6e4,l[9]==="-"&&(d=-d)}let M=new Date(Date.UTC(p,h,m,y,x,O,s));return d&&M.setTime(M.getTime()-d),M}function i(a){return a.toISOString()}return Yf=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:n,instanceOf:Date,represent:i}),Yf}function Nx(){if(px)return qf;px=1;let e=dt();function t(r){return r==="<<"||r===null}return qf=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),qf}function Rx(){if(hx)return Jf;hx=1;let e=dt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
84
|
+
\r`;function r(a){if(a===null)return!1;let s=0,d=a.length,l=t;for(let p=0;p<d;p++){let h=l.indexOf(a.charAt(p));if(!(h>64)){if(h<0)return!1;s+=6}}return s%8===0}function o(a){let s=a.replace(/[\r\n=]/g,""),d=s.length,l=t,p=0,h=[];for(let y=0;y<d;y++)y%4===0&&y&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|l.indexOf(s.charAt(y));let m=d%4*6;return m===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):m===18?(h.push(p>>10&255),h.push(p>>2&255)):m===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",d=0,l=a.length,p=t;for(let m=0;m<l;m++)m%3===0&&m&&(s+=p[d>>18&63],s+=p[d>>12&63],s+=p[d>>6&63],s+=p[d&63]),d=(d<<8)+a[m];let h=l%3;return h===0?(s+=p[d>>18&63],s+=p[d>>12&63],s+=p[d>>6&63],s+=p[d&63]):h===2?(s+=p[d>>10&63],s+=p[d>>4&63],s+=p[d<<2&63],s+=p[64]):h===1&&(s+=p[d>>2&63],s+=p[d<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return Jf=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),Jf}function Lx(){if(mx)return Xf;mx=1;let e=dt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let a={},s=i;for(let d=0,l=s.length;d<l;d+=1){let p=s[d],h=!1;if(r.call(p)!=="[object Object]")return!1;let m;for(m in p)if(t.call(p,m))if(!h)h=!0;else return!1;if(!h||t.call(a,m))return!1;Object.defineProperty(a,m,{value:!0})}return!0}function n(i){return i!==null?i:[]}return Xf=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),Xf}function Dx(){if(fx)return Qf;fx=1;let e=dt(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,a=new Array(i.length);for(let s=0,d=i.length;s<d;s+=1){let l=i[s];if(t.call(l)!=="[object Object]")return!1;let p=Object.keys(l);if(p.length!==1)return!1;a[s]=[p[0],l[p[0]]]}return!0}function o(n){if(n===null)return[];let i=n,a=new Array(i.length);for(let s=0,d=i.length;s<d;s+=1){let l=i[s],p=Object.keys(l);a[s]=[p[0],l[p[0]]]}return a}return Qf=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),Qf}function jx(){if(gx)return eg;gx=1;let e=dt(),t=Object.prototype.hasOwnProperty;function r(n){if(n===null)return!0;let i=n;for(let a in i)if(t.call(i,a)&&i[a]!==null)return!1;return!0}function o(n){return n!==null?n:{}}return eg=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),eg}function rg(){return yx||(yx=1,tg=Px().extend({implicit:[Ox(),Nx()],explicit:[Rx(),Lx(),Dx(),jx()]})),tg}function CO(){if(bx)return _c;bx=1;let e=Oi(),t=Ni(),r=IO(),o=rg(),n=Object.prototype.hasOwnProperty,i=1,a=2,s=3,d=4,l=1,p=2,h=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,x=/[,\[\]{}]/,O=/^(?:!|!!|![0-9A-Za-z-]+!)$/,M=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function H(u){return Object.prototype.toString.call(u)}function T(u){return u===10||u===13}function _(u){return u===9||u===32}function b(u){return u===9||u===32||u===10||u===13}function v(u){return u===44||u===91||u===93||u===123||u===125}function j(u){if(u>=48&&u<=57)return u-48;let S=u|32;return S>=97&&S<=102?S-97+10:-1}function Y(u){return u===120?2:u===117?4:u===85?8:0}function X(u){return u>=48&&u<=57?u-48:-1}function se(u){switch(u){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
85
85
|
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function me(u){return u<=65535?String.fromCharCode(u):String.fromCharCode((u-65536>>10)+55296,(u-65536&1023)+56320)}function ye(u,S,L){S==="__proto__"?Object.defineProperty(u,S,{configurable:!0,enumerable:!0,writable:!0,value:L}):u[S]=L}let pt=new Array(256),wt=new Array(256);for(let u=0;u<256;u++)pt[u]=se(u)?1:0,wt[u]=se(u);function le(u,S){this.input=u,this.filename=S.filename||null,this.schema=S.schema||o,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.maxDepth=typeof S.maxDepth=="number"?S.maxDepth:100,this.maxTotalMergeKeys=typeof S.maxTotalMergeKeys=="number"?S.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=u.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function he(u,S){let L={name:u.filename,buffer:u.input.slice(0,-1),position:u.position,line:u.line,column:u.position-u.lineStart};return L.snippet=r(L),new t(S,L)}function Q(u,S){throw he(u,S)}function _t(u,S){u.onWarning&&u.onWarning.call(null,he(u,S))}function Ze(u,S,L){let D=u.anchorMapTransactions;if(D.length!==0){let P=D[D.length-1];n.call(P,S)||(P[S]={existed:n.call(u.anchorMap,S),value:u.anchorMap[S]})}u.anchorMap[S]=L}function bn(u){u.anchorMapTransactions.push(Object.create(null))}function ht(u){let S=u.anchorMapTransactions.pop(),L=u.anchorMapTransactions;if(L.length===0)return;let D=L[L.length-1],P=Object.keys(S);for(let f=0,$=P.length;f<$;f+=1){let C=P[f];n.call(D,C)||(D[C]=S[C])}}function rt(u){let S=u.anchorMapTransactions.pop(),L=Object.keys(S);for(let D=L.length-1;D>=0;D-=1){let P=S[L[D]];P.existed?u.anchorMap[L[D]]=P.value:delete u.anchorMap[L[D]]}}function Se(u){return{position:u.position,line:u.line,lineStart:u.lineStart,lineIndent:u.lineIndent,firstTabInLine:u.firstTabInLine,tag:u.tag,anchor:u.anchor,kind:u.kind,result:u.result}}function Be(u,S){u.position=S.position,u.line=S.line,u.lineStart=S.lineStart,u.lineIndent=S.lineIndent,u.firstTabInLine=S.firstTabInLine,u.tag=S.tag,u.anchor=S.anchor,u.kind=S.kind,u.result=S.result}let kt={YAML:function(S,L,D){S.version!==null&&Q(S,"duplication of %YAML directive"),D.length!==1&&Q(S,"YAML directive accepts exactly one argument");let P=/^([0-9]+)\.([0-9]+)$/.exec(D[0]);P===null&&Q(S,"ill-formed argument of the YAML directive");let f=parseInt(P[1],10),$=parseInt(P[2],10);f!==1&&Q(S,"unacceptable YAML version of the document"),S.version=D[0],S.checkLineBreaks=$<2,$!==1&&$!==2&&_t(S,"unsupported YAML version of the document")},TAG:function(S,L,D){let P;D.length!==2&&Q(S,"TAG directive accepts exactly two arguments");let f=D[0];P=D[1],O.test(f)||Q(S,"ill-formed tag handle (first argument) of the TAG directive"),n.call(S.tagMap,f)&&Q(S,'there is a previously declared suffix for "'+f+'" tag handle'),M.test(P)||Q(S,"ill-formed tag prefix (second argument) of the TAG directive");try{P=decodeURIComponent(P)}catch{Q(S,"tag prefix is malformed: "+P)}S.tagMap[f]=P}};function Ye(u,S,L,D){if(S<L){let P=u.input.slice(S,L);if(D)for(let f=0,$=P.length;f<$;f+=1){let C=P.charCodeAt(f);C===9||C>=32&&C<=1114111||Q(u,"expected valid JSON character")}else m.test(P)&&Q(u,"the stream contains non-printable characters");u.result+=P}}function mt(u){u.totalMergeKeys++,u.maxTotalMergeKeys!==-1&&u.totalMergeKeys>u.maxTotalMergeKeys&&Q(u,"merge keys exceeded maxTotalMergeKeys ("+u.maxTotalMergeKeys+")")}function je(u,S,L,D){e.isObject(L)||Q(u,"cannot merge mappings; the provided source object is unacceptable"),mt(u);let P=Object.keys(L);for(let f=0,$=P.length;f<$;f+=1){let C=P[f];mt(u),n.call(S,C)||(ye(S,C,L[C]),D[C]=!0)}}function xt(u,S,L,D,P,f,$,C,z){if(Array.isArray(P)){P=Array.prototype.slice.call(P);for(let B=0,V=P.length;B<V;B+=1)Array.isArray(P[B])&&Q(u,"nested arrays are not supported inside keys"),typeof P=="object"&&H(P[B])==="[object Object]"&&(P[B]="[object Object]")}if(typeof P=="object"&&H(P)==="[object Object]"&&(P="[object Object]"),P=String(P),S===null&&(S={}),D==="tag:yaml.org,2002:merge")if(Array.isArray(f)){f.length>100&&Q(u,"abnormal merge sequence size");for(let B=0,V=f.length;B<V;B+=1)je(u,S,f[B],L)}else je(u,S,f,L);else!u.json&&!n.call(L,P)&&n.call(S,P)&&(u.line=$||u.line,u.lineStart=C||u.lineStart,u.position=z||u.position,Q(u,"duplicated mapping key")),ye(S,P,f),delete L[P];return S}function Ft(u){let S=u.input.charCodeAt(u.position);S===10?u.position++:S===13?(u.position++,u.input.charCodeAt(u.position)===10&&u.position++):Q(u,"a line break is expected"),u.line+=1,u.lineStart=u.position,u.firstTabInLine=-1}function Ae(u,S,L){let D=0,P=u.input.charCodeAt(u.position);for(;P!==0;){for(;_(P);)P===9&&u.firstTabInLine===-1&&(u.firstTabInLine=u.position),P=u.input.charCodeAt(++u.position);if(S&&P===35)do P=u.input.charCodeAt(++u.position);while(P!==10&&P!==13&&P!==0);if(T(P))for(Ft(u),P=u.input.charCodeAt(u.position),D++,u.lineIndent=0;P===32;)u.lineIndent++,P=u.input.charCodeAt(++u.position);else break}return L!==-1&&D!==0&&u.lineIndent<L&&_t(u,"deficient indentation"),D}function ft(u){let S=u.position,L=u.input.charCodeAt(S);return!!((L===45||L===46)&&L===u.input.charCodeAt(S+1)&&L===u.input.charCodeAt(S+2)&&(S+=3,L=u.input.charCodeAt(S),L===0||b(L)))}function ne(u,S){S===1?u.result+=" ":S>1&&(u.result+=e.repeat(`
|
|
86
86
|
`,S-1))}function ot(u,S,L){let D,P,f,$,C,z,B=u.kind,V=u.result,N=u.input.charCodeAt(u.position);if(b(N)||v(N)||N===35||N===38||N===42||N===33||N===124||N===62||N===39||N===34||N===37||N===64||N===96)return!1;if(N===63||N===45){let q=u.input.charCodeAt(u.position+1);if(b(q)||L&&v(q))return!1}for(u.kind="scalar",u.result="",D=P=u.position,f=!1;N!==0;){if(N===58){let q=u.input.charCodeAt(u.position+1);if(b(q)||L&&v(q))break}else if(N===35){let q=u.input.charCodeAt(u.position-1);if(b(q))break}else{if(u.position===u.lineStart&&ft(u)||L&&v(N))break;if(T(N))if($=u.line,C=u.lineStart,z=u.lineIndent,Ae(u,!1,-1),u.lineIndent>=S){f=!0,N=u.input.charCodeAt(u.position);continue}else{u.position=P,u.line=$,u.lineStart=C,u.lineIndent=z;break}}f&&(Ye(u,D,P,!1),ne(u,u.line-$),D=P=u.position,f=!1),_(N)||(P=u.position+1),N=u.input.charCodeAt(++u.position)}return Ye(u,D,P,!1),u.result?!0:(u.kind=B,u.result=V,!1)}function tn(u,S){let L,D,P=u.input.charCodeAt(u.position);if(P!==39)return!1;for(u.kind="scalar",u.result="",u.position++,L=D=u.position;(P=u.input.charCodeAt(u.position))!==0;)if(P===39)if(Ye(u,L,u.position,!0),P=u.input.charCodeAt(++u.position),P===39)L=u.position,u.position++,D=u.position;else return!0;else T(P)?(Ye(u,L,D,!0),ne(u,Ae(u,!1,S)),L=D=u.position):u.position===u.lineStart&&ft(u)?Q(u,"unexpected end of the document within a single quoted scalar"):(u.position++,_(P)||(D=u.position));Q(u,"unexpected end of the stream within a single quoted scalar")}function Zn(u,S){let L,D,P,f=u.input.charCodeAt(u.position);if(f!==34)return!1;for(u.kind="scalar",u.result="",u.position++,L=D=u.position;(f=u.input.charCodeAt(u.position))!==0;){if(f===34)return Ye(u,L,u.position,!0),u.position++,!0;if(f===92){if(Ye(u,L,u.position,!0),f=u.input.charCodeAt(++u.position),T(f))Ae(u,!1,S);else if(f<256&&pt[f])u.result+=wt[f],u.position++;else if((P=Y(f))>0){let $=P,C=0;for(;$>0;$--)f=u.input.charCodeAt(++u.position),(P=j(f))>=0?C=(C<<4)+P:Q(u,"expected hexadecimal character");u.result+=me(C),u.position++}else Q(u,"unknown escape sequence");L=D=u.position}else T(f)?(Ye(u,L,D,!0),ne(u,Ae(u,!1,S)),L=D=u.position):u.position===u.lineStart&&ft(u)?Q(u,"unexpected end of the document within a double quoted scalar"):(u.position++,_(f)||(D=u.position))}Q(u,"unexpected end of the stream within a double quoted scalar")}function Yn(u,S){let L=!0,D,P,f,$=u.tag,C,z=u.anchor,B,V,N,q,re=Object.create(null),ae,ce,ue,fe=u.input.charCodeAt(u.position);if(fe===91)B=93,q=!1,C=[];else if(fe===123)B=125,q=!0,C={};else return!1;for(u.anchor!==null&&Ze(u,u.anchor,C),fe=u.input.charCodeAt(++u.position);fe!==0;){if(Ae(u,!0,S),fe=u.input.charCodeAt(u.position),fe===B)return u.position++,u.tag=$,u.anchor=z,u.kind=q?"mapping":"sequence",u.result=C,!0;if(L?fe===44&&Q(u,"expected the node content, but found ','"):Q(u,"missed comma between flow collection entries"),ce=ae=ue=null,V=N=!1,fe===63){let wn=u.input.charCodeAt(u.position+1);b(wn)&&(V=N=!0,u.position++,Ae(u,!0,S))}D=u.line,P=u.lineStart,f=u.position,vn(u,S,i,!1,!0),ce=u.tag,ae=u.result,Ae(u,!0,S),fe=u.input.charCodeAt(u.position),(N||u.line===D)&&fe===58&&(V=!0,fe=u.input.charCodeAt(++u.position),Ae(u,!0,S),vn(u,S,i,!1,!0),ue=u.result),q?xt(u,C,re,ce,ae,ue,D,P,f):V?C.push(xt(u,null,re,ce,ae,ue,D,P,f)):C.push(ae),Ae(u,!0,S),fe=u.input.charCodeAt(u.position),fe===44?(L=!0,fe=u.input.charCodeAt(++u.position)):L=!1}Q(u,"unexpected end of the stream within a flow collection")}function Rt(u,S){let L,D=l,P=!1,f=!1,$=S,C=0,z=!1,B,V=u.input.charCodeAt(u.position);if(V===124)L=!1;else if(V===62)L=!0;else return!1;for(u.kind="scalar",u.result="";V!==0;)if(V=u.input.charCodeAt(++u.position),V===43||V===45)l===D?D=V===43?h:p:Q(u,"repeat of a chomping mode identifier");else if((B=X(V))>=0)B===0?Q(u,"bad explicit indentation width of a block scalar; it cannot be less than one"):f?Q(u,"repeat of an indentation width identifier"):($=S+B-1,f=!0);else break;if(_(V)){do V=u.input.charCodeAt(++u.position);while(_(V));if(V===35)do V=u.input.charCodeAt(++u.position);while(!T(V)&&V!==0)}for(;V!==0;){for(Ft(u),u.lineIndent=0,V=u.input.charCodeAt(u.position);(!f||u.lineIndent<$)&&V===32;)u.lineIndent++,V=u.input.charCodeAt(++u.position);if(!f&&u.lineIndent>$&&($=u.lineIndent),T(V)){C++;continue}if(!f&&$===0&&Q(u,"missing indentation for block scalar"),u.lineIndent<$){D===h?u.result+=e.repeat(`
|
|
87
87
|
`,P?1+C:C):D===l&&P&&(u.result+=`
|
|
@@ -90,7 +90,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
90
90
|
`,C+1)):C===0?P&&(u.result+=" "):u.result+=e.repeat(`
|
|
91
91
|
`,C):u.result+=e.repeat(`
|
|
92
92
|
`,P?1+C:C),P=!0,f=!0,C=0;let N=u.position;for(;!T(V)&&V!==0;)V=u.input.charCodeAt(++u.position);Ye(u,N,u.position,!1)}return!0}function qn(u,S){let L=u.tag,D=u.anchor,P=[],f=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&Ze(u,u.anchor,P);let $=u.input.charCodeAt(u.position);for(;$!==0&&(u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,Q(u,"tab characters must not be used in indentation")),$===45);){let C=u.input.charCodeAt(u.position+1);if(!b(C))break;if(f=!0,u.position++,Ae(u,!0,-1)&&u.lineIndent<=S){P.push(null),$=u.input.charCodeAt(u.position);continue}let z=u.line;if(vn(u,S,s,!1,!0),P.push(u.result),Ae(u,!0,-1),$=u.input.charCodeAt(u.position),(u.line===z||u.lineIndent>S)&&$!==0)Q(u,"bad indentation of a sequence entry");else if(u.lineIndent<S)break}return f?(u.tag=L,u.anchor=D,u.kind="sequence",u.result=P,!0):!1}function ba(u,S,L){let D,P,f,$,C=u.tag,z=u.anchor,B={},V=Object.create(null),N=null,q=null,re=null,ae=!1,ce=!1;if(u.firstTabInLine!==-1)return!1;u.anchor!==null&&Ze(u,u.anchor,B);let ue=u.input.charCodeAt(u.position);for(;ue!==0;){!ae&&u.firstTabInLine!==-1&&(u.position=u.firstTabInLine,Q(u,"tab characters must not be used in indentation"));let fe=u.input.charCodeAt(u.position+1),wn=u.line;if((ue===63||ue===58)&&b(fe))ue===63?(ae&&(xt(u,B,V,N,q,null,P,f,$),N=q=re=null),ce=!0,ae=!0,D=!0):ae?(ae=!1,D=!0):Q(u,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),u.position+=1,ue=fe;else{if(P=u.line,f=u.lineStart,$=u.position,!vn(u,L,a,!1,!0))break;if(u.line===wn){for(ue=u.input.charCodeAt(u.position);_(ue);)ue=u.input.charCodeAt(++u.position);if(ue===58)ue=u.input.charCodeAt(++u.position),b(ue)||Q(u,"a whitespace character is expected after the key-value separator within a block mapping"),ae&&(xt(u,B,V,N,q,null,P,f,$),N=q=re=null),ce=!0,ae=!1,D=!1,N=u.tag,q=u.result;else if(ce)Q(u,"can not read an implicit mapping pair; a colon is missed");else return u.tag=C,u.anchor=z,!0}else if(ce)Q(u,"can not read a block mapping entry; a multiline key may not be an implicit key");else return u.tag=C,u.anchor=z,!0}if((u.line===wn||u.lineIndent>S)&&(ae&&(P=u.line,f=u.lineStart,$=u.position),vn(u,S,d,!0,D)&&(ae?q=u.result:re=u.result),ae||(xt(u,B,V,N,q,re,P,f,$),N=q=re=null),Ae(u,!0,-1),ue=u.input.charCodeAt(u.position)),(u.line===wn||u.lineIndent>S)&&ue!==0)Q(u,"bad indentation of a mapping entry");else if(u.lineIndent<S)break}return ae&&xt(u,B,V,N,q,null,P,f,$),ce&&(u.tag=C,u.anchor=z,u.kind="mapping",u.result=B),ce}function va(u){let S=!1,L=!1,D,P,f=u.input.charCodeAt(u.position);if(f!==33)return!1;u.tag!==null&&Q(u,"duplication of a tag property"),f=u.input.charCodeAt(++u.position),f===60?(S=!0,f=u.input.charCodeAt(++u.position)):f===33?(L=!0,D="!!",f=u.input.charCodeAt(++u.position)):D="!";let $=u.position;if(S){do f=u.input.charCodeAt(++u.position);while(f!==0&&f!==62);u.position<u.length?(P=u.input.slice($,u.position),f=u.input.charCodeAt(++u.position)):Q(u,"unexpected end of the stream within a verbatim tag")}else{for(;f!==0&&!b(f);)f===33&&(L?Q(u,"tag suffix cannot contain exclamation marks"):(D=u.input.slice($-1,u.position+1),O.test(D)||Q(u,"named tag handle cannot contain such characters"),L=!0,$=u.position+1)),f=u.input.charCodeAt(++u.position);P=u.input.slice($,u.position),x.test(P)&&Q(u,"tag suffix cannot contain flow indicator characters")}P&&!M.test(P)&&Q(u,"tag name cannot contain such characters: "+P);try{P=decodeURIComponent(P)}catch{Q(u,"tag name is malformed: "+P)}return S?u.tag=P:n.call(u.tagMap,D)?u.tag=u.tagMap[D]+P:D==="!"?u.tag="!"+P:D==="!!"?u.tag="tag:yaml.org,2002:"+P:Q(u,'undeclared tag handle "'+D+'"'),!0}function wa(u){let S=u.input.charCodeAt(u.position);if(S!==38)return!1;u.anchor!==null&&Q(u,"duplication of an anchor property"),S=u.input.charCodeAt(++u.position);let L=u.position;for(;S!==0&&!b(S)&&!v(S);)S=u.input.charCodeAt(++u.position);return u.position===L&&Q(u,"name of an anchor node must contain at least one character"),u.anchor=u.input.slice(L,u.position),!0}function ql(u){let S=u.input.charCodeAt(u.position);if(S!==42)return!1;S=u.input.charCodeAt(++u.position);let L=u.position;for(;S!==0&&!b(S)&&!v(S);)S=u.input.charCodeAt(++u.position);u.position===L&&Q(u,"name of an alias node must contain at least one character");let D=u.input.slice(L,u.position);return n.call(u.anchorMap,D)||Q(u,'unidentified alias "'+D+'"'),u.result=u.anchorMap[D],Ae(u,!0,-1),!0}function _a(u,S,L,D){let P=Se(u);return bn(u),Be(u,S),u.tag=null,u.anchor=null,u.kind=null,u.result=null,ba(u,L,D)&&u.kind==="mapping"?(ht(u),!0):(rt(u),Be(u,P),!1)}function vn(u,S,L,D,P){let f,$,C=1,z=!1,B=!1,V=null,N,q,re;u.depth>=u.maxDepth&&Q(u,"nesting exceeded maxDepth ("+u.maxDepth+")"),u.depth+=1,u.listener!==null&&u.listener("open",u),u.tag=null,u.anchor=null,u.kind=null,u.result=null;let ae=f=$=d===L||s===L;if(D&&Ae(u,!0,-1)&&(z=!0,u.lineIndent>S?C=1:u.lineIndent===S?C=0:u.lineIndent<S&&(C=-1)),C===1)for(;;){let ce=u.input.charCodeAt(u.position),ue=Se(u);if(z&&(ce===33&&u.tag!==null||ce===38&&u.anchor!==null)||!va(u)&&!wa(u))break;V===null&&(V=ue),Ae(u,!0,-1)?(z=!0,$=ae,u.lineIndent>S?C=1:u.lineIndent===S?C=0:u.lineIndent<S&&(C=-1)):$=!1}if($&&($=z||P),C===1||d===L)if(i===L||a===L?q=S:q=S+1,re=u.position-u.lineStart,C===1)if($&&(qn(u,re)||ba(u,re,q))||Yn(u,q))B=!0;else{let ce=u.input.charCodeAt(u.position);V!==null&&ae&&!$&&ce!==124&&ce!==62&&_a(u,V,V.position-V.lineStart,q)||f&&Rt(u,q)||tn(u,q)||Zn(u,q)?B=!0:ql(u)?(B=!0,(u.tag!==null||u.anchor!==null)&&Q(u,"alias node should not have any properties")):ot(u,q,i===L)&&(B=!0,u.tag===null&&(u.tag="?")),u.anchor!==null&&Ze(u,u.anchor,u.result)}else C===0&&(B=$&&qn(u,re));if(u.tag===null)u.anchor!==null&&Ze(u,u.anchor,u.result);else if(u.tag==="?"){u.result!==null&&u.kind!=="scalar"&&Q(u,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+u.kind+'"');for(let ce=0,ue=u.implicitTypes.length;ce<ue;ce+=1)if(N=u.implicitTypes[ce],N.resolve(u.result)){u.result=N.construct(u.result),u.tag=N.tag,u.anchor!==null&&Ze(u,u.anchor,u.result);break}}else if(u.tag!=="!"){if(n.call(u.typeMap[u.kind||"fallback"],u.tag))N=u.typeMap[u.kind||"fallback"][u.tag];else{N=null;let ce=u.typeMap.multi[u.kind||"fallback"];for(let ue=0,fe=ce.length;ue<fe;ue+=1)if(u.tag.slice(0,ce[ue].tag.length)===ce[ue].tag){N=ce[ue];break}}N||Q(u,"unknown tag !<"+u.tag+">"),u.result!==null&&N.kind!==u.kind&&Q(u,"unacceptable node kind for !<"+u.tag+'> tag; it should be "'+N.kind+'", not "'+u.kind+'"'),N.resolve(u.result,u.tag)?(u.result=N.construct(u.result,u.tag),u.anchor!==null&&Ze(u,u.anchor,u.result)):Q(u,"cannot resolve a node with !<"+u.tag+"> explicit tag")}return u.listener!==null&&u.listener("close",u),u.depth-=1,u.tag!==null||u.anchor!==null||B}function Jl(u){let S=u.position,L=!1,D;for(u.version=null,u.checkLineBreaks=u.legacy,u.tagMap=Object.create(null),u.anchorMap=Object.create(null);(D=u.input.charCodeAt(u.position))!==0&&(Ae(u,!0,-1),D=u.input.charCodeAt(u.position),!(u.lineIndent>0||D!==37));){L=!0,D=u.input.charCodeAt(++u.position);let P=u.position;for(;D!==0&&!b(D);)D=u.input.charCodeAt(++u.position);let f=u.input.slice(P,u.position),$=[];for(f.length<1&&Q(u,"directive name must not be less than one character in length");D!==0;){for(;_(D);)D=u.input.charCodeAt(++u.position);if(D===35){do D=u.input.charCodeAt(++u.position);while(D!==0&&!T(D));break}if(T(D))break;for(P=u.position;D!==0&&!b(D);)D=u.input.charCodeAt(++u.position);$.push(u.input.slice(P,u.position))}D!==0&&Ft(u),n.call(kt,f)?kt[f](u,f,$):_t(u,'unknown document directive "'+f+'"')}if(Ae(u,!0,-1),u.lineIndent===0&&u.input.charCodeAt(u.position)===45&&u.input.charCodeAt(u.position+1)===45&&u.input.charCodeAt(u.position+2)===45?(u.position+=3,Ae(u,!0,-1)):L&&Q(u,"directives end mark is expected"),vn(u,u.lineIndent-1,d,!1,!0),Ae(u,!0,-1),u.checkLineBreaks&&y.test(u.input.slice(S,u.position))&&_t(u,"non-ASCII line breaks are interpreted as content"),u.documents.push(u.result),u.position===u.lineStart&&ft(u)){u.input.charCodeAt(u.position)===46&&(u.position+=3,Ae(u,!0,-1));return}u.position<u.length-1&&Q(u,"end of the stream or a document separator is expected")}function Do(u,S){u=String(u),S=S||{},u.length!==0&&(u.charCodeAt(u.length-1)!==10&&u.charCodeAt(u.length-1)!==13&&(u+=`
|
|
93
|
-
`),u.charCodeAt(0)===65279&&(u=u.slice(1)));let L=new le(u,S),D=u.indexOf("\0");for(D!==-1&&(L.position=D,Q(L,"null byte is not allowed in input")),L.input+="\0";L.input.charCodeAt(L.position)===32;)L.lineIndent+=1,L.position+=1;for(;L.position<L.length-1;)Jl(L);return L.documents}function Xl(u,S,L){S!==null&&typeof S=="object"&&typeof L>"u"&&(L=S,S=null);let D=Do(u,L);if(typeof S!="function")return D;for(let P=0,f=D.length;P<f;P+=1)S(D[P])}function Ql(u,S){let L=Do(u,S);if(L.length!==0){if(L.length===1)return L[0];throw new t("expected a single document in the stream, but found more")}}return _c.loadAll=Xl,_c.load=Ql,_c}function PO(){if(
|
|
93
|
+
`),u.charCodeAt(0)===65279&&(u=u.slice(1)));let L=new le(u,S),D=u.indexOf("\0");for(D!==-1&&(L.position=D,Q(L,"null byte is not allowed in input")),L.input+="\0";L.input.charCodeAt(L.position)===32;)L.lineIndent+=1,L.position+=1;for(;L.position<L.length-1;)Jl(L);return L.documents}function Xl(u,S,L){S!==null&&typeof S=="object"&&typeof L>"u"&&(L=S,S=null);let D=Do(u,L);if(typeof S!="function")return D;for(let P=0,f=D.length;P<f;P+=1)S(D[P])}function Ql(u,S){let L=Do(u,S);if(L.length!==0){if(L.length===1)return L[0];throw new t("expected a single document in the stream, but found more")}}return _c.loadAll=Xl,_c.load=Ql,_c}function PO(){if(vx)return ng;vx=1;let e=Oi(),t=Ni(),r=rg(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,a=9,s=10,d=13,l=32,p=33,h=34,m=35,y=37,x=38,O=39,M=42,H=44,T=45,_=58,b=61,v=62,j=63,Y=64,X=91,se=93,me=96,ye=123,pt=124,wt=125,le={};le[0]="\\0",le[7]="\\a",le[8]="\\b",le[9]="\\t",le[10]="\\n",le[11]="\\v",le[12]="\\f",le[13]="\\r",le[27]="\\e",le[34]='\\"',le[92]="\\\\",le[133]="\\N",le[160]="\\_",le[8232]="\\L",le[8233]="\\P";let he=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Q=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function _t(f,$){if($===null)return{};let C={},z=Object.keys($);for(let B=0,V=z.length;B<V;B+=1){let N=z[B],q=String($[N]);N.slice(0,2)==="!!"&&(N="tag:yaml.org,2002:"+N.slice(2));let re=f.compiledTypeMap.fallback[N];re&&n.call(re.styleAliases,q)&&(q=re.styleAliases[q]),C[N]=q}return C}function Ze(f){let $,C,z=f.toString(16).toUpperCase();if(f<=255)$="x",C=2;else if(f<=65535)$="u",C=4;else if(f<=4294967295)$="U",C=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+$+e.repeat("0",C-z.length)+z}let bn=1,ht=2;function rt(f){this.schema=f.schema||r,this.indent=Math.max(1,f.indent||2),this.noArrayIndent=f.noArrayIndent||!1,this.skipInvalid=f.skipInvalid||!1,this.flowLevel=e.isNothing(f.flowLevel)?-1:f.flowLevel,this.styleMap=_t(this.schema,f.styles||null),this.sortKeys=f.sortKeys||!1,this.lineWidth=f.lineWidth||80,this.noRefs=f.noRefs||!1,this.noCompatMode=f.noCompatMode||!1,this.condenseFlow=f.condenseFlow||!1,this.quotingType=f.quotingType==='"'?ht:bn,this.forceQuotes=f.forceQuotes||!1,this.replacer=typeof f.replacer=="function"?f.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Se(f,$){let C=e.repeat(" ",$),z=0,B="",V=f.length;for(;z<V;){let N,q=f.indexOf(`
|
|
94
94
|
`,z);q===-1?(N=f.slice(z),z=V):(N=f.slice(z,q+1),z=q+1),N.length&&N!==`
|
|
95
95
|
`&&(B+=C),B+=N}return B}function Be(f,$){return`
|
|
96
96
|
`+e.repeat(" ",f.indent*$)}function kt(f,$){for(let C=0,z=f.implicitTypes.length;C<z;C+=1)if(f.implicitTypes[C].resolve($))return!0;return!1}function Ye(f){return f===l||f===a}function mt(f){return f>=32&&f<=126||f>=161&&f<=55295&&f!==8232&&f!==8233||f>=57344&&f<=65533&&f!==i||f>=65536&&f<=1114111}function je(f){return mt(f)&&f!==i&&f!==d&&f!==s}function xt(f,$,C){let z=je(f),B=z&&!Ye(f);return(C?z:z&&f!==H&&f!==X&&f!==se&&f!==ye&&f!==wt)&&f!==m&&!($===_&&!B)||je($)&&!Ye($)&&f===m||$===_&&B}function Ft(f){return mt(f)&&f!==i&&!Ye(f)&&f!==T&&f!==j&&f!==_&&f!==H&&f!==X&&f!==se&&f!==ye&&f!==wt&&f!==m&&f!==x&&f!==M&&f!==p&&f!==pt&&f!==b&&f!==v&&f!==O&&f!==h&&f!==y&&f!==Y&&f!==me}function Ae(f){return!Ye(f)&&f!==_}function ft(f,$){let C=f.charCodeAt($),z;return C>=55296&&C<=56319&&$+1<f.length&&(z=f.charCodeAt($+1),z>=56320&&z<=57343)?(C-55296)*1024+z-56320+65536:C}function ne(f){return/^\n* /.test(f)}let ot=1,tn=2,Zn=3,Yn=4,Rt=5;function qn(f,$,C,z,B,V,N,q){let re,ae=0,ce=null,ue=!1,fe=!1,wn=z!==-1,jo=-1,Mo=Ft(ft(f,0))&&Ae(ft(f,f.length-1));if($||N)for(re=0;re<f.length;ae>=65536?re+=2:re++){if(ae=ft(f,re),!mt(ae))return Rt;Mo=Mo&&xt(ae,ce,q),ce=ae}else{for(re=0;re<f.length;ae>=65536?re+=2:re++){if(ae=ft(f,re),ae===s)ue=!0,wn&&(fe=fe||re-jo-1>z&&f[jo+1]!==" ",jo=re);else if(!mt(ae))return Rt;Mo=Mo&&xt(ae,ce,q),ce=ae}fe=fe||wn&&re-jo-1>z&&f[jo+1]!==" "}return!ue&&!fe?Mo&&!N&&!B(f)?ot:V===ht?Rt:tn:C>9&&ne(f)?Rt:N?V===ht?Rt:tn:fe?Yn:Zn}function ba(f,$,C,z,B){f.dump=(function(){if($.length===0)return f.quotingType===ht?'""':"''";if(!f.noCompatMode&&(he.indexOf($)!==-1||Q.test($)))return f.quotingType===ht?'"'+$+'"':"'"+$+"'";let V=f.indent*Math.max(1,C),N=f.lineWidth===-1?-1:Math.max(Math.min(f.lineWidth,40),f.lineWidth-V),q=z||f.flowLevel>-1&&C>=f.flowLevel;function re(ae){return kt(f,ae)}switch(qn($,q,f.indent,N,re,f.quotingType,f.forceQuotes&&!z,B)){case ot:return $;case tn:return"'"+$.replace(/'/g,"''")+"'";case Zn:return"|"+va($,f.indent)+wa(Se($,V));case Yn:return">"+va($,f.indent)+wa(Se(ql($,N),V));case Rt:return'"'+vn($)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function va(f,$){let C=ne(f)?String($):"",z=f[f.length-1]===`
|
|
@@ -105,7 +105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
105
105
|
`+f.slice(B,V),B=V+1),N=q;return re+=`
|
|
106
106
|
`,f.length-B>$&&N>B?re+=f.slice(B,N)+`
|
|
107
107
|
`+f.slice(N+1):re+=f.slice(B),re.slice(1)}function vn(f){let $="",C=0;for(let z=0;z<f.length;C>=65536?z+=2:z++){C=ft(f,z);let B=le[C];!B&&mt(C)?($+=f[z],C>=65536&&($+=f[z+1])):$+=B||Ze(C)}return $}function Jl(f,$,C){let z="",B=f.tag;for(let V=0,N=C.length;V<N;V+=1){let q=C[V];f.replacer&&(q=f.replacer.call(C,String(V),q)),(S(f,$,q,!1,!1)||typeof q>"u"&&S(f,$,null,!1,!1))&&(z!==""&&(z+=","+(f.condenseFlow?"":" ")),z+=f.dump)}f.tag=B,f.dump="["+z+"]"}function Do(f,$,C,z){let B="",V=f.tag;for(let N=0,q=C.length;N<q;N+=1){let re=C[N];f.replacer&&(re=f.replacer.call(C,String(N),re)),(S(f,$+1,re,!0,!0,!1,!0)||typeof re>"u"&&S(f,$+1,null,!0,!0,!1,!0))&&((!z||B!=="")&&(B+=Be(f,$)),f.dump&&s===f.dump.charCodeAt(0)?B+="-":B+="- ",B+=f.dump)}f.tag=V,f.dump=B||"[]"}function Xl(f,$,C){let z="",B=f.tag,V=Object.keys(C);for(let N=0,q=V.length;N<q;N+=1){let re="";z!==""&&(re+=", "),f.condenseFlow&&(re+='"');let ae=V[N],ce=C[ae];f.replacer&&(ce=f.replacer.call(C,ae,ce)),S(f,$,ae,!1,!1)&&(f.dump.length>1024&&(re+="? "),re+=f.dump+(f.condenseFlow?'"':"")+":"+(f.condenseFlow?"":" "),S(f,$,ce,!1,!1)&&(re+=f.dump,z+=re))}f.tag=B,f.dump="{"+z+"}"}function Ql(f,$,C,z){let B="",V=f.tag,N=Object.keys(C);if(f.sortKeys===!0)N.sort();else if(typeof f.sortKeys=="function")N.sort(f.sortKeys);else if(f.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let q=0,re=N.length;q<re;q+=1){let ae="";(!z||B!=="")&&(ae+=Be(f,$));let ce=N[q],ue=C[ce];if(f.replacer&&(ue=f.replacer.call(C,ce,ue)),!S(f,$+1,ce,!0,!0,!0))continue;let fe=f.tag!==null&&f.tag!=="?"||f.dump&&f.dump.length>1024;fe&&(f.dump&&s===f.dump.charCodeAt(0)?ae+="?":ae+="? "),ae+=f.dump,fe&&(ae+=Be(f,$)),S(f,$+1,ue,!0,fe)&&(f.dump&&s===f.dump.charCodeAt(0)?ae+=":":ae+=": ",ae+=f.dump,B+=ae)}f.tag=V,f.dump=B||"{}"}function u(f,$,C){let z=C?f.explicitTypes:f.implicitTypes;for(let B=0,V=z.length;B<V;B+=1){let N=z[B];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof $=="object"&&$ instanceof N.instanceOf)&&(!N.predicate||N.predicate($))){if(C?N.multi&&N.representName?f.tag=N.representName($):f.tag=N.tag:f.tag="?",N.represent){let q=f.styleMap[N.tag]||N.defaultStyle,re;if(o.call(N.represent)==="[object Function]")re=N.represent($,q);else if(n.call(N.represent,q))re=N.represent[q]($,q);else throw new t("!<"+N.tag+'> tag resolver accepts not "'+q+'" style');f.dump=re}return!0}}return!1}function S(f,$,C,z,B,V,N){f.tag=null,f.dump=C,u(f,C,!1)||u(f,C,!0);let q=o.call(f.dump),re=z;z&&(z=f.flowLevel<0||f.flowLevel>$);let ae=q==="[object Object]"||q==="[object Array]",ce,ue;if(ae&&(ce=f.duplicates.indexOf(C),ue=ce!==-1),(f.tag!==null&&f.tag!=="?"||ue||f.indent!==2&&$>0)&&(B=!1),ue&&f.usedDuplicates[ce])f.dump="*ref_"+ce;else{if(ae&&ue&&!f.usedDuplicates[ce]&&(f.usedDuplicates[ce]=!0),q==="[object Object]")z&&Object.keys(f.dump).length!==0?(Ql(f,$,f.dump,B),ue&&(f.dump="&ref_"+ce+f.dump)):(Xl(f,$,f.dump),ue&&(f.dump="&ref_"+ce+" "+f.dump));else if(q==="[object Array]")z&&f.dump.length!==0?(f.noArrayIndent&&!N&&$>0?Do(f,$-1,f.dump,B):Do(f,$,f.dump,B),ue&&(f.dump="&ref_"+ce+f.dump)):(Jl(f,$,f.dump),ue&&(f.dump="&ref_"+ce+" "+f.dump));else if(q==="[object String]")f.tag!=="?"&&ba(f,f.dump,$,V,re);else{if(q==="[object Undefined]")return!1;if(f.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+q)}if(f.tag!==null&&f.tag!=="?"){let fe=encodeURI(f.tag[0]==="!"?f.tag.slice(1):f.tag).replace(/!/g,"%21");f.tag[0]==="!"?fe="!"+fe:fe.slice(0,18)==="tag:yaml.org,2002:"?fe="!!"+fe.slice(18):fe="!<"+fe+">",f.dump=fe+" "+f.dump}}return!0}function L(f,$){let C=[],z=[];D(f,C,z);let B=z.length;for(let V=0;V<B;V+=1)$.duplicates.push(C[z[V]]);$.usedDuplicates=new Array(B)}function D(f,$,C){if(f!==null&&typeof f=="object"){let z=$.indexOf(f);if(z!==-1)C.indexOf(z)===-1&&C.push(z);else if($.push(f),Array.isArray(f))for(let B=0,V=f.length;B<V;B+=1)D(f[B],$,C);else{let B=Object.keys(f);for(let V=0,N=B.length;V<N;V+=1)D(f[B[V]],$,C)}}}function P(f,$){$=$||{};let C=new rt($);C.noRefs||L(f,C);let z=f;return C.replacer&&(z=C.replacer.call({"":z},"",z)),S(C,0,z,!0,!0)?C.dump+`
|
|
108
|
-
`:""}return tg.dump=P,tg}function OO(){if(vx)return Qe;vx=1;let e=CO(),t=PO();function r(o,n){return function(){throw new Error("Function yaml."+o+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Qe.Type=dt(),Qe.Schema=wx(),Qe.FAILSAFE_SCHEMA=Sx(),Qe.JSON_SCHEMA=Ix(),Qe.CORE_SCHEMA=Cx(),Qe.DEFAULT_SCHEMA=ng(),Qe.load=e.load,Qe.loadAll=e.loadAll,Qe.dump=t.dump,Qe.YAMLException=Ni(),Qe.types={binary:Nx(),float:Ax(),map:xx(),null:Ex(),pairs:Lx(),set:Dx(),timestamp:Px(),bool:Tx(),int:$x(),merge:Ox(),omap:Rx(),seq:kx(),str:_x()},Qe.safeLoad=r("safeLoad","load"),Qe.safeLoadAll=r("safeLoadAll","loadAll"),Qe.safeDump=r("safeDump","dump"),Qe}var Qe,_c,Mn,Yk,Rf,qk,Lf,Jk,Df,Xk,jf,Qk,Mf,ex,Uf,tx,zf,nx,Ff,rx,Gf,ox,Bf,ix,Wf,ax,Kf,sx,Hf,cx,Vf,lx,Zf,dx,Yf,ux,qf,px,Jf,hx,Xf,mx,Qf,fx,eg,gx,yx,tg,bx,vx,NO,so,gF,yF,bF,vF,wF,_F,jx,kF,xF,SF,EF,TF,$F,AF,kc=w(()=>{Qe={},_c={},Mn={};tg={};NO=OO(),so=AO(NO),{Type:gF,Schema:yF,FAILSAFE_SCHEMA:bF,JSON_SCHEMA:vF,CORE_SCHEMA:wF,DEFAULT_SCHEMA:_F,load:jx,loadAll:kF,dump:xF,YAMLException:SF,types:EF,safeLoad:TF,safeLoadAll:$F,safeDump:AF}=so});function Fe(e){let t;try{t=so.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=jn.safeParse(t);if(!r.success)return{ok:!1,issues:RO(r.error)};let o=Hk(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function RO(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function Ri(e){return so.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function xc(e,t){return jn.parse({manifest:{schema_version:Ci,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Li=w(()=>{"use strict";kc();ln()});var rg=w(()=>{"use strict";Li();ln();wc()});var Mx=w(()=>{"use strict"});function Ux(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:vt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ao.map(o=>({section:o,status:e[o].status}))}}function zx(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var Fx=w(()=>{"use strict";wc();Li();ln()});var Ie,Sc,Gx=w(()=>{"use strict";Ie={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",restoreSession:"/play/v1/games/{game}/session/restore",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",identityOptions:"/play/v1/games/{game}/identity",identity:"/play/v1/games/{game}/players/me/identity",recoveryCode:"/play/v1/games/{game}/players/me/recovery-code",leaderboard:"/play/v1/games/{game}/leaderboard"},Sc="/play"});function Ec(e,t,r={}){let o=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:o,max_streak:Math.max(e.max_streak,o),exact:(e.exact??0)+(r.exact===!0?1:0),...typeof r.score=="number"?{best_score:Math.max(e.best_score??r.score,r.score)}:e.best_score===void 0?{}:{best_score:e.best_score}}}var Bx,jt,LO,DO,jO,HF,Kx,MO,UO,VF,zO,ZF,YF,qF,Hx,FO,GO,JF,BO,WO,XF,Wx,QF,e6,t6,Vx,og=w(()=>{"use strict";ze();ln();fc();Gx();Bx="2.0",jt=c.object({server_time:c.string(),snapshot:c.string()}),LO=c.enum(["at_commit","at_settlement"]),DO=c.enum(["shared","per_player","feed"]),jO=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),HF=jt.extend({game:c.string(),api_version:c.literal(Bx).default(Bx),archetype:Dn,marking:LO,challenge_source:DO,schedule:jO,updates:c.object({transport:c.enum(["poll","socket"]),freshness_seconds:c.number().int().positive()}),display:c.record(c.string(),c.unknown()).default({}),identity:c.object({required:c.boolean(),provider:c.string(),anonymous_play:c.boolean().default(!1)}),archive:c.boolean().default(!1),capabilities:c.array(c.string()).default([])}),Kx=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),MO=jt.extend({id:c.string(),number:c.number().int().positive().optional(),origin:Ai.optional(),version:c.number().int().nonnegative(),can:Kx,opens_at:c.string().optional(),locks_at:c.string().optional(),timer_seconds:c.number().int().positive().optional(),challenge_instance_id:c.string().nullable().default(null),challenge:c.record(c.string(),c.unknown()).default({}),solution:c.record(c.string(),c.unknown()).optional()}),UO=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Kx,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),VF=jt.extend({rounds:c.array(UO)}),zO=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),last_played_at:c.string().optional(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),ZF=jt.extend({player_id:c.string(),played:c.array(zO)}),YF=jt.extend({status:c.enum(["ready","exhausted"]),round:MO.optional()}),qF=jt.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Hx=c.object({idempotency_key:c.string().min(8),round_version:c.number().int().nonnegative(),challenge_instance_id:c.string().nullable().default(null),payload:c.record(c.string(),c.unknown()).refine(e=>e.op===void 0||typeof e.op=="string"&&e.op.length>0,{message:"op must be a non-empty string when present",path:["op"]})}),FO=c.enum(["accepted","rejected","duplicate","stale","busy"]),GO=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),JF=jt.extend({play_id:c.string(),outcome:FO,reason:c.string().optional(),round_version:c.number().int().nonnegative(),retry_after_seconds:c.number().int().positive().optional(),marked:c.boolean().default(!0),feedback:c.array(GO).default([]),round_state:c.lazy(()=>WO).optional()}),BO=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),WO=jt.extend({player_id:c.string(),round_id:c.string(),started_at:c.string().optional(),attempts_used:c.number().int().nonnegative().default(0),attempts_allowed:c.number().int().nonnegative().optional(),mistakes_used:c.number().int().nonnegative().default(0),mistakes_allowed:c.number().int().nonnegative().optional(),progress:c.record(c.string(),c.unknown()).default({}),score:c.number().default(0),score_revision:c.number().int().nonnegative().default(0),finished:c.boolean().default(!1),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional(),share:BO.optional()}),XF=jt.extend({player_id:c.string(),display_name:c.string().optional(),avatar:c.string().optional(),avatar_url:c.string().optional(),played:c.number().int().nonnegative().default(0),won:c.number().int().nonnegative().default(0),current_streak:c.number().int().nonnegative().default(0),max_streak:c.number().int().nonnegative().default(0),exact:c.number().int().nonnegative().optional(),best_score:c.number().optional(),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Wx=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),avatar:c.string().optional(),avatar_url:c.string().optional(),exact:c.boolean().optional(),score:c.number()}),QF=jt.extend({round_id:c.string().optional(),order:c.enum(["high_first","low_first"]).default("high_first"),tie_break:c.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:c.array(Wx).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Wx.optional()}),e6=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})}),t6=jt.extend({adjectives:c.array(c.string()),animals:c.array(c.string()),avatars:c.array(c.object({id:c.string(),url:c.string()}))}),Vx=c.object({name:c.object({adjective:c.string().min(1),animal:c.string().min(1)}).optional(),avatar:c.string().min(1).optional()}).refine(e=>e.name!==void 0||e.avatar!==void 0,{message:"Send a name, an avatar, or both."})});function Zx(e){return YO[qe(e)]}function Yx(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:Zx(t)?.[0]}function qx(e,t){return Zx(e)?.includes(t)??!1}function Tc(e){return ig({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function ig(e){if(Array.isArray(e))return`[${e.map(ig).join(",")}]`;if(e&&typeof e=="object"){let t=e;return`{${Object.keys(t).filter(o=>t[o]!==void 0).sort().map(o=>`${JSON.stringify(o)}:${ig(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var KO,HO,VO,ZO,ag,s6,YO,Jx=w(()=>{"use strict";ze();rn();ro();KO=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),HO=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),VO=c.object({op:c.literal("answer"),answers:c.record(c.string(),c.union([c.string(),c.number()])).optional(),picks:c.array(c.string()).optional()}).passthrough(),ZO=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),ag=c.object({op:c.literal(no),model:c.literal(Nn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(lt.aimX.min).max(lt.aimX.max),aimY:c.number().int().min(lt.aimY.min).max(lt.aimY.max),power:c.number().int().min(lt.power.min).max(lt.power.max)}).strict(),s6=c.union([HO,VO,ZO,ag,KO]),YO={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[no],place:["place","skip"]}});function Qx(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function eS(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function oS(e,t=$c){return e.terms?.version===t}function Ic(e){let t=iS.safeParse(e.access);return t.success?t.data:"pending"}function aS(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),role:t(e.role),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",termsVersion:t(e.termsVersion),decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function sS(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function cg(e){return pN.includes(e)}function lg(e,t){return!e.prodApproval||cg(t.tier)?"dev":"prod"}function lS(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function dS(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var qO,JO,Xx,XO,QO,eN,sg,tN,nN,tS,rN,m6,nS,oN,$c,Ac,rS,iN,aN,iS,f6,g6,sN,cN,lN,y6,b6,v6,w6,_6,dN,k6,cS,x6,uN,pN,Cc=w(()=>{"use strict";ze();ln();Fo();$i();$i();Yt();qO=c.enum(["draft","live","sleeping","throttled","expired","archived"]),JO=c.enum(["scheduled","open","locked","settled"]),Xx=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),XO=c.object({id:c.string(),label:c.string(),state:JO,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),QO=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),eN=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),sg=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),tN=c.enum(["absent","pending","ready","failed"]),nN=c.object({state:tN.default("absent"),url:c.string().nullable().default(null),regenerations:c.number().int().nonnegative().default(0),updatedAt:c.string().nullable().default(null),onProject:c.string().nullable().default(null)});tS=c.object({section:c.string(),status:Af}),rN=c.object({instanceId:c.string(),embedSlug:c.string(),template:c.string(),type:c.enum(["leaderboard","qr"]),createdAt:c.string(),consentBy:c.string()}),m6=c.object({template:c.string().min(1),consent:c.literal(!0)}),nS=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(Sr),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(eN).default([]),archetype:Dn,offersPrize:c.boolean().default(!1),state:qO,prodApproval:c.object({approvedAt:c.string(),approvedBy:c.string()}).nullable().default(null).optional(),archivePrefix:c.string().nullable().default(null),space:c.string().nullable().default(null).optional(),platformSpace:c.string().nullable().default(null).optional(),platformProject:c.string().nullable().default(null).optional(),platformEvent:c.string().nullable().default(null).optional(),platformElement:c.string().nullable().default(null).optional(),studioUrl:c.string().nullable().default(null).optional(),appSpec:c.object({version:c.string(),shape:c.string(),resource:c.string().nullable().default(null),specUrl:c.string().optional(),wording:c.array(c.string()).optional(),refusal:c.object({at:c.string(),reason:c.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:nN.prefault({}).optional(),graphics:c.array(rN).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),settingsDefaults:c.record(c.string(),c.string()).optional(),conformance:Rn,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(tS),meters:c.array(Xx),history:c.array(Ti),rounds:c.array(XO),destinations:c.array(QO),logs:c.array(sg),updatedAt:c.string()}),oN=c.object({login:c.string(),linkedAt:c.string()}),$c="2026-09-06",Ac="https://gamestage.ai/terms",rS="https://gamestage.ai/stage",iN=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});aN=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),iS=c.enum(["pending","approved","refused"]),f6=c.enum(["manual","automatic"]);g6=c.enum(["approved","refused"]),sN=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});cN=c.object({id:c.string(),name:c.string(),tier:io,ownerEmail:c.string(),access:iS.default("pending"),profile:sN.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:oN.nullable().default(null),terms:iN.nullable().default(null),signal:aN.prefault({}),meters:c.array(Xx),games:c.array(nS)}),lN=nS.extend({logs:c.array(sg).optional()}),y6=cN.extend({games:c.array(lN),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),b6=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),v6=c.object({id:c.string(),name:c.string(),archetype:Dn,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:Rn,offersPrize:c.boolean().default(!1),sections:c.array(tS).default([]),containerLabel:c.string().min(1).optional()}),w6=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),_6=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:Rn,offersPrize:c.boolean().default(!1),round:Xe.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),settings:c.record(c.string(),c.string()).optional(),notes:c.string().max(500).optional()}),dN=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:sg.shape.level.nullable().default(null)}),k6=c.enum(["access_pending","terms_not_accepted","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),cS=c.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","github.linked","github.unlinked","terms.accepted","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.graphic.added","game.graphic.removed","game.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","engine.integrity_violation","destination.changed","signal.enabled","signal.disabled","source.key_attempt"]),x6=c.object({id:c.string(),at:c.string(),action:cS,actor:c.object({kind:c.enum(["creator","operator","system"]),id:c.string(),email:c.string().nullable().default(null)}),gameId:c.string().nullable().default(null),correlationId:c.string(),detail:c.record(c.string(),c.unknown()).default({})}),uN=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:cS.nullable().default(null),actorId:c.string().nullable().default(null),gameId:c.string().nullable().default(null),from:c.string().nullable().default(null),to:c.string().nullable().default(null)}),pN=["runtime"]});var Jt=w(()=>{"use strict"});function yN(e){return`slate-${e+1}`}function hS(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:yN(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var fN,gN,pS,Un=w(()=>{"use strict";ze();Jt();fN=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),gN=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(fN).min(1)}),pS=c.object({archetype:c.literal("push"),theme:c.string().default(""),prompt:c.string().default(""),target:c.number().int().positive().optional(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),slates:c.array(gN).min(1)})});var L6,Pc=w(()=>{"use strict";ze();Yt();Un();Jt();L6=c.discriminatedUnion("archetype",[pS,yc,$f,vc])});var Oc=w(()=>{"use strict";Yt();Jt();ro()});var Nc=w(()=>{"use strict"});var dg=w(()=>{"use strict";rn();Un();Pc();Oc();Nc();Jt()});import{createHash as bN}from"node:crypto";function wN(e){return bN("sha256").update(e).digest("hex").slice(0,16)}function Rc(e){return wN(e)}var vN,dn,zn=w(()=>{"use strict";ze();Jt();Yt();vN=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative()),scale:c.number().int().positive().optional(),sources:c.record(c.string(),oo).optional(),scoring:Tf.optional()}),dn=c.object({corpus:c.literal("1"),source:c.string().optional(),sources:c.record(c.string(),oo).optional(),facts:c.record(c.string(),c.array(gc)).optional(),entries:c.record(c.string(),c.object({label:c.string().min(1),team:c.string().optional(),position:c.string().optional()})).optional(),measures:c.array(vN).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var _N,fS,kN,lG,gS,dG,uG,pG,ug=w(()=>{"use strict";ze();_N=c.enum(["push","pull"]),fS=c.object({workspaceId:c.string().min(1),name:c.string().min(1),key:c.string().min(1),digest:c.string().regex(/^[0-9a-f]{16}$/),measures:c.array(c.string()).default([]),counts:c.record(c.string(),c.number().int().nonnegative()).default({}),scored:c.array(c.string()).optional(),bytes:c.number().int().nonnegative().default(0),origin:_N.default("push"),supplier:c.string().optional(),publishedAt:c.string().nullable().default(null),checkedAt:c.string().nullable().default(null),failing:c.boolean().default(!1),counted:c.boolean().default(!1)}),kN=c.object({gameId:c.string().min(1),gameName:c.string().default(""),pinnedDigest:c.string().nullable().default(null),stale:c.boolean().default(!1),roundIds:c.array(c.string()).default([])}),lG=c.object({dataset:fS,usedBy:c.array(kN).default([])}),gS=c.enum(["pushed","pulled","joined","refused","failed"]),dG=c.object({at:c.string(),event:gS,dataset:c.string().min(1),digest:c.string().nullable().default(null),gameId:c.string().nullable().default(null),gameName:c.string().nullable().default(null),roundId:c.string().nullable().default(null),message:c.string().default(""),ok:c.boolean().default(!0)}),uG=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(gS).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),pG=c.object({datasets:c.array(fS).default([]),unavailable:c.string().nullable().default(null)})});var pg=w(()=>{"use strict";Jt();Yt()});var hg=w(()=>{"use strict";Un();Jt()});var mg=w(()=>{"use strict"});var fg=w(()=>{"use strict";zn();Un();hg();Oc();mg();Jt();Un();Yt();rn();Nc();Pc()});function Di(){return bg.filter(e=>e.public!==!1&&e.type!=="collection"&&e.type!=="boolean"&&e.type!=="number").map(e=>e.key)}function yS(e){if(e===null||typeof e!="object"||Array.isArray(e))return["gamestage.settings.json must be one JSON object of field keys to text."];let t=new Set(Di()),r=[];for(let[o,n]of Object.entries(e)){let i=/^label_[a-z0-9_]+$/.test(o);!t.has(o)&&!i?r.push(`"${o}" is not a Studio field a game can fill. The fields are: ${[...t].join(", ")}, and any label_<key> the page reads.`):typeof n!="string"&&r.push(`"${o}" must be text, and is ${Array.isArray(n)?"a list":typeof n}.`)}return r}function mr(e,t,r,o){let n=e[0].toUpperCase()+e.slice(1),i=(d,l,p)=>({key:`css_variables_${d}`,label:l,type:"colour",description:p,readBy:`The game's own CSS, as the --gs-${d} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:r}),a=t.toLowerCase(),s=[i(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return o.variant&&s.push(i(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),s.push(i(`on${n}Colour`,`On ${a} colour`,"On: content sitting on the main and variant surfaces."),i(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),i(`on${n}ContainerColour`,`On ${a} container colour`,"On container: content sitting on the container surface.")),s}function Tg(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)||ON.has(t)&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function Lc(e){return[...gg.filter(t=>Tg(e,Eg[t.key])).map(t=>t.key),...$g(e)]}function $g(e){let t=new Set;for(let r of e.matchAll(/["'`](label_[a-z0-9_]+)["'`]|\b(label_[a-z0-9_]+)\s*:/g)){let o=r[1]??r[2];o&&o!==Dc&&t.add(o)}return[...t].sort()}function vS(e){let t=e.slice(Dc.length).replace(/_/g," ").trim();return{key:e,label:t.charAt(0).toUpperCase()+t.slice(1),type:"freetext",description:"A word this game's page shows. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page.",section:"Wording"}}var gg,yg,SN,bg,vg,EN,wg,TN,_g,bS,$N,AN,IN,kg,CN,PN,xg,Sg,Eg,ON,Dc,Ag=w(()=>{"use strict";gg=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:'What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:'What the result screen says when a fan finished under, e.g. "{n} away from the target". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:'The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:'The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:'The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}];yg=gg.map(e=>e.key);SN=[...mr("background","Background","The app and element background.",{variant:!1}),...mr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...mr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...mr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...mr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...mr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...mr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})],bg=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"title_font",label:"Title typeface",type:"freetext",description:`The Google Font the game's name is set in at the top of the page, such as "Bebas Neue". It must be one of the families Gamestage offers (Anton, Archivo Black, Bebas Neue, Bungee, Chakra Petch, Fraunces, Oswald, Playfair Display, Russo One and others); any other name is ignored and the game's own title face is used. Leave it empty to keep that face.`,readBy:"The game's own page, on its title, loaded from Google Fonts after the page has drawn.",section:"Brand"},{key:"title_font_weight",label:"Title weight",type:"freetext",description:"How heavy the title is, as a number from 100 to 900 (400 is regular, 700 bold). A weight the typeface does not have becomes the nearest one it does; empty uses its heaviest.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_letter_spacing",label:"Title letter spacing",type:"freetext",description:"Space between the title's letters, as a fraction of the type size: 0.08 spreads it out, -0.02 tightens it, empty leaves the typeface's own spacing. Kept between -0.1 and 0.4.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_case",label:"Title case",type:"freetext",description:`Type "upper" to show the game's name in capital letters whatever case it is typed in. Leave it empty to show it as typed.`,readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_colour",label:"Title colour",type:"colour",description:"The colour of the game's name. Leave it empty to use the page's own text colour.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its submit button.",section:"Wording"},...gg,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1},...SN],vg=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"}],EN=[{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],wg=[{key:"title",label:"Round name",type:"freetext",description:"How this round is listed in Studio, so you can tell rounds apart. Gamestage fills it in when it creates the round; change it to anything. Fans do not see it.",readBy:"Studio's timeline label. Nothing a fan loads reads it.",section:"Content",public:!1},{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],TN=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],_g="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",bS={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},$N=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},bS,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${_g}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],AN=[{key:"answer_measure",label:"Answer from data",type:"freetext",description:'Leave empty to type the answer yourself. Otherwise the dataset measure the answer is worked out from, e.g. "own_goals", and the board holds dataset keys rather than names.',readBy:"The relay, which works out the answer when the round is provisioned.",section:"This round",public:!1},{key:"answer_rule",label:"Which player is right",type:"freetext",description:'With "Answer from data": highest, lowest, only_nonzero (the one player above zero) or only_zero (the one player on zero). A round where the rule fits more than one player is refused, never guessed.',readBy:"The relay.",section:"This round",public:!1},{key:"reveal_each_guess",label:"Show a wrong guess's figure",type:"freetext",description:'With "Answer from data": "yes" to show a wrong guess its own figure straight away, "no" to show every figure only at the end. Empty means yes.',readBy:"The Engine, when it marks a guess.",section:"This round",public:!1},{key:"round_twist",label:"The twist",type:"freetext",description:`One surprising line shown after the round, e.g. "He has also completed more passes than any other defender." ${_g}`,readBy:"The Engine, which sends it only with a finished result.",section:"This round",public:!1},{key:"round_twist_source",label:"Where the twist is from",type:"freetext",description:'The publication and date, e.g. "Fantasy Premier League, 27 Sep 2026".',readBy:"The Engine, with the twist.",section:"This round",public:!1},{key:"round_twist_url",label:"The twist's link",type:"freetext",description:"A link to where the twist was reported. Optional.",readBy:"The Engine, with the twist.",section:"This round",public:!1}],IN=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},bS,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${_g}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What they have in common",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],kg=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],CN=[{key:"card_note",label:"What this card means",type:"freetext",description:'A sentence explaining the card, shown when a fan taps it. "Goal in the first 10" might be "A goal is scored by either team inside the first ten minutes." Leave it empty and tapping the card does nothing.',readBy:"The game's own page, on the back of the card a fan taps.",section:"This card",public:!0}],PN=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the goal, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the goal.",section:"This round"},{key:"shoot_shots_allowed",label:"Shots",type:"number",description:"How many penalties a fan takes, from 1 to 20. Leave it empty for 5.",readBy:"The Engine, which refuses a shot once they are spent.",section:"This round"},{key:"shoot_goals_to_win",label:"Goals to win",type:"number",description:"How many goals count as winning the shootout. Reaching it does not end play: every remaining shot still scores. Leave it empty for 3.",readBy:"The Engine, which decides won or lost after the last shot.",section:"This round"},{key:"shoot_points_per_goal",label:"Points per goal",type:"number",description:"What each goal is worth on the leaderboard. Leave it empty for 100.",readBy:"The Engine, which scores each goal.",section:"This round"},{key:"shoot_difficulty",label:"Keeper",type:"freetext",description:"How good the goalkeeper is: easy_v1, balanced_v1 or hard_v1. Leave it empty for balanced_v1.",readBy:"The Engine, which picks the keeper's speed, reach and reactions from it.",section:"This round"}],xg={hunt:[...$N,...AN],push:TN,group:IN,predict:[],bingo:CN,shoot:PN,place:[]},Sg={hunt:[],push:[],group:[],predict:[],bingo:EN,shoot:[],place:[]},Eg={display_name:"displayName",title_font:"titleFont",title_font_weight:"titleFontWeight",title_letter_spacing:"titleLetterSpacing",title_colour:"titleColour",title_case:"titleCase",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",capped_today_note:"cappedTodayNote",share_dare:"shareDare",result_dare:"resultDare"},ON=new Set(["titleFont","titleFontWeight","titleLetterSpacing","titleColour","titleCase"]);Dc="label_"});function DN(e){let t=new Map,r=o=>{for(let n of o)if(n.type==="collection"){let i=t.get(n.key);if(i&&(i.itemLabel!==n.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(n.fieldset??[])))throw new Error(`The collection "${n.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(n.key,n),r(n.fieldset??[])}};return r(e),[...NN,...kg.map(LN),...[...t.values()].map(RN)]}function Ig(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,field:kS(r),description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);if(i||(i={name:r.section},t.push(i)),r.subsection){let a=i.subsections??=[],s=a.find(d=>d.name===r.subsection);s||(s={name:r.subsection,...r.subsectionDescription?{description:r.subsectionDescription}:{},properties:[]},a.push(s)),s.properties.push(n)}else(i.properties??=[]).push(n)}return t}function jN(e){let t=e.archetypes.map(qe);for(let i of t)if(!wS[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??yg),n=[...bg.filter(i=>!yg.includes(i.key)||o.has(i.key)),...[...o].filter(i=>i.startsWith(Dc)).sort().map(vS)];return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:wS[i],content_type:_S(i),derived_from:jc[i]?.derivedFrom??"data",duration:jc[i]?.duration??{mode:"instant"},label:jc[i]?.derivedFrom==="prediction"?"{{question.text}}":"{{element.title}}",custom_fields:Ig([...wg,...xg[qe(i)]??[]]),...jc[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":DN([...n,...vg,...wg,...Object.values(xg).flat(),...Object.values(Sg).flat(),...kg]),"project_settings.json":{sections:Ig(n)},"event_settings.json":{sections:Ig([...vg,...t.flatMap(i=>Sg[i]??[])])}}}function xS(e){return jN({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var wS,_S,jc,kS,NN,RN,LN,Cg=w(()=>{"use strict";Ag();rn();wS=Ob,_S=e=>{let t=qe(e);return nd[t]??`gamestage-${t.replaceAll("_","-")}-element`},jc={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},kS=e=>e.type==="collection"?e.key:e.type,NN=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1}],RN=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:kS(t),...t.description?{description:t.description}:{}}))}),LN=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var Pg=w(()=>{"use strict";rn()});var SS=w(()=>{"use strict";Li();Fo();Cc();dg();zn();ug();pg();fg();Cg();Pg();rg();og();Yt()});function $S(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function IS(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let d=globalThis.location?.origin,l=new URL(`${o}${a}`,o.startsWith("/")?d:void 0);for(let[h,m]of Object.entries(s.query??{}))m!=null&&l.searchParams.set(h,String(m));let p;for(let h=1;h<=r;h++){let m=typeof e.token=="function"?await e.token():e.token,y;try{y=await t(l,{method:i,headers:{authorization:`Bearer ${m}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)})}catch(M){let H=M instanceof Error?M.message:String(M);if(p=new $t(0,"unreachable",`Could not reach the control plane at ${o}: ${H}. Check your connection and run the command again.`,!0),h===r)break;await ES($S(h));continue}if(y.ok)return await y.json();let x=await y.json().catch(()=>({}));if(p=new $t(y.status,x.error?.code??"unknown",x.error?.message??y.statusText,x.error?.retryable??!1),!p.retryable||h===r)break;let O=Number(y.headers.get("retry-after"));await ES(Number.isFinite(O)&&O>0?O*1e3:$S(h))}throw p??new $t(0,"unknown","Request failed.",!1)}}function CS(e){let t=IS(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(aS);return sS(o)},getWorkspace:r=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(r)}`),setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function fr(e){let t=IS(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let d of r)Array.isArray(s[d])||(s[d]=[]);return s},n=a=>({...a,access:Ic(a),terms:a.terms??null,games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:Ic(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof $t)||a.status!==404)throw a;return TS||(TS=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),acceptTerms:async a=>i(await t("PUT","/v1/workspace/terms",{body:{version:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,d)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:d}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),addGraphic:()=>{throw new Error("A graphic is composed by the control plane, not recorded by a client. Use composeGraphic(gameId, { template, consent: true }).")},composeGraphic:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/graphics`,{body:s}),removeGraphic:(a,s)=>t("DELETE",`/v1/games/${encodeURIComponent(a)}/graphics/${encodeURIComponent(s)}`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),withdrawGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/withdraw`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(d){throw d instanceof $t&&d.status===404&&!/no such game/i.test(d.message)?new $t(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):d}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),setWorkspaceProfile:a=>t("PUT","/v1/workspace/profile",{body:a}),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:d}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return d},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:AS}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof $t&&a.status===404)return{datasets:[],unavailable:AS};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof $t&&s.status===404)return[];throw s}}}}var $t,ES,TS,AS,PS=w(()=>{"use strict";Cc();$t=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},ES=e=>new Promise(t=>setTimeout(t,e)),TS=!1;AS="This control plane is running a build older than this screen, so it cannot list datasets yet."});function MN(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function OS(e,t){let r=MN(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var NS=w(()=>{"use strict"});var RS=w(()=>{"use strict";Un()});var ji,LS,He,DS,jS,co,MS,US,Og=w(()=>{"use strict";zn();ji=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.round(e):null,LS=e=>{let t=Number(e);return Number.isFinite(t)&&t>=0?Math.round(t*100):null},He=(e,t)=>({fields:[e],label:t,read:r=>ji(r[e])}),DS=270,jS=3,co=(e,t)=>({fields:[e,"minutes"],label:`${t} per 90 minutes, in hundredths (at least ${DS} minutes played)`,partial:!0,scale:100,read:r=>{let o=ji(r[e]),n=ji(r.minutes);return o===null||n===null||n<DS?null:Math.round(o*90*100/n)}}),MS=(e,t)=>({fields:[e,"starts"],label:`${t} per start, in hundredths (at least ${jS} starts)`,partial:!0,scale:100,read:r=>{let o=ji(r[e]),n=ji(r.starts);return o===null||n===null||n<jS?null:Math.round(o*100/n)}}),US={player_price:{...He("now_cost","Price, in tenths of a million"),scale:10},season_points:He("total_points","Points this season"),points_per_game:{fields:["points_per_game"],label:"Points per game, in tenths",scale:10,read:e=>{let t=Number(e.points_per_game);return Number.isFinite(t)&&t>=0?Math.round(t*10):null}},minutes:He("minutes","Minutes played"),starts:He("starts","Starts"),goals:He("goals_scored","Goals"),assists:He("assists","Assists"),own_goals:He("own_goals","Own goals"),penalties_missed:He("penalties_missed","Penalties missed"),penalties_saved:He("penalties_saved","Penalties saved"),yellow_cards:He("yellow_cards","Yellow cards"),red_cards:He("red_cards","Red cards"),saves:He("saves","Saves"),bonus:He("bonus","Bonus points"),tackles:He("tackles","Tackles"),recoveries:He("recoveries","Ball recoveries"),clearances_blocks_interceptions:He("clearances_blocks_interceptions","Clearances, blocks and interceptions"),defensive_contributions:He("defensive_contribution","Defensive contribution points"),expected_goals:{fields:["expected_goals"],label:"Expected goals, in hundredths",scale:100,read:e=>LS(e.expected_goals)},expected_assists:{fields:["expected_assists"],label:"Expected assists, in hundredths",scale:100,read:e=>LS(e.expected_assists)},goals_per_90:co("goals_scored","Goals"),assists_per_90:co("assists","Assists"),yellow_cards_per_90:co("yellow_cards","Yellow cards"),tackles_per_90:co("tackles","Tackles"),recoveries_per_90:co("recoveries","Ball recoveries"),saves_per_90:co("saves","Saves"),bonus_per_start:MS("bonus","Bonus points"),defensive_contributions_per_start:MS("defensive_contribution","Defensive contribution points")}});function Mi(e){return e.standing==="unofficial"?GN:void 0}function zS(e){return un.find(t=>t.id===e)}var UN,zN,FN,nW,GN,un,Ng=w(()=>{"use strict";Og();ze();UN=c.discriminatedUnion("kind",[c.object({kind:c.literal("everyone")}),c.object({kind:c.literal("domains"),domains:c.array(c.string().min(1)).min(1)}),c.object({kind:c.literal("named")})]),zN=c.enum(["licensed","unofficial","creator"]),FN=c.enum(["ours","creator"]),nW=c.object({id:c.string().min(1),label:c.string().min(1),standing:zN,origin:FN,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),catalogue:c.object({offers:c.string().min(1),competitions:c.array(c.string()).default([]),cost:c.string().min(1),needsKey:c.boolean().default(!1),signUp:c.string().url().optional(),licence:c.string().min(1),fetched:c.boolean().optional()}).optional(),audience:UN.optional()}),GN="Requests to this source are made on behalf of you, the game builder. You are responsible for the data you consume, and for securing the legal rights and licence to use it. We recommend using it for testing only, and not launching with it unless you have explicit permission from the data owner.";un=[{id:"nba",label:"NBA",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"domains",domains:["monterosa.co.uk","nba.com"]},produces:["career_points","career_rebounds","career_assists","career_games"],note:"Licensed to Monterosa. Career totals are the NBA's own figures, not a sum we computed.",catalogue:{offers:"NBA players' career totals: points, rebounds, assists, games.",competitions:["NBA"],cost:"Included for Monterosa and NBA accounts; others by arrangement.",needsKey:!1,licence:"Licensed to Monterosa. Fit for a game with a prize.",fetched:!0}},{id:"push",label:"Your own data",standing:"creator",origin:"creator",tiers:["runtime","live","enterprise"],produces:[],note:"A file you push with `gamestage reference push`, from your machine or your CI.",catalogue:{offers:"Any values you hold, in a JSON file you push: your squad, your archive, your own licensed feed.",competitions:[],cost:"Free on every plan.",needsKey:!1,licence:"Yours. Your data, or a feed you license: your terms.",fetched:!0}},{id:"fpl",label:"Fantasy Premier League",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:Object.keys(US),note:"Free, with no contract behind it, so a prize game wants a licensed source. Prices move weekly and a round in play keeps the ones it opened with.",catalogue:{offers:"Premier League players: FPL price and points, goals, assists, own goals, penalties missed and saved, cards, saves, bonus, tackles, recoveries, defensive contributions, minutes, starts and expected goals and assists, plus per-90 and per-start ratios, with each player's name, club and position. Refreshed daily.",competitions:["Premier League"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}},{id:"sportmonks",label:"Sportmonks football",standing:"creator",origin:"ours",tiers:["runtime","live","enterprise"],produces:["goals","assists","appearances","minutes","yellow_cards","clean_sheets"],note:"Your own Sportmonks plan and key. We call it on a schedule with your key, and your plan decides which competitions you can use.",catalogue:{offers:"Football players' season statistics for any competition your plan covers: goals, assists, appearances, minutes, cards, clean sheets, with each player's name, team and position.",competitions:[],cost:"Your Sportmonks plan. A free plan covers a few smaller leagues; the Premier League needs a paid one.",needsKey:!0,signUp:"https://www.sportmonks.com/football-api/",licence:"Yours: your Sportmonks plan and its terms. Check they cover this use before a game with a prize."}},{id:"espn",label:"ESPN (open access)",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:[],note:"ESPN's openly reachable sports data, with no contract behind it, so not for a prize. Not fetched yet: ask us before building on it.",catalogue:{offers:"Rosters, athletes and statistics across many leagues, from ESPN's openly reachable endpoints.",competitions:["NBA","NFL","MLB","NHL","Premier League and other football leagues"],cost:"Free. No key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!1}}]});function WN(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function FS(e){let t=e.ownerEmail?.lastIndexOf("@")??-1,r=t>=0?e.ownerEmail.slice(t+1).trim().toLowerCase():void 0;return{id:e.id,domain:r||void 0,grants:e.supplierGrants}}function KN(e){return e.audience??BN}function HN(e,t,r=un){let o=r.find(i=>i.id===t);if(!o)return{allowed:!1,reason:`There is no supplier called "${t}".`};if(e.grants?.includes(t))return{allowed:!0,because:"grant"};let n=KN(o);switch(n.kind){case"everyone":return{allowed:!0,because:"audience"};case"domains":return e.domain&&WN(e.domain,n.domains)?{allowed:!0,because:"audience"}:{allowed:!1,reason:`${o.label} is available to ${n.domains.join(" and ")}. Ask us if you need it.`};case"named":return{allowed:!1,reason:`${o.label} is granted per account. Ask us if you need it.`}}}function GS(e,t=un){return t.map(r=>({supplier:r,entitlement:HN(e,r.id,t)}))}var BN,BS=w(()=>{"use strict";Ng();BN={kind:"everyone"}});function XN(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function QN(e,t){let r=new Set((e.grants??[]).filter(o=>o.startsWith("org:")).map(o=>o.slice(4)));return t.find(o=>r.has(o.id)?!0:e.domain?XN(e.domain,o.domains):!1)}function HS(e,t){let r=e?.lastIndexOf("@")??-1,o=r>=0?e.slice(r+1).trim().toLowerCase():void 0;if(o)return QN({id:"creator",domain:o},t)}function VS(e,t){let r={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`};if(t.identity&&(e.identity.provider="jwt",e.identity.jwt={issuer:t.identity.issuer,jwks_uri:t.identity.jwks_uri,...t.identity.audience?{audience:t.identity.audience}:{}},e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,r]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let o=new Set(e.measurement.destinations.map(n=>n.type));for(let n of t.analytics)o.has(n.type)||(e.measurement.destinations.push({type:n.type,enabled:!0,config:n.config}),o.add(n.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,r]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,r])}var VN,ZN,YN,qN,WS,JN,KS,ZS,YS=w(()=>{"use strict";ze();ln();VN=c.object({kind:c.enum(["figma","tokens","guidelines"]),ref:c.string().min(1)}),ZN=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),YN=c.object({provider:c.string().optional(),analytics_requires_consent:c.boolean().default(!0)}),qN=c.object({type:Pf.shape.type,config:c.record(c.string(),c.string()).default({})}),WS=c.object({kind:c.string().min(1),ref:c.string().min(1)}),JN=c.object({sink:WS.optional(),source:WS.optional()}),KS=c.object({id:c.string().min(1),displayName:c.string().min(1),domains:c.array(c.string()).default([]),version:c.number().int().nonnegative().default(1),brand:VN.optional(),identity:ZN.optional(),consent:YN.prefault({}),analytics:c.array(qN).default([]),data:JN.prefault({})});ZS=[KS.parse({id:"monterosa",displayName:"Monterosa",domains:["monterosa.co.uk"],brand:{kind:"guidelines",ref:"monterosa-brand-guidelines"},identity:{issuer:"https://accounts.google.com",jwks_uri:"https://www.googleapis.com/oauth2/v3/certs"},consent:{analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{source:{kind:"slack-directory",ref:"monterosa-people"},sink:{kind:"delta-share",ref:"monterosa_gameplay"}}}),KS.parse({id:"nba",displayName:"NBA",domains:["nba.com"],brand:{kind:"figma",ref:"nba-brand"},identity:{issuer:"https://id.nba.com",jwks_uri:"https://id.nba.com/.well-known/jwks.json"},consent:{provider:"onetrust",analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{sink:{kind:"snowflake",ref:"nba_gameplay"}}})]});var dW,qS=w(()=>{"use strict";ze();dW=c.object({org:c.string().min(1),game:c.string().min(1),player:c.string().min(1),alias:c.string().optional(),round:c.string().optional(),score:c.number(),outcome:c.string().optional(),at:c.string().min(1)})});var JS=w(()=>{"use strict";zn()});var XS=w(()=>{"use strict";zn()});function Rg(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=dn.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:Rc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length])),scored:r.data.measures.filter(o=>o.scoring).map(o=>o.key)}}}async function QS(e,t){let r=Rg(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}function eE(e,t){return e?e.filter(r=>!t.scored.includes(r)):[]}var tE=w(()=>{"use strict";zn()});var nE=w(()=>{"use strict"});var rE=w(()=>{"use strict"});function Mc(e){return e.sourceIp?.trim()||"unknown"}function lo(e,t){return`${e.length}:${e}${t}`}var eR,oE,iE,aE,sE,wW,_W,kW,cE=w(()=>{"use strict";eR=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},oE=e=>typeof process>"u"?void 0:eR(process.env?.[e]),iE=(e,t,r)=>({burst:oE(t)??e.burst,perMinute:oE(r)??e.perMinute}),aE={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},sE={player:iE(aE.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:iE(aE.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},wW=sE.player,_W=sE.publicRoutes,kW=600*1e3});var lE=w(()=>{"use strict"});var Uc,Lg=w(()=>{"use strict";Uc=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]});function dE(e,t){return[...e.map(r=>r.toUpperCase()),String(t).padStart(2,"0")].join("-")}function uE(e){if(typeof e!="string"||e.length>120)return;let t=e.trim().toLowerCase().split(/[\s\-_.]+/).filter(Boolean);if(t.length!==zc+1)return;let r=t.slice(0,zc),o=t[zc];if(r.every(nR)&&/^\d{2}$/.test(o))return dE(r,Number(o))}function pE(e){let t=Array.from({length:zc},()=>Uc[e(Uc.length)]);return dE(t,e(100))}var zc,tR,nR,AW,IW,hE,CW,Dg,mE=w(()=>{"use strict";ze();Lg();zc=4,nR=e=>(tR??=new Set(Uc)).has(e);AW=c.object({has_code:c.boolean(),issued_at:c.string().nullable()}),IW=c.object({code:c.string(),issued_at:c.string(),replaced:c.boolean()}),hE=c.object({code:c.string().max(120)}),CW=c.object({token:c.string(),player_id:c.string(),kind:c.literal("anonymous"),previous_player:c.literal("kept")}),Dg="That code doesn't match a player. Check each word and the two numbers, then try again."});var we=w(()=>{"use strict";Fo();rn();ln();Sf();wc();rg();Mx();Li();Fx();fc();og();Jx();$i();Yt();Cc();SS();PS();Ag();Jt();pg();NS();Un();Pc();hg();Oc();mg();ro();RS();zn();BS();YS();qS();Ng();Og();JS();XS();tE();ug();Nc();fg();nE();Cg();dg();rE();Pg();xf();cE();lE();mE();Lg()});var uo,gr,Ve,Mt,Xt,Re,fE,rR,oR,iR,aR,sR,cR,Ui,pn=w(()=>{"use strict";uo=`/**
|
|
108
|
+
`:""}return ng.dump=P,ng}function OO(){if(wx)return Qe;wx=1;let e=CO(),t=PO();function r(o,n){return function(){throw new Error("Function yaml."+o+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return Qe.Type=dt(),Qe.Schema=_x(),Qe.FAILSAFE_SCHEMA=Ex(),Qe.JSON_SCHEMA=Cx(),Qe.CORE_SCHEMA=Px(),Qe.DEFAULT_SCHEMA=rg(),Qe.load=e.load,Qe.loadAll=e.loadAll,Qe.dump=t.dump,Qe.YAMLException=Ni(),Qe.types={binary:Rx(),float:Ix(),map:Sx(),null:Tx(),pairs:Dx(),set:jx(),timestamp:Ox(),bool:$x(),int:Ax(),merge:Nx(),omap:Lx(),seq:xx(),str:kx()},Qe.safeLoad=r("safeLoad","load"),Qe.safeLoadAll=r("safeLoadAll","loadAll"),Qe.safeDump=r("safeDump","dump"),Qe}var Qe,_c,Mn,qk,Lf,Jk,Df,Xk,jf,Qk,Mf,ex,Uf,tx,zf,nx,Ff,rx,Gf,ox,Bf,ix,Wf,ax,Kf,sx,Hf,cx,Vf,lx,Zf,dx,Yf,ux,qf,px,Jf,hx,Xf,mx,Qf,fx,eg,gx,tg,yx,bx,ng,vx,wx,NO,so,gF,yF,bF,vF,wF,_F,Mx,kF,xF,SF,EF,TF,$F,AF,kc=w(()=>{Qe={},_c={},Mn={};ng={};NO=OO(),so=AO(NO),{Type:gF,Schema:yF,FAILSAFE_SCHEMA:bF,JSON_SCHEMA:vF,CORE_SCHEMA:wF,DEFAULT_SCHEMA:_F,load:Mx,loadAll:kF,dump:xF,YAMLException:SF,types:EF,safeLoad:TF,safeLoadAll:$F,safeDump:AF}=so});function Fe(e){let t;try{t=so.load(e)}catch(n){return{ok:!1,issues:[{path:"(document)",message:n instanceof Error?n.message:"YAML parse failed"}]}}if(t===null||typeof t!="object")return{ok:!1,issues:[{path:"(document)",message:"Manifest must be a YAML mapping"}]};let r=jn.safeParse(t);if(!r.success)return{ok:!1,issues:RO(r.error)};let o=Vk(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function RO(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function Ri(e){return so.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function xc(e,t){return jn.parse({manifest:{schema_version:Ci,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Li=w(()=>{"use strict";kc();ln()});var og=w(()=>{"use strict";Li();ln();wc()});var Ux=w(()=>{"use strict"});function zx(e,t){let r=e.backend.archetype;if(!r)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:vt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ao.map(o=>({section:o,status:e[o].status}))}}function Fx(e,t){let r=[];return t&&e.app.id!==t&&r.push(`This manifest is for the game "${e.app.id}", and you are editing "${t}". A manifest cannot change which game it belongs to: set app.id to "${t}", or register "${e.app.id}" as its own game.`),e.backend.archetype||r.push("This manifest declares no backend.archetype, so there is nothing to register. The control plane keys a game on its archetype and a game without one could never be deployed against."),r}var Gx=w(()=>{"use strict";wc();Li();ln()});var Ie,Sc,Bx=w(()=>{"use strict";Ie={runtime:"/play/v1/games/{game}/runtime",currentRound:"/play/v1/games/{game}/rounds/current",rounds:"/play/v1/games/{game}/rounds",roundsMine:"/play/v1/games/{game}/rounds/mine",nextRound:"/play/v1/games/{game}/rounds/next",round:"/play/v1/games/{game}/rounds/{round}",plays:"/play/v1/games/{game}/rounds/{round}/plays",session:"/play/v1/games/{game}/session",restoreSession:"/play/v1/games/{game}/session/restore",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",identityOptions:"/play/v1/games/{game}/identity",identity:"/play/v1/games/{game}/players/me/identity",recoveryCode:"/play/v1/games/{game}/players/me/recovery-code",leaderboard:"/play/v1/games/{game}/leaderboard"},Sc="/play"});function Ec(e,t,r={}){let o=t==="won"?e.current_streak+1:t==="lost"||t==="partial"?0:e.current_streak;return{...e,played:e.played+1,won:e.won+(t==="won"?1:0),current_streak:o,max_streak:Math.max(e.max_streak,o),exact:(e.exact??0)+(r.exact===!0?1:0),...typeof r.score=="number"?{best_score:Math.max(e.best_score??r.score,r.score)}:e.best_score===void 0?{}:{best_score:e.best_score}}}var Wx,jt,LO,DO,jO,HF,Hx,MO,UO,VF,zO,ZF,YF,qF,Vx,FO,GO,JF,BO,WO,XF,Kx,QF,e6,t6,Zx,ig=w(()=>{"use strict";ze();ln();fc();Bx();Wx="2.0",jt=c.object({server_time:c.string(),snapshot:c.string()}),LO=c.enum(["at_commit","at_settlement"]),DO=c.enum(["shared","per_player","feed"]),jO=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),HF=jt.extend({game:c.string(),api_version:c.literal(Wx).default(Wx),archetype:Dn,marking:LO,challenge_source:DO,schedule:jO,updates:c.object({transport:c.enum(["poll","socket"]),freshness_seconds:c.number().int().positive()}),display:c.record(c.string(),c.unknown()).default({}),identity:c.object({required:c.boolean(),provider:c.string(),anonymous_play:c.boolean().default(!1)}),archive:c.boolean().default(!1),capabilities:c.array(c.string()).default([])}),Hx=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),MO=jt.extend({id:c.string(),number:c.number().int().positive().optional(),origin:Ai.optional(),version:c.number().int().nonnegative(),can:Hx,opens_at:c.string().optional(),locks_at:c.string().optional(),timer_seconds:c.number().int().positive().optional(),challenge_instance_id:c.string().nullable().default(null),challenge:c.record(c.string(),c.unknown()).default({}),solution:c.record(c.string(),c.unknown()).optional()}),UO=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Hx,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),VF=jt.extend({rounds:c.array(UO)}),zO=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),last_played_at:c.string().optional(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),ZF=jt.extend({player_id:c.string(),played:c.array(zO)}),YF=jt.extend({status:c.enum(["ready","exhausted"]),round:MO.optional()}),qF=jt.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Vx=c.object({idempotency_key:c.string().min(8),round_version:c.number().int().nonnegative(),challenge_instance_id:c.string().nullable().default(null),payload:c.record(c.string(),c.unknown()).refine(e=>e.op===void 0||typeof e.op=="string"&&e.op.length>0,{message:"op must be a non-empty string when present",path:["op"]})}),FO=c.enum(["accepted","rejected","duplicate","stale","busy"]),GO=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),JF=jt.extend({play_id:c.string(),outcome:FO,reason:c.string().optional(),round_version:c.number().int().nonnegative(),retry_after_seconds:c.number().int().positive().optional(),marked:c.boolean().default(!0),feedback:c.array(GO).default([]),round_state:c.lazy(()=>WO).optional()}),BO=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),WO=jt.extend({player_id:c.string(),round_id:c.string(),started_at:c.string().optional(),attempts_used:c.number().int().nonnegative().default(0),attempts_allowed:c.number().int().nonnegative().optional(),mistakes_used:c.number().int().nonnegative().default(0),mistakes_allowed:c.number().int().nonnegative().optional(),progress:c.record(c.string(),c.unknown()).default({}),score:c.number().default(0),score_revision:c.number().int().nonnegative().default(0),finished:c.boolean().default(!1),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional(),share:BO.optional()}),XF=jt.extend({player_id:c.string(),display_name:c.string().optional(),avatar:c.string().optional(),avatar_url:c.string().optional(),played:c.number().int().nonnegative().default(0),won:c.number().int().nonnegative().default(0),current_streak:c.number().int().nonnegative().default(0),max_streak:c.number().int().nonnegative().default(0),exact:c.number().int().nonnegative().optional(),best_score:c.number().optional(),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Kx=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),avatar:c.string().optional(),avatar_url:c.string().optional(),exact:c.boolean().optional(),score:c.number()}),QF=jt.extend({round_id:c.string().optional(),order:c.enum(["high_first","low_first"]).default("high_first"),tie_break:c.enum(["earliest_play","fewest_attempts","none"]).default("none"),entries:c.array(Kx).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Kx.optional()}),e6=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})}),t6=jt.extend({adjectives:c.array(c.string()),animals:c.array(c.string()),avatars:c.array(c.object({id:c.string(),url:c.string()}))}),Zx=c.object({name:c.object({adjective:c.string().min(1),animal:c.string().min(1)}).optional(),avatar:c.string().min(1).optional()}).refine(e=>e.name!==void 0||e.avatar!==void 0,{message:"Send a name, an avatar, or both."})});function Yx(e){return YO[qe(e)]}function qx(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:Yx(t)?.[0]}function Jx(e,t){return Yx(e)?.includes(t)??!1}function Tc(e){return ag({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function ag(e){if(Array.isArray(e))return`[${e.map(ag).join(",")}]`;if(e&&typeof e=="object"){let t=e;return`{${Object.keys(t).filter(o=>t[o]!==void 0).sort().map(o=>`${JSON.stringify(o)}:${ag(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var KO,HO,VO,ZO,sg,s6,YO,Xx=w(()=>{"use strict";ze();rn();ro();KO=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),HO=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),VO=c.object({op:c.literal("answer"),answers:c.record(c.string(),c.union([c.string(),c.number()])).optional(),picks:c.array(c.string()).optional()}).passthrough(),ZO=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),sg=c.object({op:c.literal(no),model:c.literal(Nn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(lt.aimX.min).max(lt.aimX.max),aimY:c.number().int().min(lt.aimY.min).max(lt.aimY.max),power:c.number().int().min(lt.power.min).max(lt.power.max)}).strict(),s6=c.union([HO,VO,ZO,sg,KO]),YO={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[no],place:["place","skip"]}});function eS(e,t=new Date){let r=typeof t=="string"?Date.parse(t):t.getTime(),o,n=Number.NEGATIVE_INFINITY;for(let i of e.rounds){let a=Date.parse(i.locksAt);Number.isNaN(a)||a>n&&(n=a,o=i)}return o?n>r?{state:"live",round:o}:{state:"stale",round:o,lockedForMs:r-n}:{state:"none"}}function tS(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),r=t<1?`${Math.max(1,Math.floor(e.lockedForMs/6e4))} minutes`:t<48?`${t} hours`:`${Math.floor(t/24)} days`;return`The round this game is serving, ${e.round.label}, locked ${r} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function iS(e,t=$c){return e.terms?.version===t}function Ic(e){let t=aS.safeParse(e.access);return t.success?t.data:"pending"}function sS(e){let t=n=>typeof n=="string"&&n.trim()?n:null,r=e.decision??null,o=r?t(r.state):null;return{workspaceId:t(e.workspaceId)??"unknown",name:t(e.name),ownerEmail:t(e.ownerEmail)??"",company:t(e.company),role:t(e.role),intent:t(e.intent),signals:t(e.signals),registeredAt:t(e.registeredAt)??"",termsVersion:t(e.termsVersion),decision:o==="approved"||o==="refused"?{state:o,at:t(r.at)??t(e.registeredAt)??"",by:t(r.by)??"unknown",reason:t(r.reason)}:null}}function cS(e){return{waiting:e.filter(t=>!t.decision).sort((t,r)=>t.registeredAt.localeCompare(r.registeredAt)),decided:e.filter(t=>t.decision).sort((t,r)=>r.decision.at.localeCompare(t.decision.at))}}function lg(e){return pN.includes(e)}function dg(e,t){return!e.prodApproval||lg(t.tier)?"dev":"prod"}function dS(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function uS(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var qO,JO,Qx,XO,QO,eN,cg,tN,nN,nS,rN,m6,rS,oN,$c,Ac,oS,iN,aN,aS,f6,g6,sN,cN,lN,y6,b6,v6,w6,_6,dN,k6,lS,x6,uN,pN,Cc=w(()=>{"use strict";ze();ln();Fo();$i();$i();Yt();qO=c.enum(["draft","live","sleeping","throttled","expired","archived"]),JO=c.enum(["scheduled","open","locked","settled"]),Qx=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),XO=c.object({id:c.string(),label:c.string(),state:JO,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),QO=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),eN=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),cg=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),tN=c.enum(["absent","pending","ready","failed"]),nN=c.object({state:tN.default("absent"),url:c.string().nullable().default(null),regenerations:c.number().int().nonnegative().default(0),updatedAt:c.string().nullable().default(null),onProject:c.string().nullable().default(null)});nS=c.object({section:c.string(),status:If}),rN=c.object({instanceId:c.string(),embedSlug:c.string(),template:c.string(),type:c.enum(["leaderboard","qr"]),createdAt:c.string(),consentBy:c.string()}),m6=c.object({template:c.string().min(1),consent:c.literal(!0)}),rS=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(Sr),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(eN).default([]),archetype:Dn,offersPrize:c.boolean().default(!1),state:qO,prodApproval:c.object({approvedAt:c.string(),approvedBy:c.string()}).nullable().default(null).optional(),archivePrefix:c.string().nullable().default(null),space:c.string().nullable().default(null).optional(),platformSpace:c.string().nullable().default(null).optional(),platformProject:c.string().nullable().default(null).optional(),platformEvent:c.string().nullable().default(null).optional(),platformElement:c.string().nullable().default(null).optional(),studioUrl:c.string().nullable().default(null).optional(),appSpec:c.object({version:c.string(),shape:c.string(),resource:c.string().nullable().default(null),specUrl:c.string().optional(),wording:c.array(c.string()).optional(),refusal:c.object({at:c.string(),reason:c.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:nN.prefault({}).optional(),graphics:c.array(rN).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),settingsDefaults:c.record(c.string(),c.string()).optional(),conformance:Rn,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(nS),meters:c.array(Qx),history:c.array(Ti),rounds:c.array(XO),destinations:c.array(QO),logs:c.array(cg),updatedAt:c.string()}),oN=c.object({login:c.string(),linkedAt:c.string()}),$c="2026-09-06",Ac="https://gamestage.ai/terms",oS="https://gamestage.ai/stage",iN=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});aN=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),aS=c.enum(["pending","approved","refused"]),f6=c.enum(["manual","automatic"]);g6=c.enum(["approved","refused"]),sN=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});cN=c.object({id:c.string(),name:c.string(),tier:io,ownerEmail:c.string(),access:aS.default("pending"),profile:sN.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:oN.nullable().default(null),terms:iN.nullable().default(null),signal:aN.prefault({}),meters:c.array(Qx),games:c.array(rS)}),lN=rS.extend({logs:c.array(cg).optional()}),y6=cN.extend({games:c.array(lN),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),b6=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),v6=c.object({id:c.string(),name:c.string(),archetype:Dn,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:Rn,offersPrize:c.boolean().default(!1),sections:c.array(nS).default([]),containerLabel:c.string().min(1).optional()}),w6=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),_6=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:Rn,offersPrize:c.boolean().default(!1),round:Xe.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),settings:c.record(c.string(),c.string()).optional(),notes:c.string().max(500).optional()}),dN=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:cg.shape.level.nullable().default(null)}),k6=c.enum(["access_pending","terms_not_accepted","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_not_seeded","delete_refused"]),lS=c.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","github.linked","github.unlinked","terms.accepted","game.registered","game.deployed","game.deploy_refused","round.provisioned","round.provision_failed","round.unchanged","round.seeded","game.platform_provisioned","game.platform_provision_failed","game.app_spec_refused","art.requested","art.generated","art.failed","art.published","game.woken","game.suspended","game.throttled","game.approaching_fair_use","game.archived","game.graphic.added","game.graphic.removed","game.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","engine.integrity_violation","destination.changed","signal.enabled","signal.disabled","source.key_attempt"]),x6=c.object({id:c.string(),at:c.string(),action:lS,actor:c.object({kind:c.enum(["creator","operator","system"]),id:c.string(),email:c.string().nullable().default(null)}),gameId:c.string().nullable().default(null),correlationId:c.string(),detail:c.record(c.string(),c.unknown()).default({})}),uN=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:lS.nullable().default(null),actorId:c.string().nullable().default(null),gameId:c.string().nullable().default(null),from:c.string().nullable().default(null),to:c.string().nullable().default(null)}),pN=["runtime"]});var Jt=w(()=>{"use strict"});function yN(e){return`slate-${e+1}`}function mS(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,r)=>({id:yN(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var fN,gN,hS,Un=w(()=>{"use strict";ze();Jt();fN=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),gN=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(fN).min(1)}),hS=c.object({archetype:c.literal("push"),theme:c.string().default(""),prompt:c.string().default(""),target:c.number().int().positive().optional(),targetLabel:c.string().default(""),unit:c.string().max(4).default(""),slates:c.array(gN).min(1)})});var L6,Pc=w(()=>{"use strict";ze();Yt();Un();Jt();L6=c.discriminatedUnion("archetype",[hS,yc,Af,vc])});var Oc=w(()=>{"use strict";Yt();Jt();ro()});var Nc=w(()=>{"use strict"});var ug=w(()=>{"use strict";rn();Un();Pc();Oc();Nc();Jt()});import{createHash as bN}from"node:crypto";function wN(e){return bN("sha256").update(e).digest("hex").slice(0,16)}function Rc(e){return wN(e)}var vN,dn,zn=w(()=>{"use strict";ze();Jt();Yt();vN=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative()),scale:c.number().int().positive().optional(),sources:c.record(c.string(),oo).optional(),scoring:$f.optional(),tiers:c.array(Tf).min(1).optional()}),dn=c.object({corpus:c.literal("1"),source:c.string().optional(),sources:c.record(c.string(),oo).optional(),facts:c.record(c.string(),c.array(gc)).optional(),entries:c.record(c.string(),c.object({label:c.string().min(1),team:c.string().optional(),position:c.string().optional()})).optional(),measures:c.array(vN).min(1)}).superRefine((e,t)=>{let r=e.measures.map(o=>o.key);new Set(r).size!==r.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var _N,gS,kN,lG,yS,dG,uG,pG,pg=w(()=>{"use strict";ze();_N=c.enum(["push","pull"]),gS=c.object({workspaceId:c.string().min(1),name:c.string().min(1),key:c.string().min(1),digest:c.string().regex(/^[0-9a-f]{16}$/),measures:c.array(c.string()).default([]),counts:c.record(c.string(),c.number().int().nonnegative()).default({}),scored:c.array(c.string()).optional(),bytes:c.number().int().nonnegative().default(0),origin:_N.default("push"),supplier:c.string().optional(),publishedAt:c.string().nullable().default(null),checkedAt:c.string().nullable().default(null),failing:c.boolean().default(!1),counted:c.boolean().default(!1)}),kN=c.object({gameId:c.string().min(1),gameName:c.string().default(""),pinnedDigest:c.string().nullable().default(null),stale:c.boolean().default(!1),roundIds:c.array(c.string()).default([])}),lG=c.object({dataset:gS,usedBy:c.array(kN).default([])}),yS=c.enum(["pushed","pulled","joined","refused","failed"]),dG=c.object({at:c.string(),event:yS,dataset:c.string().min(1),digest:c.string().nullable().default(null),gameId:c.string().nullable().default(null),gameName:c.string().nullable().default(null),roundId:c.string().nullable().default(null),message:c.string().default(""),ok:c.boolean().default(!0)}),uG=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(yS).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),pG=c.object({datasets:c.array(gS).default([]),unavailable:c.string().nullable().default(null)})});var hg=w(()=>{"use strict";Jt();Yt()});var mg=w(()=>{"use strict";Un();Jt()});var fg=w(()=>{"use strict"});var gg=w(()=>{"use strict";zn();Un();mg();Oc();fg();Jt();Un();Yt();rn();Nc();Pc()});function Di(){return vg.filter(e=>e.public!==!1&&e.type!=="collection"&&e.type!=="boolean"&&e.type!=="number").map(e=>e.key)}function bS(e){if(e===null||typeof e!="object"||Array.isArray(e))return["gamestage.settings.json must be one JSON object of field keys to text."];let t=new Set(Di()),r=[];for(let[o,n]of Object.entries(e)){let i=/^label_[a-z0-9_]+$/.test(o);!t.has(o)&&!i?r.push(`"${o}" is not a Studio field a game can fill. The fields are: ${[...t].join(", ")}, and any label_<key> the page reads.`):typeof n!="string"&&r.push(`"${o}" must be text, and is ${Array.isArray(n)?"a list":typeof n}.`)}return r}function mr(e,t,r,o){let n=e[0].toUpperCase()+e.slice(1),i=(d,l,p)=>({key:`css_variables_${d}`,label:l,type:"colour",description:p,readBy:`The game's own CSS, as the --gs-${d} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:r}),a=t.toLowerCase(),s=[i(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return o.variant&&s.push(i(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),s.push(i(`on${n}Colour`,`On ${a} colour`,"On: content sitting on the main and variant surfaces."),i(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),i(`on${n}ContainerColour`,`On ${a} container colour`,"On container: content sitting on the container surface.")),s}function $g(e,t){let r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${r}\\b`,`\\bpresentation\\s*\\[\\s*["']${r}["']\\s*\\]`,`\\b${r}\\s*:`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)||ON.has(t)&&/\broot\s*:/.test(e)?!0:t==="analyticsUrl"}function Lc(e){return[...yg.filter(t=>$g(e,Tg[t.key])).map(t=>t.key),...Ag(e)]}function Ag(e){let t=new Set;for(let r of e.matchAll(/["'`](label_[a-z0-9_]+)["'`]|\b(label_[a-z0-9_]+)\s*:/g)){let o=r[1]??r[2];o&&o!==Dc&&t.add(o)}return[...t].sort()}function wS(e){let t=e.slice(Dc.length).replace(/_/g," ").trim();return{key:e,label:t.charAt(0).toUpperCase()+t.slice(1),type:"freetext",description:"A word this game's page shows. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page.",section:"Wording"}}var yg,bg,SN,vg,wg,EN,_g,TN,kg,vS,$N,AN,IN,xg,CN,PN,Sg,Eg,Tg,ON,Dc,Ig=w(()=>{"use strict";yg=[{key:"play_again_label",label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:'What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:'What the result screen says when a fan finished under, e.g. "{n} away from the target". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:'The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:'The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:'The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}];bg=yg.map(e=>e.key);SN=[...mr("background","Background","The app and element background.",{variant:!1}),...mr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...mr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...mr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...mr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...mr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...mr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})],vg=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Reference data",type:"freetext",description:"A link to JSON holding the data this game draws on, shared by every round. Fetched by the Engine, never sent to a fan's browser. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"title_font",label:"Title typeface",type:"freetext",description:`The Google Font the game's name is set in at the top of the page, such as "Bebas Neue". It must be one of the families Gamestage offers (Anton, Archivo Black, Bebas Neue, Bungee, Chakra Petch, Fraunces, Oswald, Playfair Display, Russo One and others); any other name is ignored and the game's own title face is used. Leave it empty to keep that face.`,readBy:"The game's own page, on its title, loaded from Google Fonts after the page has drawn.",section:"Brand"},{key:"title_font_weight",label:"Title weight",type:"freetext",description:"How heavy the title is, as a number from 100 to 900 (400 is regular, 700 bold). A weight the typeface does not have becomes the nearest one it does; empty uses its heaviest.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_letter_spacing",label:"Title letter spacing",type:"freetext",description:"Space between the title's letters, as a fraction of the type size: 0.08 spreads it out, -0.02 tightens it, empty leaves the typeface's own spacing. Kept between -0.1 and 0.4.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_case",label:"Title case",type:"freetext",description:`Type "upper" to show the game's name in capital letters whatever case it is typed in. Leave it empty to show it as typed.`,readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_colour",label:"Title colour",type:"colour",description:"The colour of the game's name. Leave it empty to use the page's own text colour.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its submit button.",section:"Wording"},...yg,{key:"rank_ladder",label:"Rank names",type:"collection",itemLabel:"{{rank_label}}",description:"What each rank is called, best first. The game decides which rank a fan earned; this is only what it is called. Leave it empty to use the game's own names.",readBy:"The Engine, which awards the rank and returns its name.",section:"Wording",fieldset:[{key:"rank_label",label:"Name",type:"freetext",description:'What a fan sees when they earn this rank, e.g. "Hall of Fame".',readBy:"The Engine, on a finished round.",section:"Wording"}]},{key:"round_selection",label:"How the live round is chosen",type:"freetext",description:"Calendar: the round on today's edition, which a producer prepares. Rotation: one of a pool, chosen by the clock, the same one for everybody playing at that moment. Leave it empty for calendar.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"round_window_seconds",label:"How long a round stays up",type:"number",description:"Under rotation, how many seconds each round is the live one before the next takes over. Leave it empty for a day.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data a round counts, when it holds more than one, e.g. "points". A round can name its own instead. Leave it empty if the data holds one measure.',readBy:"The control plane, when it joins a round to the reference data.",section:"Content",public:!1},...SN],wg=[{key:"edition_name",label:"Edition name",type:"freetext",description:"What a fan sees this edition called. Leave it empty to use the game's own word for its container.",readBy:"The game's own page, wherever it names the round.",section:"This edition"},{key:"edition_strapline",label:"Edition line",type:"freetext",description:"A line for this edition only: a sponsor, a fixture, a date. Leave it empty and the line is not drawn.",readBy:"The game's own page, beside the edition name.",section:"This edition"}],EN=[{key:"bingo_rows",label:"Board rows",type:"number",description:"How many rows a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_columns",label:"Board columns",type:"number",description:"How many columns a fan's board has. Leave it empty for 3.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_centre_mode",label:"Centre cell",type:"freetext",description:'One of "free" (marked for everybody, and does not use a card), "none" (an ordinary cell dealt like any other) or "choice" (the fan picks it). Leave it empty for "free".',readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_shuffle_allowance",label:"Reshuffles allowed",type:"number",description:"How many times a fan may redeal their board before locking it. Leave it empty for 3.",readBy:"The Engine, which refuses a reshuffle once this is spent.",section:"This edition"},{key:"bingo_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"bingo_points_per_line",label:"Points per line",type:"number",description:"Awarded once for each completed line. Leave it empty for 10.",readBy:"The Engine, when it scores a settled board.",section:"This edition"},{key:"bingo_points_for_full_board",label:"Points for a full board",type:"number",description:"Awarded once, on top of every line, when the whole board comes in. Leave it empty for 0.",readBy:"The Engine, when it scores a settled board.",section:"This edition"}],_g=[{key:"title",label:"Round name",type:"freetext",description:"How this round is listed in Studio, so you can tell rounds apart. Gamestage fills it in when it creates the round; change it to anything. Fans do not see it.",readBy:"Studio's timeline label. Nothing a fan loads reads it.",section:"Content",public:!1},{key:"source_url",label:"Content source",type:"freetext",description:"A link to JSON holding this round's content. Fetched by the Engine when the round is provisioned, so it is never sent to a fan's browser and may hold the answers. Leave it empty to use the round in the game's manifest.",readBy:"The control plane, when it provisions the round.",section:"Content",public:!1},{key:"measure",label:"Measure",type:"freetext",description:'Which column of the reference data this round counts, e.g. "assists". Leave it empty to count what the game counts.',readBy:"The control plane, when it joins this round to the reference data.",section:"Content",public:!1},{key:"round_timer_seconds",label:"Time limit",type:"number",description:"How many seconds a fan gets on this round, counted from when they open it: 180 for three minutes. The Engine refuses a play that arrives after it. Leave it empty for a round with no clock.",readBy:"The Engine, which refuses a late play, and the game's own page, which counts it down.",section:"Content"}],TN=[{key:"round_theme",label:"Theme",type:"freetext",description:`What this round is about, in a word or two, e.g. "The Eighties". Shown above the game's name. Leave it empty for a round that is not one of a themed set.`,readBy:"The game's own page, above the title.",section:"This round"},{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},{key:"round_target",label:"The target",type:"number",description:"The total a fan must get as close to as they can without going over. Public: it is the goal they are set, and the game is unplayable without it.",readBy:"The Engine, which marks against it, and the page, which shows it.",section:"This round"},{key:"round_target_label",label:"What is being counted",type:"freetext",description:'Shown beside the target, e.g. "Career Points".',readBy:"The game's own page, beside the target.",section:"This round"},{key:"round_unit",label:"Unit",type:"freetext",description:'Put in front of every number in this round, e.g. "\xA3". Leave it empty for a round that counts something with no unit, like points.',readBy:"The game's own page, in front of the target, each pick and the total.",section:"This round"},{key:"round_slates",label:"The picks",type:"collection",itemLabel:"{{slate_label}}",description:"One group per pick, in the order a fan plays them. Five groups means five picks.",readBy:"The Engine, which marks against them, and the page, which draws them.",section:"This round",fieldset:[{key:"slate_label",label:"Group",type:"freetext",description:'What a fan sees above the choices, e.g. "1996-97 CHI".',readBy:"The game's own page.",section:"This round"},{key:"slate_entries",label:"Choices",type:"collection",itemLabel:"{{entry_label}}",description:"The choices a fan picks between in this group.",readBy:"The Engine and the page.",section:"This round",fieldset:[{key:"entry_label",label:"Name",type:"freetext",description:'What a fan sees, e.g. "Michael Jordan".',readBy:"The game's own page.",section:"This round"},{key:"entry_key",label:"Reference",type:"freetext",description:`The id this choice has in the game's own data, e.g. "jordami01". It is how the Engine finds what the choice is worth, so it has to match the data the game was deployed with. Never shown to a fan.`,readBy:"The Engine, to look up what this choice is worth.",section:"This round"},{key:"entry_note",label:"Note",type:"freetext",description:'Something worth knowing about this choice, shown to a fan who went over because of it, e.g. "Six rings, six Finals MVPs." Leave it empty and the game works out its own line.',readBy:"The game's own page, on the result when this choice took a fan over.",section:"This round"}]}]}],kg="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",vS={key:"round_board",label:"The board",type:"collection",itemLabel:"{{board_item}}",description:"Everything a fan can pick from, in the order they should see it.",readBy:"The Engine, which marks against it, and the page, which draws it.",section:"This round",fieldset:[{key:"board_item",label:"Pick",type:"freetext",description:'One thing a fan can pick, exactly as they should read it, e.g. "Michael Jordan".',readBy:"The game's own page, and the Engine, which marks a pick by it.",section:"This round"}]},$N=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},vS,{key:"round_targets",label:"The right answers",type:"freetext",description:`The picks that are right, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Larry Bird". ${kg}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],AN=[{key:"answer_measure",label:"Answer from data",type:"freetext",description:'Leave empty to type the answer yourself. Otherwise the dataset measure the answer is worked out from, e.g. "own_goals", and the board holds dataset keys rather than names.',readBy:"The relay, which works out the answer when the round is provisioned.",section:"This round",public:!1},{key:"answer_rule",label:"Which player is right",type:"freetext",description:'With "Answer from data": highest, lowest, only_nonzero (the one player above zero) or only_zero (the one player on zero). A round where the rule fits more than one player is refused, never guessed.',readBy:"The relay.",section:"This round",public:!1},{key:"reveal_each_guess",label:"Show a wrong guess's figure",type:"freetext",description:'With "Answer from data": "yes" to show a wrong guess its own figure straight away, "no" to show every figure only at the end. Empty means yes.',readBy:"The Engine, when it marks a guess.",section:"This round",public:!1},{key:"round_twist",label:"The twist",type:"freetext",description:`One surprising line shown after the round, e.g. "He has also completed more passes than any other defender." ${kg}`,readBy:"The Engine, which sends it only with a finished result.",section:"This round",public:!1},{key:"round_twist_source",label:"Where the twist is from",type:"freetext",description:'The publication and date, e.g. "Fantasy Premier League, 27 Sep 2026".',readBy:"The Engine, with the twist.",section:"This round",public:!1},{key:"round_twist_url",label:"The twist's link",type:"freetext",description:"A link to where the twist was reported. Optional.",readBy:"The Engine, with the twist.",section:"This round",public:!1}],IN=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the board, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the board.",section:"This round"},vS,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${kg}`,readBy:"The Engine, to mark a guess and to name a group once it is found.",section:"This round",public:!1,fieldset:[{key:"group_label",label:"What they have in common",type:"freetext",description:'Shown to a fan only once they have found this group, e.g. "1996-97 Bulls".',readBy:"The game's own page, after the group is solved.",section:"This round"},{key:"group_members",label:"Which ones",type:"freetext",description:'The picks in this group, separated by commas, written exactly as they appear on the board, e.g. "Michael Jordan, Scottie Pippen". Every one has to be on the board, and no pick may be in two groups.',readBy:"The Engine, to mark a guess.",section:"This round"}]}],xg=[{key:"prediction_question",label:"Question",type:"freetext",description:"What a fan is asked to call, in their words.",readBy:"The Engine, when it provisions the round.",section:"Content"},{key:"prediction_option",label:"Option",type:"freetext",description:"One thing a fan can call. Add one per outcome.",readBy:"The Engine, when it provisions the round.",section:"Content"}],CN=[{key:"card_note",label:"What this card means",type:"freetext",description:'A sentence explaining the card, shown when a fan taps it. "Goal in the first 10" might be "A goal is scored by either team inside the first ten minutes." Leave it empty and tapping the card does nothing.',readBy:"The game's own page, on the back of the card a fan taps.",section:"This card",public:!0}],PN=[{key:"round_prompt",label:"What a fan is told",type:"freetext",description:"The line above the goal, in a fan's words. Leave it empty to keep the wording the game was built with.",readBy:"The game's own page, above the goal.",section:"This round"},{key:"shoot_shots_allowed",label:"Shots",type:"number",description:"How many penalties a fan takes, from 1 to 20. Leave it empty for 5.",readBy:"The Engine, which refuses a shot once they are spent.",section:"This round"},{key:"shoot_goals_to_win",label:"Goals to win",type:"number",description:"How many goals count as winning the shootout. Reaching it does not end play: every remaining shot still scores. Leave it empty for 3.",readBy:"The Engine, which decides won or lost after the last shot.",section:"This round"},{key:"shoot_points_per_goal",label:"Points per goal",type:"number",description:"What each goal is worth on the leaderboard. Leave it empty for 100.",readBy:"The Engine, which scores each goal.",section:"This round"},{key:"shoot_difficulty",label:"Keeper",type:"freetext",description:"How good the goalkeeper is: easy_v1, balanced_v1 or hard_v1. Leave it empty for balanced_v1.",readBy:"The Engine, which picks the keeper's speed, reach and reactions from it.",section:"This round"}],Sg={hunt:[...$N,...AN],push:TN,group:IN,predict:[],bingo:CN,shoot:PN,place:[]},Eg={hunt:[],push:[],group:[],predict:[],bingo:EN,shoot:[],place:[]},Tg={display_name:"displayName",title_font:"titleFont",title_font_weight:"titleFontWeight",title_letter_spacing:"titleLetterSpacing",title_colour:"titleColour",title_case:"titleCase",analytics_url:"analyticsUrl",strapline:"strapline",how_to_play:"howToPlay",primary_colour:"primaryColour",play_button_label:"playButtonLabel",play_again_label:"playAgainLabel",result_button_label:"resultButtonLabel",share_button_label:"shareButtonLabel",edition_name:"editionName",edition_strapline:"editionStrapline",margin_over:"marginOver",margin_exact:"marginExact",margin_under:"marginUnder",result_over:"resultOver",result_exact:"resultExact",result_under:"resultUnder",share_over:"shareOver",share_exact:"shareExact",share_under:"shareUnder",result_bust_note:"resultBustNote",share_bust_note:"shareBustNote",capped_today_note:"cappedTodayNote",share_dare:"shareDare",result_dare:"resultDare"},ON=new Set(["titleFont","titleFontWeight","titleLetterSpacing","titleColour","titleCase"]);Dc="label_"});function DN(e){let t=new Map,r=o=>{for(let n of o)if(n.type==="collection"){let i=t.get(n.key);if(i&&(i.itemLabel!==n.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(n.fieldset??[])))throw new Error(`The collection "${n.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(n.key,n),r(n.fieldset??[])}};return r(e),[...NN,...xg.map(LN),...[...t.values()].map(RN)]}function Cg(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,field:xS(r),description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);if(i||(i={name:r.section},t.push(i)),r.subsection){let a=i.subsections??=[],s=a.find(d=>d.name===r.subsection);s||(s={name:r.subsection,...r.subsectionDescription?{description:r.subsectionDescription}:{},properties:[]},a.push(s)),s.properties.push(n)}else(i.properties??=[]).push(n)}return t}function jN(e){let t=e.archetypes.map(qe);for(let i of t)if(!_S[i])throw new Error(`No Studio element name for the ${i} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let r=i=>`${e.urls.baseAppsUrl}/${i}`,o=new Set(e.wording??bg),n=[...vg.filter(i=>!bg.includes(i.key)||o.has(i.key)),...[...o].filter(i=>i.startsWith(Dc)).sort().map(wS)];return{"spec.json":{name:e.name,id:e.id,version:e.version,base_apps_url:e.urls.baseAppsUrl,dash_image:e.urls.dashImage,embed_url:e.urls.embedUrl,elements:r("elements.json"),fields:r("fields.json"),project_settings:r("project_settings.json"),event_settings:r("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1},"elements.json":t.map(i=>({name:_S[i],content_type:kS(i),derived_from:jc[i]?.derivedFrom??"data",duration:jc[i]?.duration??{mode:"instant"},label:jc[i]?.derivedFrom==="prediction"?"{{question.text}}":"{{element.title}}",custom_fields:Cg([..._g,...Sg[qe(i)]??[]]),...jc[i]?.derivedFrom==="prediction"?{label_question:i==="bingo"?"Card":"Question",label_option:i==="bingo"?"Outcome":"Option",reveal_results:{modes:["manual"],default:"manual"},correct_option:{live_update:!0},question:[{label:"Question",key:"text",field:"prediction_question",mandatory:"question"}],option:[{label:"Option",key:"text",field:"prediction_option",mandatory:"option"}]}:{}})),"fields.json":DN([...n,...wg,..._g,...Object.values(Sg).flat(),...Object.values(Eg).flat(),...xg]),"project_settings.json":{sections:Cg(n)},"event_settings.json":{sections:Cg([...wg,...t.flatMap(i=>Eg[i]??[])])}}}function SS(e){return jN({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var _S,kS,jc,xS,NN,RN,LN,Pg=w(()=>{"use strict";Ig();rn();_S=Nb,kS=e=>{let t=qe(e);return nd[t]??`gamestage-${t.replaceAll("_","-")}-element`},jc={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},xS=e=>e.type==="collection"?e.key:e.type,NN=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1}],RN=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:xS(t),...t.description?{description:t.description}:{}}))}),LN=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var Og=w(()=>{"use strict";rn()});var ES=w(()=>{"use strict";Li();Fo();Cc();ug();zn();pg();hg();gg();Pg();Og();og();ig();Yt()});function AS(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function CS(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let d=globalThis.location?.origin,l=new URL(`${o}${a}`,o.startsWith("/")?d:void 0);for(let[h,m]of Object.entries(s.query??{}))m!=null&&l.searchParams.set(h,String(m));let p;for(let h=1;h<=r;h++){let m=typeof e.token=="function"?await e.token():e.token,y;try{y=await t(l,{method:i,headers:{authorization:`Bearer ${m}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)})}catch(M){let H=M instanceof Error?M.message:String(M);if(p=new $t(0,"unreachable",`Could not reach the control plane at ${o}: ${H}. Check your connection and run the command again.`,!0),h===r)break;await TS(AS(h));continue}if(y.ok)return await y.json();let x=await y.json().catch(()=>({}));if(p=new $t(y.status,x.error?.code??"unknown",x.error?.message??y.statusText,x.error?.retryable??!1),!p.retryable||h===r)break;let O=Number(y.headers.get("retry-after"));await TS(Number.isFinite(O)&&O>0?O*1e3:AS(h))}throw p??new $t(0,"unknown","Request failed.",!1)}}function PS(e){let t=CS(e);return{setWorkspaceAccess:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/access`,{body:{access:o,reason:n??null}}),async listAccess(){let r=await t("GET","/v1/admin/access"),o=[...r.waiting??[],...r.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(sS);return cS(o)},getWorkspace:r=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(r)}`),setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function fr(e){let t=CS(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let d of r)Array.isArray(s[d])||(s[d]=[]);return s},n=a=>({...a,access:Ic(a),terms:a.terms??null,games:(a.games??[]).map(o),gamesTotal:a.gamesTotal??(a.games??[]).length,archivedTotal:a.archivedTotal??(a.games??[]).filter(s=>s.state==="archived").length}),i=a=>({...a,workspace:{...a.workspace,access:Ic(a.workspace??{}),games:(a.workspace?.games??[]).map(o)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(a){if(!(a instanceof $t)||a.status!==404)throw a;return $S||($S=!0,console.warn("[control-plane] no /v1/workspace/summary, falling back to the full workspace read. If this persists the control plane is behind the site, and every Stage screen is carrying the whole workspace again.")),n(await t("GET","/v1/workspace"))}},linkGitHub:async a=>i(await t("PUT","/v1/workspace/github",{body:{login:a}})),acceptTerms:async a=>i(await t("PUT","/v1/workspace/terms",{body:{version:a}})),setPlan:async a=>i(await t("PUT","/v1/workspace/plan",{body:{tier:a}})),uploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/uploads`,{body:{filename:s}}),setPresetArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art/preset`,{body:{preset:s}}),artUploadTarget:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/art/uploads`,{body:{content_type:s}}),setUploadedArt:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/art`,{body:{url:s}}),referenceUploadTarget:(a,s)=>t("POST","/v1/reference/uploads",{body:{name:a,digest:s}}),pruneBundle:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/bundle`,{body:{filenames:s}}),async getGame(a){try{return o(await t("GET",`/v1/games/${encodeURIComponent(a)}`))}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,d)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:d}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),addGraphic:()=>{throw new Error("A graphic is composed by the control plane, not recorded by a client. Use composeGraphic(gameId, { template, consent: true }).")},composeGraphic:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/graphics`,{body:s}),removeGraphic:(a,s)=>t("DELETE",`/v1/games/${encodeURIComponent(a)}/graphics/${encodeURIComponent(s)}`),promoteGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/promote`),withdrawGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/withdraw`),deleteGame:a=>t("DELETE",`/v1/games/${encodeURIComponent(a)}`),deploy:(a,s)=>t("POST",`/v1/games/${encodeURIComponent(a)}/deploy`,{body:s}),refreshRound:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/round/refresh`),async seedRound(a,s){try{return await t("PUT",`/v1/games/${encodeURIComponent(a)}/round`,{body:{round:s}})}catch(d){throw d instanceof $t&&d.status===404&&!/no such game/i.test(d.message)?new $t(404,"not_supported","This control plane cannot take a round yet. It is running a build older than this CLI, so the round has to go in through Studio until it is updated.",!1):d}},setSignal:async a=>i(await t("PUT","/v1/workspace/signal",{body:{enabled:a}})),setWorkspaceProfile:a=>t("PUT","/v1/workspace/profile",{body:a}),async getEndpoints(a){try{return await t("GET",`/v1/games/${encodeURIComponent(a)}/endpoints`)}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:d}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return d},async getAuditLog(a){let{records:s}=await t("GET","/v1/audit",{query:a});return s},async listDatasets(){try{let a=await t("GET","/v1/reference/datasets");return!a||!Array.isArray(a.datasets)?{datasets:[],unavailable:IS}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof $t&&a.status===404)return{datasets:[],unavailable:IS};throw a}},async getDataset(a){try{let s=await t("GET",`/v1/reference/datasets/${encodeURIComponent(a)}`);return s?.dataset?s:void 0}catch(s){if(s instanceof $t&&s.status===404)return;throw s}},async getDataLog(a){try{let s=await t("GET","/v1/reference/log",{query:a});return Array.isArray(s?.lines)?s.lines:[]}catch(s){if(s instanceof $t&&s.status===404)return[];throw s}}}}var $t,TS,$S,IS,OS=w(()=>{"use strict";Cc();$t=class extends Error{status;code;retryable;constructor(t,r,o,n){super(o),this.status=t,this.code=r,this.retryable=n,this.name="ControlPlaneError"}},TS=e=>new Promise(t=>setTimeout(t,e)),$S=!1;IS="This control plane is running a build older than this screen, so it cannot list datasets yet."});function MN(e){if(e.timerSeconds===void 0||!Number.isInteger(e.timerSeconds)||e.timerSeconds<=0||!e.startedAt)return;let t=Date.parse(e.startedAt);if(Number.isFinite(t))return t+e.timerSeconds*1e3}function NS(e,t){let r=MN(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var RS=w(()=>{"use strict"});var LS=w(()=>{"use strict";Un()});var ji,DS,He,jS,MS,co,US,zS,Ng=w(()=>{"use strict";zn();ji=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.round(e):null,DS=e=>{let t=Number(e);return Number.isFinite(t)&&t>=0?Math.round(t*100):null},He=(e,t)=>({fields:[e],label:t,read:r=>ji(r[e])}),jS=270,MS=3,co=(e,t)=>({fields:[e,"minutes"],label:`${t} per 90 minutes, in hundredths (at least ${jS} minutes played)`,partial:!0,scale:100,read:r=>{let o=ji(r[e]),n=ji(r.minutes);return o===null||n===null||n<jS?null:Math.round(o*90*100/n)}}),US=(e,t)=>({fields:[e,"starts"],label:`${t} per start, in hundredths (at least ${MS} starts)`,partial:!0,scale:100,read:r=>{let o=ji(r[e]),n=ji(r.starts);return o===null||n===null||n<MS?null:Math.round(o*100/n)}}),zS={player_price:{...He("now_cost","Price, in tenths of a million"),scale:10},season_points:He("total_points","Points this season"),points_per_game:{fields:["points_per_game"],label:"Points per game, in tenths",scale:10,read:e=>{let t=Number(e.points_per_game);return Number.isFinite(t)&&t>=0?Math.round(t*10):null}},minutes:He("minutes","Minutes played"),starts:He("starts","Starts"),goals:He("goals_scored","Goals"),assists:He("assists","Assists"),own_goals:He("own_goals","Own goals"),penalties_missed:He("penalties_missed","Penalties missed"),penalties_saved:He("penalties_saved","Penalties saved"),yellow_cards:He("yellow_cards","Yellow cards"),red_cards:He("red_cards","Red cards"),saves:He("saves","Saves"),bonus:He("bonus","Bonus points"),tackles:He("tackles","Tackles"),recoveries:He("recoveries","Ball recoveries"),clearances_blocks_interceptions:He("clearances_blocks_interceptions","Clearances, blocks and interceptions"),defensive_contributions:He("defensive_contribution","Defensive contribution points"),expected_goals:{fields:["expected_goals"],label:"Expected goals, in hundredths",scale:100,read:e=>DS(e.expected_goals)},expected_assists:{fields:["expected_assists"],label:"Expected assists, in hundredths",scale:100,read:e=>DS(e.expected_assists)},goals_per_90:co("goals_scored","Goals"),assists_per_90:co("assists","Assists"),yellow_cards_per_90:co("yellow_cards","Yellow cards"),tackles_per_90:co("tackles","Tackles"),recoveries_per_90:co("recoveries","Ball recoveries"),saves_per_90:co("saves","Saves"),bonus_per_start:US("bonus","Bonus points"),defensive_contributions_per_start:US("defensive_contribution","Defensive contribution points")}});function Mi(e){return e.standing==="unofficial"?GN:void 0}function FS(e){return un.find(t=>t.id===e)}var UN,zN,FN,nW,GN,un,Rg=w(()=>{"use strict";Ng();ze();UN=c.discriminatedUnion("kind",[c.object({kind:c.literal("everyone")}),c.object({kind:c.literal("domains"),domains:c.array(c.string().min(1)).min(1)}),c.object({kind:c.literal("named")})]),zN=c.enum(["licensed","unofficial","creator"]),FN=c.enum(["ours","creator"]),nW=c.object({id:c.string().min(1),label:c.string().min(1),standing:zN,origin:FN,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),catalogue:c.object({offers:c.string().min(1),competitions:c.array(c.string()).default([]),cost:c.string().min(1),needsKey:c.boolean().default(!1),signUp:c.string().url().optional(),licence:c.string().min(1),fetched:c.boolean().optional()}).optional(),audience:UN.optional()}),GN="Requests to this source are made on behalf of you, the game builder. You are responsible for the data you consume, and for securing the legal rights and licence to use it. We recommend using it for testing only, and not launching with it unless you have explicit permission from the data owner.";un=[{id:"nba",label:"NBA",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"domains",domains:["monterosa.co.uk","nba.com"]},produces:["career_points","career_rebounds","career_assists","career_games"],note:"Licensed to Monterosa. Career totals are the NBA's own figures, not a sum we computed.",catalogue:{offers:"NBA players' career totals: points, rebounds, assists, games.",competitions:["NBA"],cost:"Included for Monterosa and NBA accounts; others by arrangement.",needsKey:!1,licence:"Licensed to Monterosa. Fit for a game with a prize.",fetched:!0}},{id:"push",label:"Your own data",standing:"creator",origin:"creator",tiers:["runtime","live","enterprise"],produces:[],note:"A file you push with `gamestage reference push`, from your machine or your CI.",catalogue:{offers:"Any values you hold, in a JSON file you push: your squad, your archive, your own licensed feed.",competitions:[],cost:"Free on every plan.",needsKey:!1,licence:"Yours. Your data, or a feed you license: your terms.",fetched:!0}},{id:"fpl",label:"Fantasy Premier League",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:Object.keys(zS),note:"Free, with no contract behind it, so a prize game wants a licensed source. Prices move weekly and a round in play keeps the ones it opened with.",catalogue:{offers:"Premier League players: FPL price and points, goals, assists, own goals, penalties missed and saved, cards, saves, bonus, tackles, recoveries, defensive contributions, minutes, starts and expected goals and assists, plus per-90 and per-start ratios, with each player's name, club and position. Refreshed daily.",competitions:["Premier League"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}},{id:"sportmonks",label:"Sportmonks football",standing:"creator",origin:"ours",tiers:["runtime","live","enterprise"],produces:["goals","assists","appearances","minutes","yellow_cards","clean_sheets"],note:"Your own Sportmonks plan and key. We call it on a schedule with your key, and your plan decides which competitions you can use.",catalogue:{offers:"Football players' season statistics for any competition your plan covers: goals, assists, appearances, minutes, cards, clean sheets, with each player's name, team and position.",competitions:[],cost:"Your Sportmonks plan. A free plan covers a few smaller leagues; the Premier League needs a paid one.",needsKey:!0,signUp:"https://www.sportmonks.com/football-api/",licence:"Yours: your Sportmonks plan and its terms. Check they cover this use before a game with a prize."}},{id:"espn",label:"ESPN (open access)",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:[],note:"ESPN's openly reachable sports data, with no contract behind it, so not for a prize. Not fetched yet: ask us before building on it.",catalogue:{offers:"Rosters, athletes and statistics across many leagues, from ESPN's openly reachable endpoints.",competitions:["NBA","NFL","MLB","NHL","Premier League and other football leagues"],cost:"Free. No key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!1}}]});function WN(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function GS(e){let t=e.ownerEmail?.lastIndexOf("@")??-1,r=t>=0?e.ownerEmail.slice(t+1).trim().toLowerCase():void 0;return{id:e.id,domain:r||void 0,grants:e.supplierGrants}}function KN(e){return e.audience??BN}function HN(e,t,r=un){let o=r.find(i=>i.id===t);if(!o)return{allowed:!1,reason:`There is no supplier called "${t}".`};if(e.grants?.includes(t))return{allowed:!0,because:"grant"};let n=KN(o);switch(n.kind){case"everyone":return{allowed:!0,because:"audience"};case"domains":return e.domain&&WN(e.domain,n.domains)?{allowed:!0,because:"audience"}:{allowed:!1,reason:`${o.label} is available to ${n.domains.join(" and ")}. Ask us if you need it.`};case"named":return{allowed:!1,reason:`${o.label} is granted per account. Ask us if you need it.`}}}function BS(e,t=un){return t.map(r=>({supplier:r,entitlement:HN(e,r.id,t)}))}var BN,WS=w(()=>{"use strict";Rg();BN={kind:"everyone"}});function XN(e,t){let r=e.trim().toLowerCase();return r?t.some(o=>{let n=o.trim().toLowerCase();return r===n||r.endsWith(`.${n}`)}):!1}function QN(e,t){let r=new Set((e.grants??[]).filter(o=>o.startsWith("org:")).map(o=>o.slice(4)));return t.find(o=>r.has(o.id)?!0:e.domain?XN(e.domain,o.domains):!1)}function VS(e,t){let r=e?.lastIndexOf("@")??-1,o=r>=0?e.slice(r+1).trim().toLowerCase():void 0;if(o)return QN({id:"creator",domain:o},t)}function ZS(e,t){let r={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`};if(t.identity&&(e.identity.provider="jwt",e.identity.jwt={issuer:t.identity.issuer,jwks_uri:t.identity.jwks_uri,...t.identity.audience?{audience:t.identity.audience}:{}},e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,r]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let o=new Set(e.measurement.destinations.map(n=>n.type));for(let n of t.analytics)o.has(n.type)||(e.measurement.destinations.push({type:n.type,enabled:!0,config:n.config}),o.add(n.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,r]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,r])}var VN,ZN,YN,qN,KS,JN,HS,YS,qS=w(()=>{"use strict";ze();ln();VN=c.object({kind:c.enum(["figma","tokens","guidelines"]),ref:c.string().min(1)}),ZN=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),YN=c.object({provider:c.string().optional(),analytics_requires_consent:c.boolean().default(!0)}),qN=c.object({type:Of.shape.type,config:c.record(c.string(),c.string()).default({})}),KS=c.object({kind:c.string().min(1),ref:c.string().min(1)}),JN=c.object({sink:KS.optional(),source:KS.optional()}),HS=c.object({id:c.string().min(1),displayName:c.string().min(1),domains:c.array(c.string()).default([]),version:c.number().int().nonnegative().default(1),brand:VN.optional(),identity:ZN.optional(),consent:YN.prefault({}),analytics:c.array(qN).default([]),data:JN.prefault({})});YS=[HS.parse({id:"monterosa",displayName:"Monterosa",domains:["monterosa.co.uk"],brand:{kind:"guidelines",ref:"monterosa-brand-guidelines"},identity:{issuer:"https://accounts.google.com",jwks_uri:"https://www.googleapis.com/oauth2/v3/certs"},consent:{analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{source:{kind:"slack-directory",ref:"monterosa-people"},sink:{kind:"delta-share",ref:"monterosa_gameplay"}}}),HS.parse({id:"nba",displayName:"NBA",domains:["nba.com"],brand:{kind:"figma",ref:"nba-brand"},identity:{issuer:"https://id.nba.com",jwks_uri:"https://id.nba.com/.well-known/jwks.json"},consent:{provider:"onetrust",analytics_requires_consent:!0},analytics:[{type:"monterosa",config:{}}],data:{sink:{kind:"snowflake",ref:"nba_gameplay"}}})]});var dW,JS=w(()=>{"use strict";ze();dW=c.object({org:c.string().min(1),game:c.string().min(1),player:c.string().min(1),alias:c.string().optional(),round:c.string().optional(),score:c.number(),outcome:c.string().optional(),at:c.string().min(1)})});var XS=w(()=>{"use strict";zn()});var QS=w(()=>{"use strict";zn()});function Lg(e){let t;try{t=JSON.parse(e)}catch(o){return{ok:!1,reason:"That is not JSON.",detail:o instanceof Error?o.message:void 0}}let r=dn.safeParse(t);if(!r.success){let o=r.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:o?`${o.path.join(".")||"document"}: ${o.message}`:void 0}}return{ok:!0,summary:{digest:Rc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length])),scored:r.data.measures.filter(o=>o.scoring).map(o=>o.key)}}}async function eE(e,t){let r=Lg(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}function tE(e,t){return e?e.filter(r=>!t.scored.includes(r)):[]}var nE=w(()=>{"use strict";zn()});var rE=w(()=>{"use strict"});var oE=w(()=>{"use strict"});function Mc(e){return e.sourceIp?.trim()||"unknown"}function lo(e,t){return`${e.length}:${e}${t}`}var eR,iE,aE,sE,cE,wW,_W,kW,lE=w(()=>{"use strict";eR=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},iE=e=>typeof process>"u"?void 0:eR(process.env?.[e]),aE=(e,t,r)=>({burst:iE(t)??e.burst,perMinute:iE(r)??e.perMinute}),sE={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},cE={player:aE(sE.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:aE(sE.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},wW=cE.player,_W=cE.publicRoutes,kW=600*1e3});var dE=w(()=>{"use strict"});var Uc,Dg=w(()=>{"use strict";Uc=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]});function uE(e,t){return[...e.map(r=>r.toUpperCase()),String(t).padStart(2,"0")].join("-")}function pE(e){if(typeof e!="string"||e.length>120)return;let t=e.trim().toLowerCase().split(/[\s\-_.]+/).filter(Boolean);if(t.length!==zc+1)return;let r=t.slice(0,zc),o=t[zc];if(r.every(nR)&&/^\d{2}$/.test(o))return uE(r,Number(o))}function hE(e){let t=Array.from({length:zc},()=>Uc[e(Uc.length)]);return uE(t,e(100))}var zc,tR,nR,AW,IW,mE,CW,jg,fE=w(()=>{"use strict";ze();Dg();zc=4,nR=e=>(tR??=new Set(Uc)).has(e);AW=c.object({has_code:c.boolean(),issued_at:c.string().nullable()}),IW=c.object({code:c.string(),issued_at:c.string(),replaced:c.boolean()}),mE=c.object({code:c.string().max(120)}),CW=c.object({token:c.string(),player_id:c.string(),kind:c.literal("anonymous"),previous_player:c.literal("kept")}),jg="That code doesn't match a player. Check each word and the two numbers, then try again."});var we=w(()=>{"use strict";Fo();rn();ln();Sf();wc();og();Ux();Li();Gx();fc();ig();Xx();$i();Yt();Cc();ES();OS();Ig();Jt();hg();RS();Un();Pc();mg();Oc();fg();ro();LS();zn();WS();qS();JS();Rg();Ng();XS();QS();nE();pg();Nc();gg();rE();Pg();ug();oE();Og();xf();lE();dE();fE();Dg()});var uo,gr,Ve,Mt,Xt,Re,gE,rR,oR,iR,aR,sR,cR,Ui,pn=w(()=>{"use strict";uo=`/**
|
|
109
109
|
* @monterosa/gamestage-player, bundled for a browser.
|
|
110
110
|
*
|
|
111
111
|
* Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
|
|
@@ -7384,7 +7384,7 @@ function titleTreatment(presentation) {
|
|
|
7384
7384
|
let fontHref;
|
|
7385
7385
|
const font = resolveTitleFont(presentation.titleFont, presentation.titleFontWeight);
|
|
7386
7386
|
if (font) {
|
|
7387
|
-
vars["--gs-title-font"] = \`"\${font.family}", var(--gs-font-display,
|
|
7387
|
+
vars["--gs-title-font"] = \`"\${font.family}", var(--gs-font-display, system-ui), sans-serif\`;
|
|
7388
7388
|
vars["--gs-title-weight"] = String(font.weight);
|
|
7389
7389
|
declarations.push("font-family: var(--gs-title-font)", "font-weight: var(--gs-title-weight)");
|
|
7390
7390
|
const family = font.family.replace(/ /g, "+");
|
|
@@ -7887,7 +7887,7 @@ export {
|
|
|
7887
7887
|
titleTreatment,
|
|
7888
7888
|
tokenOf
|
|
7889
7889
|
};
|
|
7890
|
-
`,Xt="
|
|
7890
|
+
`,Xt="9413ee4f3ff5aab3",Re="gamestage.js",gE="0.62.0",rR=`<!doctype html>
|
|
7891
7891
|
<html lang="en">
|
|
7892
7892
|
<head>
|
|
7893
7893
|
<meta charset="utf-8" />
|
|
@@ -11109,16 +11109,16 @@ main()
|
|
|
11109
11109
|
</script>
|
|
11110
11110
|
</body>
|
|
11111
11111
|
</html>
|
|
11112
|
-
`,Ui={hunt:rR,push:oR,group:iR,predict:aR,bingo:sR,shoot:cR}});function
|
|
11112
|
+
`,Ui={hunt:rR,push:oR,group:iR,predict:aR,bingo:sR,shoot:cR}});function yE(e){ho=e}function J(){return ho}function Fc(e=process.argv,t=process.env){if(t.GAMESTAGE_INVOCATION)return t.GAMESTAGE_INVOCATION;let r=e[1]??"";if(/[\\/]_npx[\\/]/.test(r))return"npx gamestage";let o=r.split(/[\\/]/).pop()??"";return o==="gamestage.mjs"||o==="cli.mjs"?`node ${o}`:"gamestage"}function ie(e){return`${Fc()} ${e}`}function Mg(e){let t=Fc();return t==="gamestage"?e:e.replace(uR,(r,o,n)=>dR.includes(o)?`\`${t} ${o}${n}\``:r)}function g(e=""){ho||process.stdout.write(Mg(e)+`
|
|
11113
11113
|
`)}function U(e){g(),g(A.bold(e))}function E(e,t="-"){g(` ${A.dim(t)} ${e}`)}function R(e,t){g(` ${A.dim(e.padEnd(18))} ${t}`)}function te(e){ho&&process.stdout.write(JSON.stringify(e,null,2)+`
|
|
11114
|
-
`)}async function
|
|
11115
|
-
`);else{process.stderr.write(`${A.red("Error")} ${
|
|
11116
|
-
`);for(let r of t??[])process.stderr.write(` ${
|
|
11117
|
-
`)}process.exit(1)}var ho,lR,po,A,dR,uR,Ne=w(()=>{"use strict";ho=!1;lR=()=>!ho&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,po=(e,t)=>lR()?`\x1B[${e}m${t}\x1B[0m`:t,A={bold:e=>po("1",e),dim:e=>po("2",e),red:e=>po("31",e),green:e=>po("32",e),yellow:e=>po("33",e),cyan:e=>po("36",e)};dR=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","sources","start","status","suggest","suspend","verify","wake","whoami"],uR=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});import{spawn as SE}from"node:child_process";import{chmod as vE,mkdir as wE,readFile as _E,rm as kE,writeFile as xE}from"node:fs/promises";import{homedir as wR,platform as mo}from"node:os";import{dirname as _R,join as EE}from"node:path";async function TE(){let e=await fetch(`${Ug}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:zg})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function $E(e){let t=await fetch(`${Ug}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:zg,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function AE(e){let t=mo()==="darwin"?"open":mo()==="win32"?"cmd":"xdg-open",r=mo()==="win32"?["/c","start","",e]:[e];try{SE(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Fg(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function Gg(e,t){return new Promise(r=>{let o=SE("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function Bg(e){let t=JSON.stringify(e),r=Fg();return r?(await wE(_R(r),{recursive:!0,mode:448}),await xE(r,t,{mode:384}),await vE(r,384),"file"):mo()==="darwin"&&await Gg(["add-generic-password","-a",fo,"-s",fo,"-U","-w",t])!==null?"keychain":(await wE(IE,{recursive:!0,mode:448}),await xE(Gc,t,{mode:384}),await vE(Gc,384),"file")}function kR(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function xR(e){if(!e.refreshToken)return null;let t=await fetch(`${Ug}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:zg,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function SR(){let e=Fg();if(e)try{return JSON.parse(await _E(e,"utf8"))}catch{return null}if(mo()==="darwin"){let t=await Gg(["find-generic-password","-a",fo,"-s",fo,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await _E(Gc,"utf8"))}catch{return null}}async function CE(){let e=Fg();if(e){await kE(e,{force:!0});return}mo()==="darwin"&&await Gg(["delete-generic-password","-a",fo,"-s",fo]),await kE(Gc,{force:!0})}async function Le(){let e=await SR();if(!e)return null;if(!kR(e.accessToken)||!e.refreshToken)return e;let t=await xR(e);return t?(await Bg(t),t):null}var Ug,zg,fo,IE,Gc,yr=w(()=>{"use strict";Ug="https://api.workos.com",zg=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";fo="gamestage-cli",IE=EE(wR(),".gamestage"),Gc=EE(IE,"credentials.json")});function NE(e){return`${Ut}/stage/games/${encodeURIComponent(e)}?tab=overview`}function RE(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${Ut}/docs/game-formats#${e}`:`${Ut}/docs`}var Ut,Kc=w(()=>{"use strict";Ut=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function AR(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function IR(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function CR(e=De,t=process.env){if(IR(t)&&!AR(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function yo(e=De){let t=CR(e);t&&K(t)}async function Fn(){let e=await Le();return e||K("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function Te(){let e=await Fn();return{client:fr({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function LE(){let e=await Le().catch(()=>null);if(e)return fr({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken})}async function Kg(){let e=await Le();return e||K("You are not signed in.",["Run `gamestage login`. An operator's command needs an operator's own session."]),{admin:CS({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Hc(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===Hg?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${De}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${De}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${De}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Fi(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:Hg,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${Ut}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function DE(e){return!e.changed&&e.refused?{ok:!0,status:"refused_by_store",access:e.access,code:e.code,heading:"Not approved",message:e.refused,next:["Nothing was written. When they have accepted the terms, run this again."]}:e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function bo(e){if(U(e.heading),g(` ${e.message}`),e.next.length){g();for(let t of e.next)E(t)}g()}function jE(e,t,r){let o=a=>{let s=a.trim().toLowerCase();return io.options.find(d=>d===s||Pi[d].toLowerCase()===s)},n=io.options.map(a=>`${a} (${Pi[a]})`).join(", "),i=o(t);return i?r===void 0?{request:{workspaceId:e,tier:i}}:!/^\d+$/.test(r)||Number(r)>1e4?{problem:`"${r}" is not a live-game allowance.`,detail:["Give a whole number from 0 to 10000, where 0 means no ceiling.","Nothing has been changed."]}:{request:{workspaceId:e,tier:i,allowance:Number(r)}}:o(e)?{problem:"The workspace comes first and the plan second.",detail:[`Try: ${ie(`admin plan ${t} ${e}`)}`,"Nothing has been changed."]}:{problem:`"${t}" is not a plan.`,detail:[`Use one of: ${n}.`,"Nothing has been changed."]}}function go(e){let t=Pi[e.tier];if(e.liveGameAllowance===void 0)return t;let r=e.liveGameAllowance===0?"no live-game ceiling":`${e.liveGameAllowance} live game${e.liveGameAllowance===1?"":"s"}`;return`${t}, ${r}`}function ME(e){let{request:t,previous:r,result:o,stored:n}=e,i=go({tier:t.tier,liveGameAllowance:t.allowance}),a={previous:r,stored:n};return o.refused?{...a,status:"refused_by_store",exitCode:0,heading:"Not changed",message:o.refused,next:["Nothing was written."]}:n?n.tier===t.tier&&(t.allowance===void 0||n.liveGameAllowance===t.allowance)?r!==null&&r.tier===n.tier&&r.liveGameAllowance===n.liveGameAllowance?{...a,status:"unchanged",exitCode:0,heading:"No change",message:`${t.workspaceId} was already on ${go(n)}, and still is.`,next:[Wg]}:{...a,status:"set",exitCode:0,heading:"Plan set",message:`${t.workspaceId} is on ${go(n)}, read back from the control plane after the write.`,next:[Wg]}:{...a,status:"not_what_was_asked",exitCode:1,heading:"Not what was asked",message:`${t.workspaceId} was sent ${i} and holds ${go(n)}. The write reported success, and the stored workspace disagrees with it.`,next:["Run it again to see whether the second read agrees. If it still disagrees, that is a control-plane defect to raise, not an operator mistake."]}:{...a,status:"unconfirmed",exitCode:2,heading:"Sent, and not confirmed",message:`The control plane accepted ${t.workspaceId} moving to ${i}, and could not then be asked what it kept: ${e.unreadable??"no reason given"}.`,next:["Treat the plan as unknown rather than set. Run this again once the control plane answers reads; repeating the same plan is safe.",Wg]}}function UE(e){if(U(e.heading),g(` ${e.message}`),g(),R("Before",e.previous?go(e.previous):"could not be read"),R("Stored now",e.stored?go(e.stored):"could not be read"),e.next.length){g();for(let t of e.next)E(t)}g()}function Ce(e){let t=[],r=e.status,o=e.code;if(o===Hg){let n=Fi({access:"pending"});J()?te({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):bo(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${De}`),K(e instanceof Error?e.message:"The control plane call failed.",t)}var De,Hg,Wg,At=w(()=>{"use strict";we();yr();Ne();Kc();De=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";Hg="access_pending";Wg="This does not re-provision. A live round keeps the caps it was provisioned with, including its day cap, until the game is deployed again, so a creator refused before this is refused the same way until they redeploy with `gamestage deploy`. That is not this change failing."});function LR(e,t){let o=new RegExp(`id="${t}"[^>]*>([^<]*)<`).exec(e)?.[1]?.replace(/\s+/g," ").trim();return o||void 0}function DR(e,t){return new RegExp(`${t}:\\s*el\\("([a-z0-9-]+)"\\)`).exec(e)?.[1]}function GE(e,t,r){let o=new Set(Di()),n={},i=(s,d)=>{d&&o.has(s)&&(n[s]=d)};i("display_name",t.trim());let a=DR(e,"playButtonLabel");a&&i("play_button_label",LR(e,a)),r&&i("how_to_play",RR[r]);for(let[s,d]of Zg(e))i(`css_variables_${s}`,d);return i("primary_colour",jR(e)),n}function Zg(e){let t=BE(e),r=new Map;for(let o of e.matchAll(/var\(--gs-([A-Za-z]+)\s*,/g)){if(r.has(o[1]))continue;let n=0,i=o.index;for(let s=o.index;s<e.length;s++)if(e[s]==="(")n++;else if(e[s]===")"&&--n===0){i=s+1;break}let a=t(e.slice(o.index,i));a&&r.set(o[1],a)}return r}function jR(e){return/var\(--gamestage-primary\s*,\s*(#[0-9A-Fa-f]{3,8})\s*\)/.exec(e)?.[1]?.toUpperCase()}function BE(e){let t=new Map;for(let o of e.matchAll(/(--[A-Za-z0-9-]+)\s*:\s*([^;}]+)/g))t.has(o[1])||t.set(o[1],o[2].trim());let r=(o,n=0)=>{if(n>12)return;let i=o.trim(),a=/^#[0-9A-Fa-f]{3,8}$/.exec(i);if(a)return a[0].toUpperCase();let s=/^var\(\s*(--[A-Za-z0-9-]+)\s*(?:,\s*([\s\S]*))?\)$/.exec(i);if(!s)return;let[,d,l]=s;if(!d.startsWith("--gs-")){let p=t.get(d),h=p?r(p,n+1):void 0;if(h)return h}return l?r(l,n+1):void 0};return r}function WE(e){let t=/(?:^|[\s}])body\s*\{([^}]*)\}/.exec(e),r=t?/background(?:-color)?\s*:\s*([^;}]+)/.exec(t[1])?.[1]?.trim():void 0;return r?BE(e)(r):void 0}var RR,Yg=w(()=>{"use strict";we();RR={hunt:"Find the right ones on the board. A wrong pick costs a try.",push:"Pick one from each line. Get as close to the limit as you dare without going over.",group:"Sort the board into its groups. A wrong group costs a life.",predict:"Call what will happen before it does. You score when you are right.",bingo:"Lock your board, then mark each square as it happens. A full line scores.",shoot:"Pick a spot and a power, then shoot. The keeper decides the rest."}});import{readFile as BR}from"node:fs/promises";import{dirname as WR,join as KR}from"node:path";async function _o(e){let t=KR(WR(e),wo),r;try{r=await BR(t,"utf8")}catch{return{path:t,problems:[]}}let o;try{o=JSON.parse(r)}catch(i){return{path:t,problems:[`${wo} is not valid JSON: ${i instanceof Error?i.message:String(i)}`]}}let n=yS(o);return n.length>0?{path:t,problems:n}:{path:t,settings:o,problems:n}}var wo,Wi=w(()=>{"use strict";we();wo="gamestage.settings.json"});async function Ki(e,t){let r=t.referenceName;if(r)try{let{datasets:o}=await e.listDatasets(),n=o.find(s=>s.name===r),i=n?.supplier?zS(n.supplier):void 0,a=i?Mi(i):void 0;return!i||!a?void 0:{dataset:r,source:i.label,caveat:a}}catch{return}}function Hi(e){!e||J()||(U("This game's data comes from an unofficial source"),E(`It is scored on ${e.dataset}, from ${e.source}.`),E(e.caveat),g())}var qg=w(()=>{"use strict";we();Ne()});import{open as YR,readFile as qE}from"node:fs/promises";import{createHash as qR}from"node:crypto";import{gunzipSync as JR}from"node:zlib";function e1(e){for(let{pattern:t,what:r}of QR)if(t.test(e))return r}function Xg(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||XR.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function XE(e,t){let r;try{r=await YR(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
|
|
11118
|
-
`),a])}catch{return}finally{await r.close()}}async function n1(e){return(await
|
|
11114
|
+
`)}async function Ug(e){let t=process.stdout;typeof t.writableLength=="number"&&t.writableLength>0&&await new Promise(r=>{let o=()=>r();t.once("drain",o),t.once("error",o),t.once("close",o)}),process.exit(e)}function K(e,t){if(ho)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
|
|
11115
|
+
`);else{process.stderr.write(`${A.red("Error")} ${Mg(e)}
|
|
11116
|
+
`);for(let r of t??[])process.stderr.write(` ${Mg(r)}
|
|
11117
|
+
`)}process.exit(1)}var ho,lR,po,A,dR,uR,Ne=w(()=>{"use strict";ho=!1;lR=()=>!ho&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,po=(e,t)=>lR()?`\x1B[${e}m${t}\x1B[0m`:t,A={bold:e=>po("1",e),dim:e=>po("2",e),red:e=>po("31",e),green:e=>po("32",e),yellow:e=>po("33",e),cyan:e=>po("36",e)};dR=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","sources","start","status","suggest","suspend","verify","wake","whoami"],uR=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});import{spawn as EE}from"node:child_process";import{chmod as wE,mkdir as _E,readFile as kE,rm as xE,writeFile as SE}from"node:fs/promises";import{homedir as wR,platform as mo}from"node:os";import{dirname as _R,join as TE}from"node:path";async function $E(){let e=await fetch(`${zg}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Fg})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function AE(e){let t=await fetch(`${zg}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Fg,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e})}),r=await t.json();if(t.ok){let o=r.user;return{status:"ok",session:{accessToken:String(r.access_token??""),refreshToken:r.refresh_token?String(r.refresh_token):void 0,email:o?.email,userId:o?.id}}}switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down"};case"expired_token":return{status:"expired"};default:return{status:"denied",reason:String(r.error_description??r.error??"unknown error")}}}function IE(e){let t=mo()==="darwin"?"open":mo()==="win32"?"cmd":"xdg-open",r=mo()==="win32"?["/c","start","",e]:[e];try{EE(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Gg(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function Bg(e,t){return new Promise(r=>{let o=EE("security",e,{stdio:["pipe","pipe","ignore"]}),n="";o.stdout.on("data",i=>n+=i),o.on("error",()=>r(null)),o.on("close",i=>r(i===0?n.trim():null)),t!==void 0?o.stdin.end(t):o.stdin.end()})}async function Wg(e){let t=JSON.stringify(e),r=Gg();return r?(await _E(_R(r),{recursive:!0,mode:448}),await SE(r,t,{mode:384}),await wE(r,384),"file"):mo()==="darwin"&&await Bg(["add-generic-password","-a",fo,"-s",fo,"-U","-w",t])!==null?"keychain":(await _E(CE,{recursive:!0,mode:448}),await SE(Gc,t,{mode:384}),await wE(Gc,384),"file")}function kR(e){try{let[,t]=e.split("."),{exp:r}=JSON.parse(Buffer.from(t,"base64url").toString());return typeof r!="number"?!0:r*1e3-Date.now()<3e4}catch{return!0}}async function xR(e){if(!e.refreshToken)return null;let t=await fetch(`${zg}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Fg,grant_type:"refresh_token",refresh_token:e.refreshToken})});if(!t.ok)return null;let r=await t.json();return r.access_token?{...e,accessToken:String(r.access_token),refreshToken:r.refresh_token?String(r.refresh_token):e.refreshToken}:null}async function SR(){let e=Gg();if(e)try{return JSON.parse(await kE(e,"utf8"))}catch{return null}if(mo()==="darwin"){let t=await Bg(["find-generic-password","-a",fo,"-s",fo,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await kE(Gc,"utf8"))}catch{return null}}async function PE(){let e=Gg();if(e){await xE(e,{force:!0});return}mo()==="darwin"&&await Bg(["delete-generic-password","-a",fo,"-s",fo]),await xE(Gc,{force:!0})}async function Le(){let e=await SR();if(!e)return null;if(!kR(e.accessToken)||!e.refreshToken)return e;let t=await xR(e);return t?(await Wg(t),t):null}var zg,Fg,fo,CE,Gc,yr=w(()=>{"use strict";zg="https://api.workos.com",Fg=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";fo="gamestage-cli",CE=TE(wR(),".gamestage"),Gc=TE(CE,"credentials.json")});function RE(e){return`${Ut}/stage/games/${encodeURIComponent(e)}?tab=overview`}function LE(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${Ut}/docs/game-formats#${e}`:`${Ut}/docs`}var Ut,Kc=w(()=>{"use strict";Ut=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function AR(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function IR(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function CR(e=De,t=process.env){if(IR(t)&&!AR(e)&&t.GAMESTAGE_ALLOW_REMOTE_TESTS!=="1")return`Refusing to register a test game against non-local control plane ${e}. Use the throwaway local control plane, or set GAMESTAGE_ALLOW_REMOTE_TESTS=1 for a deliberate real-plane run.`}function yo(e=De){let t=CR(e);t&&K(t)}async function Fn(){let e=await Le();return e||K("You are not signed in.",["Run `gamestage login`. It creates the account too if you do not have one.","Inspecting, scaffolding and validating a manifest still need no account."]),e}async function Te(){let e=await Fn();return{client:fr({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function DE(){let e=await Le().catch(()=>null);if(e)return fr({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken})}async function Hg(){let e=await Le();return e||K("You are not signed in.",["Run `gamestage login`. An operator's command needs an operator's own session."]),{admin:PS({baseUrl:De,token:async()=>(await Le())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Hc(e){try{let t=await e.getWorkspace(),r=t?.access;return r==="approved"||r==="pending"||r==="refused"?{access:r,workspace:t}:{access:"unreported",workspace:t}}catch(t){let r=t.status,o=t.code;return o===Vg?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${De}.`,detail:["You are signed in, and deploying will fail until this is pointed somewhere real.","Set GAMESTAGE_CONTROL_URL to your control plane and run this again."]}:r===401||r===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${De}.`,"A token from one environment is refused by another, so check which one you signed into."]}:{access:"unknown",problem:"unreachable",reason:`Could not reach the control plane at ${De}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Fi(e){switch(e.access){case"approved":return{ok:!0,status:"approved",access:"approved",heading:"Approved",message:"Your account is approved, so every command works, including deploy.",next:["`gamestage status` shows the workspace, its games and what they are using."]};case"pending":return{ok:!0,status:"pending_approval",access:"pending",code:Vg,heading:"Registered, waiting for approval",message:"You are registered and your account is waiting for approval. That is the normal path for a new account, and approval is a person's decision today.",next:["Nothing is wrong and nothing is lost. There is no second form to fill in.","Inspecting a prototype, scaffolding a game and writing a round all work now and need no approval.","`gamestage status` re-checks approval. It never opens the browser again."]};case"refused":return{ok:!0,status:"access_refused",access:"refused",heading:"Access refused",message:"This account has been refused access. Signing in worked, so this is a decision about the account rather than a broken token.",next:["Nothing in the CLI changes this, and running `gamestage login` again will not.","Inspecting, scaffolding and writing a round still work and need no account.",`If you think this is wrong, say so where you registered: ${Ut}.`]};case"unreported":return{ok:!0,status:"access_not_reported",access:null,heading:"Signed in",message:"This control plane answered and does not report an access state, so whether this account is approved is not known here.",next:["It predates the access state rather than being broken, so carry on.","A deploy that is refused for approval will say so in its own words."]};default:return{ok:!1,status:e.problem==="no_control_plane"?"no_control_plane":e.problem==="token_refused"?"token_refused":"control_plane_unreachable",access:null,heading:"Signed in, and the control plane is not usable",message:e.reason,next:e.detail}}}function jE(e){return!e.changed&&e.refused?{ok:!0,status:"refused_by_store",access:e.access,code:e.code,heading:"Not approved",message:e.refused,next:["Nothing was written. When they have accepted the terms, run this again."]}:e.changed?e.access==="approved"?{ok:!0,status:"approved",access:"approved",heading:"Approved",message:`${e.workspaceId} was ${e.previous} and is now approved.`,next:["Their next `gamestage status` says approved, and deploy works from then on."]}:{ok:!0,status:"refused",access:"refused",heading:"Refused",message:`${e.workspaceId} was ${e.previous} and is now refused.`,next:["Their next `gamestage status` says refused, and says how to argue with it."]}:{ok:!0,status:"unchanged",access:e.access,heading:"No change",message:`${e.workspaceId} was already ${e.previous}. Nothing was written.`,next:["No audit record either: the trail records transitions, and this was not one."]}}function bo(e){if(U(e.heading),g(` ${e.message}`),e.next.length){g();for(let t of e.next)E(t)}g()}function ME(e,t,r){let o=a=>{let s=a.trim().toLowerCase();return io.options.find(d=>d===s||Pi[d].toLowerCase()===s)},n=io.options.map(a=>`${a} (${Pi[a]})`).join(", "),i=o(t);return i?r===void 0?{request:{workspaceId:e,tier:i}}:!/^\d+$/.test(r)||Number(r)>1e4?{problem:`"${r}" is not a live-game allowance.`,detail:["Give a whole number from 0 to 10000, where 0 means no ceiling.","Nothing has been changed."]}:{request:{workspaceId:e,tier:i,allowance:Number(r)}}:o(e)?{problem:"The workspace comes first and the plan second.",detail:[`Try: ${ie(`admin plan ${t} ${e}`)}`,"Nothing has been changed."]}:{problem:`"${t}" is not a plan.`,detail:[`Use one of: ${n}.`,"Nothing has been changed."]}}function go(e){let t=Pi[e.tier];if(e.liveGameAllowance===void 0)return t;let r=e.liveGameAllowance===0?"no live-game ceiling":`${e.liveGameAllowance} live game${e.liveGameAllowance===1?"":"s"}`;return`${t}, ${r}`}function UE(e){let{request:t,previous:r,result:o,stored:n}=e,i=go({tier:t.tier,liveGameAllowance:t.allowance}),a={previous:r,stored:n};return o.refused?{...a,status:"refused_by_store",exitCode:0,heading:"Not changed",message:o.refused,next:["Nothing was written."]}:n?n.tier===t.tier&&(t.allowance===void 0||n.liveGameAllowance===t.allowance)?r!==null&&r.tier===n.tier&&r.liveGameAllowance===n.liveGameAllowance?{...a,status:"unchanged",exitCode:0,heading:"No change",message:`${t.workspaceId} was already on ${go(n)}, and still is.`,next:[Kg]}:{...a,status:"set",exitCode:0,heading:"Plan set",message:`${t.workspaceId} is on ${go(n)}, read back from the control plane after the write.`,next:[Kg]}:{...a,status:"not_what_was_asked",exitCode:1,heading:"Not what was asked",message:`${t.workspaceId} was sent ${i} and holds ${go(n)}. The write reported success, and the stored workspace disagrees with it.`,next:["Run it again to see whether the second read agrees. If it still disagrees, that is a control-plane defect to raise, not an operator mistake."]}:{...a,status:"unconfirmed",exitCode:2,heading:"Sent, and not confirmed",message:`The control plane accepted ${t.workspaceId} moving to ${i}, and could not then be asked what it kept: ${e.unreadable??"no reason given"}.`,next:["Treat the plan as unknown rather than set. Run this again once the control plane answers reads; repeating the same plan is safe.",Kg]}}function zE(e){if(U(e.heading),g(` ${e.message}`),g(),R("Before",e.previous?go(e.previous):"could not be read"),R("Stored now",e.stored?go(e.stored):"could not be read"),e.next.length){g();for(let t of e.next)E(t)}g()}function Ce(e){let t=[],r=e.status,o=e.code;if(o===Vg){let n=Fi({access:"pending"});J()?te({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):bo(n),process.exit(0)}r===401?t.push("Your session has expired. Run `gamestage login` again."):r===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):r===429?t.push("You are being rate limited. Wait a moment and try again."):e.retryable&&t.push("This one is worth retrying: the failure was at our end."),o&&t.push(`Code: ${o}`),t.push(`Control plane: ${De}`),K(e instanceof Error?e.message:"The control plane call failed.",t)}var De,Vg,Kg,At=w(()=>{"use strict";we();yr();Ne();Kc();De=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";Vg="access_pending";Kg="This does not re-provision. A live round keeps the caps it was provisioned with, including its day cap, until the game is deployed again, so a creator refused before this is refused the same way until they redeploy with `gamestage deploy`. That is not this change failing."});function LR(e,t){let o=new RegExp(`id="${t}"[^>]*>([^<]*)<`).exec(e)?.[1]?.replace(/\s+/g," ").trim();return o||void 0}function DR(e,t){return new RegExp(`${t}:\\s*el\\("([a-z0-9-]+)"\\)`).exec(e)?.[1]}function BE(e,t,r){let o=new Set(Di()),n={},i=(s,d)=>{d&&o.has(s)&&(n[s]=d)};i("display_name",t.trim());let a=DR(e,"playButtonLabel");a&&i("play_button_label",LR(e,a)),r&&i("how_to_play",RR[r]);for(let[s,d]of Yg(e))i(`css_variables_${s}`,d);return i("primary_colour",jR(e)),n}function Yg(e){let t=WE(e),r=new Map;for(let o of e.matchAll(/var\(--gs-([A-Za-z]+)\s*,/g)){if(r.has(o[1]))continue;let n=0,i=o.index;for(let s=o.index;s<e.length;s++)if(e[s]==="(")n++;else if(e[s]===")"&&--n===0){i=s+1;break}let a=t(e.slice(o.index,i));a&&r.set(o[1],a)}return r}function jR(e){return/var\(--gamestage-primary\s*,\s*(#[0-9A-Fa-f]{3,8})\s*\)/.exec(e)?.[1]?.toUpperCase()}function WE(e){let t=new Map;for(let o of e.matchAll(/(--[A-Za-z0-9-]+)\s*:\s*([^;}]+)/g))t.has(o[1])||t.set(o[1],o[2].trim());let r=(o,n=0)=>{if(n>12)return;let i=o.trim(),a=/^#[0-9A-Fa-f]{3,8}$/.exec(i);if(a)return a[0].toUpperCase();let s=/^var\(\s*(--[A-Za-z0-9-]+)\s*(?:,\s*([\s\S]*))?\)$/.exec(i);if(!s)return;let[,d,l]=s;if(!d.startsWith("--gs-")){let p=t.get(d),h=p?r(p,n+1):void 0;if(h)return h}return l?r(l,n+1):void 0};return r}function KE(e){let t=/(?:^|[\s}])body\s*\{([^}]*)\}/.exec(e),r=t?/background(?:-color)?\s*:\s*([^;}]+)/.exec(t[1])?.[1]?.trim():void 0;return r?WE(e)(r):void 0}var RR,qg=w(()=>{"use strict";we();RR={hunt:"Find the right ones on the board. A wrong pick costs a try.",push:"Pick one from each line. Get as close to the limit as you dare without going over.",group:"Sort the board into its groups. A wrong group costs a life.",predict:"Call what will happen before it does. You score when you are right.",bingo:"Lock your board, then mark each square as it happens. A full line scores.",shoot:"Pick a spot and a power, then shoot. The keeper decides the rest."}});import{readFile as BR}from"node:fs/promises";import{dirname as WR,join as KR}from"node:path";async function _o(e){let t=KR(WR(e),wo),r;try{r=await BR(t,"utf8")}catch{return{path:t,problems:[]}}let o;try{o=JSON.parse(r)}catch(i){return{path:t,problems:[`${wo} is not valid JSON: ${i instanceof Error?i.message:String(i)}`]}}let n=bS(o);return n.length>0?{path:t,problems:n}:{path:t,settings:o,problems:n}}var wo,Wi=w(()=>{"use strict";we();wo="gamestage.settings.json"});async function Ki(e,t){let r=t.referenceName;if(r)try{let{datasets:o}=await e.listDatasets(),n=o.find(s=>s.name===r),i=n?.supplier?FS(n.supplier):void 0,a=i?Mi(i):void 0;return!i||!a?void 0:{dataset:r,source:i.label,caveat:a}}catch{return}}function Hi(e){!e||J()||(U("This game's data comes from an unofficial source"),E(`It is scored on ${e.dataset}, from ${e.source}.`),E(e.caveat),g())}var Jg=w(()=>{"use strict";we();Ne()});import{open as YR,readFile as JE}from"node:fs/promises";import{createHash as qR}from"node:crypto";import{gunzipSync as JR}from"node:zlib";function e1(e){for(let{pattern:t,what:r}of QR)if(t.test(e))return r}function Qg(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||XR.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function QE(e,t){let r;try{r=await YR(e,"r")}catch{return}try{let{size:o}=await r.stat();if(o<=t){let s=Buffer.alloc(o);return o>0&&await r.read(s,0,o,0),s}let n=Math.floor(t/2),i=Buffer.alloc(n),a=Buffer.alloc(n);return await r.read(i,0,n,0),await r.read(a,0,n,o-n),Buffer.concat([i,Buffer.from(`
|
|
11118
|
+
`),a])}catch{return}finally{await r.close()}}async function n1(e){return(await QE(e,XE))?.toString("latin1")}async function Vi(e){let t=await QE(e,XE);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await JE(e);t=JR(s,{maxOutputLength:t1})}catch{}if(t.byteLength>=2){if(t[0]===255&&t[1]===254)return t.toString("utf16le");if(t[0]===254&&t[1]===255)return t.swap16().toString("utf16le")}let r=t.subarray(0,8192);if(!r.includes(0))return t.toString("utf8");let o=0,n=0,i=0;for(let s=0;s<r.length;s+=1)r[s]===0&&(i+=1,s%2===0?o+=1:n+=1);let a=Math.floor(r.length/2);if(a>8){if(n>a*.7&&o<a*.1)return t.toString("utf16le");if(o>a*.7&&n<a*.1)return t.swap16().toString("utf16le")}if(i<=8&&i*20<r.length)return t.toString("utf8").split("\0").join("")}function r1(e){let t=Fe(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function ko(e,t){if(t.archetype==="hunt"){let n=t.targets;if(n.length===0)return[];let i=n.filter(a=>new RegExp(`["'\`]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["'\`]`,"i").test(e));return i.length===n.length?i:[]}if(t.archetype==="predict")return[];if(t.archetype==="bingo")return t.cardPool.length<2?[]:e.split(`
|
|
11119
11119
|
`).some(i=>t.cardPool.every(a=>new RegExp(`["\`']${a.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(i)))?t.cardPool.map(i=>i.label):[];if(t.archetype==="group"){let n=[];for(let i of t.groups){if(new RegExp(`["\`']${i.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(e)){n.push(i.label);continue}e.split(`
|
|
11120
11120
|
`).some(d=>i.members.every(l=>new RegExp(`["\`']${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(d)))&&n.push(i.label)}return n}if(t.archetype==="shoot")return[];if(t.archetype==="place"){let n=a=>new RegExp(`["\`']${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i"),i=[];for(let a of t.qualifies){if(a.cells.length===0)continue;e.split(`
|
|
11121
|
-
`).some(d=>n(a.item).test(d)&&a.cells.every(l=>n(l).test(d)))&&i.push(a.item)}return i}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`\\b(?:${a})\\b[^\\n]{0,120}?\\b${i.value}\\b`,"i"),d=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?\\b(?:${a})\\b`,"i");(s.test(e)||d.test(e))&&o.push(i.label)}return o}function xo(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;if(e.archetype==="place")return`The page holds which cells a card fits: ${t.join(", ")}. A player who reads it can fill the board without knowing a face, which is the game.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function i1(e){try{return JSON.parse(e)}catch{}try{let t=jx(e);return typeof t=="object"?t:void 0}catch{return}}function a1(e){let t=i1(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,d]of Object.entries(i)){if(o1.has(s.toLowerCase())){r=s;return}n(d,a+1)}}};return n(t,0),r}function s1(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Jg+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(p=>p.split(r)),n=o[0].length,i=o.filter(p=>p.length===n);if(n<2||i.length<o.length*.95||i.length<Jg+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),d=!1,l=!1;for(let p=0;p<s;p+=1){let h=a.map(m=>m[p].trim());h.every(m=>m.length>0&&/^-?\d+(\.\d+)?$/.test(m))?d=!0:h.every(m=>m.length>0&&!/^-?\d+(\.\d+)?$/.test(m))&&(l=!0)}if(d&&l)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=Jg&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function d1(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&l1.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:c1.has(t.slice(r+1))}function p1(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>u1.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function h1(e){if(e.relativePath!==Re)return;let t;try{t=await qE(e.path)}catch{return}if(qR("sha256").update(t).digest("hex").slice(0,16)!==Xt)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function QE(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),d;for(let l of e){let p=p1(l.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await h1(l);if(h){d??=h;continue}if(s.has(l.relativePath)){r.push(l);continue}let m=await Qg(l,t.round);if(!m){r.push(l);continue}if(m.confidence==="suspected"&&a.has(l.relativePath)){n.push(m),r.push(l);continue}if(m.alwaysWithheld||d1(l.relativePath)){o.push(m);continue}d??=m}return{publish:r,withheld:o,allowed:n,walkedPast:i,...d?{refuse:d}:{}}}async function Qg(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(Xg(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await Vi(e.path);if(o!==void 0){let i=e1(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=r1(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=ko(o,t);if(s.length)return r(xo(t,s),"certain")}}if(t&&o===void 0){let i=await n1(e.path);if(i!==void 0){let a=ko(i,t);if(a.length)return r(xo(t,a),"certain")}}if(o===void 0)return;let n=a1(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(s1(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var XR,QR,JE,t1,o1,Jg,c1,l1,u1,Vc=w(()=>{"use strict";kc();we();pn();XR=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),QR=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];JE=8e6,t1=32e6;o1=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Jg=20;c1=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),l1=new Set(["gz","br","zst","zz"]);u1=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function Zc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Re||o===Ve)continue;let n=await Vi(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var ey=w(()=>{"use strict";pn();Vc()});import{lstatSync as m1,readdirSync as f1}from"node:fs";import{relative as g1,resolve as eT,sep as y1}from"node:path";function Yc(e){let t=e.split("/").pop()??e;return b1.has(t)||t.startsWith(".env.")}function Zi(e,t={}){let r=t.symlinks??"throw",o=eT(e),n=[],i=[],a=[];function s(d){for(let l of f1(d,{withFileTypes:!0}).sort((p,h)=>p.name.localeCompare(h.name))){let p=eT(d,l.name),h=g1(o,p).split(y1).join("/");if(l.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${h}`);i.push(h);continue}if(l.isDirectory())s(p);else if(l.isFile()){if(Yc(h)){a.push(h);continue}n.push({path:p,relativePath:h})}}}if(!m1(o).isDirectory())throw new Error(`${e} is not a directory.`);return s(o),{files:n,skippedLinks:i,withheld:a}}function tT(e){return Zi(e,{symlinks:"throw"}).files}function nT(e,t=[]){let r=[],o=new Map;for(let i of e){let a=i.relativePath;if(!v1.test(a)||w1.test(a)){r.push(a);continue}let d=a.lastIndexOf("/"),l=d===-1?".":a.slice(0,d);o.set(l,(o.get(l)??0)+1)}let n=[];for(let i of r.sort())n.push(i);for(let[i,a]of[...o].sort(([s],[d])=>s.localeCompare(d))){let s=i==="."?"the directory root":`${i}/`;n.push(`${a} ${a===1?"file":"files"} in ${s}`)}for(let i of[...t].sort())n.push(`withheld: ${i}`);return{lines:n,named:r}}var b1,v1,w1,qc=w(()=>{"use strict";b1=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs","gamestage.settings.json"]);v1=/\.(html?|css|js|mjs|cjs|map|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf|mp3|mp4|webm|txt|md)$/i,w1=/(^|\/)(\.|_)|(^|\/)[^/]*(secret|credential|password|token|key|\.pem|\.p12|\.pfx|backup|\.bak|answers?|solution)[^/]*$/i});import{createHash as _1}from"node:crypto";function Yi(e){return _1("sha256").update(e,"utf8").digest()[0]&127}var Jc,ty=w(()=>{"use strict";Jc=128});import{createHmac as rT,randomBytes as k1,timingSafeEqual as x1}from"node:crypto";function Xc(e){return e.startsWith(ny)}function qi(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${ny}${t||"unknown"}`}async function iT(e){if(!e.token)return e.sessionSecret?{playerId:S1(e.anonymousId,e.sessionSecret)??qi(void 0)}:{playerId:qi(e.anonymousId)};let t=e.resolver??oT,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:qi(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function sT(e){let t=`${ny}${k1(16).toString("base64url")}`;return{playerId:t,token:ry(t,e)}}function cT(e,t){return rT("sha256",t).update(e).digest("base64url")}function ry(e,t){return`${e}${aT}${cT(e,t)}`}function S1(e,t){if(!e)return;let r=e.lastIndexOf(aT);if(r<=0)return;let o=e.slice(0,r);if(!Xc(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(cT(o,t));if(n.length===i.length)return x1(n,i)?o:void 0}function lT(e,t){return rT("sha256",t).update(`gamestage-recovery\0${e}`).digest("base64url")}var ny,oT,aT,Qc=w(()=>{"use strict";ny="anon:";oT={async resolve(){}};aT="."});function Gn(e){return e instanceof Error?e.name:"unknown"}function mn(e){console.error(E1,e)}function dT(e,t){console.error(T1,{violation:e,...t})}var E1,T1,el=w(()=>{"use strict";E1="engine_error",T1="engine_integrity_violation"});function uT(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function $1(e){let t=Ji[uT(`a:${e}`)%Ji.length],r=Xi[uT(`n:${e}`)%Xi.length];return`${t} ${r}`}function tl(e,t){return t?.trim()||$1(e)}function pT(e,t){if(Ji.includes(e)&&Xi.includes(t))return`${e} ${t}`}var Ji,Xi,oy=w(()=>{"use strict";Ji=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],Xi=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});function nl(e){if(e)return Qi.some(t=>t.id===e)?e:C1[e]}function iy(e){let t=nl(e);return t?Qi.find(r=>r.id===t)?.url:void 0}function hT(e){return Qi.some(t=>t.id===e)}var A1,I1,Qi,C1,mT=w(()=>{"use strict";A1="https://gamestage.ai",I1=["peep-afro-smile","peep-bald-sunglasses","peep-bangs-cute","peep-beanie-beard","peep-bun-glasses","peep-buns-happy","peep-cap-smile","peep-cornrows-calm","peep-curly-glasses","peep-dreads-driven","peep-flattop-serious","peep-gray-moustache","peep-graybun-smile","peep-hijab-grin","peep-knots-awe","peep-long-smile","peep-longafro-closed","peep-medium-suspicious","peep-mohawk-lol","peep-pomp-cheeky","peep-shaved-beard","peep-short-sunglasses","peep-turban-beard","peep-twists-grin"],Qi=I1.map(e=>({id:e,url:`${A1}/avatars/${e}.svg`})),C1={"nigiri-salmon":"peep-afro-smile","nigiri-tuna":"peep-bun-glasses","nigiri-tamago":"peep-beanie-beard","maki-roll":"peep-hijab-grin","california-roll":"peep-mohawk-lol",futomaki:"peep-gray-moustache",temaki:"peep-dreads-driven",onigiri:"peep-bangs-cute","ramen-bowl":"peep-turban-beard","miso-soup":"peep-bald-sunglasses",udon:"peep-knots-awe",gyoza:"peep-curly-glasses",edamame:"peep-pomp-cheeky","tempura-prawn":"peep-cornrows-calm",takoyaki:"peep-graybun-smile",sashimi:"peep-cap-smile","chopsticks-rest":"peep-twists-grin","soy-sauce":"peep-flattop-serious","sake-set":"peep-medium-suspicious",mochi:"peep-buns-happy"}});import{createHash as P1}from"node:crypto";function Ot(e){return OS({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function fT(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function rl(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function O1(e){return P1("sha256").update(Tc(e)).digest("hex")}function yT(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),d=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=T=>T;function p(T,_){return!n.settle||!T.round.can.results_available||_.outcome!=="pending"?_:n.settle({secret:T.secret,state:_,limits:T.limits,now:i()})}function h(T){if(!T.fusedUntil)return 0;let _=Math.ceil((Date.parse(T.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(_)&&_>0?_:0}async function m(T,_){let b=e.fuse?.note(t,Yi(r),_);if(!b)return;let v=new Date(Date.parse(i())+b.holdSeconds*1e3).toISOString();if(b.kind==="stop")try{await o.setFuse(t,T,v)}catch(j){mn({event:"fuse_write_failed",tenant:t,round_id:T,name:Gn(j)})}try{await e.onFuse?.({...b,until:v})}catch(j){mn({event:"fuse_notify_failed",tenant:t,round_id:T,name:Gn(j)})}}function y(T){let _=h(T)>0,b=rl({limits:T.limits,now:i()});return!_&&!b?T.round:{...T.round,can:{...T.round.can,accepting_plays:!1}}}function x(T,_){let b=T.round.number??Number.POSITIVE_INFINITY,v=_.round.number??Number.POSITIVE_INFINITY;return b!==v?b-v:T.round.id.localeCompare(_.round.id)}async function O(T){let _=T.round.id,b=await o.getState(t,_,r);return b?{state:b.state,version:b.version}:{state:{...n.initialState({playerId:r,roundId:_,limits:T.limits,now:i(),round:T.round,secret:T.secret}),started_at:i()},version:void 0}}async function M(T,_,b,v){if(_.timerSeconds===void 0||v!==void 0)return b;try{if(await o.putStateIfVersion(t,b,void 0))return b}catch(Y){return mn({event:"round_open_write_failed",tenant:t,round_id:T,name:Gn(Y)}),b}return(await o.getState(t,T,r))?.state??b}let H=(T,_,b)=>({...d(),play_id:s(),outcome:T,reason:_,round_version:b,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...d()}},async getCurrentRound(){let T=await o.getCurrentRound(t);if(!T)throw new Error(ay);return{...y(T),...d()}},async getRound(T){let _=await o.getRound(t,T);return _?{...y(_),...d()}:void 0},async getRoundPool(){let[T,_]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),b=_?.round.id,v=[...T].sort(x).map(j=>{let Y=y(j);return{id:Y.id,number:Y.number,version:Y.version,can:Y.can,opens_at:Y.opens_at,locks_at:Y.locks_at,current:Y.id===b,theme:typeof Y.challenge?.theme=="string"?Y.challenge.theme:""}});return{...d(),rounds:v}},async getPlayedRounds(){let T=await o.listStatesForPlayer(t,r);return{...d(),player_id:r,played:T.map(_=>({round_id:_.round_id,finished:_.finished,score:_.score,outcome:_.outcome,..._.server_time?{last_played_at:_.server_time}:{}})).sort((_,b)=>_.round_id.localeCompare(b.round_id))}},async getNextRound(){let[T,_]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),b=new Set(_.filter(X=>X.finished).map(X=>X.round_id)),v=new Set(_.map(X=>X.round_id)),j=[...T].filter(X=>y(X).can.accepting_plays&&!b.has(X.round.id)).sort(x),Y=j.find(X=>!v.has(X.round.id))??j[0];return Y?{...d(),status:"ready",round:{...y(Y),...d()}}:{...d(),status:"exhausted"}},async getRoundState(T){let _=await o.getRound(t,T);if(!_)throw new Error(ay);let b=l(_),{state:v,version:j}=await O(b),Y=await M(T,b.limits,v,j),X=p(b,Y);return X!==Y&&X.finished&&await o.recordScore(t,T,r,X.score),{...X,...d()}},async getProfile(){let T=await o.getProfile(t,r),_=(await o.getIdentities(t,[r]))[r],b=_?.avatar??T.avatar;return{...T,display_name:tl(r,_?.display_name??T.display_name),...b?{avatar:nl(b),avatar_url:iy(b)}:{},...d()}},getIdentityOptions(){return{adjectives:[...Ji],animals:[...Xi],avatars:Qi.map(T=>({...T})),...d()}},async setIdentity(T){let _;return T.name&&(_=pT(T.name.adjective,T.name.animal),!_)?{ok:!1,reason:"That name is not one of the offered words. Choose from the lists."}:T.avatar!==void 0&&!hT(T.avatar)?{ok:!1,reason:"That avatar is not one of the offered pictures."}:(await o.setIdentity(t,r,{..._?{display_name:_}:{},...T.avatar?{avatar:T.avatar}:{}}),{ok:!0,profile:await this.getProfile()})},async recordRecoveryDigest(T,_){if(!Xc(r))return{ok:!1,reason:"Only a player who has not signed in can have a recovery code."};let{replaced:b}=await o.putRecoveryDigest(t,r,T,_);return{ok:!0,replaced:b}},async getRecoveryStatus(){let T=await o.recoveryIssuedAt(t,r);return{has_code:!!T,issued_at:T??null}},playerForRecoveryDigest(T){return o.playerForRecoveryDigest(t,T)},async getLeaderboard(T){let _=await o.getCurrentRound(t),b=_?.round.id??"",v=_?.limits,j=await o.getLeaderboard(t,b,{limit:T,viewerId:r,order:v?.scoreOrder??"high_first"}),Y=[...j.entries.map(me=>me.player_id),...j.me?[j.me.player_id]:[]],X=Y.length?await o.getIdentities(t,Y):{},se=me=>{let ye=X[me.player_id];return ye?{...me,...ye.display_name?{display_name:ye.display_name}:{},...ye.avatar?{avatar:nl(ye.avatar),avatar_url:iy(ye.avatar)}:{}}:me};return{...j,entries:j.entries.map(se),...j.me?{me:se(j.me)}:{},...d()}},async play(T,_){let b=await o.getRound(t,T);if(!b)return H("rejected",ay,0);let v=l(b);if(e.runtime.identity?.required&&Xc(r))return H("rejected",e.identityRefusal??"identity_required",v.round.version);if(h(v)>0)return{...H("busy","fair_use",v.round.version),retry_after_seconds:h(v)};if(v.limits.playsPerSecond!==void 0){let Se=i().slice(0,19),Be=await o.countPlay(t,T,Se,r,3600),kt=Math.max(1,Math.ceil(v.limits.playsPerSecond/Be.buckets));if(Be.inBucket>kt)return await m(T,Se),{...H("busy","capped",v.round.version),retry_after_seconds:1}}if(v.limits.playsPerDay!==void 0){let Se=i().slice(0,10);if(await o.countGameDay(t,T,Se,fT(i())+3600)>v.limits.playsPerDay)return await m(T,Se),{...H("busy","capped_today",v.round.version),retry_after_seconds:fT(i())}}let j=O1({round_id:T,round_version:_.round_version,challenge_instance_id:_.challenge_instance_id,payload:_.payload}),Y=Se=>Se.intent!==void 0&&Se.intent.fingerprint!==j,X=await o.getPlay(t,r,_.idempotency_key);if(X)return Y(X)?H("rejected",gT,v.round.version):{...X.result,...d(),outcome:"duplicate"};let se=Yx(_.payload,n.archetype),me=se!==void 0&&(n.operations?n.operations.includes(se):qx(n.archetype,se));if(_.payload.op!==void 0&&!me)return H("rejected","unknown_operation",v.round.version);let{state:ye,version:pt}=await O(v),wt=n.admissible({accepting:v.round.can.accepting_plays,roundVersion:v.round.version,playedVersion:_.round_version,challengeInstanceId:v.round.challenge_instance_id??null,playedChallengeInstanceId:_.challenge_instance_id??null,state:ye,secret:v.secret,limits:v.limits,now:i()});if(!wt.ok){let Se=wt.reason==="round_version"?"stale":"rejected";return H(Se,wt.reason,v.round.version)}if(rl({limits:v.limits,now:i()}))return H("rejected","lock_deadline_passed",v.round.version);let le=n.mark({payload:_.payload,secret:v.secret,state:ye,limits:v.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(le.outcome!=="accepted")return H("rejected",le.reason??"rejected",v.round.version);let he={...d(),play_id:s(),outcome:le.outcome,round_version:v.round.version,marked:le.marked,feedback:le.feedback,round_state:{...le.next,...d()}},Q=`play:${JSON.stringify([t,r,_.idempotency_key])}`,_t=[{id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.committed",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,outcome:he.outcome,marked:he.marked,round_version:he.round_version,score_before:ye.score,score_after:le.next.score,attempts_used:le.next.attempts_used,attempts_allowed:le.next.attempts_allowed,mistakes_used:le.next.mistakes_used,mistakes_allowed:le.next.mistakes_allowed,...n.auditDetail({secret:v.secret,before:ye,decision:le,payload:_.payload})}}],Ze=le.marked&&(le.participation?.score??!0),bn=le.participation?.profile??!0;Ze&&_t.push({id:`score:${JSON.stringify([t,r,_.idempotency_key])}`,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"score.recorded",detail:{play_id:he.play_id,score_before:ye.score,score_after:le.next.score,marked:!0,outcome:le.next.outcome}});let ht=bn&&le.next.finished&&!ye.finished?Ec(await o.getProfile(t,r),le.next.outcome,{...Ze?{score:le.next.score}:{},exact:le.next.progress?.exact===!0}):void 0,rt=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:_.idempotency_key,date:i().slice(0,10),play:{result:he,intent:{fingerprint:j,round_id:T,round_version:_.round_version}},state:le.next,expectedVersion:pt,audit:_t,...Ze?{score:{roundId:T,score:le.next.score,...le.next.progress?.exact===!0?{exact:!0}:{}}}:{},...ht?{profile:ht}:{},round:{roundId:T,version:v.round.version,sharded:v.sharded===!0}});if(!rt.ok&&rt.reason==="contended")return H("busy","contended",v.round.version);if(!rt.ok&&rt.reason==="play_exists"){let Se=await o.getPlay(t,r,_.idempotency_key);return Se&&Y(Se)?H("rejected",gT,v.round.version):Se?{...Se.result,...d(),outcome:"duplicate"}:(mn({stage:"play_receipt_missing",tenant:t,round_id:T,player_id:r}),H("rejected","play_conflict",v.round.version))}if(!rt.ok&&rt.reason==="round_changed"){let Se=await o.getRound(t,T),Be=Se===void 0||Se.round.version!==v.round.version,kt=Be?"round_changed":"round_closed";return await o.appendAudit({id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.refused",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,reason:kt,decided_against_version:v.round.version,attempt_spent:!1}}),H(Be?"stale":"rejected",kt,Se?.round.version??v.round.version)}return rt.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),he):(await o.appendAudit({id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.refused",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,reason:"round_version",attempt_spent:!1}}),H("stale","round_version",v.round.version))}}}var Nt,gT,ay,Qt=w(()=>{"use strict";ty();Qc();el();oy();mT();we();Nt="time_expired";gT="idempotency_conflict",ay="round_not_found"});function N1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function R1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(v=>r.targets.includes(v)&&!i.has(v)),s=t.picks.filter(v=>!r.targets.includes(v)),d=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let v of a)i.add(v);let p=i.size>=r.required,h=l>=n.mistakesAllowed,m=d>=n.attemptsAllowed,y=p||h||m,x=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),O=r.figures,M={...o.progress.figures??{}};if(O?.perGuess&&!e.markAtSettlement)for(let v of s)v in O.values&&(M[v]=O.values[v]);let H=y&&!e.markAtSettlement,T=H&&O?{answer:r.targets,reveal:[{slate:"board",label:O.label,scale:O.scale,entries:Object.entries(O.values).map(([v,j])=>({key:v,label:v,value:j,...O.sources?.[v]?{source:O.sources[v]}:{}}))}],...r.facts?.length?{facts:r.facts}:{}}:H&&r.facts?.length?{facts:r.facts}:{},_={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],...O?{figures:M,figure_label:O.label,figure_scale:O.scale}:{},...T},score:x,finished:y,outcome:e.markAtSettlement?"pending":p?"won":y?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:_}:{outcome:"accepted",marked:!0,feedback:t.picks.map(v=>({key:v,verdict:r.targets.includes(v)?"correct":"wrong"})),next:_}}function L1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var sy,cy=w(()=>{"use strict";Qt();sy={archetype:"hunt",admissible:N1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return R1({...e,attempt:{picks:t}})},initialState:L1,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function D1(e,t,r,o){let n=e.scoring;if(n?.mode!=="proximity")return{mode:"total"};let i=r?0:Math.floor(t/n.pointsPer),a=!r&&o&&t===e.target?n.exactBonus:0;return{mode:"proximity",per:n.pointsPer,base:i,bonus:a}}function j1(e,t,r,o){let n=e.scoring;if(n?.mode!=="proximity")return r?e.target-t:t;if(r)return 0;let i=Math.floor(t/n.pointsPer);return o&&t===e.target?i+n.exactBonus:i}function M1(e){return e.slates.map(t=>({slate:t.id,label:t.label,entries:t.entries.map(r=>({key:r.key,label:r.label,value:r.value,...r.source?{source:r.source}:{}}))}))}function ly(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function U1(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function z1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function F1(e){let{secret:t,state:r,limits:o}=e,n=ly(r),i=H=>({outcome:"rejected",reason:H,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,d=a.entries.find(H=>H.key===s);if(!d)return i("not_on_slate");let l=n.total+d.value,p=l>t.target,h=[...n.picks,{slate:a.id,key:d.key,label:d.label,value:d.value}],m=r.attempts_used+1,y=m>=o.picksAllowed,x=p||y,O={...r,server_time:e.now,attempts_used:m,attempts_allowed:o.picksAllowed,progress:{total:l,picks:h,bust:p,...x?{tier:U1(t,l),exact:!p&&l===t.target,reveal:M1(t),...t.facts?.length?{facts:t.facts}:{},points:D1(t,l,p,x)}:{}},score:e.markAtSettlement?r.score:j1(t,l,p,x),finished:x,outcome:e.markAtSettlement?"pending":p?"lost":x?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:O}:{outcome:"accepted",marked:!0,feedback:[{key:d.key,verdict:p?"wrong":"correct",label:String(d.value)}],next:O}}function G1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var dy,uy=w(()=>{"use strict";Qt();dy={archetype:"push",admissible:z1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return F1({...e,attempt:{picks:t}})},initialState:G1,auditDetail({secret:e,before:t,decision:r}){let o=ly(t),n=ly(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function K1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function H1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(v=>!i.has(v.key)),d=s.find(v=>B1(v.members,t.picks)),l=o.attempts_used+1,p=o.mistakes_used+(d?0:1);d&&(i.add(d.key),a.push({key:d.key,label:d.label,members:[...d.members]}));let h=i.size>=r.groups.length,m=p>=n.mistakesAllowed,y=l>=n.attemptsAllowed,x=h||m||y,O=e.markAtSettlement?o.score:o.score+(d?r.pointsPerGroup:0)+(h?r.completionBonus:0),M={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:p,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:O,finished:x,outcome:e.markAtSettlement?"pending":h?"won":x?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:M};let H=s.reduce((v,j)=>Math.max(v,W1(t.picks,j)),0),T=!d&&t.picks.length>1&&H===t.picks.length-1,_=d?"correct":T?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((v,j)=>({key:v,verdict:_,...d&&j===0?{label:d.label}:{}})),next:M}}function V1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var B1,W1,bT,vT=w(()=>{"use strict";Qt();B1=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,W1=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;bT={archetype:"group",admissible:K1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return H1({...e,attempt:{picks:t}})},initialState:V1,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function Z1(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function Y1(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function q1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function J1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=Z1(r,t),a=o.attempts_used+1;if(r.questions.filter(p=>i[p.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let d=r.questions.find(p=>!Y1(p,i[p.id]));if(d)return{outcome:"rejected",reason:d.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let l={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(p=>p.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...l,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:X1(r,i),next:wT(r,l,i)}}function X1(e,t){return e.questions.map(r=>{let o=t[r.id],n=bc(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function wT(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=bc(i,r[i.id],e.pointsForCorrect);o+=a,a!==bc(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function Q1(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=eL(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...wT(t,r,o),server_time:e.now}}function eL(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function tL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var _T,kT=w(()=>{"use strict";we();Qt();_T={archetype:"predict",admissible:q1,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return J1({...e,attempt:r?{answers:r}:{pick:o}})},initialState:tL,settle:Q1,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function nL(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function py(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function rL(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function oL(e){let t=py(e),r=rL(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function iL(e){let t=nL(e),r=[...e.cardPool],o=[],n={},i={};for(let a=0;a<t&&r.length>0;a++){let s=Math.floor(Math.random()*r.length),d=r.splice(s,1)[0];o.push(d.key),n[d.key]=d.label,d.note&&(i[d.key]=d.note)}return{board:o,cards:n,notes:i}}function xT(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function aL(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,d=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let m=p*o+h,y=i&&m>a*o+s?1:0;return t.cells[m-y]},l=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)l.push(Array.from({length:o},(m,y)=>d(h,y)).filter(m=>!!m));else if(p==="column")for(let h=0;h<o;h++)l.push(Array.from({length:r},(m,y)=>d(y,h)).filter(m=>!!m));else if(p==="diagonal"&&r===o)l.push(Array.from({length:r},(h,m)=>d(m,m)).filter(h=>!!h)),l.push(Array.from({length:r},(h,m)=>d(m,r-1-m)).filter(h=>!!h));else if(p==="full_board"){let h=[...t.cells,...t.centre?[t.centre]:[]];l.push(h)}return l.filter(p=>p.length>0)}function sL(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:rl({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function cL(e){let{secret:t,state:r,limits:o}=e;if(py(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={},s={};for(let d=0;d<n;d++){let l=iL(t);i.push(l.board),Object.assign(a,l.cards),Object.assign(s,l.notes)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a,...Object.keys(s).length>0?{notes:s}:{}}}}}function lL(e){let{secret:t,state:r}=e,o=py(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function dL(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=oL(r);if(o===void 0)return r;let n=aL(t,o),i=n.filter(m=>xT(m,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(m=>t.cardStatus?.[m]==="correct"),d=a.some(m=>t.cardStatus?.[m]===void 0),l=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let m of a){let y=t.cardStatus?.[m];y&&(p[m]=y)}let h=n.map(m=>{let y=xT(m,t.cardStatus),x=m.filter(M=>t.cardStatus?.[M]==="correct").length,O=m.some(M=>t.cardStatus?.[M]==="incorrect");return{cards:m,complete:y,oneAway:!y&&!O&&x===m.length-1}});return{...r,server_time:e.now,score:l,progress:{...r.progress,marks:p,lines:h},outcome:d?"pending":i>0||s?"won":"lost"}}function uL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function pL(e){return e.op==="deal"||e.op==="reshuffle"?cL({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?lL({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var ST,ET=w(()=>{"use strict";Qt();ST={archetype:"bingo",admissible:sL,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:pL({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:uL,settle:dL,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as hL}from"node:crypto";function ea(e,t,r){return hL("sha256",Buffer.from(e.entropy,"hex")).update(["gamestage-shoot",t,e.roundId,e.playerId,e.model,e.profile,String(e.shotIndex)].join("|")).digest().readUInt32BE(0)%r}function $T(e){let t=TT[e.profile];return{targetX:ea(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:ea(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:ea(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:ea(e,"dispersion_x",2001)-1e3,dispersionY:ea(e,"dispersion_y",2001)-1e3}}function AT(e,t,r){let o=TT[r],n=Zt,i=n.ballRadius,a=o.maxFlightMs-Math.floor((o.maxFlightMs-o.minFlightMs)*e.power/1e3),s=o.baseSpread+Math.floor(o.spreadPerPower*e.power/1e3),d=e.aimX+Math.trunc(t.dispersionX*s/1e3),l=Math.max(i,e.aimY+Math.trunc(t.dispersionY*s/1e3)),p=100+Math.floor((1e3-e.power)/5),h=Math.max(0,a-t.reactionMs),m=Math.floor(h*o.speedPerSecond/1e3),y=t.targetX-n.keeperStart.x,x=t.targetY-n.keeperStart.y,O=Math.round(Math.hypot(y,x)),M=O===0?0:Math.min(1,m/O),H=n.keeperStart.x+Math.trunc(y*M),T=n.keeperStart.y+Math.trunc(x*M),_={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:H,endY:T,diveStartMs:t.reactionMs},b={endX:d,endY:l,arcHeight:p},v=(ye,pt)=>({result:ye,replay:{flightMs:a,ball:b,keeper:_,contact:pt}}),j=Math.abs(d),Y=j+i>=n.postX&&j-i<=n.postX+n.postWidth&&l-i<=n.barY+n.barHeight,X=l+i>=n.barY&&l-i<=n.barY+n.barHeight&&j-i<=n.postX+n.postWidth;return Y?v("frame",{with:"post",x:Math.sign(d||1)*n.postX,y:l,atMs:a}):X?v("frame",{with:"bar",x:d,y:n.barY,atMs:a}):j+i<n.postX&&l+i<n.barY?Math.abs(d-H)<=o.reachX+i&&Math.abs(l-T)<=o.reachY+i?v("saved",{with:"keeper",x:d,y:l,atMs:a}):v("goal",null):v("wide",null)}var TT,IT=w(()=>{"use strict";ro();TT={easy_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:180,reactionMaxMs:340,speedPerSecond:1600,reachX:220,reachY:260},balanced_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:120,reactionMaxMs:280,speedPerSecond:2200,reachX:280,reachY:320},hard_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:80,reactionMaxMs:200,speedPerSecond:2800,reachX:320,reachY:360}}});function mL(e,t){let r=e.progress;return{kind:"shoot",model:r.model??t.model,profile:r.profile??t.profile,goals:typeof r.goals=="number"?r.goals:0,shots:Array.isArray(r.shots)?r.shots:[]}}function fL(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function gL(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function yL(e){if(e.code==="unrecognized_keys")return"unexpected_field";let t=String(e.path[0]??"");return t==="op"?"unknown_operation":t==="model"?"unknown_model":t==="aimX"||t==="aimY"?"aim_out_of_range":t==="power"?"power_out_of_range":"invalid_shot"}function bL(e){let{secret:t,state:r,limits:o}=e,n=T=>({outcome:"rejected",reason:T,marked:!1,feedback:[],next:r});if(!fL(t.entropy))return n("entropy_missing");if(t.model!==Nn)return n("unknown_model");let i=ag.safeParse(e.payload.op===void 0?{...e.payload,op:no}:e.payload);if(!i.success)return n(yL(i.error.issues[0]));let a=i.data;if(r.attempts_used>=o.attemptsAllowed)return n("shootout_spent");if(a.shotIndex!==r.attempts_used)return n("shot_index_mismatch");let s=$T({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),d=AT({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),l=mL(r,t),p=d.result==="goal",h=p?t.pointsPerGoal:0,m=l.goals+(p?1:0),y={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:d.result,points:h,replay:d.replay},x=r.attempts_used+1,O=x>=o.attemptsAllowed,M={...r,server_time:e.now,attempts_used:x,attempts_allowed:o.attemptsAllowed,progress:{...l,goals:m,shots:[...l.shots,y]},score:m*t.pointsPerGoal,finished:O,outcome:O?m>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:d.result}],next:M}}function vL(e){let t=e.secret??{};return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{kind:"shoot",model:t.model??Nn,profile:t.profile??Ii,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var CT,PT=w(()=>{"use strict";we();Qt();IT();CT={archetype:"shoot",admissible:gL,mark:bL,initialState:vL,auditDetail({before:e,decision:t,payload:r}){let o=t.next.progress.shots?.at(-1),n=t.outcome==="accepted"&&o!==void 0;return{op:r.op??no,accepted:n,...t.outcome==="rejected"?{refused:t.reason}:{},...n?{shot_index:o.shotIndex,aim_x:o.aimX,aim_y:o.aimY,power:o.power,result:o.result,points:o.points,goals_before:e.progress.goals??0,goals_after:t.next.progress.goals??0}:{}}}}});function wL(e){let t=e.progress;return{kind:"place",filled:typeof t.filled=="number"?t.filled:0,placements:Array.isArray(t.placements)?t.placements:[],skipsUsed:typeof t.skipsUsed=="number"?t.skipsUsed:0}}function _L(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"deck_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function xL(e){let{secret:t,state:r,limits:o}=e,n=wL(r),i=m=>({outcome:"rejected",reason:m,marked:!1,feedback:[],next:r}),a=e.payload.op===void 0?"place":e.payload.op;if(a!=="place"&&a!=="skip")return i("unknown_operation");for(let m of Object.keys(e.payload))if(!kL[a].includes(m))return i("unexpected_field");let s=e.payload.itemIndex;if(typeof s!="number"||!Number.isInteger(s)||s<0)return i("invalid_item");if(s!==r.attempts_used)return i("item_index_mismatch");if(r.attempts_used>=o.attemptsAllowed)return i("deck_spent");let d=(m,y)=>{let x=r.attempts_used+1,O=r.mistakes_used+(y.mistake?1:0),M={...n,...m},H=M.filled>=t.cells.length,T=O>=o.mistakesAllowed,_=x>=o.attemptsAllowed,b=H||T||_,v={...r,server_time:e.now,attempts_used:x,attempts_allowed:o.attemptsAllowed,mistakes_used:O,mistakes_allowed:o.mistakesAllowed,progress:M,score:M.filled*t.pointsPerPlacement+(H?t.fullHouseBonus:0),finished:b,outcome:b?H?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:y.feedback,next:v}};if(a==="skip")return n.skipsUsed>=o.skipsAllowed?i("skips_exhausted"):d({skipsUsed:n.skipsUsed+1},{mistake:!1,feedback:[]});let l=e.payload.cell;if(typeof l!="string"||!t.cells.includes(l))return i("unknown_cell");if(n.placements.some(m=>m.cell===l))return i("cell_filled");let p=t.deck[s];return(p!==void 0&&t.qualifies[p]?.includes(l))??!1?d({filled:n.filled+1,placements:[...n.placements,{itemIndex:s,cell:l}]},{mistake:!1,feedback:[{key:l,verdict:"correct"}]}):d({},{mistake:!0,feedback:[{key:l,verdict:"wrong"}]})}function SL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{kind:"place",filled:0,placements:[],skipsUsed:0},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var kL,OT,NT=w(()=>{"use strict";Qt();kL={place:["op","itemIndex","cell"],skip:["op","itemIndex"]};OT={archetype:"place",operations:["place","skip"],admissible:_L,mark:xL,initialState:SL,auditDetail({before:e,decision:t,payload:r}){let o=t.outcome==="accepted",n=o&&t.feedback[0]?.verdict==="correct";return{op:r.op??"place",accepted:o,...t.outcome==="rejected"?{refused:t.reason}:{},...o?{item_index:typeof r.itemIndex=="number"?r.itemIndex:null,cell:typeof r.cell=="string"?r.cell:null,placed:n,filled_before:e.progress.filled??0,filled_after:t.next.progress.filled??0}:{}}}}});function EL(e){return RT[qe(e)]}function LT(e){return EL(e.archetype??"hunt")}function DT(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var RT,vr,ol=w(()=>{"use strict";we();cy();uy();vT();kT();ET();PT();NT();RT={hunt:sy,push:dy,group:bT,predict:_T,bingo:ST,shoot:CT,place:OT},vr=Object.keys(RT)});function jT(e){let t=LT(e.round);if(t)return yT({...e,rules:t})}var MT=w(()=>{"use strict";Qt();ol();cy();uy();Qt()});function UT(e){let t=new Map,r=new Map,o=(b,v)=>`${v}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,d=new Map,l=new Set,p=new Map,h=new Map,m=new Map,y=new Map,x=new Map,O=new Map,M=new Set,H=e.currentRoundId,T,_=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set($e(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,v){let j=t.get(v);return j?structuredClone(j):void 0},async putRound(b,v,j,Y){if(Y&&h.has(Y.id))throw new Error("audit_record_exists");for(let X=0;X<Jc;X+=1)r.set(o(v.round.id,X),{version:v.round.version,accepting:v.round.can.accepting_plays});t.set(v.round.id,{...structuredClone(v),sharded:!0}),Y&&h.set(Y.id,structuredClone(Y)),j&&(H=v.round.id,T=void 0)},async setRotation(b,v,j){T={roundIds:[...v],windowSeconds:j}},async getCurrentRound(){let b=T?T.roundIds[Math.floor(_()/1e3/T.windowSeconds)%T.roundIds.length]:H,v=t.get(b);return v?structuredClone(v):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,v){return[...n.entries()].filter(([j,Y])=>j.startsWith(`${b}#`)&&Y.state.player_id===v).map(([,j])=>structuredClone(j.state))},async getState(b,v,j){let Y=n.get($e(b,v,j));return Y?structuredClone(Y):void 0},async putStateIfVersion(b,v,j){let Y=$e(b,v.round_id,v.player_id),X=n.get(Y);return j===void 0?X?!1:(n.set(Y,{state:structuredClone(v),version:0}),!0):!X||X.version!==j?!1:(n.set(Y,{state:structuredClone(v),version:X.version+1}),!0)},async getPlay(b,v,j){let Y=i.get($e(b,v,j));return Y?structuredClone(Y):void 0},async putPlayIfAbsent(b,v,j,Y){let X=$e(b,v,j);return i.has(X)?!1:(i.set(X,structuredClone(Y)),!0)},async getLeaderboard(b,v,j){let Y=j?.order??"high_first";if(e.leaderboard)return structuredClone(e.leaderboard);let X=[...a.entries()].filter(([me])=>me.startsWith($e(b,v)+"#")).map(([me,ye])=>({rank:0,player_id:me.slice(me.lastIndexOf("#")+1),display_name:tl(me.slice(me.lastIndexOf("#")+1)),score:ye,...M.has(me)?{exact:!0}:{}})).sort((me,ye)=>Y==="low_first"?me.score-ye.score:ye.score-me.score).map((me,ye)=>({...me,rank:ye+1})),se=j?.limit??X.length;return{server_time:"",snapshot:"",round_id:v,order:Y,tie_break:"earliest_play",entries:X.slice(0,se),total:X.length,truncated:!1,me:j?.viewerId?X.find(me=>me.player_id===j.viewerId):void 0}},async getIdentities(b,v){let j={};for(let Y of v){let X=y.get($e(b,Y));X&&(j[Y]=structuredClone(X))}return j},async setIdentity(b,v,j){let Y=$e(b,v);y.set(Y,{...y.get(Y),...j})},async putRecoveryDigest(b,v,j,Y){let X=$e(b,v),se=O.get(X);return se&&x.delete($e(b,se.digest)),O.set(X,{digest:j,issuedAt:Y}),x.set($e(b,j),v),{replaced:!!se}},async playerForRecoveryDigest(b,v){return x.get($e(b,v))},async recoveryIssuedAt(b,v){return O.get($e(b,v))?.issuedAt},async getProfile(b,v){let j=m.get($e(b,v));return j?structuredClone(j):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:v,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,v,j,Y,X){let se=$e(b,v,j,String(Yi(Y))),me=(s.get(se)??0)+1;return s.set(se,me),{inBucket:me,buckets:Jc}},async countGameDay(b,v,j,Y){let X=$e(b,v,j,"game"),se=(s.get(X)??0)+1;return s.set(X,se),se},async getDailyActivity(b,v){return v.map(j=>({date:j,plays:d.get($e(b,j))??0,players:null}))},async markMonthlyPlayer(b,v,j){let Y=`${$e(b,v)}#${j}`;if(l.has(Y))return;l.add(Y);let X=$e(b,v);p.set(X,(p.get(X)??0)+1)},async getMonthlyPlayers(b,v){return p.get($e(b,v))??0},async setFuse(b,v,j){let Y=t.get(v);Y&&(Y.fusedUntil=j)},async setResult(b,v,j,Y){let X=t.get(v);if(!X)return;let me=X.secret.questions??[],ye=Object.fromEntries(me.map(he=>[he.id,he.result??null]));if(typeof j=="string")me[0]&&(me[0].result=j);else for(let he of me){let Q=j[he.id];Q!==void 0&&(he.result=Q)}let pt=me.every(he=>he.result!==void 0);X.round.challenge={...X.round.challenge,...pt?{questions:me.map(he=>({...X.round.challenge.questions?.find(Q=>Q.id===he.id),id:he.id,result:he.result})),...typeof j=="string"?{result:j}:{}}:{}},X.round.can={...X.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let he=0;he<Jc;he+=1){let Q=r.get(o(v,he));Q&&(Q.accepting=!1)}let wt=new Date().toISOString(),le={id:`settle_${v}_${wt}_${h.size}`,at:wt,tenant:b,round_id:v,player_id:null,action:"round.settled",detail:{version:X.round.version,result:j,before:ye,after:Object.fromEntries(me.map(he=>[he.id,he.result??null])),closed:!0},...Y?{actor:Y.actor}:{},...Y?.correlation_id?{correlation_id:Y.correlation_id}:{}};h.set(le.id,structuredClone(le))},async recordScore(b,v,j,Y){a.set($e(b,v,j),Y)},async appendAudit(b){if(h.has(b.id))throw dT("audit_record_overwrite",{tenant:b.tenant,round_id:b.round_id,action:b.action,record_id:b.id}),new Error("audit_record_exists");h.set(b.id,structuredClone(b))},async commitPlay(b){let v=$e(b.tenant,b.playerId,b.idempotencyKey);if(i.has(v))return{ok:!1,reason:"play_exists"};let j=$e(b.tenant,b.state.round_id,b.state.player_id),Y=n.get(j);if(b.expectedVersion===void 0){if(Y)return{ok:!1,reason:"state_version"}}else if(!Y||Y.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let se of b.audit)if(h.has(se.id))throw new Error("audit_record_exists");if(b.round?.sharded){let se=r.get(o(b.round.roundId,Yi(b.playerId)));if(!se||se.version!==b.round.version||!se.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let se=t.get(b.round.roundId);if(!se||se.round.version!==b.round.version||!se.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set(v,structuredClone(b.play)),n.set(j,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let se of b.audit)h.set(se.id,structuredClone(se));if(b.score){let se=$e(b.tenant,b.score.roundId,b.playerId);a.set(se,b.score.score),b.score.exact?M.add(se):M.delete(se)}b.profile&&m.set($e(b.tenant,b.playerId),structuredClone(b.profile));let X=$e(b.tenant,b.date);return d.set(X,(d.get(X)??0)+1),{ok:!0}}}}var $e,zT=w(()=>{"use strict";oy();ty();el();$e=(...e)=>e.join("#")});import{randomBytes as TL}from"node:crypto";function $L(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus,...e.figures?{figures:e.figures}:{},...e.facts?.length?{facts:e.facts}:{}},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function AL(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel,scoring:e.scoring?{mode:e.scoring.mode,points_per:e.scoring.pointsPer,exact_bonus:e.scoring.exactBonus}:{mode:"total"}}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{},...e.scoring?{scoring:e.scoring}:{},...e.facts?.length?{facts:e.facts}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function IL(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function CL(e,t){let r=Uk(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function PL(e,t){let r=LL(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function OL(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label,...i.note?{note:i.note}:{}})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function NL(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,model:e.model,profile:e.difficulty,shots_allowed:e.shotsAllowed,goals_to_win:e.goalsToWin,points_per_goal:e.pointsPerGoal,input:{aim_x:[lt.aimX.min,lt.aimX.max],aim_y:[lt.aimY.min,lt.aimY.max],power:[lt.power.min,lt.power.max]},geometry:{post_x:Zt.postX,bar_y:Zt.barY,post_width:Zt.postWidth,bar_height:Zt.barHeight,ball_radius:Zt.ballRadius,keeper_start:{x:Zt.keeperStart.x,y:Zt.keeperStart.y}}}},secret:{model:e.model,profile:e.difficulty,shotsAllowed:e.shotsAllowed,goalsToWin:e.goalsToWin,pointsPerGoal:e.pointsPerGoal},limits:{attemptsAllowed:e.shotsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function RL(e,t){let r={server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,board:e.board.map(n=>({key:n.key,label:n.label,...n.art!==void 0?{art:n.art}:{}})),deck:e.deck.map(n=>({key:n.key,name:n.name,...n.image!==void 0?{image:n.image}:{}})),points_per_placement:e.pointsPerPlacement,full_house_bonus:e.fullHouseBonus}},o={};for(let n of e.deck)o[n.key]=[];for(let n of e.qualifies)o[n.item]=n.cells;return{archetype:"place",round:r,secret:{cells:e.board.map(n=>n.key),deck:e.deck.map(n=>n.key),qualifies:o,pointsPerPlacement:e.pointsPerPlacement,fullHouseBonus:e.fullHouseBonus},limits:{attemptsAllowed:e.deck.length,mistakesAllowed:e.mistakesAllowed,skipsAllowed:e.skipsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function LL(e,t){switch(e.archetype){case"hunt":return $L(e,t);case"push":return AL(e,t);case"group":return IL(e,t);case"predict":return CL(e,t);case"bingo":return OL(e,t);case"shoot":return NL(e,t);case"place":return RL(e,t)}}function DL(){return TL(32).toString("hex")}function jL(e,t,r){if(e.archetype!=="shoot")return e;let o=t?.secret?.entropy,n=(t?.archetype??"hunt")==="shoot"&&typeof o=="string"&&o.length>0?o:r();return{...e,secret:{...e.secret,entropy:n}}}function So(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(So).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${So(o)}`).join(",")}}`}function FT(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...d}=i,{version:l,...p}=d;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:m,...y}=p.can;return{...p,can:y}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return So({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===So({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function ML(e,t){if(e.archetype!=="bingo"||!FT(e,t,{ignoringSettlement:!0}))return!1;let r=i=>(i??{}).cardStatus??{},o=r(t.secret),n=r(e.secret);for(let[i,a]of Object.entries(o))if(!(i in n)||So(n[i])!==So(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function hy(e,t,r,o,n=!0,i,a,s){let d=i??cn(r),l=await e.getRound(t,d),p=jL(PL(r,o),l,s?.newEntropy??DL);if(p.round.id=d,a&&(p.round.origin=a),l&&FT(p,l)){let{fusedUntil:y,...x}=l;return await e.putRound(t,{...x,archetype:p.archetype},n),{roundId:d,version:l.round.version,changed:!1,current:n}}if(l&&ML(p,l)){let y=Object.keys((p.secret??{}).cardStatus??{}).length;return await e.putRound(t,{...l,round:{...p.round,version:l.round.version},secret:p.secret,limits:p.limits,archetype:p.archetype},n,{id:`round_${d}_settle_v${l.round.version}_${y}`,at:new Date().toISOString(),tenant:t,round_id:d,player_id:null,action:"round.settled",detail:{version:l.round.version,resolved:y,snapshot:o}}),{roundId:d,version:l.round.version,changed:!1,current:n}}let h=l?l.round.version+1:1,m={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,m,n,{id:`round_${d}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:d,player_id:null,action:l?"round.replaced":"round.provisioned",detail:{version:h,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:d,version:h,changed:!0,current:n}}var GT=w(()=>{"use strict";we()});function WT(e,t){let r=e.entries??[],o=r.filter(n=>typeof n.display_name=="string"&&n.display_name.trim().length>0);return{generated_at:t,last_updated:e.server_time??t,...e.round_id!==void 0&&{round_id:e.round_id},order:e.order??"high_first",entries:o.map(n=>({external_id:n.player_id,name:n.display_name.trim(),primary_score:n.score})),withheld:r.length-o.length}}var BT,UL,W5,KT=w(()=>{"use strict";ze();BT="/play/v1/games/{game}/gfx/leaderboard",UL=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),W5=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(UL),withheld:c.number().int().nonnegative()})});import{randomInt as zL}from"node:crypto";function et(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function HT(e,t,r,o,n){let i=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:my,body:void 0};if(e.method==="GET"&&i===`${Sc}/health`)return Me(200,{status:"ok"});let a=tt.session.exec(i);if(a){if(e.method!=="POST")return Ue(405,"method_not_allowed","This route accepts POST.");let l=decodeURIComponent(a[1]),p=o?.check(lo(l,Mc(e)));if(p&&!p.allowed)return il(p.retryAfterSeconds);let h=r?.issue(l);return h?Me(200,{server_time:"",snapshot:"",token:h.token,player_id:h.playerId,kind:"anonymous"}):Ue(503,"unavailable","This deployment cannot issue a session.",!0)}let s=tt.restoreSession.exec(i);if(s){if(e.method!=="POST")return Ue(405,"method_not_allowed","This route accepts POST.");let l=decodeURIComponent(s[1]),p=Mc(e),h=o?.check(lo(l,p));if(h&&!h.allowed)return il(h.retryAfterSeconds);let m=hE.safeParse(e.body),y=m.success?m.data.code:"",x=y.trim().toLowerCase().split(/[\s\-_.]+/)[0]??"";for(let _ of[`recover:${lo(l,p)}`,`recover-word:${lo(l,x)}`]){let b=n?.check(_);if(b&&!b.allowed)return il(b.retryAfterSeconds)}let O=uE(y);if(!O||!r?.recoveryDigest||!r.sign)return Ue(401,"code_not_recognised",Dg);let M;try{M=await t.forPlayer(l,e)}catch(_){return mn({path:e.path,method:e.method,game:l,stage:"resolve",name:Gn(_)}),Ue(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!M)return Ue(404,"not_found",`No game with id "${l}".`);let H=await M.playerForRecoveryDigest(r.recoveryDigest(O));if(!H)return Ue(401,"code_not_recognised",Dg);let T=Me(200,{token:r.sign(H),player_id:H,kind:"anonymous",previous_player:"kept"});return T.headers["cache-control"]="no-store",T}let d=[["runtime",tt.runtime],["currentRound",tt.currentRound],["rounds",tt.rounds],["roundsMine",tt.roundsMine],["nextRound",tt.nextRound],["plays",tt.plays],["roundState",tt.roundState],["profile",tt.profile],["identityOptions",tt.identityOptions],["identity",tt.identity],["recoveryCode",tt.recoveryCode],["graphicsFeed",tt.graphicsFeed],["leaderboard",tt.leaderboard],["round",tt.round]];for(let[l,p]of d){let h=p.exec(i);if(!h)continue;let m=decodeURIComponent(h[1]),y=h[2]?decodeURIComponent(h[2]):void 0,x=o?.check(lo(m,Mc(e)));if(x&&!x.allowed)return il(x.retryAfterSeconds);let O=l==="plays"||l==="identity",M=l==="recoveryCode";if(M?e.method!=="GET"&&e.method!=="POST":O?e.method!=="POST":e.method!=="GET")return Ue(405,"method_not_allowed",`This route accepts ${M?"GET or POST":O?"POST":"GET"}.`);let H;try{H=await t.forPlayer(m,e)}catch(T){return mn({path:e.path,method:e.method,game:m,stage:"resolve",name:Gn(T)}),Ue(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!H)return Ue(404,"not_found",`No game with id "${m}".`);try{switch(l){case"runtime":return Me(200,await H.getRuntime());case"currentRound":return Me(200,await H.getCurrentRound());case"rounds":return Me(200,await H.getRoundPool());case"roundsMine":return Me(200,await H.getPlayedRounds());case"nextRound":return Me(200,await H.getNextRound());case"round":{let T=await H.getRound(y);return T?Me(200,T):Ue(404,"not_found","No such round.")}case"roundState":return Me(200,await H.getRoundState(y));case"profile":return Me(200,await H.getProfile());case"identityOptions":{let T=Me(200,H.getIdentityOptions());return T.headers["cache-control"]="public, max-age=300",T}case"identity":{let T=Vx.safeParse(e.body);if(!T.success)return Ue(422,"invalid_request",T.error.issues.map(b=>`${b.path.join(".")||"body"}: ${b.message}`).join("; "));let _=await H.setIdentity(T.data);return _.ok?Me(200,_.profile):Ue(422,"not_offered",_.reason)}case"recoveryCode":{if(e.method==="GET"){let j=Me(200,await H.getRecoveryStatus());return j.headers["cache-control"]="no-store",j}if(!r?.recoveryDigest)return Ue(503,"unavailable","This deployment cannot issue recovery codes.",!0);let T=pE(zL),_=new Date().toISOString(),b=await H.recordRecoveryDigest(r.recoveryDigest(T),_);if(!b.ok)return Ue(409,"not_anonymous",b.reason);let v=Me(200,{code:T,issued_at:_,replaced:b.replaced});return v.headers["cache-control"]="no-store",v}case"leaderboard":return Me(200,await H.getLeaderboard());case"graphicsFeed":{let T=await H.getLeaderboard(),_=WT(T,new Date().toISOString()),b=Me(200,_);return b.headers["cache-control"]="public, max-age=5",b}case"plays":{let T=Hx.safeParse(e.body);if(!T.success)return Ue(422,"invalid_request",T.error.issues.map(v=>`${v.path.join(".")||"body"}: ${v.message}`).join("; "));let _=await H.play(y,T.data),b=Me(200,_);return _.outcome==="busy"&&_.retry_after_seconds&&(b.headers["retry-after"]=String(_.retry_after_seconds)),b}}}catch(T){return T instanceof Error&&T.message==="round_not_found"?Ue(404,"not_found","No such round."):(mn({path:e.path,method:e.method,game:m,name:Gn(T)}),Ue(500,"internal","Something went wrong at our end.",!0))}}return FL}var my,Me,Ue,tt,FL,il,VT=w(()=>{"use strict";we();KT();el();my={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Me=(e,t)=>({status:e,headers:{"content-type":"application/json",...my},body:t}),Ue=(e,t,r,o=!1)=>Me(e,{error:{code:t,message:r,retryable:o}});tt={runtime:et(Ie.runtime),currentRound:et(Ie.currentRound),rounds:et(Ie.rounds),roundsMine:et(Ie.roundsMine),nextRound:et(Ie.nextRound),round:et(Ie.round),plays:et(Ie.plays),roundState:et(Ie.roundState),profile:et(Ie.profile),identityOptions:et(Ie.identityOptions),identity:et(Ie.identity),recoveryCode:et(Ie.recoveryCode),restoreSession:et(Ie.restoreSession),leaderboard:et(Ie.leaderboard),graphicsFeed:et(BT),session:et(Ie.session)},FL=Ue(404,"not_found","No such route on the player API."),il=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...my},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function sl(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function fn(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var wr,ta,al,J5,Eo=w(()=>{wr=new TextEncoder,ta=new TextDecoder,al=new TextDecoder("utf-8",{fatal:!0}),J5=2**32});function GL(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function ZT(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw cl(t.name);if(t.hash&&o.hash?.name!==t.hash)throw cl(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw cl(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw cl(t.length,"algorithm.length");GL(e,r)}var cl,YT=w(()=>{cl=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function qT(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var JT,fy,gy=w(()=>{JT=(e,...t)=>qT("Key must be ",e,...t),fy=(e,t,...r)=>qT(`Key for the ${e} algorithm must be `,t,...r)});var nt,It,na,ll,Ge,Pe,Bn,ra,To,dl,ul,pl,ut=w(()=>{nt=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},It=class extends nt{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},na=class extends nt{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},ll=class extends nt{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Ge=class extends nt{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Pe=class extends nt{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Bn=class extends nt{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},ra=class extends nt{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},To=class extends nt{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},dl=class extends nt{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},ul=class extends nt{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},pl=class extends nt{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var $o,yy,by,vy=w(()=>{$o=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},yy=e=>e?.[Symbol.toStringTag]==="KeyObject",by=e=>$o(e)||yy(e)});function wy(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function hl(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var _y=w(()=>{});function oa(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:ta.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=ta.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return hl(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function Ao(e){let t=e;return typeof t=="string"&&(t=wr.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):wy(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var ia=w(()=>{Eo();_y()});function zt(e){if(!BL(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ml(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var BL,ky,XT,QT,e$,Wn=w(()=>{BL=e=>typeof e=="object"&&e!==null;ky=e=>zt(e)&&typeof e.kty=="string",XT=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),QT=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,e$=e=>e.kty==="oct"&&typeof e.k=="string"});function xy(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function Sy(e,t,r){try{return oa(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function t$(e,t,r){try{return fn(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function n$(e,t,r){let o;try{o=JSON.parse(al.decode(oa(e)))}catch{throw new t(r)}if(!zt(o))throw new t(r);return o}var Ey=w(()=>{ia();Eo();Wn()});function HL(e,t){if(!e.kty.includes(t.kty))throw new Ge(KL);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function fl(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Ge('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=HL(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var KL,Ty=w(()=>{ut();KL='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function YL(e,t,r){return e.symmetric?VL(e,t,r):ZL(e,t,r)}function i$(e,t){return yl||=new WeakMap,yl.get(e)?.[t]}function a$(e,t,r){let o=yl.get(e);return o?o[t]=r:yl.set(e,{[t]:r}),r}async function bl(e,t,r){let o=YL(e,t,r);switch(o.kind){case o$:case Ay:return o.key;case gl:{if(o.key.k)return oa(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return r$(o.key,o.key,e)}case Iy:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?JL(n,e):r$(n,n.export({format:"jwk"}),e)}}}var Io,$y,VL,ZL,o$,Ay,Iy,gl,yl,qL,r$,JL,Cy=w(()=>{gy();vy();Wn();ia();Ty();Io=e=>e[Symbol.toStringTag],$y=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},VL=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:o$,key:t};if(ky(t)){if(e$(t)&&$y(e,t,r))return{kind:gl,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!by(t))throw new TypeError(fy(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Io(t)} instances for symmetric algorithms must be of type "secret"`);return $o(t)?{kind:Ay,key:t}:{kind:Iy,key:t}},ZL=(e,t,r)=>{let{alg:o}=e;if(ky(t))switch(r){case"decrypt":case"sign":if(XT(t)&&$y(e,t,r))return{kind:gl,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(QT(t)&&$y(e,t,r))return{kind:gl,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!by(t))throw new TypeError(fy(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Io(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Io(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Io(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Io(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Io(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return $o(t)?{kind:Ay,key:t}:{kind:Iy,key:t}},o$=Symbol(),Ay=Symbol(),Iy=Symbol(),gl=Symbol();qL={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};r$=async(e,t,r)=>{let o=i$(e,r.alg);if(o)return o;let n=await fl(r,{...t,alg:r.alg});return a$(e,r.alg,n)},JL=(e,t)=>{let r=i$(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=qL[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return a$(e,t.alg,e.toCryptoKey(s,o,n))}});function aa(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var Py=w(()=>{});function vl(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:XL,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function wl(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new Ge('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:QL,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function Oy(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:_l,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Ny(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:_l,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function Ry(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:_l,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function Ly(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:s$,keyOps:c$,cekBits:e,ivBits:96,cbc:!1}}function Dy(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:s$,keyOps:c$,cekBits:e,ivBits:128,cbc:!0}}function l$(e){return eD[e]}var XL,QL,_l,eD,s$,c$,_V,d$=w(()=>{ut();Py();XL={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},QL={public:[],private:["deriveBits"]},_l={public:[],private:[]};eD=aa({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:_l,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":vl(1),"RSA-OAEP-256":vl(256),"RSA-OAEP-384":vl(384),"RSA-OAEP-512":vl(512),"ECDH-ES":wl(),"ECDH-ES+A128KW":wl(128),"ECDH-ES+A192KW":wl(192),"ECDH-ES+A256KW":wl(256),A128KW:Oy(128),A192KW:Oy(192),A256KW:Oy(256),A128GCMKW:Ny(128),A192GCMKW:Ny(192),A256GCMKW:Ny(256),"PBES2-HS256+A128KW":Ry(256,128),"PBES2-HS384+A192KW":Ry(384,192),"PBES2-HS512+A256KW":Ry(512,256)}),s$={public:[],private:[]},c$={encrypt:"encrypt",decrypt:"decrypt"};_V=aa({A128GCM:Ly(128),A192GCM:Ly(192),A256GCM:Ly(256),"A128CBC-HS256":Dy(256),"A192CBC-HS384":Dy(384),"A256CBC-HS512":Dy(512)})});function tD(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function nD(e,t,r){ZT(t,e.subtle,r),e.minModulusLength&&tD(e.alg,t)}async function u$(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(nD(e,t,r),t)}async function p$(e,t,r){let o=await u$(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function h$(e,t,r,o){let n=await u$(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var jy=w(()=>{YT()});function m$(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function f$(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function xl(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new Ge(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var kl,My=w(()=>{ut();kl=new Map([["b64",!0]])});function Uy(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:sa}}function Co(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:sa,minModulusLength:2048}}function zy(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:sa}}function g$(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:sa}}function Fy(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:sa}}function Sl(e){let t=y$[e];if(!t)throw new Ge(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function El(e){return y$[e]}var sa,y$,ca=w(()=>{ut();Py();sa={public:["verify"],private:["sign"]};y$=aa({HS256:Uy(256),HS384:Uy(384),HS512:Uy(512),RS256:Co("RSASSA-PKCS1-v1_5",256),RS384:Co("RSASSA-PKCS1-v1_5",384),RS512:Co("RSASSA-PKCS1-v1_5",512),PS256:Co("RSA-PSS",256,32),PS384:Co("RSA-PSS",384,48),PS512:Co("RSA-PSS",512,64),ES256:zy("P-256",256),ES384:zy("P-384",384),ES512:zy("P-521",512),EdDSA:g$(),Ed25519:g$(),"ML-DSA-44":Fy("ML-DSA-44"),"ML-DSA-65":Fy("ML-DSA-65"),"ML-DSA-87":Fy("ML-DSA-87")})});function b$(e){return{algorithms:e&&m$("algorithms",e.algorithms),crit:e?.crit}}async function rD(e,t,r){let o={};e.protected&&(o=n$(e.protected,Pe,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!ml(o,e.header))throw new Pe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=xl(Pe,kl,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Pe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Pe('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new ll('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Pe("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Pe("JWS Payload must be a string or an Uint8Array instance");let d=!1;typeof r=="function"&&(r=await r(o,e),d=!0);let l=Sl(s),p=sl(e.protected!==void 0?fn(e.protected):new Uint8Array,fn("."),typeof e.payload=="string"?a?t.b64p??=t$(e.payload,"payload",Pe):wr.encode(e.payload):e.payload),h=Sy(e.signature,"signature",Pe),m=await bl(l,r,"verify");if(!await h$(l,m,h,p))throw new pl;let x;return a?x=Sy(e.payload,"payload",Pe):typeof e.payload=="string"?x=wr.encode(e.payload):x=e.payload,{payload:x,parsedProt:o,b64:a,key:m,resolvedKey:d}}async function v$(e,t,r){if(e instanceof Uint8Array&&(e=ta.decode(e)),typeof e!="string")throw new Pe("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new Pe("Invalid Compact JWS");return rD({payload:n,protected:o,signature:i},t,r)}var w$=w(()=>{jy();ca();ut();Eo();Ey();Wn();My();Cy()});function la(e){let t=aD.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*k$);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*x$);break;case"day":case"days":case"d":n=Math.round(r*Gy);break;case"week":case"weeks":case"w":n=Math.round(r*oD);break;default:n=Math.round(r*iD);break}return t[1]==="-"||t[4]==="ago"?-n:n}function gn(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function S$(e,t,r={}){let o;try{o=JSON.parse(al.decode(t))}catch{}if(!zt(o))throw new Bn("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||_$(e.typ)!==_$(n)))throw new It('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:d,maxTokenAge:l}=r,p=[...i];l!==void 0&&p.push("iat"),d!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let x of new Set(p.reverse()))if(!(x in o))throw new It(`missing required "${x}" claim`,o,x,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new It('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new It('unexpected "sub" claim value',o,"sub","check_failed");if(d!==void 0&&!sD(o.aud,typeof d=="string"?[d]:d))throw new It('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=la(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}gn("clockTolerance option",h);let{currentDate:m}=r,y=gn("currentDate option",Kn(m||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new It('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new It('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>y+h)throw new It('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new It('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=y-h)throw new na('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let x=y-o.iat,O=typeof l=="number"?l:la(l);if(x-h>O)throw new na('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(x<0-h)throw new It('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Kn,k$,x$,Gy,oD,iD,aD,_$,sD,Tl,By=w(()=>{ut();Eo();Wn();Kn=e=>Math.floor(e.getTime()/1e3),k$=60,x$=k$*60,Gy=x$*24,oD=Gy*7,iD=Gy*365.25,aD=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;_$=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,sD=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Tl=class{#e;constructor(t){if(!zt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return wr.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=gn("setNotBefore",t):t instanceof Date?this.#e.nbf=gn("setNotBefore",Kn(t)):this.#e.nbf=Kn(new Date)+la(t)}set exp(t){typeof t=="number"?this.#e.exp=gn("setExpirationTime",t):t instanceof Date?this.#e.exp=gn("setExpirationTime",Kn(t)):this.#e.exp=Kn(new Date)+la(t)}set iat(t){t===void 0?this.#e.iat=Kn(new Date):t instanceof Date?this.#e.iat=gn("setIssuedAt",Kn(t)):typeof t=="string"?this.#e.iat=gn("setIssuedAt",Kn(new Date)+la(t)):this.#e.iat=gn("setIssuedAt",t)}}});async function Wy(e,t,r){let o=await v$(e,b$(r),t);if(!o.b64)throw new Bn("JWTs MUST NOT use unencoded payload");let i={payload:S$(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var E$=w(()=>{w$();By();ut()});function $l(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function T$(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!ml(r,o))throw new Pe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};f$(Pe,r);let i=xl(Pe,kl,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new Pe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Pe('JWS "alg" (Algorithm) Header Parameter missing or invalid');let d=Sl(s),l,p;if(a){let H=e.encoded??={};H.b64??=Ao(e.payload),H.raw??=fn(H.b64),l=H.b64,p=H.raw}else p=e.payload,l="";let h,m;r?(h=Ao(JSON.stringify(r)),m=fn(h)):(h="",m=new Uint8Array);let y=sl(m,fn("."),p),x=await bl(d,t,"sign"),O=await p$(d,x,y),M={signature:Ao(O),payload:l};return r&&(M.protected=h),M}var Al=w(()=>{ia();jy();ca();Wn();ut();Eo();My();Cy()});var Il,$$=w(()=>{ut();Al();Ey();Il=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return xy(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return xy(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new Pe("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await T$({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Cl,A$=w(()=>{$$();Al();Cl=class{#e;#t;constructor(t){this.#e=new Il(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if($l(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var da,I$=w(()=>{A$();Al();ut();By();da=class{#e;#t;constructor(t={}){this.#t=new Tl(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Cl(this.#t.data());if(o.setProtectedHeader(this.#e),$l(this.#e))throw new Bn("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function C$(){return new Ge('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function P$(e){if(typeof e!="string")throw C$();let t=El(e)??l$(e);if(!t)throw C$();return t}var O$=w(()=>{ut();ca();d$()});function dD(e){pa(e,48,"Invalid PKCS#8 structure"),ua(e),pa(e,2,"Expected version field");let t=ua(e);e.pos+=t,pa(e,48,"Expected algorithm identifier");let r=ua(e);return{algIdStart:e.pos,algIdLength:r}}var Ky,cD,Hy,ua,pa,N$,lD,uD,pD,hD,R$,L$=w(()=>{_y();ut();O$();Ky=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},cD=e=>({data:e,pos:0}),Hy=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},ua=e=>{let t=Hy(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|Hy(e);return o}return t},pa=(e,t,r)=>{if(Hy(e)!==t)throw new Error(r)},N$=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},lD=e=>{pa(e,6,"Expected algorithm OID");let t=ua(e);return N$(e,t)};uD=e=>{let t=lD(e);if(Ky(t,[43,101,110]))return"X25519";if(!Ky(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");pa(e,6,"Expected curve OID");let r=ua(e),o=N$(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Ky(o,i))return n;throw new Error("Unsupported named curve")},pD=async(e,t,r,o)=>{let n=P$(r);if(n.symmetric)throw new Ge('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new Ge("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},hD=(e,t)=>hl(e.replace(t,"")),R$=(e,t,r)=>{let o=hD(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=cD(i);return dD(a),uD(a)}),pD("pkcs8",o,t,n)}});function mD(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function fD(e){if(yy(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:Ao(e)};if(!$o(e))throw new TypeError(JT(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=mD(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Vy(e){return fD(e)}var D$=w(()=>{gy();ia();vy()});function gD(e){let t=typeof e=="string"?El(e):void 0;if(!t||t.symmetric)throw new Ge('Unsupported "alg" value for a JSON Web Key Set');return t}function yD(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(bD)}function bD(e){return zt(e)}async function j$(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await fl(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new ra("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Yy(e){let t=new Zy(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var Zy,M$=w(()=>{Ty();ca();ut();Wn();Zy=class{#e;#t=new WeakMap;constructor(t){if(!yD(t))throw new ra("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=gD(o),a=this.#e.keys.filter(l=>{let p=i.kty.includes(l.kty);return p&&typeof n=="string"&&(p=n===l.kid),p&&(typeof l.alg=="string"||l.kty==="AKP")&&(p=o===l.alg),p&&typeof l.use=="string"&&(p=l.use==="sig"),p&&Array.isArray(l.key_ops)&&(p=l.key_ops.includes("verify")),p&&i.crv&&(p=l.crv===i.crv),p}),{0:s,length:d}=a;if(d===0)throw new To;if(d!==1){let l=new dl,p=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await j$(p,h,i)}catch{}},l}return j$(this.#t,s,i)}}});function vD(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function wD(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new ul:i});if(n.status!==200)throw new nt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new nt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function _D(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!zt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,zt))}function Xy(e,t){let r=new Jy(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var qy,U$,Pl,Jy,z$=w(()=>{ut();M$();Wn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(qy="jose/v6.2.5");U$=Symbol();Pl=Symbol();Jy=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),qy&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",qy),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[U$],r?.[Pl]!==void 0&&(this.#s=r?.[Pl],_D(r?.[Pl],this.#c)&&(this.#i=this.#s.uat,this.#a=Yy(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof To&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&vD()&&(this.#r=void 0),this.#r||=wD(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Yy(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function Qy(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return R$(e,t,r)}var F$=w(()=>{L$()});var eb=w(()=>{E$();I$();z$();D$();F$()});function kD(e){let t=G$.get(e);return t||(t=Xy(new URL(e)),G$.set(e,t)),t}function B$(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await Wy(r,kD(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${xD}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var G$,xD,W$=w(()=>{"use strict";eb();Qc();G$=new Map;xD="id:"});import{createPublicKey as SD,generateKeyPairSync as ED}from"node:crypto";async function tb(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Ol}`,{privateKey:n,publicKey:i}=ED("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Qy(n,"RS256"),s=await Vy(SD(i)),d="gamestage-dev",l={keys:[{...s,kid:d,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:B$({issuer:r,jwksUri:o}),async mint(p,h={}){let m=Math.floor(Date.now()/1e3);return new da({name:p}).setProtectedHeader({alg:"RS256",kid:d}).setIssuer(r).setSubject(p).setIssuedAt(m).setExpirationTime(m+(h.expiresInSeconds??3600)).sign(a)}}}var Ol,nb=w(()=>{"use strict";eb();W$();Ol="/.well-known/jwks.json"});import{createServer as TD}from"node:http";import{randomBytes as $D}from"node:crypto";async function ID(e){let t=UT({tenant:e.game,rounds:[],currentRoundId:""});await hy(t,e.game,Xe.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await hy(t,e.game,Xe.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=DT({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return jT({tenant:e.game,playerId:n.playerId??qi(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function CD(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function Nl(e){let t=await ID(e),r=$D(32).toString("base64"),o={issue:()=>sT(r),sign:a=>ry(a,r),recoveryDigest:a=>lT(a,r)},n=e.devIdentity,i=TD((a,s)=>{(async()=>{let d=new URL(a.url??"/","http://localhost");if(n&&d.pathname===Ol){let m=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(d.pathname)){let m=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}let l=a.headers[AD],p=a.headers.authorization,h=await HT({method:a.method??"GET",path:d.pathname,body:await CD(a),...(({playerId:m,refused:y})=>({playerId:m,identityRefusal:y}))(await iT({token:p?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(l)?l[0]:l,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(h.status,h.headers),s.end(h.body===void 0?void 0:JSON.stringify(h.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var AD,rb=w(()=>{"use strict";we();MT();ol();zT();GT();VT();Qc();nb();nb();ol();AD="x-gamestage-player"});import{spawn as PD}from"node:child_process";import{createHash as OD,randomBytes as H$}from"node:crypto";import{constants as ND}from"node:fs";import{access as RD,mkdtemp as LD,rm as V$}from"node:fs/promises";import{request as DD}from"node:http";import{homedir as Rl,tmpdir as jD}from"node:os";import{join as ha}from"node:path";function ob(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??H$(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function Ll(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??UD].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await RD(s,ND.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await LD(ha(jD(),"gamestage-chrome-")),i=PD(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await FD(await zD(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:d}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await cb.create(a,d,i,n)}}catch(s){throw a?.close(),await Z$(i),await V$(n,{recursive:!0,force:!0}),s}}function zD(e,t){return new Promise((r,o)=>{let n="",i=p=>{clearTimeout(l),e.stderr?.off("data",a),e.off("error",s),e.off("close",d),p()},a=p=>{n=(n+p.toString("utf8")).slice(-4e3);let h=n.match(/DevTools listening on (ws:\/\/\S+)/);h&&i(()=>r(h[1]))},s=p=>i(()=>o(p)),d=p=>i(()=>o(new Error(`Chrome exited before DevTools was ready${p===null?"":` (code ${p})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",d);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function FD(e){return new Promise((t,r)=>{let o=new URL(e),n=H$(16).toString("base64"),i=OD("sha1").update(n+MD).digest("base64"),a=DD({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,d,l)=>{s.headers["sec-websocket-accept"]!==i?(d.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new sb(d,l))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function Z$(e){e.exitCode===null&&(e.kill("SIGTERM"),!await K$(e,1e3)&&(e.kill("SIGKILL"),await K$(e,1e3)))}function K$(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function ib(e){return new Promise(t=>setTimeout(t,e))}var MD,ab,sb,cb,UD,Y$=w(()=>{"use strict";MD="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";ab=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,d=n&127,l=2;if(d===126){if(this.buffered.length<l+2)break;d=this.buffered.readUInt16BE(l),l+=2}else if(d===127){if(this.buffered.length<l+8)break;let m=this.buffered.readBigUInt64BE(l);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");d=Number(m),l+=8}let p=l;if(s&&(l+=4),this.buffered.length<l+d)break;let h=Buffer.from(this.buffered.subarray(l,l+d));if(s)for(let m=0;m<h.length;m++)h[m]^=this.buffered[p+m%4];if(this.buffered=this.buffered.subarray(l+d),a===8||a===9||a===10)r.push({opcode:a,payload:h});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:h}):(this.fragmentedOpcode=a,this.fragments=[h])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(h),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},sb=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new ab;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(ob(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(ob(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(ob(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},cb=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,d=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(d.split(`
|
|
11121
|
+
`).some(d=>n(a.item).test(d)&&a.cells.every(l=>n(l).test(d)))&&i.push(a.item)}return i}let r=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=[];for(let n of t.slates)for(let i of n.entries){let a=`${r(i.key)}|${r(i.label)}`,s=new RegExp(`\\b(?:${a})\\b[^\\n]{0,120}?\\b${i.value}\\b`,"i"),d=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?\\b(?:${a})\\b`,"i");(s.test(e)||d.test(e))&&o.push(i.label)}return o}function xo(e,t){if(e.archetype==="hunt")return`Every target appears in the artefact: ${t.join(", ")}. A solution in the bundle can be read before anybody plays.`;if(e.archetype==="group")return`The page holds the grouping: ${t.join(", ")}. A player who reads it has the categories, which is the puzzle.`;if(e.archetype==="place")return`The page holds which cells a card fits: ${t.join(", ")}. A player who reads it can fill the board without knowing a face, which is the game.`;let r=t.slice(0,5).join(", "),o=t.length>5?`, and ${t.length-5} more`:"";return`The page carries what each pick is worth: ${r}${o}. A game that is arithmetic is finished the moment the numbers ship, without a move being played.`}function i1(e){try{return JSON.parse(e)}catch{}try{let t=Mx(e);return typeof t=="object"?t:void 0}catch{return}}function a1(e){let t=i1(e);if(!t||typeof t!="object")return;let r,o=new Set,n=(i,a)=>{if(!(r||a>6||!i||typeof i!="object")&&!o.has(i)){if(o.add(i),Array.isArray(i)){for(let s of i)n(s,a+1);return}for(let[s,d]of Object.entries(i)){if(o1.has(s.toLowerCase())){r=s;return}n(d,a+1)}}};return n(t,0),r}function s1(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Xg+1)return!1;for(let r of[","," ",";"]){let o=t.slice(0,500).map(p=>p.split(r)),n=o[0].length,i=o.filter(p=>p.length===n);if(n<2||i.length<o.length*.95||i.length<Xg+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),d=!1,l=!1;for(let p=0;p<s;p+=1){let h=a.map(m=>m[p].trim());h.every(m=>m.length>0&&/^-?\d+(\.\d+)?$/.test(m))?d=!0:h.every(m=>m.length>0&&!/^-?\d+(\.\d+)?$/.test(m))&&(l=!0)}if(d&&l)return!0}try{let r=JSON.parse(e);if(r&&typeof r=="object"&&!Array.isArray(r)){let o=Object.values(r);if(o.length>=Xg&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function d1(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&l1.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:c1.has(t.slice(r+1))}function p1(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>u1.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function h1(e){if(e.relativePath!==Re)return;let t;try{t=await JE(e.path)}catch{return}if(qR("sha256").update(t).digest("hex").slice(0,16)!==Xt)return{path:e.relativePath,why:"needs regenerating. Run `gamestage client`, then deploy again. If it is refused again with the same digest, the tool that wrote the file is older than the one checking it, so update Gamestage and rerun.",confidence:"certain"}}async function eT(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),d;for(let l of e){let p=p1(l.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await h1(l);if(h){d??=h;continue}if(s.has(l.relativePath)){r.push(l);continue}let m=await ey(l,t.round);if(!m){r.push(l);continue}if(m.confidence==="suspected"&&a.has(l.relativePath)){n.push(m),r.push(l);continue}if(m.alwaysWithheld||d1(l.relativePath)){o.push(m);continue}d??=m}return{publish:r,withheld:o,allowed:n,walkedPast:i,...d?{refuse:d}:{}}}async function ey(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(Qg(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await Vi(e.path);if(o!==void 0){let i=e1(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=r1(o);if(a)return r(a.round?"is an App Manifest, which carries the round's private half":"is an App Manifest, which is ours rather than the game's","certain",!0);if(t){let s=ko(o,t);if(s.length)return r(xo(t,s),"certain")}}if(t&&o===void 0){let i=await n1(e.path);if(i!==void 0){let a=ko(i,t);if(a.length)return r(xo(t,a),"certain")}}if(o===void 0)return;let n=a1(o);if(n){let i=/^[aeiou]/i.test(n)?"an":"a";return r(`looks like it holds a round's answers: it has ${i} "${n}" key. If that is the game's own data rather than its answers, publish it with --allow ${e.relativePath}`,"suspected")}if(s1(o))return r(`looks like reference data: a long table of labels against numbers, which is what a round is scored against. If it is the game's own data, publish it with --allow ${e.relativePath}`,"suspected")}var XR,QR,XE,t1,o1,Xg,c1,l1,u1,Vc=w(()=>{"use strict";kc();we();pn();XR=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),QR=[{pattern:/-----BEGIN [A-Z ]*PRIVATE KEY-----/,what:"a private key block"},{pattern:/-----BEGIN OPENSSH PRIVATE KEY-----/,what:"an OpenSSH private key"},{pattern:/\bAKIA[0-9A-Z]{16}\b/,what:"an AWS access key id"},{pattern:/\baws_secret_access_key\s*[=:]/i,what:"an AWS secret access key"},{pattern:/\bsk-(live|proj|ant)-[A-Za-z0-9_-]{16,}/,what:"a live API key"},{pattern:/\bsk_live_[A-Za-z0-9]{16,}/,what:"a live Stripe key"},{pattern:/\bgh[pousr]_[A-Za-z0-9]{30,}/,what:"a GitHub token"},{pattern:/\bxox[baprs]-[A-Za-z0-9-]{10,}/,what:"a Slack token"},{pattern:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,what:"a signed token"},{pattern:/\bauthorization\s*:\s*["']?\s*(bearer|basic)\s+\S{12,}/i,what:"an Authorization header with a token in it"}];XE=8e6,t1=32e6;o1=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Xg=20;c1=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),l1=new Set(["gz","br","zst","zz"]);u1=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function Zc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Re||o===Ve)continue;let n=await Vi(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var ty=w(()=>{"use strict";pn();Vc()});import{lstatSync as m1,readdirSync as f1}from"node:fs";import{relative as g1,resolve as tT,sep as y1}from"node:path";function Yc(e){let t=e.split("/").pop()??e;return b1.has(t)||t.startsWith(".env.")}function Zi(e,t={}){let r=t.symlinks??"throw",o=tT(e),n=[],i=[],a=[];function s(d){for(let l of f1(d,{withFileTypes:!0}).sort((p,h)=>p.name.localeCompare(h.name))){let p=tT(d,l.name),h=g1(o,p).split(y1).join("/");if(l.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${h}`);i.push(h);continue}if(l.isDirectory())s(p);else if(l.isFile()){if(Yc(h)){a.push(h);continue}n.push({path:p,relativePath:h})}}}if(!m1(o).isDirectory())throw new Error(`${e} is not a directory.`);return s(o),{files:n,skippedLinks:i,withheld:a}}function nT(e){return Zi(e,{symlinks:"throw"}).files}function rT(e,t=[]){let r=[],o=new Map;for(let i of e){let a=i.relativePath;if(!v1.test(a)||w1.test(a)){r.push(a);continue}let d=a.lastIndexOf("/"),l=d===-1?".":a.slice(0,d);o.set(l,(o.get(l)??0)+1)}let n=[];for(let i of r.sort())n.push(i);for(let[i,a]of[...o].sort(([s],[d])=>s.localeCompare(d))){let s=i==="."?"the directory root":`${i}/`;n.push(`${a} ${a===1?"file":"files"} in ${s}`)}for(let i of[...t].sort())n.push(`withheld: ${i}`);return{lines:n,named:r}}var b1,v1,w1,qc=w(()=>{"use strict";b1=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs","gamestage.settings.json"]);v1=/\.(html?|css|js|mjs|cjs|map|svg|png|jpe?g|gif|webp|avif|ico|woff2?|ttf|otf|mp3|mp4|webm|txt|md)$/i,w1=/(^|\/)(\.|_)|(^|\/)[^/]*(secret|credential|password|token|key|\.pem|\.p12|\.pfx|backup|\.bak|answers?|solution)[^/]*$/i});import{createHash as _1}from"node:crypto";function Yi(e){return _1("sha256").update(e,"utf8").digest()[0]&127}var Jc,ny=w(()=>{"use strict";Jc=128});import{createHmac as oT,randomBytes as k1,timingSafeEqual as x1}from"node:crypto";function Xc(e){return e.startsWith(ry)}function qi(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${ry}${t||"unknown"}`}async function aT(e){if(!e.token)return e.sessionSecret?{playerId:S1(e.anonymousId,e.sessionSecret)??qi(void 0)}:{playerId:qi(e.anonymousId)};let t=e.resolver??iT,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:qi(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function cT(e){let t=`${ry}${k1(16).toString("base64url")}`;return{playerId:t,token:oy(t,e)}}function lT(e,t){return oT("sha256",t).update(e).digest("base64url")}function oy(e,t){return`${e}${sT}${lT(e,t)}`}function S1(e,t){if(!e)return;let r=e.lastIndexOf(sT);if(r<=0)return;let o=e.slice(0,r);if(!Xc(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(lT(o,t));if(n.length===i.length)return x1(n,i)?o:void 0}function dT(e,t){return oT("sha256",t).update(`gamestage-recovery\0${e}`).digest("base64url")}var ry,iT,sT,Qc=w(()=>{"use strict";ry="anon:";iT={async resolve(){}};sT="."});function Gn(e){return e instanceof Error?e.name:"unknown"}function mn(e){console.error(E1,e)}function uT(e,t){console.error(T1,{violation:e,...t})}var E1,T1,el=w(()=>{"use strict";E1="engine_error",T1="engine_integrity_violation"});function pT(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t^=t>>>16,t=Math.imul(t,2246822507)>>>0,t^=t>>>13,t=Math.imul(t,3266489909)>>>0,t^=t>>>16,t>>>0}function $1(e){let t=Ji[pT(`a:${e}`)%Ji.length],r=Xi[pT(`n:${e}`)%Xi.length];return`${t} ${r}`}function tl(e,t){return t?.trim()||$1(e)}function hT(e,t){if(Ji.includes(e)&&Xi.includes(t))return`${e} ${t}`}var Ji,Xi,iy=w(()=>{"use strict";Ji=["Amber","Brave","Bright","Calm","Clever","Copper","Eager","Early","Fleet","Gentle","Golden","Happy","Keen","Kind","Lucky","Merry","Nimble","Noble","Quick","Quiet","Rapid","Ready","Royal","Silver","Steady","Sunny","Swift","Tidy","True","Warm","Wise","Zesty"],Xi=["Badger","Beaver","Bison","Falcon","Ferret","Finch","Gibbon","Heron","Ibex","Jaguar","Kestrel","Lemur","Lynx","Marten","Meerkat","Osprey","Otter","Panda","Puffin","Quokka","Rabbit","Raven","Robin","Salmon","Sparrow","Stoat","Tapir","Teal","Vole","Walrus","Weasel","Wombat"]});function nl(e){if(e)return Qi.some(t=>t.id===e)?e:C1[e]}function ay(e){let t=nl(e);return t?Qi.find(r=>r.id===t)?.url:void 0}function mT(e){return Qi.some(t=>t.id===e)}var A1,I1,Qi,C1,fT=w(()=>{"use strict";A1="https://gamestage.ai",I1=["peep-afro-smile","peep-bald-sunglasses","peep-bangs-cute","peep-beanie-beard","peep-bun-glasses","peep-buns-happy","peep-cap-smile","peep-cornrows-calm","peep-curly-glasses","peep-dreads-driven","peep-flattop-serious","peep-gray-moustache","peep-graybun-smile","peep-hijab-grin","peep-knots-awe","peep-long-smile","peep-longafro-closed","peep-medium-suspicious","peep-mohawk-lol","peep-pomp-cheeky","peep-shaved-beard","peep-short-sunglasses","peep-turban-beard","peep-twists-grin"],Qi=I1.map(e=>({id:e,url:`${A1}/avatars/${e}.svg`})),C1={"nigiri-salmon":"peep-afro-smile","nigiri-tuna":"peep-bun-glasses","nigiri-tamago":"peep-beanie-beard","maki-roll":"peep-hijab-grin","california-roll":"peep-mohawk-lol",futomaki:"peep-gray-moustache",temaki:"peep-dreads-driven",onigiri:"peep-bangs-cute","ramen-bowl":"peep-turban-beard","miso-soup":"peep-bald-sunglasses",udon:"peep-knots-awe",gyoza:"peep-curly-glasses",edamame:"peep-pomp-cheeky","tempura-prawn":"peep-cornrows-calm",takoyaki:"peep-graybun-smile",sashimi:"peep-cap-smile","chopsticks-rest":"peep-twists-grin","soy-sauce":"peep-flattop-serious","sake-set":"peep-medium-suspicious",mochi:"peep-buns-happy"}});import{createHash as P1}from"node:crypto";function Ot(e){return NS({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function gT(e){let t=Date.parse(e);if(Number.isNaN(t))return 1;let r=Date.parse(`${e.slice(0,10)}T00:00:00.000Z`)+864e5;return Math.max(1,Math.ceil((r-t)/1e3))}function rl(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function O1(e){return P1("sha256").update(Tc(e)).digest("hex")}function bT(e){let{tenant:t,playerId:r,store:o,rules:n}=e,i=e.now??(()=>new Date().toISOString()),a=0,s=e.newPlayId??(()=>`play_${++a}_${r}`),d=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=T=>T;function p(T,_){return!n.settle||!T.round.can.results_available||_.outcome!=="pending"?_:n.settle({secret:T.secret,state:_,limits:T.limits,now:i()})}function h(T){if(!T.fusedUntil)return 0;let _=Math.ceil((Date.parse(T.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite(_)&&_>0?_:0}async function m(T,_){let b=e.fuse?.note(t,Yi(r),_);if(!b)return;let v=new Date(Date.parse(i())+b.holdSeconds*1e3).toISOString();if(b.kind==="stop")try{await o.setFuse(t,T,v)}catch(j){mn({event:"fuse_write_failed",tenant:t,round_id:T,name:Gn(j)})}try{await e.onFuse?.({...b,until:v})}catch(j){mn({event:"fuse_notify_failed",tenant:t,round_id:T,name:Gn(j)})}}function y(T){let _=h(T)>0,b=rl({limits:T.limits,now:i()});return!_&&!b?T.round:{...T.round,can:{...T.round.can,accepting_plays:!1}}}function x(T,_){let b=T.round.number??Number.POSITIVE_INFINITY,v=_.round.number??Number.POSITIVE_INFINITY;return b!==v?b-v:T.round.id.localeCompare(_.round.id)}async function O(T){let _=T.round.id,b=await o.getState(t,_,r);return b?{state:b.state,version:b.version}:{state:{...n.initialState({playerId:r,roundId:_,limits:T.limits,now:i(),round:T.round,secret:T.secret}),started_at:i()},version:void 0}}async function M(T,_,b,v){if(_.timerSeconds===void 0||v!==void 0)return b;try{if(await o.putStateIfVersion(t,b,void 0))return b}catch(Y){return mn({event:"round_open_write_failed",tenant:t,round_id:T,name:Gn(Y)}),b}return(await o.getState(t,T,r))?.state??b}let H=(T,_,b)=>({...d(),play_id:s(),outcome:T,reason:_,round_version:b,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...d()}},async getCurrentRound(){let T=await o.getCurrentRound(t);if(!T)throw new Error(sy);return{...y(T),...d()}},async getRound(T){let _=await o.getRound(t,T);return _?{...y(_),...d()}:void 0},async getRoundPool(){let[T,_]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),b=_?.round.id,v=[...T].sort(x).map(j=>{let Y=y(j);return{id:Y.id,number:Y.number,version:Y.version,can:Y.can,opens_at:Y.opens_at,locks_at:Y.locks_at,current:Y.id===b,theme:typeof Y.challenge?.theme=="string"?Y.challenge.theme:""}});return{...d(),rounds:v}},async getPlayedRounds(){let T=await o.listStatesForPlayer(t,r);return{...d(),player_id:r,played:T.map(_=>({round_id:_.round_id,finished:_.finished,score:_.score,outcome:_.outcome,..._.server_time?{last_played_at:_.server_time}:{}})).sort((_,b)=>_.round_id.localeCompare(b.round_id))}},async getNextRound(){let[T,_]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),b=new Set(_.filter(X=>X.finished).map(X=>X.round_id)),v=new Set(_.map(X=>X.round_id)),j=[...T].filter(X=>y(X).can.accepting_plays&&!b.has(X.round.id)).sort(x),Y=j.find(X=>!v.has(X.round.id))??j[0];return Y?{...d(),status:"ready",round:{...y(Y),...d()}}:{...d(),status:"exhausted"}},async getRoundState(T){let _=await o.getRound(t,T);if(!_)throw new Error(sy);let b=l(_),{state:v,version:j}=await O(b),Y=await M(T,b.limits,v,j),X=p(b,Y);return X!==Y&&X.finished&&await o.recordScore(t,T,r,X.score),{...X,...d()}},async getProfile(){let T=await o.getProfile(t,r),_=(await o.getIdentities(t,[r]))[r],b=_?.avatar??T.avatar;return{...T,display_name:tl(r,_?.display_name??T.display_name),...b?{avatar:nl(b),avatar_url:ay(b)}:{},...d()}},getIdentityOptions(){return{adjectives:[...Ji],animals:[...Xi],avatars:Qi.map(T=>({...T})),...d()}},async setIdentity(T){let _;return T.name&&(_=hT(T.name.adjective,T.name.animal),!_)?{ok:!1,reason:"That name is not one of the offered words. Choose from the lists."}:T.avatar!==void 0&&!mT(T.avatar)?{ok:!1,reason:"That avatar is not one of the offered pictures."}:(await o.setIdentity(t,r,{..._?{display_name:_}:{},...T.avatar?{avatar:T.avatar}:{}}),{ok:!0,profile:await this.getProfile()})},async recordRecoveryDigest(T,_){if(!Xc(r))return{ok:!1,reason:"Only a player who has not signed in can have a recovery code."};let{replaced:b}=await o.putRecoveryDigest(t,r,T,_);return{ok:!0,replaced:b}},async getRecoveryStatus(){let T=await o.recoveryIssuedAt(t,r);return{has_code:!!T,issued_at:T??null}},playerForRecoveryDigest(T){return o.playerForRecoveryDigest(t,T)},async getLeaderboard(T){let _=await o.getCurrentRound(t),b=_?.round.id??"",v=_?.limits,j=await o.getLeaderboard(t,b,{limit:T,viewerId:r,order:v?.scoreOrder??"high_first"}),Y=[...j.entries.map(me=>me.player_id),...j.me?[j.me.player_id]:[]],X=Y.length?await o.getIdentities(t,Y):{},se=me=>{let ye=X[me.player_id];return ye?{...me,...ye.display_name?{display_name:ye.display_name}:{},...ye.avatar?{avatar:nl(ye.avatar),avatar_url:ay(ye.avatar)}:{}}:me};return{...j,entries:j.entries.map(se),...j.me?{me:se(j.me)}:{},...d()}},async play(T,_){let b=await o.getRound(t,T);if(!b)return H("rejected",sy,0);let v=l(b);if(e.runtime.identity?.required&&Xc(r))return H("rejected",e.identityRefusal??"identity_required",v.round.version);if(h(v)>0)return{...H("busy","fair_use",v.round.version),retry_after_seconds:h(v)};if(v.limits.playsPerSecond!==void 0){let Se=i().slice(0,19),Be=await o.countPlay(t,T,Se,r,3600),kt=Math.max(1,Math.ceil(v.limits.playsPerSecond/Be.buckets));if(Be.inBucket>kt)return await m(T,Se),{...H("busy","capped",v.round.version),retry_after_seconds:1}}if(v.limits.playsPerDay!==void 0){let Se=i().slice(0,10);if(await o.countGameDay(t,T,Se,gT(i())+3600)>v.limits.playsPerDay)return await m(T,Se),{...H("busy","capped_today",v.round.version),retry_after_seconds:gT(i())}}let j=O1({round_id:T,round_version:_.round_version,challenge_instance_id:_.challenge_instance_id,payload:_.payload}),Y=Se=>Se.intent!==void 0&&Se.intent.fingerprint!==j,X=await o.getPlay(t,r,_.idempotency_key);if(X)return Y(X)?H("rejected",yT,v.round.version):{...X.result,...d(),outcome:"duplicate"};let se=qx(_.payload,n.archetype),me=se!==void 0&&(n.operations?n.operations.includes(se):Jx(n.archetype,se));if(_.payload.op!==void 0&&!me)return H("rejected","unknown_operation",v.round.version);let{state:ye,version:pt}=await O(v),wt=n.admissible({accepting:v.round.can.accepting_plays,roundVersion:v.round.version,playedVersion:_.round_version,challengeInstanceId:v.round.challenge_instance_id??null,playedChallengeInstanceId:_.challenge_instance_id??null,state:ye,secret:v.secret,limits:v.limits,now:i()});if(!wt.ok){let Se=wt.reason==="round_version"?"stale":"rejected";return H(Se,wt.reason,v.round.version)}if(rl({limits:v.limits,now:i()}))return H("rejected","lock_deadline_passed",v.round.version);let le=n.mark({payload:_.payload,secret:v.secret,state:ye,limits:v.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(le.outcome!=="accepted")return H("rejected",le.reason??"rejected",v.round.version);let he={...d(),play_id:s(),outcome:le.outcome,round_version:v.round.version,marked:le.marked,feedback:le.feedback,round_state:{...le.next,...d()}},Q=`play:${JSON.stringify([t,r,_.idempotency_key])}`,_t=[{id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.committed",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,outcome:he.outcome,marked:he.marked,round_version:he.round_version,score_before:ye.score,score_after:le.next.score,attempts_used:le.next.attempts_used,attempts_allowed:le.next.attempts_allowed,mistakes_used:le.next.mistakes_used,mistakes_allowed:le.next.mistakes_allowed,...n.auditDetail({secret:v.secret,before:ye,decision:le,payload:_.payload})}}],Ze=le.marked&&(le.participation?.score??!0),bn=le.participation?.profile??!0;Ze&&_t.push({id:`score:${JSON.stringify([t,r,_.idempotency_key])}`,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"score.recorded",detail:{play_id:he.play_id,score_before:ye.score,score_after:le.next.score,marked:!0,outcome:le.next.outcome}});let ht=bn&&le.next.finished&&!ye.finished?Ec(await o.getProfile(t,r),le.next.outcome,{...Ze?{score:le.next.score}:{},exact:le.next.progress?.exact===!0}):void 0,rt=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:_.idempotency_key,date:i().slice(0,10),play:{result:he,intent:{fingerprint:j,round_id:T,round_version:_.round_version}},state:le.next,expectedVersion:pt,audit:_t,...Ze?{score:{roundId:T,score:le.next.score,...le.next.progress?.exact===!0?{exact:!0}:{}}}:{},...ht?{profile:ht}:{},round:{roundId:T,version:v.round.version,sharded:v.sharded===!0}});if(!rt.ok&&rt.reason==="contended")return H("busy","contended",v.round.version);if(!rt.ok&&rt.reason==="play_exists"){let Se=await o.getPlay(t,r,_.idempotency_key);return Se&&Y(Se)?H("rejected",yT,v.round.version):Se?{...Se.result,...d(),outcome:"duplicate"}:(mn({stage:"play_receipt_missing",tenant:t,round_id:T,player_id:r}),H("rejected","play_conflict",v.round.version))}if(!rt.ok&&rt.reason==="round_changed"){let Se=await o.getRound(t,T),Be=Se===void 0||Se.round.version!==v.round.version,kt=Be?"round_changed":"round_closed";return await o.appendAudit({id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.refused",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,reason:kt,decided_against_version:v.round.version,attempt_spent:!1}}),H(Be?"stale":"rejected",kt,Se?.round.version??v.round.version)}return rt.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),he):(await o.appendAudit({id:Q,at:he.server_time,tenant:t,round_id:T,player_id:r,action:"play.refused",detail:{play_id:he.play_id,idempotency_key:_.idempotency_key,reason:"round_version",attempt_spent:!1}}),H("stale","round_version",v.round.version))}}}var Nt,yT,sy,Qt=w(()=>{"use strict";ny();Qc();el();iy();fT();we();Nt="time_expired";yT="idempotency_conflict",sy="round_not_found"});function N1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function R1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=t.picks.filter(v=>r.targets.includes(v)&&!i.has(v)),s=t.picks.filter(v=>!r.targets.includes(v)),d=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let v of a)i.add(v);let p=i.size>=r.required,h=l>=n.mistakesAllowed,m=d>=n.attemptsAllowed,y=p||h||m,x=e.markAtSettlement?o.score:a.length*Math.max(0,r.pointsPerTarget-(r.mistakePenalty??0)*o.mistakes_used)+o.score+(p?r.completionBonus:0),O=r.figures,M={...o.progress.figures??{}};if(O?.perGuess&&!e.markAtSettlement)for(let v of s)v in O.values&&(M[v]=O.values[v]);let H=y&&!e.markAtSettlement,T=H&&O?{answer:r.targets,reveal:[{slate:"board",label:O.label,scale:O.scale,entries:Object.entries(O.values).map(([v,j])=>({key:v,label:v,value:j,...O.sources?.[v]?{source:O.sources[v]}:{}}))}],...r.facts?.length?{facts:r.facts}:{}}:H&&r.facts?.length?{facts:r.facts}:{},_={...o,server_time:e.now,attempts_used:d,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],...O?{figures:M,figure_label:O.label,figure_scale:O.scale}:{},...T},score:x,finished:y,outcome:e.markAtSettlement?"pending":p?"won":y?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:_}:{outcome:"accepted",marked:!0,feedback:t.picks.map(v=>({key:v,verdict:r.targets.includes(v)?"correct":"wrong"})),next:_}}function L1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var cy,ly=w(()=>{"use strict";Qt();cy={archetype:"hunt",admissible:N1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return R1({...e,attempt:{picks:t}})},initialState:L1,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[];return{correct_picks:t.feedback.filter(n=>n.verdict==="correct").length,picks_submitted:o.length,points_per_target:e.pointsPerTarget,completion_bonus:e.completionBonus}}}});function D1(e,t,r,o){let n=e.scoring;if(n?.mode!=="proximity")return{mode:"total"};let i=r?0:Math.floor(t/n.pointsPer),a=!r&&o&&t===e.target?n.exactBonus:0;return{mode:"proximity",per:n.pointsPer,base:i,bonus:a}}function j1(e,t,r,o){let n=e.scoring;if(n?.mode!=="proximity")return r?e.target-t:t;if(r)return 0;let i=Math.floor(t/n.pointsPer);return o&&t===e.target?i+n.exactBonus:i}function M1(e){return e.slates.map(t=>({slate:t.id,label:t.label,entries:t.entries.map(r=>({key:r.key,label:r.label,value:r.value,...r.source?{source:r.source}:{}}))}))}function dy(e){let t=e.progress;return{total:typeof t.total=="number"?t.total:0,picks:Array.isArray(t.picks)?t.picks:[],bust:t.bust===!0}}function U1(e,t){if(t>e.target)return e.bustLabel;let r=(e.target-t)/e.target;for(let o of e.tiers)if(r<=o.within)return o.label;return e.floorLabel}function z1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function F1(e){let{secret:t,state:r,limits:o}=e,n=dy(r),i=H=>({outcome:"rejected",reason:H,marked:!1,feedback:[],next:r});if(e.attempt.picks.length!==1)return i("one_pick_per_play");let a=t.slates[r.attempts_used];if(!a)return i("picks_exhausted");let[s]=e.attempt.picks,d=a.entries.find(H=>H.key===s);if(!d)return i("not_on_slate");let l=n.total+d.value,p=l>t.target,h=[...n.picks,{slate:a.id,key:d.key,label:d.label,value:d.value}],m=r.attempts_used+1,y=m>=o.picksAllowed,x=p||y,O={...r,server_time:e.now,attempts_used:m,attempts_allowed:o.picksAllowed,progress:{total:l,picks:h,bust:p,...x?{tier:U1(t,l),exact:!p&&l===t.target,reveal:M1(t),...t.facts?.length?{facts:t.facts}:{},points:D1(t,l,p,x)}:{}},score:e.markAtSettlement?r.score:j1(t,l,p,x),finished:x,outcome:e.markAtSettlement?"pending":p?"lost":x?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:O}:{outcome:"accepted",marked:!0,feedback:[{key:d.key,verdict:p?"wrong":"correct",label:String(d.value)}],next:O}}function G1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.picksAllowed,mistakes_used:0,mistakes_allowed:0,progress:{total:0,picks:[],bust:!1},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var uy,py=w(()=>{"use strict";Qt();uy={archetype:"push",admissible:z1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return F1({...e,attempt:{picks:t}})},initialState:G1,auditDetail({secret:e,before:t,decision:r}){let o=dy(t),n=dy(r.next);return{target:e.target,total_before:o.total,total_after:n.total,bust:n.bust,picks_committed:n.picks.length,...n.tier?{tier:n.tier}:{}}}}});function K1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:e.state.mistakes_used>=e.limits.mistakesAllowed?{ok:!1,reason:"mistakes_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function H1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=new Set(Array.isArray(o.progress.solved)?o.progress.solved:[]),a=Array.isArray(o.progress.revealed)?o.progress.revealed:[],s=r.groups.filter(v=>!i.has(v.key)),d=s.find(v=>B1(v.members,t.picks)),l=o.attempts_used+1,p=o.mistakes_used+(d?0:1);d&&(i.add(d.key),a.push({key:d.key,label:d.label,members:[...d.members]}));let h=i.size>=r.groups.length,m=p>=n.mistakesAllowed,y=l>=n.attemptsAllowed,x=h||m||y,O=e.markAtSettlement?o.score:o.score+(d?r.pointsPerGroup:0)+(h?r.completionBonus:0),M={...o,server_time:e.now,attempts_used:l,attempts_allowed:n.attemptsAllowed,mistakes_used:p,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i],revealed:a},score:O,finished:x,outcome:e.markAtSettlement?"pending":h?"won":x?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:M};let H=s.reduce((v,j)=>Math.max(v,W1(t.picks,j)),0),T=!d&&t.picks.length>1&&H===t.picks.length-1,_=d?"correct":T?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((v,j)=>({key:v,verdict:_,...d&&j===0?{label:d.label}:{}})),next:M}}function V1(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{solved:[],revealed:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var B1,W1,vT,wT=w(()=>{"use strict";Qt();B1=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,W1=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;vT={archetype:"group",admissible:K1,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return H1({...e,attempt:{picks:t}})},initialState:V1,auditDetail({secret:e,decision:t,payload:r}){let o=Array.isArray(r.picks)?r.picks:[],n=t.feedback[0]?.verdict;return{group_found:n==="correct"?t.next.progress.solved.at(-1):null,near_miss:n==="close",picks_submitted:o.length,groups_total:e.groups.length,points_per_group:e.pointsPerGroup}}}});function Z1(e,t){if(t.answers)return t.answers;if(t.pick===void 0)return{};let r=e.questions[0];return r?{[r.id]:t.pick}:{}}function Y1(e,t){return e.kind==="number"?!(typeof t!="number"||!Number.isFinite(t)||e.min!==void 0&&t<e.min||e.max!==void 0&&t>e.max):typeof t=="string"&&(e.options??[]).some(r=>r.key===t)}function q1(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function J1(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=Z1(r,t),a=o.attempts_used+1;if(r.questions.filter(p=>i[p.id]===void 0).length>0)return{outcome:"rejected",reason:"incomplete_prediction",marked:!1,feedback:[],next:o};let d=r.questions.find(p=>!Y1(p,i[p.id]));if(d)return{outcome:"rejected",reason:d.kind==="number"?"out_of_range":"unknown_option",marked:!1,feedback:[],next:o};let l={...o,server_time:e.now,attempts_used:a,attempts_allowed:n.attemptsAllowed,progress:{...o.progress,answers:i},finished:a>=n.attemptsAllowed};return r.questions.some(p=>p.result===void 0)?{outcome:"accepted",marked:!1,feedback:[],next:{...l,outcome:"pending"}}:{outcome:"accepted",marked:!0,feedback:X1(r,i),next:_T(r,l,i)}}function X1(e,t){return e.questions.map(r=>{let o=t[r.id],n=bc(r,o,e.pointsForCorrect),i=r.kind==="number"?String(r.result):(r.options??[]).find(a=>a.key===r.result)?.label;return{key:r.id,verdict:n===e.pointsForCorrect||n>0&&r.kind!=="number"?"correct":n>0?"partial":"wrong",...i?{label:i}:{}}})}function _T(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=bc(i,r[i.id],e.pointsForCorrect);o+=a,a!==bc(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function Q1(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=eL(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{..._T(t,r,o),server_time:e.now}}function eL(e){let t=e.progress.answers;if(t&&typeof t=="object"&&!Array.isArray(t))return t;let r=Array.isArray(e.progress.picks)?e.progress.picks:[];return r.length>0?{1:r[0]}:{}}function tL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{answers:{}},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var kT,xT=w(()=>{"use strict";we();Qt();kT={archetype:"predict",admissible:q1,mark(e){let t=e.payload.answers,r=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0,o=typeof e.payload.pick=="string"?e.payload.pick:Array.isArray(e.payload.picks)&&typeof e.payload.picks[0]=="string"?e.payload.picks[0]:void 0;return J1({...e,attempt:r?{answers:r}:{pick:o}})},initialState:tL,settle:Q1,auditDetail({secret:e,decision:t,payload:r}){let o=r.answers;return{predicted:o&&typeof o=="object"&&!Array.isArray(o)?o:typeof r.pick=="string"&&e.questions[0]?{[e.questions[0].id]:r.pick}:null,settled_at_commit:e.questions.every(i=>i.result!==void 0),marked:t.marked,questions_asked:e.questions.length}}}});function nL(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function hy(e){let r=e.progress?.boards;if(!(!Array.isArray(r)||r.length===0)&&r.every(o=>Array.isArray(o)&&o.every(n=>typeof n=="string")))return r}function rL(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function oL(e){let t=hy(e),r=rL(e);if(!t||r===void 0)return;let o=t[r];if(!o)return;let n=e.progress,i=typeof n?.centre=="string"?n.centre:void 0;return{cells:o,centre:i}}function iL(e){let t=nL(e),r=[...e.cardPool],o=[],n={},i={};for(let a=0;a<t&&r.length>0;a++){let s=Math.floor(Math.random()*r.length),d=r.splice(s,1)[0];o.push(d.key),n[d.key]=d.label,d.note&&(i[d.key]=d.note)}return{board:o,cards:n,notes:i}}function ST(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function aL(e,t){let{rows:r,columns:o,centreMode:n}=e,i=n!=="none",a=i?Math.floor(r/2):-1,s=i?Math.floor(o/2):-1,d=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let m=p*o+h,y=i&&m>a*o+s?1:0;return t.cells[m-y]},l=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)l.push(Array.from({length:o},(m,y)=>d(h,y)).filter(m=>!!m));else if(p==="column")for(let h=0;h<o;h++)l.push(Array.from({length:r},(m,y)=>d(y,h)).filter(m=>!!m));else if(p==="diagonal"&&r===o)l.push(Array.from({length:r},(h,m)=>d(m,m)).filter(h=>!!h)),l.push(Array.from({length:r},(h,m)=>d(m,r-1-m)).filter(h=>!!h));else if(p==="full_board"){let h=[...t.cells,...t.centre?[t.centre]:[]];l.push(h)}return l.filter(p=>p.length>0)}function sL(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:rl({limits:e.limits,now:e.now})?{ok:!1,reason:"lock_deadline_passed"}:e.state.finished?{ok:!1,reason:"already_locked"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function cL(e){let{secret:t,state:r,limits:o}=e;if(hy(r)!==void 0)return{outcome:"rejected",reason:"already_dealt",marked:!1,feedback:[],next:r};let n=Math.max(1,o.shuffleAllowance+1),i=[],a={},s={};for(let d=0;d<n;d++){let l=iL(t);i.push(l.board),Object.assign(a,l.cards),Object.assign(s,l.notes)}return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,attempts_used:o.shuffleAllowance,attempts_allowed:o.shuffleAllowance,progress:{...r.progress,boards:i,cards:a,...Object.keys(s).length>0?{notes:s}:{}}}}}function lL(e){let{secret:t,state:r}=e,o=hy(r);if(o===void 0)return{outcome:"rejected",reason:"no_board_dealt",marked:!1,feedback:[],next:r};let n=typeof e.board=="number"?e.board:void 0;if(n===void 0||!Number.isInteger(n)||n<0||n>=o.length)return{outcome:"rejected",reason:"unknown_board",marked:!1,feedback:[],next:r};let i={cells:o[n]},a=typeof e.centre=="string"?e.centre:void 0;if(t.centreMode==="none"){if(a!==void 0)return{outcome:"rejected",reason:"centre_not_offered",marked:!1,feedback:[],next:r}}else if(t.centreMode==="choice"){if(a===void 0||!(t.centreOptions??[]).includes(a))return{outcome:"rejected",reason:"invalid_centre",marked:!1,feedback:[],next:r};if(!t.allowCentreDuplicate&&i.cells.includes(a))return{outcome:"rejected",reason:"centre_duplicates_board",marked:!1,feedback:[],next:r}}let s=t.centreMode==="choice"?a:void 0;return{outcome:"accepted",marked:!1,feedback:[],next:{...r,server_time:e.now,finished:!0,outcome:"pending",progress:{...r.progress,chosen:n,...s?{centre:s}:{}}}}}function dL(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=oL(r);if(o===void 0)return r;let n=aL(t,o),i=n.filter(m=>ST(m,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(m=>t.cardStatus?.[m]==="correct"),d=a.some(m=>t.cardStatus?.[m]===void 0),l=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let m of a){let y=t.cardStatus?.[m];y&&(p[m]=y)}let h=n.map(m=>{let y=ST(m,t.cardStatus),x=m.filter(M=>t.cardStatus?.[M]==="correct").length,O=m.some(M=>t.cardStatus?.[M]==="incorrect");return{cards:m,complete:y,oneAway:!y&&!O&&x===m.length-1}});return{...r,server_time:e.now,score:l,progress:{...r.progress,marks:p,lines:h},outcome:d?"pending":i>0||s?"won":"lost"}}function uL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.shuffleAllowance,mistakes_used:0,mistakes_allowed:0,progress:{},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}function pL(e){return e.op==="deal"||e.op==="reshuffle"?cL({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?lL({secret:e.secret,state:e.state,centre:e.centre,board:e.board,now:e.now}):{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}}var ET,TT=w(()=>{"use strict";Qt();ET={archetype:"bingo",admissible:sL,mark(e){let t=e.payload.op;return t!=="deal"&&t!=="reshuffle"&&t!=="lock"?{outcome:"rejected",reason:"unknown_operation",marked:!1,feedback:[],next:e.state}:pL({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:uL,settle:dL,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as hL}from"node:crypto";function ea(e,t,r){return hL("sha256",Buffer.from(e.entropy,"hex")).update(["gamestage-shoot",t,e.roundId,e.playerId,e.model,e.profile,String(e.shotIndex)].join("|")).digest().readUInt32BE(0)%r}function AT(e){let t=$T[e.profile];return{targetX:ea(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:ea(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:ea(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:ea(e,"dispersion_x",2001)-1e3,dispersionY:ea(e,"dispersion_y",2001)-1e3}}function IT(e,t,r){let o=$T[r],n=Zt,i=n.ballRadius,a=o.maxFlightMs-Math.floor((o.maxFlightMs-o.minFlightMs)*e.power/1e3),s=o.baseSpread+Math.floor(o.spreadPerPower*e.power/1e3),d=e.aimX+Math.trunc(t.dispersionX*s/1e3),l=Math.max(i,e.aimY+Math.trunc(t.dispersionY*s/1e3)),p=100+Math.floor((1e3-e.power)/5),h=Math.max(0,a-t.reactionMs),m=Math.floor(h*o.speedPerSecond/1e3),y=t.targetX-n.keeperStart.x,x=t.targetY-n.keeperStart.y,O=Math.round(Math.hypot(y,x)),M=O===0?0:Math.min(1,m/O),H=n.keeperStart.x+Math.trunc(y*M),T=n.keeperStart.y+Math.trunc(x*M),_={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:H,endY:T,diveStartMs:t.reactionMs},b={endX:d,endY:l,arcHeight:p},v=(ye,pt)=>({result:ye,replay:{flightMs:a,ball:b,keeper:_,contact:pt}}),j=Math.abs(d),Y=j+i>=n.postX&&j-i<=n.postX+n.postWidth&&l-i<=n.barY+n.barHeight,X=l+i>=n.barY&&l-i<=n.barY+n.barHeight&&j-i<=n.postX+n.postWidth;return Y?v("frame",{with:"post",x:Math.sign(d||1)*n.postX,y:l,atMs:a}):X?v("frame",{with:"bar",x:d,y:n.barY,atMs:a}):j+i<n.postX&&l+i<n.barY?Math.abs(d-H)<=o.reachX+i&&Math.abs(l-T)<=o.reachY+i?v("saved",{with:"keeper",x:d,y:l,atMs:a}):v("goal",null):v("wide",null)}var $T,CT=w(()=>{"use strict";ro();$T={easy_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:180,reactionMaxMs:340,speedPerSecond:1600,reachX:220,reachY:260},balanced_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:120,reactionMaxMs:280,speedPerSecond:2200,reachX:280,reachY:320},hard_v1:{baseSpread:40,spreadPerPower:150,minFlightMs:420,maxFlightMs:900,diveMaxX:900,diveMinY:150,diveMaxY:750,reactionMinMs:80,reactionMaxMs:200,speedPerSecond:2800,reachX:320,reachY:360}}});function mL(e,t){let r=e.progress;return{kind:"shoot",model:r.model??t.model,profile:r.profile??t.profile,goals:typeof r.goals=="number"?r.goals:0,shots:Array.isArray(r.shots)?r.shots:[]}}function fL(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function gL(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function yL(e){if(e.code==="unrecognized_keys")return"unexpected_field";let t=String(e.path[0]??"");return t==="op"?"unknown_operation":t==="model"?"unknown_model":t==="aimX"||t==="aimY"?"aim_out_of_range":t==="power"?"power_out_of_range":"invalid_shot"}function bL(e){let{secret:t,state:r,limits:o}=e,n=T=>({outcome:"rejected",reason:T,marked:!1,feedback:[],next:r});if(!fL(t.entropy))return n("entropy_missing");if(t.model!==Nn)return n("unknown_model");let i=sg.safeParse(e.payload.op===void 0?{...e.payload,op:no}:e.payload);if(!i.success)return n(yL(i.error.issues[0]));let a=i.data;if(r.attempts_used>=o.attemptsAllowed)return n("shootout_spent");if(a.shotIndex!==r.attempts_used)return n("shot_index_mismatch");let s=AT({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),d=IT({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),l=mL(r,t),p=d.result==="goal",h=p?t.pointsPerGoal:0,m=l.goals+(p?1:0),y={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:d.result,points:h,replay:d.replay},x=r.attempts_used+1,O=x>=o.attemptsAllowed,M={...r,server_time:e.now,attempts_used:x,attempts_allowed:o.attemptsAllowed,progress:{...l,goals:m,shots:[...l.shots,y]},score:m*t.pointsPerGoal,finished:O,outcome:O?m>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:d.result}],next:M}}function vL(e){let t=e.secret??{};return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:0,progress:{kind:"shoot",model:t.model??Nn,profile:t.profile??Ii,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var PT,OT=w(()=>{"use strict";we();Qt();CT();PT={archetype:"shoot",admissible:gL,mark:bL,initialState:vL,auditDetail({before:e,decision:t,payload:r}){let o=t.next.progress.shots?.at(-1),n=t.outcome==="accepted"&&o!==void 0;return{op:r.op??no,accepted:n,...t.outcome==="rejected"?{refused:t.reason}:{},...n?{shot_index:o.shotIndex,aim_x:o.aimX,aim_y:o.aimY,power:o.power,result:o.result,points:o.points,goals_before:e.progress.goals??0,goals_after:t.next.progress.goals??0}:{}}}}});function wL(e){let t=e.progress;return{kind:"place",filled:typeof t.filled=="number"?t.filled:0,placements:Array.isArray(t.placements)?t.placements:[],skipsUsed:typeof t.skipsUsed=="number"?t.skipsUsed:0}}function _L(e){return e.accepting?e.playedVersion!==e.roundVersion?{ok:!1,reason:"round_version"}:e.challengeInstanceId!==null&&e.playedChallengeInstanceId!==e.challengeInstanceId?{ok:!1,reason:"challenge_instance_id"}:e.state.finished?{ok:!1,reason:"round_finished"}:Ot(e)?{ok:!1,reason:Nt}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"deck_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function xL(e){let{secret:t,state:r,limits:o}=e,n=wL(r),i=m=>({outcome:"rejected",reason:m,marked:!1,feedback:[],next:r}),a=e.payload.op===void 0?"place":e.payload.op;if(a!=="place"&&a!=="skip")return i("unknown_operation");for(let m of Object.keys(e.payload))if(!kL[a].includes(m))return i("unexpected_field");let s=e.payload.itemIndex;if(typeof s!="number"||!Number.isInteger(s)||s<0)return i("invalid_item");if(s!==r.attempts_used)return i("item_index_mismatch");if(r.attempts_used>=o.attemptsAllowed)return i("deck_spent");let d=(m,y)=>{let x=r.attempts_used+1,O=r.mistakes_used+(y.mistake?1:0),M={...n,...m},H=M.filled>=t.cells.length,T=O>=o.mistakesAllowed,_=x>=o.attemptsAllowed,b=H||T||_,v={...r,server_time:e.now,attempts_used:x,attempts_allowed:o.attemptsAllowed,mistakes_used:O,mistakes_allowed:o.mistakesAllowed,progress:M,score:M.filled*t.pointsPerPlacement+(H?t.fullHouseBonus:0),finished:b,outcome:b?H?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:y.feedback,next:v}};if(a==="skip")return n.skipsUsed>=o.skipsAllowed?i("skips_exhausted"):d({skipsUsed:n.skipsUsed+1},{mistake:!1,feedback:[]});let l=e.payload.cell;if(typeof l!="string"||!t.cells.includes(l))return i("unknown_cell");if(n.placements.some(m=>m.cell===l))return i("cell_filled");let p=t.deck[s];return(p!==void 0&&t.qualifies[p]?.includes(l))??!1?d({filled:n.filled+1,placements:[...n.placements,{itemIndex:s,cell:l}]},{mistake:!1,feedback:[{key:l,verdict:"correct"}]}):d({},{mistake:!0,feedback:[{key:l,verdict:"wrong"}]})}function SL(e){return{server_time:e.now,snapshot:"",player_id:e.playerId,round_id:e.roundId,attempts_used:0,attempts_allowed:e.limits.attemptsAllowed,mistakes_used:0,mistakes_allowed:e.limits.mistakesAllowed,progress:{kind:"place",filled:0,placements:[],skipsUsed:0},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var kL,NT,RT=w(()=>{"use strict";Qt();kL={place:["op","itemIndex","cell"],skip:["op","itemIndex"]};NT={archetype:"place",operations:["place","skip"],admissible:_L,mark:xL,initialState:SL,auditDetail({before:e,decision:t,payload:r}){let o=t.outcome==="accepted",n=o&&t.feedback[0]?.verdict==="correct";return{op:r.op??"place",accepted:o,...t.outcome==="rejected"?{refused:t.reason}:{},...o?{item_index:typeof r.itemIndex=="number"?r.itemIndex:null,cell:typeof r.cell=="string"?r.cell:null,placed:n,filled_before:e.progress.filled??0,filled_after:t.next.progress.filled??0}:{}}}}});function EL(e){return LT[qe(e)]}function DT(e){return EL(e.archetype??"hunt")}function jT(e){return{server_time:"",snapshot:e.snapshot,game:e.game,api_version:"2.0",archetype:e.archetype,marking:e.marking??"at_commit",challenge_source:e.challengeSource??"shared",schedule:{kind:"local_midnight"},updates:{transport:"poll",freshness_seconds:30},display:{title:e.title??e.game},identity:{required:e.identityRequired??!1,provider:"jwt",anonymous_play:!e.identityRequired},archive:!0,capabilities:["plays","profile","leaderboard","rounds"]}}var LT,vr,ol=w(()=>{"use strict";we();ly();py();wT();xT();TT();OT();RT();LT={hunt:cy,push:uy,group:vT,predict:kT,bingo:ET,shoot:PT,place:NT},vr=Object.keys(LT)});function MT(e){let t=DT(e.round);if(t)return bT({...e,rules:t})}var UT=w(()=>{"use strict";Qt();ol();ly();py();Qt()});function zT(e){let t=new Map,r=new Map,o=(b,v)=>`${v}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,d=new Map,l=new Set,p=new Map,h=new Map,m=new Map,y=new Map,x=new Map,O=new Map,M=new Set,H=e.currentRoundId,T,_=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set($e(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,v){let j=t.get(v);return j?structuredClone(j):void 0},async putRound(b,v,j,Y){if(Y&&h.has(Y.id))throw new Error("audit_record_exists");for(let X=0;X<Jc;X+=1)r.set(o(v.round.id,X),{version:v.round.version,accepting:v.round.can.accepting_plays});t.set(v.round.id,{...structuredClone(v),sharded:!0}),Y&&h.set(Y.id,structuredClone(Y)),j&&(H=v.round.id,T=void 0)},async setRotation(b,v,j){T={roundIds:[...v],windowSeconds:j}},async getCurrentRound(){let b=T?T.roundIds[Math.floor(_()/1e3/T.windowSeconds)%T.roundIds.length]:H,v=t.get(b);return v?structuredClone(v):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,v){return[...n.entries()].filter(([j,Y])=>j.startsWith(`${b}#`)&&Y.state.player_id===v).map(([,j])=>structuredClone(j.state))},async getState(b,v,j){let Y=n.get($e(b,v,j));return Y?structuredClone(Y):void 0},async putStateIfVersion(b,v,j){let Y=$e(b,v.round_id,v.player_id),X=n.get(Y);return j===void 0?X?!1:(n.set(Y,{state:structuredClone(v),version:0}),!0):!X||X.version!==j?!1:(n.set(Y,{state:structuredClone(v),version:X.version+1}),!0)},async getPlay(b,v,j){let Y=i.get($e(b,v,j));return Y?structuredClone(Y):void 0},async putPlayIfAbsent(b,v,j,Y){let X=$e(b,v,j);return i.has(X)?!1:(i.set(X,structuredClone(Y)),!0)},async getLeaderboard(b,v,j){let Y=j?.order??"high_first";if(e.leaderboard)return structuredClone(e.leaderboard);let X=[...a.entries()].filter(([me])=>me.startsWith($e(b,v)+"#")).map(([me,ye])=>({rank:0,player_id:me.slice(me.lastIndexOf("#")+1),display_name:tl(me.slice(me.lastIndexOf("#")+1)),score:ye,...M.has(me)?{exact:!0}:{}})).sort((me,ye)=>Y==="low_first"?me.score-ye.score:ye.score-me.score).map((me,ye)=>({...me,rank:ye+1})),se=j?.limit??X.length;return{server_time:"",snapshot:"",round_id:v,order:Y,tie_break:"earliest_play",entries:X.slice(0,se),total:X.length,truncated:!1,me:j?.viewerId?X.find(me=>me.player_id===j.viewerId):void 0}},async getIdentities(b,v){let j={};for(let Y of v){let X=y.get($e(b,Y));X&&(j[Y]=structuredClone(X))}return j},async setIdentity(b,v,j){let Y=$e(b,v);y.set(Y,{...y.get(Y),...j})},async putRecoveryDigest(b,v,j,Y){let X=$e(b,v),se=O.get(X);return se&&x.delete($e(b,se.digest)),O.set(X,{digest:j,issuedAt:Y}),x.set($e(b,j),v),{replaced:!!se}},async playerForRecoveryDigest(b,v){return x.get($e(b,v))},async recoveryIssuedAt(b,v){return O.get($e(b,v))?.issuedAt},async getProfile(b,v){let j=m.get($e(b,v));return j?structuredClone(j):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:v,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,v,j,Y,X){let se=$e(b,v,j,String(Yi(Y))),me=(s.get(se)??0)+1;return s.set(se,me),{inBucket:me,buckets:Jc}},async countGameDay(b,v,j,Y){let X=$e(b,v,j,"game"),se=(s.get(X)??0)+1;return s.set(X,se),se},async getDailyActivity(b,v){return v.map(j=>({date:j,plays:d.get($e(b,j))??0,players:null}))},async markMonthlyPlayer(b,v,j){let Y=`${$e(b,v)}#${j}`;if(l.has(Y))return;l.add(Y);let X=$e(b,v);p.set(X,(p.get(X)??0)+1)},async getMonthlyPlayers(b,v){return p.get($e(b,v))??0},async setFuse(b,v,j){let Y=t.get(v);Y&&(Y.fusedUntil=j)},async setResult(b,v,j,Y){let X=t.get(v);if(!X)return;let me=X.secret.questions??[],ye=Object.fromEntries(me.map(he=>[he.id,he.result??null]));if(typeof j=="string")me[0]&&(me[0].result=j);else for(let he of me){let Q=j[he.id];Q!==void 0&&(he.result=Q)}let pt=me.every(he=>he.result!==void 0);X.round.challenge={...X.round.challenge,...pt?{questions:me.map(he=>({...X.round.challenge.questions?.find(Q=>Q.id===he.id),id:he.id,result:he.result})),...typeof j=="string"?{result:j}:{}}:{}},X.round.can={...X.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let he=0;he<Jc;he+=1){let Q=r.get(o(v,he));Q&&(Q.accepting=!1)}let wt=new Date().toISOString(),le={id:`settle_${v}_${wt}_${h.size}`,at:wt,tenant:b,round_id:v,player_id:null,action:"round.settled",detail:{version:X.round.version,result:j,before:ye,after:Object.fromEntries(me.map(he=>[he.id,he.result??null])),closed:!0},...Y?{actor:Y.actor}:{},...Y?.correlation_id?{correlation_id:Y.correlation_id}:{}};h.set(le.id,structuredClone(le))},async recordScore(b,v,j,Y){a.set($e(b,v,j),Y)},async appendAudit(b){if(h.has(b.id))throw uT("audit_record_overwrite",{tenant:b.tenant,round_id:b.round_id,action:b.action,record_id:b.id}),new Error("audit_record_exists");h.set(b.id,structuredClone(b))},async commitPlay(b){let v=$e(b.tenant,b.playerId,b.idempotencyKey);if(i.has(v))return{ok:!1,reason:"play_exists"};let j=$e(b.tenant,b.state.round_id,b.state.player_id),Y=n.get(j);if(b.expectedVersion===void 0){if(Y)return{ok:!1,reason:"state_version"}}else if(!Y||Y.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let se of b.audit)if(h.has(se.id))throw new Error("audit_record_exists");if(b.round?.sharded){let se=r.get(o(b.round.roundId,Yi(b.playerId)));if(!se||se.version!==b.round.version||!se.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let se=t.get(b.round.roundId);if(!se||se.round.version!==b.round.version||!se.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set(v,structuredClone(b.play)),n.set(j,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let se of b.audit)h.set(se.id,structuredClone(se));if(b.score){let se=$e(b.tenant,b.score.roundId,b.playerId);a.set(se,b.score.score),b.score.exact?M.add(se):M.delete(se)}b.profile&&m.set($e(b.tenant,b.playerId),structuredClone(b.profile));let X=$e(b.tenant,b.date);return d.set(X,(d.get(X)??0)+1),{ok:!0}}}}var $e,FT=w(()=>{"use strict";iy();ny();el();$e=(...e)=>e.join("#")});import{randomBytes as TL}from"node:crypto";function $L(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,pick:e.required??e.targets.length,prompt:e.prompt}},secret:{targets:e.targets,required:e.required??e.targets.length,pointsPerTarget:e.pointsPerTarget,completionBonus:e.completionBonus,...e.mistakePenalty?{mistakePenalty:e.mistakePenalty}:{},...e.figures?{figures:e.figures}:{},...e.facts?.length?{facts:e.facts}:{}},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function AL(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{theme:e.theme,prompt:e.prompt,target:e.target,target_label:e.targetLabel,unit:e.unit,picks:e.slates.length,slates:e.slates.map(o=>({id:o.id,label:o.label,entries:o.entries.map(n=>({key:n.key,label:n.label}))})),tiers:e.tiers,floor_label:e.floorLabel,bust_label:e.bustLabel,scoring:e.scoring?{mode:e.scoring.mode,points_per:e.scoring.pointsPer,exact_bonus:e.scoring.exactBonus}:{mode:"total"}}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{},...e.scoring?{scoring:e.scoring}:{},...e.facts?.length?{facts:e.facts}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function IL(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{board:e.board,prompt:e.prompt,groups:e.groups.length,group_size:e.groups[0]?.members.length??0}},secret:{groups:e.groups,pointsPerGroup:e.pointsPerGroup,completionBonus:e.completionBonus},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function CL(e,t){let r=zk(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open&&!o,results_available:o,solution_revealed:o,closed:!e.open||o,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,questions:r.map(i=>({id:i.id,kind:i.kind,prompt:i.prompt,...i.options?{options:i.options.map(a=>({key:a.key,label:a.label}))}:{},...i.min!==void 0?{min:i.min}:{},...i.max!==void 0?{max:i.max}:{},...i.step!==void 0?{step:i.step}:{},...o&&i.result!==void 0?{result:i.result}:{}})),...e.options?{options:e.options.map(i=>({key:i.key,label:i.label}))}:{},...o&&e.result!==void 0?{result:e.result}:{}}},secret:{questions:r,pointsForCorrect:e.pointsForCorrect},limits:{attemptsAllowed:e.attemptsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function PL(e,t){let r=LL(e,t);return e.archetype==="bingo"?e.locksAt===void 0?r:{...r,round:{...r.round,locks_at:e.locksAt},limits:{...r.limits,locksAt:e.locksAt}}:e.timerSeconds===void 0?r:{...r,round:{...r.round,timer_seconds:e.timerSeconds},limits:{...r.limits,timerSeconds:e.timerSeconds}}}function OL(e,t){let r=e.cardPool.some(i=>i.result!==void 0),o=e.cardPool.length>0&&e.cardPool.every(i=>i.result!==void 0);return{archetype:"bingo",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:r,solution_revealed:o,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,rows:e.rows,columns:e.columns,centre_mode:e.centreMode,...e.centreMode==="choice"?{centre_options:e.centreOptions??[]}:{},line_types:e.lineTypes,points_per_line:e.pointsPerLine,points_for_full_board:e.pointsForFullBoard}},secret:{rows:e.rows,columns:e.columns,centreMode:e.centreMode,...e.centreOptions?{centreOptions:e.centreOptions}:{},allowCentreDuplicate:e.allowCentreDuplicate,lineTypes:e.lineTypes,cardPool:e.cardPool.map(i=>({key:i.key,label:i.label,...i.note?{note:i.note}:{}})),cardStatus:Object.fromEntries(e.cardPool.filter(i=>i.result!==void 0).map(i=>[i.key,i.result])),pointsPerLine:e.pointsPerLine,pointsForFullBoard:e.pointsForFullBoard},limits:{shuffleAllowance:e.shuffleAllowance,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function NL(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,model:e.model,profile:e.difficulty,shots_allowed:e.shotsAllowed,goals_to_win:e.goalsToWin,points_per_goal:e.pointsPerGoal,input:{aim_x:[lt.aimX.min,lt.aimX.max],aim_y:[lt.aimY.min,lt.aimY.max],power:[lt.power.min,lt.power.max]},geometry:{post_x:Zt.postX,bar_y:Zt.barY,post_width:Zt.postWidth,bar_height:Zt.barHeight,ball_radius:Zt.ballRadius,keeper_start:{x:Zt.keeperStart.x,y:Zt.keeperStart.y}}}},secret:{model:e.model,profile:e.difficulty,shotsAllowed:e.shotsAllowed,goalsToWin:e.goalsToWin,pointsPerGoal:e.pointsPerGoal},limits:{attemptsAllowed:e.shotsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function RL(e,t){let r={server_time:"",snapshot:t,id:cn(e),number:e.number,can:{accepting_plays:e.open,results_available:!1,solution_revealed:!1,closed:!e.open,optimistic_play:!1},challenge_instance_id:null,challenge:{prompt:e.prompt,board:e.board.map(n=>({key:n.key,label:n.label,...n.art!==void 0?{art:n.art}:{}})),deck:e.deck.map(n=>({key:n.key,name:n.name,...n.image!==void 0?{image:n.image}:{}})),points_per_placement:e.pointsPerPlacement,full_house_bonus:e.fullHouseBonus}},o={};for(let n of e.deck)o[n.key]=[];for(let n of e.qualifies)o[n.item]=n.cells;return{archetype:"place",round:r,secret:{cells:e.board.map(n=>n.key),deck:e.deck.map(n=>n.key),qualifies:o,pointsPerPlacement:e.pointsPerPlacement,fullHouseBonus:e.fullHouseBonus},limits:{attemptsAllowed:e.deck.length,mistakesAllowed:e.mistakesAllowed,skipsAllowed:e.skipsAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay},...e.scoreOrder===void 0?{}:{scoreOrder:e.scoreOrder}}}}function LL(e,t){switch(e.archetype){case"hunt":return $L(e,t);case"push":return AL(e,t);case"group":return IL(e,t);case"predict":return CL(e,t);case"bingo":return OL(e,t);case"shoot":return NL(e,t);case"place":return RL(e,t)}}function DL(){return TL(32).toString("hex")}function jL(e,t,r){if(e.archetype!=="shoot")return e;let o=t?.secret?.entropy,n=(t?.archetype??"hunt")==="shoot"&&typeof o=="string"&&o.length>0?o:r();return{...e,secret:{...e.secret,entropy:n}}}function So(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(So).join(",")}]`:`{${Object.entries(e).filter(([,r])=>r!==void 0).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>`${JSON.stringify(r)}:${So(o)}`).join(",")}}`}function GT(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...d}=i,{version:l,...p}=d;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:m,...y}=p.can;return{...p,can:y}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return So({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===So({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function ML(e,t){if(e.archetype!=="bingo"||!GT(e,t,{ignoringSettlement:!0}))return!1;let r=i=>(i??{}).cardStatus??{},o=r(t.secret),n=r(e.secret);for(let[i,a]of Object.entries(o))if(!(i in n)||So(n[i])!==So(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function my(e,t,r,o,n=!0,i,a,s){let d=i??cn(r),l=await e.getRound(t,d),p=jL(PL(r,o),l,s?.newEntropy??DL);if(p.round.id=d,a&&(p.round.origin=a),l&>(p,l)){let{fusedUntil:y,...x}=l;return await e.putRound(t,{...x,archetype:p.archetype},n),{roundId:d,version:l.round.version,changed:!1,current:n}}if(l&&ML(p,l)){let y=Object.keys((p.secret??{}).cardStatus??{}).length;return await e.putRound(t,{...l,round:{...p.round,version:l.round.version},secret:p.secret,limits:p.limits,archetype:p.archetype},n,{id:`round_${d}_settle_v${l.round.version}_${y}`,at:new Date().toISOString(),tenant:t,round_id:d,player_id:null,action:"round.settled",detail:{version:l.round.version,resolved:y,snapshot:o}}),{roundId:d,version:l.round.version,changed:!1,current:n}}let h=l?l.round.version+1:1,m={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,m,n,{id:`round_${d}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:d,player_id:null,action:l?"round.replaced":"round.provisioned",detail:{version:h,snapshot:o,number:r.number,archetype:r.archetype,accepting_plays:r.open}}),{roundId:d,version:h,changed:!0,current:n}}var BT=w(()=>{"use strict";we()});function KT(e,t){let r=e.entries??[],o=r.filter(n=>typeof n.display_name=="string"&&n.display_name.trim().length>0);return{generated_at:t,last_updated:e.server_time??t,...e.round_id!==void 0&&{round_id:e.round_id},order:e.order??"high_first",entries:o.map(n=>({external_id:n.player_id,name:n.display_name.trim(),primary_score:n.score})),withheld:r.length-o.length}}var WT,UL,W5,HT=w(()=>{"use strict";ze();WT="/play/v1/games/{game}/gfx/leaderboard",UL=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),W5=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(UL),withheld:c.number().int().nonnegative()})});import{randomInt as zL}from"node:crypto";function et(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function VT(e,t,r,o,n){let i=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:fy,body:void 0};if(e.method==="GET"&&i===`${Sc}/health`)return Me(200,{status:"ok"});let a=tt.session.exec(i);if(a){if(e.method!=="POST")return Ue(405,"method_not_allowed","This route accepts POST.");let l=decodeURIComponent(a[1]),p=o?.check(lo(l,Mc(e)));if(p&&!p.allowed)return il(p.retryAfterSeconds);let h=r?.issue(l);return h?Me(200,{server_time:"",snapshot:"",token:h.token,player_id:h.playerId,kind:"anonymous"}):Ue(503,"unavailable","This deployment cannot issue a session.",!0)}let s=tt.restoreSession.exec(i);if(s){if(e.method!=="POST")return Ue(405,"method_not_allowed","This route accepts POST.");let l=decodeURIComponent(s[1]),p=Mc(e),h=o?.check(lo(l,p));if(h&&!h.allowed)return il(h.retryAfterSeconds);let m=mE.safeParse(e.body),y=m.success?m.data.code:"",x=y.trim().toLowerCase().split(/[\s\-_.]+/)[0]??"";for(let _ of[`recover:${lo(l,p)}`,`recover-word:${lo(l,x)}`]){let b=n?.check(_);if(b&&!b.allowed)return il(b.retryAfterSeconds)}let O=pE(y);if(!O||!r?.recoveryDigest||!r.sign)return Ue(401,"code_not_recognised",jg);let M;try{M=await t.forPlayer(l,e)}catch(_){return mn({path:e.path,method:e.method,game:l,stage:"resolve",name:Gn(_)}),Ue(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!M)return Ue(404,"not_found",`No game with id "${l}".`);let H=await M.playerForRecoveryDigest(r.recoveryDigest(O));if(!H)return Ue(401,"code_not_recognised",jg);let T=Me(200,{token:r.sign(H),player_id:H,kind:"anonymous",previous_player:"kept"});return T.headers["cache-control"]="no-store",T}let d=[["runtime",tt.runtime],["currentRound",tt.currentRound],["rounds",tt.rounds],["roundsMine",tt.roundsMine],["nextRound",tt.nextRound],["plays",tt.plays],["roundState",tt.roundState],["profile",tt.profile],["identityOptions",tt.identityOptions],["identity",tt.identity],["recoveryCode",tt.recoveryCode],["graphicsFeed",tt.graphicsFeed],["leaderboard",tt.leaderboard],["round",tt.round]];for(let[l,p]of d){let h=p.exec(i);if(!h)continue;let m=decodeURIComponent(h[1]),y=h[2]?decodeURIComponent(h[2]):void 0,x=o?.check(lo(m,Mc(e)));if(x&&!x.allowed)return il(x.retryAfterSeconds);let O=l==="plays"||l==="identity",M=l==="recoveryCode";if(M?e.method!=="GET"&&e.method!=="POST":O?e.method!=="POST":e.method!=="GET")return Ue(405,"method_not_allowed",`This route accepts ${M?"GET or POST":O?"POST":"GET"}.`);let H;try{H=await t.forPlayer(m,e)}catch(T){return mn({path:e.path,method:e.method,game:m,stage:"resolve",name:Gn(T)}),Ue(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!H)return Ue(404,"not_found",`No game with id "${m}".`);try{switch(l){case"runtime":return Me(200,await H.getRuntime());case"currentRound":return Me(200,await H.getCurrentRound());case"rounds":return Me(200,await H.getRoundPool());case"roundsMine":return Me(200,await H.getPlayedRounds());case"nextRound":return Me(200,await H.getNextRound());case"round":{let T=await H.getRound(y);return T?Me(200,T):Ue(404,"not_found","No such round.")}case"roundState":return Me(200,await H.getRoundState(y));case"profile":return Me(200,await H.getProfile());case"identityOptions":{let T=Me(200,H.getIdentityOptions());return T.headers["cache-control"]="public, max-age=300",T}case"identity":{let T=Zx.safeParse(e.body);if(!T.success)return Ue(422,"invalid_request",T.error.issues.map(b=>`${b.path.join(".")||"body"}: ${b.message}`).join("; "));let _=await H.setIdentity(T.data);return _.ok?Me(200,_.profile):Ue(422,"not_offered",_.reason)}case"recoveryCode":{if(e.method==="GET"){let j=Me(200,await H.getRecoveryStatus());return j.headers["cache-control"]="no-store",j}if(!r?.recoveryDigest)return Ue(503,"unavailable","This deployment cannot issue recovery codes.",!0);let T=hE(zL),_=new Date().toISOString(),b=await H.recordRecoveryDigest(r.recoveryDigest(T),_);if(!b.ok)return Ue(409,"not_anonymous",b.reason);let v=Me(200,{code:T,issued_at:_,replaced:b.replaced});return v.headers["cache-control"]="no-store",v}case"leaderboard":return Me(200,await H.getLeaderboard());case"graphicsFeed":{let T=await H.getLeaderboard(),_=KT(T,new Date().toISOString()),b=Me(200,_);return b.headers["cache-control"]="public, max-age=5",b}case"plays":{let T=Vx.safeParse(e.body);if(!T.success)return Ue(422,"invalid_request",T.error.issues.map(v=>`${v.path.join(".")||"body"}: ${v.message}`).join("; "));let _=await H.play(y,T.data),b=Me(200,_);return _.outcome==="busy"&&_.retry_after_seconds&&(b.headers["retry-after"]=String(_.retry_after_seconds)),b}}}catch(T){return T instanceof Error&&T.message==="round_not_found"?Ue(404,"not_found","No such round."):(mn({path:e.path,method:e.method,game:m,name:Gn(T)}),Ue(500,"internal","Something went wrong at our end.",!0))}}return FL}var fy,Me,Ue,tt,FL,il,ZT=w(()=>{"use strict";we();HT();el();fy={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"},Me=(e,t)=>({status:e,headers:{"content-type":"application/json",...fy},body:t}),Ue=(e,t,r,o=!1)=>Me(e,{error:{code:t,message:r,retryable:o}});tt={runtime:et(Ie.runtime),currentRound:et(Ie.currentRound),rounds:et(Ie.rounds),roundsMine:et(Ie.roundsMine),nextRound:et(Ie.nextRound),round:et(Ie.round),plays:et(Ie.plays),roundState:et(Ie.roundState),profile:et(Ie.profile),identityOptions:et(Ie.identityOptions),identity:et(Ie.identity),recoveryCode:et(Ie.recoveryCode),restoreSession:et(Ie.restoreSession),leaderboard:et(Ie.leaderboard),graphicsFeed:et(WT),session:et(Ie.session)},FL=Ue(404,"not_found","No such route on the player API."),il=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...fy},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function sl(...e){let t=e.reduce((n,{length:i})=>n+i,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function fn(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}var wr,ta,al,J5,Eo=w(()=>{wr=new TextEncoder,ta=new TextDecoder,al=new TextDecoder("utf-8",{fatal:!0}),J5=2**32});function GL(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function YT(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw cl(t.name);if(t.hash&&o.hash?.name!==t.hash)throw cl(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw cl(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw cl(t.length,"algorithm.length");GL(e,r)}var cl,qT=w(()=>{cl=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function JT(e,t,...r){if(r=r.filter(Boolean),r.length>2){let o=r.pop();e+=`one of type ${r.join(", ")}, or ${o}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var XT,gy,yy=w(()=>{XT=(e,...t)=>JT("Key must be ",e,...t),gy=(e,t,...r)=>JT(`Key for the ${e} algorithm must be `,t,...r)});var nt,It,na,ll,Ge,Pe,Bn,ra,To,dl,ul,pl,ut=w(()=>{nt=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},It=class extends nt{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},na=class extends nt{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(t,r,o="unspecified",n="unspecified"){super(t,{cause:{claim:o,reason:n,payload:r}}),this.claim=o,this.reason=n,this.payload=r}},ll=class extends nt{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Ge=class extends nt{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Pe=class extends nt{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Bn=class extends nt{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},ra=class extends nt{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},To=class extends nt{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(t="no applicable key found in the JSON Web Key Set",r){super(t,r)}},dl=class extends nt{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(t="multiple matching keys found in the JSON Web Key Set",r){super(t,r)}},ul=class extends nt{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},pl=class extends nt{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var $o,by,vy,wy=w(()=>{$o=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},by=e=>e?.[Symbol.toStringTag]==="KeyObject",vy=e=>$o(e)||by(e)});function _y(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let o=0;o<e.length;o+=t)r.push(String.fromCharCode.apply(null,e.subarray(o,o+t)));return btoa(r.join(""))}function hl(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}var ky=w(()=>{});function oa(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:ta.decode(e),{alphabet:"base64url"})}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.",{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=ta.decode(t)),t.includes("+")||t.includes("/"))throw new TypeError("The input to be decoded is not correctly encoded.");t=t.replace(/-/g,"+").replace(/_/g,"/");try{return hl(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function Ao(e){let t=e;return typeof t=="string"&&(t=wr.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):_y(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var ia=w(()=>{Eo();ky()});function zt(e){if(!BL(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ml(...e){let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(let o of t){let n=Object.keys(o);if(!r||r.size===0){r=new Set(n);continue}for(let i of n){if(r.has(i))return!1;r.add(i)}}return!0}var BL,xy,QT,e$,t$,Wn=w(()=>{BL=e=>typeof e=="object"&&e!==null;xy=e=>zt(e)&&typeof e.kty=="string",QT=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),e$=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,t$=e=>e.kty==="oct"&&typeof e.k=="string"});function Sy(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function Ey(e,t,r){try{return oa(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function n$(e,t,r){try{return fn(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function r$(e,t,r){let o;try{o=JSON.parse(al.decode(oa(e)))}catch{throw new t(r)}if(!zt(o))throw new t(r);return o}var Ty=w(()=>{ia();Eo();Wn()});function HL(e,t){if(!e.kty.includes(t.kty))throw new Ge(KL);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function fl(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Ge('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=HL(e,t),o=!!(t.d||t.priv),n=o?e.usages.private:e.usages.public,i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!o,t.key_ops??n)}var KL,$y=w(()=>{ut();KL='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function YL(e,t,r){return e.symmetric?VL(e,t,r):ZL(e,t,r)}function a$(e,t){return yl||=new WeakMap,yl.get(e)?.[t]}function s$(e,t,r){let o=yl.get(e);return o?o[t]=r:yl.set(e,{[t]:r}),r}async function bl(e,t,r){let o=YL(e,t,r);switch(o.kind){case i$:case Iy:return o.key;case gl:{if(o.key.k)return oa(o.key.k);if(!Object.isFrozen(o.key)){let{key_ops:n}=o.key;Array.isArray(n)&&Object.freeze(n),Object.freeze(o.key)}return o$(o.key,o.key,e)}case Cy:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?JL(n,e):o$(n,n.export({format:"jwk"}),e)}}}var Io,Ay,VL,ZL,i$,Iy,Cy,gl,yl,qL,o$,JL,Py=w(()=>{yy();wy();Wn();ia();$y();Io=e=>e[Symbol.toStringTag],Ay=(e,t,r)=>{let{alg:o}=e;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError(`Invalid key for this operation, its "use" must be "${n}" when present`)}if(t.alg!==void 0&&t.alg!==o)throw new TypeError(`Invalid key for this operation, its "alg" must be "${o}" when present`);if(Array.isArray(t.key_ops)){let n=r==="encrypt"||r==="decrypt"?e.keyOps?.[r]:r;if(n&&t.key_ops?.includes?.(n)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},VL=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:i$,key:t};if(xy(t)){if(t$(t)&&Ay(e,t,r))return{kind:gl,key:t};throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!vy(t))throw new TypeError(gy(o,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Io(t)} instances for symmetric algorithms must be of type "secret"`);return $o(t)?{kind:Iy,key:t}:{kind:Cy,key:t}},ZL=(e,t,r)=>{let{alg:o}=e;if(xy(t))switch(r){case"decrypt":case"sign":if(QT(t)&&Ay(e,t,r))return{kind:gl,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(e$(t)&&Ay(e,t,r))return{kind:gl,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!vy(t))throw new TypeError(gy(o,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError(`${Io(t)} instances for asymmetric algorithms must not be of type "secret"`);if(t.type==="public")switch(r){case"sign":throw new TypeError(`${Io(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Io(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if(t.type==="private")switch(r){case"verify":throw new TypeError(`${Io(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Io(t)} instances for asymmetric algorithm encryption must be of type "public"`)}return $o(t)?{kind:Iy,key:t}:{kind:Cy,key:t}},i$=Symbol(),Iy=Symbol(),Cy=Symbol(),gl=Symbol();qL={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};o$=async(e,t,r)=>{let o=a$(e,r.alg);if(o)return o;let n=await fl(r,{...t,alg:r.alg});return s$(e,r.alg,n)},JL=(e,t)=>{let r=a$(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=qL[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return s$(e,t.alg,e.toCryptoKey(s,o,n))}});function aa(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var Oy=w(()=>{});function vl(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:XL,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function wl(e){return{kty:["EC","OKP"],subtle:{name:"ECDH"},subtleFor:({kty:t,crv:r,asymmetricKeyType:o})=>{if(r==="X25519"||o==="x25519")return{name:"X25519"};if(t==="OKP")throw new Ge('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:QL,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function Ny(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:_l,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Ry(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:_l,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function Ly(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:_l,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function Dy(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:c$,keyOps:l$,cekBits:e,ivBits:96,cbc:!1}}function jy(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:c$,keyOps:l$,cekBits:e,ivBits:128,cbc:!0}}function d$(e){return eD[e]}var XL,QL,_l,eD,c$,l$,_V,u$=w(()=>{ut();Oy();XL={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},QL={public:[],private:["deriveBits"]},_l={public:[],private:[]};eD=aa({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:_l,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":vl(1),"RSA-OAEP-256":vl(256),"RSA-OAEP-384":vl(384),"RSA-OAEP-512":vl(512),"ECDH-ES":wl(),"ECDH-ES+A128KW":wl(128),"ECDH-ES+A192KW":wl(192),"ECDH-ES+A256KW":wl(256),A128KW:Ny(128),A192KW:Ny(192),A256KW:Ny(256),A128GCMKW:Ry(128),A192GCMKW:Ry(192),A256GCMKW:Ry(256),"PBES2-HS256+A128KW":Ly(256,128),"PBES2-HS384+A192KW":Ly(384,192),"PBES2-HS512+A256KW":Ly(512,256)}),c$={public:[],private:[]},l$={encrypt:"encrypt",decrypt:"decrypt"};_V=aa({A128GCM:Dy(128),A192GCM:Dy(192),A256GCM:Dy(256),"A128CBC-HS256":jy(256),"A192CBC-HS384":jy(384),"A256CBC-HS512":jy(512)})});function tD(e,t){let{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function nD(e,t,r){YT(t,e.subtle,r),e.minModulusLength&&tD(e.alg,t)}async function p$(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(nD(e,t,r),t)}async function h$(e,t,r){let o=await p$(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function m$(e,t,r,o){let n=await p$(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var My=w(()=>{qT()});function f$(e,t){if(t!==void 0&&(!Array.isArray(t)||t.some(r=>typeof r!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)}function g$(e,t){let{crit:r}=t??{};if(Array.isArray(r)&&new Set(r).size!==r.length)throw new e('"crit" (Critical) Header Parameter MUST NOT contain duplicate values')}function xl(e,t,r,o,n){if(n.crit!==void 0&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||o.crit===void 0)return new Set;if(!Array.isArray(o.crit)||o.crit.length===0||o.crit.some(a=>typeof a!="string"||a.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;r!==void 0?i=new Map([...Object.entries(r),...t.entries()]):i=t;for(let a of o.crit){if(!i.has(a))throw new Ge(`Extension Header Parameter "${a}" is not recognized`);if(n[a]===void 0)throw new e(`Extension Header Parameter "${a}" is missing`);if(i.get(a)&&o[a]===void 0)throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(o.crit)}var kl,Uy=w(()=>{ut();kl=new Map([["b64",!0]])});function zy(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:sa}}function Co(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:sa,minModulusLength:2048}}function Fy(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:sa}}function y$(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:sa}}function Gy(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:sa}}function Sl(e){let t=b$[e];if(!t)throw new Ge(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function El(e){return b$[e]}var sa,b$,ca=w(()=>{ut();Oy();sa={public:["verify"],private:["sign"]};b$=aa({HS256:zy(256),HS384:zy(384),HS512:zy(512),RS256:Co("RSASSA-PKCS1-v1_5",256),RS384:Co("RSASSA-PKCS1-v1_5",384),RS512:Co("RSASSA-PKCS1-v1_5",512),PS256:Co("RSA-PSS",256,32),PS384:Co("RSA-PSS",384,48),PS512:Co("RSA-PSS",512,64),ES256:Fy("P-256",256),ES384:Fy("P-384",384),ES512:Fy("P-521",512),EdDSA:y$(),Ed25519:y$(),"ML-DSA-44":Gy("ML-DSA-44"),"ML-DSA-65":Gy("ML-DSA-65"),"ML-DSA-87":Gy("ML-DSA-87")})});function v$(e){return{algorithms:e&&f$("algorithms",e.algorithms),crit:e?.crit}}async function rD(e,t,r){let o={};e.protected&&(o=r$(e.protected,Pe,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!ml(o,e.header))throw new Pe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=xl(Pe,kl,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Pe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Pe('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new ll('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Pe("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Pe("JWS Payload must be a string or an Uint8Array instance");let d=!1;typeof r=="function"&&(r=await r(o,e),d=!0);let l=Sl(s),p=sl(e.protected!==void 0?fn(e.protected):new Uint8Array,fn("."),typeof e.payload=="string"?a?t.b64p??=n$(e.payload,"payload",Pe):wr.encode(e.payload):e.payload),h=Ey(e.signature,"signature",Pe),m=await bl(l,r,"verify");if(!await m$(l,m,h,p))throw new pl;let x;return a?x=Ey(e.payload,"payload",Pe):typeof e.payload=="string"?x=wr.encode(e.payload):x=e.payload,{payload:x,parsedProt:o,b64:a,key:m,resolvedKey:d}}async function w$(e,t,r){if(e instanceof Uint8Array&&(e=ta.decode(e)),typeof e!="string")throw new Pe("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new Pe("Invalid Compact JWS");return rD({payload:n,protected:o,signature:i},t,r)}var _$=w(()=>{My();ca();ut();Eo();Ty();Wn();Uy();Py()});function la(e){let t=aD.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let r=parseFloat(t[2]),o=t[3].toLowerCase(),n;switch(o){case"sec":case"secs":case"second":case"seconds":case"s":n=Math.round(r);break;case"minute":case"minutes":case"min":case"mins":case"m":n=Math.round(r*x$);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*S$);break;case"day":case"days":case"d":n=Math.round(r*By);break;case"week":case"weeks":case"w":n=Math.round(r*oD);break;default:n=Math.round(r*iD);break}return t[1]==="-"||t[4]==="ago"?-n:n}function gn(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function E$(e,t,r={}){let o;try{o=JSON.parse(al.decode(t))}catch{}if(!zt(o))throw new Bn("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||k$(e.typ)!==k$(n)))throw new It('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:d,maxTokenAge:l}=r,p=[...i];l!==void 0&&p.push("iat"),d!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let x of new Set(p.reverse()))if(!(x in o))throw new It(`missing required "${x}" claim`,o,x,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new It('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new It('unexpected "sub" claim value',o,"sub","check_failed");if(d!==void 0&&!sD(o.aud,typeof d=="string"?[d]:d))throw new It('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=la(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}gn("clockTolerance option",h);let{currentDate:m}=r,y=gn("currentDate option",Kn(m||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new It('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new It('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>y+h)throw new It('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new It('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=y-h)throw new na('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let x=y-o.iat,O=typeof l=="number"?l:la(l);if(x-h>O)throw new na('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(x<0-h)throw new It('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var Kn,x$,S$,By,oD,iD,aD,k$,sD,Tl,Wy=w(()=>{ut();Eo();Wn();Kn=e=>Math.floor(e.getTime()/1e3),x$=60,S$=x$*60,By=S$*24,oD=By*7,iD=By*365.25,aD=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;k$=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,sD=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Tl=class{#e;constructor(t){if(!zt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return wr.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(t){this.#e.iss=t}get sub(){return this.#e.sub}set sub(t){this.#e.sub=t}get aud(){return this.#e.aud}set aud(t){this.#e.aud=t}set jti(t){this.#e.jti=t}set nbf(t){typeof t=="number"?this.#e.nbf=gn("setNotBefore",t):t instanceof Date?this.#e.nbf=gn("setNotBefore",Kn(t)):this.#e.nbf=Kn(new Date)+la(t)}set exp(t){typeof t=="number"?this.#e.exp=gn("setExpirationTime",t):t instanceof Date?this.#e.exp=gn("setExpirationTime",Kn(t)):this.#e.exp=Kn(new Date)+la(t)}set iat(t){t===void 0?this.#e.iat=Kn(new Date):t instanceof Date?this.#e.iat=gn("setIssuedAt",Kn(t)):typeof t=="string"?this.#e.iat=gn("setIssuedAt",Kn(new Date)+la(t)):this.#e.iat=gn("setIssuedAt",t)}}});async function Ky(e,t,r){let o=await w$(e,v$(r),t);if(!o.b64)throw new Bn("JWTs MUST NOT use unencoded payload");let i={payload:E$(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var T$=w(()=>{_$();Wy();ut()});function $l(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function $$(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!ml(r,o))throw new Pe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};g$(Pe,r);let i=xl(Pe,kl,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new Pe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Pe('JWS "alg" (Algorithm) Header Parameter missing or invalid');let d=Sl(s),l,p;if(a){let H=e.encoded??={};H.b64??=Ao(e.payload),H.raw??=fn(H.b64),l=H.b64,p=H.raw}else p=e.payload,l="";let h,m;r?(h=Ao(JSON.stringify(r)),m=fn(h)):(h="",m=new Uint8Array);let y=sl(m,fn("."),p),x=await bl(d,t,"sign"),O=await h$(d,x,y),M={signature:Ao(O),payload:l};return r&&(M.protected=h),M}var Al=w(()=>{ia();My();ca();Wn();ut();Eo();Uy();Py()});var Il,A$=w(()=>{ut();Al();Ty();Il=class{#e;#t;#n;constructor(t){if(!(t instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this.#e=t}setProtectedHeader(t){return Sy(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return Sy(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new Pe("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await $$({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Cl,I$=w(()=>{A$();Al();Cl=class{#e;#t;constructor(t){this.#e=new Il(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if($l(this.#t))throw new TypeError("use the flattened module for creating JWS with b64: false");let o=await this.#e.sign(t,r);return`${o.protected}.${o.payload}.${o.signature}`}}});var da,C$=w(()=>{I$();Al();ut();Wy();da=class{#e;#t;constructor(t={}){this.#t=new Tl(t)}setIssuer(t){return this.#t.iss=t,this}setSubject(t){return this.#t.sub=t,this}setAudience(t){return this.#t.aud=t,this}setJti(t){return this.#t.jti=t,this}setNotBefore(t){return this.#t.nbf=t,this}setExpirationTime(t){return this.#t.exp=t,this}setIssuedAt(t){return this.#t.iat=t,this}setProtectedHeader(t){return this.#e=t,this}async sign(t,r){let o=new Cl(this.#t.data());if(o.setProtectedHeader(this.#e),$l(this.#e))throw new Bn("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function P$(){return new Ge('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function O$(e){if(typeof e!="string")throw P$();let t=El(e)??d$(e);if(!t)throw P$();return t}var N$=w(()=>{ut();ca();u$()});function dD(e){pa(e,48,"Invalid PKCS#8 structure"),ua(e),pa(e,2,"Expected version field");let t=ua(e);e.pos+=t,pa(e,48,"Expected algorithm identifier");let r=ua(e);return{algIdStart:e.pos,algIdLength:r}}var Hy,cD,Vy,ua,pa,R$,lD,uD,pD,hD,L$,D$=w(()=>{ky();ut();N$();Hy=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},cD=e=>({data:e,pos:0}),Vy=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},ua=e=>{let t=Vy(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|Vy(e);return o}return t},pa=(e,t,r)=>{if(Vy(e)!==t)throw new Error(r)},R$=(e,t)=>{if(t<0||e.pos+t>e.data.length)throw new Error("Unexpected end of ASN.1 input");let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},lD=e=>{pa(e,6,"Expected algorithm OID");let t=ua(e);return R$(e,t)};uD=e=>{let t=lD(e);if(Hy(t,[43,101,110]))return"X25519";if(!Hy(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");pa(e,6,"Expected curve OID");let r=ua(e),o=R$(e,r);for(let{name:n,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Hy(o,i))return n;throw new Error("Unsupported named curve")},pD=async(e,t,r,o)=>{let n=O$(r);if(n.symmetric)throw new Ge('Invalid or unsupported "alg" (Algorithm) value');let i=e==="spki",a;if(n.subtleFor)try{a=n.subtleFor({crv:o.getNamedCurve(t)})}catch{throw new Ge("Invalid or unsupported key format")}else a=n.subtle;return crypto.subtle.importKey(e,t,a,o?.extractable??!!i,i?n.usages.public:n.usages.private)},hD=(e,t)=>hl(e.replace(t,"")),L$=(e,t,r)=>{let o=hD(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=cD(i);return dD(a),uD(a)}),pD("pkcs8",o,t,n)}});function mD(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function fD(e){if(by(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:Ao(e)};if(!$o(e))throw new TypeError(XT(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:o,use:n,...i}=mD(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Zy(e){return fD(e)}var j$=w(()=>{yy();ia();wy()});function gD(e){let t=typeof e=="string"?El(e):void 0;if(!t||t.symmetric)throw new Ge('Unsupported "alg" value for a JSON Web Key Set');return t}function yD(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(bD)}function bD(e){return zt(e)}async function M$(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await fl(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new ra("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function qy(e){let t=new Yy(e),r=async(o,n)=>t.getKey(o,n);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}var Yy,U$=w(()=>{$y();ca();ut();Wn();Yy=class{#e;#t=new WeakMap;constructor(t){if(!yD(t))throw new ra("JSON Web Key Set malformed");this.#e=structuredClone(t)}jwks(){return this.#e}async getKey(t,r){let{alg:o,kid:n}={...t,...r?.header},i=gD(o),a=this.#e.keys.filter(l=>{let p=i.kty.includes(l.kty);return p&&typeof n=="string"&&(p=n===l.kid),p&&(typeof l.alg=="string"||l.kty==="AKP")&&(p=o===l.alg),p&&typeof l.use=="string"&&(p=l.use==="sig"),p&&Array.isArray(l.key_ops)&&(p=l.key_ops.includes("verify")),p&&i.crv&&(p=l.crv===i.crv),p}),{0:s,length:d}=a;if(d===0)throw new To;if(d!==1){let l=new dl,p=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await M$(p,h,i)}catch{}},l}return M$(this.#t,s,i)}}});function vD(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function wD(e,t,r,o=fetch){let n=await o(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(i=>{throw i.name==="TimeoutError"?new ul:i});if(n.status!==200)throw new nt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new nt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function _D(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!zt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,zt))}function Qy(e,t){let r=new Xy(e,t),o=async(n,i)=>r.getKey(n,i);return Object.defineProperties(o,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),o}var Jy,z$,Pl,Xy,F$=w(()=>{ut();U$();Wn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Jy="jose/v6.2.5");z$=Symbol();Pl=Symbol();Xy=class{#e;#t;#n;#c;#i;#r;#o;#l;#a;#s;constructor(t,r){if(!(t instanceof URL))throw new TypeError("url must be an instance of URL");this.#e=new URL(t.href),this.#t=typeof r?.timeoutDuration=="number"?r?.timeoutDuration:5e3,this.#n=typeof r?.cooldownDuration=="number"?r?.cooldownDuration:3e4,this.#c=typeof r?.cacheMaxAge=="number"?r?.cacheMaxAge:6e5,this.#o=new Headers(r?.headers),Jy&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Jy),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[z$],r?.[Pl]!==void 0&&(this.#s=r?.[Pl],_D(r?.[Pl],this.#c)&&(this.#i=this.#s.uat,this.#a=qy(this.#s.jwks)))}pendingFetch(){return!!this.#r}coolingDown(){return typeof this.#i=="number"?Date.now()<this.#i+this.#n:!1}fresh(){return typeof this.#i=="number"?Date.now()<this.#i+this.#c:!1}jwks(){return this.#a?.jwks()}async getKey(t,r){(!this.#a||!this.fresh())&&await this.reload();try{return await this.#a(t,r)}catch(o){if(o instanceof To&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&vD()&&(this.#r=void 0),this.#r||=wD(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=qy(t),this.#s&&(this.#s.uat=Date.now(),this.#s.jwks=t),this.#i=Date.now(),this.#r=void 0}).catch(t=>{throw this.#r=void 0,t}),await this.#r}}});async function eb(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return L$(e,t,r)}var G$=w(()=>{D$()});var tb=w(()=>{T$();C$();F$();j$();G$()});function kD(e){let t=B$.get(e);return t||(t=Qy(new URL(e)),B$.set(e,t)),t}function W$(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await Ky(r,kD(e.jwksUri),{issuer:e.issuer,...e.audience?{audience:e.audience}:{}}),n=typeof o.sub=="string"?o.sub:"";if(!n){t="token_malformed";return}let i=typeof o.name=="string"?o.name:typeof o.preferred_username=="string"?o.preferred_username:void 0;return{playerId:`${xD}${n}`,...i?{alias:i}:{}}}catch(o){let n=o?.code;t=n==="ERR_JWT_EXPIRED"?"token_expired":n==="ERR_JWS_INVALID"||n==="ERR_JWT_INVALID"?"token_malformed":"token_untrusted";return}}}}var B$,xD,K$=w(()=>{"use strict";tb();Qc();B$=new Map;xD="id:"});import{createPublicKey as SD,generateKeyPairSync as ED}from"node:crypto";async function nb(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Ol}`,{privateKey:n,publicKey:i}=ED("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await eb(n,"RS256"),s=await Zy(SD(i)),d="gamestage-dev",l={keys:[{...s,kid:d,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:W$({issuer:r,jwksUri:o}),async mint(p,h={}){let m=Math.floor(Date.now()/1e3);return new da({name:p}).setProtectedHeader({alg:"RS256",kid:d}).setIssuer(r).setSubject(p).setIssuedAt(m).setExpirationTime(m+(h.expiresInSeconds??3600)).sign(a)}}}var Ol,rb=w(()=>{"use strict";tb();K$();Ol="/.well-known/jwks.json"});import{createServer as TD}from"node:http";import{randomBytes as $D}from"node:crypto";async function ID(e){let t=zT({tenant:e.game,rounds:[],currentRoundId:""});await my(t,e.game,Xe.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await my(t,e.game,Xe.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=jT({game:e.game,archetype:e.round.archetype,snapshot:"local",title:e.title,identityRequired:e.identityRequired});return{async forPlayer(o,n){if(o===e.game)return MT({tenant:e.game,playerId:n.playerId??qi(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function CD(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)try{return JSON.parse(Buffer.concat(t).toString("utf8"))}catch{return}}async function Nl(e){let t=await ID(e),r=$D(32).toString("base64"),o={issue:()=>cT(r),sign:a=>oy(a,r),recoveryDigest:a=>dT(a,r)},n=e.devIdentity,i=TD((a,s)=>{(async()=>{let d=new URL(a.url??"/","http://localhost");if(n&&d.pathname===Ol){let m=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(d.pathname)){let m=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(m)}),s.end(m);return}let l=a.headers[AD],p=a.headers.authorization,h=await VT({method:a.method??"GET",path:d.pathname,body:await CD(a),...(({playerId:m,refused:y})=>({playerId:m,identityRefusal:y}))(await aT({token:p?.replace(/^Bearer\s+/i,"")||void 0,anonymousId:Array.isArray(l)?l[0]:l,sessionSecret:r,resolver:n?.resolver}))},t,o);s.writeHead(h.status,h.headers),s.end(h.body===void 0?void 0:JSON.stringify(h.body))})().catch(()=>{s.headersSent?s.destroy():(s.writeHead(500,{"content-type":"application/json"}),s.end(JSON.stringify({error:{code:"internal",message:"The local Engine failed.",retryable:!0}})))})});return i.attachDevIdentity=a=>{n=a},i}var AD,ob=w(()=>{"use strict";we();UT();ol();FT();BT();ZT();Qc();rb();rb();ol();AD="x-gamestage-player"});import{spawn as PD}from"node:child_process";import{createHash as OD,randomBytes as V$}from"node:crypto";import{constants as ND}from"node:fs";import{access as RD,mkdtemp as LD,rm as Z$}from"node:fs/promises";import{request as DD}from"node:http";import{homedir as Rl,tmpdir as jD}from"node:os";import{join as ha}from"node:path";function ib(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??V$(4);if(o.length!==4)throw new Error("A WebSocket masking key must be four bytes.");let n=r.length<126?0:r.length<=65535?2:8,i=Buffer.alloc(2+n+4+r.length);i[0]=(t.fin===!1?0:128)|(t.opcode??1),i[1]=128|(n===0?r.length:n===2?126:127);let a=2;n===2?(i.writeUInt16BE(r.length,a),a+=2):n===8&&(i.writeBigUInt64BE(BigInt(r.length),a),a+=8),o.copy(i,a),a+=4;for(let s=0;s<r.length;s++)i[a+s]=r[s]^o[s%4];return i}async function Ll(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??UD].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await RD(s,ND.X_OK),o=s;break}catch{}if(!o)return{status:"skipped",detail:"No supported browser found. Install Chrome, Chromium, Brave or Edge, or set GAMESTAGE_CHROME to its executable path, then run verify again."};let n=await LD(ha(jD(),"gamestage-chrome-")),i=PD(o,["--headless=new","--remote-debugging-port=0","--no-first-run","--no-default-browser-check",`--user-data-dir=${n}`,"about:blank"],{stdio:["ignore","ignore","pipe"]}),a;try{a=await FD(await zD(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:d}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await lb.create(a,d,i,n)}}catch(s){throw a?.close(),await Y$(i),await Z$(n,{recursive:!0,force:!0}),s}}function zD(e,t){return new Promise((r,o)=>{let n="",i=p=>{clearTimeout(l),e.stderr?.off("data",a),e.off("error",s),e.off("close",d),p()},a=p=>{n=(n+p.toString("utf8")).slice(-4e3);let h=n.match(/DevTools listening on (ws:\/\/\S+)/);h&&i(()=>r(h[1]))},s=p=>i(()=>o(p)),d=p=>i(()=>o(new Error(`Chrome exited before DevTools was ready${p===null?"":` (code ${p})`}.`)));e.stderr?.on("data",a),e.on("error",s),e.on("close",d);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function FD(e){return new Promise((t,r)=>{let o=new URL(e),n=V$(16).toString("base64"),i=OD("sha1").update(n+MD).digest("base64"),a=DD({hostname:o.hostname,port:o.port,path:`${o.pathname}${o.search}`,headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Version":"13","Sec-WebSocket-Key":n}});a.on("upgrade",(s,d,l)=>{s.headers["sec-websocket-accept"]!==i?(d.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new cb(d,l))}),a.on("response",s=>{s.resume(),r(new Error(`Chrome refused the WebSocket upgrade with status ${s.statusCode}.`))}),a.on("error",r),a.end()})}async function Y$(e){e.exitCode===null&&(e.kill("SIGTERM"),!await H$(e,1e3)&&(e.kill("SIGKILL"),await H$(e,1e3)))}function H$(e,t){return e.exitCode!==null?Promise.resolve(!0):new Promise(r=>{let o=a=>{clearTimeout(i),e.off("close",n),r(a)},n=()=>o(!0);e.once("close",n);let i=setTimeout(()=>o(!1),t)})}function ab(e){return new Promise(t=>setTimeout(t,e))}var MD,sb,cb,lb,UD,q$=w(()=>{"use strict";MD="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";sb=class{buffered=Buffer.alloc(0);fragments=[];fragmentedOpcode;push(t){this.buffered=this.buffered.length?Buffer.concat([this.buffered,t]):Buffer.from(t);let r=[];for(;this.buffered.length>=2;){let o=this.buffered[0],n=this.buffered[1],i=(o&128)!==0,a=o&15,s=(n&128)!==0,d=n&127,l=2;if(d===126){if(this.buffered.length<l+2)break;d=this.buffered.readUInt16BE(l),l+=2}else if(d===127){if(this.buffered.length<l+8)break;let m=this.buffered.readBigUInt64BE(l);if(m>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");d=Number(m),l+=8}let p=l;if(s&&(l+=4),this.buffered.length<l+d)break;let h=Buffer.from(this.buffered.subarray(l,l+d));if(s)for(let m=0;m<h.length;m++)h[m]^=this.buffered[p+m%4];if(this.buffered=this.buffered.subarray(l+d),a===8||a===9||a===10)r.push({opcode:a,payload:h});else if(a===1){if(this.fragmentedOpcode!==void 0)throw new Error("A new WebSocket message arrived before its continuation finished.");i?r.push({opcode:a,payload:h}):(this.fragmentedOpcode=a,this.fragments=[h])}else if(a===0){if(this.fragmentedOpcode===void 0)throw new Error("A WebSocket continuation arrived without a first frame.");this.fragments.push(h),i&&(r.push({opcode:this.fragmentedOpcode,payload:Buffer.concat(this.fragments)}),this.fragmentedOpcode=void 0,this.fragments=[])}else throw new Error(`Unsupported WebSocket opcode ${a}.`)}return r}},cb=class{constructor(t,r){this.socket=t;t.on("data",o=>this.receive(o)),t.on("error",o=>this.fail(o)),t.on("close",()=>this.fail(new Error("Chrome closed the DevTools connection."))),r.length&&this.receive(r)}socket;decoder=new sb;pending=new Map;listeners=new Map;nextId=1;ended=!1;send(t,r={},o){if(this.ended)return Promise.reject(new Error("Chrome's DevTools connection is closed."));let n=this.nextId++;return new Promise((i,a)=>{this.pending.set(n,{resolve:s=>i(s),reject:a}),this.socket.write(ib(JSON.stringify({id:n,method:t,params:r,...o?{sessionId:o}:{}})),s=>{s&&(this.pending.delete(n),a(s))})})}on(t,r,o){let n=`${o??""}:${t}`,i=this.listeners.get(n)??new Set;return i.add(r),this.listeners.set(n,i),()=>i.delete(r)}close(){this.ended||(this.ended=!0,this.socket.end(ib(Buffer.alloc(0),{opcode:8})),this.rejectPending(new Error("Chrome's DevTools connection was closed.")))}receive(t){try{for(let r of this.decoder.push(t)){if(r.opcode===8){this.ended=!0,this.socket.end(),this.rejectPending(new Error("Chrome closed the DevTools connection."));continue}if(r.opcode===9){this.socket.write(ib(r.payload,{opcode:10}));continue}if(r.opcode===10)continue;let o=JSON.parse(r.payload.toString("utf8"));if(o.id!==void 0){let n=this.pending.get(o.id);if(!n)continue;this.pending.delete(o.id),o.error?n.reject(new Error(o.error.message??"Chrome rejected a CDP command.")):n.resolve(o.result)}else if(o.method){let n=`${o.sessionId??""}:${o.method}`;for(let i of this.listeners.get(n)??[])i(o.params??{})}}}catch(r){this.fail(r instanceof Error?r:new Error("Could not read Chrome's response."))}}fail(t){this.ended||(this.ended=!0,this.socket.destroy(),this.rejectPending(t))}rejectPending(t){for(let r of this.pending.values())r.reject(t);this.pending.clear()}},lb=class e{constructor(t,r,o,n){this.cdp=t;this.sessionId=r;this.child=o;this.profile=n;this.on("Runtime.exceptionThrown",a=>{let s=a.exceptionDetails,d=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(d.split(`
|
|
11122
11122
|
`)[0].replace(/^[A-Za-z]*Error:\s*/,""))}),this.on("Network.requestWillBeSent",a=>{let s=String(a.requestId);this.requests.set(s,a.request??{}),this.inflight.add(s),this.lastNetworkActivity=Date.now()}),this.on("Network.responseReceived",a=>{let s=a.response;this.sizes.set(String(a.requestId),{url:s?.url??"",type:String(a.type??"Other"),bytes:0})});let i=a=>{this.inflight.delete(String(a.requestId)),this.lastNetworkActivity=Date.now()};this.on("Network.loadingFinished",a=>{let s=this.sizes.get(String(a.requestId));s&&(s.bytes=Number(a.encodedDataLength??0)),i(a)}),this.on("Network.loadingFailed",i)}cdp;sessionId;child;profile;pageErrors=[];requests=new Map;sizes=new Map;inflight=new Set;lastNetworkActivity=Date.now();closed=!1;static async create(t,r,o,n){let i=new e(t,r,o,n);return await Promise.all([i.send("Page.enable"),i.send("Runtime.enable"),i.send("Network.enable")]),i}async addScriptToEvaluateOnNewDocument(t){await this.send("Page.addScriptToEvaluateOnNewDocument",{source:t})}async navigate(t,r=2e4){this.sizes.clear();let o=Date.now()+r,n=this.waitForEvent("Page.loadEventFired",r,"page load"),i=await this.send("Page.navigate",{url:t});if(i.errorText)throw new Error(i.errorText);await n,await this.waitForNetworkIdle(Math.max(1,o-Date.now()))}query(t){return this.evaluate(`Array.from(document.querySelectorAll(${JSON.stringify(t)}), (_, index) => index)`)}isVisible(t,r){return this.evaluate(`(() => {
|
|
11123
11123
|
const element = document.querySelectorAll(${JSON.stringify(t)})[${r}];
|
|
11124
11124
|
if (!element) return false;
|
|
@@ -11136,9 +11136,9 @@ main()
|
|
|
11136
11136
|
if ("disabled" in element && element.disabled) return { ok: false, error: "Element is disabled." };
|
|
11137
11137
|
element.click();
|
|
11138
11138
|
return { ok: true };
|
|
11139
|
-
})()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await
|
|
11140
|
-
`);return/(^|[\s,}])(html|body)\b[^{]*\{[^}]*background(?:-color)?\s*:/i.test(n)||o.push("the game's background on html and body, in a <style> before any script"),/<meta\s+name="theme-color"/i.test(e)||o.push('a <meta name="theme-color"> with the background colour'),/<meta\s+name="color-scheme"/i.test(e)||o.push('a <meta name="color-scheme">'),/class="[^"]*\bgs-boot\b/.test(e)||/data-gs-loading/.test(e)||/role="status"[^>]*aria-busy="true"|aria-busy="true"[^>]*role="status"/.test(e)||/role="progressbar"/.test(e)||o.push("a loading state in the markup (a spinner or progress bar, not text)"),{ok:o.length===0,missing:o}}function KD(e,t){let r=_f[e],o=[],n=t.largest.map(a=>`${a.name} (${a.kb} KB)`).join(", "),i=(a,s,d,l)=>`${a} is ${s} ${l}, over the ${d} ${l} a ${lr[e].name.toLowerCase()} game gets.`;return t.jsKb>r.jsKb&&o.push(`${i("JavaScript",t.jsKb,r.jsKb,"KB")} Largest files: ${n}.`),t.cssKb>r.cssKb&&o.push(i("CSS",t.cssKb,r.cssKb,"KB")),t.fontKb>r.fontKb&&o.push(`${i("Fonts",t.fontKb,r.fontKb,"KB")} Load fewer weights, or subset them to the characters the game uses.`),t.totalKb>r.totalKb&&o.push(`${i("Everything together",t.totalKb,r.totalKb,"KB")} Largest files: ${n}.`),t.firstRenderMs!==void 0&&t.firstRenderMs>r.firstRenderMs&&o.push(`${i("First render",t.firstRenderMs,r.firstRenderMs,"ms")} Paint the game's colour and a loading state from the HTML itself, before any script.`),t.playableMs!==void 0&&t.playableMs>r.playableMs&&o.push(`${i("Time to playable",t.playableMs,r.playableMs,"ms")} Largest files: ${n}.`),o}async function
|
|
11141
|
-
return { tall: el.scrollHeight, wide: el.scrollWidth, h: innerHeight, w: innerWidth }; })()`),a=i.tall>i.h+1,s=i.wide>i.w+1;if(!a&&!s)return{size:n,fits:!0};let d=[];return a&&d.push(`the page is ${i.tall-i.h}px taller than the screen, so it scrolls`),s&&d.push(`the page is ${i.wide-i.w}px wider than the screen`),{size:n,fits:!1,detail:d.join(", and ")}}async function VD(e,t){await e.setViewport(390,844),await e.throttle(kf);try{await e.navigate(t,9e4);let r=await
|
|
11139
|
+
})()`);if(!o.ok)throw new Error(o.error??"Element could not be clicked.")}async waitForSelector(t,r=5e3){let o=Date.now()+r;for(;Date.now()<o;){if((await this.query(t)).length)return;await ab(50)}throw new Error(`Timed out after ${r}ms waiting for ${t}.`)}async setOffline(t){await this.send("Network.emulateNetworkConditions",{offline:t,latency:0,downloadThroughput:-1,uploadThroughput:-1})}waitForResponse(t){let r=t.timeout??15e3;return new Promise((o,n)=>{let i=!1,a=l=>{i||(i=!0,clearTimeout(d),s(),l())},s=this.on("Network.responseReceived",l=>{let p=String(l.requestId),h=this.requests.get(p);h?.url?.includes(t.urlIncludes)&&h.method?.toUpperCase()===t.method.toUpperCase()&&a(()=>o({json:async()=>JSON.parse(await this.responseBody(p,r))}))}),d=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}transfers(){return[...this.sizes.values()]}run(t){return this.evaluate(t)}async setViewport(t,r){await this.send("Emulation.setDeviceMetricsOverride",{width:t,height:r,deviceScaleFactor:2,mobile:!0}),await this.send("Emulation.setTouchEmulationEnabled",{enabled:!0,maxTouchPoints:5})}async throttle(t){await this.send("Network.setCacheDisabled",{cacheDisabled:t!==null}),await this.send("Emulation.setCPUThrottlingRate",{rate:t?.cpuSlowdown??1}),await this.send("Network.emulateNetworkConditions",{offline:!1,latency:t?.latencyMs??0,downloadThroughput:t?t.downloadKbps*1e3/8:-1,uploadThroughput:t?t.uploadKbps*1e3/8:-1})}async close(){this.closed||(this.closed=!0,this.cdp.close(),await Y$(this.child),await Z$(this.profile,{recursive:!0,force:!0}))}send(t,r={}){return this.cdp.send(t,r,this.sessionId)}on(t,r){return this.cdp.on(t,r,this.sessionId)}async evaluate(t){let r=await this.send("Runtime.evaluate",{expression:t,awaitPromise:!0,returnByValue:!0});if(r.exceptionDetails)throw new Error(r.exceptionDetails.exception?.description??r.exceptionDetails.text??"The page could not evaluate browser code.");return r.result.value}waitForEvent(t,r,o){return new Promise((n,i)=>{let a=l=>{clearTimeout(d),s(),l()},s=this.on(t,()=>a(n)),d=setTimeout(()=>a(()=>i(new Error(`Timed out after ${r}ms waiting for ${o}.`))),r)})}async waitForNetworkIdle(t){let r=Date.now()+t;for(;Date.now()<r;){if(this.inflight.size===0&&Date.now()-this.lastNetworkActivity>=500)return;await ab(50)}throw new Error("Timed out after 20000ms waiting for the network to settle.")}async responseBody(t,r){let o=Date.now()+r,n=new Error("The response body was not available.");for(;Date.now()<o;)try{let i=await this.send("Network.getResponseBody",{requestId:t});return i.base64Encoded?Buffer.from(i.body,"base64").toString("utf8"):i.body}catch(i){n=i instanceof Error?i:n,await ab(25)}throw n}},UD=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Brave Browser.app/Contents/MacOS/Brave Browser","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",ha(Rl(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),ha(Rl(),"Applications/Chromium.app/Contents/MacOS/Chromium"),ha(Rl(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),ha(Rl(),"Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"),"/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/opt/google/chrome/chrome","/usr/bin/chromium","/usr/bin/chromium-browser","/usr/lib/chromium/chromium","/snap/bin/chromium","/usr/bin/brave-browser","/usr/bin/brave-browser-stable","/opt/brave.com/brave/brave-browser","/usr/bin/microsoft-edge","/usr/bin/microsoft-edge-stable","/opt/microsoft/msedge/msedge"]});function WD(e){let t=e.search(/<script\b/i),r=t===-1?e:e.slice(0,t),o=[],n=[...r.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)].map(s=>s[1]).join(`
|
|
11140
|
+
`);return/(^|[\s,}])(html|body)\b[^{]*\{[^}]*background(?:-color)?\s*:/i.test(n)||o.push("the game's background on html and body, in a <style> before any script"),/<meta\s+name="theme-color"/i.test(e)||o.push('a <meta name="theme-color"> with the background colour'),/<meta\s+name="color-scheme"/i.test(e)||o.push('a <meta name="color-scheme">'),/class="[^"]*\bgs-boot\b/.test(e)||/data-gs-loading/.test(e)||/role="status"[^>]*aria-busy="true"|aria-busy="true"[^>]*role="status"/.test(e)||/role="progressbar"/.test(e)||o.push("a loading state in the markup (a spinner or progress bar, not text)"),{ok:o.length===0,missing:o}}function KD(e,t){let r=_f[e],o=[],n=t.largest.map(a=>`${a.name} (${a.kb} KB)`).join(", "),i=(a,s,d,l)=>`${a} is ${s} ${l}, over the ${d} ${l} a ${lr[e].name.toLowerCase()} game gets.`;return t.jsKb>r.jsKb&&o.push(`${i("JavaScript",t.jsKb,r.jsKb,"KB")} Largest files: ${n}.`),t.cssKb>r.cssKb&&o.push(i("CSS",t.cssKb,r.cssKb,"KB")),t.fontKb>r.fontKb&&o.push(`${i("Fonts",t.fontKb,r.fontKb,"KB")} Load fewer weights, or subset them to the characters the game uses.`),t.totalKb>r.totalKb&&o.push(`${i("Everything together",t.totalKb,r.totalKb,"KB")} Largest files: ${n}.`),t.firstRenderMs!==void 0&&t.firstRenderMs>r.firstRenderMs&&o.push(`${i("First render",t.firstRenderMs,r.firstRenderMs,"ms")} Paint the game's colour and a loading state from the HTML itself, before any script.`),t.playableMs!==void 0&&t.playableMs>r.playableMs&&o.push(`${i("Time to playable",t.playableMs,r.playableMs,"ms")} Largest files: ${n}.`),o}async function J$(e,t){let r=Date.now()+t;do{let o=await e.run(`performance.getEntriesByName(${JSON.stringify(dr)}).length ? "mark" : (document.querySelector(${JSON.stringify(BD)}) ? "board" : "")`).catch(()=>"");if(o==="mark"||o==="board")return o;await new Promise(n=>setTimeout(n,100))}while(Date.now()<r)}async function HD(e,t,r,o){let n=`${r}x${o}`;await e.setViewport(r,o),await e.navigate(t,3e4),await J$(e,15e3),await e.run("new Promise((done) => setTimeout(done, 400))");let i=await e.run(`(() => { const el = document.scrollingElement || document.documentElement;
|
|
11141
|
+
return { tall: el.scrollHeight, wide: el.scrollWidth, h: innerHeight, w: innerWidth }; })()`),a=i.tall>i.h+1,s=i.wide>i.w+1;if(!a&&!s)return{size:n,fits:!0};let d=[];return a&&d.push(`the page is ${i.tall-i.h}px taller than the screen, so it scrolls`),s&&d.push(`the page is ${i.wide-i.w}px wider than the screen`),{size:n,fits:!1,detail:d.join(", and ")}}async function VD(e,t){await e.setViewport(390,844),await e.throttle(kf);try{await e.navigate(t,9e4);let r=await J$(e,6e4),o=r==="board"?await e.run("performance.now()"):void 0,n=await e.run(`(() => {
|
|
11142
11142
|
const kind = (entry) => {
|
|
11143
11143
|
const url = entry.name.split("?")[0].toLowerCase();
|
|
11144
11144
|
if (/\\.(woff2?|ttf|otf)$/.test(url)) return "font";
|
|
@@ -11154,45 +11154,45 @@ main()
|
|
|
11154
11154
|
const fcp = performance.getEntriesByName("first-contentful-paint")[0];
|
|
11155
11155
|
const mark = performance.getEntriesByName(${JSON.stringify(dr)})[0];
|
|
11156
11156
|
return { fcp: fcp ? fcp.startTime : undefined, mark: mark ? mark.startTime : undefined, files };
|
|
11157
|
-
})()`),i=e.transfers().filter(p=>p.bytes>0);if(i.length>0){let p=h=>{let m=h.url.split("?")[0].toLowerCase();return h.type==="Font"||/\.(woff2?|ttf|otf)$/.test(m)?"font":h.type==="Stylesheet"||/\.css$/.test(m)?"css":h.type==="Script"||/\.m?js$/.test(m)?"js":h.type==="Document"?"html":"other"};n.files=i.map(h=>({name:h.url,type:p(h),bytes:h.bytes}))}let a=p=>Math.round(p/1024),s=p=>a(n.files.filter(h=>!p||h.type===p).reduce((h,m)=>h+m.bytes,0)),d=[...n.files].sort((p,h)=>h.bytes-p.bytes).slice(0,3).map(p=>({name:p.name.split("/").pop()||p.name,kb:a(p.bytes)})),l=n.mark??o;return{jsKb:s("js"),cssKb:s("css"),fontKb:s("font"),totalKb:s(),firstRenderMs:n.fcp===void 0?void 0:Math.round(n.fcp),playableMs:l===void 0?void 0:Math.round(l),playableBy:n.mark!==void 0?"mark":r==="board"?"board":void 0,largest:d}}finally{await e.throttle(null)}}async function
|
|
11157
|
+
})()`),i=e.transfers().filter(p=>p.bytes>0);if(i.length>0){let p=h=>{let m=h.url.split("?")[0].toLowerCase();return h.type==="Font"||/\.(woff2?|ttf|otf)$/.test(m)?"font":h.type==="Stylesheet"||/\.css$/.test(m)?"css":h.type==="Script"||/\.m?js$/.test(m)?"js":h.type==="Document"?"html":"other"};n.files=i.map(h=>({name:h.url,type:p(h),bytes:h.bytes}))}let a=p=>Math.round(p/1024),s=p=>a(n.files.filter(h=>!p||h.type===p).reduce((h,m)=>h+m.bytes,0)),d=[...n.files].sort((p,h)=>h.bytes-p.bytes).slice(0,3).map(p=>({name:p.name.split("/").pop()||p.name,kb:a(p.bytes)})),l=n.mark??o;return{jsKb:s("js"),cssKb:s("css"),fontKb:s("font"),totalKb:s(),firstRenderMs:n.fcp===void 0?void 0:Math.round(n.fcp),playableMs:l===void 0?void 0:Math.round(l),playableBy:n.mark!==void 0?"mark":r==="board"?"board":void 0,largest:d}}finally{await e.throttle(null)}}async function X$(e,t,r,o){let n=_f[o],i=WD(r),a=[];i.ok||a.push(`The first paint is not the game's: it is missing ${i.missing.join("; ")}. Inside a native app's web view that shows as a white flash.`);let s=[];if(Nk.includes(o))for(let[l,p]of GD){let h=await HD(e,t,l,p).catch(m=>({size:`${l}x${p}`,fits:!1,detail:`could not be measured: ${m instanceof Error?m.message:String(m)}`}));s.push(h),h.fits||a.push(`At ${h.size} ${h.detail}. A ${lr[o].name.toLowerCase()} game must fit without the page scrolling: let the list inside scroll, or tighten the layout for short phones.`)}let d;try{d=await VD(e,t),a.push(...KD(o,d)),d.playableBy==="board"&&a.push(`The page sets no "${dr}" mark, so playable was timed by finding the board. Call window.gamestageReady() (or performance.mark) when the round is drawn.`)}catch(l){a.push(`The load could not be measured: ${l instanceof Error?l.message:String(l)}.`)}return{layout:o,profile:kf.name,budget:n,fit:s,load:d,firstPaint:i,warnings:a}}var GD,BD,Q$=w(()=>{"use strict";we();GD=[[360,640],[390,844],[844,390]],BD="button.pick, [data-pick], [data-gs-choice], [data-gamestage-start]"});function db(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function e0(e){let t=db(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||YD.test(t)||ZD.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function t0(e){for(let t of qD)if(t.test.test(e))return{confidence:"likely",level:t.level,...t.setting?{setting:t.setting}:{},because:t.because};return{confidence:"possible",level:"project",because:"a fan reads it and nothing in the code says it changes per round or per edition"}}function JD(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
|
|
11158
11158
|
`.repeat(n.split(`
|
|
11159
11159
|
`).length-1)).replace(/<style[\s\S]*?<\/style>/gi,n=>`
|
|
11160
11160
|
`.repeat(n.split(`
|
|
11161
11161
|
`).length-1)).split(`
|
|
11162
|
-
`).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let d=s.replace(/\s+/g," ");if(!
|
|
11163
|
-
`).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!Q$(i))continue;let a=lb(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...e0(a),file:e.relative,line:o+1})}}),t}function Dl(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...JD(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...XD(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var ZD,YD,qD,db=w(()=>{"use strict";ZD=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],YD=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;qD=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var v0={};Gt(v0,{browserCheck:()=>nj,browserChecks:()=>p0,connectionCheck:()=>y0,runVerify:()=>mb,scanPublishSet:()=>b0,shootPlayCheck:()=>g0,verificationResult:()=>u0});import{readFile as jl}from"node:fs/promises";import{gzipSync as QD}from"node:zlib";import{dirname as t0,resolve as ub}from"node:path";function ej(e){switch(e){case"hunt":return Xe.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Xe.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Xe.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Xe.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});case"shoot":return Xe.parse({archetype:e,number:1,prompt:"Five penalties. Three to win.",shotsAllowed:5,goalsToWin:3,pointsPerGoal:100,open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function n0(e,t,r){return(xS({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=Eg[i.key];return a?[[i.key,a]]:[]})}function u0(e){let t=e.filter(n=>n.status==="open").length,r=e.filter(n=>n.status==="skipped").length,o=e.filter(n=>n.status==="n/a").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r,notApplicable:o}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r,notApplicable:o}:{outcome:"verified",exitCode:0,open:t,skipped:r,notApplicable:o}}function pb(e){return tj.map(t=>({...t,status:"skipped",detail:e}))}async function p0(e,t,r,o){let n;try{n=await Ll()}catch(a){return pb("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim())}if(n.status==="skipped")return pb(n.detail);let i=n.browser;try{return[await f0(i,e,t,r,o),await y0(i,e)]}finally{await i.close().catch(()=>{})}}async function nj(e,t,r,o){let n;try{n=await Ll()}catch(a){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim()}}if(n.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:n.detail};let i=n.browser;try{return await f0(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function rj(e){let t=Date.now()+hb;do{if((await e.query(ma)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,h0))}while(Date.now()<t)}async function m0(e){for(let t=0;t<3&&!((await e.query(ma)).length>0);t++){let r=await rj(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(ma,5e3).catch(()=>{})}}async function f0(e,t,r,o,n){try{if(await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),qe(n??"")==="shoot")return await g0(e);await m0(e);let i=await e.query(ma);if(i.length===0){let x=e.pageErrors[0],O=await e.query("#prompt").then(()=>e.html()).then(H=>/id="prompt"[^>]*>([^<]{0,160})/.exec(H)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${x?` The page threw: ${x}`:O?` The page says: ${O}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let x of i)if(await e.click(ma,x).catch(()=>{}),s+=1,(await e.query(o0)).length>0)break;let d=await e.query(r0);if(d.length===0){let x=Symbol("pending"),O=await Promise.race([a,new Promise(M=>setTimeout(()=>M(x),5e3))]);if(O===x||O===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(o0)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(r0,d[0])}let l=await a;if(!l)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let p=await l.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let h=await e.html(),m=p.round_state?.score,y=m===void 0||h.includes(String(m))||h.includes(m.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:y?"verified":"open",detail:y?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${m} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}}async function c0(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,h0))}while(Date.now()<o);return!1}async function g0(e){let t="rendered-outcome",r="the screen shows what the server decided",o=M=>({id:t,what:r,status:"open",detail:M});if(!await c0(e,i0,hb)){let M=e.pageErrors[0];return o("Found no aim control. A penalties page offers its aim as buttons carrying `data-aim`, so a fan and this check can set up the same shot."+(M?` The page threw: ${M}`:""))}if(await e.click(i0,0).catch(()=>{}),(await e.query(a0)).length>0&&await e.click(a0,0).catch(()=>{}),!await c0(e,s0,hb))return o("An aim and a power were chosen and the page never allowed a shot: the shoot control stayed disabled or was not there. It is `#shoot` or `[data-gamestage-shoot]`.");let n=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});await e.click(s0,0);let i=await n;if(!i)return o("Shoot was pressed and the page never asked the Engine. Whatever it showed, it decided for itself.");let a=await i.json();if(e.pageErrors.length)return o(`The page threw: ${e.pageErrors[0]}`);if(a.outcome!=="accepted"&&a.outcome!=="duplicate"){let M=a.reason==="unexpected_field"?"The page put something on the wire the Engine does not take from a page, a result or a score of its own, and the Engine refused the whole shot rather than read round it. Send the aim, the power and the shot index and nothing else.":`The Engine refused the shot: ${a.reason??a.outcome}.`;return o(M)}let s=a.round_state?.progress?.shots?.at(-1);if(!s?.result)return o("The Engine accepted the shot and its state carries no committed shot to compare against.");let d=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,l=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+oj,h=await e.html();for(;!l.test(h)&&Date.now()<p;)await new Promise(M=>setTimeout(M,100)),h=await e.html();let m=[...h.matchAll(d)].map(M=>M[1]);if(!l.test(h))return o(`The Engine committed ${s.result} and the page shows ${m.length?m.map(M=>`"${M}"`).join(", "):"no shot result at all"}. The result a fan reads has to be the one the Engine returned, drawn from \`round_state.progress.shots\`, never worked out on the page.`);let y=a.round_state?.attempts_used;if(typeof y=="number"&&m.length!==y)return o(`The Engine has taken ${y} shot${y===1?"":"s"} and the page draws ${m.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let x=a.round_state?.score;return x===void 0||h.includes(String(x))||h.includes(x.toLocaleString("en-US"))?{id:t,what:r,status:"verified",detail:`The shot went to the Engine and came back ${s.result}; the page drew that and the score ${x}.`}:o(`The Engine committed a score of ${x} and the page does not show it.`)}async function y0(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await m0(e);let n=await e.html();await e.setOffline(!0);let i=await l0(e,n,3e3);return i?(await e.setOffline(!1),await l0(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function l0(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function aj(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>ij.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function d0(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function b0(e,t){let{files:r,skippedLinks:o}=Zi(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let d=aj(s.relativePath);if(d){i.has(d)||(i.add(d),n.push({path:`${d}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(Xg(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let l=await Vi(s.path);if(l===void 0)continue;a+=1;let p=Fe(l);if(p.ok&&p.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let h=ko(l,t);if(h.length){n.push({path:s.relativePath,why:xo(t,h),fatal:!0});continue}let m;try{let y=JSON.parse(l);y&&Array.isArray(y.sourcesContent)&&(m=y)}catch{}if(m){let y=m.sourcesContent.filter(O=>typeof O=="string").join(`
|
|
11164
|
-
`),x=y?ko(y,t):[];if(x.length){n.push({path:s.relativePath,why:`${xo(t,x)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}
|
|
11165
|
-
`),b=Lc(_),v=n0(r,n.archetype,b).filter(([,ne])=>!Tg(_,ne)).map(([ne])=>ne);d.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(b.length?`, and it offers ${b.length} more for controls it has (${b.join(", ")})`:""),status:v.length?"open":"verified",detail:v.length?`The page does not read: ${v.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let j=await _o(t),Y=new Set(Di()),X=new Set(["strapline","result_dare","share_dare","analytics_url","title_font","title_font_weight","title_letter_spacing","title_colour","title_case"]),se=[...Zg(_).keys()].map(ne=>`css_variables_${ne}`).filter(ne=>Y.has(ne)),ye=[...n0(r,n.archetype,b).map(([ne])=>ne).filter(ne=>Y.has(ne)&&!v.includes(ne)&&!X.has(ne)),...se,...$g(_)].filter(ne=>!j.settings?.[ne]?.trim());d.push({id:"settings-seeded",what:"every Studio field the page reads starts with the game's own value, from gamestage.settings.json",status:j.problems.length||ye.length?"open":"verified",detail:j.problems.length?j.problems.join(" "):ye.length?`Studio would open with these empty: ${ye.join(", ")}. Add each to gamestage.settings.json with the value a fan sees today, and read it from game.presentation rather than keeping it in the page.`:void 0});let pt=Dl(T),le=x.files.some(ne=>{let ot=ne.relativePath.split("/").pop();return ot===Re||ot===Ve})||s.includes(Re)||s.includes(Ve),he=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);d.push({id:"client-present",what:"the client the page imports is there",status:le||!he?"verified":"open",detail:he&&!le?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let _t=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(ne=>_.includes(ne));d.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:_t.length===0?"verified":"open",detail:_t.length===0?void 0:`This game imports ${_t.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Ze=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(_),bn=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(_);d.push({id:"server-time",what:"a deadline comes from the server's clock",status:Ze&&bn?"skipped":"verified",detail:Ze&&bn?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let ht=await Nl({game:r.app.id,round:n,title:r.app.title});await new Promise(ne=>ht.listen(0,"127.0.0.1",()=>ne()));let rt=ht.address(),Se=rt&&typeof rt!="string"?`http://127.0.0.1:${rt.port}`:"",Be=await import("node:http").then(({createServer:ne})=>ne(async(ot,tn)=>{let Zn=(ot.url??"/").split("?")[0],Yn=Zn==="/"?a:ub(a,"..",Zn.slice(1));try{let Rt=await jl(Yn),qn=/\bgzip\b/.test(String(ot.headers["accept-encoding"]??""));tn.writeHead(200,{"content-type":sj(Yn),...qn?{"content-encoding":"gzip"}:{}}),tn.end(qn?QD(Rt):Rt)}catch{tn.writeHead(404).end()}}));await new Promise(ne=>Be.listen(0,"127.0.0.1",()=>ne()));let kt=Be.address(),Ye=kt&&typeof kt!="string"?`http://127.0.0.1:${kt.port}/`:"",mt;try{d.push(...e.noBrowser?pb("Asked not to open a browser."):await p0(Ye,Se,r.app.id,n.archetype)),e.noBrowser||(mt=await cj(a,Ye,r))}finally{ht.close(),Be.close()}let je=u0(d),xt=x.findings.filter(ne=>!ne.fatal),Ft=await LE(),Ae=Ft?await Ft.getGame(r.app.id).catch(()=>{}):void 0,ft=Ft&&Ae?await Ki(Ft,Ae):void 0;if(J()){te({ok:je.outcome==="verified",...ft?{sourceWarning:ft}:{},outcome:je.outcome,exitCode:je.exitCode,checks:d,open:je.open,skipped:je.skipped,round:i,copy_candidates:pt,...mt?{load:mt}:{},publish_set:{directory:y,files:x.files.map(ne=>ne.relativePath),read:x.read,warnings:xt}}),je.exitCode!==0&&await Mg(je.exitCode);return}Hi(ft),U(je.outcome==="verified"?"Verified":je.outcome==="failed"?"Verification failed":"Verification incomplete"),R("round used for verification",i.source),g(` ${A.dim(i.detail)}`);for(let ne of d){let ot=ne.status==="verified"?A.green("ok"):ne.status==="open"?A.yellow("open"):ne.status==="n/a"?A.dim("n/a"):A.dim("skipped");R(ne.what,ot),ne.detail&&g(` ${A.dim(ne.detail)}`)}if(xt.length){g(),g(A.dim(" Also in the publish set, and a deploy would upload it:"));for(let ne of xt)g(` ${A.dim("\xB7")} ${A.cyan(ne.path)} ${A.dim(ne.why)}`)}if(mt&&lj(mt),pt.length){g(),g(A.dim(" Copy a producer may need to own:"));for(let ne of pt)g(` ${A.dim("\xB7")} ${A.cyan(`${ne.file}:${ne.line}`)} ${ne.text} ${A.dim(`(${ne.confidence}, ${ne.level})`)}`)}g(),je.outcome==="verified"?E("The Engine decided the outcome and the page showed it. That is the migration done."):je.outcome==="failed"?E("A check remains open, so the game failed verification. Read the open check and fix its cause."):E("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),g(),je.exitCode!==0&&await Mg(je.exitCode)}function sj(e){return{js:"text/javascript",mjs:"text/javascript",css:"text/css",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",woff2:"font/woff2",woff:"font/woff",html:"text/html"}[e.split(".").pop()?.toLowerCase()??""]??"text/html"}async function cj(e,t,r){let o=r.experience.layout??mc(r.backend.archetype,r.experience.host??"fullscreen"),n;try{n=await Ll()}catch{return}if(n.status!=="skipped")try{let i=await jl(e,"utf8");return await J$(n.browser,t,i,o)}catch{return}finally{await n.browser.close().catch(()=>{})}}function lj(e){if(g(),g(A.dim(` How it loads (${e.layout}, on a ${e.profile}):`)),e.load){let t=e.load,r=e.budget;g(` ${A.dim("\xB7")} JavaScript ${t.jsKb} KB of ${r.jsKb}, CSS ${t.cssKb} of ${r.cssKb}, fonts ${t.fontKb} of ${r.fontKb}, all ${t.totalKb} of ${r.totalKb}`),t.firstRenderMs!==void 0&&g(` ${A.dim("\xB7")} first render ${t.firstRenderMs} ms of ${r.firstRenderMs}`),t.playableMs!==void 0&&g(` ${A.dim("\xB7")} playable ${t.playableMs} ms of ${r.playableMs}`)}for(let t of e.fit)g(` ${A.dim("\xB7")} ${t.size}: ${t.fits?"fits":A.yellow("does not fit")}`);if(e.warnings.length===0){g(` ${A.dim("\xB7")} within budget, and the first paint is the game's own`);return}for(let t of e.warnings)g(` ${A.yellow("!")} ${t}`)}var ma,r0,o0,tj,hb,h0,i0,a0,s0,oj,ij,fb=w(()=>{"use strict";Wi();Yg();we();rb();At();qg();pn();Y$();X$();ey();db();qc();Vc();Ne();ma="button.pick, [data-pick], [data-gs-choice]",r0="#submit, button[type=submit], .submit",o0="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",tj=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];hb=15e3,h0=250;i0="[data-aim]",a0="[data-power]",s0="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",oj=4e3;ij=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var _n=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Jn=class extends _n{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Uo=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Jn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ka(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as nI}from"node:events";import td from"node:child_process";import nn from"node:path";import Sa from"node:fs";import ve from"node:process";import{stripVTControlCharacters as rI}from"node:util";import{stripVTControlCharacters as QA}from"node:util";var zo=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>ka(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(h,m){return r.formatItem(h,o,m,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let d=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",d,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,m)=>{let y=h.map(x=>i(r.styleOptionTerm(r.optionTerm(x)),r.styleOptionDescription(r.optionDescription(x))));a=a.concat(this.formatItemList(m,y,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,m)=>{let y=h.map(x=>i(r.styleSubcommandTerm(r.subcommandTerm(x)),r.styleSubcommandDescription(r.subcommandDescription(x))));a=a.concat(this.formatItemList(m,y,r))}),a.join(`
|
|
11166
|
-
`)}displayWidth(t){return
|
|
11162
|
+
`).forEach((n,i)=>{let a=[...[...n.matchAll(/>([^<>]{2,160})</g)].map(s=>s[1]),...[...n.matchAll(/\b(?:title|alt|placeholder|aria-label)="([^"]{2,160})"/gi)].map(s=>s[1])];for(let s of a){let d=s.replace(/\s+/g," ");if(!e0(d))continue;let l=db(d);t.push({text:l,...t0(l),file:e.relative,line:i+1})}}),t}function XD(e){let t=[];return e.text.split(`
|
|
11163
|
+
`).forEach((r,o)=>{if(!/^\s*(import|export|require\()/.test(r))for(let n of r.matchAll(/(['"`])((?:(?!\1)[^\\\r\n]|\\.){2,160})\1/g)){let i=n[2].replace(/\s+/g," ");if(!e0(i))continue;let a=db(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...t0(a),file:e.relative,line:o+1})}}),t}function Dl(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...JD(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...XD(o));let r=new Map;for(let o of t){let n=o.text.toLowerCase();r.has(n)||r.set(n,o)}return[...r.values()].sort((o,n)=>o.level===n.level?o.text.localeCompare(n.text):o.level.localeCompare(n.level))}var ZD,YD,qD,ub=w(()=>{"use strict";ZD=[/^(loading|error|ok|yes|no|on|off|true|false|null|undefined)$/i,/^[\d\s.,:%+-]+$/,/^[a-z0-9_-]+$/,/^(#|\.|\/|https?:|data:|mailto:)/i,/^[A-Z_]{2,}$/,/^\s*$/],YD=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;qD=[{test:/^(play|start|go|begin|submit|share|try|see|next|done|finish)\b/i,level:"project",setting:"play_button_label",because:"reads as a button a fan presses, and a producer owns the words on it"},{test:/\b(how to play|the rules|instructions)\b/i,level:"project",setting:"how_to_play",because:"reads as the rules, which a producer rewrites without a deploy"},{test:/\b(hall of fame|all-?star|all-?nba|rookie|veteran|starter|busted|legend|champion|gold|silver|bronze)\b/i,level:"project",because:"reads as a rank a fan is given, which is the game's ladder and does not change between editions"},{test:/\b(today|tonight|this week|round \d|day \d|week \d)\b/i,level:"element",because:"names one round rather than the game, so it changes every time the round does"},{test:/\b(edition|season|fixture|matchday|gameweek|tournament|final|semi)\b/i,level:"event",because:"names a run of the game rather than the game, so it belongs to the edition"},{test:/\balready played\b|\bcome back\b|\bsee your result\b/i,level:"project",because:"a message a fan reads about their own state, and a producer's to word"}]});var w0={};Gt(w0,{browserCheck:()=>nj,browserChecks:()=>h0,connectionCheck:()=>b0,runVerify:()=>fb,scanPublishSet:()=>v0,shootPlayCheck:()=>y0,verificationResult:()=>p0});import{readFile as jl}from"node:fs/promises";import{gzipSync as QD}from"node:zlib";import{dirname as n0,resolve as pb}from"node:path";function ej(e){switch(e){case"hunt":return Xe.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return Xe.parse({archetype:e,number:1,prompt:"Two picks. Get close to 100 without going over.",target:100,targetLabel:"Points",slates:[{id:"first",label:"First pick",entries:[{key:"alpha",label:"Alpha",value:40},{key:"beta",label:"Beta",value:70}]},{id:"second",label:"Second pick",entries:[{key:"gamma",label:"Gamma",value:25},{key:"delta",label:"Delta",value:55}]}],open:!0});case"group":return Xe.parse({archetype:e,number:1,prompt:"Find the groups. Four at a time.",board:["alpha","beta","gamma","delta","epsilon","zeta","eta","theta"],groups:[{key:"first",label:"First four",members:["alpha","beta","gamma","delta"]},{key:"second",label:"Second four",members:["epsilon","zeta","eta","theta"]}],open:!0});case"predict":return Xe.parse({archetype:e,number:1,prompt:"Who takes it?",options:[{key:"alpha",label:"Alpha"},{key:"beta",label:"Beta"},{key:"draw",label:"Neither, it ends level"}],open:!0});case"shoot":return Xe.parse({archetype:e,number:1,prompt:"Five penalties. Three to win.",shotsAllowed:5,goalsToWin:3,pointsPerGoal:100,open:!0});default:throw new Error(`No representative round exists for the ${e} archetype.`)}}function r0(e,t,r){return(SS({gameId:e.app.id,gameName:e.app.title,archetype:t,manifestRevision:e.manifest.revision,wording:r,urls:{baseAppsUrl:"",dashImage:"",embedUrl:""}})["project_settings.json"].sections??[]).flatMap(i=>i.properties??[]).flatMap(i=>{if(typeof i.key!="string")return[];let a=Tg[i.key];return a?[[i.key,a]]:[]})}function p0(e){let t=e.filter(n=>n.status==="open").length,r=e.filter(n=>n.status==="skipped").length,o=e.filter(n=>n.status==="n/a").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r,notApplicable:o}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r,notApplicable:o}:{outcome:"verified",exitCode:0,open:t,skipped:r,notApplicable:o}}function hb(e){return tj.map(t=>({...t,status:"skipped",detail:e}))}async function h0(e,t,r,o){let n;try{n=await Ll()}catch(a){return hb("Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim())}if(n.status==="skipped")return hb(n.detail);let i=n.browser;try{return[await g0(i,e,t,r,o),await b0(i,e)]}finally{await i.close().catch(()=>{})}}async function nj(e,t,r,o){let n;try{n=await Ll()}catch(a){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:"Chrome could not start. Check GAMESTAGE_CHROME points to a working browser, then "+`run verify again. ${a instanceof Error?a.message:""}`.trim()}}if(n.status==="skipped")return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"skipped",detail:n.detail};let i=n.browser;try{return await g0(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function rj(e){let t=Date.now()+mb;do{if((await e.query(ma)).length>0)return;let r=await e.query("[data-gamestage-start]:not([disabled])");for(let o of r)if(await e.isVisible("[data-gamestage-start]:not([disabled])",o))return o;await new Promise(o=>setTimeout(o,m0))}while(Date.now()<t)}async function f0(e){for(let t=0;t<3&&!((await e.query(ma)).length>0);t++){let r=await rj(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(ma,5e3).catch(()=>{})}}async function g0(e,t,r,o,n){try{if(await e.addScriptToEvaluateOnNewDocument(`window.GAMESTAGE_API = ${JSON.stringify(r)};window.GAMESTAGE_GAME = ${JSON.stringify(o)};`),await e.navigate(t,2e4),qe(n??"")==="shoot")return await y0(e);await f0(e);let i=await e.query(ma);if(i.length===0){let x=e.pageErrors[0],O=await e.query("#prompt").then(()=>e.html()).then(H=>/id="prompt"[^>]*>([^<]{0,160})/.exec(H)?.[1]?.trim()).catch(()=>{});return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Found nothing to pick. The page did not render a board from the round.${x?` The page threw: ${x}`:O?` The page says: ${O}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let x of i)if(await e.click(ma,x).catch(()=>{}),s+=1,(await e.query(i0)).length>0)break;let d=await e.query(o0);if(d.length===0){let x=Symbol("pending"),O=await Promise.race([a,new Promise(M=>setTimeout(()=>M(x),5e3))]);if(O===x||O===void 0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board. The page has no Submit, which is allowed because a tap can be the play, but nothing reached the Engine either, so no play was made by any route.`}}else{if((await e.query(i0)).length===0)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`Selected ${s} of ${i.length} on the board and the page never allowed a play: Submit stayed disabled throughout. The page decides when a guess is complete, so either it needs a combination this cannot reach by picking in order, or it is not enabling Submit when it should.`};await e.click(o0,d[0])}let l=await a;if(!l)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:"The page was played and never asked the Engine. Whatever it showed, it decided for itself."};let p=await l.json();if(e.pageErrors.length)return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:`The page threw: ${e.pageErrors[0]}`};let h=await e.html(),m=p.round_state?.score,y=m===void 0||h.includes(String(m))||h.includes(m.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:y?"verified":"open",detail:y?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${m} and the page does not show it.`}}catch(i){return{id:"rendered-outcome",what:"the screen shows what the server decided",status:"open",detail:i instanceof Error?i.message:"The page could not be played."}}}async function l0(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,m0))}while(Date.now()<o);return!1}async function y0(e){let t="rendered-outcome",r="the screen shows what the server decided",o=M=>({id:t,what:r,status:"open",detail:M});if(!await l0(e,a0,mb)){let M=e.pageErrors[0];return o("Found no aim control. A penalties page offers its aim as buttons carrying `data-aim`, so a fan and this check can set up the same shot."+(M?` The page threw: ${M}`:""))}if(await e.click(a0,0).catch(()=>{}),(await e.query(s0)).length>0&&await e.click(s0,0).catch(()=>{}),!await l0(e,c0,mb))return o("An aim and a power were chosen and the page never allowed a shot: the shoot control stayed disabled or was not there. It is `#shoot` or `[data-gamestage-shoot]`.");let n=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{});await e.click(c0,0);let i=await n;if(!i)return o("Shoot was pressed and the page never asked the Engine. Whatever it showed, it decided for itself.");let a=await i.json();if(e.pageErrors.length)return o(`The page threw: ${e.pageErrors[0]}`);if(a.outcome!=="accepted"&&a.outcome!=="duplicate"){let M=a.reason==="unexpected_field"?"The page put something on the wire the Engine does not take from a page, a result or a score of its own, and the Engine refused the whole shot rather than read round it. Send the aim, the power and the shot index and nothing else.":`The Engine refused the shot: ${a.reason??a.outcome}.`;return o(M)}let s=a.round_state?.progress?.shots?.at(-1);if(!s?.result)return o("The Engine accepted the shot and its state carries no committed shot to compare against.");let d=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,l=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+oj,h=await e.html();for(;!l.test(h)&&Date.now()<p;)await new Promise(M=>setTimeout(M,100)),h=await e.html();let m=[...h.matchAll(d)].map(M=>M[1]);if(!l.test(h))return o(`The Engine committed ${s.result} and the page shows ${m.length?m.map(M=>`"${M}"`).join(", "):"no shot result at all"}. The result a fan reads has to be the one the Engine returned, drawn from \`round_state.progress.shots\`, never worked out on the page.`);let y=a.round_state?.attempts_used;if(typeof y=="number"&&m.length!==y)return o(`The Engine has taken ${y} shot${y===1?"":"s"} and the page draws ${m.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let x=a.round_state?.score;return x===void 0||h.includes(String(x))||h.includes(x.toLocaleString("en-US"))?{id:t,what:r,status:"verified",detail:`The shot went to the Engine and came back ${s.result}; the page drew that and the score ${x}.`}:o(`The Engine committed a score of ${x} and the page does not show it.`)}async function b0(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await f0(e);let n=await e.html();await e.setOffline(!0);let i=await d0(e,n,3e3);return i?(await e.setOffline(!1),await d0(e,i,3e3)?{id:r,what:o,status:"verified",detail:"Taken offline the page said so, and it recovered when the network returned."}:{id:r,what:o,status:"open",detail:"The page noticed the connection going and not it coming back: it was still in its offline state three seconds after the network returned. Listen for `online` as well, take the message down, and re-read the round rather than trusting what is on the screen."}):{id:r,what:o,status:"open",detail:"The connection was taken away and the page did not change. A fan who loses their signal is shown a game that still looks playable, and every tap on it is a tap the Engine never sees. Listen for the window's `offline` event and say so on the screen."}}catch(n){return{id:r,what:o,status:"open",detail:n instanceof Error?n.message:"The page could not be taken offline and back."}}finally{await e.setOffline(!1).catch(()=>{})}}async function d0(e,t,r){let o=Date.now()+r;for(;Date.now()<o;){let n=await e.html().catch(()=>t);if(n!==t)return n;await new Promise(i=>setTimeout(i,100))}}function aj(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>ij.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function u0(e){let t=e.split("/").pop()??e;return t.endsWith("~")||t===".DS_Store"||/\.(bak|orig|swp|swo|rej|old)$/.test(t)||/\.old\.[^.]+$/.test(t)}async function v0(e,t){let{files:r,skippedLinks:o}=Zi(e,{symlinks:"skip"}),n=[],i=new Set,a=0;for(let s of o)n.push({path:s,why:"a symlink, which a deploy would refuse to publish",fatal:!1});for(let s of r){let d=aj(s.relativePath);if(d){i.has(d)||(i.add(d),n.push({path:`${d}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(Qg(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let l=await Vi(s.path);if(l===void 0)continue;a+=1;let p=Fe(l);if(p.ok&&p.manifest.backend.round){n.push({path:s.relativePath,why:"an App Manifest, which carries the round's private half",fatal:!0});continue}let h=ko(l,t);if(h.length){n.push({path:s.relativePath,why:xo(t,h),fatal:!0});continue}let m;try{let y=JSON.parse(l);y&&Array.isArray(y.sourcesContent)&&(m=y)}catch{}if(m){let y=m.sourcesContent.filter(O=>typeof O=="string").join(`
|
|
11164
|
+
`),x=y?ko(y,t):[];if(x.length){n.push({path:s.relativePath,why:`${xo(t,x)} It is inside the map's own copy of your sources.`,fatal:!0});continue}n.push({path:s.relativePath,why:"a source map, which publishes your sources",fatal:!1});continue}u0(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)u0(s.relativePath)&&!n.some(d=>d.path===s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1});return{files:r,read:a,findings:n}}async function fb(e){await Fn();let t=e.manifest??"gamestage.yaml",r,o="";try{o=await jl(t,"utf8");let ne=Fe(o);if(!ne.ok)return K(`${t} is not a valid App Manifest.`,ne.issues.map(ot=>`${A.cyan(ot.path)} ${ot.message}`));r=ne.manifest}catch{return K(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let n=r.backend.round??ej(r.backend.archetype),i=r.backend.round?{source:"manifest",archetype:n.archetype,detail:"The Engine used this game's own backend.round from the manifest."}:{source:"stand-in",archetype:n.archetype,detail:`The manifest carries no round, so the Engine used a representative ${n.archetype} stand-in supplied by Gamestage. It did not test the game's production content from Studio.`};if(!vr.includes(n.archetype))return K(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${vr.join(", ")}.`]);let a=pb(e.file??"index.html"),s;try{s=await jl(a,"utf8")}catch{return K(`Cannot read ${e.file??"index.html"}.`)}let d=[];d.push({id:"round-is-the-games-own",what:"the round played here was this game's own",status:i.source==="manifest"?"verified":"skipped",detail:i.source==="manifest"?void 0:"This game keeps its content in Studio, which is where it belongs, so there is no round here to play and this check cannot run. That is a limit of checking locally rather than anything wrong with the game. Play the deployed game to prove its round."});let l=n.archetype==="shoot"?"shotsAllowed":"attemptsAllowed",p=n.archetype==="shoot"?5:10,h=n.archetype==="hunt"||n.archetype==="group"||n.archetype==="shoot",m=new RegExp(`^\\s*${l}\\s*:`,"m").test(o);d.push({id:"attempts-cap-chosen",what:"the attempt cap was chosen rather than defaulted",status:r.backend.round?h?m?"verified":"open":"n/a":"skipped",detail:r.backend.round?h?m?void 0:`backend.round.${l} is not set, so the Engine applied its default of ${p}. Nobody chose that number, and it is the game a fan plays. Set it, even to ${p}, so it is a decision rather than an accident.`:`A ${n.archetype} round is not capped by ${l}.`:"No round in the manifest; the content is in Studio, where the cap is a producer's field."});let y=pb(e.dir??n0(a)),x;try{x=await v0(y,n)}catch(ne){return K(`Cannot read the publish set at ${e.dir??n0(a)}.`,[ne instanceof Error?ne.message:"The directory could not be walked."])}let O=x.findings.filter(ne=>ne.fatal),M=ko(s,n),H=M.length>0||O.length>0;d.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${x.files.length} file${x.files.length===1?"":"s"}, ${x.read} read)`,status:H?"open":"verified",detail:H?[M.length?xo(n,M):void 0,...O.map(ne=>`${ne.path}: ${ne.why}`)].filter(Boolean).join(" "):void 0});let T=await Zc(x.files),_=T.map(ne=>ne.text).join(`
|
|
11165
|
+
`),b=Lc(_),v=r0(r,n.archetype,b).filter(([,ne])=>!$g(_,ne)).map(([ne])=>ne);d.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(b.length?`, and it offers ${b.length} more for controls it has (${b.join(", ")})`:""),status:v.length?"open":"verified",detail:v.length?`The page does not read: ${v.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let j=await _o(t),Y=new Set(Di()),X=new Set(["strapline","result_dare","share_dare","analytics_url","title_font","title_font_weight","title_letter_spacing","title_colour","title_case"]),se=[...Yg(_).keys()].map(ne=>`css_variables_${ne}`).filter(ne=>Y.has(ne)),ye=[...r0(r,n.archetype,b).map(([ne])=>ne).filter(ne=>Y.has(ne)&&!v.includes(ne)&&!X.has(ne)),...se,...Ag(_)].filter(ne=>!j.settings?.[ne]?.trim());d.push({id:"settings-seeded",what:"every Studio field the page reads starts with the game's own value, from gamestage.settings.json",status:j.problems.length||ye.length?"open":"verified",detail:j.problems.length?j.problems.join(" "):ye.length?`Studio would open with these empty: ${ye.join(", ")}. Add each to gamestage.settings.json with the value a fan sees today, and read it from game.presentation rather than keeping it in the page.`:void 0});let pt=Dl(T),le=x.files.some(ne=>{let ot=ne.relativePath.split("/").pop();return ot===Re||ot===Ve})||s.includes(Re)||s.includes(Ve),he=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);d.push({id:"client-present",what:"the client the page imports is there",status:le||!he?"verified":"open",detail:he&&!le?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let _t=["@monterosa/sdk-core","@monterosa/sdk-connect-kit","@monterosa/sdk-consent-kit","@monterosa/sdk-storage-kit","@monterosa/sdk-analytics-kit","@monterosa/sdk-interact-kit","@monterosa/sdk-identify-kit","@monterosa/sdk-util"].filter(ne=>_.includes(ne));d.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:_t.length===0?"verified":"open",detail:_t.length===0?void 0:`This game imports ${_t.join(", ")} directly. The Gamestage client is the only supported way to reach Interaction Cloud: it holds the connection, the consent gate and the server clock, and a second one beside it has none of them. Use what \`start()\` returns instead, and say what is missing from it if something is.`});let Ze=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test(_),bn=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test(_);d.push({id:"server-time",what:"a deadline comes from the server's clock",status:Ze&&bn?"skipped":"verified",detail:Ze&&bn?"This game reads the device clock somewhere and handles a round's timing somewhere, and this check reads the bundle as one string, so it cannot tell whether those are the same code. Worth your eyes: a lock or a countdown decided by the device clock is a deadline a fan can move by changing their clock. Use `game.now()`, which is the server's time through the client. `Date.now()` is fine for anything that decides nothing, like an animation or an analytics timestamp.":void 0});let ht=await Nl({game:r.app.id,round:n,title:r.app.title});await new Promise(ne=>ht.listen(0,"127.0.0.1",()=>ne()));let rt=ht.address(),Se=rt&&typeof rt!="string"?`http://127.0.0.1:${rt.port}`:"",Be=await import("node:http").then(({createServer:ne})=>ne(async(ot,tn)=>{let Zn=(ot.url??"/").split("?")[0],Yn=Zn==="/"?a:pb(a,"..",Zn.slice(1));try{let Rt=await jl(Yn),qn=/\bgzip\b/.test(String(ot.headers["accept-encoding"]??""));tn.writeHead(200,{"content-type":sj(Yn),...qn?{"content-encoding":"gzip"}:{}}),tn.end(qn?QD(Rt):Rt)}catch{tn.writeHead(404).end()}}));await new Promise(ne=>Be.listen(0,"127.0.0.1",()=>ne()));let kt=Be.address(),Ye=kt&&typeof kt!="string"?`http://127.0.0.1:${kt.port}/`:"",mt;try{d.push(...e.noBrowser?hb("Asked not to open a browser."):await h0(Ye,Se,r.app.id,n.archetype)),e.noBrowser||(mt=await cj(a,Ye,r))}finally{ht.close(),Be.close()}let je=p0(d),xt=x.findings.filter(ne=>!ne.fatal),Ft=await DE(),Ae=Ft?await Ft.getGame(r.app.id).catch(()=>{}):void 0,ft=Ft&&Ae?await Ki(Ft,Ae):void 0;if(J()){te({ok:je.outcome==="verified",...ft?{sourceWarning:ft}:{},outcome:je.outcome,exitCode:je.exitCode,checks:d,open:je.open,skipped:je.skipped,round:i,copy_candidates:pt,...mt?{load:mt}:{},publish_set:{directory:y,files:x.files.map(ne=>ne.relativePath),read:x.read,warnings:xt}}),je.exitCode!==0&&await Ug(je.exitCode);return}Hi(ft),U(je.outcome==="verified"?"Verified":je.outcome==="failed"?"Verification failed":"Verification incomplete"),R("round used for verification",i.source),g(` ${A.dim(i.detail)}`);for(let ne of d){let ot=ne.status==="verified"?A.green("ok"):ne.status==="open"?A.yellow("open"):ne.status==="n/a"?A.dim("n/a"):A.dim("skipped");R(ne.what,ot),ne.detail&&g(` ${A.dim(ne.detail)}`)}if(xt.length){g(),g(A.dim(" Also in the publish set, and a deploy would upload it:"));for(let ne of xt)g(` ${A.dim("\xB7")} ${A.cyan(ne.path)} ${A.dim(ne.why)}`)}if(mt&&lj(mt),pt.length){g(),g(A.dim(" Copy a producer may need to own:"));for(let ne of pt)g(` ${A.dim("\xB7")} ${A.cyan(`${ne.file}:${ne.line}`)} ${ne.text} ${A.dim(`(${ne.confidence}, ${ne.level})`)}`)}g(),je.outcome==="verified"?E("The Engine decided the outcome and the page showed it. That is the migration done."):je.outcome==="failed"?E("A check remains open, so the game failed verification. Read the open check and fix its cause."):E("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),g(),je.exitCode!==0&&await Ug(je.exitCode)}function sj(e){return{js:"text/javascript",mjs:"text/javascript",css:"text/css",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",woff2:"font/woff2",woff:"font/woff",html:"text/html"}[e.split(".").pop()?.toLowerCase()??""]??"text/html"}async function cj(e,t,r){let o=r.experience.layout??mc(r.backend.archetype,r.experience.host??"fullscreen"),n;try{n=await Ll()}catch{return}if(n.status!=="skipped")try{let i=await jl(e,"utf8");return await X$(n.browser,t,i,o)}catch{return}finally{await n.browser.close().catch(()=>{})}}function lj(e){if(g(),g(A.dim(` How it loads (${e.layout}, on a ${e.profile}):`)),e.load){let t=e.load,r=e.budget;g(` ${A.dim("\xB7")} JavaScript ${t.jsKb} KB of ${r.jsKb}, CSS ${t.cssKb} of ${r.cssKb}, fonts ${t.fontKb} of ${r.fontKb}, all ${t.totalKb} of ${r.totalKb}`),t.firstRenderMs!==void 0&&g(` ${A.dim("\xB7")} first render ${t.firstRenderMs} ms of ${r.firstRenderMs}`),t.playableMs!==void 0&&g(` ${A.dim("\xB7")} playable ${t.playableMs} ms of ${r.playableMs}`)}for(let t of e.fit)g(` ${A.dim("\xB7")} ${t.size}: ${t.fits?"fits":A.yellow("does not fit")}`);if(e.warnings.length===0){g(` ${A.dim("\xB7")} within budget, and the first paint is the game's own`);return}for(let t of e.warnings)g(` ${A.yellow("!")} ${t}`)}var ma,o0,i0,tj,mb,m0,a0,s0,c0,oj,ij,gb=w(()=>{"use strict";Wi();qg();we();ob();At();Jg();pn();q$();Q$();ty();ub();qc();Vc();Ne();ma="button.pick, [data-pick], [data-gs-choice]",o0="#submit, button[type=submit], .submit",i0="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",tj=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];mb=15e3,m0=250;a0="[data-aim]",s0="[data-power]",c0="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",oj=4e3;ij=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var _n=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Jn=class extends _n{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Uo=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Jn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ka(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as rI}from"node:events";import td from"node:child_process";import nn from"node:path";import Sa from"node:fs";import ve from"node:process";import{stripVTControlCharacters as oI}from"node:util";import{stripVTControlCharacters as eI}from"node:util";var zo=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((n,i)=>n.name().localeCompare(i.name())),r}compareOptions(t,r){let o=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),o=t._getHelpOption();if(o&&!o.hidden){let n=o.short&&t._findOption(o.short),i=o.long&&t._findOption(o.long);!n&&!i?r.push(o):o.long&&!i?r.push(t.createOption(o.long,o.description)):o.short&&!n&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let n=o.options.filter(i=>!i.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>ka(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,n)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let n=t.parent;n;n=n.parent)o=n.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatItemList(t,r,o){return r.length===0?[]:[o.styleTitle(t),...r,""]}groupItems(t,r,o){let n=new Map;return t.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[])}),r.forEach(i=>{let a=o(i);n.has(a)||n.set(a,[]),n.get(a).push(i)}),n}formatHelp(t,r){let o=r.padWidth(t,r),n=r.helpWidth??80;function i(h,m){return r.formatItem(h,o,m,r)}let a=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],s=r.commandDescription(t);s.length>0&&(a=a.concat([r.boxWrap(r.styleCommandDescription(s),n),""]));let d=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",d,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,m)=>{let y=h.map(x=>i(r.styleOptionTerm(r.optionTerm(x)),r.styleOptionDescription(r.optionDescription(x))));a=a.concat(this.formatItemList(m,y,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,m)=>{let y=h.map(x=>i(r.styleSubcommandTerm(r.subcommandTerm(x)),r.styleSubcommandDescription(r.subcommandDescription(x))));a=a.concat(this.formatItemList(m,y,r))}),a.join(`
|
|
11166
|
+
`)}displayWidth(t){return eI(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,n){let a=" ".repeat(2);if(!o)return a+t;let s=t.padEnd(r+t.length-n.displayWidth(t)),d=2,p=(this.helpWidth??80)-r-d-2,h;return p<this.minWidthToWrap||n.preformatted(o)?h=o:h=n.boxWrap(o,p).replace(/\n/g,`
|
|
11167
11167
|
`+" ".repeat(r+d)),a+s+" ".repeat(d)+h.replace(/\n/g,`
|
|
11168
11168
|
${a}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,i=[];return o.forEach(a=>{let s=a.match(n);if(s===null){i.push("");return}let d=[s.shift()],l=this.displayWidth(d[0]);s.forEach(p=>{let h=this.displayWidth(p);if(l+h<=r){d.push(p),l+=h;return}i.push(d.join(""));let m=p.trimStart();d=[m],l=this.displayWidth(m)}),i.push(d.join(""))}),i.join(`
|
|
11169
|
-
`)}};var kn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=
|
|
11169
|
+
`)}};var kn=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=tI(t);this.short=o.shortFlag,this.long=o.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Jn(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ib(this.name().replace(/^no-/,"")):Ib(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},xa=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let n=this.negativeOptions.get(o).presetArg,i=n!==void 0?n:!1;return r.negate===(i===t)}};function Ib(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function tI(e){let t,r,o=/^-[^-]$/,n=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(o.test(i[0])&&(t=i.shift()),n.test(i[0])&&(r=i.shift()),!t&&o.test(i[0])&&(t=i.shift()),!t&&n.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let a=i[0],s=`option creation failed due to '${a}' in option flags '${e}'`;throw/^-[^-][^-]/.test(a)?new Error(`${s}
|
|
11170
11170
|
- a short flag is a single dash and a single character
|
|
11171
11171
|
- either use a single dash and a single character (for a short flag)
|
|
11172
11172
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(a)?new Error(`${s}
|
|
11173
11173
|
- too many short flags`):n.test(a)?new Error(`${s}
|
|
11174
11174
|
- too many long flags`):new Error(`${s}
|
|
11175
|
-
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function
|
|
11175
|
+
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function nI(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let n=1;n<=e.length;n++){let i;e[n-1]===t[o-1]?i=0:i=1,r[n][o]=Math.min(r[n-1][o]+1,r[n][o-1]+1,r[n-1][o-1]+i),n>1&&o>1&&e[n-1]===t[o-2]&&e[n-2]===t[o-1]&&(r[n][o]=Math.min(r[n][o],r[n-2][o-2]+1))}return r[e.length][t.length]}function ed(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(a=>a.slice(2)));let o=[],n=3,i=.4;return t.forEach(a=>{if(a.length<=1)return;let s=nI(e,a),d=Math.max(e.length,a.length);(d-s)/d>i&&(s<n?(n=s,o=[a]):s===n&&o.push(a))}),o.sort((a,s)=>a.localeCompare(s)),r&&(o=o.map(a=>`--${a}`)),o.length>1?`
|
|
11176
11176
|
(Did you mean one of ${o.join(", ")}?)`:o.length===1?`
|
|
11177
|
-
(Did you mean ${o[0]}?)`:""}var xr=class e extends
|
|
11177
|
+
(Did you mean ${o[0]}?)`:""}var xr=class e extends rI{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ve.stdout.write(r),writeErr:r=>ve.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ve.stdout.isTTY?ve.stdout.columns:void 0,getErrHelpWidth:()=>ve.stderr.isTTY?ve.stderr.columns:void 0,getOutHasColors:()=>Pb()??(ve.stdout.isTTY&&ve.stdout.hasColors?.()),getErrHasColors:()=>Pb()??(ve.stderr.isTTY&&ve.stderr.hasColors?.()),stripColor:r=>oI(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let n=r,i=o;typeof n=="object"&&n!==null&&(i=n,n=null),i=i||{};let[,a,s]=t.match(/([^ ]+) *(.*)/),d=this.createCommand(a);return n&&(d.description(n),d._executableHandler=!0),i.isDefault&&(this._defaultCommandName=d._name),d._hidden=!!(i.noHelp||i.hidden),d._executableFile=i.executableFile||null,s&&d.arguments(s),this._registerCommand(d),d.parent=this,d.copyInheritedSettings(this),n?this:d}createCommand(t){return new e(t)}createHelp(){return Object.assign(new zo,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
11178
11178
|
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Uo(t,r)}argument(t,r,o,n){let i=this.createArgument(t,r);return typeof o=="function"?i.default(n).argParser(o):i.default(o),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let o=t??"help [command]",[,n,i]=o.match(/([^ ]+) *(.*)/),a=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),a&&s.description(a),this._addImplicitHelpCommand=!0,this._helpCommand=s,(t||r)&&this._initCommandGroup(s),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
11179
11179
|
Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new _n(t,r,o)),ve.exit(t)}action(t){let r=o=>{let n=this.registeredArguments.length,i=o.slice(0,n);return this._storeOptionsAsProperties?i[n]=this:i[n]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new kn(t,r)}_callParseArg(t,r,o,n){try{return t.parseArg(r,o)}catch(i){if(i.code==="commander.invalidArgument"){let a=`${n} ${i.message}`;this.error(a,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
|
|
11180
11180
|
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),o=r(t).find(n=>this._findCommand(n));if(o){let n=r(this._findCommand(o)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let n=(i,a,s)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let d=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,d,a):i!==null&&t.variadic&&(i=t._collectValue(i,d)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(o,i,s)};return this.on("option:"+r,i=>{let a=`error: option '${t.flags}' argument '${i}' is invalid.`;n(i,a,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let a=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;n(i,a,"env")}),this}_optionEx(t,r,o,n,i){if(typeof r=="object"&&r instanceof kn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(r,o);if(a.makeOptionMandatory(!!t.mandatory),typeof n=="function")a.default(i).argParser(n);else if(n instanceof RegExp){let s=n;n=(d,l)=>{let p=s.exec(d);return p?p[0]:l},a.default(i).argParser(n)}else a.default(n);return this.addOption(a)}option(t,r,o,n){return this._optionEx({},t,r,o,n)}requiredOption(t,r,o,n){return this._optionEx({mandatory:!0},t,r,o,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ve.versions?.electron&&(r.from="electron");let n=ve.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ve.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ve.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let r=t.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
11181
11181
|
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(Sa.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
|
|
11182
11182
|
- if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
11183
11183
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
11184
|
-
- ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(p,h){let m=nn.resolve(p,h);if(Sa.existsSync(m))return m;if(o.includes(nn.extname(h)))return;let y=o.find(x=>Sa.existsSync(`${m}${x}`));if(y)return`${m}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=Sa.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=nn.resolve(nn.dirname(p),a)}if(a){let p=n(a,i);if(!p&&!t._executableFile&&this._scriptPath){let h=nn.basename(this._scriptPath,nn.extname(this._scriptPath));h!==this._name&&(p=n(a,`${h}-${t._name}`))}i=p||i}let s=o.includes(nn.extname(i)),d;ve.platform!=="win32"?s?(r.unshift(i),r=
|
|
11184
|
+
- ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(p,h){let m=nn.resolve(p,h);if(Sa.existsSync(m))return m;if(o.includes(nn.extname(h)))return;let y=o.find(x=>Sa.existsSync(`${m}${x}`));if(y)return`${m}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=Sa.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=nn.resolve(nn.dirname(p),a)}if(a){let p=n(a,i);if(!p&&!t._executableFile&&this._scriptPath){let h=nn.basename(this._scriptPath,nn.extname(this._scriptPath));h!==this._name&&(p=n(a,`${h}-${t._name}`))}i=p||i}let s=o.includes(nn.extname(i)),d;ve.platform!=="win32"?s?(r.unshift(i),r=Cb(ve.execArgv).concat(r),d=td.spawn(ve.argv[0],r,{stdio:"inherit"})):d=td.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=Cb(ve.execArgv).concat(r),d=td.spawn(ve.execPath,r,{stdio:"inherit"})),d.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{ve.on(h,()=>{d.killed===!1&&d.exitCode===null&&d.kill(h)})});let l=this._exitCallback;d.on("close",p=>{p=p??1,l?l(new _n(p,"commander.executeSubCommandAsync","(close)")):ve.exit(p)}),d.on("error",p=>{if(p.code==="ENOENT")this._checkForMissingExecutable(i,a,t._name);else if(p.code==="EACCES")throw new Error(`'${i}' not executable`);if(!l)ve.exit(1);else{let h=new _n(1,"commander.executeSubCommandAsync","(error)");h.nestedError=p,l(h)}}),this.runningCommand=d}_dispatchSubcommand(t,r,o){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,n,"preSubcommand"),i=this._chainOrCall(i,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(o));else return n._parseCommand(r,o)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,n,i)=>{let a=n;if(n!==null&&o.parseArg){let s=`error: command-argument value '${n}' is invalid for argument '${o.name()}'.`;a=this._callParseArg(o,n,i,s)}return a};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,n)=>{let i=o.defaultValue;o.variadic?n<this.args.length?(i=this.args.slice(n),o.parseArg&&(i=i.reduce((a,s)=>t(o,s,a),o.defaultValue))):i===void 0&&(i=[]):n<this.args.length&&(i=this.args[n],o.parseArg&&(i=t(o,i,o.defaultValue))),r[n]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,n=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(a=>{n.push({hookedCommand:i,callback:a})})}),r==="postAction"&&n.reverse(),n.forEach(i=>{o=this._chainOrCall(o,()=>i.callback(i.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let n=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(i=>{n=this._chainOrCall(n,()=>i(this,r))}),n}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let a;return a=this._chainOrCallHooks(a,"preAction"),a=this._chainOrCall(a,()=>this._actionHandler(this.processedArgs)),this.parent&&(a=this._chainOrCall(a,()=>{this.parent.emit(i,t,r)})),a=this._chainOrCallHooks(a,"postAction"),a}if(this.parent?.listenerCount(i))n(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let n=o.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let n=t.find(i=>o.conflictsWith.includes(i.attributeName()));n&&this._conflictingOption(o,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],n=r;function i(p){return p.length>1&&p[0]==="-"}let a=p=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(p)?!this._getCommandAndAncestors().some(h=>h.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,s=null,d=null,l=0;for(;l<t.length||d;){let p=d??t[l++];if(d=null,p==="--"){n===o&&n.push(p),n.push(...t.slice(l));break}if(s&&(!i(p)||a(p))){this.emit(`option:${s.name()}`,p);continue}if(s=null,i(p)){let h=this._findOption(p);if(h){if(h.required){let m=t[l++];m===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,m)}else if(h.optional){let m=null;l<t.length&&(!i(t[l])||a(t[l]))&&(m=t[l++]),this.emit(`option:${h.name()}`,m)}else this.emit(`option:${h.name()}`);s=h.variadic?h:null;continue}}if(p.length>2&&p[0]==="-"&&p[1]!=="-"){let h=this._findOption(`-${p[1]}`);if(h){h.required||h.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${h.name()}`,p.slice(2)):(this.emit(`option:${h.name()}`),d=`-${p.slice(2)}`);continue}}if(/^--[^=]+=/.test(p)){let h=p.indexOf("="),m=this._findOption(p.slice(0,h));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,p.slice(h+1));continue}}if(n===r&&i(p)&&!(this.commands.length===0&&a(p))&&(n=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(p)){r.push(p),o.push(...t.slice(l));break}else if(this._getHelpCommand()&&p===this._getHelpCommand().name()){r.push(p,...t.slice(l));break}else if(this._defaultCommandName){o.push(p,...t.slice(l));break}}if(this._passThroughOptions){n.push(p,...t.slice(l));break}n.push(p)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let n=this.options[o].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
|
|
11185
11185
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
11186
11186
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
11187
11187
|
`),this.outputHelp({error:!0}));let o=r||{},n=o.exitCode||1,i=o.code||"commander.error";this._exit(n,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ve.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ve.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new xa(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,o.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=a=>{let s=a.attributeName(),d=this.getOptionValue(s),l=this.options.find(h=>h.negate&&s===h.attributeName()),p=this.options.find(h=>!h.negate&&s===h.attributeName());return l&&(l.presetArg===void 0&&d===!1||l.presetArg!==void 0&&d===l.presetArg)?l:p||a},n=a=>{let s=o(a),d=s.attributeName();return this.getOptionValueSource(d)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);n=n.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=ed(t,n)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",n=t.length,i=this.parent?` for '${this.name()}'`:"",a=t.join(", "),s=`error: too many arguments${i}. Expected ${r} argument${o} but got ${n}: ${a}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(i=>{n.push(i.name()),i.alias()&&n.push(i.alias())}),r=ed(t,n)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let n=this.createOption(r,o);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
11188
11188
|
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let n=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>ka(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=nn.basename(t,nn.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let n=r.formatHelp(this,r);return o.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,o,n,i;return r?(o=s=>this._outputConfiguration.writeErr(s),n=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(o=s=>this._outputConfiguration.writeOut(s),n=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(n||(s=this._outputConfiguration.stripColor(s)),o(s)),hasColors:n,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),n={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation({error:o.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(ve.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
11189
11189
|
Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let a;typeof r=="function"?a=r({error:i.error,command:i.command}):a=r,a&&i.write(`${a}
|
|
11190
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
11190
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Cb(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",n="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?n=i[3]:o=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],o=i[3],n=i[4]),r&&n!=="0"?`${r}=${o}:${parseInt(n)+1}`:t})}function Pb(){if(ve.env.NO_COLOR||ve.env.FORCE_COLOR==="0"||ve.env.FORCE_COLOR==="false")return!1;if(ve.env.FORCE_COLOR||ve.env.CLICOLOR_FORCE!==void 0)return!0}var W2=new xr;we();pn();Ne();import{mkdir as pR,readFile as hR,writeFile as mR}from"node:fs/promises";import{dirname as fR,join as gR,relative as yR,resolve as bR}from"node:path";async function vR(e,t){let r;try{r=await hR(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function bE(e,t,r){let o=gR(e,t),n=await vR(o,r);try{await pR(fR(o),{recursive:!0}),await mR(o,r,"utf8")}catch{throw K(`Cannot write ${o}.`),new Error("unreachable")}return{where:yR(process.cwd(),o)||t,state:n}}async function vE(e){let t=bR(e.out??"."),r=await bE(t,Re,Mt),o=await bE(t,Ve,uo),n=`import { start } from "./${Re}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${Ve}";`,a=r.state==="same"&&o.state==="same";if(J())return te({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Xt,import:n},{path:o.where,digest:gr,import:i}],path:r.where,digest:Xt,import:n});U(a?"Already current":"Wrote the Gamestage client"),R("Library",`${r.where} (${Xt})`),R("Player client",`${o.where} (${gr})`),g(),E(`Import it: ${A.cyan(n)}`),E(`The player API on its own: ${A.cyan(i)}`),(r.state==="different"||o.state==="different")&&E("An earlier copy was replaced. It is generated, so nothing of yours was in it."),g()}we();pn();yr();import{stat as HR,writeFile as VE}from"node:fs/promises";import{createHash as VR}from"node:crypto";var Pt="0.35.13",zi="2026-09-27-5",Bc=">=22.13.0";function ER(e=Bc){let[t,r]=e.replace(/^[^\d]*/,"").split(".").map(Number);return[t,r||0]}function OE(e,t=Bc){let[r,o]=ER(t),[n,i]=e.split(".").map(Number);return n>r||n===r&&i>=o}import{randomUUID as TR}from"node:crypto";var $R=/-[0-9a-f]{4}$/;function Wc(e){return`${e}-${TR().replace(/-/g,"").slice(0,4)}`}function NE(e){return $R.test(e)}At();var hn="favicon.svg",Gi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
|
11191
11191
|
<rect width="32" height="32" rx="7" fill="#1b1c1f"/>
|
|
11192
11192
|
<path d="m12 8 12 8-12 8Z" fill="#fff"/>
|
|
11193
11193
|
</svg>
|
|
11194
|
-
`;function
|
|
11195
|
-
`,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function PR(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function
|
|
11194
|
+
`;function Zg(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function Bi(e){if(Zg(e))return e;let t=`<link rel="icon" href="./${hn}" type="image/svg+xml">
|
|
11195
|
+
`,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function PR(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function FE(e,t){let r=t.trim();if(!r)return e;let o=PR(r);return e.replace(/(<title[^>]*>)[\s\S]*?(<\/title>)/i,`$1${o}$2`).replace(/(<h1\b[^>]*\bid=["']game-name["'][^>]*>)[\s\S]*?(<\/h1>)/i,`$1${o}$2`)}var OR="http://127.0.0.1:4000";function NR(e){return`<script>
|
|
11196
11196
|
// Local development only. \`gamestage deploy\` writes the real values into
|
|
11197
11197
|
// this page when you deploy, and this block then does nothing: it assigns
|
|
11198
11198
|
// only where nothing has assigned already, and only on a local address.
|
|
@@ -11209,7 +11209,7 @@ Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let
|
|
|
11209
11209
|
if (!window.GAMESTAGE_GAME) window.GAMESTAGE_GAME = ${JSON.stringify(e)};
|
|
11210
11210
|
})();
|
|
11211
11211
|
</script>
|
|
11212
|
-
`}function
|
|
11212
|
+
`}function GE(e,t){let r=t.trim();return!r||!/<\/head>/i.test(e)||/window\.GAMESTAGE_API\s*=/.test(e)?e:e.replace(/<\/head>/i,`${NR(r)}</head>`)}qg();we();var vo="data-gs-first-paint",MR=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function UR(e){let t=e.length===4?`#${[...e.slice(1)].map(i=>i+i).join("")}`:e,[r,o,n]=[1,3,5].map(i=>{let a=parseInt(t.slice(i,i+2),16)/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*r+.7152*o+.0722*n>.4}function zR(e){let t=UR(e);return`<meta name="color-scheme" content="${t?"light":"dark"}" ${vo} />
|
|
11213
11213
|
<meta name="theme-color" content="${e}" ${vo} />
|
|
11214
11214
|
<style ${vo}>
|
|
11215
11215
|
/* The game's colour from the first frame, before any script. GS-537. */
|
|
@@ -11238,34 +11238,34 @@ Expecting one of '${o.join("', '")}'`);let n=`${t}Help`;return this.on(n,i=>{let
|
|
|
11238
11238
|
};
|
|
11239
11239
|
</script>
|
|
11240
11240
|
`}var GR=`<div class="gs-boot" role="status" aria-busy="true" ${vo}><span class="gs-boot__spinner" aria-hidden="true"></span><span class="gs-boot__label">Loading</span></div>
|
|
11241
|
-
`;function
|
|
11241
|
+
`;function HE(e,t){if(!t||!MR.test(t)||e.includes(vo))return e;let r=/<head[^>]*>/i.exec(e),o=/<body[^>]*>/i.exec(e);if(!r||!o)return e;let n=r.index+r[0].length,i=/^(\s*<meta\s+(?:charset|name="viewport")[^>]*>)+/i.exec(e.slice(n)),a=n+(i?i[0].length:0),s=e.slice(0,a)+`
|
|
11242
11242
|
`+zR(t)+FR()+e.slice(a),d=/<body[^>]*>/i.exec(s),l=d.index+d[0].length;return s.slice(0,l)+`
|
|
11243
|
-
`+GR+s.slice(l)}Wi();Ne();async function
|
|
11243
|
+
`+GR+s.slice(l)}Wi();Ne();async function ZE(e){try{return await HR(e),!0}catch{return!1}}var br={hunt:"Find the marked few among many. A wrong pick costs an attempt.",push:"Picks add hidden value towards a limit. Going over is a bust.",group:"Form the hidden sets in a board. The whole guess is judged at once.",predict:"Call it before it happens. It settles when the result arrives.",bingo:"Each fan gets their own board from a shared pool. Fill a line before it locks.",shoot:"Aim, pick a power, shoot. The Engine plays the keeper and decides each penalty.",place:"A card is dealt; drop it on a category it fits. The Engine holds who qualifies.",trivia:"Question, answer, mark against a server answer set, score, close.",timed_round:"Open and close rounds on a schedule, using server time.",synchronous_event:"React to a real-world trigger: kick-off, goal, period change.",collection_ranking:"Accumulate verified actions and expose rank, progress and eligibility."},YE=Object.keys(Ui).map(e=>({format:e,summary:br[e]}));async function ZR(e,t,r){let o=await Le();if(!o)return!1;yo();let i=await fr({baseUrl:De,token:o.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:r,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${VR("sha256").update(t).digest("hex")}`,conformance:vt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ao.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function qE(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return K("Give the game a name with --name.");let r=e.format??e.archetype;if(!r){J()&&(te({ok:!1,status:"archetype_required",message:"Choose a format before scaffolding. How the game is played is decided first, on purpose.",archetypes:Object.entries(br).map(([_,b])=>({archetype:_,summary:b})),formats:Object.entries(br).map(([_,b])=>({format:_,summary:b})),example:`gamestage create --name "${e.name??t}" --format hunt`}),process.exit(1)),U("Choose how the game is played first"),g(A.dim(` The format decides what the server owns: answers, locks, scoring
|
|
11244
11244
|
and settlement. Picking it before any client code is what keeps the
|
|
11245
|
-
game trustworthy later.`)),g();for(let[_,b]of Object.entries(br))g(` ${A.cyan(_.padEnd(20))} ${A.dim(b)}`);g(),g(` ${A.dim("Then run:")} ${A.cyan(ie(`create --name "${e.name??t}" --format <format>`))}`),g(),process.exit(1)}let o=Dn.safeParse(r);if(!o.success)return K(`Unknown format "${r}".`,[...Object.keys(br).map(_=>A.cyan(_)),"",`You are running gamestage ${Pt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${A.cyan("npx gamestage@latest create ...")} run the current one`]);let n=Ui[o.data],i=pc.safeParse(e.host??"fullscreen");if(!i.success)return K(`Unknown host "${e.host}".`,[...Object.entries(hc).map(([_,b])=>`${A.cyan(_.padEnd(16))} ${A.dim(b.summary)}`)]);let a=uc.safeParse(e.layout??mc(o.data,i.data));if(!a.success)return K(`Unknown layout "${e.layout}".`,[...Object.entries(lr).map(([_,b])=>`${A.cyan(_.padEnd(8))} ${A.dim(b.summary)}`)]);if(!n&&!J())return K(`"${o.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(Ui).map(_=>` ${A.cyan(_.padEnd(10))} ${A.dim(br[_])}`),"",`${A.dim("Then run:")} ${A.cyan(ie(`create --name "${e.name??t}" --format hunt`))}`]);let s=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(s&&!e.force&&await
|
|
11246
|
-
`],[hn,Gi],[Re,Mt],[Ve,uo]];for(let[b,v]of _){if(!e.force&&await
|
|
11247
|
-
`))}catch{return}}async function fj(e){try{let t=await fa(e,"utf8");return`c${_0("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function gj(e){try{return await fa(e,"utf8")}catch{return}}async function yj(e){try{let t=Fe(await fa(e,"utf8"));return t.ok?vt(t.manifest).computed:"L0"}catch{return"L0"}}async function S0(e,t){t.file&&t.dir&&K("Choose either --file or --dir for a deploy, not both.");let{client:r}=await Te(),o=await hj(t.manifest??"gamestage.yaml",!!t.manifest),n=await _o(t.manifest??"gamestage.yaml");n.problems.length>0&&K(`${wo} cannot be used as it is.`,n.problems);try{let i,a={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?i=await vj(r,e,t.file,a):t.dir&&(i=await xj(r,e,t.dir,a));let s=t.manifest??"gamestage.yaml",d=t.revision??await fj(s),l=await r.deploy(e,{manifestRevision:d,contentHash:t.hash??`sha256:${d}`,conformance:t.level??await yj(s),...await gj(s).then(O=>O===void 0?{}:{manifestSource:O}),...n.settings?{settings:n.settings}:{},offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await mj(t.dir)}:{}});if(ga(l,"deploy"))return;let p=o?l.game.rounds.some(O=>O.id===`round-${o.number}`):null,h=p===!1?[...l.game.logs].reverse().find(O=>O.level==="error"):void 0,m=await Ki(r,l.game);if(J())return te({ok:!0,status:"deployed",...m?{sourceWarning:m}:{},roundProvisioned:p,...h?{roundError:h.message}:{},game:i?{...l.game,playgroundUrl:i}:l.game});let y=Xn(l.game.containerLabel),x=Xn(l.game.containerLabel,{lower:!0});if(U("Deployed"),k0(l.game,i),p&&R(y,`${o.number} is live`),g(),Hi(m),l.game.appSpec?.refusal&&(U("But Studio would not take the game's settings"),g(` ${l.game.appSpec.refusal.reason}`),g(),E("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),E("Deploy again once it is fixed; nothing else needs doing."),g()),await wj(i??l.game.playgroundUrl,l.game.playerEndpoint,e,t.check===!1,l.game.archetype),p===!1){U(`But there is no ${x}`),g(` ${h?.message??`The Engine did not accept the ${x}.`}`),g(),E("Anyone opening the game will find nothing on. Deploy again once it is fixed."),g();return}if(p===null){let O=l.game.rounds?.length??0;E(O?`No ${x} in the manifest, which is right: the game is playing ${O} from Studio.`:`No ${x} in the manifest and none in Studio, so the game has nothing on yet.`)}E("Share the playground URL. It sleeps when idle and wakes on a request."),g()}catch(i){Ce(i)}}async function E0(e){let{client:t}=await Te();try{let r=await t.archiveGame(e);if(ga(r,"archive"))return;if(J()){te({ok:!0,status:"archived",game:r.game});return}U("Archived"),R("Game",`${r.game.name} (${r.game.id})`),g(),E("Taken off the air. Its record and files are retained outside the served bundle."),g()}catch(r){Ce(r)}}async function T0(e){let{client:t}=await Te();try{let r=await t.promoteGame(e);if(ga(r,"promote"))return;let o=await t.getWorkspace(),n=lg(r.game,o),i=await Ki(t,r.game);if(J()){te({ok:!0,status:"promoted",stage:n,...i?{sourceWarning:i}:{},game:r.game});return}U("Approved"),R("Game",`${r.game.name} (${r.game.id})`),g(),n==="prod"?E("Live. Your workspace's plan already carries prod."):E("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),g(),Hi(i)}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(J()){te({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}U("Not yet"),g(" This control plane does not have promotion yet."),g(),E("Your game is untouched and still serving dev."),E("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),g();return}Ce(r)}}async function $0(e){let{client:t}=await Te();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){g("Nothing to remove. Every archived game here was deployed at some point.");return}if(!J()){U(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,d]of[...a].sort((l,p)=>p[1]-l[1]))E(d>1?`${s} x${d}`:s);g(),E("A live game, or one that ever deployed, is refused by the server."),g()}if(!e.yes){process.stdin.isTTY||K("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=dj({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){g("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(te({removed:n,refused:i.length}),!J()){U("Removed"),E(`${n} records gone.`);for(let a of i)E(a);g()}}catch(r){Ce(r)}}async function A0(e){let{client:t}=await Te();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(J()){te({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}U("Not done"),g(` ${o}`),g();return}if(J())return te({ok:!0,workspace:r});U("Plan changed"),R("Plan",r.tier),R("Live games",String(r.liveGameAllowance||"Contracted")),g()}catch(r){Ce(r)}}async function vb(e,t){let{admin:r,email:o}=await Kg();try{let n=await r.setWorkspaceAccess(e,t),i=DE(n);if(J())return te({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});bo(i),n.changed&&(R("Decided by",o),g())}catch(n){Ce(n)}}async function I0(e,t,r){let o=jE(e,t,r.liveGames);"problem"in o&&K(o.problem,o.detail);let{request:n}=o,{admin:i,email:a}=await Kg(),s=async()=>{try{let d=await i.getWorkspace(n.workspaceId);return{reading:{tier:d.tier,liveGameAllowance:d.liveGameAllowance}}}catch(d){let l=d.status,p=d instanceof Error?d.message:String(d);return l===404&&/unknown resource/i.test(p)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:l?`${l}, ${p}`:p}}};try{let d=await s(),l=await i.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),p=await s(),h=ME({request:n,previous:d.reading,result:{refused:l?.refused,code:l?.code},stored:p.reading,unreadable:p.why});if(h.exitCode!==0&&(process.exitCode=h.exitCode),J())return te({ok:h.exitCode!==1,status:h.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:h.previous,stored:h.stored,reprovisioned:!1,code:l?.code??null,message:h.message,next:h.next});UE(h),h.status==="set"&&(R("Decided by",a),g())}catch(d){Ce(d)}}async function C0(e){let t;try{t=await fa(e,"utf8")}catch{return K(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=Fe(t);if(!r.ok)return K(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${A.cyan(a.path)} ${a.message}`),"",`${A.cyan(ie(`manifest validate ${e}`))} the full report`]);let o=r.manifest,n=zx(o);if(n.length)return K(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await Te();yo();try{let a=await i.registerGame(Ux(o,`sha256:${_0("sha256").update(t).digest("hex")}`));if(ga(a,"register"))return;if(J()){te({ok:!0,status:"registered",game:a.game});return}U("Registered"),R("Game",`${a.game.name} (${a.game.id})`),R("State",a.game.state),R("Conformance",a.game.conformance),g(),E(`${A.cyan(ie(`deploy ${a.game.id} --dir .`))} publish it`),g()}catch(a){Ce(a)}}async function wb(e,t){let{client:r}=await Te();try{let o=await r.setAwake(e,t);if(ga(o,t?"wake":"suspend"))return;if(J()){te({ok:!0,status:o.game.state,game:o.game});return}U(t?"Awake":"Suspended"),R("Game",`${o.game.name} (${o.game.id})`),R("State",o.game.state),g(),E(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),g()}catch(o){Ce(o)}}async function P0(e,t){let{client:r}=await Te();try{let o=await r.getEndpoints(e);if(o||K(...O0(e)),J())return te({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||K(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),g(n);return}U("Endpoints"),R("Player",o.player??"not deployed"),R("Control",o.control??"not deployed"),R("Playground",o.playground??"not deployed"),g()}catch(o){Ce(o)}}function O0(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function N0(e,t){let{client:r}=await Te();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?Qx(n):{state:"none"},a=eS(i);if(J())return te({ok:!0,lines:o,freshness:i});if(a&&(U("This game is serving a closed round"),g(),E(a),g()),o.length===0){U("No log lines"),g(),E("Nothing yet, or everything is older than the tier's retention."),g();return}for(let s of o){let d=s.roundId?` [${s.roundId}]`:"";g(`${s.at} ${s.level.padEnd(5)}${d} ${s.message}`)}}catch(o){Ce(o)}}function gb(e=fE,t=Pt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&K("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${Ut}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${A.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${A.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function w0(e,t,r=Ut){let o=`${r}/client/${t}/${Re}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function R0(e,t,r){let o=`<script>
|
|
11245
|
+
game trustworthy later.`)),g();for(let[_,b]of Object.entries(br))g(` ${A.cyan(_.padEnd(20))} ${A.dim(b)}`);g(),g(` ${A.dim("Then run:")} ${A.cyan(ie(`create --name "${e.name??t}" --format <format>`))}`),g(),process.exit(1)}let o=Dn.safeParse(r);if(!o.success)return K(`Unknown format "${r}".`,[...Object.keys(br).map(_=>A.cyan(_)),"",`You are running gamestage ${Pt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${A.cyan("npx gamestage@latest create ...")} run the current one`]);let n=Ui[o.data],i=pc.safeParse(e.host??"fullscreen");if(!i.success)return K(`Unknown host "${e.host}".`,[...Object.entries(hc).map(([_,b])=>`${A.cyan(_.padEnd(16))} ${A.dim(b.summary)}`)]);let a=uc.safeParse(e.layout??mc(o.data,i.data));if(!a.success)return K(`Unknown layout "${e.layout}".`,[...Object.entries(lr).map(([_,b])=>`${A.cyan(_.padEnd(8))} ${A.dim(b.summary)}`)]);if(!n&&!J())return K(`"${o.data}" is coming soon. Nothing was registered or written.`,["There is no Engine behind it yet, so create would give you a manifest and no","game a fan could play.","","Build with one of these today:",...Object.keys(Ui).map(_=>` ${A.cyan(_.padEnd(10))} ${A.dim(br[_])}`),"",`${A.dim("Then run:")} ${A.cyan(ie(`create --name "${e.name??t}" --format hunt`))}`]);let s=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(s&&!e.force&&await ZE(s))return K(`${s} already exists, and create would replace it.`,["That file holds a game: its id, its format and whatever has been done to it.","A new one minted here would be a second game in the same directory.","",`${A.cyan(ie(`manifest validate ${s}`))} check what you have`,`${A.cyan(ie("start"))} find the next step for this directory`,"",A.dim("There is a --force, and it replaces your page and clients as well as the"),A.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let d=Wc(t),l=xc(d,e.name??d);l.app.status="confirmed",l.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],l.experience.status="proposed",l.experience.surfaces=["web-embed"],l.experience.host=i.data,l.experience.layout=a.data,l.backend.status="confirmed",l.backend.route="managed_runtime",l.backend.archetype=o.data,l.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${o.data}`}],l.identity.status="proposed",l.identity.provider="identify";let p=VS((await Le().catch(()=>null))?.email,YS);p&&ZS(l,p);let h=jn.parse(l),m=vt(h);h.manifest.conformance=m.computed;let y=Ri(h),x=!1,O;try{x=await ZR(h,y,o.data)}catch(_){O=_ instanceof Error?_.message:"The control plane did not answer."}let M=null;s&&(M=s,await VE(M,y,"utf8"));let H=!!n&&e.write!==!1,T=[];if(H){let _=[["index.html",HE(GE(FE(Bi(n),h.app.title),h.app.id),KE(n))],[wo,`${JSON.stringify(BE(n,h.app.title,h.backend.archetype),null,2)}
|
|
11246
|
+
`],[hn,Gi],[Re,Mt],[Ve,uo]];for(let[b,v]of _){if(!e.force&&await ZE(b)){T.push(b);continue}await VE(b,v,"utf8")}}if(J()){te({ok:!0,manifest:h,manifest_yaml:y,written_to:M,conformance:{computed:m.computed,blockers:m.blockers},registered:x,host:i.data,layout:a.data,layout_guidance:bf,...a.data==="card"?{layout_cost:vf}:{},...i.data==="app-webview"?{host_note:wf}:{},...O?{registration_failed:O}:{},scaffolded:H,files:H?["index.html",hn,Re,Ve].filter(_=>!T.includes(_)):[],kept:T,...n?{}:{scaffold_skipped:"no_engine",engines:Object.keys(Ui)},next:"gamestage dev"});return}U(`Created ${h.app.title}`),R("Game id",h.app.id),R("Game format",o.data),H&&T.length===0?R("Files","index.html, with the Gamestage client beside it"):H&&R("Kept",`${T.join(", ")} (already here, left as they were)`),R("Authority","managed runtime (server-owned)"),R("Build stage",`${m.computed} ${m.computedName}`),M&&R("Manifest",M),g(x?" Registered in Studio as a draft.":O?` Not registered in Studio: ${O} (${De})`:" No account found, so registration was skipped."),U("Where it runs"),R("Host",`${hc[i.data].name}: ${hc[i.data].summary}`),R("Layout",`${lr[a.data].name}: ${lr[a.data].summary}`),g(` ${A.dim(bf)}`),a.data==="card"&&g(` ${A.dim(vf)}`),i.data==="app-webview"&&g(` ${A.dim(wf)}`),g(` ${A.dim("Change it with --host and --layout; it is in gamestage.yaml under experience.")}`),U("What the server will own"),g(` ${A.dim(br[o.data])}`),U("Next"),T.includes("index.html")&&E(`${A.cyan(ie("inspect ."))} find what in your page has to move to the Engine`),E(`${A.cyan(ie("dev --serve"))} start the Engine and serve this page, so there is something to open`),E(`${A.cyan(ie("dev"))} the Engine alone, where you serve the page yourself`),E(`${A.cyan(ie("manifest validate "+(M??"gamestage.yaml")))} check where it stands`),g()}we();pn();At();Jg();ty();Wi();qc();Vc();import{readFileSync as bb}from"node:fs";import{readFile as fa}from"node:fs/promises";import{createInterface as dj}from"node:readline/promises";import{extname as uj,resolve as pj}from"node:path";import{createHash as k0}from"node:crypto";Ne();Kc();function ga(e,t){return e.refused?J()?(te({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(U("Not done"),g(` ${e.refused}`),g(),!0):!1}function vb(e,t){if(e.state==="archived")return{stage:"dev",reason:"archived, so it serves nobody"};if(!t)return{stage:null,reason:"this control plane did not report your workspace's plan"};let r=dg(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!lg(t);return!o&&!n?{stage:r,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:o?{stage:r,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:r,reason:"waiting on your approval, run `gamestage promote`"}}function x0(e,t=e.playgroundUrl,r){if(R("Game",`${e.name} (${e.id})`),R("State",e.state),r!==void 0){let{stage:o,reason:n}=vb(e,r);R("Serving",o==="prod"?"prod":`dev: ${n}`)}R("Build stage",e.conformance),R("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&R("Playground",t),e.playerEndpoint&&R("Player API",e.playerEndpoint),R("Manage",RE(e.id)),e.studioUrl&&R("Studio",e.studioUrl),R("Docs",LE(e.archetype))}async function S0(e){let{client:t,email:r}=await Te(),o=await Hc(t),n=Fi(o);if(n.ok||K(n.message,n.next),n.access==="pending"||n.access==="refused"){if(J())return te({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});U("Your account"),R("Signed in as",r),R("Access",n.access),bo(n);return}try{if(e){let l=await t.getGame(e);l||K(...N0(e));let p=await t.getWorkspaceSummary().then(y=>y.tier).catch(()=>{}),{stage:h,reason:m}=vb(l,p);if(J())return te({ok:!0,stage:h,...m?{stageReason:m}:{},game:l});if(U(l.name),x0(l,void 0,p),p===void 0&&R("Serving",`unchecked: ${m}`),l.meters.length){g();for(let y of l.meters){let x=Math.round(uS(y)*100);R(y.label,`${y.used} of ${y.limit}${y.unit} (${x}%)`)}}g();return}let i="workspace"in o&&o.workspace?o.workspace:await t.getWorkspace(),a=i.games.length,s=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(J())return te({ok:!0,status:n.status,access:n.access,games_total:s??null,games_shown:a,workspace:{...i,games:i.games.map(l=>{let{stage:p,reason:h}=vb(l,i.tier);return{...l,stage:p,...h?{stageReason:h}:{}}})}});if(U(i.name),R("Signed in as",r),R("Access",n.access??"not reported by this control plane"),R("Tier",i.tier),R("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),g(),s===0){E("No games yet. `gamestage create` or `gamestage inspect .` starts one."),g();return}for(let l of i.games)R(l.name,`${l.state}${l.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(g(),E(`Showing ${a} of ${s} games.`));let d=dS(i.meters);if(d.length){g(),U("At a cap");for(let l of d)E(`${l.label}: ${l.used} of ${l.limit}${l.unit}`)}g()}catch(i){Ce(i)}}async function hj(e,t){let r;try{r=await fa(e,"utf8")}catch{t&&K(`Cannot read ${e}.`);return}let o=Fe(r);if(!o.ok){K(`${e} is not a valid App Manifest, so its round cannot be provisioned.`,o.issues.map(n=>`${n.path} ${n.message}`));return}return o.manifest.backend.round}async function mj(e){try{let t=await Zc(nT(e));return Lc(t.map(r=>r.text).join(`
|
|
11247
|
+
`))}catch{return}}async function fj(e){try{let t=await fa(e,"utf8");return`c${k0("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function gj(e){try{return await fa(e,"utf8")}catch{return}}async function yj(e){try{let t=Fe(await fa(e,"utf8"));return t.ok?vt(t.manifest).computed:"L0"}catch{return"L0"}}async function E0(e,t){t.file&&t.dir&&K("Choose either --file or --dir for a deploy, not both.");let{client:r}=await Te(),o=await hj(t.manifest??"gamestage.yaml",!!t.manifest),n=await _o(t.manifest??"gamestage.yaml");n.problems.length>0&&K(`${wo} cannot be used as it is.`,n.problems);try{let i,a={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?i=await vj(r,e,t.file,a):t.dir&&(i=await xj(r,e,t.dir,a));let s=t.manifest??"gamestage.yaml",d=t.revision??await fj(s),l=await r.deploy(e,{manifestRevision:d,contentHash:t.hash??`sha256:${d}`,conformance:t.level??await yj(s),...await gj(s).then(O=>O===void 0?{}:{manifestSource:O}),...n.settings?{settings:n.settings}:{},offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await mj(t.dir)}:{}});if(ga(l,"deploy"))return;let p=o?l.game.rounds.some(O=>O.id===`round-${o.number}`):null,h=p===!1?[...l.game.logs].reverse().find(O=>O.level==="error"):void 0,m=await Ki(r,l.game);if(J())return te({ok:!0,status:"deployed",...m?{sourceWarning:m}:{},roundProvisioned:p,...h?{roundError:h.message}:{},game:i?{...l.game,playgroundUrl:i}:l.game});let y=Xn(l.game.containerLabel),x=Xn(l.game.containerLabel,{lower:!0});if(U("Deployed"),x0(l.game,i),p&&R(y,`${o.number} is live`),g(),Hi(m),l.game.appSpec?.refusal&&(U("But Studio would not take the game's settings"),g(` ${l.game.appSpec.refusal.reason}`),g(),E("The game is live and playing. What is stale is what a producer sees in Studio, so they may be editing boxes that no longer match the game."),E("Deploy again once it is fixed; nothing else needs doing."),g()),await wj(i??l.game.playgroundUrl,l.game.playerEndpoint,e,t.check===!1,l.game.archetype),p===!1){U(`But there is no ${x}`),g(` ${h?.message??`The Engine did not accept the ${x}.`}`),g(),E("Anyone opening the game will find nothing on. Deploy again once it is fixed."),g();return}if(p===null){let O=l.game.rounds?.length??0;E(O?`No ${x} in the manifest, which is right: the game is playing ${O} from Studio.`:`No ${x} in the manifest and none in Studio, so the game has nothing on yet.`)}E("Share the playground URL. It sleeps when idle and wakes on a request."),g()}catch(i){Ce(i)}}async function T0(e){let{client:t}=await Te();try{let r=await t.archiveGame(e);if(ga(r,"archive"))return;if(J()){te({ok:!0,status:"archived",game:r.game});return}U("Archived"),R("Game",`${r.game.name} (${r.game.id})`),g(),E("Taken off the air. Its record and files are retained outside the served bundle."),g()}catch(r){Ce(r)}}async function $0(e){let{client:t}=await Te();try{let r=await t.promoteGame(e);if(ga(r,"promote"))return;let o=await t.getWorkspace(),n=dg(r.game,o),i=await Ki(t,r.game);if(J()){te({ok:!0,status:"promoted",stage:n,...i?{sourceWarning:i}:{},game:r.game});return}U("Approved"),R("Game",`${r.game.name} (${r.game.id})`),g(),n==="prod"?E("Live. Your workspace's plan already carries prod."):E("Approved, but still serving dev: reaching fans on prod also needs your workspace on a paid plan, which only Monterosa can do. Talk to us and this takes effect with no further action from you."),g(),Hi(i)}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(J()){te({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}U("Not yet"),g(" This control plane does not have promotion yet."),g(),E("Your game is untouched and still serving dev."),E("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),g();return}Ce(r)}}async function A0(e){let{client:t}=await Te();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){g("Nothing to remove. Every archived game here was deployed at some point.");return}if(!J()){U(`${o.length} archived games that never deployed`);let a=new Map;for(let s of o)a.set(s.name,(a.get(s.name)??0)+1);for(let[s,d]of[...a].sort((l,p)=>p[1]-l[1]))E(d>1?`${s} x${d}`:s);g(),E("A live game, or one that ever deployed, is refused by the server."),g()}if(!e.yes){process.stdin.isTTY||K("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=dj({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){g("Nothing was deleted.");return}}finally{a.close()}}let n=0,i=[];for(let a of o){let s=await t.deleteGame(a.id);s.refused?i.push(`${a.name}: ${s.refused}`):n+=1}if(te({removed:n,refused:i.length}),!J()){U("Removed"),E(`${n} records gone.`);for(let a of i)E(a);g()}}catch(r){Ce(r)}}async function I0(e){let{client:t}=await Te();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(J()){te({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}U("Not done"),g(` ${o}`),g();return}if(J())return te({ok:!0,workspace:r});U("Plan changed"),R("Plan",r.tier),R("Live games",String(r.liveGameAllowance||"Contracted")),g()}catch(r){Ce(r)}}async function wb(e,t){let{admin:r,email:o}=await Hg();try{let n=await r.setWorkspaceAccess(e,t),i=jE(n);if(J())return te({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});bo(i),n.changed&&(R("Decided by",o),g())}catch(n){Ce(n)}}async function C0(e,t,r){let o=ME(e,t,r.liveGames);"problem"in o&&K(o.problem,o.detail);let{request:n}=o,{admin:i,email:a}=await Hg(),s=async()=>{try{let d=await i.getWorkspace(n.workspaceId);return{reading:{tier:d.tier,liveGameAllowance:d.liveGameAllowance}}}catch(d){let l=d.status,p=d instanceof Error?d.message:String(d);return l===404&&/unknown resource/i.test(p)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:l?`${l}, ${p}`:p}}};try{let d=await s(),l=await i.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),p=await s(),h=UE({request:n,previous:d.reading,result:{refused:l?.refused,code:l?.code},stored:p.reading,unreadable:p.why});if(h.exitCode!==0&&(process.exitCode=h.exitCode),J())return te({ok:h.exitCode!==1,status:h.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:h.previous,stored:h.stored,reprovisioned:!1,code:l?.code??null,message:h.message,next:h.next});zE(h),h.status==="set"&&(R("Decided by",a),g())}catch(d){Ce(d)}}async function P0(e){let t;try{t=await fa(e,"utf8")}catch{return K(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=Fe(t);if(!r.ok)return K(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${A.cyan(a.path)} ${a.message}`),"",`${A.cyan(ie(`manifest validate ${e}`))} the full report`]);let o=r.manifest,n=Fx(o);if(n.length)return K(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await Te();yo();try{let a=await i.registerGame(zx(o,`sha256:${k0("sha256").update(t).digest("hex")}`));if(ga(a,"register"))return;if(J()){te({ok:!0,status:"registered",game:a.game});return}U("Registered"),R("Game",`${a.game.name} (${a.game.id})`),R("State",a.game.state),R("Conformance",a.game.conformance),g(),E(`${A.cyan(ie(`deploy ${a.game.id} --dir .`))} publish it`),g()}catch(a){Ce(a)}}async function _b(e,t){let{client:r}=await Te();try{let o=await r.setAwake(e,t);if(ga(o,t?"wake":"suspend"))return;if(J()){te({ok:!0,status:o.game.state,game:o.game});return}U(t?"Awake":"Suspended"),R("Game",`${o.game.name} (${o.game.id})`),R("State",o.game.state),g(),E(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),g()}catch(o){Ce(o)}}async function O0(e,t){let{client:r}=await Te();try{let o=await r.getEndpoints(e);if(o||K(...N0(e)),J())return te({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||K(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),g(n);return}U("Endpoints"),R("Player",o.player??"not deployed"),R("Control",o.control??"not deployed"),R("Playground",o.playground??"not deployed"),g()}catch(o){Ce(o)}}function N0(e){let t=/[A-Z\s]/.test(e);return[`No game with the id "${e}" in this workspace.`,t?["That looks like a game's name. Every command takes the id, which is","the name in lower case plus four characters, e.g. my-game-a3c9.","`gamestage status` lists them, and `create` prints one when it makes it."]:["`gamestage status` lists the games in this workspace and their ids."]]}async function R0(e,t){let{client:r}=await Te();try{let o=await r.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await r.getGame(e).catch(()=>{}),i=n?eS(n):{state:"none"},a=tS(i);if(J())return te({ok:!0,lines:o,freshness:i});if(a&&(U("This game is serving a closed round"),g(),E(a),g()),o.length===0){U("No log lines"),g(),E("Nothing yet, or everything is older than the tier's retention."),g();return}for(let s of o){let d=s.roundId?` [${s.roundId}]`:"";g(`${s.at} ${s.level.padEnd(5)}${d} ${s.message}`)}}catch(o){Ce(o)}}function yb(e=gE,t=Pt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&K("This is a development build of the CLI, so it cannot pin a client version.",["A deployed page imports the Gamestage client from a published version, and","this build is not one. Deploying anyway would point the game at",`${Ut}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${A.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${A.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function _0(e,t,r=Ut){let o=`${r}/client/${t}/${Re}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function L0(e,t,r){let o=`<script>
|
|
11248
11248
|
// Written by \`gamestage deploy\`. Where this game's Engine answers.
|
|
11249
11249
|
window.GAMESTAGE_API = ${JSON.stringify(t)};
|
|
11250
11250
|
window.GAMESTAGE_GAME = ${JSON.stringify(r)};
|
|
11251
11251
|
// This page was deployed, so it may ask which Interaction Cloud project it is.
|
|
11252
11252
|
window.GAMESTAGE_IC_LOOKUP = true;
|
|
11253
11253
|
</script>
|
|
11254
|
-
`,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Po(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||K(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function Ml(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function bj(e){switch(uj(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function vj(e,t,r,o={}){let n=pj(r),i;try{i=yb(n)}catch{throw K(`Cannot read ${r}.`),new Error("unreachable")}let a=await Qg({path:n,relativePath:r},o.round);a&&K(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),d=R0(Bi(i.toString("utf8")),`${s.playerApiOrigin}`,t);await Po(s.uploadUrl,d,"text/html; charset=utf-8",s.cacheControl);let l=await e.uploadTarget(t,Ve);await Po(l.uploadUrl,uo,"text/javascript; charset=utf-8",l.cacheControl);let p=await e.uploadTarget(t,Re);await Po(p.uploadUrl,Mt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,hn);return await Po(h.uploadUrl,Gi,"image/svg+xml",h.cacheControl),J()||(g(),E(`Uploaded ${r} to ${Ml(s)}`),E(`Wired it to ${s.playerApiOrigin} as "${t}"`),E(`Shipped @monterosa/gamestage beside it (${Xt})`),E(`Shipped the player client beside it (${gr})`)),Ml(s)}async function wj(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(fb(),v0));_j(await i(e,t,r,n))}function _j(e){if(e.status==="verified"){R("Checked","the page loads and plays in a browser"),g();return}if(e.status==="skipped"||e.status==="n/a"){E(A.dim(`Not checked in a browser: ${e.detail??""}`.trim())),g();return}U("The published page did not start"),g(` ${e.detail??""}`),g(),E("The files are published, so the game is live and broken rather than unpublished."),E(`${A.cyan(ie("verify"))} the same check, with the rest of them`),g(),process.exitCode=1}function kj(e){for(let t of e.walkedPast)E(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)E(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)E(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&K(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function xj(e,t,r,o={}){let n,i=[];try{let _=Zi(r,{symlinks:"throw"});n=_.files,i=_.withheld}catch(_){throw K(_ instanceof Error?_.message:`Cannot read ${r}.`),new Error("unreachable")}let a=await QE(n,{...o,exempt:[Re,Ve]});kj(a);let s=a.publish,d=s.find(_=>_.relativePath==="index.html");d||K(`Directory ${r} must contain an index.html file.`);let l=nT(s,i);U(`Publishing ${s.length} ${s.length===1?"file":"files"} to the playground`);for(let _ of l.lines)E(_);l.named.length&&(g(),E("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),g();let p=yb(d.path,"utf8"),h=Vg(p),m=s.some(_=>_.relativePath==="favicon.ico"),y=s.some(_=>_.relativePath===hn),x=!h&&!m,O=x&&!y,M=gb();if(M!=="0.0.0-test"){let _=`${Ut}/client/${M}/${Re}`,b=!1;try{b=(await fetch(_,{method:"HEAD"})).ok}catch{b=!0}b||K(`The client this deploy would pin, ${M}, is not published yet.`,[`Every page uploaded here will import ${_},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${A.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let H;for(let _ of s){if(_.relativePath===Re||_.relativePath===Ve)continue;let b;try{b=await e.uploadTarget(t,_.relativePath)}catch(se){throw new Error(`${_.relativePath} cannot be published: ${se instanceof Error?se.message:String(se)}`,{cause:se})}_.relativePath==="index.html"&&(H=b);let v=yb(_.path),j=/\.(m?js)$/i.test(_.relativePath),X=/\.html$/i.test(_.relativePath)?R0(w0(x&&_.relativePath==="index.html"?Bi(v.toString("utf8")):v.toString("utf8"),gb()),b.playerApiOrigin,t):j?w0(v.toString("utf8"),gb()):v;await Po(b.uploadUrl,X,bj(_.relativePath),b.cacheControl)}if(O){let _=await e.uploadTarget(t,hn);await Po(_.uploadUrl,Gi,"image/svg+xml",_.cacheControl)}let T=[...s.map(_=>_.relativePath),...O?[hn]:[]];try{await e.pruneBundle(t,T);for(let _ of a.withheld)E(`Removed ${_.path} from the playground.`)}catch(_){let b=_ instanceof Error?_.message:String(_),v=a.withheld.map(j=>j.path);U("The playground still holds files this deploy did not publish"),g(` ${b}`),g(),v.length?(E(`Could not remove ${v.join(", ")} from the playground: ${b}`),E("Anything an earlier deploy put there is still being served.")):E("Anything an earlier deploy put there is still being served."),g(),process.exitCode=1}if(!J()&&H&&(g(),E(`Uploaded ${s.length} files from ${r}`),E(`Playground: ${Ml(H)}`),E(`Wired it to ${H.playerApiOrigin} as "${t}"`),O&&E("Added a replaceable starter favicon")),!H)throw new Error("The directory index was not uploaded.");return Ml(H)}yr();we();import{readFile as B0,stat as Lj}from"node:fs/promises";import{createServer as Dj}from"node:http";import{extname as jj,join as Mj,normalize as Uj,resolve as W0,sep as zj}from"node:path";we();var D0="player-conformance",_b="round-current",Sj="sha256:emulator-conformance";function yn(e){return structuredClone(e)}function en(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:Sj}}var Ej="2026-08-01T08:00:00.000Z";function Tj(e){let t=e==="per-player-challenge",r=e==="locked";return{...en(),id:_b,number:412,version:2,...r?{locks_at:Ej}:{},can:{accepting_plays:!r,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function L0(e,t){let r=t==="mistakes";return{...en(),player_id:D0,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function $j(e){let t=Tj(e),r=new Map([[t.id,t]]),o=new Map([[t.id,L0(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",L0("round-revealed",e))),{runtime:{...en(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...en(),round_id:_b,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...en(),player_id:D0,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function Ul(e,t){return{...en(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function kb(e){let t=$j(e);return{async getRuntime(){return yn(t.runtime)},async getCurrentRound(){return yn(t.rounds.get(_b))},async getRound(r){let o=t.rounds.get(r);return o?yn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return Ul(t,"round_not_found");let i=Tc({round_id:r,round_version:o.round_version,challenge_instance_id:o.challenge_instance_id,payload:o.payload}),a=t.plays.get(o.idempotency_key);if(a)return t.intents.get(o.idempotency_key)!==i?Ul(t,"idempotency_conflict"):{...yn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...en(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return Ul(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=en().server_time)return Ul(t,"lock_deadline_passed");let s=t.roundStates.get(r),d=t.runtime.marking==="at_settlement",l={...s,...en(),attempts_used:s.attempts_used+1,score:s.score+(d?0:10),finished:!d,outcome:d?"pending":"won"},p={...en(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!d,feedback:d?[]:[{key:"answer",verdict:"correct"}],round_state:yn(l)};return t.roundStates.set(r,l),t.plays.set(o.idempotency_key,p),t.intents.set(o.idempotency_key,i),l.finished&&!s.finished&&(t.profile=Ec(t.profile,l.outcome)),yn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return yn(o)},async getProfile(){return yn(t.profile)},async getLeaderboard(){return yn(t.leaderboard)}}}function Aj(){return e=>kb(e)}var uY=Aj();we();import{createServer as Ij}from"node:http";function kr(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var Cj=kr(Ie.runtime),j0=kr(Ie.currentRound),M0=kr(Ie.round),U0=kr(Ie.plays),z0=kr(Ie.roundState),Pj=kr(Ie.profile),Oj=kr(Ie.leaderboard),F0={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"};function Hn(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{...F0,"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function _r(e,t,r,o){Hn(e,t,{error:{code:r,message:o,retryable:!1}})}async function Nj(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function Rj(e,t,r,o,n){if(!e.url){_r(t,400,"invalid_request","The request URL is missing.");return}let a=new URL(e.url,"http://localhost").pathname;if(e.method==="OPTIONS"){t.writeHead(204,F0),t.end();return}if(n&&(j0.test(a)||M0.test(a)||U0.test(a)||z0.test(a))){_r(t,404,"no_round",n);return}if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(a)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(Cj.test(a)){Hn(t,200,await r.getRuntime());return}if(j0.test(a)){Hn(t,200,await r.getCurrentRound());return}let s=M0.exec(a);if(s){let l=await r.getRound(decodeURIComponent(s[2]));if(!l){_r(t,404,"round_not_found","The requested round was not found.");return}Hn(t,200,l);return}let d=z0.exec(a);if(d){let l=decodeURIComponent(d[2]);try{Hn(t,200,await r.getRoundState(l))}catch{_r(t,404,"round_not_found","The requested round was not found.")}return}if(Pj.test(a)){Hn(t,200,await r.getProfile());return}if(Oj.test(a)){Hn(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let s=U0.exec(a);if(s){try{let d=await Nj(e);Hn(t,200,await r.play(decodeURIComponent(s[2]),d))}catch(d){_r(t,400,"invalid_request",d instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}_r(t,404,"not_found","The requested player API route was not found.")}function zl(e="default",t,r){let o=kb(e);return Ij((n,i)=>{Rj(n,i,o,t,r).catch(()=>{i.headersSent?i.destroy():_r(i,500,"internal_error","The emulator could not answer the request.")})})}pn();rb();At();Ne();async function Fj(e){let t;try{t=await B0(e,"utf8")}catch{return}let r=Fe(t);if(!r.ok){K(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${A.cyan(o.path)} ${o.message}`));return}return r.manifest}var Gj={unconfigured:"No round yet. Set one up in Studio, or add one to gamestage.yaml to play it locally.","studio-round":"This game's round is in Studio, which gamestage dev cannot reach. Play the deployed game, or add a round to gamestage.yaml to play it locally."};async function Bj(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:zl(r,Mt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await Fj(e.manifest??"gamestage.yaml");if(!o)return{server:zl(r,Mt),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:zl(r,Mt,Gj[a]),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&K(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),vr.includes(n.archetype)||K(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${vr.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Nl({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:Mt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}var Wj={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"};function Kj(e,t){let r=(n,i)=>`if (!window.${n}) window.${n} = ${JSON.stringify(i)};
|
|
11254
|
+
`,n=e.search(/<script\b/i);if(n===-1){let i=e.search(/<\/head>/i);return i===-1?o+e:e.slice(0,i)+o+e.slice(i)}return e.slice(0,n)+o+e.slice(n)}async function Po(e,t,r,o){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":r,...o?{"cache-control":o}:{}}});n.ok||K(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function Ml(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function bj(e){switch(uj(e).toLowerCase()){case".html":return"text/html; charset=utf-8";case".css":return"text/css; charset=utf-8";case".js":case".mjs":return"text/javascript; charset=utf-8";case".json":return"application/json; charset=utf-8";case".svg":return"image/svg+xml";case".png":return"image/png";case".jpg":case".jpeg":return"image/jpeg";case".gif":return"image/gif";case".webp":return"image/webp";case".ico":return"image/x-icon";case".webmanifest":return"application/manifest+json; charset=utf-8";case".wasm":return"application/wasm";default:return"application/octet-stream"}}async function vj(e,t,r,o={}){let n=pj(r),i;try{i=bb(n)}catch{throw K(`Cannot read ${r}.`),new Error("unreachable")}let a=await ey({path:n,relativePath:r},o.round);a&&K(`${r} ${a.why}`,["A deploy is a publishing act, and --file publishes this file as the game's","own page. Point --file at the game's HTML, or use --dir and let the gate","withhold what the page does not need."]);let s=await e.uploadTarget(t,"index.html"),d=L0(Bi(i.toString("utf8")),`${s.playerApiOrigin}`,t);await Po(s.uploadUrl,d,"text/html; charset=utf-8",s.cacheControl);let l=await e.uploadTarget(t,Ve);await Po(l.uploadUrl,uo,"text/javascript; charset=utf-8",l.cacheControl);let p=await e.uploadTarget(t,Re);await Po(p.uploadUrl,Mt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,hn);return await Po(h.uploadUrl,Gi,"image/svg+xml",h.cacheControl),J()||(g(),E(`Uploaded ${r} to ${Ml(s)}`),E(`Wired it to ${s.playerApiOrigin} as "${t}"`),E(`Shipped @monterosa/gamestage beside it (${Xt})`),E(`Shipped the player client beside it (${gr})`)),Ml(s)}async function wj(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(gb(),w0));_j(await i(e,t,r,n))}function _j(e){if(e.status==="verified"){R("Checked","the page loads and plays in a browser"),g();return}if(e.status==="skipped"||e.status==="n/a"){E(A.dim(`Not checked in a browser: ${e.detail??""}`.trim())),g();return}U("The published page did not start"),g(` ${e.detail??""}`),g(),E("The files are published, so the game is live and broken rather than unpublished."),E(`${A.cyan(ie("verify"))} the same check, with the rest of them`),g(),process.exitCode=1}function kj(e){for(let t of e.walkedPast)E(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)E(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)E(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&K(`${e.refuse.path} ${e.refuse.why}`,["A deploy is a publishing act, so this file would sit at a public URL beside","your game. Remove it from the directory, or point --dir at a directory that","does not contain it, and deploy again."])}async function xj(e,t,r,o={}){let n,i=[];try{let _=Zi(r,{symlinks:"throw"});n=_.files,i=_.withheld}catch(_){throw K(_ instanceof Error?_.message:`Cannot read ${r}.`),new Error("unreachable")}let a=await eT(n,{...o,exempt:[Re,Ve]});kj(a);let s=a.publish,d=s.find(_=>_.relativePath==="index.html");d||K(`Directory ${r} must contain an index.html file.`);let l=rT(s,i);U(`Publishing ${s.length} ${s.length===1?"file":"files"} to the playground`);for(let _ of l.lines)E(_);l.named.length&&(g(),E("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),g();let p=bb(d.path,"utf8"),h=Zg(p),m=s.some(_=>_.relativePath==="favicon.ico"),y=s.some(_=>_.relativePath===hn),x=!h&&!m,O=x&&!y,M=yb();if(M!=="0.0.0-test"){let _=`${Ut}/client/${M}/${Re}`,b=!1;try{b=(await fetch(_,{method:"HEAD"})).ok}catch{b=!0}b||K(`The client this deploy would pin, ${M}, is not published yet.`,[`Every page uploaded here will import ${_},`,"which answers 404 today. The game would load, fetch nothing, and show a","blank screen with no error anywhere.","","Deploy the site first: it is what serves /client/<version>/.","",`${A.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let H;for(let _ of s){if(_.relativePath===Re||_.relativePath===Ve)continue;let b;try{b=await e.uploadTarget(t,_.relativePath)}catch(se){throw new Error(`${_.relativePath} cannot be published: ${se instanceof Error?se.message:String(se)}`,{cause:se})}_.relativePath==="index.html"&&(H=b);let v=bb(_.path),j=/\.(m?js)$/i.test(_.relativePath),X=/\.html$/i.test(_.relativePath)?L0(_0(x&&_.relativePath==="index.html"?Bi(v.toString("utf8")):v.toString("utf8"),yb()),b.playerApiOrigin,t):j?_0(v.toString("utf8"),yb()):v;await Po(b.uploadUrl,X,bj(_.relativePath),b.cacheControl)}if(O){let _=await e.uploadTarget(t,hn);await Po(_.uploadUrl,Gi,"image/svg+xml",_.cacheControl)}let T=[...s.map(_=>_.relativePath),...O?[hn]:[]];try{await e.pruneBundle(t,T);for(let _ of a.withheld)E(`Removed ${_.path} from the playground.`)}catch(_){let b=_ instanceof Error?_.message:String(_),v=a.withheld.map(j=>j.path);U("The playground still holds files this deploy did not publish"),g(` ${b}`),g(),v.length?(E(`Could not remove ${v.join(", ")} from the playground: ${b}`),E("Anything an earlier deploy put there is still being served.")):E("Anything an earlier deploy put there is still being served."),g(),process.exitCode=1}if(!J()&&H&&(g(),E(`Uploaded ${s.length} files from ${r}`),E(`Playground: ${Ml(H)}`),E(`Wired it to ${H.playerApiOrigin} as "${t}"`),O&&E("Added a replaceable starter favicon")),!H)throw new Error("The directory index was not uploaded.");return Ml(H)}yr();we();import{readFile as W0,stat as Lj}from"node:fs/promises";import{createServer as Dj}from"node:http";import{extname as jj,join as Mj,normalize as Uj,resolve as K0,sep as zj}from"node:path";we();var j0="player-conformance",kb="round-current",Sj="sha256:emulator-conformance";function yn(e){return structuredClone(e)}function en(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:Sj}}var Ej="2026-08-01T08:00:00.000Z";function Tj(e){let t=e==="per-player-challenge",r=e==="locked";return{...en(),id:kb,number:412,version:2,...r?{locks_at:Ej}:{},can:{accepting_plays:!r,results_available:!1,solution_revealed:!1,closed:!1,optimistic_play:!1},challenge_instance_id:t?"challenge-player-conformance":null,challenge:{prompt:"alpha"}}}function D0(e,t){let r=t==="mistakes";return{...en(),player_id:j0,round_id:e,attempts_used:r?6:0,attempts_allowed:10,mistakes_used:r?2:0,mistakes_allowed:4,progress:r?{solved:["group-1"]}:{},score:r?10:0,score_revision:0,finished:!1,outcome:r?"incomplete":void 0}}function $j(e){let t=Tj(e),r=new Map([[t.id,t]]),o=new Map([[t.id,D0(t.id,e)]]);return e==="solution-disclosure"&&(r.set("round-revealed",{...t,id:"round-revealed",number:411,version:3,can:{accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0,optimistic_play:!1},solution:{answer:"revealed-alpha"}}),o.set("round-revealed",D0("round-revealed",e))),{runtime:{...en(),game:"conformance-game",api_version:"2.0",archetype:e==="at-settlement"?"predict":"group",marking:e==="at-settlement"?"at_settlement":"at_commit",challenge_source:e==="per-player-challenge"?"per_player":"shared",schedule:{kind:"continuous"},updates:{transport:"poll",freshness_seconds:30},display:{title:"Conformance game"},identity:{required:!1,provider:"identify",anonymous_play:!0},archive:!0,capabilities:["plays","profile","leaderboard"]},rounds:r,roundStates:o,leaderboard:{...en(),round_id:kb,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...en(),player_id:j0,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function Ul(e,t){return{...en(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function xb(e){let t=$j(e);return{async getRuntime(){return yn(t.runtime)},async getCurrentRound(){return yn(t.rounds.get(kb))},async getRound(r){let o=t.rounds.get(r);return o?yn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return Ul(t,"round_not_found");let i=Tc({round_id:r,round_version:o.round_version,challenge_instance_id:o.challenge_instance_id,payload:o.payload}),a=t.plays.get(o.idempotency_key);if(a)return t.intents.get(o.idempotency_key)!==i?Ul(t,"idempotency_conflict"):{...yn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...en(),play_id:`stale-${t.nextPlay++}`,outcome:"stale",reason:"round_version",round_version:n.version,marked:!1,feedback:[]};if(n.challenge_instance_id!==null&&o.challenge_instance_id!==n.challenge_instance_id)return Ul(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=en().server_time)return Ul(t,"lock_deadline_passed");let s=t.roundStates.get(r),d=t.runtime.marking==="at_settlement",l={...s,...en(),attempts_used:s.attempts_used+1,score:s.score+(d?0:10),finished:!d,outcome:d?"pending":"won"},p={...en(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!d,feedback:d?[]:[{key:"answer",verdict:"correct"}],round_state:yn(l)};return t.roundStates.set(r,l),t.plays.set(o.idempotency_key,p),t.intents.set(o.idempotency_key,i),l.finished&&!s.finished&&(t.profile=Ec(t.profile,l.outcome)),yn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return yn(o)},async getProfile(){return yn(t.profile)},async getLeaderboard(){return yn(t.leaderboard)}}}function Aj(){return e=>xb(e)}var uY=Aj();we();import{createServer as Ij}from"node:http";function kr(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var Cj=kr(Ie.runtime),M0=kr(Ie.currentRound),U0=kr(Ie.round),z0=kr(Ie.plays),F0=kr(Ie.roundState),Pj=kr(Ie.profile),Oj=kr(Ie.leaderboard),G0={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"authorization, content-type, x-gamestage-player","access-control-max-age":"600"};function Hn(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{...G0,"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function _r(e,t,r,o){Hn(e,t,{error:{code:r,message:o,retryable:!1}})}async function Nj(e){let t=[];for await(let r of e)t.push(Buffer.from(r));if(t.length!==0)return JSON.parse(Buffer.concat(t).toString("utf8"))}async function Rj(e,t,r,o,n){if(!e.url){_r(t,400,"invalid_request","The request URL is missing.");return}let a=new URL(e.url,"http://localhost").pathname;if(e.method==="OPTIONS"){t.writeHead(204,G0),t.end();return}if(n&&(M0.test(a)||U0.test(a)||z0.test(a)||F0.test(a))){_r(t,404,"no_round",n);return}if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(a)){t.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(o)}),t.end(o);return}if(Cj.test(a)){Hn(t,200,await r.getRuntime());return}if(M0.test(a)){Hn(t,200,await r.getCurrentRound());return}let s=U0.exec(a);if(s){let l=await r.getRound(decodeURIComponent(s[2]));if(!l){_r(t,404,"round_not_found","The requested round was not found.");return}Hn(t,200,l);return}let d=F0.exec(a);if(d){let l=decodeURIComponent(d[2]);try{Hn(t,200,await r.getRoundState(l))}catch{_r(t,404,"round_not_found","The requested round was not found.")}return}if(Pj.test(a)){Hn(t,200,await r.getProfile());return}if(Oj.test(a)){Hn(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let s=z0.exec(a);if(s){try{let d=await Nj(e);Hn(t,200,await r.play(decodeURIComponent(s[2]),d))}catch(d){_r(t,400,"invalid_request",d instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}_r(t,404,"not_found","The requested player API route was not found.")}function zl(e="default",t,r){let o=xb(e);return Ij((n,i)=>{Rj(n,i,o,t,r).catch(()=>{i.headersSent?i.destroy():_r(i,500,"internal_error","The emulator could not answer the request.")})})}pn();ob();At();Ne();async function Fj(e){let t;try{t=await W0(e,"utf8")}catch{return}let r=Fe(t);if(!r.ok){K(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${A.cyan(o.path)} ${o.message}`));return}return r.manifest}var Gj={unconfigured:"No round yet. Set one up in Studio, or add one to gamestage.yaml to play it locally.","studio-round":"This game's round is in Studio, which gamestage dev cannot reach. Play the deployed game, or add a round to gamestage.yaml to play it locally."};async function Bj(e){let t=Number(e.port);if(!Number.isInteger(t)||t<0||t>65535)throw new Error("--port must be an integer between 0 and 65535");let r=e.scenario??"default";if(e.fixture)return{server:zl(r,Mt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await Fj(e.manifest??"gamestage.yaml");if(!o)return{server:zl(r,Mt),what:"fixture",fixtureReason:"no-manifest",game:"conformance-game"};let n=o.backend.round;if(!n){let a=o.interaction_cloud.elements.length?"studio-round":"unconfigured";return{server:zl(r,Mt,Gj[a]),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&K(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),vr.includes(n.archetype)||K(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${vr.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Nl({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:Mt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}var Wj={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"};function Kj(e,t){let r=(n,i)=>`if (!window.${n}) window.${n} = ${JSON.stringify(i)};
|
|
11255
11255
|
`,o="<script>\n// Added by `gamestage dev --serve` as it served this page. Not in your file.\n"+r("GAMESTAGE_API",t.api)+r("GAMESTAGE_GAME",t.game)+(t.token?r("GAMESTAGE_TOKEN",t.token):"")+`</script>
|
|
11256
11256
|
`;return/<head[^>]*>/i.test(e)?e.replace(/<head[^>]*>/i,n=>`${n}
|
|
11257
|
-
${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","http://localhost"),i=decodeURIComponent(n.pathname),a=
|
|
11258
|
-
`);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function aM(e,t){if(!(await xb(e)).isFile())try{let o=JSON.parse(await Fl(Sb(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=V0(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=V0(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function V0(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var sM=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],cM=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],lM=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function dM(e){let t=e.map(s=>s.text).join(`
|
|
11259
|
-
`),r=lM.map(s=>{let d=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:d.length,because:d}}).filter(s=>s.hits>0).sort((s,d)=>d.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function uM(e,t){let o=(await
|
|
11260
|
-
`),s=cM.filter(m=>!m.present.test(a)).map(m=>({id:m.id,title:m.title,detail:m.detail,evidence:[]})),d=[];t.some(m=>/<(div|section|main|canvas)/i.test(m.text))&&d.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(m=>({file:m.relative}))});let p=Dl(t),h=[];return o.kind==="standalone_html"&&h.push("Where is this deployed today, and who owns that hosting?"),h.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),i.some(m=>m.id==="client-play-limit")?h.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&h.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: `backend.round.attemptsAllowed` defaults to 10 when left out, and that number is then the game a fan plays. Choose it deliberately, and if the prototype allowed unlimited tries, tell the developer the game has changed."),{target:e,scanned_files:t.length,stack:o,keep:d,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await aM(e,t),skipped:r}}Ne();var yM={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},bM=new Set(["players make picks","selects from a roster","players guess"]);function vM(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,r=Bt.includes(t),o=e.because.filter(n=>!bM.has(n));return r&&o.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:r?yM[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var wM=e=>gM(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",_M=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function kM(e,t){let r=wM(e.name??e.target),o=t&&OE(t)?t:Wc(r),n=e.name??_M(r),i=xc(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),jn.parse(i)}async function xM(e,t){let r=await Le();if(!r)return!1;yo();let o=e.backend.archetype;if(!o)return!1;let i=await fr({baseUrl:De,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${fM("sha256").update(t).digest("hex")}`,conformance:vt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ao.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function SM(e){try{let t=so.load(await pM(e,"utf8"));if(!t||typeof t!="object")return;let r=t.app;return typeof r?.id=="string"&&r.id.trim()?r.id:void 0}catch{return}}async function EM(e){try{return await hM(e),!0}catch{return!1}}async function q0(e,t){let r;try{r=await Y0(e)}catch(p){return K(p instanceof Error?p.message:"Inspection failed")}let o=kM(r,await SM(typeof t.write=="string"?t.write:"gamestage.yaml")),n=vM(r.archetype),i=vt(o);o.manifest.conformance=i.computed;let a=Ri(o),s=!1,d,l=null;if(t.write){if(l=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await EM(l))return K(`${l} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${A.cyan(ie(`manifest validate ${l}`))} check what you have`,`${A.cyan(ie("inspect . --force"))} replace it anyway`]);await mM(l,a,"utf8");try{s=await xM(o,a)}catch(p){d=p instanceof Error?p.message:"The control plane did not answer."}}if(J()){te({ok:!0,report:r,format_match:n,manifest:o,conformance:{computed:i.computed,blockers:i.blockers},manifest_yaml:a,written_to:l,registered:s,...d?{registration_failed:d}:{}});return}if(U(`Inspection report ${A.dim(r.target)}`),R("Files inspected",String(r.scanned_files)),R("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),n.matched&&r.archetype?(R("Format",r.archetype.archetype),g(` ${" ".repeat(18)} ${A.dim(r.archetype.because.join("; "))}`)):n.nearest?(R("Format",A.yellow("none of the served formats marks this game")),g(),g(` The formats are ${Bt.join(", ")}. Each is one rule an`),g(" Engine marks plays against, and this game's rule is not among them."),g(),g(` Nearest: ${A.cyan(n.nearest)}, which ${n.differs}.`),g(" Building on it would judge fans by a rule their game never had."),g()):(R("Format",A.yellow("not recognised from this code")),g(),g(" Nothing in what was read says which of the served formats this is, and"),g(" that is a reading of the code rather than a verdict on the game."),g(` They are ${Bt.join(", ")}.`),g()),n.matched||(g(" Tell us the rule we do not have. It needs no account and sends"),g(" nothing until you add --send:"),g(` ${A.cyan(ie(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),r.skipped.length){U("Skipped");for(let p of r.skipped)E(`${A.dim(p.file)} \u2014 not scanned`),g(` ${A.dim(p.reason)}`)}if(r.keep.length){U("Keep as yours");for(let p of r.keep)E(A.green(p.title)),g(` ${A.dim(p.detail)}`)}if(r.move_behind_authority.length){U("Must move behind an authoritative boundary");for(let p of r.move_behind_authority){E(A.yellow(p.title)),g(` ${A.dim(p.detail)}`);for(let h of p.evidence.slice(0,2)){let m=h.line?`${h.file}:${h.line}`:h.file;g(` ${A.dim("\u2192")} ${A.cyan(m)}${h.excerpt?A.dim(" "+h.excerpt):""}`)}p.remedy&&(g(` ${A.dim("delete")} ${p.remedy.delete}`),g(` ${A.dim("call")} ${A.cyan(p.remedy.call)}`),p.remedy.render&&g(` ${A.dim("render")} ${p.remedy.render}`),p.remedy.move&&g(` ${A.dim("move")} ${p.remedy.move}`),g(` ${A.dim("keep")} ${p.remedy.keep}`))}}if(r.missing_integrations.length){U("Platform integrations not present yet");for(let p of r.missing_integrations)E(p.title),g(` ${A.dim(p.detail)}`)}if(r.unknowns.length){U("Needs a human answer");for(let p of r.unknowns)E(p,"?")}if(U("App Manifest"),R("Conformance",`${i.computed} ${i.computedName}`),i.blockers.length){g(),g(A.dim(" To reach the next level:"));for(let p of i.blockers)g(` ${A.dim("\xB7")} ${p.requirement}`)}g(),l?(g(` Written to ${A.cyan(l)}`),!n.matched&&n.nearest&&g(A.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),g(s?" Registered in Studio as a draft.":d?` Not registered in Studio: ${d} (${De})`:" No account found, so registration was skipped.")):(g(A.dim(" Nothing written and nothing registered. Re-run with --write to save")),g(A.dim(" this manifest and register the game."))),g()}var J0="https://github.com",TM="https://api.github.com",Gl=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function X0(){let e=await fetch(`${J0}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Gl,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function Q0(e){let r=await(await fetch(`${J0}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Gl,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await $M(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function $M(e){let t=await fetch(`${TM}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}At();Ne();var AM=e=>new Promise(t=>setTimeout(t,e));async function eA(){let{client:e}=await Te();try{let t=await X0();J()?te({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Gl}):(U("Link GitHub"),g(),E("This proves who you are. We read your GitHub login and nothing else."),E("No access to your code is requested, and none is stored."),E("It is optional: a deploy does not require it."),g(),R("Code",t.user_code),R("Open",t.verification_uri),g(),E("Enter the code on that page. This waits until you do."),g());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await AM(o*1e3);let n=await Q0(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return K("You declined the request on GitHub.");if(n.status==="expired")return K("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(J())return te({ok:!0,status:"linked",github:i.github});U("Linked"),R("Account",n.login),g(),E("Your first deploy is no longer gated. Run `gamestage deploy`."),g();return}K("The code expired before it was entered.")}catch(t){Ce(t)}}yr();At();Ne();we();var IM=e=>new Promise(t=>setTimeout(t,e));function CM(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
|
|
11261
|
-
`)}async function
|
|
11257
|
+
${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","http://localhost"),i=decodeURIComponent(n.pathname),a=K0(e,`.${Uj(i)}`);if(!(a===e||a.startsWith(e+zj))){o.writeHead(403).end("Outside the served directory");return}let d=a;try{(await Lj(d)).isDirectory()&&(d=Mj(d,"index.html"))}catch{o.writeHead(404).end("Not found");return}try{let l=await W0(d),p=/\.html?$/i.test(d),h=t&&p?Kj(l.toString("utf8"),t):l;o.writeHead(200,{"content-type":Wj[jj(d).toLowerCase()]??"application/octet-stream","cache-control":"no-store, must-revalidate"}),o.end(h)}catch{o.writeHead(404).end("Not found")}})}function B0(e,t){U("Your game runs in two places"),E("This process is the Engine. It holds the answers and marks every play."),t&&e?(R("Open",e),E("Your page is served from this directory, with caching off so an edit shows.")):E("Your page is yours to serve: this command does not, and the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),E("The round a fan plays comes from Studio, not from here. A producer changes it without a deploy and without you."),g(),E("A manifest change needs a restart: this reads it once, at startup."),g()}async function H0(e){await Fn();let t=await Bj(e),{server:r}=t,o=()=>new Promise((m,y)=>{p?.close(),r.close(x=>x?y(x):m())}),n=new Promise(m=>{let y=async()=>{process.off("SIGINT",y),process.off("SIGTERM",y),await o(),m()};process.once("SIGINT",y),process.once("SIGTERM",y)});await new Promise((m,y)=>{r.once("error",y),r.listen(Number(e.port),"127.0.0.1",()=>m())});let i=r.address();if(!i||typeof i=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${i.port}`,s,d;t.as&&(s=await nb(a),r.attachDevIdentity?.(s),d=await s.mint(t.as));let l=(await Le().catch(()=>null))?.email,p,h;if(e.serve){let m=K0(process.cwd());p=Hj(m,t.game?{api:a,game:t.game,token:d}:void 0),await new Promise((x,O)=>{p.once("error",O),p.listen(Number(e.servePort??4001),"127.0.0.1",()=>x())});let y=p.address();y&&typeof y!="string"&&(h=`http://127.0.0.1:${y.port}`)}if(J())te({ok:!0,status:"listening",serving:t.what,baseUrl:a,game:t.game,round:t.round?{number:t.round.number,id:`round-${t.round.number}`}:null,round_source:t.round?"manifest":"stand-in",...t.fixtureReason?{fixture_reason:t.fixtureReason}:{},...s&&d?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:d,required:!0}}:{}});else if(t.what==="engine"){U(t.title??t.game);let m=Xn(t.containerLabel);R("Serving",`your ${Xn(t.containerLabel,{lower:!0})}, through the real Engine`),R(m,`${t.round.number} (round-${t.round.number})`),R("API",a),R("Game id",t.game),l&&R("Signed in",l),g(),E(`<script src="${a}/gamestage.js"></script>`),E(`window.GAMESTAGE_API = "${a}"`),E(`window.GAMESTAGE_GAME = "${t.game}"`),d&&E(`window.GAMESTAGE_TOKEN = "${d}"`),g(),s&&d&&(R("Playing as",`${t.as} (${A.cyan(`id:${t.as}`)})`),R("Identity","required, so an anonymous play is refused here too"),R("Keys",s.jwksUri),g(),E("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),E(`This harness cannot be deployed: its issuer is a loopback URL, and ${A.cyan(ie("manifest validate"))} refuses a manifest that names one.`),g()),E(`Edit the ${Xn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),g(),B0(h,!!e.serve)}else U(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),R("API",a),R("Game id",t.game),g(),E(`<script src="${a}/gamestage.js"></script>`),g(),t.fixtureReason==="studio-round"?(E("A round is configured in Studio, but `gamestage dev` cannot reach it."),E("Play the deployed game to use the Studio round. Your page will say so here rather than draw a board.")):t.fixtureReason==="unconfigured"?(E("No round is configured in Studio yet, so your page will say so rather than draw a board."),E("Set up the first round in Studio, then play the deployed game.")):(E("There is no round here to serve, so this is the shell rather than your game."),E("`dev` reads a round from the manifest and is the one place that may: it is a local harness and deploys nothing. A game's real content lives in Studio, where a producer can change it without you.")),g(),B0(h,!!e.serve);await n}gb();we();Ne();import{stat as Vj}from"node:fs/promises";function Zj(e){let t=OE(e);return{id:"node",label:"Node.js",ok:t,detail:t?`v${e}`:`v${e} - Gamestage needs Node ${Bc} or newer`,blocking:!0}}async function V0(){let e=[];e.push(Zj(process.versions.node)),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${Ci} bundled`,blocking:!1});let t=!1;try{await Vj("gamestage.yaml"),t=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:t,detail:t?"gamestage.yaml found":"none here yet \u2014 `gamestage inspect .` or `gamestage create` makes one",blocking:!1}),e.push({id:"auth",label:"Signed in",ok:!1,detail:"not signed in \u2014 only needed to deploy",blocking:!1});let r=e.filter(o=>!o.ok&&o.blocking);J()&&(te({ok:r.length===0,checks:e}),process.exit(r.length===0?0:1)),U("Environment");for(let o of e){let n=o.ok?A.green("ok"):o.blocking?A.red("blocked"):A.dim("--");g(` ${n.padEnd(18)} ${o.label.padEnd(16)} ${A.dim(o.detail)}`)}g(),r.length&&(g(` ${A.red("Fix the blocked items above before continuing.")}`),g(),process.exit(1)),g(` ${A.green("Ready.")}`),g()}kc();we();yr();import{readFile as pM,stat as hM,writeFile as mM}from"node:fs/promises";import{createHash as fM}from"node:crypto";import{basename as gM}from"node:path";At();ub();qc();pn();import{readdir as Yj,readFile as Fl,stat as Sb}from"node:fs/promises";import{createHash as qj}from"node:crypto";import{basename as Y0,extname as Jj,join as Eb,relative as Xj}from"node:path";var Qj=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),eM=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function tM(e){return qj("sha256").update(e).digest("hex").slice(0,16)}var nM={[Ve]:gr,[Re]:Xt};function rM(e){let t=Y0(e.relative);if(Yc(e.relative))return`${t} is never published by \`gamestage deploy\`, so nothing in it reaches a browser.`;let r=nM[t];return!r||tM(e.text)!==r?null:`${t} is the Gamestage client \`gamestage client\` generated. It reads an Engine verdict; it does not decide one, and the words that make it look like a leak (answer, correct, target) are how it talks to the Engine.`}async function oM(e,t=200){let r=await Sb(e),o=[],n=[],i=s=>{let d=rM(s);d?n.push({file:s.relative,reason:d}):o.push(s)};if(r.isFile())return i({path:e,relative:Y0(e),text:await Fl(e,"utf8")}),{files:o,skipped:n};let a=async s=>{if(o.length>=t)return;let d=await Yj(s,{withFileTypes:!0});for(let l of d){if(o.length>=t)return;if(l.name.startsWith(".")&&l.name!==".openai")continue;let p=Eb(s,l.name);if(l.isDirectory()){if(Qj.has(l.name))continue;await a(p)}else if(eM.has(Jj(l.name)))try{i({path:p,relative:Xj(e,p),text:await Fl(p,"utf8")})}catch{}}};return await a(e),{files:o,skipped:n}}function iM(e,t){let r=e.text.split(`
|
|
11258
|
+
`);for(let o=0;o<r.length;o++)if(t.test(r[o]))return{file:e.relative,line:o+1,excerpt:r[o].trim().slice(0,120)};return null}async function aM(e,t){if(!(await Sb(e)).isFile())try{let o=JSON.parse(await Fl(Eb(e,"package.json"),"utf8"));if(o.name)return o.name.replace(/^@[^/]+\//,"")}catch{}for(let o of t){if(!/\.html?$/.test(o.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(o.text);if(n){let a=Z0(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=Z0(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function Z0(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var sM=[{id:"client-scoring",title:"Scoring runs in the browser",detail:"Score is computed client-side, so a player can edit it. Scoring must move into the Game Engine and the client must render a server-returned result.",patterns:[/\b\w*(score|points|total)\s*\+=/i,/\b\w*(score|points|total)\w*\s*=\s*\w*\s*[+*]/i,/function\s+\w*(calculate|compute|get)\w*(score|points|total|tier)/i],remedy:{delete:"the score arithmetic in the browser, and the answer set it marks against",call:"const result = await client.play(round.id, { picks, roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.score, and result.feedback[].verdict per pick. `round_state` is absent where a game marks at settlement, so read it optionally",move:"the answer set into `backend.round.targets` in gamestage.yaml, where a deploy provisions it into the Engine",keep:"every bit of the rendering, the animation and the copy",because:"a score the browser computes is a score a player can set"},remedies:{push:{delete:"the running total, the bust comparison and the tier table, and the dataset the values came from",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.total for the running total, .bust for whether they went over, and .tier for the rank. The value each pick contributed comes back in result.feedback[0].label",move:"what each pick is worth into `backend.round.slates[].entries[].value` in gamestage.yaml, and the ceiling into `backend.round.target`",keep:"every bit of the rendering, the animation and the copy",because:"a game whose whole mechanic is arithmetic is finished the moment its numbers reach the browser, whatever the page does afterwards"}}},{id:"client-outcome",title:"The result is decided in the browser",detail:"Win, loss or result tier is determined client-side, so the outcome cannot be trusted. The Engine must decide the outcome and return it as a committed decision.",patterns:[/\b(bust|win|won|lost|passed|failed)\s*=\s*\w+\s*[<>=]/i,/\bgetTier\s*\(|\bdetermine(Result|Outcome|Winner)/i],remedy:{delete:"the local decision about winning, losing or a result tier",call:"const result = await client.play(round.id, input, newIdempotencyKey())",render:"result.round_state?.outcome, which is won, lost, incomplete or pending",keep:"how the outcome is presented, including the celebration",because:"an outcome the page decides is one it can be persuaded to decide differently"},remedies:{push:{delete:"the bust comparison and the function that turns a distance into a rank",call:"const result = await client.play(round.id, { picks: [key], roundVersion: round.version }, newIdempotencyKey())",render:"result.round_state?.progress.bust and .tier, which are decided on commit: the total only grows, so passing the target ends the round then rather than at the last pick",move:"the rank ladder into `backend.round.tiers`, as fractions of the target",keep:"how the result is presented, including the celebration",because:"a rank the page awards is one it can award itself"}}},{id:"client-answers",title:"Answers or targets are present in client code",detail:"The solution set ships to the browser, so it can be read before play. Answers must be held server-side and never cross the wire.",patterns:[/\b(answer|solution|correct)(Key|Set|s)?\s*[:=]/i,/\bisCorrect\s*[:=(]/i,/\b\w*(target|answer|solution)\w*\s*=\s*[[{](?!.*(fetch|await|response))/i,/\b(target|answer|solution)s?\s*:\s*[^,}\n]/i],remedy:{delete:"the array or object holding the correct answers",call:"const round = await client.getCurrentRound()",render:"round.challenge for what the player picks from. The Engine returns the verdict; the page never knows the answer until the round reveals it",move:"the answers into `backend.round.targets` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to mark against",keep:"the board, the layout and the interaction",because:"a solution in the bundle can be read before anybody plays"},remedies:{push:{delete:"the dataset the contributions are looked up in",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates, which carry each pick's key and label and no value at all. What a pick was worth arrives as feedback once it has been committed",move:"the values into `backend.round.slates[].entries[].value` in gamestage.yaml. Deleting them without moving them leaves the Engine nothing to count",keep:"the board, the layout and the interaction",because:"knowing every contribution is knowing which picks land on the target, which is the whole game"}}},{id:"client-play-limit",title:"Play limiting relies on browser storage",detail:"Attempt limits enforced through localStorage or cookies reset when storage is cleared. Limits must be enforced against an identified player server-side.",patterns:[/localStorage\.(set|get)Item\s*\(\s*['"`][^'"`]*(play|attempt|tries|daily|limit)/i,/sessionStorage\.(set|get)Item/i],remedy:{delete:"the localStorage or cookie bookkeeping that counts attempts",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed, and the same pair for mistakes",move:"the limits into `backend.round.attemptsAllowed` and `mistakesAllowed`",keep:"how the remaining attempts are shown",because:"a limit in storage is a limit that clearing storage removes"},remedies:{push:{delete:"the localStorage bookkeeping that remembers today's game",call:"const state = await client.getRoundState(round.id)",render:"state.attempts_used against state.attempts_allowed for picks taken, and state.finished for whether today is done",move:"the number of picks into `backend.round.slates`: one slate is one pick",keep:"how the remaining picks are shown",because:"a game that remembers in the browser is one a cleared browser lets you play again"}}},{id:"client-randomness",title:"The daily challenge is chosen in the browser",detail:"Client-side randomness means players can reroll until they like the challenge, and no two players share a verifiable daily. Selection must be server-issued.",patterns:[/Math\.random\s*\(\)/,/\b(daily|today|challenge)\w*\s*=\s*.*Math\.random/i],remedy:{delete:"the Math.random() that chooses the challenge",call:"const round = await client.getCurrentRound()",render:"round.challenge, which is the same for everyone playing that round",keep:"randomness that is only decoration, such as confetti or shuffling how options are laid out",because:"a challenge the browser picks is one a player can reroll, and no two players share a daily worth comparing"},remedies:{push:{delete:"the Math.random() that chooses which team and season comes up",call:"const round = await client.getCurrentRound()",render:"round.challenge.slates in order: slate n is pick n. Keep the spin as an animation over a choice the round has already made",move:"the sequence into `backend.round.slates`, one per pick",keep:"the spin, the reveal and every bit of its timing",because:"a slate the browser draws is one a player can redraw, and it means no two players played the same day"}}},{id:"client-time",title:"Round timing uses client time",detail:"Device clocks can be changed. Open, lock and settle decisions must use authoritative server time.",patterns:[/new Date\(\)\.getTime\(\)/,/Date\.now\(\)\s*[<>]/],remedy:{delete:"the comparisons against Date.now() that decide whether the round is open",call:"const round = await client.getCurrentRound()",render:"round.can.accepting_plays, and round.server_time where a countdown needs an origin",keep:"the countdown itself, driven from the server's time rather than the device's",because:"a device clock is something a player can change"}}],cM=[{id:"sdk",title:"Monterosa JavaScript SDK 2",detail:"No SDK integration found. The SDK provides the EnMasse connection, live config and content updates, identity, consent, storage and experience hosting.",present:/@monterosa\/sdk-|sdk\.monterosa\.cloud/i},{id:"identity",title:"Player sign-in",detail:"No player identity found. Anonymous play is supported and the Engine's signed session carries it. To identify players, name your own issuer and its JWKS in `identity.jwt` and the Engine validates the token your login system already gives them.",present:/identify-kit|monterosa.*identity|\bIdentify\b|jwks|oidc|auth0|workos|firebase.*auth/i},{id:"consent",title:"Consent gating",detail:"No consent handling found. Analytics and storage must respect the player's consent choices.",present:/consent-kit|consent/i},{id:"analytics",title:"Analytics",detail:"No analytics found. Gamestage routes events to the destinations declared in the manifest, with Monterosa Analytics on by default.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],lM=[{archetype:"hunt",signals:[{pattern:/\b(answer|solution|correct)(s|Set|Key)?\s*[:=]/i,because:"marks picks against a known answer set"},{pattern:/\bisCorrect\b|\bverdict\b/i,because:"judges a pick right or wrong"},{pattern:/\bpick(s|ed)?\b/i,because:"players make picks"},{pattern:/\broster|\bplayer(s)?\s*\[/i,because:"selects from a roster"}]},{archetype:"push",signals:[{pattern:/\b\w*(total|sum|running)\w*\s*\+=/i,because:"accumulates a running total from each pick"},{pattern:/\bbust\b/i,because:"has a bust condition for going over"},{pattern:/\b\w*total\w*\s*[><]=?\s*\w*target|\btarget\w*\s*-\s*\w*total/i,because:"compares the total against a target"},{pattern:/\bgetTier\b|\bwithout going over\b|\bclosest\b/i,because:"scores by how close the total came"}]},{archetype:"trivia",signals:[{pattern:/\bquestion\b/i,because:"presents questions"},{pattern:/\bchoice(s)?\b|\boption(s)?\b/i,because:"offers answer choices"},{pattern:/\bquiz\b/i,because:"describes itself as a quiz"}]},{archetype:"predict",signals:[{pattern:/\bpredict/i,because:"asks players to predict"},{pattern:/\bmarket\b|\bodds\b/i,because:"has market or odds language"},{pattern:/\bsettle(d|ment)?\b/i,because:"settles outcomes"}]},{archetype:"group",signals:[{pattern:/\bpuzzle\b/i,because:"describes itself as a puzzle"},{pattern:/\bguess(es)?\b/i,because:"players guess"},{pattern:/\bstreak\b/i,because:"tracks streaks"}]},{archetype:"timed_round",signals:[{pattern:/\bcountdown\b|\btimer\b/i,because:"runs a countdown"},{pattern:/\bround\b/i,because:"is organised into rounds"}]}];function dM(e){let t=e.map(s=>s.text).join(`
|
|
11259
|
+
`),r=lM.map(s=>{let d=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:d.length,because:d}}).filter(s=>s.hits>0).sort((s,d)=>d.hits-s.hits),o=r[0];if(!o)return null;let n=r[1]?.hits??0,i=o.hits-n,a=o.hits>=3&&i>=2?"high":o.hits>=2?"medium":"low";return{archetype:o.archetype,confidence:a,because:o.because}}async function uM(e,t){let o=(await Sb(e)).isFile()?null:e;if(o)try{let i=await Fl(Eb(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},d=s.next?"Next.js":s.react?"React":s.vue?"Vue":s.svelte?"Svelte":void 0,l=s.vite?"Vite":s.webpack?"webpack":void 0;return{kind:"node_project",framework:d,build:l}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(i=>/\.html?$/.test(i.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function q0(e){let{files:t,skipped:r}=await oM(e);if(t.length===0)throw new Error(r.length>0?`No inspectable source found at ${e}. Everything found there is a generated Gamestage client bundle (${r.map(m=>m.file).join(", ")}), not a game. Point inspect at the game itself.`:`No inspectable source found at ${e}. Point inspect at a game file or a project directory.`);let o=await uM(e,t),n=dM(t),i=[];for(let m of sM){let y=[];for(let x of t){for(let O of m.patterns){let M=iM(x,O);if(M){y.push(M);break}}if(y.length>=3)break}if(y.length>0){let x=n?m.remedies?.[n.archetype]??m.remedy:m.remedy;i.push({...x?{remedy:x}:{},id:m.id,title:m.title,detail:m.detail,evidence:y})}}let a=t.map(m=>m.text).join(`
|
|
11260
|
+
`),s=cM.filter(m=>!m.present.test(a)).map(m=>({id:m.id,title:m.title,detail:m.detail,evidence:[]})),d=[];t.some(m=>/<(div|section|main|canvas)/i.test(m.text))&&d.push({id:"presentation",title:"Player-facing presentation",detail:"Layout, styling and interaction feel can stay creator-owned. Gamestage replaces the authority beneath the interface, not the interface itself.",evidence:t.slice(0,2).map(m=>({file:m.relative}))});let p=Dl(t),h=[];return o.kind==="standalone_html"&&h.push("Where is this deployed today, and who owns that hosting?"),h.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),i.some(m=>m.id==="client-play-limit")?h.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&h.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: `backend.round.attemptsAllowed` defaults to 10 when left out, and that number is then the game a fan plays. Choose it deliberately, and if the prototype allowed unlimited tries, tell the developer the game has changed."),{target:e,scanned_files:t.length,stack:o,keep:d,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await aM(e,t),skipped:r}}Ne();var yM={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},bM=new Set(["players make picks","selects from a roster","players guess"]);function vM(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,r=Bt.includes(t),o=e.because.filter(n=>!bM.has(n));return r&&o.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:r?yM[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var wM=e=>gM(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",_M=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function kM(e,t){let r=wM(e.name??e.target),o=t&&NE(t)?t:Wc(r),n=e.name??_M(r),i=xc(o,n);return i.manifest.conformance="L0",i.app.status="proposed",i.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],i.experience.status="proposed",i.experience.surfaces=["web-embed"],i.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.archetype&&(i.backend.status="proposed",i.backend.route="managed_runtime",i.backend.archetype=e.archetype.archetype,i.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(s=>s.id==="client-play-limit"||s.id==="client-scoring")&&(i.identity.status="proposed",i.identity.provider="identify",i.identity.require_authenticated_writes=!0),jn.parse(i)}async function xM(e,t){let r=await Le();if(!r)return!1;yo();let o=e.backend.archetype;if(!o)return!1;let i=await fr({baseUrl:De,token:r.accessToken}).registerGame({id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:`sha256:${fM("sha256").update(t).digest("hex")}`,conformance:vt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:ao.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function SM(e){try{let t=so.load(await pM(e,"utf8"));if(!t||typeof t!="object")return;let r=t.app;return typeof r?.id=="string"&&r.id.trim()?r.id:void 0}catch{return}}async function EM(e){try{return await hM(e),!0}catch{return!1}}async function J0(e,t){let r;try{r=await q0(e)}catch(p){return K(p instanceof Error?p.message:"Inspection failed")}let o=kM(r,await SM(typeof t.write=="string"?t.write:"gamestage.yaml")),n=vM(r.archetype),i=vt(o);o.manifest.conformance=i.computed;let a=Ri(o),s=!1,d,l=null;if(t.write){if(l=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await EM(l))return K(`${l} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${A.cyan(ie(`manifest validate ${l}`))} check what you have`,`${A.cyan(ie("inspect . --force"))} replace it anyway`]);await mM(l,a,"utf8");try{s=await xM(o,a)}catch(p){d=p instanceof Error?p.message:"The control plane did not answer."}}if(J()){te({ok:!0,report:r,format_match:n,manifest:o,conformance:{computed:i.computed,blockers:i.blockers},manifest_yaml:a,written_to:l,registered:s,...d?{registration_failed:d}:{}});return}if(U(`Inspection report ${A.dim(r.target)}`),R("Files inspected",String(r.scanned_files)),R("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),n.matched&&r.archetype?(R("Format",r.archetype.archetype),g(` ${" ".repeat(18)} ${A.dim(r.archetype.because.join("; "))}`)):n.nearest?(R("Format",A.yellow("none of the served formats marks this game")),g(),g(` The formats are ${Bt.join(", ")}. Each is one rule an`),g(" Engine marks plays against, and this game's rule is not among them."),g(),g(` Nearest: ${A.cyan(n.nearest)}, which ${n.differs}.`),g(" Building on it would judge fans by a rule their game never had."),g()):(R("Format",A.yellow("not recognised from this code")),g(),g(" Nothing in what was read says which of the served formats this is, and"),g(" that is a reading of the code rather than a verdict on the game."),g(` They are ${Bt.join(", ")}.`),g()),n.matched||(g(" Tell us the rule we do not have. It needs no account and sends"),g(" nothing until you add --send:"),g(` ${A.cyan(ie(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),r.skipped.length){U("Skipped");for(let p of r.skipped)E(`${A.dim(p.file)} \u2014 not scanned`),g(` ${A.dim(p.reason)}`)}if(r.keep.length){U("Keep as yours");for(let p of r.keep)E(A.green(p.title)),g(` ${A.dim(p.detail)}`)}if(r.move_behind_authority.length){U("Must move behind an authoritative boundary");for(let p of r.move_behind_authority){E(A.yellow(p.title)),g(` ${A.dim(p.detail)}`);for(let h of p.evidence.slice(0,2)){let m=h.line?`${h.file}:${h.line}`:h.file;g(` ${A.dim("\u2192")} ${A.cyan(m)}${h.excerpt?A.dim(" "+h.excerpt):""}`)}p.remedy&&(g(` ${A.dim("delete")} ${p.remedy.delete}`),g(` ${A.dim("call")} ${A.cyan(p.remedy.call)}`),p.remedy.render&&g(` ${A.dim("render")} ${p.remedy.render}`),p.remedy.move&&g(` ${A.dim("move")} ${p.remedy.move}`),g(` ${A.dim("keep")} ${p.remedy.keep}`))}}if(r.missing_integrations.length){U("Platform integrations not present yet");for(let p of r.missing_integrations)E(p.title),g(` ${A.dim(p.detail)}`)}if(r.unknowns.length){U("Needs a human answer");for(let p of r.unknowns)E(p,"?")}if(U("App Manifest"),R("Conformance",`${i.computed} ${i.computedName}`),i.blockers.length){g(),g(A.dim(" To reach the next level:"));for(let p of i.blockers)g(` ${A.dim("\xB7")} ${p.requirement}`)}g(),l?(g(` Written to ${A.cyan(l)}`),!n.matched&&n.nearest&&g(A.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),g(s?" Registered in Studio as a draft.":d?` Not registered in Studio: ${d} (${De})`:" No account found, so registration was skipped.")):(g(A.dim(" Nothing written and nothing registered. Re-run with --write to save")),g(A.dim(" this manifest and register the game."))),g()}var X0="https://github.com",TM="https://api.github.com",Gl=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function Q0(){let e=await fetch(`${X0}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Gl,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function eA(e){let r=await(await fetch(`${X0}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Gl,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await $M(r.access_token)};switch(r.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:r.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${r.error}).`)}}async function $M(e){let t=await fetch(`${TM}/user`,{headers:{accept:"application/vnd.github+json",authorization:`Bearer ${e}`,"user-agent":"gamestage-cli"}});if(!t.ok)throw new Error(`GitHub would not identify the account (${t.status}).`);let r=await t.json();if(!r.login)throw new Error("GitHub returned an account with no login.");return r.login}At();Ne();var AM=e=>new Promise(t=>setTimeout(t,e));async function tA(){let{client:e}=await Te();try{let t=await Q0();J()?te({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Gl}):(U("Link GitHub"),g(),E("This proves who you are. We read your GitHub login and nothing else."),E("No access to your code is requested, and none is stored."),E("It is optional: a deploy does not require it."),g(),R("Code",t.user_code),R("Open",t.verification_uri),g(),E("Enter the code on that page. This waits until you do."),g());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await AM(o*1e3);let n=await eA(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return K("You declined the request on GitHub.");if(n.status==="expired")return K("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(J())return te({ok:!0,status:"linked",github:i.github});U("Linked"),R("Account",n.login),g(),E("Your first deploy is no longer gated. Run `gamestage deploy`."),g();return}K("The code expired before it was entered.")}catch(t){Ce(t)}}yr();At();Ne();we();var IM=e=>new Promise(t=>setTimeout(t,e));function CM(e){process.stderr.write(JSON.stringify({ok:!0,status:"awaiting_approval",user_code:e.user_code,verification_uri:e.verification_uri,verification_uri_complete:e.verification_uri_complete,expires_in:e.expires_in},null,2)+`
|
|
11261
|
+
`)}async function nA(e,t,r){let{client:o}=await Te(),n=await Hc(o),i=Fi(n),a=n.access==="approved"||n.access==="pending"?n.workspace:void 0,s=a!==void 0&&!iS(a),d;if(r&&(d=await o.getWorkspace().then(l=>l.id).catch(()=>{})),J()){te({ok:i.ok,status:i.status,access:i.access,...i.code?{code:i.code}:{},message:i.message,next:i.next,email:e.email,...t?{stored_in:t}:{},control_plane:De,...s?{terms:{accepted:!1,url:Ac,version:$c}}:{}}),i.ok||process.exit(1);return}g(),U("Signed in"),R("Account",e.email??e.userId??"unknown"),t&&R("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),g(),E("Never written into the project, and never passed to your agent."),E("`gamestage logout` removes it."),r&&d&&d!==r?(g(),U("Not the workspace you asked for"),R("You asked for",r),R("You are in",d),g(),E("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&d&&R("Workspace",d),bo(i),s&&(U("Terms of Service"),g(` ${PM}`),g()),i.ok||process.exit(1)}var PM=`Read the Gamestage Terms of Service at ${Ac} and accept them at ${oS} before your account can be approved or a game deployed. You must accept them yourself in a browser; an agent cannot accept them for you.`;async function rA(e){let t=await Le();if(t){await nA(t,void 0,e);return}let r;try{r=await $E()}catch(s){K("Could not reach the sign-in service.",[String(s)])}if(J())CM(r);else{U("Sign in to Gamestage"),g(" This also creates your account if you do not have one. Google or email."),g(" A new account is approved by a person, so this may end in a wait."),g(" Taking a while? Email support@monterosa.co."),g(),R("Open",r.verification_uri_complete),R("Or enter",`${r.user_code} at ${r.verification_uri}`);let s=!!process.env.GAMESTAGE_CREDENTIALS;s&&(g(),g(" Signing in to a second credential file, so this does NOT open a browser."),E("Opening it here would hand the address to the browser you are already signed in to, which approves as that account instantly and with nothing to click."),E("Copy the address above into a private window and approve it there."),E("Signing out at auth.gamestage.ai first works too.")),g(),g(" Waiting for you to confirm in the browser..."),s||IE(r.verification_uri_complete)}let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await IM(n);let s=await AE(r.device_code);if(s.status==="ok"){i=s.session;break}if(s.status==="slow_down"){n+=5e3;continue}s.status!=="pending"&&(s.status==="expired"&&K("That code expired.",["Run `gamestage login` again."]),K("Sign-in was refused.",[s.reason]))}i||K("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await Wg(i);await nA(i,a,e)}async function oA(){let e=await Le();if(await PE(),J()){te({ok:!0,status:e?"signed_out":"not_signed_in"});return}U(e?"Signed out":"Not signed in"),e&&R("Removed",e.email??"session"),g()}async function iA(){let e=await Le();if(J()){te(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){U("Not signed in"),g(),E("Inspecting, scaffolding and local rounds need no account."),E("Run `gamestage login` when you want to deploy a playground."),g();return}U("Signed in"),R("Account",e.email??"unknown"),e.userId&&R("User",e.userId),g(),E("`gamestage status` says whether this account is approved."),g()}we();yr();import{readdir as OM,readFile as aA,stat as NM}from"node:fs/promises";Ne();import{homedir as RM}from"node:os";import{join as LM}from"node:path";async function DM(e){let t=[];try{t=await OM(e)}catch{}let r=t.filter(a=>!a.startsWith(".")),o=[];for(let a of r)/\.html?$/.test(a)&&o.push(a);let n=!1,i;for(let a of["gamestage.yaml","gamestage.yml"])try{await NM(`${e}/${a}`),n=!0;try{let s=Fe(await aA(`${e}/${a}`,"utf8"));s.ok&&(i=!!s.manifest.backend.round)}catch{}break}catch{}return{has_manifest:n,has_package_json:r.includes("package.json"),html_files:o,is_empty:r.length===0,has_round:i}}function jM(e,t){let r=[],o="";for(let n of e.split(" "))o&&o.length+1+n.length>t?(r.push(o),o=n):o=o?`${o} ${n}`:n;return o&&r.push(o),r}async function MM(){try{return(await aA(LM(RM(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function sA(){let e=process.cwd(),t=await DM(e),r=t.has_manifest?t.has_round===!1?"round":t.has_round===!0?"play":"continue":t.has_package_json||t.html_files.length>0?"inspect":"create",o={continue:{command:ie("manifest validate gamestage.yaml"),why:"This project already has an App Manifest. Check where it stands.",prompt:"Tell me where this Gamestage project stands. Run `npx gamestage manifest validate gamestage.yaml` and `npx gamestage status`, then summarise what is done and what is left before it could go live."},round:{command:"edit gamestage.yaml, add backend.round",why:`The manifest names a format but no round, so there is no game for the Engine to serve yet. The round is the content the server owns: the board a player sees and the answers they never do. Until it is there, \`${ie("dev")}\` serves the contract fixture rather than your game, and \`${ie("verify")}\` has nothing to verify. Both need an account, so \`${ie("login")}\` comes first.`,prompt:"This project has a Gamestage manifest with no round yet. Write one into gamestage.yaml from the game's own content so `gamestage dev` can serve it locally, and keep every answer out of the page and out of anything the browser downloads. A deployed game takes its round from Studio instead, where a producer changes it without a deploy: the manifest round is for developing against, not the content you ship."},play:{command:ie("dev"),why:`The manifest declares a round. Serve it locally, through the real Engine. Needs an account, so \`${ie("login")}\` first if you have not.`,prompt:"Serve this Gamestage game locally with `npx gamestage dev`, open it, and make a play. Then tell me whether the Engine decided the outcome or the page did."},inspect:{command:ie("inspect ."),why:"There is a game here already. Read it read-only and produce an inspection report.",prompt:"Take the game in this folder to production with Gamestage. Start with `npx gamestage inspect .`, which changes nothing, and tell me what has to move out of the page before you edit anything."},create:{command:ie("create"),why:"Nothing to inspect. Start a new game from a concept.",prompt:"Build me a new game with Gamestage. Ask me which format it should be and what it is about before you scaffold anything, rather than choosing for me."}},n=await Le().catch(()=>null);if(J()){te({ok:!0,cwd:e,version:Pt,detected:t,route:r,next:o[r],prompt:o[r].prompt,docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:Fc(),account:{signed_in:!!n?.email,email:n?.email??null,sign_in:ie("login")},authentication:n?.email?`Signed in as ${n.email}. \`${ie("deploy")}\` also needs the account approved; \`${ie("status")}\` says whether it is.`:`Not signed in. \`${ie("inspect")}\`, \`${ie("create")}\` and \`${ie("manifest validate")}\` work without an account, so do that work now. \`${ie("dev")}\`, \`${ie("verify")}\` and \`${ie("deploy")}\` refuse until \`${ie("login")}\`, which creates the account too. Tell the person once, when you reach the first command that needs it.`});return}U(`Gamestage ${Pt}`);let i=zi?await MM():null;if(i&&zi&&i<zi&&g(A.dim(` Your installed Gamestage skill is ${i}; the current one is ${zi}.
|
|
11262
11262
|
Refresh it: `)+A.cyan("npx skills add https://gamestage.ai/skill")),g(A.dim(" Take an agent-built game to production, on the platform behind the")),g(A.dim(" world's biggest fan experiences.")),U("What this does"),g(A.dim(` Your game keeps its interface. Its answers, scoring and locks move
|
|
11263
11263
|
behind an Engine the player's browser cannot reach, so nobody can read
|
|
11264
11264
|
the answer out of the page or award themselves a score.`)),g(),g(` ${A.dim("A")} ${A.cyan("round")} ${A.dim("is one playable thing: a board, a question, a slate.")}`),g(` ${A.dim("Your")} ${A.cyan("manifest")} ${A.dim("is gamestage.yaml, which describes the game.")}`),g(` ${A.dim("The")} ${A.cyan("Engine")} ${A.dim("marks a play, holds the score and refuses a cheat.")}`),U("Who you are"),n?.email?(R("Signed in",n.email),g(A.dim(` ${ie("status")} names your workspace and whether it is approved.`)),g(A.dim(` If that is not the account you signed up with, ${ie("login")} rebinds
|
|
11265
|
-
this machine. Stage shows the command with your workspace in it.`))):(g(` Not signed in. ${A.cyan(ie("login"))} binds this machine to your account,`),g(" and creates the account if you do not have one."),g(A.dim(" Inspect, create and validate need no account, so start there.")),g(A.dim(` ${ie("dev")}, ${ie("verify")} and ${ie("deploy")} ask you to sign in first.`))),U("Where you are"),t.has_manifest&&t.has_round===!1)g(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)g(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)g(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let a=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);g(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else g(" Nothing here yet. This looks like a fresh start.");if(U("Do this next"),g(` ${A.cyan(o[r].command)}`),g(` ${A.dim(o[r].why)}`),r==="create"||r==="inspect"){g(),g(` ${A.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of
|
|
11265
|
+
this machine. Stage shows the command with your workspace in it.`))):(g(` Not signed in. ${A.cyan(ie("login"))} binds this machine to your account,`),g(" and creates the account if you do not have one."),g(A.dim(" Inspect, create and validate need no account, so start there.")),g(A.dim(` ${ie("dev")}, ${ie("verify")} and ${ie("deploy")} ask you to sign in first.`))),U("Where you are"),t.has_manifest&&t.has_round===!1)g(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)g(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)g(" An App Manifest is already present.");else if(t.has_package_json||t.html_files.length){let a=[t.has_package_json?"a Node project":null,t.html_files.length?`${t.html_files.length} HTML file(s)`:null].filter(Boolean);g(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else g(" Nothing here yet. This looks like a fresh start.");if(U("Do this next"),g(` ${A.cyan(o[r].command)}`),g(` ${A.dim(o[r].why)}`),r==="create"||r==="inspect"){g(),g(` ${A.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of YE)g(` ${A.cyan(a.padEnd(10))} ${A.dim(s)}`)}g(),g(` ${A.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let a of jM(o[r].prompt,74))g(` ${A.cyan(a)}`);U("Good to know"),g(A.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
|
|
11266
11266
|
need you signed in, because they run your round through a real
|
|
11267
11267
|
Engine. \`gamestage login\` creates the account if you do not have
|
|
11268
|
-
one yet. ${zk}`)),g()}var Oo=class extends Error{};function sA(e){let t=e.what.trim();if(!t)throw new Oo("Say what you were trying to build.");if(t.length>2e3)throw new Oo(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function cA(e){return JSON.stringify(e,null,2)}async function Bl(e,t,r=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let o=t[Symbol.asyncIterator](),n,i=Symbol("nothing came"),a=await Promise.race([o.next(),new Promise(l=>{n=setTimeout(()=>l(i),r)})]);if(clearTimeout(n),a===i||a.done)return o.return?.().catch(()=>{}),e??"";let s=[lA(a.value)];for(let l=await o.next();!l.done;l=await o.next())s.push(lA(l.value));let d=s.join("");return d.trim()?d:e??""}function lA(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Ne();var UM=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function dA(e,t,r,o=process.stdin){let n=await Bl(e,o),i;try{i=sA({what:n,closest:t.closest,cliVersion:r})}catch(d){throw d instanceof Oo&&K(d.message),d}if(!t.send){if(J()){te({sent:!1,would_send:i});return}U("This is everything that would be sent"),g(),g(cA(i)),g(),E("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),E(n===e?`Send it with ${ie('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ie("suggest --send")}.`);return}let a;try{a=await fetch(UM,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(d){K("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let s=await a.json().catch(()=>({}));if(a.ok||K(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){te({sent:!0,reference:s.reference??null});return}U("Sent"),s.reference&&E(`Reference ${s.reference}. Quote it if you follow up.`),E("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var No=class extends Error{};function uA(e){let t=e.what.trim();if(!t)throw new No("Say what went wrong.");if(t.length>2e3)throw new No(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function pA(e){return JSON.stringify(e,null,2)}Ne();var zM=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function hA(e,t,r,o=process.stdin){let n=await Bl(e,o),i;try{i=uA({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(d){throw d instanceof No&&K(d.message),d}if(!t.send){if(J()){te({sent:!1,would_send:i});return}U("This is everything that would be sent"),g(),g(pA(i)),g(),E("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),E(n===e?`Send it with ${ie('issue "..." --send')}.`:`Send it by piping the same text again, with ${ie("issue --send")}.`);return}let a;try{a=await fetch(zM,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(d){K("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let s=await a.json().catch(()=>({}));if(a.ok||K(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){te({sent:!0,reference:s.reference??null});return}U("Reported"),s.reference&&E(`Reference ${s.reference}. Quote it if you follow up.`),E("It is in the backlog now. Somebody at Monterosa reads these.")}we();At();Ne();import{readFile as FM}from"node:fs/promises";import{resolve as GM}from"node:path";async function mA(e){let t=GM(e),r;try{r=await FM(t,"utf8")}catch{K(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){K(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=dn.safeParse(o);if(!n.success){let i=n.error.issues[0];K(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function BM(e){let t=dn.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var WM={copy:"immutable copy",pointer:"reference data"};async function KM(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||K(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function fA(e,t,r={}){let{client:o}=await Te(),{body:n}=await mA(t),i=Rc(n),a=Rg(n),s=await o.getDataset(e).catch(()=>{}),d=a.ok?eE(s?.dataset?.scored,a.summary):[];d.length&&!r.dropScoring&&K(`This push would stop ${d.join(", ")} scoring rounds.`,[`The live ${e} gives ${d.join(", ")} a scoring block and ${t} does not.`,"Add the block back, or pass --drop-scoring if removing it is the point."]);let l=await o.referenceUploadTarget(e,i),p=await QS(n,async(y,x)=>{await KM(y==="copy"?l.copy:l.pointer,x,WM[y])});p.ok||K(`${t} is not valid reference data.`,[p.detail??"No detail."]);let{measures:h,counts:m}=p.summary;if(J())return te({ok:!0,name:e,digest:i,measures:h,counts:m,key:l.pointer.key});U("Pushed"),E(`${e} is now the reference data for this workspace`);for(let y of h)E(`${y}: ${m[y].toLocaleString("en-GB")} values`);E(`Digest ${i}, kept so a round can say what it was scored on`),g(),E("A round provisioned from now on uses this. One already in play keeps"),E("the numbers it opened with, which is deliberate.")}async function gA(e,t){let{body:r,measures:o}=await mA(e),n=BM(r),i=dn.parse(JSON.parse(r)),a={};for(let s of i.measures){let d=t.filter(l=>typeof s.values[l]!="number");d.length&&(a[s.key]=d)}if(J())return te({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});U("Reference data");for(let s of o)E(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){g(),E("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(g(),!Object.keys(a).length){E(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,d]of Object.entries(a))E(`${s} has no value for ${d.map(l=>`"${l}"`).join(", ")}`);K("A round using those keys would be refused rather than scoring them as nothing.")}we();At();Ne();function HM(e,t){return e.map(({supplier:r,entitlement:o})=>{let n=t.filter(d=>(d.supplier??(d.origin==="push"?"push":void 0))===r.id).map(d=>d.name),i=r.catalogue,a=i?.needsKey??!1,s=o.allowed?n.length>0?"connected":i?.fetched===!1?"listed, not fetched yet":a?"available, needs a key":"available":"not available to you";return{id:r.id,label:r.label,state:s,...o.allowed?{}:{reason:o.reason??""},offers:i?.offers??r.note,competitions:i?.competitions??[],cost:i?.cost??"",needsKey:a,...i?.signUp?{signUp:i.signUp}:{},licence:i?.licence??r.note,...Mi(r)?{caveat:Mi(r)}:{},datasets:n}})}async function yA(){let{client:e}=await Te(),[t,r]=await Promise.all([e.getWorkspace(),e.listDatasets()]),o=HM(GS(FS(t),un),r.datasets);if(J())return te({ok:!0,sources:o});U("Where a game's real-world values can come from");for(let n of o)g(),R(n.label,n.state),E(n.offers),n.competitions.length&&E(`Covers: ${n.competitions.join(", ")}`),n.cost&&E(`Cost: ${n.cost}`),E(`Licence: ${n.licence}`),n.caveat&&E(n.caveat),n.datasets.length&&E(`In this workspace: ${n.datasets.join(", ")}`),n.state==="available, needs a key"&&(n.signUp&&E(`Sign up: ${n.signUp}`),E(`Then: \`gamestage sources connect ${n.id}\`, which opens a page for your key. Never paste a key into a chat.`)),n.reason&&E(n.reason);g(),E("Values stay on the server. A fan's browser only ever receives names and results.")}we();At();Ne();Kc();import{spawn as VM}from"node:child_process";function Wl(e){let t=un.find(r=>r.id===e);if(!t?.catalogue?.needsKey){let r=un.filter(o=>o.catalogue?.needsKey).map(o=>o.id);K(`${e} is not a source you connect with a key.`,[r.length?`Sources that take your own key: ${r.join(", ")}.`:"No source takes a key yet.","`gamestage sources` lists them all."])}return t}function ZM(e){return`${Ut}/stage/data/sources/${encodeURIComponent(e)}`}var YM=/^op:\/\/[^\s/]+\/[^\s/]+(\/[^\s/]+)?\/[^\s/]+$/;function qM(e,t=VM){return new Promise(r=>{let o="",n=!1,i=s=>{n||(n=!0,r(s))},a;try{a=t("op",["read","--no-newline",e],{shell:!1,stdio:["ignore","pipe","ignore"]})}catch{i({ok:!1,reason:"The 1Password CLI (op) is not installed or not on your PATH."});return}a.stdout?.on("data",s=>{o+=s.toString("utf8")}),a.on("error",s=>i({ok:!1,reason:s.code==="ENOENT"?"The 1Password CLI (op) is not installed or not on your PATH.":"The 1Password CLI could not be started."})),a.on("close",s=>{let d=o.trim();i(s===0&&d?{ok:!0,value:d}:{ok:!1,reason:"1Password did not return that secret. Check the reference, and that you are signed in to op and approved the read."})})})}async function bA(e,t={}){if(t.fromOp!==void 0)return JM(e,t.fromOp);let r=Wl(e),o=ZM(e);if(J()){te({ok:!0,source:e,connect_url:o,sign_up:r.catalogue?.signUp??null});return}U(`Connect ${r.label}`),R("Open",o),E("Paste your API key on that page, in your own browser. It goes straight to Gamestage and is stored in AWS Secrets Manager."),E("This command never asks for the key, so the coding agent running it never sees it. Do not paste a key into a chat."),r.catalogue?.signUp&&E(`No key yet? Sign up at ${r.catalogue.signUp}`),E(`When it says Connected, \`gamestage sources status ${e}\` shows what your plan covers.`),g()}async function vA(e,t){let r=await Fn(),o=await fetch(`${De}/v1/sources/${encodeURIComponent(e)}/key`,{method:t,headers:{authorization:`Bearer ${r.accessToken}`,accept:"application/json"}}).catch(()=>{});o||K("Could not reach Gamestage.",["Check your connection and try again."]);let n=await o.json().catch(()=>({}));return o.ok||K(n.error?.message??`Gamestage answered ${o.status}.`,[]),n}function wA(e,t){if(J()){te({ok:!0,source:e,...t});return}if(U(e),R("State",t.state==="connected"?"connected":"not connected"),t.message&&E(t.message),t.coverage?.length){let r=t.coverage.slice(0,12);E(`Your plan covers: ${r.join(", ")}${t.coverage.length>r.length?`, and ${t.coverage.length-r.length} more`:""}.`)}t.state!=="connected"&&E(`\`gamestage sources connect ${e}\` gives you the link to add a key.`),g()}async function _A(e){Wl(e),wA(e,await vA(e,"GET"))}async function kA(e){Wl(e),wA(e,await vA(e,"DELETE"))}async function JM(e,t,r=qM){Wl(e),YM.test(t)||K("--from-op takes a 1Password reference, such as op://Vault/Item/field.",["It never takes a key itself. To paste a key instead, open the page `gamestage sources connect "+e+"` prints."]);let o=await Fn(),n=await r(t);n.ok||K(n.reason,[]);let i;try{i=await fetch(`${De}/v1/sources/${encodeURIComponent(e)}/key`,{method:"PUT",headers:{authorization:`Bearer ${o.accessToken}`,"content-type":"application/json",accept:"application/json","x-gamestage-via":"cli"},body:JSON.stringify({key:n.value})})}catch{i=void 0}i||K("Could not reach Gamestage.",["Check your connection and try again."]);let a=await i.json().catch(()=>({})),s=p=>p.split(n.value).join("[key]");(i.status===422||a.state==="rejected")&&K(`${e} refused that key. Check the 1Password item holds the whole API token, then try again.`,[]),i.status===429&&K("Too many attempts to connect a key in the last hour. Wait an hour, then try again.",[]),(i.status===401||i.status===403)&&K("Gamestage did not accept your session.",["Run `gamestage login`, then try again."]),i.ok||K(`Gamestage could not connect the key (HTTP ${i.status}). Try again in a minute.`,[]);let d=(a.coverage??[]).map(s),l=/^[A-Za-z0-9]{4}$/.test(a.keyEnding??"")?a.keyEnding:n.value.slice(-4);if(J()){te({ok:!0,source:e,state:"connected",key_ending:l,coverage:d});return}U("Connected"),R("Key ending",l),d.length?E(`Your plan covers: ${d.join(", ")}.`):E("Your plan covers no competitions yet."),g()}we();At();Ne();import{readFile as XM}from"node:fs/promises";import{resolve as QM}from"node:path";import{createInterface as e2}from"node:readline/promises";async function t2(e){let t;try{t=await XM(QM(e),"utf8")}catch{K(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=Fe(t);r.ok||K(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||K(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&K("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function n2(e){if(U("What goes into Studio"),E(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){E(e.target===void 0?"Target: left blank, so the round is built backwards from a perfect line at provisioning":`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)E(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);g(),g("No point values go with it. They stay in your reference data, where only"),g("the Engine reads them.")}else if(e.archetype==="shoot")E(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),E(`Keeper: ${e.difficulty}`),g(),g("Nothing here is an answer. The keeper is decided by the Engine at play time,"),g("from entropy it minted when the round was provisioned.");else{if(E(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")E(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)E(`${t.label}: ${t.members.join(", ")}`);g(),g("The answer goes with it, into a field Studio withholds from a fan's browser."),g("Only a producer signed into Studio can read it.")}g()}async function r2(e,t){if(t)return!0;process.stdin.isTTY||K("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=e2({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function xA(e,t){let r=t.manifest??"gamestage.yaml",o=await t2(r),n=o.archetype==="push"?hS(o):o;if(J()||n2(n),!await r2(e,!!t.yes)){g("Nothing was written.");return}try{let{client:i}=await Te(),a=await i.seedRound(e,n);a.refused&&K("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};te({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),J()||(U("Written"),E(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),E("A producer can change every word of it without another deploy."),E("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),g())}catch(i){Ce(i)}}async function SA(e){try{let{client:t}=await Te(),r=await t.refreshRound(e);r.refused&&K("The round was not refreshed.",[r.refused]);let o=(r.game.logs??[]).slice(-3);if(te({game:e,refreshed:!0,logs:o}),!J()){U("Refreshed");for(let n of o)E(n.message);g()}}catch(t){Ce(t)}}var Kl={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},Hl=`
|
|
11268
|
+
one yet. ${Fk}`)),g()}var Oo=class extends Error{};function cA(e){let t=e.what.trim();if(!t)throw new Oo("Say what you were trying to build.");if(t.length>2e3)throw new Oo(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let r=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:r||"none",cli_version:e.cliVersion}}function lA(e){return JSON.stringify(e,null,2)}async function Bl(e,t,r=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let o=t[Symbol.asyncIterator](),n,i=Symbol("nothing came"),a=await Promise.race([o.next(),new Promise(l=>{n=setTimeout(()=>l(i),r)})]);if(clearTimeout(n),a===i||a.done)return o.return?.().catch(()=>{}),e??"";let s=[dA(a.value)];for(let l=await o.next();!l.done;l=await o.next())s.push(dA(l.value));let d=s.join("");return d.trim()?d:e??""}function dA(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Ne();var UM=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function uA(e,t,r,o=process.stdin){let n=await Bl(e,o),i;try{i=cA({what:n,closest:t.closest,cliVersion:r})}catch(d){throw d instanceof Oo&&K(d.message),d}if(!t.send){if(J()){te({sent:!1,would_send:i});return}U("This is everything that would be sent"),g(),g(lA(i)),g(),E("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),E(n===e?`Send it with ${ie('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ie("suggest --send")}.`);return}let a;try{a=await fetch(UM,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(d){K("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let s=await a.json().catch(()=>({}));if(a.ok||K(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){te({sent:!0,reference:s.reference??null});return}U("Sent"),s.reference&&E(`Reference ${s.reference}. Quote it if you follow up.`),E("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var No=class extends Error{};function pA(e){let t=e.what.trim();if(!t)throw new No("Say what went wrong.");if(t.length>2e3)throw new No(`That is ${t.length} characters and the limit is 2000. Send what broke and how to hit it; we will ask for the rest.`);let r=(e.game??"").trim();return{kind:"issue",what:t,game:r||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function hA(e){return JSON.stringify(e,null,2)}Ne();var zM=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function mA(e,t,r,o=process.stdin){let n=await Bl(e,o),i;try{i=pA({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(d){throw d instanceof No&&K(d.message),d}if(!t.send){if(J()){te({sent:!1,would_send:i});return}U("This is everything that would be sent"),g(),g(hA(i)),g(),E("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),E(n===e?`Send it with ${ie('issue "..." --send')}.`:`Send it by piping the same text again, with ${ie("issue --send")}.`);return}let a;try{a=await fetch(zM,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(d){K("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let s=await a.json().catch(()=>({}));if(a.ok||K(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),J()){te({sent:!0,reference:s.reference??null});return}U("Reported"),s.reference&&E(`Reference ${s.reference}. Quote it if you follow up.`),E("It is in the backlog now. Somebody at Monterosa reads these.")}we();At();Ne();import{readFile as FM}from"node:fs/promises";import{resolve as GM}from"node:path";async function fA(e){let t=GM(e),r;try{r=await FM(t,"utf8")}catch{K(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){K(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=dn.safeParse(o);if(!n.success){let i=n.error.issues[0];K(`${e} is not valid reference data.`,[i?`${i.path.join(".")||"document"}: ${i.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:r,measures:n.data.measures.map(i=>i.key)}}function BM(e){let t=dn.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var WM={copy:"immutable copy",pointer:"reference data"};async function KM(e,t,r){let o=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});o.ok||K(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function gA(e,t,r={}){let{client:o}=await Te(),{body:n}=await fA(t),i=Rc(n),a=Lg(n),s=await o.getDataset(e).catch(()=>{}),d=a.ok?tE(s?.dataset?.scored,a.summary):[];d.length&&!r.dropScoring&&K(`This push would stop ${d.join(", ")} scoring rounds.`,[`The live ${e} gives ${d.join(", ")} a scoring block and ${t} does not.`,"Add the block back, or pass --drop-scoring if removing it is the point."]);let l=await o.referenceUploadTarget(e,i),p=await eE(n,async(y,x)=>{await KM(y==="copy"?l.copy:l.pointer,x,WM[y])});p.ok||K(`${t} is not valid reference data.`,[p.detail??"No detail."]);let{measures:h,counts:m}=p.summary;if(J())return te({ok:!0,name:e,digest:i,measures:h,counts:m,key:l.pointer.key});U("Pushed"),E(`${e} is now the reference data for this workspace`);for(let y of h)E(`${y}: ${m[y].toLocaleString("en-GB")} values`);E(`Digest ${i}, kept so a round can say what it was scored on`),g(),E("A round provisioned from now on uses this. One already in play keeps"),E("the numbers it opened with, which is deliberate.")}async function yA(e,t){let{body:r,measures:o}=await fA(e),n=BM(r),i=dn.parse(JSON.parse(r)),a={};for(let s of i.measures){let d=t.filter(l=>typeof s.values[l]!="number");d.length&&(a[s.key]=d)}if(J())return te({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});U("Reference data");for(let s of o)E(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){g(),E("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(g(),!Object.keys(a).length){E(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,d]of Object.entries(a))E(`${s} has no value for ${d.map(l=>`"${l}"`).join(", ")}`);K("A round using those keys would be refused rather than scoring them as nothing.")}we();At();Ne();function HM(e,t){return e.map(({supplier:r,entitlement:o})=>{let n=t.filter(d=>(d.supplier??(d.origin==="push"?"push":void 0))===r.id).map(d=>d.name),i=r.catalogue,a=i?.needsKey??!1,s=o.allowed?n.length>0?"connected":i?.fetched===!1?"listed, not fetched yet":a?"available, needs a key":"available":"not available to you";return{id:r.id,label:r.label,state:s,...o.allowed?{}:{reason:o.reason??""},offers:i?.offers??r.note,competitions:i?.competitions??[],cost:i?.cost??"",needsKey:a,...i?.signUp?{signUp:i.signUp}:{},licence:i?.licence??r.note,...Mi(r)?{caveat:Mi(r)}:{},datasets:n}})}async function bA(){let{client:e}=await Te(),[t,r]=await Promise.all([e.getWorkspace(),e.listDatasets()]),o=HM(BS(GS(t),un),r.datasets);if(J())return te({ok:!0,sources:o});U("Where a game's real-world values can come from");for(let n of o)g(),R(n.label,n.state),E(n.offers),n.competitions.length&&E(`Covers: ${n.competitions.join(", ")}`),n.cost&&E(`Cost: ${n.cost}`),E(`Licence: ${n.licence}`),n.caveat&&E(n.caveat),n.datasets.length&&E(`In this workspace: ${n.datasets.join(", ")}`),n.state==="available, needs a key"&&(n.signUp&&E(`Sign up: ${n.signUp}`),E(`Then: \`gamestage sources connect ${n.id}\`, which opens a page for your key. Never paste a key into a chat.`)),n.reason&&E(n.reason);g(),E("Values stay on the server. A fan's browser only ever receives names and results.")}we();At();Ne();Kc();import{spawn as VM}from"node:child_process";function Wl(e){let t=un.find(r=>r.id===e);if(!t?.catalogue?.needsKey){let r=un.filter(o=>o.catalogue?.needsKey).map(o=>o.id);K(`${e} is not a source you connect with a key.`,[r.length?`Sources that take your own key: ${r.join(", ")}.`:"No source takes a key yet.","`gamestage sources` lists them all."])}return t}function ZM(e){return`${Ut}/stage/data/sources/${encodeURIComponent(e)}`}var YM=/^op:\/\/[^\s/]+\/[^\s/]+(\/[^\s/]+)?\/[^\s/]+$/;function qM(e,t=VM){return new Promise(r=>{let o="",n=!1,i=s=>{n||(n=!0,r(s))},a;try{a=t("op",["read","--no-newline",e],{shell:!1,stdio:["ignore","pipe","ignore"]})}catch{i({ok:!1,reason:"The 1Password CLI (op) is not installed or not on your PATH."});return}a.stdout?.on("data",s=>{o+=s.toString("utf8")}),a.on("error",s=>i({ok:!1,reason:s.code==="ENOENT"?"The 1Password CLI (op) is not installed or not on your PATH.":"The 1Password CLI could not be started."})),a.on("close",s=>{let d=o.trim();i(s===0&&d?{ok:!0,value:d}:{ok:!1,reason:"1Password did not return that secret. Check the reference, and that you are signed in to op and approved the read."})})})}async function vA(e,t={}){if(t.fromOp!==void 0)return JM(e,t.fromOp);let r=Wl(e),o=ZM(e);if(J()){te({ok:!0,source:e,connect_url:o,sign_up:r.catalogue?.signUp??null});return}U(`Connect ${r.label}`),R("Open",o),E("Paste your API key on that page, in your own browser. It goes straight to Gamestage and is stored in AWS Secrets Manager."),E("This command never asks for the key, so the coding agent running it never sees it. Do not paste a key into a chat."),r.catalogue?.signUp&&E(`No key yet? Sign up at ${r.catalogue.signUp}`),E(`When it says Connected, \`gamestage sources status ${e}\` shows what your plan covers.`),g()}async function wA(e,t){let r=await Fn(),o=await fetch(`${De}/v1/sources/${encodeURIComponent(e)}/key`,{method:t,headers:{authorization:`Bearer ${r.accessToken}`,accept:"application/json"}}).catch(()=>{});o||K("Could not reach Gamestage.",["Check your connection and try again."]);let n=await o.json().catch(()=>({}));return o.ok||K(n.error?.message??`Gamestage answered ${o.status}.`,[]),n}function _A(e,t){if(J()){te({ok:!0,source:e,...t});return}if(U(e),R("State",t.state==="connected"?"connected":"not connected"),t.message&&E(t.message),t.coverage?.length){let r=t.coverage.slice(0,12);E(`Your plan covers: ${r.join(", ")}${t.coverage.length>r.length?`, and ${t.coverage.length-r.length} more`:""}.`)}t.state!=="connected"&&E(`\`gamestage sources connect ${e}\` gives you the link to add a key.`),g()}async function kA(e){Wl(e),_A(e,await wA(e,"GET"))}async function xA(e){Wl(e),_A(e,await wA(e,"DELETE"))}async function JM(e,t,r=qM){Wl(e),YM.test(t)||K("--from-op takes a 1Password reference, such as op://Vault/Item/field.",["It never takes a key itself. To paste a key instead, open the page `gamestage sources connect "+e+"` prints."]);let o=await Fn(),n=await r(t);n.ok||K(n.reason,[]);let i;try{i=await fetch(`${De}/v1/sources/${encodeURIComponent(e)}/key`,{method:"PUT",headers:{authorization:`Bearer ${o.accessToken}`,"content-type":"application/json",accept:"application/json","x-gamestage-via":"cli"},body:JSON.stringify({key:n.value})})}catch{i=void 0}i||K("Could not reach Gamestage.",["Check your connection and try again."]);let a=await i.json().catch(()=>({})),s=p=>p.split(n.value).join("[key]");(i.status===422||a.state==="rejected")&&K(`${e} refused that key. Check the 1Password item holds the whole API token, then try again.`,[]),i.status===429&&K("Too many attempts to connect a key in the last hour. Wait an hour, then try again.",[]),(i.status===401||i.status===403)&&K("Gamestage did not accept your session.",["Run `gamestage login`, then try again."]),i.ok||K(`Gamestage could not connect the key (HTTP ${i.status}). Try again in a minute.`,[]);let d=(a.coverage??[]).map(s),l=/^[A-Za-z0-9]{4}$/.test(a.keyEnding??"")?a.keyEnding:n.value.slice(-4);if(J()){te({ok:!0,source:e,state:"connected",key_ending:l,coverage:d});return}U("Connected"),R("Key ending",l),d.length?E(`Your plan covers: ${d.join(", ")}.`):E("Your plan covers no competitions yet."),g()}we();At();Ne();import{readFile as XM}from"node:fs/promises";import{resolve as QM}from"node:path";import{createInterface as e2}from"node:readline/promises";async function t2(e){let t;try{t=await XM(QM(e),"utf8")}catch{K(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=Fe(t);r.ok||K(`${e} is not a valid App Manifest.`,r.issues.map(n=>`${n.path} ${n.message}`));let o=r.ok?r.manifest.backend.round:void 0;return o||K(`${e} has no round in it.`,["There is nothing to push. A round lives under `backend.round` while a game is","still being built locally; once it is in Studio it lives there instead."]),o.archetype==="predict"&&K("A prediction's question and options are authored in Studio itself.",["They are the platform's own question and options rather than fields of ours,","which is what lets a producer reveal the answer once the world decides. There","is nothing here to write, and nothing to write it with."]),o}function n2(e){if(U("What goes into Studio"),E(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){E(e.target===void 0?"Target: left blank, so the round is built backwards from a perfect line at provisioning":`Target: ${e.target.toLocaleString()} ${e.targetLabel}`.trim());for(let t of e.slates)E(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);g(),g("No point values go with it. They stay in your reference data, where only"),g("the Engine reads them.")}else if(e.archetype==="shoot")E(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),E(`Keeper: ${e.difficulty}`),g(),g("Nothing here is an answer. The keeper is decided by the Engine at play time,"),g("from entropy it minted when the round was provisioned.");else{if(E(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")E(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)E(`${t.label}: ${t.members.join(", ")}`);g(),g("The answer goes with it, into a field Studio withholds from a fan's browser."),g("Only a producer signed into Studio can read it.")}g()}async function r2(e,t){if(t)return!0;process.stdin.isTTY||K("Refusing to overwrite Studio without being asked.",[`Nothing has changed on ${e}.`,"Re-run with `--yes` if you mean to replace whatever a producer has typed."]);let r=e2({input:process.stdin,output:process.stdout});try{return(await r.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{r.close()}}async function SA(e,t){let r=t.manifest??"gamestage.yaml",o=await t2(r),n=o.archetype==="push"?mS(o):o;if(J()||n2(n),!await r2(e,!!t.yes)){g("Nothing was written.");return}try{let{client:i}=await Te(),a=await i.seedRound(e,n);a.refused&&K("The round was not written into Studio.",[a.refused]);let s=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:{count:n.board.length,noun:"picks on the board"};te({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),J()||(U("Written"),E(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),E("A producer can change every word of it without another deploy."),E("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),g())}catch(i){Ce(i)}}async function EA(e){try{let{client:t}=await Te(),r=await t.refreshRound(e);r.refused&&K("The round was not refreshed.",[r.refused]);let o=(r.game.logs??[]).slice(-3);if(te({game:e,refreshed:!0,logs:o}),!J()){U("Refreshed");for(let n of o)E(n.message);g()}}catch(t){Ce(t)}}var Kl={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},Hl=`
|
|
11269
11269
|
/* Prev and Next render as bordered web buttons on a graphic nobody can
|
|
11270
11270
|
click, next to "PAGE 1 OF 4". A director seeing browser chrome concludes
|
|
11271
11271
|
the feed is a screen-share rather than a broadcast source. */
|
|
@@ -11297,14 +11297,14 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11297
11297
|
.stat-label { font-size: calc(var(--row-h, 86px) * 0.22) !important; line-height: 1 !important; }
|
|
11298
11298
|
.stat-value { font-size: calc(var(--row-h, 86px) * 0.40) !important; line-height: 1 !important; }
|
|
11299
11299
|
|
|
11300
|
-
`,EA=`
|
|
11301
|
-
.leaderboard { border-width: 3px !important; }
|
|
11302
11300
|
`,TA=`
|
|
11301
|
+
.leaderboard { border-width: 3px !important; }
|
|
11302
|
+
`,$A=`
|
|
11303
11303
|
html[data-mode="embed"], html[data-mode="embed"] body, #root {
|
|
11304
11304
|
background: transparent !important;
|
|
11305
11305
|
}
|
|
11306
11306
|
body { padding: 0 !important; }
|
|
11307
|
-
`,o2=213;function
|
|
11307
|
+
`,o2=213;function AA(e,t,r){return`
|
|
11308
11308
|
/* On the root rather than on .entries, so everything inherits it. The
|
|
11309
11309
|
header's own numbers are sized from it too, and a custom property set on
|
|
11310
11310
|
the rows cannot be read by anything above them. */
|
|
@@ -11329,11 +11329,11 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11329
11329
|
88px score. */
|
|
11330
11330
|
.entry-rank { font-size: calc(var(--row-h) * 0.44) !important; font-weight: 700 !important; }
|
|
11331
11331
|
.table-header .col { font-size: ${r}px !important; }
|
|
11332
|
-
`}var
|
|
11332
|
+
`}var IA=`
|
|
11333
11333
|
.leaderboard, .leaderboard *, .header-area, .header-area * {
|
|
11334
11334
|
font-family: "Inter", "Helvetica Neue", Arial, "Liberation Sans", sans-serif !important;
|
|
11335
11335
|
}
|
|
11336
|
-
`,
|
|
11336
|
+
`,CA=`
|
|
11337
11337
|
/* The face is an attribute, not a rule. \`primaryFontUrl\` and
|
|
11338
11338
|
\`primaryFontFamily\` are the renderer's own mechanism and it loads the
|
|
11339
11339
|
stylesheet into a real <link>, so the graphic carries a known face instead
|
|
@@ -11505,7 +11505,7 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11505
11505
|
background: linear-gradient(90deg, rgba(255,107,61,0.14), rgba(255,107,61,0.05)) !important;
|
|
11506
11506
|
border-color: rgba(255,107,61,0.32) !important;
|
|
11507
11507
|
}
|
|
11508
|
-
`,
|
|
11508
|
+
`,PA=`
|
|
11509
11509
|
/* The ground goes on the element that already fills the screen.
|
|
11510
11510
|
*
|
|
11511
11511
|
* It was on #root, which is only as tall as its content, so a three-player
|
|
@@ -11622,7 +11622,7 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11622
11622
|
font-size: 3vmin !important;
|
|
11623
11623
|
line-height: 1 !important;
|
|
11624
11624
|
}
|
|
11625
|
-
`;function
|
|
11625
|
+
`;function OA(e){return`
|
|
11626
11626
|
#root {
|
|
11627
11627
|
--rows: ${e.rows};
|
|
11628
11628
|
--row-h: min(${e.maxRowPx}px, calc(${100-e.reserveVh}vh / var(--rows))) !important;
|
|
@@ -11633,8 +11633,8 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11633
11633
|
.entry-score { font-size: calc(var(--row-cap) * ${e.score}) !important; }
|
|
11634
11634
|
.entry-rank { font-size: calc(var(--row-cap) * ${e.rank}) !important; }
|
|
11635
11635
|
.table-header .col { font-size: ${e.header}vmin !important; }
|
|
11636
|
-
`}var
|
|
11637
|
-
`).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var a2=[{id:"lowerthird",summary:"A lower third over live video, for TV and streaming",madeFor:"A broadcast or stream, keyed over the picture",type:"leaderboard",attributes:{...Kl,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:Vl,cssOverrides:`${Hl}${
|
|
11636
|
+
`}var NA={primaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",primaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif',secondaryFontUrl:"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,600;0,700;1,700&display=swap",secondaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif'},Vl="#1E4B8F";function i2(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/[ \t]+/g," ").replace(/\n\s*\n+/g,`
|
|
11637
|
+
`).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var a2=[{id:"lowerthird",summary:"A lower third over live video, for TV and streaming",madeFor:"A broadcast or stream, keyed over the picture",type:"leaderboard",attributes:{...Kl,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:Vl,cssOverrides:`${Hl}${$A}${IA}${AA(3,68,20)}${TA}
|
|
11638
11638
|
/* The lower third of the frame, inside the title-safe area. */
|
|
11639
11639
|
#root {
|
|
11640
11640
|
position: fixed;
|
|
@@ -11645,7 +11645,7 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11645
11645
|
needs its own edge once this is keyed over a picture. */
|
|
11646
11646
|
.leaderboard { background: rgba(0,0,0,0.78); border-radius: 6px; }
|
|
11647
11647
|
.entry-name, .entry-score { text-shadow: 0 2px 6px rgba(0,0,0,0.9); }
|
|
11648
|
-
`}},{id:"panel",summary:"A right-hand panel that pulls out over the picture, for TV and CTV",madeFor:"Connected TV and broadcast, beside the action rather than under it",type:"leaderboard",attributes:{...Kl,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:Vl,cssOverrides:`${Hl}${
|
|
11648
|
+
`}},{id:"panel",summary:"A right-hand panel that pulls out over the picture, for TV and CTV",madeFor:"Connected TV and broadcast, beside the action rather than under it",type:"leaderboard",attributes:{...Kl,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:Vl,cssOverrides:`${Hl}${$A}${IA}${AA(8,106,18)}${TA}
|
|
11649
11649
|
/* The right 30%, full height, inside the title-safe area. The picture keeps
|
|
11650
11650
|
the left two thirds, which is where the action is. */
|
|
11651
11651
|
#root {
|
|
@@ -11659,7 +11659,7 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11659
11659
|
/* A narrow column cannot let a long name push the score off the end. */
|
|
11660
11660
|
.col-name { min-width: 0; }
|
|
11661
11661
|
.entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
11662
|
-
`}},{id:"bigscreen",summary:"A stadium screen or a Jumbotron",madeFor:"The big screen in the ground",type:"leaderboard",attributes:{...Kl,rowsPerScreen:10,embedPageSize:10,showAvatars:!1,avatarStyle:"circle",aspectRatio:"16/9",accentColour:Vl,...
|
|
11662
|
+
`}},{id:"bigscreen",summary:"A stadium screen or a Jumbotron",madeFor:"The big screen in the ground",type:"leaderboard",attributes:{...Kl,rowsPerScreen:10,embedPageSize:10,showAvatars:!1,avatarStyle:"circle",aspectRatio:"16/9",accentColour:Vl,...NA,cssOverrides:`${Hl}${PA}${OA({rows:10,maxRowPx:132,reserveVh:31,rankPct:9,scorePct:17,name:.4,score:.48,rank:.56,header:1.8,typeCapVmin:6.9})}${CA}
|
|
11663
11663
|
/* Drawn for a 20m board serving a 150m bowl. The renderer's own cap is
|
|
11664
11664
|
30.4px on a name, which is comfortable to about 44m and no further. That
|
|
11665
11665
|
150m figure is asserted rather than measured: print a page at scale, walk
|
|
@@ -11668,7 +11668,7 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11668
11668
|
No avatar: the names are Identify auto-aliases, so no photograph is ever
|
|
11669
11669
|
coming, and a 56px circle carrying 12px initials sat in the strongest
|
|
11670
11670
|
reading position on every row repeating the two words beside it. */
|
|
11671
|
-
`,storyModeEnabled:!0,storySegmentSize:10,storySegmentDuration:8}},{id:"vertical",summary:"A portrait panel in a concourse",madeFor:"Digital out of home, 9:16",type:"leaderboard",attributes:{...Kl,rowsPerScreen:8,embedPageSize:8,showAvatars:!1,avatarStyle:"circle",aspectRatio:"9/16",accentColour:Vl,...
|
|
11671
|
+
`,storyModeEnabled:!0,storySegmentSize:10,storySegmentDuration:8}},{id:"vertical",summary:"A portrait panel in a concourse",madeFor:"Digital out of home, 9:16",type:"leaderboard",attributes:{...Kl,rowsPerScreen:8,embedPageSize:8,showAvatars:!1,avatarStyle:"circle",aspectRatio:"9/16",accentColour:Vl,...NA,cssOverrides:`${Hl}${PA}${OA({rows:8,maxRowPx:210,reserveVh:25,rankPct:11,scorePct:27,name:.25,score:.3,rank:.36,header:3.3,typeCapVmin:16.7})}${CA}
|
|
11672
11672
|
/* A concourse panel is read from a few metres rather than from a stand, and
|
|
11673
11673
|
it has 1920 of height to spend on eight rows, so the row cap is taller
|
|
11674
11674
|
than the big screen's while the type it carries is smaller in proportion
|
|
@@ -11685,10 +11685,10 @@ ${o}`):o+e}function Hj(e,t){return Dj(async(r,o)=>{let n=new URL(r.url??"/","htt
|
|
|
11685
11685
|
eight rows and the chrome fill the panel. The min() still governs anything
|
|
11686
11686
|
smaller, so a 720x1280 panel is unchanged. No backticks in here: this
|
|
11687
11687
|
comment is inside a template literal and one of them ends the string. */
|
|
11688
|
-
`}},{id:"promo",summary:"A QR code that sends a crowd to the game",madeFor:"Getting people playing, with no live data at all",type:"qr",attributes:{backgroundType:"solid",backgroundColour:"#0B0B0F",qrBackgroundColour:"#FFFFFF",qrForegroundColour:"#000000",qrUrlMode:"full",aspectRatio:"9/16"}}],ya=a2.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:i2(t)}}:e}),Ro="bigscreen";function Zl(e){return ya.find(t=>t.id===e)}function
|
|
11688
|
+
`}},{id:"promo",summary:"A QR code that sends a crowd to the game",madeFor:"Getting people playing, with no live data at all",type:"qr",attributes:{backgroundType:"solid",backgroundColour:"#0B0B0F",qrBackgroundColour:"#FFFFFF",qrForegroundColour:"#000000",qrUrlMode:"full",aspectRatio:"9/16"}}],ya=a2.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:i2(t)}}:e}),Ro="bigscreen";function Zl(e){return ya.find(t=>t.id===e)}function RA(){return ya.map(e=>e.id)}import{createServer as s2}from"node:http";import{readFile as DA}from"node:fs/promises";import{extname as c2}from"node:path";At();Ne();var Vn=1e4,Yl="preview",l2=[{name:"Happy Robin",primaryScore:61257},{name:"Copper Panda",primaryScore:59917},{name:"Sunny Robin",primaryScore:58582},{name:"Bo",primaryScore:58150},{name:"Wise Raven",primaryScore:56621},{name:"Marguerite Vandersteen-Whitlock",primaryScore:54903},{name:"Keen Marten",primaryScore:51044},{name:"Quiet Otter",primaryScore:49781},{name:"Quick Falcon",primaryScore:48310},{name:"Kind Puffin",primaryScore:47225},{name:"Ready Tapir",primaryScore:46980},{name:"Steady Finch",primaryScore:44117},{name:"Zesty Quokka",primaryScore:43508},{name:"Lucky Raven",primaryScore:41966},{name:"Bold Ibex",primaryScore:40402},{name:"Jo",primaryScore:39875},{name:"Silver Bison",primaryScore:38214},{name:"Calm Osprey",primaryScore:36790},{name:"Eager Lynx",primaryScore:35636},{name:"Golden Marmot",primaryScore:34401},{name:"Nimble Shrike",primaryScore:33118},{name:"Patient Heron",primaryScore:32292},{name:"Clever Stoat",primaryScore:30877},{name:"Brisk Wombat",primaryScore:29618},{name:"Gentle Kestrel",primaryScore:28044},{name:"Sharp Meerkat",primaryScore:26510},{name:"Sly Pangolin",primaryScore:24903},{name:"Warm Capybara",primaryScore:23177},{name:"Swift Ocelot",primaryScore:21440},{name:"Merry Numbat",primaryScore:19862},{name:"Proud Caracal",primaryScore:17305},{name:"Keen Wallaby",primaryScore:15288},{name:"Mild Aardvark",primaryScore:13910},{name:"Brave Echidna",primaryScore:11642},{name:"Plucky Serval",primaryScore:9033},{name:"Tidy Bandicoot",primaryScore:8766},{name:"Sunny Kinkajou",primaryScore:6120},{name:"Bright Heron",primaryScore:-3020},{name:"Rash Coati",primaryScore:-5417},{name:"Still Fox",primaryScore:-8824}];function d2(e){switch(c2(e)){case".js":return"text/javascript; charset=utf-8";case".css":return"text/css; charset=utf-8";case".html":return"text/html; charset=utf-8";case".json":return"application/json";case".woff2":return"font/woff2";case".svg":return"image/svg+xml";default:return"application/octet-stream"}}async function u2(e){let t="";try{t=await DA(e.css,"utf8")}catch{}let r=Number(e.rows)||10,o=new Date().toISOString(),n=Zl(Ro)?.attributes??{};return{instance:{instanceId:Yl,name:"Preview",type:"leaderboard",embedSlug:Yl,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:o,updatedAt:o,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:n.rowsPerScreen??r,storyModeEnabled:n.storyModeEnabled??!1,storySegmentSize:n.storySegmentSize??10,storySegmentDuration:n.storySegmentDuration??8,accentColour:e.accent??n.accentColour??"#FFD700",colourPreset:"dark",primaryFontUrl:n.primaryFontUrl,primaryFontFamily:n.primaryFontFamily,secondaryFontUrl:n.secondaryFontUrl,secondaryFontFamily:n.secondaryFontFamily,headerText:"Preview Game",statusText:"Live",logos:[{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><rect width="120" height="120" fill="none" stroke="#888" stroke-width="4"/><text x="60" y="66" font-family="monospace" font-size="16" fill="#888" text-anchor="middle">LOGO</text></svg>'),position:"top-right"}],embedPageSize:r,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,templateCss:n.cssOverrides,cssOverrides:t}},entries:l2.slice(0,r).map((i,a)=>({entryId:`preview-${a}`,instanceId:Yl,name:i.name,gender:"",primaryScore:i.primaryScore,rank:a+1,createdAt:o,updatedAt:o})),generatedAt:o}}async function LA(e,t){let r=new URL(t.replace(/^\/(r\/)?/,""),e.endsWith("/")?e:`${e}/`);return fetch(r,{redirect:"follow"})}async function jA(e){let t=e.renderer.replace(/\/+$/,"")+"/";if(!(await fetch(new URL("embed.html",t)).catch(()=>{}))?.ok)throw new Error(`Could not load the Live Graphics renderer from ${t}.
|
|
11689
11689
|
Pass --renderer <url> if your Space serves it somewhere else.`);let o=s2((a,s)=>{(async()=>{let d=(a.url??"/").split("?")[0]??"/";try{if(d==="/config.js"){s.writeHead(200,{"content-type":"text/javascript","cache-control":"no-store"}),s.end(`window.GFX_CONFIG = {"apiBase":""};
|
|
11690
|
-
`);return}if(d.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await u2(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(d==="/"||d==="/index.html"||d==="/embed.html"||d==="/bigscreen.html"){let y=await(await
|
|
11690
|
+
`);return}if(d.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await u2(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(d==="/"||d==="/index.html"||d==="/embed.html"||d==="/bigscreen.html"){let y=await(await LA(t,"embed.html")).text();y=y.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),s.writeHead(200,{"content-type":"text/html; charset=utf-8"}),s.end(y);return}let l=await LA(t,d);if(!l.ok){s.writeHead(l.status),s.end();return}let p=Buffer.from(await l.arrayBuffer());s.writeHead(200,{"content-type":d2(d)}),s.end(p)}catch(l){s.writeHead(502,{"content-type":"text/plain"}),s.end(`Could not reach the renderer: ${l instanceof Error?l.message:String(l)}
|
|
11691
11691
|
`)}})()});await new Promise((a,s)=>{o.once("error",s),o.listen(Number(e.port),"127.0.0.1",()=>a())});let n=o.address();if(!n||typeof n=="string")throw new Error("The local server did not report its listening address");let i=`http://127.0.0.1:${n.port}/?slug=${Yl}${e.bigscreen?"&bigscreen=true":""}`;process.stdout.write(["",` Your graphic: ${i}`,` Stylesheet: ${e.css}`,` Renderer: ${t}`,""," Save the stylesheet and the page picks it up within five seconds."," This touches nothing real: no graphic is read and none is written.",""," Ctrl-C to stop.",""].join(`
|
|
11692
|
-
`)),await new Promise(a=>{let s=()=>{process.off("SIGINT",s),process.off("SIGTERM",s),o.close(()=>a())};process.once("SIGINT",s),process.once("SIGTERM",s)})}function p2(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function jA(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,J()){te({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}U(n);for(let[d,l]of Object.entries(a))R(d,l);g();for(let d of i)E(d);g()};try{let o;try{o=await LA(t.css,"utf8")}catch{r("no_stylesheet","No stylesheet to publish",[`${t.css} is not there.`,"Write one, see it with `gamestage graphic dev`, then run this again."]);return}if(o.length>Vn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Vn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Vn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Vn.toLocaleString()} characters`},{characters:o.length,limit:Vn});return}let{client:n}=await Te(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",["A producer can only point a graphic at a file that is being served.",`Run \`gamestage deploy ${i.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${i.name} (${i.id})`});return}let a=p2(i.playgroundUrl,t.css),s=!1,d=0;try{let l=await fetch(a);d=l.status,s=l.ok}catch{s=!1}if(!s){r("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${i.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":a,Answered:d?String(d):"nothing"},{url:a,status:d,characters:o.length,limit:Vn});return}if(J()){te({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Vn,url:a});return}U("Ready for a producer"),R("Game",`${i.name} (${i.id})`),R("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Vn.toLocaleString()} characters)`),R("Address",a),g(),E("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),E("Today they copy the stylesheet out of that address by hand. A graphic that follows the address by itself is proposed to Monterosa and not built yet, so nothing on your side changes when it lands."),g()}catch(o){Ce(o)}}function Eb(e,t){let o=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:o};let n=Zl(t.template)?.attributes?.rowsPerScreen,i=n?`${o}&rows=${n}`:o;return t.template==="bigscreen"?{Address:`${o}&bigscreen=true`,"Overlay form":i}:{Address:i}}function MA(e,t){return e.refused?(process.exitCode=1,J()?(te({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(U("Not done"),g(` ${e.refused}`),g(),!0)):!1}async function UA(e,t){let r=(n,i,a)=>{if(process.exitCode=1,J()){te({ok:!1,reason:n,game:e,template:t.template});return}U(i),g();for(let s of a)E(s);g()},o=Zl(t.template);if(!o){r("no_such_template",`No template called ${t.template}`,[`The templates are: ${NA().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){r("consent_not_given","Nobody has said these names can be shown",["A leaderboard puts fans' names on a screen other people can see, and somebody has to confirm those people agreed to that.",`Run it again with --consent when that is true: \`gamestage graphic create ${e} --template ${o.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await Te(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",[o.type==="qr"?"A QR code sends a crowd to the game, and there is nowhere to send them yet.":"A graphic follows the game's own leaderboard, and a game that has not deployed publishes none.",`Run \`gamestage deploy ${i.id} --dir .\` first.`]);return}let a=await n.composeGraphic(i.id,{template:o.id,consent:!0});if(MA(a,"graphic create"))return;let s=(a.game.graphics??[]).at(-1);if(!s){r("not_recorded","The graphic was made and not recorded",["The control plane accepted the request and the game holds no new graphic.",`Run \`gamestage graphic list ${i.id}\` before making another one.`]);return}let d=Eb(i.playgroundUrl,s);if(J()){te({ok:!0,game:i.id,graphic:s,addresses:d});return}U("On screen"),R("Game",`${i.name} (${i.id})`),R("Template",`${o.id} - ${o.summary}`),R("Made for",o.madeFor);for(let[l,p]of Object.entries(d))R(l,p);g(),E("Open that address on the screen. It is a web page and needs no sign-in."),E(o.type==="qr"?"The code points at your game's own page, so it keeps working as long as the game is deployed.":"It follows your game's leaderboard by itself and redraws as fans play. Nothing needs redeploying when a round changes."),E(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${i.id}\`.`),g()}catch(n){if(n.code==="graphics_not_configured"){r("graphics_not_configured","This deployment cannot make graphics",["The control plane has no Live Graphics key, so there is nothing to compose a graphic with.","That is a deployment setting rather than anything about your game. Tell whoever runs it."]);return}Ce(n)}}async function zA(e){try{let{client:t}=await Te(),r=await t.getGame(e);if(!r){process.exitCode=1,J()?te({ok:!1,reason:"no_such_game",game:e}):(U("No such game"),g(),E(`Nothing in your workspace has the id ${e}.`),g());return}let o=r.graphics??[];if(J()){te({ok:!0,game:r.id,graphics:o.map(n=>({...n,addresses:r.playgroundUrl?Eb(r.playgroundUrl,n):{}}))});return}if(o.length===0){U("No graphics yet"),g(),E(`Make one with \`gamestage graphic create ${r.id} --template bigscreen --consent\`.`),g();return}U(`${o.length} graphic${o.length===1?"":"s"}`);for(let n of o){if(g(),R("Template",`${n.template} (${n.type})`),R("Id",n.instanceId),r.playgroundUrl)for(let[i,a]of Object.entries(Eb(r.playgroundUrl,n)))R(i,a);R("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}g(),E(`Take one down with \`gamestage graphic remove ${r.id} <id>\`.`),g()}catch(t){Ce(t)}}async function FA(e,t){try{let{client:r}=await Te(),o=await r.removeGraphic(e,t);if(MA(o,"graphic remove"))return;if(J()){te({ok:!0,game:o.game.id,removed:t});return}U("Taken down"),R("Game",`${o.game.name} (${o.game.id})`),R("Removed",t),g(),E("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),g()}catch(r){Ce(r)}}function GA(){if(J()){te({ok:!0,default:Ro,templates:ya.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}U("Graphic templates");for(let e of ya)g(),R(e.id,e.id===Ro?`${e.summary} (the default)`:e.summary),R("",e.madeFor);g(),E("Pick one with `gamestage graphic create <game> --template <id> --consent`."),g()}we();Ne();Wi();import{readFile as h2}from"node:fs/promises";async function BA(e,t){let r;try{r=await h2(e,"utf8")}catch{return K(`Cannot read ${e}`)}let o=Fe(r);if(!o.ok)return J()&&(te({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),K(`${e} is not a valid App Manifest`,o.issues.map(p=>`${A.cyan(p.path)} ${p.message}`));let n=o.manifest,i=vt(n),a=null;if(t.level){let p=Rn.safeParse(t.level.toUpperCase());if(!p.success)return K(`Unknown level "${t.level}". Use L0 through L5.`);a=p.data}let s=a?Zk(n,a):null,d=await _o(e),l=!i.overclaimed&&(s?.ok??!0)&&d.problems.length===0;if(J()&&(te({ok:l,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results,settings_file:d.settings?{ok:!0,keys:Object.keys(d.settings)}:d.problems.length?{ok:!1,problems:d.problems}:null}),process.exit(l?0:1)),U(`${n.app.title} ${A.dim(n.app.id)}`),R("Schema",n.manifest.schema_version),R("Revision",String(n.manifest.revision)),R("Conformance",i.overclaimed?`${A.red(i.claimed)} claimed, ${A.bold(i.computed)} evidenced`:`${A.green(i.computed)} ${i.computedName}`),i.overclaimed){U("Overclaimed"),g(A.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let p of i.blockers)E(A.red(p.requirement))}if(a&&s&&!s.ok){U(`Not yet ${a}`);for(let p of s.missing)E(`${A.yellow(p.id)} ${p.requirement}`)}if(d.problems.length){U("gamestage.settings.json");for(let p of d.problems)E(A.red(p))}else d.settings&&R("Studio fields",`${Object.keys(d.settings).length} filled from gamestage.settings.json on deploy`);if(l&&(g(),g(` ${A.green("Valid")}${a?` at ${a}`:""}.`),n.backend.round||(g(A.dim(" Structurally valid, and no round in the manifest, which is normal: a game's")),g(A.dim(" round comes from Studio. `gamestage dev` will say so too and serve a stand-in."))),i.blockers.length)){g(),g(A.dim(" Next level needs:"));for(let p of i.blockers)g(` ${A.dim("\xB7")} ${p.requirement}`)}g(),process.exit(l?0:1)}var WA={start:"none",doctor:"none",inspect:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session",status:"approved",deploy:"approved",archive:"approved",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",logs:"approved","manifest register":"approved","reference push":"approved",sources:"approved","round push":"approved","round refresh":"approved","link github":"approved"};function KA(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function HA(e,t){return e.commands.filter(r=>!r._hidden).map(r=>m2(r,t))}function m2(e,t){let r=t?`${t} ${e.name()}`:e.name(),o=!!e._actionHandler;return{name:e.name(),aliases:e.aliases(),summary:e.description(),arguments:e.registeredArguments.map(n=>({name:n.name(),required:n.required,description:n.description,...n.defaultValue===void 0?{}:{default:n.defaultValue}})),options:KA(e),...o?{account:WA[r]??"none"}:{},commands:HA(e,r)}}function VA(e,t){return{name:e.name(),version:t,summary:e.description(),options:KA(e),commands:HA(e,"")}}function ZA(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Ne();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var be=new xr,f2=(()=>{let e=[...Bt];return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();be.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(Pt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{gE(!!e.opts().json)});be.command("start").description("read the current directory and point at the right next step").action(aA);be.command("doctor").description("check the local environment").action(H0);be.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(q0);be.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${f2}`).addOption(new kn("--archetype <format>").hideHelp()).option("--host <host>","where it runs: fullscreen, article-launch, article-embed or app-webview (default fullscreen)").option("--layout <layout>","how it sits on the screen: screen, canvas, launch, card, page or sheet (default from the host and format)").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing how it is played before scaffolding").action(YE);be.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>mb({...e,noBrowser:e.browser===!1}));be.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(bE);var YA=be.command("manifest").description("work with the App Manifest");YA.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(C0);YA.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(BA);be.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(x0);be.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(S0);var qA=be.command("reference").description("the private data a round is scored against");qA.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").option("--drop-scoring","publish even though a measure that scores rounds today would stop scoring them").action(fA);qA.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action(gA);var Tb=be.command("sources").description("where a game's real-world values can come from, and which you can use now").helpCommand(!0).action(yA);Tb.command("connect <source>").description("the link to add your own key for a source, e.g. sportmonks").option("--from-op <reference>","at your own terminal only: read the key from 1Password (op://Vault/Item/field); never run by an agent").action((e,t)=>bA(e,t));Tb.command("status <source>").description("whether your key for a source is connected, and what your plan covers").action(_A);Tb.command("disconnect <source>").description("remove your key for a source; its scheduled pulls stop").action(kA);var JA=be.command("round").description("the round a fan plays, and getting it into Studio");JA.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(xA);JA.command("refresh").argument("<game>","game id").description("read Studio and the dataset again now, rather than on the next fan's visit").action(SA);var Lo=be.command("graphic").description("the graphic your game puts on a screen");Lo.command("dev").option("--css <path>","the stylesheet to preview","graphic.css").option("--port <port>","port to serve on","4321").option("--rows <rows>","how many rows to draw","10").option("--bigscreen","draw it as a big screen rather than an overlay",!1).option("--accent <colour>","accent colour, as #rrggbb").option("--renderer <url>","where the Live Graphics renderer is served from","https://monterosa-gamestage.spaces-dev.monterosa.cloud/r/").description("see your stylesheet on the real graphic, on your own machine").action(DA);Lo.command("templates").description("the screens a graphic can be cut for").action(GA);Lo.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",Ro).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(UA);Lo.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(zA);Lo.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action(FA);Lo.command("push").argument("<game>","game id").option("--css <path>","the stylesheet to publish","graphic.css").description("hand a producer the address of your stylesheet").action(jA);be.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(E0);be.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(T0);be.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action($0);be.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(A0);be.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>wb(e,!1));be.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>wb(e,!0));be.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(P0);be.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(N0);be.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(K0);be.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("[what]","what you were trying to build, or pipe it in").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>dA(e,t,Pt));be.command("issue").description("report something that went wrong (no account needed)").argument("[what]","what went wrong, or pipe it in").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>hA(e,t,Pt));be.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").option("--workspace <id>","the workspace you expect to land in, from the welcome screen").action(e=>nA(e.workspace));var g2=be.command("link").description("connect an account Gamestage needs (requires sign-in)");g2.command("github").description("link your GitHub account, which a first deploy requires").action(eA);var $b=be.command("admin").description("approve, refuse or set the plan of a creator's account (operators only)");$b.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>vb(e,"approved"));$b.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>vb(e,"refused"));$b.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,r)=>I0(e,t,r));be.command("logout").description("forget the stored session").action(rA);be.command("whoami").description("show who the CLI is signed in as").action(oA);ZA(process.argv)&&(process.stdout.write(`${JSON.stringify(VA(be,Pt),null,2)}
|
|
11692
|
+
`)),await new Promise(a=>{let s=()=>{process.off("SIGINT",s),process.off("SIGTERM",s),o.close(()=>a())};process.once("SIGINT",s),process.once("SIGTERM",s)})}function p2(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function MA(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,J()){te({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}U(n);for(let[d,l]of Object.entries(a))R(d,l);g();for(let d of i)E(d);g()};try{let o;try{o=await DA(t.css,"utf8")}catch{r("no_stylesheet","No stylesheet to publish",[`${t.css} is not there.`,"Write one, see it with `gamestage graphic dev`, then run this again."]);return}if(o.length>Vn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Vn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Vn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Vn.toLocaleString()} characters`},{characters:o.length,limit:Vn});return}let{client:n}=await Te(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",["A producer can only point a graphic at a file that is being served.",`Run \`gamestage deploy ${i.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${i.name} (${i.id})`});return}let a=p2(i.playgroundUrl,t.css),s=!1,d=0;try{let l=await fetch(a);d=l.status,s=l.ok}catch{s=!1}if(!s){r("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${i.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":a,Answered:d?String(d):"nothing"},{url:a,status:d,characters:o.length,limit:Vn});return}if(J()){te({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Vn,url:a});return}U("Ready for a producer"),R("Game",`${i.name} (${i.id})`),R("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Vn.toLocaleString()} characters)`),R("Address",a),g(),E("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),E("Today they copy the stylesheet out of that address by hand. A graphic that follows the address by itself is proposed to Monterosa and not built yet, so nothing on your side changes when it lands."),g()}catch(o){Ce(o)}}function Tb(e,t){let o=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:o};let n=Zl(t.template)?.attributes?.rowsPerScreen,i=n?`${o}&rows=${n}`:o;return t.template==="bigscreen"?{Address:`${o}&bigscreen=true`,"Overlay form":i}:{Address:i}}function UA(e,t){return e.refused?(process.exitCode=1,J()?(te({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(U("Not done"),g(` ${e.refused}`),g(),!0)):!1}async function zA(e,t){let r=(n,i,a)=>{if(process.exitCode=1,J()){te({ok:!1,reason:n,game:e,template:t.template});return}U(i),g();for(let s of a)E(s);g()},o=Zl(t.template);if(!o){r("no_such_template",`No template called ${t.template}`,[`The templates are: ${RA().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){r("consent_not_given","Nobody has said these names can be shown",["A leaderboard puts fans' names on a screen other people can see, and somebody has to confirm those people agreed to that.",`Run it again with --consent when that is true: \`gamestage graphic create ${e} --template ${o.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await Te(),i=await n.getGame(e);if(!i){r("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!i.playgroundUrl){r("not_deployed","This game has not been deployed",[o.type==="qr"?"A QR code sends a crowd to the game, and there is nowhere to send them yet.":"A graphic follows the game's own leaderboard, and a game that has not deployed publishes none.",`Run \`gamestage deploy ${i.id} --dir .\` first.`]);return}let a=await n.composeGraphic(i.id,{template:o.id,consent:!0});if(UA(a,"graphic create"))return;let s=(a.game.graphics??[]).at(-1);if(!s){r("not_recorded","The graphic was made and not recorded",["The control plane accepted the request and the game holds no new graphic.",`Run \`gamestage graphic list ${i.id}\` before making another one.`]);return}let d=Tb(i.playgroundUrl,s);if(J()){te({ok:!0,game:i.id,graphic:s,addresses:d});return}U("On screen"),R("Game",`${i.name} (${i.id})`),R("Template",`${o.id} - ${o.summary}`),R("Made for",o.madeFor);for(let[l,p]of Object.entries(d))R(l,p);g(),E("Open that address on the screen. It is a web page and needs no sign-in."),E(o.type==="qr"?"The code points at your game's own page, so it keeps working as long as the game is deployed.":"It follows your game's leaderboard by itself and redraws as fans play. Nothing needs redeploying when a round changes."),E(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${i.id}\`.`),g()}catch(n){if(n.code==="graphics_not_configured"){r("graphics_not_configured","This deployment cannot make graphics",["The control plane has no Live Graphics key, so there is nothing to compose a graphic with.","That is a deployment setting rather than anything about your game. Tell whoever runs it."]);return}Ce(n)}}async function FA(e){try{let{client:t}=await Te(),r=await t.getGame(e);if(!r){process.exitCode=1,J()?te({ok:!1,reason:"no_such_game",game:e}):(U("No such game"),g(),E(`Nothing in your workspace has the id ${e}.`),g());return}let o=r.graphics??[];if(J()){te({ok:!0,game:r.id,graphics:o.map(n=>({...n,addresses:r.playgroundUrl?Tb(r.playgroundUrl,n):{}}))});return}if(o.length===0){U("No graphics yet"),g(),E(`Make one with \`gamestage graphic create ${r.id} --template bigscreen --consent\`.`),g();return}U(`${o.length} graphic${o.length===1?"":"s"}`);for(let n of o){if(g(),R("Template",`${n.template} (${n.type})`),R("Id",n.instanceId),r.playgroundUrl)for(let[i,a]of Object.entries(Tb(r.playgroundUrl,n)))R(i,a);R("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}g(),E(`Take one down with \`gamestage graphic remove ${r.id} <id>\`.`),g()}catch(t){Ce(t)}}async function GA(e,t){try{let{client:r}=await Te(),o=await r.removeGraphic(e,t);if(UA(o,"graphic remove"))return;if(J()){te({ok:!0,game:o.game.id,removed:t});return}U("Taken down"),R("Game",`${o.game.name} (${o.game.id})`),R("Removed",t),g(),E("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),g()}catch(r){Ce(r)}}function BA(){if(J()){te({ok:!0,default:Ro,templates:ya.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}U("Graphic templates");for(let e of ya)g(),R(e.id,e.id===Ro?`${e.summary} (the default)`:e.summary),R("",e.madeFor);g(),E("Pick one with `gamestage graphic create <game> --template <id> --consent`."),g()}we();Ne();Wi();import{readFile as h2}from"node:fs/promises";async function WA(e,t){let r;try{r=await h2(e,"utf8")}catch{return K(`Cannot read ${e}`)}let o=Fe(r);if(!o.ok)return J()&&(te({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),K(`${e} is not a valid App Manifest`,o.issues.map(p=>`${A.cyan(p.path)} ${p.message}`));let n=o.manifest,i=vt(n),a=null;if(t.level){let p=Rn.safeParse(t.level.toUpperCase());if(!p.success)return K(`Unknown level "${t.level}". Use L0 through L5.`);a=p.data}let s=a?Yk(n,a):null,d=await _o(e),l=!i.overclaimed&&(s?.ok??!0)&&d.problems.length===0;if(J()&&(te({ok:l,manifest_id:n.app.id,conformance:{claimed:i.claimed,computed:i.computed,overclaimed:i.overclaimed},required_level:a,missing:s?.missing??[],blockers:i.blockers,rules:i.results,settings_file:d.settings?{ok:!0,keys:Object.keys(d.settings)}:d.problems.length?{ok:!1,problems:d.problems}:null}),process.exit(l?0:1)),U(`${n.app.title} ${A.dim(n.app.id)}`),R("Schema",n.manifest.schema_version),R("Revision",String(n.manifest.revision)),R("Conformance",i.overclaimed?`${A.red(i.claimed)} claimed, ${A.bold(i.computed)} evidenced`:`${A.green(i.computed)} ${i.computedName}`),i.overclaimed){U("Overclaimed"),g(A.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let p of i.blockers)E(A.red(p.requirement))}if(a&&s&&!s.ok){U(`Not yet ${a}`);for(let p of s.missing)E(`${A.yellow(p.id)} ${p.requirement}`)}if(d.problems.length){U("gamestage.settings.json");for(let p of d.problems)E(A.red(p))}else d.settings&&R("Studio fields",`${Object.keys(d.settings).length} filled from gamestage.settings.json on deploy`);if(l&&(g(),g(` ${A.green("Valid")}${a?` at ${a}`:""}.`),n.backend.round||(g(A.dim(" Structurally valid, and no round in the manifest, which is normal: a game's")),g(A.dim(" round comes from Studio. `gamestage dev` will say so too and serve a stand-in."))),i.blockers.length)){g(),g(A.dim(" Next level needs:"));for(let p of i.blockers)g(` ${A.dim("\xB7")} ${p.requirement}`)}g(),process.exit(l?0:1)}var KA={start:"none",doctor:"none",inspect:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session",status:"approved",deploy:"approved",archive:"approved",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",logs:"approved","manifest register":"approved","reference push":"approved",sources:"approved","round push":"approved","round refresh":"approved","link github":"approved"};function HA(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function VA(e,t){return e.commands.filter(r=>!r._hidden).map(r=>m2(r,t))}function m2(e,t){let r=t?`${t} ${e.name()}`:e.name(),o=!!e._actionHandler;return{name:e.name(),aliases:e.aliases(),summary:e.description(),arguments:e.registeredArguments.map(n=>({name:n.name(),required:n.required,description:n.description,...n.defaultValue===void 0?{}:{default:n.defaultValue}})),options:HA(e),...o?{account:KA[r]??"none"}:{},commands:VA(e,r)}}function ZA(e,t){return{name:e.name(),version:t,summary:e.description(),options:HA(e),commands:VA(e,"")}}function YA(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Ne();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var be=new xr,f2=(()=>{let e=[...Bt];return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();be.name("gamestage").description("Take an agent-built game prototype to a production fan game.\nInspect, create and validate need no account. `dev` and `verify` need\nyou signed in; publishing a game needs that account approved too.").version(Pt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{yE(!!e.opts().json)});be.command("start").description("read the current directory and point at the right next step").action(sA);be.command("doctor").description("check the local environment").action(V0);be.command("inspect").alias("adopt").argument("[target]","game file or project directory",".").option("--write [path]","write the generated manifest (default gamestage.yaml)").option("--force","replace an existing manifest, losing whatever it holds",!1).description("read an existing game read-only and produce an inspection report").action(J0);be.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${f2}`).addOption(new kn("--archetype <format>").hideHelp()).option("--host <host>","where it runs: fullscreen, article-launch, article-embed or app-webview (default fullscreen)").option("--layout <layout>","how it sits on the screen: screen, canvas, launch, card, page or sheet (default from the host and format)").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).description("start a new game, choosing how it is played before scaffolding").action(qE);be.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--dir <path>","the directory a deploy would publish (defaults to the game's own)").option("--no-browser","skip the browser proof (exits 2 unless another check fails)").description("run the game against a real Engine and prove the migration is done (requires sign-in)").action(e=>fb({...e,noBrowser:e.browser===!1}));be.command("client").option("--out <dir>","where to write it, defaulting to the current directory").description("write the player client into your project, as a browser can load it").action(vE);var qA=be.command("manifest").description("work with the App Manifest");qA.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(P0);qA.command("validate").argument("[path]","manifest path","gamestage.yaml").option("--level <level>","require a conformance level (L0-L5)").description("validate a manifest and report its evidenced conformance").action(WA);be.command("status").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near").action(S0);be.command("deploy").argument("<game>","game id").option("--revision <revision>","manifest revision being published").option("--hash <hash>","content hash of the snapshot").option("--level <level>","evidenced conformance level (L0-L5)").option("--prize","the game offers a prize (paid tiers only)",!1).option("--file <path>","the game's HTML, uploaded before the deploy gate runs").option("--dir <path>","the game's directory, uploaded with relative paths").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--no-check","skip loading the published page in a browser afterwards").option("--allow <path...>","publish a file the deploy gate suspects; it never clears a certain finding").description("publish a snapshot to a playground, and the round it puts on").action(E0);var JA=be.command("reference").description("the private data a round is scored against");JA.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").option("--drop-scoring","publish even though a measure that scores rounds today would stop scoring them").action(gA);JA.command("check").argument("<file>","the JSON file holding it").argument("[keys...]","the keys a round uses, to check they are all present").description("what a round would fail on, before a producer finds out").action(yA);var $b=be.command("sources").description("where a game's real-world values can come from, and which you can use now").helpCommand(!0).action(bA);$b.command("connect <source>").description("the link to add your own key for a source, e.g. sportmonks").option("--from-op <reference>","at your own terminal only: read the key from 1Password (op://Vault/Item/field); never run by an agent").action((e,t)=>vA(e,t));$b.command("status <source>").description("whether your key for a source is connected, and what your plan covers").action(kA);$b.command("disconnect <source>").description("remove your key for a source; its scheduled pulls stop").action(xA);var XA=be.command("round").description("the round a fan plays, and getting it into Studio");XA.command("push").argument("<game>","game id").option("--manifest <path>","manifest the round is read from","gamestage.yaml").option("--yes","do not ask before replacing what a producer has typed",!1).description("write your round into Studio, where a producer owns it from then on").action(SA);XA.command("refresh").argument("<game>","game id").description("read Studio and the dataset again now, rather than on the next fan's visit").action(EA);var Lo=be.command("graphic").description("the graphic your game puts on a screen");Lo.command("dev").option("--css <path>","the stylesheet to preview","graphic.css").option("--port <port>","port to serve on","4321").option("--rows <rows>","how many rows to draw","10").option("--bigscreen","draw it as a big screen rather than an overlay",!1).option("--accent <colour>","accent colour, as #rrggbb").option("--renderer <url>","where the Live Graphics renderer is served from","https://monterosa-gamestage.spaces-dev.monterosa.cloud/r/").description("see your stylesheet on the real graphic, on your own machine").action(jA);Lo.command("templates").description("the screens a graphic can be cut for").action(BA);Lo.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",Ro).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(zA);Lo.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(FA);Lo.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action(GA);Lo.command("push").argument("<game>","game id").option("--css <path>","the stylesheet to publish","graphic.css").description("hand a producer the address of your stylesheet").action(MA);be.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(T0);be.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action($0);be.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(A0);be.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(I0);be.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>_b(e,!1));be.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>_b(e,!0));be.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(O0);be.command("logs").argument("<game>","game id").option("--limit <n>","how many lines, newest kept","100").option("--since <iso>","only lines after this timestamp").option("--level <level>","info, warn or error").description("tail a game's runtime log").action(R0);be.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","manifest the round is read from (gamestage.yaml)").option("--fixture","serve the contract fixture instead of your own round",!1).option("--scenario <name>","fixture scenario, for contract work").option("--as <player>","play as a named signed-in player, with a keypair minted for this run").option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(H0);be.command("suggest").description("tell us about a format or feature we do not have (no account needed)").argument("[what]","what you were trying to build, or pipe it in").option("--closest <format>","the format that came nearest, if one did").option("--send","actually send it, having seen what it says",!1).action((e,t)=>uA(e,t,Pt));be.command("issue").description("report something that went wrong (no account needed)").argument("[what]","what went wrong, or pipe it in").option("--game <id>","the game it happened on, if it was about one").option("--send","actually send it, having seen what it says",!1).action((e,t)=>mA(e,t,Pt));be.command("login").description("sign in, or create an account (needed before dev, verify or deploy)").option("--workspace <id>","the workspace you expect to land in, from the welcome screen").action(e=>rA(e.workspace));var g2=be.command("link").description("connect an account Gamestage needs (requires sign-in)");g2.command("github").description("link your GitHub account, which a first deploy requires").action(tA);var Ab=be.command("admin").description("approve, refuse or set the plan of a creator's account (operators only)");Ab.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>wb(e,"approved"));Ab.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>wb(e,"refused"));Ab.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,r)=>C0(e,t,r));be.command("logout").description("forget the stored session").action(oA);be.command("whoami").description("show who the CLI is signed in as").action(iA);YA(process.argv)&&(process.stdout.write(`${JSON.stringify(ZA(be,Pt),null,2)}
|
|
11693
11693
|
`),process.exit(0));be.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
|
|
11694
11694
|
`),process.exit(1)});
|