gamestage 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.mjs +173 -88
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -10,7 +10,7 @@
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 gT=Object.defineProperty;var v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var It=(e,t)=>{for(var r in t)gT(e,r,{get:t[r],enumerable:!0})};var cr,Un,De,xt,Pt,Te,gy,kT,xT,ST,ET,$T,TT,bo,Zt=v(()=>{"use strict";cr=`/**
13
+ var RT=Object.defineProperty;var v=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var It=(e,t)=>{for(var r in t)RT(e,r,{get:t[r],enumerable:!0})};var cr,Un,De,xt,Pt,Ae,Ey,zT,FT,GT,BT,WT,KT,wo,Zt=v(()=>{"use strict";cr=`/**
14
14
  * @monterosa/gamestage-player, bundled for a browser.
15
15
  *
16
16
  * Generated by the Gamestage CLI. Do not edit: it is replaced whenever the CLI
@@ -7003,7 +7003,7 @@ export {
7003
7003
  streakFrom,
7004
7004
  tokenOf
7005
7005
  };
7006
- `,Pt="865adcda248f1f60",Te="gamestage.js",gy="0.48.0",kT=`<!doctype html>
7006
+ `,Pt="865adcda248f1f60",Ae="gamestage.js",Ey="0.48.0",zT=`<!doctype html>
7007
7007
  <html lang="en">
7008
7008
  <head>
7009
7009
  <meta charset="utf-8" />
@@ -7367,7 +7367,7 @@ main().catch((error) => {
7367
7367
  </script>
7368
7368
  </body>
7369
7369
  </html>
7370
- `,xT=`<!doctype html>
7370
+ `,FT=`<!doctype html>
7371
7371
  <html lang="en">
7372
7372
  <head>
7373
7373
  <meta charset="utf-8" />
@@ -7780,7 +7780,7 @@ main().catch((error) => {
7780
7780
  </script>
7781
7781
  </body>
7782
7782
  </html>
7783
- `,ST=`<!doctype html>
7783
+ `,GT=`<!doctype html>
7784
7784
  <html lang="en">
7785
7785
  <head>
7786
7786
  <meta charset="utf-8" />
@@ -8249,7 +8249,7 @@ main().catch((error) => {
8249
8249
  </script>
8250
8250
  </body>
8251
8251
  </html>
8252
- `,ET=`<!doctype html>
8252
+ `,BT=`<!doctype html>
8253
8253
  <html lang="en">
8254
8254
  <head>
8255
8255
  <meta charset="utf-8" />
@@ -8614,7 +8614,7 @@ main().catch((error) => {
8614
8614
  </script>
8615
8615
  </body>
8616
8616
  </html>
8617
- `,$T=`<!doctype html>
8617
+ `,WT=`<!doctype html>
8618
8618
  <html lang="en">
8619
8619
  <head>
8620
8620
  <meta charset="utf-8" />
@@ -9431,7 +9431,7 @@ main().catch((error) => {
9431
9431
  </script>
9432
9432
  </body>
9433
9433
  </html>
9434
- `,TT=`<!doctype html>
9434
+ `,KT=`<!doctype html>
9435
9435
  <html lang="en">
9436
9436
  <head>
9437
9437
  <meta charset="utf-8" />
@@ -10072,54 +10072,54 @@ main().catch((error) => {
10072
10072
  </script>
10073
10073
  </body>
10074
10074
  </html>
10075
- `,bo={hunt:kT,push:xT,group:ST,predict:ET,bingo:$T,shoot:TT}});function yy(e){dr=e}function X(){return dr}function Yi(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 ge(e){return`${Yi()} ${e}`}function CT(e){let t=Yi();return t==="gamestage"?e:e.replace(PT,(r,o,n)=>IT.includes(o)?`\`${t} ${o}${n}\``:r)}function y(e=""){dr||process.stdout.write(CT(e)+`
10076
- `)}function H(e){y(),y(C.bold(e))}function O(e,t="-"){y(` ${C.dim(t)} ${e}`)}function W(e,t){y(` ${C.dim(e.padEnd(18))} ${t}`)}function te(e){dr&&process.stdout.write(JSON.stringify(e,null,2)+`
10077
- `)}function V(e,t){if(dr)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
10078
- `);else{process.stderr.write(`${C.red("Error")} ${e}
10075
+ `,wo={hunt:zT,push:FT,group:GT,predict:BT,bingo:WT,shoot:KT}});function $y(e){dr=e}function q(){return dr}function Xi(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 ge(e){return`${Xi()} ${e}`}function YT(e){let t=Xi();return t==="gamestage"?e:e.replace(VT,(r,o,n)=>HT.includes(o)?`\`${t} ${o}${n}\``:r)}function y(e=""){dr||process.stdout.write(YT(e)+`
10076
+ `)}function K(e){y(),y(O.bold(e))}function I(e,t="-"){y(` ${O.dim(t)} ${e}`)}function U(e,t){y(` ${O.dim(e.padEnd(18))} ${t}`)}function Q(e){dr&&process.stdout.write(JSON.stringify(e,null,2)+`
10077
+ `)}async function ul(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 V(e,t){if(dr)process.stderr.write(JSON.stringify({ok:!1,error:e,detail:t??[]},null,2)+`
10078
+ `);else{process.stderr.write(`${O.red("Error")} ${e}
10079
10079
  `);for(let r of t??[])process.stderr.write(` ${r}
10080
- `)}process.exit(1)}var dr,AT,lr,C,IT,PT,Pe=v(()=>{"use strict";dr=!1;AT=()=>!dr&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,lr=(e,t)=>AT()?`\x1B[${e}m${t}\x1B[0m`:t,C={bold:e=>lr("1",e),dim:e=>lr("2",e),red:e=>lr("31",e),green:e=>lr("32",e),yellow:e=>lr("33",e),cyan:e=>lr("36",e)};IT=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],PT=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function zn(e,t={}){let r=e?.trim()||ur;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var ur,wo=v(()=>{"use strict";ur="Round"});function Ge(e){return zT[e]??e}function wy(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=Ge(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Ji,zT,il,_y,Ht=v(()=>{"use strict";Ji=["hunt","push","group","predict","bingo","shoot"],zT={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};il={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"},_y={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties"}});function w(e,t,r){function o(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,p=Object.keys(l);for(let h=0;h<p.length;h++){let f=p[h];f in s||(s[f]=l[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var u;let l=r?.Parent?new i:this;o(l,s),(u=l._zod).deferred??(u.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 $e(e){return e&&Object.assign(Fn,e),Fn}var ky,al,sl,St,ln,Fn,Gn=v(()=>{al=Object.freeze({status:"aborted"});sl=Symbol("zod_brand"),St=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ln=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ky=globalThis).__zod_globalConfig??(ky.__zod_globalConfig={});Fn=globalThis.__zod_globalConfig});var G={};It(G,{BIGINT_FORMAT_RANGES:()=>yl,Class:()=>ll,NUMBER_FORMAT_RANGES:()=>gl,aborted:()=>hn,allowsEval:()=>pl,assert:()=>KT,assertEqual:()=>FT,assertIs:()=>BT,assertNever:()=>WT,assertNotEqual:()=>GT,assignProp:()=>un,base64ToUint8Array:()=>Sy,base64urlToUint8Array:()=>cA,cached:()=>hr,captureStackTrace:()=>Xi,cleanEnum:()=>sA,cleanRegex:()=>xo,clone:()=>Je,cloneDef:()=>HT,createTransparentProxy:()=>QT,defineLazy:()=>pe,esc:()=>qi,escapeRegex:()=>gt,explicitlyAborted:()=>vl,extend:()=>nA,finalizeIssue:()=>qe,floatSafeRemainder:()=>dl,getElementAtPath:()=>VT,getEnumValues:()=>ko,getLengthableOrigin:()=>$o,getParsedType:()=>XT,getSizableOrigin:()=>Eo,hexToUint8Array:()=>dA,isObject:()=>Bn,isPlainObject:()=>pn,issue:()=>mr,joinValues:()=>T,jsonStringifyReplacer:()=>pr,merge:()=>oA,mergeDefs:()=>Vt,normalizeParams:()=>K,nullish:()=>dn,numKeys:()=>qT,objectClone:()=>ZT,omit:()=>tA,optionalKeys:()=>fl,parsedType:()=>z,partial:()=>iA,pick:()=>eA,prefixIssues:()=>rt,primitiveTypes:()=>ml,promiseAllObject:()=>YT,propertyKeyTypes:()=>So,randomString:()=>JT,required:()=>aA,safeExtend:()=>rA,shallowClone:()=>hl,slugify:()=>ul,stringifyPrimitive:()=>U,uint8ArrayToBase64:()=>Ey,uint8ArrayToBase64url:()=>lA,uint8ArrayToHex:()=>uA,unwrapMessage:()=>_o});function FT(e){return e}function GT(e){return e}function BT(e){}function WT(e){throw new Error("Unexpected value in exhaustive check")}function KT(e){}function ko(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 T(e,t="|"){return e.map(r=>U(r)).join(t)}function pr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function dn(e){return e==null}function xo(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function dl(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 pe(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==xy)return o===void 0&&(o=xy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ZT(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function un(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function HT(e){return Vt(e._zod.def)}function VT(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function YT(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 JT(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function qi(e){return JSON.stringify(e)}function ul(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pn(e){if(Bn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Bn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hl(e){return pn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function qT(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function K(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 QT(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 U(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function fl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function eA(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=Vt(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 un(this,"shape",a),a},checks:[]});return Je(e,i)}function tA(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=Vt(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 un(this,"shape",a),a},checks:[]});return Je(e,i)}function nA(e,t){if(!pn(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=Vt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return un(this,"shape",i),i}});return Je(e,n)}function rA(e,t){if(!pn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return un(this,"shape",o),o}});return Je(e,r)}function oA(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=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return un(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Je(e,r)}function iA(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=Vt(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return un(this,"shape",u),u},checks:[]});return Je(t,a)}function aA(e,t,r){let o=Vt(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 un(this,"shape",i),i}});return Je(t,o)}function hn(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 vl(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 rt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function _o(e){return typeof e=="string"?e:e?.message}function qe(e,t,r){let o=e.message?e.message:_o(e.inst?._zod.def?.error?.(e))??_o(t?.error?.(e))??_o(r.customError?.(e))??_o(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 Eo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function $o(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function z(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 mr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function sA(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Sy(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 Ey(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function cA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Sy(t+r)}function lA(e){return Ey(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function dA(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 uA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var xy,Xi,pl,XT,So,ml,gl,yl,ll,ee=v(()=>{Gn();xy=Symbol("evaluating");Xi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};pl=hr(()=>{if(Fn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});XT=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}`)}},So=new Set(["string","number","symbol"]),ml=new Set(["string","number","bigint","boolean","symbol","undefined"]);gl={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]},yl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};ll=class{constructor(...t){}}});function Ao(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 Io(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 u=r,l=0;for(;l<s.length;){let p=s[l];l===s.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(a))):u[p]=u[p]||{_errors:[]},u=u[p],l++}}}};return o(e),r}function bl(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>o({issues:l},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let l=[...i,...u.path];if(l.length===0){r.errors.push(t(u));continue}let p=r,h=0;for(;h<l.length;){let f=l[h],g=h===l.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),g&&p.errors.push(t(u)),h++}}};return o(e),r}function Ty(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 wl(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 ${Ty(o.path)}`);return t.join(`
10081
- `)}var $y,To,ot,_l=v(()=>{Gn();ee();$y=(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,pr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},To=w("$ZodError",$y),ot=w("$ZodError",$y,{Parent:Error})});var fr,Qi,gr,ea,yr,kl,vr,xl,ta,hA,na,mA,ra,fA,oa,gA,ia,yA,aa,vA,sa,bA,ca,wA,Sl=v(()=>{Gn();_l();ee();fr=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 St;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>qe(u,i,$e())));throw Xi(s,n?.callee),s}return a.value},Qi=fr(ot),gr=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(u=>qe(u,i,$e())));throw Xi(s,n?.callee),s}return a.value},ea=gr(ot),yr=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 St;return i.issues.length?{success:!1,error:new(e??To)(i.issues.map(a=>qe(a,n,$e())))}:{success:!0,data:i.value}},kl=yr(ot),vr=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=>qe(a,n,$e())))}:{success:!0,data:i.value}},xl=vr(ot),ta=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fr(e)(t,r,n)},hA=ta(ot),na=e=>(t,r,o)=>fr(e)(t,r,o),mA=na(ot),ra=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return gr(e)(t,r,n)},fA=ra(ot),oa=e=>async(t,r,o)=>gr(e)(t,r,o),gA=oa(ot),ia=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yr(e)(t,r,n)},yA=ia(ot),aa=e=>(t,r,o)=>yr(e)(t,r,o),vA=aa(ot),sa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)},bA=sa(ot),ca=e=>async(t,r,o)=>vr(e)(t,r,o),wA=ca(ot)});var ut={};It(ut,{base64:()=>zl,base64url:()=>la,bigint:()=>Hl,boolean:()=>Yl,browserEmail:()=>AA,cidrv4:()=>Ml,cidrv6:()=>Ul,cuid:()=>El,cuid2:()=>$l,date:()=>Bl,datetime:()=>Kl,domain:()=>CA,duration:()=>Cl,e164:()=>Gl,email:()=>Nl,emoji:()=>Rl,extendedDuration:()=>_A,guid:()=>Ol,hex:()=>OA,hostname:()=>PA,html5Email:()=>EA,httpProtocol:()=>Fl,idnEmail:()=>TA,integer:()=>Vl,ipv4:()=>Ll,ipv6:()=>Dl,ksuid:()=>Il,lowercase:()=>Xl,mac:()=>jl,md5_base64:()=>RA,md5_base64url:()=>LA,md5_hex:()=>NA,nanoid:()=>Pl,null:()=>Jl,number:()=>da,rfc5322Email:()=>$A,sha1_base64:()=>jA,sha1_base64url:()=>MA,sha1_hex:()=>DA,sha256_base64:()=>zA,sha256_base64url:()=>FA,sha256_hex:()=>UA,sha384_base64:()=>BA,sha384_base64url:()=>WA,sha384_hex:()=>GA,sha512_base64:()=>ZA,sha512_base64url:()=>HA,sha512_hex:()=>KA,string:()=>Zl,time:()=>Wl,ulid:()=>Tl,undefined:()=>ql,unicodeEmail:()=>Ay,uppercase:()=>Ql,uuid:()=>Wn,uuid4:()=>kA,uuid6:()=>xA,uuid7:()=>SA,xid:()=>Al});function Rl(){return new RegExp(IA,"u")}function Py(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 Wl(e){return new RegExp(`^${Py(e)}$`)}function Kl(e){let t=Py({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(`^${Iy}T(?:${o})$`)}function Po(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Co(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var El,$l,Tl,Al,Il,Pl,Cl,_A,Ol,Wn,kA,xA,SA,Nl,EA,$A,Ay,TA,AA,IA,Ll,Dl,jl,Ml,Ul,zl,la,PA,CA,Fl,Gl,Iy,Bl,Zl,Hl,Vl,da,Yl,Jl,ql,Xl,Ql,OA,NA,RA,LA,DA,jA,MA,UA,zA,FA,GA,BA,WA,KA,ZA,HA,ua=v(()=>{ee();El=/^[cC][0-9a-z]{6,}$/,$l=/^[0-9a-z]+$/,Tl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Al=/^[0-9a-vA-V]{20}$/,Il=/^[A-Za-z0-9]{27}$/,Pl=/^[a-zA-Z0-9_-]{21}$/,Cl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_A=/^[-+]?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)?)??$/,Ol=/^([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})$/,Wn=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)$/,kA=Wn(4),xA=Wn(6),SA=Wn(7),Nl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,EA=/^[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])?)*$/,$A=/^(([^<>()\[\]\\.,;:\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,}))$/,Ay=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,TA=Ay,AA=/^[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])?)*$/,IA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Ll=/^(?:(?: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])$/,Dl=/^(([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}|:))$/,jl=e=>{let t=gt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ml=/^((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])$/,Ul=/^(([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])$/,zl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,la=/^[A-Za-z0-9_-]*$/,PA=/^(?=.{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])?)*\.?$/,CA=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Fl=/^https?$/,Gl=/^\+[1-9]\d{6,14}$/,Iy="(?:(?:\\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])))",Bl=new RegExp(`^${Iy}$`);Zl=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Hl=/^-?\d+n?$/,Vl=/^-?\d+$/,da=/^-?\d+(?:\.\d+)?$/,Yl=/^(?:true|false)$/i,Jl=/^null$/i,ql=/^undefined$/i,Xl=/^[^A-Z]*$/,Ql=/^[^a-z]*$/,OA=/^[0-9a-fA-F]*$/;NA=/^[0-9a-fA-F]{32}$/,RA=Po(22,"=="),LA=Co(22),DA=/^[0-9a-fA-F]{40}$/,jA=Po(27,"="),MA=Co(27),UA=/^[0-9a-fA-F]{64}$/,zA=Po(43,"="),FA=Co(43),GA=/^[0-9a-fA-F]{96}$/,BA=Po(64,""),WA=Co(64),KA=/^[0-9a-fA-F]{128}$/,ZA=Po(86,"=="),HA=Co(86)});function Cy(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues))}var be,Oy,pa,ha,ed,td,nd,rd,od,id,ad,sd,cd,br,ld,dd,ud,pd,hd,md,fd,gd,yd,ma=v(()=>{Gn();ua();ee();be=w("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Oy={number:"number",bigint:"bigint",object:"date"},pa=w("$ZodCheckLessThan",(e,t)=>{be.init(e,t);let r=Oy[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})}}),ha=w("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);let r=Oy[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})}}),ed=w("$ZodCheckMultipleOf",(e,t)=>{be.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):dl(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})}}),td=w("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=gl[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=Vl)}),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})}}),nd=w("$ZodCheckBigIntFormat",(e,t)=>{be.init(e,t);let[r,o]=yl[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})}}),rd=w("$ZodCheckMaxSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:Eo(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),od=w("$ZodCheckMinSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:Eo(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),id=w("$ZodCheckSizeEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:Eo(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})}}),ad=w("$ZodCheckMaxLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=$o(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),sd=w("$ZodCheckMinLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=$o(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cd=w("$ZodCheckLengthEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=$o(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})}}),br=w("$ZodCheckStringFormat",(e,t)=>{var r,o;be.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=()=>{})}),ld=w("$ZodCheckRegex",(e,t)=>{br.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})}}),dd=w("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Xl),br.init(e,t)}),ud=w("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ql),br.init(e,t)}),pd=w("$ZodCheckIncludes",(e,t)=>{be.init(e,t);let r=gt(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})}}),hd=w("$ZodCheckStartsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`^${gt(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})}}),md=w("$ZodCheckEndsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`.*${gt(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})}});fd=w("$ZodCheckProperty",(e,t)=>{be.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=>Cy(n,r,t.property));Cy(o,r,t.property)}}),gd=w("$ZodCheckMimeType",(e,t)=>{be.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})}}),yd=w("$ZodCheckOverwrite",(e,t)=>{be.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Oo,vd=v(()=>{Oo=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(`
10080
+ `)}process.exit(1)}var dr,ZT,lr,O,HT,VT,Ce=v(()=>{"use strict";dr=!1;ZT=()=>!dr&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,lr=(e,t)=>ZT()?`\x1B[${e}m${t}\x1B[0m`:t,O={bold:e=>lr("1",e),dim:e=>lr("2",e),red:e=>lr("31",e),green:e=>lr("32",e),yellow:e=>lr("33",e),cyan:e=>lr("36",e)};HT=["admin","adopt","archive","client","create","deploy","dev","doctor","endpoint","graphic","help","inspect","issue","link","login","logout","logs","manifest","plan","promote","prune","reference","round","start","status","suggest","suspend","verify","wake","whoami"],VT=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function zn(e,t={}){let r=e?.trim()||ur;return t.lower&&!/[A-Z]/.test(r.slice(1))&&(r=r.toLowerCase()),t.plural?`${r}s`:r}var ur,_o=v(()=>{"use strict";ur="Round"});function Ge(e){return oA[e]??e}function Iy(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let r=Ge(t.archetype);return r===t.archetype?e:{...t,archetype:r}}var Qi,oA,pl,Py,Ht=v(()=>{"use strict";Qi=["hunt","push","group","predict","bingo","shoot"],oA={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};pl={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"},Py={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties"}});function w(e,t,r){function o(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,p=Object.keys(l);for(let h=0;h<p.length;h++){let f=p[h];f in s||(s[f]=l[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var u;let l=r?.Parent?new i:this;o(l,s),(u=l._zod).deferred??(u.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 Te(e){return e&&Object.assign(Fn,e),Fn}var Cy,hl,ml,St,ln,Fn,Gn=v(()=>{hl=Object.freeze({status:"aborted"});ml=Symbol("zod_brand"),St=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ln=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Cy=globalThis).__zod_globalConfig??(Cy.__zod_globalConfig={});Fn=globalThis.__zod_globalConfig});var B={};It(B,{BIGINT_FORMAT_RANGES:()=>Sl,Class:()=>gl,NUMBER_FORMAT_RANGES:()=>xl,aborted:()=>hn,allowsEval:()=>bl,assert:()=>lA,assertEqual:()=>iA,assertIs:()=>sA,assertNever:()=>cA,assertNotEqual:()=>aA,assignProp:()=>un,base64ToUint8Array:()=>Ny,base64urlToUint8Array:()=>$A,cached:()=>hr,captureStackTrace:()=>ta,cleanEnum:()=>EA,cleanRegex:()=>So,clone:()=>Je,cloneDef:()=>uA,createTransparentProxy:()=>yA,defineLazy:()=>pe,esc:()=>ea,escapeRegex:()=>gt,explicitlyAborted:()=>El,extend:()=>wA,finalizeIssue:()=>qe,floatSafeRemainder:()=>yl,getElementAtPath:()=>pA,getEnumValues:()=>xo,getLengthableOrigin:()=>To,getParsedType:()=>gA,getSizableOrigin:()=>$o,hexToUint8Array:()=>AA,isObject:()=>Bn,isPlainObject:()=>pn,issue:()=>mr,joinValues:()=>T,jsonStringifyReplacer:()=>pr,merge:()=>kA,mergeDefs:()=>Vt,normalizeParams:()=>Z,nullish:()=>dn,numKeys:()=>fA,objectClone:()=>dA,omit:()=>bA,optionalKeys:()=>kl,parsedType:()=>F,partial:()=>xA,pick:()=>vA,prefixIssues:()=>rt,primitiveTypes:()=>_l,promiseAllObject:()=>hA,propertyKeyTypes:()=>Eo,randomString:()=>mA,required:()=>SA,safeExtend:()=>_A,shallowClone:()=>wl,slugify:()=>vl,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>Ry,uint8ArrayToBase64url:()=>TA,uint8ArrayToHex:()=>IA,unwrapMessage:()=>ko});function iA(e){return e}function aA(e){return e}function sA(e){}function cA(e){throw new Error("Unexpected value in exhaustive check")}function lA(e){}function xo(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 T(e,t="|"){return e.map(r=>z(r)).join(t)}function pr(e,t){return typeof t=="bigint"?t.toString():t}function hr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function dn(e){return e==null}function So(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function yl(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 pe(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Oy)return o===void 0&&(o=Oy,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function dA(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function un(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function uA(e){return Vt(e._zod.def)}function pA(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function hA(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 mA(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 vl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pn(e){if(Bn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Bn(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function wl(e){return pn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function fA(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(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 yA(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 z(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function kl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vA(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=Vt(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 un(this,"shape",a),a},checks:[]});return Je(e,i)}function bA(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=Vt(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 un(this,"shape",a),a},checks:[]});return Je(e,i)}function wA(e,t){if(!pn(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=Vt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return un(this,"shape",i),i}});return Je(e,n)}function _A(e,t){if(!pn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return un(this,"shape",o),o}});return Je(e,r)}function kA(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=Vt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return un(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Je(e,r)}function xA(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=Vt(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return un(this,"shape",u),u},checks:[]});return Je(t,a)}function SA(e,t,r){let o=Vt(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 un(this,"shape",i),i}});return Je(t,o)}function hn(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 El(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 rt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function ko(e){return typeof e=="string"?e:e?.message}function qe(e,t,r){let o=e.message?e.message:ko(e.inst?._zod.def?.error?.(e))??ko(t?.error?.(e))??ko(r.customError?.(e))??ko(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 $o(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function To(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function F(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 mr(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function EA(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ny(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 Ry(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function $A(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ny(t+r)}function TA(e){return Ry(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function AA(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 IA(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Oy,ta,bl,gA,Eo,_l,xl,Sl,gl,te=v(()=>{Gn();Oy=Symbol("evaluating");ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};bl=hr(()=>{if(Fn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});gA=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}`)}},Eo=new Set(["string","number","symbol"]),_l=new Set(["string","number","bigint","boolean","symbol","undefined"]);xl={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]},Sl={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};gl=class{constructor(...t){}}});function Io(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 Po(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 u=r,l=0;for(;l<s.length;){let p=s[l];l===s.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(a))):u[p]=u[p]||{_errors:[]},u=u[p],l++}}}};return o(e),r}function $l(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>o({issues:l},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let l=[...i,...u.path];if(l.length===0){r.errors.push(t(u));continue}let p=r,h=0;for(;h<l.length;){let f=l[h],g=h===l.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),g&&p.errors.push(t(u)),h++}}};return o(e),r}function Dy(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 Tl(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 ${Dy(o.path)}`);return t.join(`
10081
+ `)}var Ly,Ao,ot,Al=v(()=>{Gn();te();Ly=(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,pr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ao=w("$ZodError",Ly),ot=w("$ZodError",Ly,{Parent:Error})});var fr,na,gr,ra,yr,Il,vr,Pl,oa,CA,ia,OA,aa,NA,sa,RA,ca,LA,la,DA,da,jA,ua,MA,Cl=v(()=>{Gn();Al();te();fr=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 St;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>qe(u,i,Te())));throw ta(s,n?.callee),s}return a.value},na=fr(ot),gr=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(u=>qe(u,i,Te())));throw ta(s,n?.callee),s}return a.value},ra=gr(ot),yr=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 St;return i.issues.length?{success:!1,error:new(e??Ao)(i.issues.map(a=>qe(a,n,Te())))}:{success:!0,data:i.value}},Il=yr(ot),vr=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=>qe(a,n,Te())))}:{success:!0,data:i.value}},Pl=vr(ot),oa=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return fr(e)(t,r,n)},CA=oa(ot),ia=e=>(t,r,o)=>fr(e)(t,r,o),OA=ia(ot),aa=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return gr(e)(t,r,n)},NA=aa(ot),sa=e=>async(t,r,o)=>gr(e)(t,r,o),RA=sa(ot),ca=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yr(e)(t,r,n)},LA=ca(ot),la=e=>(t,r,o)=>yr(e)(t,r,o),DA=la(ot),da=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)},jA=da(ot),ua=e=>async(t,r,o)=>vr(e)(t,r,o),MA=ua(ot)});var ut={};It(ut,{base64:()=>Hl,base64url:()=>pa,bigint:()=>ed,boolean:()=>nd,browserEmail:()=>ZA,cidrv4:()=>Kl,cidrv6:()=>Zl,cuid:()=>Ol,cuid2:()=>Nl,date:()=>Jl,datetime:()=>Xl,domain:()=>YA,duration:()=>Ml,e164:()=>Yl,email:()=>zl,emoji:()=>Fl,extendedDuration:()=>UA,guid:()=>Ul,hex:()=>JA,hostname:()=>VA,html5Email:()=>BA,httpProtocol:()=>Vl,idnEmail:()=>KA,integer:()=>td,ipv4:()=>Gl,ipv6:()=>Bl,ksuid:()=>Dl,lowercase:()=>id,mac:()=>Wl,md5_base64:()=>XA,md5_base64url:()=>QA,md5_hex:()=>qA,nanoid:()=>jl,null:()=>rd,number:()=>ha,rfc5322Email:()=>WA,sha1_base64:()=>tI,sha1_base64url:()=>nI,sha1_hex:()=>eI,sha256_base64:()=>oI,sha256_base64url:()=>iI,sha256_hex:()=>rI,sha384_base64:()=>sI,sha384_base64url:()=>cI,sha384_hex:()=>aI,sha512_base64:()=>dI,sha512_base64url:()=>uI,sha512_hex:()=>lI,string:()=>Ql,time:()=>ql,ulid:()=>Rl,undefined:()=>od,unicodeEmail:()=>jy,uppercase:()=>ad,uuid:()=>Wn,uuid4:()=>zA,uuid6:()=>FA,uuid7:()=>GA,xid:()=>Ll});function Fl(){return new RegExp(HA,"u")}function Uy(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 ql(e){return new RegExp(`^${Uy(e)}$`)}function Xl(e){let t=Uy({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(`^${My}T(?:${o})$`)}function Co(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Oo(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ol,Nl,Rl,Ll,Dl,jl,Ml,UA,Ul,Wn,zA,FA,GA,zl,BA,WA,jy,KA,ZA,HA,Gl,Bl,Wl,Kl,Zl,Hl,pa,VA,YA,Vl,Yl,My,Jl,Ql,ed,td,ha,nd,rd,od,id,ad,JA,qA,XA,QA,eI,tI,nI,rI,oI,iI,aI,sI,cI,lI,dI,uI,ma=v(()=>{te();Ol=/^[cC][0-9a-z]{6,}$/,Nl=/^[0-9a-z]+$/,Rl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ll=/^[0-9a-vA-V]{20}$/,Dl=/^[A-Za-z0-9]{27}$/,jl=/^[a-zA-Z0-9_-]{21}$/,Ml=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UA=/^[-+]?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)?)??$/,Ul=/^([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})$/,Wn=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)$/,zA=Wn(4),FA=Wn(6),GA=Wn(7),zl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BA=/^[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])?)*$/,WA=/^(([^<>()\[\]\\.,;:\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,}))$/,jy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,KA=jy,ZA=/^[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])?)*$/,HA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Gl=/^(?:(?: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])$/,Bl=/^(([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}|:))$/,Wl=e=>{let t=gt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Kl=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Zl=/^(([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])$/,Hl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pa=/^[A-Za-z0-9_-]*$/,VA=/^(?=.{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])?)*\.?$/,YA=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Vl=/^https?$/,Yl=/^\+[1-9]\d{6,14}$/,My="(?:(?:\\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])))",Jl=new RegExp(`^${My}$`);Ql=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ed=/^-?\d+n?$/,td=/^-?\d+$/,ha=/^-?\d+(?:\.\d+)?$/,nd=/^(?:true|false)$/i,rd=/^null$/i,od=/^undefined$/i,id=/^[^A-Z]*$/,ad=/^[^a-z]*$/,JA=/^[0-9a-fA-F]*$/;qA=/^[0-9a-fA-F]{32}$/,XA=Co(22,"=="),QA=Oo(22),eI=/^[0-9a-fA-F]{40}$/,tI=Co(27,"="),nI=Oo(27),rI=/^[0-9a-fA-F]{64}$/,oI=Co(43,"="),iI=Oo(43),aI=/^[0-9a-fA-F]{96}$/,sI=Co(64,""),cI=Oo(64),lI=/^[0-9a-fA-F]{128}$/,dI=Co(86,"=="),uI=Oo(86)});function zy(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues))}var be,Fy,fa,ga,sd,cd,ld,dd,ud,pd,hd,md,fd,br,gd,yd,vd,bd,wd,_d,kd,xd,Sd,ya=v(()=>{Gn();ma();te();be=w("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Fy={number:"number",bigint:"bigint",object:"date"},fa=w("$ZodCheckLessThan",(e,t)=>{be.init(e,t);let r=Fy[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})}}),ga=w("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);let r=Fy[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})}}),sd=w("$ZodCheckMultipleOf",(e,t)=>{be.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):yl(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})}}),cd=w("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=xl[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=td)}),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})}}),ld=w("$ZodCheckBigIntFormat",(e,t)=>{be.init(e,t);let[r,o]=Sl[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})}}),dd=w("$ZodCheckMaxSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:$o(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ud=w("$ZodCheckMinSize",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:$o(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pd=w("$ZodCheckSizeEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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:$o(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})}}),hd=w("$ZodCheckMaxLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=To(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),md=w("$ZodCheckMinLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=To(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fd=w("$ZodCheckLengthEquals",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!dn(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=To(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})}}),br=w("$ZodCheckStringFormat",(e,t)=>{var r,o;be.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=()=>{})}),gd=w("$ZodCheckRegex",(e,t)=>{br.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})}}),yd=w("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=id),br.init(e,t)}),vd=w("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ad),br.init(e,t)}),bd=w("$ZodCheckIncludes",(e,t)=>{be.init(e,t);let r=gt(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})}}),wd=w("$ZodCheckStartsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`^${gt(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})}}),_d=w("$ZodCheckEndsWith",(e,t)=>{be.init(e,t);let r=new RegExp(`.*${gt(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})}});kd=w("$ZodCheckProperty",(e,t)=>{be.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=>zy(n,r,t.property));zy(o,r,t.property)}}),xd=w("$ZodCheckMimeType",(e,t)=>{be.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})}}),Sd=w("$ZodCheckOverwrite",(e,t)=>{be.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var No,Ed=v(()=>{No=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(`
10082
10082
  `).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(`
10083
- `))}}});var bd,wd=v(()=>{bd={major:4,minor:4,patch:3}});function Gd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Vy(e){if(!la.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gd(r)}function Yy(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 Ry(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues)),t.value[r]=e.value}function va(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...rt(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 Jy(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=fl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function qy(e,t,r,o,n,i){let a=[],s=n.keySet,u=n.catchall._zod,l=u.def.type,p=u.optin==="optional",h=u.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){a.push(f);continue}let g=u.run({value:t[f],issues:[]},o);g instanceof Promise?e.push(g.then(k=>va(k,r,f,t,p,h))):va(g,r,f,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 Ly(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=>!hn(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=>qe(a,o,$e())))}),t)}function Dy(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=>qe(a,o,$e())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function _d(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(pn(e)&&pn(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=_d(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=_d(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 jy(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).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}),hn(e))return e;let a=_d(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 My(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Uy(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues)),t.value[r]=e.value}function zy(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(...rt(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 Fy(e,t,r,o,n,i,a){e.issues.length&&(So.has(typeof o)?r.issues.push(...rt(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>qe(s,a,$e()))})),t.issues.length&&(So.has(typeof o)?r.issues.push(...rt(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>qe(s,a,$e()))})),r.value.set(e.value,t.value)}function Gy(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function By(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Wy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Ky(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 fa(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 ga(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=>ya(e,i,t.out,r)):ya(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>ya(e,i,t.in,r)):ya(e,n,t.in,r)}}function ya(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function Zy(e){return e.value=Object.freeze(e.value),e}function Hy(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(mr(n))}}var ie,Kn,ye,kd,xd,Sd,Ed,$d,Td,Ad,Id,Pd,Cd,Od,Nd,Rd,Ld,Dd,jd,Md,Ud,zd,Fd,Bd,Wd,Kd,Zd,Hd,ba,Vd,No,wa,Yd,Jd,qd,Xd,Qd,eu,tu,nu,ru,ou,Xy,iu,Ro,au,su,cu,_a,lu,du,uu,pu,hu,mu,fu,ka,gu,yu,vu,bu,wu,_u,ku,xu,xa,Lo,Su,Eu,$u,Tu,Au,Iu,Pu,Cu=v(()=>{ma();Gn();vd();Sl();ua();ee();wd();ee();ie=w("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bd;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,u)=>{let l=hn(a),p;for(let h of s){if(h._zod.def.when){if(vl(a)||!h._zod.def.when(a))continue}else if(l)continue;let f=a.issues.length,g=h._zod.check(a);if(g instanceof Promise&&u?.async===!1)throw new St;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,a.issues.length!==f&&(l||(l=hn(a,f)))});else{if(a.issues.length===f)continue;l||(l=hn(a,f))}}return p?p.then(()=>a):a},i=(a,s,u)=>{if(hn(a))return a.aborted=!0,a;let l=n(s,o,u);if(l instanceof Promise){if(u.async===!1)throw new St;return l.then(p=>e._zod.parse(p,u))}return e._zod.parse(l,u)};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 u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new St;return u.then(l=>n(l,o,s))}return n(u,o,s)}}pe(e,"~standard",()=>({validate:n=>{try{let i=kl(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return xl(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Kn=w("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Zl(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}}),ye=w("$ZodStringFormat",(e,t)=>{br.init(e,t),Kn.init(e,t)}),kd=w("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ol),ye.init(e,t)}),xd=w("$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=Wn(o))}else t.pattern??(t.pattern=Wn());ye.init(e,t)}),Sd=w("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Nl),ye.init(e,t)}),Ed=w("$ZodURL",(e,t)=>{ye.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Fl.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})}}}),$d=w("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Rl()),ye.init(e,t)}),Td=w("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Pl),ye.init(e,t)}),Ad=w("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=El),ye.init(e,t)}),Id=w("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$l),ye.init(e,t)}),Pd=w("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Tl),ye.init(e,t)}),Cd=w("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Al),ye.init(e,t)}),Od=w("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Il),ye.init(e,t)}),Nd=w("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Kl(t)),ye.init(e,t)}),Rd=w("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bl),ye.init(e,t)}),Ld=w("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wl(t)),ye.init(e,t)}),Dd=w("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cl),ye.init(e,t)}),jd=w("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ll),ye.init(e,t),e._zod.bag.format="ipv4"}),Md=w("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Dl),ye.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})}}}),Ud=w("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=jl(t.delimiter)),ye.init(e,t),e._zod.bag.format="mac"}),zd=w("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ml),ye.init(e,t)}),Fd=w("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ul),ye.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})}}});Bd=w("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=zl),ye.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Gd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Wd=w("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=la),ye.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Vy(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Kd=w("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gl),ye.init(e,t)});Zd=w("$ZodJWT",(e,t)=>{ye.init(e,t),e._zod.check=r=>{Yy(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Hd=w("$ZodCustomStringFormat",(e,t)=>{ye.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})}}),ba=w("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??da,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}}),Vd=w("$ZodNumberFormat",(e,t)=>{td.init(e,t),ba.init(e,t)}),No=w("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=Yl,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}}),wa=w("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=Hl,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}}),Yd=w("$ZodBigIntFormat",(e,t)=>{nd.init(e,t),wa.init(e,t)}),Jd=w("$ZodSymbol",(e,t)=>{ie.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}}),qd=w("$ZodUndefined",(e,t)=>{ie.init(e,t),e._zod.pattern=ql,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}}),Xd=w("$ZodNull",(e,t)=>{ie.init(e,t),e._zod.pattern=Jl,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}}),Qd=w("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),eu=w("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),tu=w("$ZodNever",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),nu=w("$ZodVoid",(e,t)=>{ie.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}}),ru=w("$ZodDate",(e,t)=>{ie.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}});ou=w("$ZodArray",(e,t)=>{ie.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],u=t.element._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(l=>Ry(l,r,a))):Ry(u,r,a)}return i.length?Promise.all(i).then(()=>r):r}});Xy=w("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=hr(()=>Jy(t));pe(e._zod,"propValues",()=>{let s=t.shape,u={};for(let l in s){let p=s[l]._zod;if(p.values){u[l]??(u[l]=new Set);for(let h of p.values)u[l].add(h)}}return u});let n=Bn,i=t.catchall,a;e._zod.parse=(s,u)=>{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 f of a.keys){let g=h[f],k=g._zod.optin==="optional",L=g._zod.optout==="optional",b=g._zod.run({value:l[f],issues:[]},u);b instanceof Promise?p.push(b.then(x=>va(x,s,f,l,k,L))):va(b,s,f,l,k,L)}return i?qy(p,l,s,u,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),iu=w("$ZodObjectJIT",(e,t)=>{Xy.init(e,t);let r=e._zod.parse,o=hr(()=>Jy(t)),n=f=>{let g=new Oo(["shape","payload","ctx"]),k=o.value,L=$=>{let j=qi($);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};g.write("const input = payload.value;");let b=Object.create(null),x=0;for(let $ of k.keys)b[$]=`key_${x++}`;g.write("const newResult = {};");for(let $ of k.keys){let j=b[$],I=qi($),ae=f[$],oe=ae?._zod?.optin==="optional",de=ae?._zod?.optout==="optional";g.write(`const ${j} = ${L($)};`),oe&&de?g.write(`
10083
+ `))}}});var $d,Td=v(()=>{$d={major:4,minor:4,patch:3}});function Yd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function rv(e){if(!pa.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yd(r)}function ov(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 By(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues)),t.value[r]=e.value}function _a(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...rt(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 iv(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=kl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function av(e,t,r,o,n,i){let a=[],s=n.keySet,u=n.catchall._zod,l=u.def.type,p=u.optin==="optional",h=u.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){a.push(f);continue}let g=u.run({value:t[f],issues:[]},o);g instanceof Promise?e.push(g.then(k=>_a(k,r,f,t,p,h))):_a(g,r,f,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 Wy(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=>!hn(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=>qe(a,o,Te())))}),t)}function Ky(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=>qe(a,o,Te())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Ad(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(pn(e)&&pn(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=Ad(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=Ad(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 Zy(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).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}),hn(e))return e;let a=Ad(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 Hy(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function Vy(e,t,r){e.issues.length&&t.issues.push(...rt(r,e.issues)),t.value[r]=e.value}function Yy(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(...rt(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 Jy(e,t,r,o,n,i,a){e.issues.length&&(Eo.has(typeof o)?r.issues.push(...rt(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>qe(s,a,Te()))})),t.issues.length&&(Eo.has(typeof o)?r.issues.push(...rt(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>qe(s,a,Te()))})),r.value.set(e.value,t.value)}function qy(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Xy(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function Qy(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function ev(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 va(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 ba(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=>wa(e,i,t.out,r)):wa(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>wa(e,i,t.in,r)):wa(e,n,t.in,r)}}function wa(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function tv(e){return e.value=Object.freeze(e.value),e}function nv(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(mr(n))}}var ie,Kn,ye,Id,Pd,Cd,Od,Nd,Rd,Ld,Dd,jd,Md,Ud,zd,Fd,Gd,Bd,Wd,Kd,Zd,Hd,Vd,Jd,qd,Xd,Qd,eu,ka,tu,Ro,xa,nu,ru,ou,iu,au,su,cu,lu,du,uu,sv,pu,Lo,hu,mu,fu,Sa,gu,yu,vu,bu,wu,_u,ku,Ea,xu,Su,Eu,$u,Tu,Au,Iu,Pu,$a,Do,Cu,Ou,Nu,Ru,Lu,Du,ju,Mu=v(()=>{ya();Gn();Ed();Cl();ma();te();Td();te();ie=w("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$d;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,u)=>{let l=hn(a),p;for(let h of s){if(h._zod.def.when){if(El(a)||!h._zod.def.when(a))continue}else if(l)continue;let f=a.issues.length,g=h._zod.check(a);if(g instanceof Promise&&u?.async===!1)throw new St;if(p||g instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await g,a.issues.length!==f&&(l||(l=hn(a,f)))});else{if(a.issues.length===f)continue;l||(l=hn(a,f))}}return p?p.then(()=>a):a},i=(a,s,u)=>{if(hn(a))return a.aborted=!0,a;let l=n(s,o,u);if(l instanceof Promise){if(u.async===!1)throw new St;return l.then(p=>e._zod.parse(p,u))}return e._zod.parse(l,u)};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 u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new St;return u.then(l=>n(l,o,s))}return n(u,o,s)}}pe(e,"~standard",()=>({validate:n=>{try{let i=Il(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Pl(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Kn=w("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ql(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}}),ye=w("$ZodStringFormat",(e,t)=>{br.init(e,t),Kn.init(e,t)}),Id=w("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ul),ye.init(e,t)}),Pd=w("$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=Wn(o))}else t.pattern??(t.pattern=Wn());ye.init(e,t)}),Cd=w("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zl),ye.init(e,t)}),Od=w("$ZodURL",(e,t)=>{ye.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Vl.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})}}}),Nd=w("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fl()),ye.init(e,t)}),Rd=w("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jl),ye.init(e,t)}),Ld=w("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ol),ye.init(e,t)}),Dd=w("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nl),ye.init(e,t)}),jd=w("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Rl),ye.init(e,t)}),Md=w("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ll),ye.init(e,t)}),Ud=w("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Dl),ye.init(e,t)}),zd=w("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Xl(t)),ye.init(e,t)}),Fd=w("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Jl),ye.init(e,t)}),Gd=w("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ql(t)),ye.init(e,t)}),Bd=w("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ml),ye.init(e,t)}),Wd=w("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gl),ye.init(e,t),e._zod.bag.format="ipv4"}),Kd=w("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bl),ye.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})}}}),Zd=w("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Wl(t.delimiter)),ye.init(e,t),e._zod.bag.format="mac"}),Hd=w("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kl),ye.init(e,t)}),Vd=w("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Zl),ye.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})}}});Jd=w("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Hl),ye.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Yd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});qd=w("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=pa),ye.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{rv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Xd=w("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Yl),ye.init(e,t)});Qd=w("$ZodJWT",(e,t)=>{ye.init(e,t),e._zod.check=r=>{ov(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),eu=w("$ZodCustomStringFormat",(e,t)=>{ye.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})}}),ka=w("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??ha,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}}),tu=w("$ZodNumberFormat",(e,t)=>{cd.init(e,t),ka.init(e,t)}),Ro=w("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=nd,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}}),xa=w("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=ed,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}}),nu=w("$ZodBigIntFormat",(e,t)=>{ld.init(e,t),xa.init(e,t)}),ru=w("$ZodSymbol",(e,t)=>{ie.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}}),ou=w("$ZodUndefined",(e,t)=>{ie.init(e,t),e._zod.pattern=od,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}}),iu=w("$ZodNull",(e,t)=>{ie.init(e,t),e._zod.pattern=rd,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}}),au=w("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),su=w("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),cu=w("$ZodNever",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),lu=w("$ZodVoid",(e,t)=>{ie.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}}),du=w("$ZodDate",(e,t)=>{ie.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}});uu=w("$ZodArray",(e,t)=>{ie.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],u=t.element._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(l=>By(l,r,a))):By(u,r,a)}return i.length?Promise.all(i).then(()=>r):r}});sv=w("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=hr(()=>iv(t));pe(e._zod,"propValues",()=>{let s=t.shape,u={};for(let l in s){let p=s[l]._zod;if(p.values){u[l]??(u[l]=new Set);for(let h of p.values)u[l].add(h)}}return u});let n=Bn,i=t.catchall,a;e._zod.parse=(s,u)=>{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 f of a.keys){let g=h[f],k=g._zod.optin==="optional",L=g._zod.optout==="optional",b=g._zod.run({value:l[f],issues:[]},u);b instanceof Promise?p.push(b.then(x=>_a(x,s,f,l,k,L))):_a(b,s,f,l,k,L)}return i?av(p,l,s,u,o.value,e):p.length?Promise.all(p).then(()=>s):s}}),pu=w("$ZodObjectJIT",(e,t)=>{sv.init(e,t);let r=e._zod.parse,o=hr(()=>iv(t)),n=f=>{let g=new No(["shape","payload","ctx"]),k=o.value,L=$=>{let j=ea($);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};g.write("const input = payload.value;");let b=Object.create(null),x=0;for(let $ of k.keys)b[$]=`key_${x++}`;g.write("const newResult = {};");for(let $ of k.keys){let j=b[$],P=ea($),ae=f[$],oe=ae?._zod?.optin==="optional",de=ae?._zod?.optout==="optional";g.write(`const ${j} = ${L($)};`),oe&&de?g.write(`
10084
10084
  if (${j}.issues.length) {
10085
- if (${I} in input) {
10085
+ if (${P} in input) {
10086
10086
  payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
10087
10087
  ...iss,
10088
- path: iss.path ? [${I}, ...iss.path] : [${I}]
10088
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
10089
10089
  })));
10090
10090
  }
10091
10091
  }
10092
10092
 
10093
10093
  if (${j}.value === undefined) {
10094
- if (${I} in input) {
10095
- newResult[${I}] = undefined;
10094
+ if (${P} in input) {
10095
+ newResult[${P}] = undefined;
10096
10096
  }
10097
10097
  } else {
10098
- newResult[${I}] = ${j}.value;
10098
+ newResult[${P}] = ${j}.value;
10099
10099
  }
10100
10100
 
10101
10101
  `):oe?g.write(`
10102
10102
  if (${j}.issues.length) {
10103
10103
  payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
10104
10104
  ...iss,
10105
- path: iss.path ? [${I}, ...iss.path] : [${I}]
10105
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
10106
10106
  })));
10107
10107
  }
10108
10108
 
10109
10109
  if (${j}.value === undefined) {
10110
- if (${I} in input) {
10111
- newResult[${I}] = undefined;
10110
+ if (${P} in input) {
10111
+ newResult[${P}] = undefined;
10112
10112
  }
10113
10113
  } else {
10114
- newResult[${I}] = ${j}.value;
10114
+ newResult[${P}] = ${j}.value;
10115
10115
  }
10116
10116
 
10117
10117
  `):g.write(`
10118
- const ${j}_present = ${I} in input;
10118
+ const ${j}_present = ${P} in input;
10119
10119
  if (${j}.issues.length) {
10120
10120
  payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
10121
10121
  ...iss,
10122
- path: iss.path ? [${I}, ...iss.path] : [${I}]
10122
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
10123
10123
  })));
10124
10124
  }
10125
10125
  if (!${j}_present && !${j}.issues.length) {
@@ -10127,55 +10127,55 @@ main().catch((error) => {
10127
10127
  code: "invalid_type",
10128
10128
  expected: "nonoptional",
10129
10129
  input: undefined,
10130
- path: [${I}]
10130
+ path: [${P}]
10131
10131
  });
10132
10132
  }
10133
10133
 
10134
10134
  if (${j}_present) {
10135
10135
  if (${j}.value === undefined) {
10136
- newResult[${I}] = undefined;
10136
+ newResult[${P}] = undefined;
10137
10137
  } else {
10138
- newResult[${I}] = ${j}.value;
10138
+ newResult[${P}] = ${j}.value;
10139
10139
  }
10140
10140
  }
10141
10141
 
10142
- `)}g.write("payload.value = newResult;"),g.write("return payload;");let S=g.compile();return($,j)=>S(f,$,j)},i,a=Bn,s=!Fn.jitless,l=s&&pl.value,p=t.catchall,h;e._zod.parse=(f,g)=>{h??(h=o.value);let k=f.value;return a(k)?s&&l&&g?.async===!1&&g.jitless!==!0?(i||(i=n(t.shape)),f=i(f,g),p?qy([],k,f,g,h,e):f):r(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});Ro=w("$ZodUnion",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(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=>xo(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 u=s._zod.run({value:o.value,issues:[]},n);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(s=>Ly(s,o,e,n)):Ly(a,o,e,n)}});au=w("$ZodXor",(e,t)=>{Ro.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 u=s._zod.run({value:o.value,issues:[]},n);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(s=>Dy(s,o,e,n)):Dy(a,o,e,n)}}),su=w("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ro.init(e,t);let r=e._zod.parse;pe(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,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of u)n[s].add(l)}}return n});let o=hr(()=>{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 u of s){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Bn(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)}}),cu=w("$ZodIntersection",(e,t)=>{ie.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(([u,l])=>jy(r,u,l)):jy(r,i,a)}});_a=w("$ZodTuple",(e,t)=>{ie.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=My(r,"optin"),u=My(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(f=>{l[p]=f})):l[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let f of h){p++;let g=t.rest._zod.run({value:f,issues:[]},n);g instanceof Promise?a.push(g.then(k=>Uy(k,o,p))):Uy(g,o,p)}}return a.length?Promise.all(a).then(()=>zy(l,o,r,i,u)):zy(l,o,r,i,u)}});lu=w("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!pn(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(g=>qe(g,o,$e())),input:l,path:[l],inst:e});continue}let h=p.value,f=t.valueType._zod.run({value:n[l],issues:[]},o);f instanceof Promise?i.push(f.then(g=>{g.issues.length&&r.issues.push(...rt(l,g.issues)),r.value[h]=g.value})):(f.issues.length&&r.issues.push(...rt(l,f.issues)),r.value[h]=f.value)}let u;for(let l in n)s.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let u=t.keyType._zod.run({value:s,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&da.test(s)&&u.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&&(u=h)}if(u.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>qe(h,o,$e())),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(...rt(s,h.issues)),r.value[u.value]=h.value})):(p.issues.length&&r.issues.push(...rt(s,p.issues)),r.value[u.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),du=w("$ZodMap",(e,t)=>{ie.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 u=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise||l instanceof Promise?i.push(Promise.all([u,l]).then(([p,h])=>{Fy(p,h,r,a,n,e,o)})):Fy(u,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});uu=w("$ZodSet",(e,t)=>{ie.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(u=>Gy(u,r))):Gy(s,r)}return i.length?Promise.all(i).then(()=>r):r}});pu=w("$ZodEnum",(e,t)=>{ie.init(e,t);let r=ko(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>So.has(typeof n)).map(n=>typeof n=="string"?gt(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}}),hu=w("$ZodLiteral",(e,t)=>{if(ie.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"?gt(o):o?gt(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}}),mu=w("$ZodFile",(e,t)=>{ie.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}}),fu=w("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln(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 St;return r.value=n,r.fallback=!0,r}});ka=w("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${xo(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=>By(a,n)):By(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),gu=w("$ZodExactOptional",(e,t)=>{ka.init(e,t),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),yu=w("$ZodNullable",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${xo(r.source)}|null)$`):void 0}),pe(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)}),vu=w("$ZodDefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(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=>Wy(i,t)):Wy(n,t)}});bu=w("$ZodPrefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(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))}),wu=w("$ZodNonOptional",(e,t)=>{ie.init(e,t),pe(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=>Ky(i,e)):Ky(n,e)}});_u=w("$ZodSuccess",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln("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)}}),ku=w("$ZodCatch",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(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=>qe(a,o,$e()))},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=>qe(i,o,$e()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),xu=w("$ZodNaN",(e,t)=>{ie.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)}),xa=w("$ZodPipe",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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=>fa(a,t.in,o)):fa(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>fa(i,t.out,o)):fa(n,t.out,o)}});Lo=w("$ZodCodec",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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=>ga(a,t,o)):ga(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>ga(a,t,o)):ga(i,t,o)}}});Su=w("$ZodPreprocess",(e,t)=>{xa.init(e,t)}),Eu=w("$ZodReadonly",(e,t)=>{ie.init(e,t),pe(e._zod,"propValues",()=>t.innerType._zod.propValues),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"optin",()=>t.innerType?._zod?.optin),pe(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(Zy):Zy(n)}});$u=w("$ZodTemplateLiteral",(e,t)=>{ie.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||ml.has(typeof o))r.push(gt(`${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)}),Tu=w("$ZodFunction",(e,t)=>(ie.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?Qi(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Qi(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 ea(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await ea(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 _a({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)),Au=w("$ZodPromise",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Iu=w("$ZodLazy",(e,t)=>{ie.init(e,t),pe(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),pe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),pe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),pe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),pe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Pu=w("$ZodCustom",(e,t)=>{be.init(e,t),ie.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=>Hy(i,r,o,e));Hy(n,r,o,e)}})});function Qy(){return{localeError:YA()}}var YA,ev=v(()=>{ee();YA=()=>{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=z(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 ${U(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: ${T(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":""}: ${T(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 tv(){return{localeError:JA()}}var JA,nv=v(()=>{ee();JA=()=>{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=z(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 ${U(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(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":""}: ${T(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 rv(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 ov(){return{localeError:qA()}}var qA,iv=v(()=>{ee();qA=()=>{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=z(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 ${U(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=rv(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()} ${u}`}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),u=rv(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()} ${u}`}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"}: ${T(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 av(){return{localeError:XA()}}var XA,sv=v(()=>{ee();XA=()=>{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=z(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 ${U(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 ${T(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":""}: ${T(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 cv(){return{localeError:QA()}}var QA,lv=v(()=>{ee();QA=()=>{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=z(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 ${U(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(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":""}: ${T(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 dv(){return{localeError:eI()}}var eI,uv=v(()=>{ee();eI=()=>{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=z(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 ${U(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(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: ${T(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 pv(){return{localeError:tI()}}var tI,hv=v(()=>{ee();tI=()=>{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=z(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 ${U(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(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"}: ${T(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 mv(){return{localeError:nI()}}var nI,fv=v(()=>{ee();nI=()=>{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=z(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 ${U(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(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"}: ${T(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 gv(){return{localeError:rI()}}var rI,yv=v(()=>{ee();rI=()=>{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=z(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 ${U(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 ${T(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"}: ${T(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 Sa(){return{localeError:oI()}}var oI,Ou=v(()=>{ee();oI=()=>{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=z(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${U(n.values[0])}`:`Invalid option: expected one of ${T(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":""}: ${T(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 vv(){return{localeError:iI()}}var iI,bv=v(()=>{ee();iI=()=>{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=z(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 ${U(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(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":""}: ${T(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 wv(){return{localeError:aI()}}var aI,_v=v(()=>{ee();aI=()=>{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=z(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 ${U(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(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":""}: ${T(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 kv(){return{localeError:sI()}}var sI,xv=v(()=>{ee();sI=()=>{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=z(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 ${U(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 ${T(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: ${T(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 Sv(){return{localeError:cI()}}var cI,Ev=v(()=>{ee();cI=()=>{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=z(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 ${U(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(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"}: ${T(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 $v(){return{localeError:lI()}}var lI,Tv=v(()=>{ee();lI=()=>{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=z(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 : ${U(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(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":""} : ${T(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 Av(){return{localeError:dI()}}var dI,Iv=v(()=>{ee();dI=()=>{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=z(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 ${U(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(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":""} : ${T(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 Pv(){return{localeError:uI()}}var uI,Cv=v(()=>{ee();uI=()=>{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"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,h=u[p??""]??o(p),f=z(l.input),g=u[f]??e[f]?.label??f;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 ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}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 ${U(l.values[0])}`;let p=l.values.map(g=>U(g));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 k=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 ${k}`}if(l.origin==="array"||l.origin==="set"){let k=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",L=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} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${L}`.trim()}let f=l.inclusive?"<=":"<",g=i(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${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 k=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 ${k}`}if(l.origin==="array"||l.origin==="set"){let k=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let b=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let L=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} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${L}`.trim()}let f=l.inclusive?">=":">",g=i(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${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],f=h?.label??p.format,k=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${k}`}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"}: ${T(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 Ov(){return{localeError:pI()}}var pI,Nv=v(()=>{ee();pI=()=>{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=z(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 ${U(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${T(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"}: ${T(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 Rv(){return{localeError:hI()}}var hI,Lv=v(()=>{ee();hI=()=>{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=z(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 ${U(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(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":""}: ${T(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 Dv(e,t,r){return Math.abs(e)===1?t:r}function wr(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 jv(){return{localeError:mI()}}var mI,Mv=v(()=>{ee();mI=()=>{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=z(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 ${U(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Dv(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 ${wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}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 ${wr(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),u=Dv(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 ${wr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}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 ${wr(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":""}. ${T(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${wr(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 ${wr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Uv(){return{localeError:fI()}}var fI,zv=v(()=>{ee();fI=()=>{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=z(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 ${U(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(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":""}: ${T(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 Fv(){return{localeError:gI()}}var gI,Gv=v(()=>{ee();gI=()=>{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=z(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 ${U(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(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"}: ${T(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 Bv(){return{localeError:yI()}}var yI,Wv=v(()=>{ee();yI=()=>{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=z(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 ${U(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(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"}: ${T(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 Kv(){return{localeError:vI()}}var vI,Zv=v(()=>{ee();vI=()=>{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=z(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: ${U(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(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":""}: ${T(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 Hv(){return{localeError:bI()}}var bI,Vv=v(()=>{ee();bI=()=>{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=z(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 ${U(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 ${T(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"}: ${T(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 Ea(){return{localeError:wI()}}var wI,Nu=v(()=>{ee();wI=()=>{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=z(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 ${U(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 ${T(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 ${T(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 Yv(){return Ea()}var Jv=v(()=>{Nu()});function qv(){return{localeError:_I()}}var _I,Xv=v(()=>{ee();_I=()=>{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=z(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 ${U(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(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),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${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),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${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: ${T(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 Qv(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 eb(){return{localeError:kI()}}var Do,kI,tb=v(()=>{ee();Do=e=>e.charAt(0).toUpperCase()+e.slice(1);kI=()=>{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 u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.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=z(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 ${U(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,Qv(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${Do(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`${Do(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,Qv(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${Do(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`${Do(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"}: ${T(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`${Do(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function nb(){return{localeError:xI()}}var xI,rb=v(()=>{ee();xI=()=>{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=z(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 ${U(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 ${T(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"}: ${T(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 ob(){return{localeError:SI()}}var SI,ib=v(()=>{ee();SI=()=>{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=z(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 ${U(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(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: ${T(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 ab(){return{localeError:EI()}}var EI,sb=v(()=>{ee();EI=()=>{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=z(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 ${U(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(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":""}: ${T(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 cb(){return{localeError:$I()}}var $I,lb=v(()=>{ee();$I=()=>{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=z(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 ${U(n.values[0])}`:`Ugyldig valg: forventet en av ${T(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"}: ${T(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 db(){return{localeError:TI()}}var TI,ub=v(()=>{ee();TI=()=>{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=z(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 ${U(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(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":""}: ${T(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 pb(){return{localeError:AI()}}var AI,hb=v(()=>{ee();AI=()=>{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=z(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 ${U(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(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"}: ${T(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 mb(){return{localeError:II()}}var II,fb=v(()=>{ee();II=()=>{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=z(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 ${U(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(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":""}: ${T(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 gb(){return{localeError:PI()}}var PI,yb=v(()=>{ee();PI=()=>{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=z(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 ${U(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(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":""}: ${T(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 vb(){return{localeError:CI()}}var CI,bb=v(()=>{ee();CI=()=>{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=z(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 ${U(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${T(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: ${T(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 wb(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 _b(){return{localeError:OI()}}var OI,kb=v(()=>{ee();OI=()=>{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=z(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 ${U(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=wb(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()} ${u}`}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),u=wb(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()} ${u}`}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":""}: ${T(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 xb(){return{localeError:NI()}}var NI,Sb=v(()=>{ee();NI=()=>{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=z(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 ${U(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(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"}: ${T(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 Eb(){return{localeError:RI()}}var RI,$b=v(()=>{ee();RI=()=>{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=z(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 ${U(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(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"}: ${T(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 Tb(){return{localeError:LI()}}var LI,Ab=v(()=>{ee();LI=()=>{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=z(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 ${U(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 ${T(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":""}: ${T(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 Ib(){return{localeError:DI()}}var DI,Pb=v(()=>{ee();DI=()=>{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=z(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 ${U(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 ${T(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: ${T(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 Cb(){return{localeError:jI()}}var jI,Ob=v(()=>{ee();jI=()=>{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=z(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 ${U(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(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":""}: ${T(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 $a(){return{localeError:MI()}}var MI,Ru=v(()=>{ee();MI=()=>{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=z(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 ${U(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 ${T(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":""}: ${T(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 Nb(){return $a()}var Rb=v(()=>{Ru()});function Lb(){return{localeError:UI()}}var UI,Db=v(()=>{ee();UI=()=>{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=z(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: ${U(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(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":""}: ${T(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 jb(){return{localeError:zI()}}var zI,Mb=v(()=>{ee();zI=()=>{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=z(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 ${U(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(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":""}: ${T(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 Ub(){return{localeError:FI()}}var FI,zb=v(()=>{ee();FI=()=>{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=z(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 ${U(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 ${T(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: ${T(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 Fb(){return{localeError:GI()}}var GI,Gb=v(()=>{ee();GI=()=>{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=z(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 ${U(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(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): ${T(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 Bb(){return{localeError:BI()}}var BI,Wb=v(()=>{ee();BI=()=>{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=z(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 ${U(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(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${T(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 Kb(){return{localeError:WI()}}var WI,Zb=v(()=>{ee();WI=()=>{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=z(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 ${U(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(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: ${T(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 jo={};It(jo,{ar:()=>Qy,az:()=>tv,be:()=>ov,bg:()=>av,ca:()=>cv,cs:()=>dv,da:()=>pv,de:()=>mv,el:()=>gv,en:()=>Sa,eo:()=>vv,es:()=>wv,fa:()=>kv,fi:()=>Sv,fr:()=>$v,frCA:()=>Av,he:()=>Pv,hr:()=>Ov,hu:()=>Rv,hy:()=>jv,id:()=>Uv,is:()=>Fv,it:()=>Bv,ja:()=>Kv,ka:()=>Hv,kh:()=>Yv,km:()=>Ea,ko:()=>qv,lt:()=>eb,mk:()=>nb,ms:()=>ob,nl:()=>ab,no:()=>cb,ota:()=>db,pl:()=>mb,ps:()=>pb,pt:()=>gb,ro:()=>vb,ru:()=>_b,sl:()=>xb,sv:()=>Eb,ta:()=>Tb,th:()=>Ib,tr:()=>Cb,ua:()=>Nb,uk:()=>$a,ur:()=>Lb,uz:()=>jb,vi:()=>Ub,yo:()=>Kb,zhCN:()=>Fb,zhTW:()=>Bb});var Lu=v(()=>{ev();nv();iv();sv();lv();uv();hv();fv();yv();Ou();bv();_v();xv();Ev();Tv();Iv();Cv();Nv();Lv();Mv();zv();Gv();Wv();Zv();Vv();Jv();Nu();Xv();tb();rb();ib();sb();lb();ub();hb();fb();yb();bb();kb();Sb();$b();Ab();Pb();Ob();Rb();Ru();Db();Mb();zb();Gb();Wb();Zb()});function Aa(){return new Ta}var Hb,Du,ju,Ta,je,Mo=v(()=>{Du=Symbol("ZodOutput"),ju=Symbol("ZodInput"),Ta=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)}};(Hb=globalThis).__zod_globalRegistry??(Hb.__zod_globalRegistry=Aa());je=globalThis.__zod_globalRegistry});function Mu(e,t){return new e({type:"string",...K(t)})}function Uu(e,t){return new e({type:"string",coerce:!0,...K(t)})}function Ia(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function Uo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function Pa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function Ca(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function Oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function Na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function zo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function Ra(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function La(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function Da(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function ja(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function Ma(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function Ua(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function za(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function Fa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function Ga(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function zu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...K(t)})}function Ba(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function Wa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function Ka(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function Za(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function Ha(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function Va(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}function Gu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function Bu(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function Wu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function Ku(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function Zu(e,t){return new e({type:"number",checks:[],...K(t)})}function Hu(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}function Vu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function Yu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...K(t)})}function Ju(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...K(t)})}function qu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...K(t)})}function Xu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...K(t)})}function Qu(e,t){return new e({type:"boolean",...K(t)})}function ep(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}function tp(e,t){return new e({type:"bigint",...K(t)})}function np(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}function rp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(t)})}function op(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(t)})}function ip(e,t){return new e({type:"symbol",...K(t)})}function ap(e,t){return new e({type:"undefined",...K(t)})}function sp(e,t){return new e({type:"null",...K(t)})}function cp(e){return new e({type:"any"})}function lp(e){return new e({type:"unknown"})}function dp(e,t){return new e({type:"never",...K(t)})}function up(e,t){return new e({type:"void",...K(t)})}function pp(e,t){return new e({type:"date",...K(t)})}function hp(e,t){return new e({type:"date",coerce:!0,...K(t)})}function mp(e,t){return new e({type:"nan",...K(t)})}function Ct(e,t){return new pa({check:"less_than",...K(t),value:e,inclusive:!1})}function pt(e,t){return new pa({check:"less_than",...K(t),value:e,inclusive:!0})}function Ot(e,t){return new ha({check:"greater_than",...K(t),value:e,inclusive:!1})}function Xe(e,t){return new ha({check:"greater_than",...K(t),value:e,inclusive:!0})}function Ya(e){return Ot(0,e)}function Ja(e){return Ct(0,e)}function qa(e){return pt(0,e)}function Xa(e){return Xe(0,e)}function mn(e,t){return new ed({check:"multiple_of",...K(t),value:e})}function fn(e,t){return new rd({check:"max_size",...K(t),maximum:e})}function Nt(e,t){return new od({check:"min_size",...K(t),minimum:e})}function Zn(e,t){return new id({check:"size_equals",...K(t),size:e})}function Hn(e,t){return new ad({check:"max_length",...K(t),maximum:e})}function Yt(e,t){return new sd({check:"min_length",...K(t),minimum:e})}function Vn(e,t){return new cd({check:"length_equals",...K(t),length:e})}function _r(e,t){return new ld({check:"string_format",format:"regex",...K(t),pattern:e})}function kr(e){return new dd({check:"string_format",format:"lowercase",...K(e)})}function xr(e){return new ud({check:"string_format",format:"uppercase",...K(e)})}function Sr(e,t){return new pd({check:"string_format",format:"includes",...K(t),includes:e})}function Er(e,t){return new hd({check:"string_format",format:"starts_with",...K(t),prefix:e})}function $r(e,t){return new md({check:"string_format",format:"ends_with",...K(t),suffix:e})}function Qa(e,t,r){return new fd({check:"property",property:e,schema:t,...K(r)})}function Tr(e,t){return new gd({check:"mime_type",mime:e,...K(t)})}function Et(e){return new yd({check:"overwrite",tx:e})}function Ar(e){return Et(t=>t.normalize(e))}function Ir(){return Et(e=>e.trim())}function Pr(){return Et(e=>e.toLowerCase())}function Cr(){return Et(e=>e.toUpperCase())}function Or(){return Et(e=>ul(e))}function fp(e,t,r){return new e({type:"array",element:t,...K(r)})}function ZI(e,t,r){return new e({type:"union",options:t,...K(r)})}function HI(e,t,r){return new e({type:"union",options:t,inclusive:!1,...K(r)})}function VI(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...K(o)})}function YI(e,t,r){return new e({type:"intersection",left:t,right:r})}function JI(e,t,r,o){let n=r instanceof ie,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...K(i)})}function qI(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...K(o)})}function XI(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...K(o)})}function QI(e,t,r){return new e({type:"set",valueType:t,...K(r)})}function e0(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...K(r)})}function t0(e,t,r){return new e({type:"enum",entries:t,...K(r)})}function n0(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...K(r)})}function gp(e,t){return new e({type:"file",...K(t)})}function r0(e,t){return new e({type:"transform",transform:t})}function o0(e,t){return new e({type:"optional",innerType:t})}function i0(e,t){return new e({type:"nullable",innerType:t})}function a0(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():hl(r)}})}function s0(e,t,r){return new e({type:"nonoptional",innerType:t,...K(r)})}function c0(e,t){return new e({type:"success",innerType:t})}function l0(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function d0(e,t,r){return new e({type:"pipe",in:t,out:r})}function u0(e,t){return new e({type:"readonly",innerType:t})}function p0(e,t,r){return new e({type:"template_literal",parts:t,...K(r)})}function h0(e,t){return new e({type:"lazy",getter:t})}function m0(e,t){return new e({type:"promise",innerType:t})}function yp(e,t,r){let o=K(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function vp(e,t,r){return new e({type:"custom",check:"custom",fn:t,...K(r)})}function bp(e,t){let r=Vb(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(mr(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(mr(i))}},e(o.value,o)),t);return r}function Vb(e,t){let r=new be({check:"custom",...K(t)});return r._zod.check=e,r}function wp(e){let t=new be({check:"describe"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function _p(e){let t=new be({check:"meta"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,...e})}],t._zod.check=()=>{},t}function kp(e,t){let r=K(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(g=>typeof g=="string"?g.toLowerCase():g),n=n.map(g=>typeof g=="string"?g.toLowerCase():g));let i=new Set(o),a=new Set(n),s=e.Codec??Lo,u=e.Boolean??No,l=e.String??Kn,p=new l({type:"string",error:r.error}),h=new u({type:"boolean",error:r.error}),f=new s({type:"pipe",in:p,out:h,transform:((g,k)=>{let L=g;return r.case!=="sensitive"&&(L=L.toLowerCase()),i.has(L)?!0:a.has(L)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:k.value,inst:f,continue:!1}),{})}),reverseTransform:((g,k)=>g===!0?o[0]||"true":n[0]||"false"),error:r.error});return f}function Nr(e,t,r,o={}){let n=K(o),i={...K(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 Fu,Yb=v(()=>{ma();Mo();Cu();ee();Fu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function gn(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??je,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 fe(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 f=a.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,f,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),fe(h,t,p),t.seen.get(h).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&Qe(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 yn(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 u=o.get(s);if(u&&u!==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,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};let g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${f("__shared")}#/${s}/${g}`}}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:u,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=u};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>
10142
+ `)}g.write("payload.value = newResult;"),g.write("return payload;");let S=g.compile();return($,j)=>S(f,$,j)},i,a=Bn,s=!Fn.jitless,l=s&&bl.value,p=t.catchall,h;e._zod.parse=(f,g)=>{h??(h=o.value);let k=f.value;return a(k)?s&&l&&g?.async===!1&&g.jitless!==!0?(i||(i=n(t.shape)),f=i(f,g),p?av([],k,f,g,h,e):f):r(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});Lo=w("$ZodUnion",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(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=>So(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 u=s._zod.run({value:o.value,issues:[]},n);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(s=>Wy(s,o,e,n)):Wy(a,o,e,n)}});hu=w("$ZodXor",(e,t)=>{Lo.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 u=s._zod.run({value:o.value,issues:[]},n);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(s=>Ky(s,o,e,n)):Ky(a,o,e,n)}}),mu=w("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Lo.init(e,t);let r=e._zod.parse;pe(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,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(let l of u)n[s].add(l)}}return n});let o=hr(()=>{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 u of s){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Bn(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)}}),fu=w("$ZodIntersection",(e,t)=>{ie.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(([u,l])=>Zy(r,u,l)):Zy(r,i,a)}});Sa=w("$ZodTuple",(e,t)=>{ie.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=Hy(r,"optin"),u=Hy(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(f=>{l[p]=f})):l[p]=h}if(t.rest){let p=r.length-1,h=i.slice(r.length);for(let f of h){p++;let g=t.rest._zod.run({value:f,issues:[]},n);g instanceof Promise?a.push(g.then(k=>Vy(k,o,p))):Vy(g,o,p)}}return a.length?Promise.all(a).then(()=>Yy(l,o,r,i,u)):Yy(l,o,r,i,u)}});gu=w("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!pn(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(g=>qe(g,o,Te())),input:l,path:[l],inst:e});continue}let h=p.value,f=t.valueType._zod.run({value:n[l],issues:[]},o);f instanceof Promise?i.push(f.then(g=>{g.issues.length&&r.issues.push(...rt(l,g.issues)),r.value[h]=g.value})):(f.issues.length&&r.issues.push(...rt(l,f.issues)),r.value[h]=f.value)}let u;for(let l in n)s.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let u=t.keyType._zod.run({value:s,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&ha.test(s)&&u.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&&(u=h)}if(u.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(h=>qe(h,o,Te())),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(...rt(s,h.issues)),r.value[u.value]=h.value})):(p.issues.length&&r.issues.push(...rt(s,p.issues)),r.value[u.value]=p.value)}}return i.length?Promise.all(i).then(()=>r):r}}),yu=w("$ZodMap",(e,t)=>{ie.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 u=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise||l instanceof Promise?i.push(Promise.all([u,l]).then(([p,h])=>{Jy(p,h,r,a,n,e,o)})):Jy(u,l,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});vu=w("$ZodSet",(e,t)=>{ie.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(u=>qy(u,r))):qy(s,r)}return i.length?Promise.all(i).then(()=>r):r}});bu=w("$ZodEnum",(e,t)=>{ie.init(e,t);let r=xo(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Eo.has(typeof n)).map(n=>typeof n=="string"?gt(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}}),wu=w("$ZodLiteral",(e,t)=>{if(ie.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"?gt(o):o?gt(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}}),_u=w("$ZodFile",(e,t)=>{ie.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}}),ku=w("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln(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 St;return r.value=n,r.fallback=!0,r}});Ea=w("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${So(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=>Xy(a,n)):Xy(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),xu=w("$ZodExactOptional",(e,t)=>{Ea.init(e,t),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),Su=w("$ZodNullable",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${So(r.source)}|null)$`):void 0}),pe(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)}),Eu=w("$ZodDefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(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=>Qy(i,t)):Qy(n,t)}});$u=w("$ZodPrefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(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))}),Tu=w("$ZodNonOptional",(e,t)=>{ie.init(e,t),pe(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=>ev(i,e)):ev(n,e)}});Au=w("$ZodSuccess",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln("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)}}),Iu=w("$ZodCatch",(e,t)=>{ie.init(e,t),e._zod.optin="optional",pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(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=>qe(a,o,Te()))},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=>qe(i,o,Te()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Pu=w("$ZodNaN",(e,t)=>{ie.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)}),$a=w("$ZodPipe",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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=>va(a,t.in,o)):va(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>va(i,t.out,o)):va(n,t.out,o)}});Do=w("$ZodCodec",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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=>ba(a,t,o)):ba(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>ba(a,t,o)):ba(i,t,o)}}});Cu=w("$ZodPreprocess",(e,t)=>{$a.init(e,t)}),Ou=w("$ZodReadonly",(e,t)=>{ie.init(e,t),pe(e._zod,"propValues",()=>t.innerType._zod.propValues),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"optin",()=>t.innerType?._zod?.optin),pe(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(tv):tv(n)}});Nu=w("$ZodTemplateLiteral",(e,t)=>{ie.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||_l.has(typeof o))r.push(gt(`${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)}),Ru=w("$ZodFunction",(e,t)=>(ie.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?na(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?na(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 ra(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await ra(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 Sa({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)),Lu=w("$ZodPromise",(e,t)=>{ie.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Du=w("$ZodLazy",(e,t)=>{ie.init(e,t),pe(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),pe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),pe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),pe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),pe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),ju=w("$ZodCustom",(e,t)=>{be.init(e,t),ie.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=>nv(i,r,o,e));nv(n,r,o,e)}})});function cv(){return{localeError:hI()}}var hI,lv=v(()=>{te();hI=()=>{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=F(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 ${z(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: ${T(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":""}: ${T(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 dv(){return{localeError:mI()}}var mI,uv=v(()=>{te();mI=()=>{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=F(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 ${z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(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":""}: ${T(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 pv(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 hv(){return{localeError:fI()}}var fI,mv=v(()=>{te();fI=()=>{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=F(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 ${z(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=pv(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()} ${u}`}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),u=pv(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()} ${u}`}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"}: ${T(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 fv(){return{localeError:gI()}}var gI,gv=v(()=>{te();gI=()=>{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=F(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 ${z(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 ${T(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":""}: ${T(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 yv(){return{localeError:yI()}}var yI,vv=v(()=>{te();yI=()=>{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=F(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 ${z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(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":""}: ${T(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 bv(){return{localeError:vI()}}var vI,wv=v(()=>{te();vI=()=>{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=F(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 ${z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(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: ${T(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 _v(){return{localeError:bI()}}var bI,kv=v(()=>{te();bI=()=>{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=F(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 ${z(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(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"}: ${T(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 xv(){return{localeError:wI()}}var wI,Sv=v(()=>{te();wI=()=>{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=F(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 ${z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(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"}: ${T(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 Ev(){return{localeError:_I()}}var _I,$v=v(()=>{te();_I=()=>{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=F(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 ${z(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 ${T(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"}: ${T(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 Ta(){return{localeError:kI()}}var kI,Uu=v(()=>{te();kI=()=>{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=F(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.values[0])}`:`Invalid option: expected one of ${T(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":""}: ${T(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 Tv(){return{localeError:xI()}}var xI,Av=v(()=>{te();xI=()=>{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=F(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 ${z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(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":""}: ${T(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 Iv(){return{localeError:SI()}}var SI,Pv=v(()=>{te();SI=()=>{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=F(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 ${z(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(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":""}: ${T(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 Cv(){return{localeError:EI()}}var EI,Ov=v(()=>{te();EI=()=>{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=F(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 ${z(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 ${T(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: ${T(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 Nv(){return{localeError:$I()}}var $I,Rv=v(()=>{te();$I=()=>{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=F(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 ${z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(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"}: ${T(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 Lv(){return{localeError:TI()}}var TI,Dv=v(()=>{te();TI=()=>{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=F(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 : ${z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(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":""} : ${T(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 jv(){return{localeError:AI()}}var AI,Mv=v(()=>{te();AI=()=>{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=F(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 ${z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(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":""} : ${T(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:II()}}var II,zv=v(()=>{te();II=()=>{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"}},u={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let p=l.expected,h=u[p??""]??o(p),f=F(l.input),g=u[f]??e[f]?.label??f;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 ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}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 ${z(l.values[0])}`;let p=l.values.map(g=>z(g));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 k=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 ${k}`}if(l.origin==="array"||l.origin==="set"){let k=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",L=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} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${L}`.trim()}let f=l.inclusive?"<=":"<",g=i(l.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${l.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${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 k=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 ${k}`}if(l.origin==="array"||l.origin==="set"){let k=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let b=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${h} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let L=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} ${k} \u05DC\u05D4\u05DB\u05D9\u05DC ${L}`.trim()}let f=l.inclusive?">=":">",g=i(l.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${l.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${h} ${g} ${f}${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],f=h?.label??p.format,k=(h?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${k}`}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"}: ${T(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 Fv(){return{localeError:PI()}}var PI,Gv=v(()=>{te();PI=()=>{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=F(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 ${z(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${T(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"}: ${T(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 Bv(){return{localeError:CI()}}var CI,Wv=v(()=>{te();CI=()=>{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=F(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 ${z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(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":""}: ${T(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 Kv(e,t,r){return Math.abs(e)===1?t:r}function wr(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:OI()}}var OI,Hv=v(()=>{te();OI=()=>{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=F(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 ${z(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Kv(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 ${wr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}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 ${wr(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),u=Kv(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 ${wr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}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 ${wr(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":""}. ${T(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${wr(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 ${wr(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Vv(){return{localeError:NI()}}var NI,Yv=v(()=>{te();NI=()=>{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=F(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 ${z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(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":""}: ${T(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 Jv(){return{localeError:RI()}}var RI,qv=v(()=>{te();RI=()=>{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=F(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 ${z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(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"}: ${T(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 Xv(){return{localeError:LI()}}var LI,Qv=v(()=>{te();LI=()=>{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=F(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 ${z(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(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"}: ${T(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 eb(){return{localeError:DI()}}var DI,tb=v(()=>{te();DI=()=>{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=F(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: ${z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(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":""}: ${T(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 nb(){return{localeError:jI()}}var jI,rb=v(()=>{te();jI=()=>{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=F(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 ${z(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 ${T(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"}: ${T(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 Aa(){return{localeError:MI()}}var MI,zu=v(()=>{te();MI=()=>{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=F(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 ${z(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 ${T(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 ${T(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 ob(){return Aa()}var ib=v(()=>{zu()});function ab(){return{localeError:UI()}}var UI,sb=v(()=>{te();UI=()=>{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=F(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 ${z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(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),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${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),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${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: ${T(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 cb(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 lb(){return{localeError:zI()}}var jo,zI,db=v(()=>{te();jo=e=>e.charAt(0).toUpperCase()+e.slice(1);zI=()=>{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 u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.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=F(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 ${z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,cb(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${jo(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`${jo(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,cb(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${jo(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`${jo(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"}: ${T(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`${jo(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function ub(){return{localeError:FI()}}var FI,pb=v(()=>{te();FI=()=>{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=F(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 ${z(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 ${T(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"}: ${T(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 hb(){return{localeError:GI()}}var GI,mb=v(()=>{te();GI=()=>{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=F(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 ${z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(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: ${T(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 fb(){return{localeError:BI()}}var BI,gb=v(()=>{te();BI=()=>{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=F(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 ${z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(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":""}: ${T(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 yb(){return{localeError:WI()}}var WI,vb=v(()=>{te();WI=()=>{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=F(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 ${z(n.values[0])}`:`Ugyldig valg: forventet en av ${T(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"}: ${T(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 bb(){return{localeError:KI()}}var KI,wb=v(()=>{te();KI=()=>{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=F(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 ${z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(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":""}: ${T(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 _b(){return{localeError:ZI()}}var ZI,kb=v(()=>{te();ZI=()=>{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=F(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 ${z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(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"}: ${T(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 xb(){return{localeError:HI()}}var HI,Sb=v(()=>{te();HI=()=>{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=F(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 ${z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(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":""}: ${T(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 Eb(){return{localeError:VI()}}var VI,$b=v(()=>{te();VI=()=>{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=F(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 ${z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(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":""}: ${T(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 Tb(){return{localeError:YI()}}var YI,Ab=v(()=>{te();YI=()=>{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=F(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 ${z(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${T(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: ${T(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 Ib(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 Pb(){return{localeError:JI()}}var JI,Cb=v(()=>{te();JI=()=>{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=F(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 ${z(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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=Ib(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()} ${u}`}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),u=Ib(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()} ${u}`}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":""}: ${T(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 Ob(){return{localeError:qI()}}var qI,Nb=v(()=>{te();qI=()=>{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=F(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 ${z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(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"}: ${T(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 Rb(){return{localeError:XI()}}var XI,Lb=v(()=>{te();XI=()=>{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=F(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 ${z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(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"}: ${T(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 Db(){return{localeError:QI()}}var QI,jb=v(()=>{te();QI=()=>{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=F(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 ${z(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 ${T(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":""}: ${T(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 Mb(){return{localeError:e0()}}var e0,Ub=v(()=>{te();e0=()=>{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=F(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 ${z(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 ${T(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: ${T(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 zb(){return{localeError:t0()}}var t0,Fb=v(()=>{te();t0=()=>{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=F(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 ${z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(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":""}: ${T(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 Ia(){return{localeError:n0()}}var n0,Fu=v(()=>{te();n0=()=>{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=F(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 ${z(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 ${T(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":""}: ${T(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 Gb(){return Ia()}var Bb=v(()=>{Fu()});function Wb(){return{localeError:r0()}}var r0,Kb=v(()=>{te();r0=()=>{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=F(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: ${z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(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":""}: ${T(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 Zb(){return{localeError:o0()}}var o0,Hb=v(()=>{te();o0=()=>{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=F(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 ${z(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(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":""}: ${T(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 Vb(){return{localeError:i0()}}var i0,Yb=v(()=>{te();i0=()=>{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=F(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 ${z(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 ${T(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: ${T(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 Jb(){return{localeError:a0()}}var a0,qb=v(()=>{te();a0=()=>{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=F(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 ${z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(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): ${T(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 Xb(){return{localeError:s0()}}var s0,Qb=v(()=>{te();s0=()=>{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=F(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 ${z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(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${T(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 ew(){return{localeError:c0()}}var c0,tw=v(()=>{te();c0=()=>{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=F(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 ${z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(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: ${T(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 Mo={};It(Mo,{ar:()=>cv,az:()=>dv,be:()=>hv,bg:()=>fv,ca:()=>yv,cs:()=>bv,da:()=>_v,de:()=>xv,el:()=>Ev,en:()=>Ta,eo:()=>Tv,es:()=>Iv,fa:()=>Cv,fi:()=>Nv,fr:()=>Lv,frCA:()=>jv,he:()=>Uv,hr:()=>Fv,hu:()=>Bv,hy:()=>Zv,id:()=>Vv,is:()=>Jv,it:()=>Xv,ja:()=>eb,ka:()=>nb,kh:()=>ob,km:()=>Aa,ko:()=>ab,lt:()=>lb,mk:()=>ub,ms:()=>hb,nl:()=>fb,no:()=>yb,ota:()=>bb,pl:()=>xb,ps:()=>_b,pt:()=>Eb,ro:()=>Tb,ru:()=>Pb,sl:()=>Ob,sv:()=>Rb,ta:()=>Db,th:()=>Mb,tr:()=>zb,ua:()=>Gb,uk:()=>Ia,ur:()=>Wb,uz:()=>Zb,vi:()=>Vb,yo:()=>ew,zhCN:()=>Jb,zhTW:()=>Xb});var Gu=v(()=>{lv();uv();mv();gv();vv();wv();kv();Sv();$v();Uu();Av();Pv();Ov();Rv();Dv();Mv();zv();Gv();Wv();Hv();Yv();qv();Qv();tb();rb();ib();zu();sb();db();pb();mb();gb();vb();wb();kb();Sb();$b();Ab();Cb();Nb();Lb();jb();Ub();Fb();Bb();Fu();Kb();Hb();Yb();qb();Qb();tw()});function Ca(){return new Pa}var nw,Bu,Wu,Pa,je,Uo=v(()=>{Bu=Symbol("ZodOutput"),Wu=Symbol("ZodInput"),Pa=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)}};(nw=globalThis).__zod_globalRegistry??(nw.__zod_globalRegistry=Ca());je=globalThis.__zod_globalRegistry});function Ku(e,t){return new e({type:"string",...Z(t)})}function Zu(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function Oa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function zo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function Na(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function Ra(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function La(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function Da(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function Fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function ja(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function Ma(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function Ua(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function za(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function Fa(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function Ga(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function Ba(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function Wa(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function Ka(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function Hu(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Z(t)})}function Za(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function Ha(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function Va(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function Ya(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function Ja(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function qa(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function Yu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function Ju(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function qu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function Xu(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function Qu(e,t){return new e({type:"number",checks:[],...Z(t)})}function ep(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}function tp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function np(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Z(t)})}function rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Z(t)})}function op(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Z(t)})}function ip(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Z(t)})}function ap(e,t){return new e({type:"boolean",...Z(t)})}function sp(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}function cp(e,t){return new e({type:"bigint",...Z(t)})}function lp(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}function dp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Z(t)})}function up(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Z(t)})}function pp(e,t){return new e({type:"symbol",...Z(t)})}function hp(e,t){return new e({type:"undefined",...Z(t)})}function mp(e,t){return new e({type:"null",...Z(t)})}function fp(e){return new e({type:"any"})}function gp(e){return new e({type:"unknown"})}function yp(e,t){return new e({type:"never",...Z(t)})}function vp(e,t){return new e({type:"void",...Z(t)})}function bp(e,t){return new e({type:"date",...Z(t)})}function wp(e,t){return new e({type:"date",coerce:!0,...Z(t)})}function _p(e,t){return new e({type:"nan",...Z(t)})}function Ct(e,t){return new fa({check:"less_than",...Z(t),value:e,inclusive:!1})}function pt(e,t){return new fa({check:"less_than",...Z(t),value:e,inclusive:!0})}function Ot(e,t){return new ga({check:"greater_than",...Z(t),value:e,inclusive:!1})}function Xe(e,t){return new ga({check:"greater_than",...Z(t),value:e,inclusive:!0})}function Xa(e){return Ot(0,e)}function Qa(e){return Ct(0,e)}function es(e){return pt(0,e)}function ts(e){return Xe(0,e)}function mn(e,t){return new sd({check:"multiple_of",...Z(t),value:e})}function fn(e,t){return new dd({check:"max_size",...Z(t),maximum:e})}function Nt(e,t){return new ud({check:"min_size",...Z(t),minimum:e})}function Zn(e,t){return new pd({check:"size_equals",...Z(t),size:e})}function Hn(e,t){return new hd({check:"max_length",...Z(t),maximum:e})}function Yt(e,t){return new md({check:"min_length",...Z(t),minimum:e})}function Vn(e,t){return new fd({check:"length_equals",...Z(t),length:e})}function _r(e,t){return new gd({check:"string_format",format:"regex",...Z(t),pattern:e})}function kr(e){return new yd({check:"string_format",format:"lowercase",...Z(e)})}function xr(e){return new vd({check:"string_format",format:"uppercase",...Z(e)})}function Sr(e,t){return new bd({check:"string_format",format:"includes",...Z(t),includes:e})}function Er(e,t){return new wd({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function $r(e,t){return new _d({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function ns(e,t,r){return new kd({check:"property",property:e,schema:t,...Z(r)})}function Tr(e,t){return new xd({check:"mime_type",mime:e,...Z(t)})}function Et(e){return new Sd({check:"overwrite",tx:e})}function Ar(e){return Et(t=>t.normalize(e))}function Ir(){return Et(e=>e.trim())}function Pr(){return Et(e=>e.toLowerCase())}function Cr(){return Et(e=>e.toUpperCase())}function Or(){return Et(e=>vl(e))}function kp(e,t,r){return new e({type:"array",element:t,...Z(r)})}function d0(e,t,r){return new e({type:"union",options:t,...Z(r)})}function u0(e,t,r){return new e({type:"union",options:t,inclusive:!1,...Z(r)})}function p0(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...Z(o)})}function h0(e,t,r){return new e({type:"intersection",left:t,right:r})}function m0(e,t,r,o){let n=r instanceof ie,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...Z(i)})}function f0(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...Z(o)})}function g0(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...Z(o)})}function y0(e,t,r){return new e({type:"set",valueType:t,...Z(r)})}function v0(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 b0(e,t,r){return new e({type:"enum",entries:t,...Z(r)})}function w0(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...Z(r)})}function xp(e,t){return new e({type:"file",...Z(t)})}function _0(e,t){return new e({type:"transform",transform:t})}function k0(e,t){return new e({type:"optional",innerType:t})}function x0(e,t){return new e({type:"nullable",innerType:t})}function S0(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():wl(r)}})}function E0(e,t,r){return new e({type:"nonoptional",innerType:t,...Z(r)})}function $0(e,t){return new e({type:"success",innerType:t})}function T0(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function A0(e,t,r){return new e({type:"pipe",in:t,out:r})}function I0(e,t){return new e({type:"readonly",innerType:t})}function P0(e,t,r){return new e({type:"template_literal",parts:t,...Z(r)})}function C0(e,t){return new e({type:"lazy",getter:t})}function O0(e,t){return new e({type:"promise",innerType:t})}function Sp(e,t,r){let o=Z(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Ep(e,t,r){return new e({type:"custom",check:"custom",fn:t,...Z(r)})}function $p(e,t){let r=rw(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(mr(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(mr(i))}},e(o.value,o)),t);return r}function rw(e,t){let r=new be({check:"custom",...Z(t)});return r._zod.check=e,r}function Tp(e){let t=new be({check:"describe"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Ap(e){let t=new be({check:"meta"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Ip(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(g=>typeof g=="string"?g.toLowerCase():g),n=n.map(g=>typeof g=="string"?g.toLowerCase():g));let i=new Set(o),a=new Set(n),s=e.Codec??Do,u=e.Boolean??Ro,l=e.String??Kn,p=new l({type:"string",error:r.error}),h=new u({type:"boolean",error:r.error}),f=new s({type:"pipe",in:p,out:h,transform:((g,k)=>{let L=g;return r.case!=="sensitive"&&(L=L.toLowerCase()),i.has(L)?!0:a.has(L)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:k.value,inst:f,continue:!1}),{})}),reverseTransform:((g,k)=>g===!0?o[0]||"true":n[0]||"false"),error:r.error});return f}function Nr(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 Vu,ow=v(()=>{ya();Uo();Mu();te();Vu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function gn(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??je,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 fe(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 f=a.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,f,p)}let h=e._zod.parent;h&&(a.ref||(a.ref=h),fe(h,t,p),t.seen.get(h).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&Qe(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 yn(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 u=o.get(s);if(u&&u!==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,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};let g=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=g,{defId:g,ref:`${f("__shared")}#/${s}/${g}`}}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:u,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=u};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>
10143
10143
 
10144
- 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 vn(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 u=e.seen.get(s);if(u.ref===null)return;let l=u.def??u.schema,p={...l},h=u.ref;if(u.ref=null,h){o(h);let g=e.seen.get(h),k=g.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(k)):Object.assign(l,k),Object.assign(l,p),s._zod.parent===h)for(let b in l)b==="$ref"||b==="allOf"||b in p||delete l[b];if(k.$ref&&g.def)for(let b in l)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(l[b])===JSON.stringify(g.def[b])&&delete l[b]}let f=s._zod.parent;if(f&&f!==h){o(f);let g=e.seen.get(f);if(g?.schema.$ref&&(l.$ref=g.schema.$ref,g.def))for(let k in l)k==="$ref"||k==="allOf"||k in g.def&&JSON.stringify(l[k])===JSON.stringify(g.def[k])&&delete l[k]}e.override({zodSchema:s,jsonSchema:l,path:u.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 u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,a[u.defId]=u.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:Rr(t,"input",e.processors),output:Rr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qe(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 Qe(o.element,r);if(o.type==="set")return Qe(o.valueType,r);if(o.type==="lazy")return Qe(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 Qe(o.innerType,r);if(o.type==="intersection")return Qe(o.left,r)||Qe(o.right,r);if(o.type==="record"||o.type==="map")return Qe(o.keyType,r)||Qe(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Qe(o.in,r)||Qe(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Qe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Qe(n,r))return!0;return!!(o.rest&&Qe(o.rest,r))}return!1}var xp,Rr,Fo=v(()=>{Mo();xp=(e,t={})=>r=>{let o=gn({...r,processors:t});return fe(e,o),yn(o,e),vn(o,e)},Rr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=gn({...n??{},target:i,io:t,processors:r});return fe(e,a),yn(a,e),vn(a,e)}});function rs(e,t){if("_idmap"in e){let o=e,n=gn({...t,processors:es}),i={};for(let u of o._idmap.entries()){let[l,p]=u;fe(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let u of o._idmap.entries()){let[l,p]=u;yn(n,p),a[l]=vn(n,p)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let r=gn({...t,processors:es});return fe(e,r),yn(r,e),vn(r,e)}var f0,Sp,Ep,$p,Tp,Ap,Ip,Pp,Cp,Op,Np,Rp,Lp,Dp,jp,Mp,Up,zp,Fp,Gp,Bp,Wp,Kp,Zp,Hp,Vp,ts,Yp,Jp,qp,Xp,Qp,eh,th,nh,rh,oh,ih,ns,ah,es,Go=v(()=>{Fo();ee();f0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sp=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=f0[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let p=[...u];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}))])}},Ep=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:u,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),f=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";h?g?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),f?g?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof u=="number"&&(n.multipleOf=u)},$p=(e,t,r,o)=>{r.type="boolean"},Tp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ap=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ip=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Pp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Cp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Op=(e,t,r,o)=>{r.not={}},Np=(e,t,r,o)=>{},Rp=(e,t,r,o)=>{},Lp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Dp=(e,t,r,o)=>{let n=e._zod.def,i=ko(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},jp=(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},Mp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Up=(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},zp=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:u}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,i)},Fp=(e,t,r,o)=>{r.type="boolean"},Gp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Bp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Wp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Zp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Hp=(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=fe(i.element,t,{...o,path:[...o.path,"items"]})},Vp=(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]=fe(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{let p=i.shape[l]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=fe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ts=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,u)=>fe(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=a:r.anyOf=a},Yp=(e,t,r,o)=>{let n=e._zod.def,i=fe(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=fe(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,u=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=u},Jp=(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",u=i.items.map((f,g)=>fe(f,t,{...o,path:[...o.path,a,g]})),l=i.rest?fe(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,l||(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},qp=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let p=fe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of u)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=fe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=fe(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)}},Xp=(e,t,r,o)=>{let n=e._zod.def,i=fe(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"}]},Qp=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},eh=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},th=(e,t,r,o)=>{let n=e._zod.def;fe(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)))},nh=(e,t,r,o)=>{let n=e._zod.def;fe(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},rh=(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;fe(a,t,o);let s=t.seen.get(e);s.ref=a},oh=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},ih=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},ns=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},ah=(e,t,r,o)=>{let n=e._zod.innerType;fe(n,t,o);let i=t.seen.get(e);i.ref=n},es={string:Sp,number:Ep,boolean:$p,bigint:Tp,symbol:Ap,null:Ip,undefined:Pp,void:Cp,never:Op,any:Np,unknown:Rp,date:Lp,enum:Dp,literal:jp,nan:Mp,template_literal:Up,file:zp,success:Fp,custom:Gp,function:Bp,transform:Wp,map:Kp,set:Zp,array:Hp,object:Vp,union:ts,intersection:Yp,tuple:Jp,record:qp,nullable:Xp,nonoptional:Qp,default:eh,prefault:th,catch:nh,pipe:rh,readonly:oh,promise:ih,optional:ns,lazy:ah}});var os,Jb=v(()=>{Go();Fo();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=gn({processors:es,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 fe(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)),yn(this.ctx,t);let o=vn(this.ctx,t),{"~standard":n,...i}=o;return i}}});var qb={};var Xb=v(()=>{});var Jt={};It(Jt,{$ZodAny:()=>Qd,$ZodArray:()=>ou,$ZodAsyncError:()=>St,$ZodBase64:()=>Bd,$ZodBase64URL:()=>Wd,$ZodBigInt:()=>wa,$ZodBigIntFormat:()=>Yd,$ZodBoolean:()=>No,$ZodCIDRv4:()=>zd,$ZodCIDRv6:()=>Fd,$ZodCUID:()=>Ad,$ZodCUID2:()=>Id,$ZodCatch:()=>ku,$ZodCheck:()=>be,$ZodCheckBigIntFormat:()=>nd,$ZodCheckEndsWith:()=>md,$ZodCheckGreaterThan:()=>ha,$ZodCheckIncludes:()=>pd,$ZodCheckLengthEquals:()=>cd,$ZodCheckLessThan:()=>pa,$ZodCheckLowerCase:()=>dd,$ZodCheckMaxLength:()=>ad,$ZodCheckMaxSize:()=>rd,$ZodCheckMimeType:()=>gd,$ZodCheckMinLength:()=>sd,$ZodCheckMinSize:()=>od,$ZodCheckMultipleOf:()=>ed,$ZodCheckNumberFormat:()=>td,$ZodCheckOverwrite:()=>yd,$ZodCheckProperty:()=>fd,$ZodCheckRegex:()=>ld,$ZodCheckSizeEquals:()=>id,$ZodCheckStartsWith:()=>hd,$ZodCheckStringFormat:()=>br,$ZodCheckUpperCase:()=>ud,$ZodCodec:()=>Lo,$ZodCustom:()=>Pu,$ZodCustomStringFormat:()=>Hd,$ZodDate:()=>ru,$ZodDefault:()=>vu,$ZodDiscriminatedUnion:()=>su,$ZodE164:()=>Kd,$ZodEmail:()=>Sd,$ZodEmoji:()=>$d,$ZodEncodeError:()=>ln,$ZodEnum:()=>pu,$ZodError:()=>To,$ZodExactOptional:()=>gu,$ZodFile:()=>mu,$ZodFunction:()=>Tu,$ZodGUID:()=>kd,$ZodIPv4:()=>jd,$ZodIPv6:()=>Md,$ZodISODate:()=>Rd,$ZodISODateTime:()=>Nd,$ZodISODuration:()=>Dd,$ZodISOTime:()=>Ld,$ZodIntersection:()=>cu,$ZodJWT:()=>Zd,$ZodKSUID:()=>Od,$ZodLazy:()=>Iu,$ZodLiteral:()=>hu,$ZodMAC:()=>Ud,$ZodMap:()=>du,$ZodNaN:()=>xu,$ZodNanoID:()=>Td,$ZodNever:()=>tu,$ZodNonOptional:()=>wu,$ZodNull:()=>Xd,$ZodNullable:()=>yu,$ZodNumber:()=>ba,$ZodNumberFormat:()=>Vd,$ZodObject:()=>Xy,$ZodObjectJIT:()=>iu,$ZodOptional:()=>ka,$ZodPipe:()=>xa,$ZodPrefault:()=>bu,$ZodPreprocess:()=>Su,$ZodPromise:()=>Au,$ZodReadonly:()=>Eu,$ZodRealError:()=>ot,$ZodRecord:()=>lu,$ZodRegistry:()=>Ta,$ZodSet:()=>uu,$ZodString:()=>Kn,$ZodStringFormat:()=>ye,$ZodSuccess:()=>_u,$ZodSymbol:()=>Jd,$ZodTemplateLiteral:()=>$u,$ZodTransform:()=>fu,$ZodTuple:()=>_a,$ZodType:()=>ie,$ZodULID:()=>Pd,$ZodURL:()=>Ed,$ZodUUID:()=>xd,$ZodUndefined:()=>qd,$ZodUnion:()=>Ro,$ZodUnknown:()=>eu,$ZodVoid:()=>nu,$ZodXID:()=>Cd,$ZodXor:()=>au,$brand:()=>sl,$constructor:()=>w,$input:()=>ju,$output:()=>Du,Doc:()=>Oo,JSONSchema:()=>qb,JSONSchemaGenerator:()=>os,NEVER:()=>al,TimePrecision:()=>Fu,_any:()=>cp,_array:()=>fp,_base64:()=>Ka,_base64url:()=>Za,_bigint:()=>tp,_boolean:()=>Qu,_catch:()=>l0,_check:()=>Vb,_cidrv4:()=>Ba,_cidrv6:()=>Wa,_coercedBigint:()=>np,_coercedBoolean:()=>ep,_coercedDate:()=>hp,_coercedNumber:()=>Hu,_coercedString:()=>Uu,_cuid:()=>Da,_cuid2:()=>ja,_custom:()=>yp,_date:()=>pp,_decode:()=>na,_decodeAsync:()=>oa,_default:()=>a0,_discriminatedUnion:()=>VI,_e164:()=>Ha,_email:()=>Ia,_emoji:()=>Ra,_encode:()=>ta,_encodeAsync:()=>ra,_endsWith:()=>$r,_enum:()=>e0,_file:()=>gp,_float32:()=>Yu,_float64:()=>Ju,_gt:()=>Ot,_gte:()=>Xe,_guid:()=>Uo,_includes:()=>Sr,_int:()=>Vu,_int32:()=>qu,_int64:()=>rp,_intersection:()=>YI,_ipv4:()=>Fa,_ipv6:()=>Ga,_isoDate:()=>Bu,_isoDateTime:()=>Gu,_isoDuration:()=>Ku,_isoTime:()=>Wu,_jwt:()=>Va,_ksuid:()=>za,_lazy:()=>h0,_length:()=>Vn,_literal:()=>n0,_lowercase:()=>kr,_lt:()=>Ct,_lte:()=>pt,_mac:()=>zu,_map:()=>XI,_max:()=>pt,_maxLength:()=>Hn,_maxSize:()=>fn,_mime:()=>Tr,_min:()=>Xe,_minLength:()=>Yt,_minSize:()=>Nt,_multipleOf:()=>mn,_nan:()=>mp,_nanoid:()=>La,_nativeEnum:()=>t0,_negative:()=>Ja,_never:()=>dp,_nonnegative:()=>Xa,_nonoptional:()=>s0,_nonpositive:()=>qa,_normalize:()=>Ar,_null:()=>sp,_nullable:()=>i0,_number:()=>Zu,_optional:()=>o0,_overwrite:()=>Et,_parse:()=>fr,_parseAsync:()=>gr,_pipe:()=>d0,_positive:()=>Ya,_promise:()=>m0,_property:()=>Qa,_readonly:()=>u0,_record:()=>qI,_refine:()=>vp,_regex:()=>_r,_safeDecode:()=>aa,_safeDecodeAsync:()=>ca,_safeEncode:()=>ia,_safeEncodeAsync:()=>sa,_safeParse:()=>yr,_safeParseAsync:()=>vr,_set:()=>QI,_size:()=>Zn,_slugify:()=>Or,_startsWith:()=>Er,_string:()=>Mu,_stringFormat:()=>Nr,_stringbool:()=>kp,_success:()=>c0,_superRefine:()=>bp,_symbol:()=>ip,_templateLiteral:()=>p0,_toLowerCase:()=>Pr,_toUpperCase:()=>Cr,_transform:()=>r0,_trim:()=>Ir,_tuple:()=>JI,_uint32:()=>Xu,_uint64:()=>op,_ulid:()=>Ma,_undefined:()=>ap,_union:()=>ZI,_unknown:()=>lp,_uppercase:()=>xr,_url:()=>zo,_uuid:()=>Pa,_uuidv4:()=>Ca,_uuidv6:()=>Oa,_uuidv7:()=>Na,_void:()=>up,_xid:()=>Ua,_xor:()=>HI,clone:()=>Je,config:()=>$e,createStandardJSONSchemaMethod:()=>Rr,createToJSONSchemaMethod:()=>xp,decode:()=>mA,decodeAsync:()=>gA,describe:()=>wp,encode:()=>hA,encodeAsync:()=>fA,extractDefs:()=>yn,finalize:()=>vn,flattenError:()=>Ao,formatError:()=>Io,globalConfig:()=>Fn,globalRegistry:()=>je,initializeContext:()=>gn,isValidBase64:()=>Gd,isValidBase64URL:()=>Vy,isValidJWT:()=>Yy,locales:()=>jo,meta:()=>_p,parse:()=>Qi,parseAsync:()=>ea,prettifyError:()=>wl,process:()=>fe,regexes:()=>ut,registry:()=>Aa,safeDecode:()=>vA,safeDecodeAsync:()=>wA,safeEncode:()=>yA,safeEncodeAsync:()=>bA,safeParse:()=>kl,safeParseAsync:()=>xl,toDotPath:()=>Ty,toJSONSchema:()=>rs,treeifyError:()=>bl,util:()=>G,version:()=>bd});var ht=v(()=>{Gn();Sl();_l();Cu();ma();wd();ee();ua();Lu();Mo();vd();Yb();Fo();Go();Jb();Xb()});var is={};It(is,{endsWith:()=>$r,gt:()=>Ot,gte:()=>Xe,includes:()=>Sr,length:()=>Vn,lowercase:()=>kr,lt:()=>Ct,lte:()=>pt,maxLength:()=>Hn,maxSize:()=>fn,mime:()=>Tr,minLength:()=>Yt,minSize:()=>Nt,multipleOf:()=>mn,negative:()=>Ja,nonnegative:()=>Xa,nonpositive:()=>qa,normalize:()=>Ar,overwrite:()=>Et,positive:()=>Ya,property:()=>Qa,regex:()=>_r,size:()=>Zn,slugify:()=>Or,startsWith:()=>Er,toLowerCase:()=>Pr,toUpperCase:()=>Cr,trim:()=>Ir,uppercase:()=>xr});var as=v(()=>{ht()});var Lr={};It(Lr,{ZodISODate:()=>cs,ZodISODateTime:()=>ss,ZodISODuration:()=>ds,ZodISOTime:()=>ls,date:()=>ch,datetime:()=>sh,duration:()=>dh,time:()=>lh});function sh(e){return Gu(ss,e)}function ch(e){return Bu(cs,e)}function lh(e){return Wu(ls,e)}function dh(e){return Ku(ds,e)}var ss,cs,ls,ds,Bo=v(()=>{ht();Ko();ss=w("ZodISODateTime",(e,t)=>{Nd.init(e,t),ve.init(e,t)});cs=w("ZodISODate",(e,t)=>{Rd.init(e,t),ve.init(e,t)});ls=w("ZodISOTime",(e,t)=>{Ld.init(e,t),ve.init(e,t)});ds=w("ZodISODuration",(e,t)=>{Dd.init(e,t),ve.init(e,t)})});var Qb,y0,it,uh=v(()=>{ht();ht();ee();Qb=(e,t)=>{To.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Io(e,r)},flatten:{value:r=>Ao(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,pr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,pr,2)}},isEmpty:{get(){return e.issues.length===0}}})},y0=w("ZodError",Qb),it=w("ZodError",Qb,{Parent:Error})});var ph,hh,mh,fh,gh,yh,vh,bh,wh,_h,kh,xh,Sh=v(()=>{ht();uh();ph=fr(it),hh=gr(it),mh=yr(it),fh=vr(it),gh=ta(it),yh=na(it),vh=ra(it),bh=oa(it),wh=ia(it),_h=aa(it),kh=sa(it),xh=ca(it)});var Wo={};It(Wo,{ZodAny:()=>Oh,ZodArray:()=>Dh,ZodBase64:()=>$s,ZodBase64URL:()=>Ts,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ps,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Ss,ZodCIDRv6:()=>Es,ZodCUID:()=>ys,ZodCUID2:()=>vs,ZodCatch:()=>om,ZodCodec:()=>ri,ZodCustom:()=>oi,ZodCustomStringFormat:()=>Ur,ZodDate:()=>Xo,ZodDefault:()=>Xh,ZodDiscriminatedUnion:()=>Mh,ZodE164:()=>As,ZodEmail:()=>ms,ZodEmoji:()=>fs,ZodEnum:()=>jr,ZodExactOptional:()=>Yh,ZodFile:()=>Hh,ZodFunction:()=>mm,ZodGUID:()=>Ho,ZodIPv4:()=>ks,ZodIPv6:()=>xs,ZodIntersection:()=>Uh,ZodJWT:()=>Is,ZodKSUID:()=>_s,ZodLazy:()=>um,ZodLiteral:()=>Zh,ZodMAC:()=>Eh,ZodMap:()=>Wh,ZodNaN:()=>am,ZodNanoID:()=>gs,ZodNever:()=>Rh,ZodNonOptional:()=>Ds,ZodNull:()=>Ph,ZodNullable:()=>qh,ZodNumber:()=>zr,ZodNumberFormat:()=>Jn,ZodObject:()=>ei,ZodOptional:()=>Ls,ZodPipe:()=>ni,ZodPrefault:()=>em,ZodPreprocess:()=>sm,ZodPromise:()=>hm,ZodReadonly:()=>cm,ZodRecord:()=>Dr,ZodSet:()=>Kh,ZodString:()=>Mr,ZodStringFormat:()=>ve,ZodSuccess:()=>rm,ZodSymbol:()=>Ah,ZodTemplateLiteral:()=>dm,ZodTransform:()=>Vh,ZodTuple:()=>Fh,ZodType:()=>le,ZodULID:()=>bs,ZodURL:()=>qo,ZodUUID:()=>Rt,ZodUndefined:()=>Ih,ZodUnion:()=>ti,ZodUnknown:()=>Nh,ZodVoid:()=>Lh,ZodXID:()=>ws,ZodXor:()=>jh,_ZodString:()=>hs,_default:()=>Qh,_function:()=>s_,any:()=>Mw,array:()=>Qo,base64:()=>_w,base64url:()=>kw,bigint:()=>Nw,boolean:()=>Th,catch:()=>im,check:()=>c_,cidrv4:()=>bw,cidrv6:()=>ww,codec:()=>r_,cuid:()=>uw,cuid2:()=>pw,custom:()=>l_,date:()=>zw,describe:()=>d_,discriminatedUnion:()=>Zw,e164:()=>xw,email:()=>tw,emoji:()=>lw,enum:()=>Ns,exactOptional:()=>Jh,file:()=>Qw,float32:()=>Iw,float64:()=>Pw,function:()=>s_,guid:()=>nw,hash:()=>Aw,hex:()=>Tw,hostname:()=>$w,httpUrl:()=>cw,instanceof:()=>p_,int:()=>us,int32:()=>Cw,int64:()=>Rw,intersection:()=>zh,invertCodec:()=>o_,ipv4:()=>gw,ipv6:()=>vw,json:()=>m_,jwt:()=>Sw,keyof:()=>Fw,ksuid:()=>fw,lazy:()=>pm,literal:()=>Xw,looseObject:()=>Ww,looseRecord:()=>Vw,mac:()=>yw,map:()=>Yw,meta:()=>u_,nan:()=>n_,nanoid:()=>dw,nativeEnum:()=>qw,never:()=>Cs,nonoptional:()=>nm,null:()=>Ch,nullable:()=>Yo,nullish:()=>e_,number:()=>$h,object:()=>Gw,optional:()=>Vo,partialRecord:()=>Hw,pipe:()=>ps,prefault:()=>tm,preprocess:()=>f_,promise:()=>a_,readonly:()=>lm,record:()=>Bh,refine:()=>fm,set:()=>Jw,strictObject:()=>Bw,string:()=>Zo,stringFormat:()=>Ew,stringbool:()=>h_,success:()=>t_,superRefine:()=>gm,symbol:()=>Dw,templateLiteral:()=>i_,transform:()=>Rs,tuple:()=>Gh,uint32:()=>Ow,uint64:()=>Lw,ulid:()=>hw,undefined:()=>jw,union:()=>Os,unknown:()=>Yn,url:()=>sw,uuid:()=>rw,uuidv4:()=>ow,uuidv6:()=>iw,uuidv7:()=>aw,void:()=>Uw,xid:()=>mw,xor:()=>Kw});function Jo(e,t,r){let o=Object.getPrototypeOf(e),n=ew.get(o);if(n||(n=new Set,ew.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 Zo(e){return Mu(Mr,e)}function tw(e){return Ia(ms,e)}function nw(e){return Uo(Ho,e)}function rw(e){return Pa(Rt,e)}function ow(e){return Ca(Rt,e)}function iw(e){return Oa(Rt,e)}function aw(e){return Na(Rt,e)}function sw(e){return zo(qo,e)}function cw(e){return zo(qo,{protocol:ut.httpProtocol,hostname:ut.domain,...G.normalizeParams(e)})}function lw(e){return Ra(fs,e)}function dw(e){return La(gs,e)}function uw(e){return Da(ys,e)}function pw(e){return ja(vs,e)}function hw(e){return Ma(bs,e)}function mw(e){return Ua(ws,e)}function fw(e){return za(_s,e)}function gw(e){return Fa(ks,e)}function yw(e){return zu(Eh,e)}function vw(e){return Ga(xs,e)}function bw(e){return Ba(Ss,e)}function ww(e){return Wa(Es,e)}function _w(e){return Ka($s,e)}function kw(e){return Za(Ts,e)}function xw(e){return Ha(As,e)}function Sw(e){return Va(Is,e)}function Ew(e,t,r={}){return Nr(Ur,e,t,r)}function $w(e){return Nr(Ur,"hostname",ut.hostname,e)}function Tw(e){return Nr(Ur,"hex",ut.hex,e)}function Aw(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=ut[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Nr(Ur,o,n,t)}function $h(e){return Zu(zr,e)}function us(e){return Vu(Jn,e)}function Iw(e){return Yu(Jn,e)}function Pw(e){return Ju(Jn,e)}function Cw(e){return qu(Jn,e)}function Ow(e){return Xu(Jn,e)}function Th(e){return Qu(Fr,e)}function Nw(e){return tp(Gr,e)}function Rw(e){return rp(Ps,e)}function Lw(e){return op(Ps,e)}function Dw(e){return ip(Ah,e)}function jw(e){return ap(Ih,e)}function Ch(e){return sp(Ph,e)}function Mw(){return cp(Oh)}function Yn(){return lp(Nh)}function Cs(e){return dp(Rh,e)}function Uw(e){return up(Lh,e)}function zw(e){return pp(Xo,e)}function Qo(e,t){return fp(Dh,e,t)}function Fw(e){let t=e._zod.def.shape;return Ns(Object.keys(t))}function Gw(e,t){let r={type:"object",shape:e??{},...G.normalizeParams(t)};return new ei(r)}function Bw(e,t){return new ei({type:"object",shape:e,catchall:Cs(),...G.normalizeParams(t)})}function Ww(e,t){return new ei({type:"object",shape:e,catchall:Yn(),...G.normalizeParams(t)})}function Os(e,t){return new ti({type:"union",options:e,...G.normalizeParams(t)})}function Kw(e,t){return new jh({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}function Zw(e,t,r){return new Mh({type:"union",options:t,discriminator:e,...G.normalizeParams(r)})}function zh(e,t){return new Uh({type:"intersection",left:e,right:t})}function Gh(e,t,r){let o=t instanceof ie,n=o?r:t,i=o?t:null;return new Fh({type:"tuple",items:e,rest:i,...G.normalizeParams(n)})}function Bh(e,t,r){return!t||!t._zod?new Dr({type:"record",keyType:Zo(),valueType:e,...G.normalizeParams(t)}):new Dr({type:"record",keyType:e,valueType:t,...G.normalizeParams(r)})}function Hw(e,t,r){let o=Je(e);return o._zod.values=void 0,new Dr({type:"record",keyType:o,valueType:t,...G.normalizeParams(r)})}function Vw(e,t,r){return new Dr({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(r)})}function Yw(e,t,r){return new Wh({type:"map",keyType:e,valueType:t,...G.normalizeParams(r)})}function Jw(e,t){return new Kh({type:"set",valueType:e,...G.normalizeParams(t)})}function Ns(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new jr({type:"enum",entries:r,...G.normalizeParams(t)})}function qw(e,t){return new jr({type:"enum",entries:e,...G.normalizeParams(t)})}function Xw(e,t){return new Zh({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}function Qw(e){return gp(Hh,e)}function Rs(e){return new Vh({type:"transform",transform:e})}function Vo(e){return new Ls({type:"optional",innerType:e})}function Jh(e){return new Yh({type:"optional",innerType:e})}function Yo(e){return new qh({type:"nullable",innerType:e})}function e_(e){return Vo(Yo(e))}function Qh(e,t){return new Xh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}function tm(e,t){return new em({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}function nm(e,t){return new Ds({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}function t_(e){return new rm({type:"success",innerType:e})}function im(e,t){return new om({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function n_(e){return mp(am,e)}function ps(e,t){return new ni({type:"pipe",in:e,out:t})}function r_(e,t,r){return new ri({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function o_(e){let t=e._zod.def;return new ri({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function lm(e){return new cm({type:"readonly",innerType:e})}function i_(e,t){return new dm({type:"template_literal",parts:e,...G.normalizeParams(t)})}function pm(e){return new um({type:"lazy",getter:e})}function a_(e){return new hm({type:"promise",innerType:e})}function s_(e){return new mm({type:"function",input:Array.isArray(e?.input)?Gh(e?.input):e?.input??Qo(Yn()),output:e?.output??Yn()})}function c_(e){let t=new be({check:"custom"});return t._zod.check=e,t}function l_(e,t){return yp(oi,e??(()=>!0),t)}function fm(e,t={}){return vp(oi,e,t)}function gm(e,t){return bp(e,t)}function p_(e,t={}){let r=new oi({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...G.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 m_(e){let t=pm(()=>Os([Zo(e),$h(),Th(),Ch(),Qo(t),Bh(Zo(),t)]));return t}function f_(e,t){return new sm({type:"pipe",in:Rs(e),out:t})}var ew,le,hs,Mr,ve,ms,Ho,Rt,qo,fs,gs,ys,vs,bs,ws,_s,ks,Eh,xs,Ss,Es,$s,Ts,As,Is,Ur,zr,Jn,Fr,Gr,Ps,Ah,Ih,Ph,Oh,Nh,Rh,Lh,Xo,Dh,ei,ti,jh,Mh,Uh,Fh,Dr,Wh,Kh,jr,Zh,Hh,Vh,Ls,Yh,qh,Xh,em,Ds,rm,om,am,ni,ri,sm,cm,dm,um,hm,mm,oi,d_,u_,h_,Ko=v(()=>{ht();ht();Go();Fo();as();Bo();Sh();ew=new WeakMap;le=w("ZodType",(e,t)=>(ie.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rr(e,"input"),output:Rr(e,"output")}}),e.toJSONSchema=xp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>ph(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>mh(e,r,o),e.parseAsync=async(r,o)=>hh(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>fh(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>gh(e,r,o),e.decode=(r,o)=>yh(e,r,o),e.encodeAsync=async(r,o)=>vh(e,r,o),e.decodeAsync=async(r,o)=>bh(e,r,o),e.safeEncode=(r,o)=>wh(e,r,o),e.safeDecode=(r,o)=>_h(e,r,o),e.safeEncodeAsync=async(r,o)=>kh(e,r,o),e.safeDecodeAsync=async(r,o)=>xh(e,r,o),Jo(e,"ZodType",{check(...r){let o=this.def;return this.clone(G.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 Je(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(fm(r,o))},superRefine(r,o){return this.check(gm(r,o))},overwrite(r){return this.check(Et(r))},optional(){return Vo(this)},exactOptional(){return Jh(this)},nullable(){return Yo(this)},nullish(){return Vo(Yo(this))},nonoptional(r){return nm(this,r)},array(){return Qo(this)},or(r){return Os([this,r])},and(r){return zh(this,r)},transform(r){return ps(this,Rs(r))},default(r){return Qh(this,r)},prefault(r){return tm(this,r)},catch(r){return im(this,r)},pipe(r){return ps(this,r)},readonly(){return lm(this)},describe(r){let o=this.clone();return je.add(o,{description:r}),o},meta(...r){if(r.length===0)return je.get(this);let o=this.clone();return je.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 je.get(e)?.description},configurable:!0}),e)),hs=w("_ZodString",(e,t)=>{Kn.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Sp(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Jo(e,"_ZodString",{regex(...o){return this.check(_r(...o))},includes(...o){return this.check(Sr(...o))},startsWith(...o){return this.check(Er(...o))},endsWith(...o){return this.check($r(...o))},min(...o){return this.check(Yt(...o))},max(...o){return this.check(Hn(...o))},length(...o){return this.check(Vn(...o))},nonempty(...o){return this.check(Yt(1,...o))},lowercase(o){return this.check(kr(o))},uppercase(o){return this.check(xr(o))},trim(){return this.check(Ir())},normalize(...o){return this.check(Ar(...o))},toLowerCase(){return this.check(Pr())},toUpperCase(){return this.check(Cr())},slugify(){return this.check(Or())}})}),Mr=w("ZodString",(e,t)=>{Kn.init(e,t),hs.init(e,t),e.email=r=>e.check(Ia(ms,r)),e.url=r=>e.check(zo(qo,r)),e.jwt=r=>e.check(Va(Is,r)),e.emoji=r=>e.check(Ra(fs,r)),e.guid=r=>e.check(Uo(Ho,r)),e.uuid=r=>e.check(Pa(Rt,r)),e.uuidv4=r=>e.check(Ca(Rt,r)),e.uuidv6=r=>e.check(Oa(Rt,r)),e.uuidv7=r=>e.check(Na(Rt,r)),e.nanoid=r=>e.check(La(gs,r)),e.guid=r=>e.check(Uo(Ho,r)),e.cuid=r=>e.check(Da(ys,r)),e.cuid2=r=>e.check(ja(vs,r)),e.ulid=r=>e.check(Ma(bs,r)),e.base64=r=>e.check(Ka($s,r)),e.base64url=r=>e.check(Za(Ts,r)),e.xid=r=>e.check(Ua(ws,r)),e.ksuid=r=>e.check(za(_s,r)),e.ipv4=r=>e.check(Fa(ks,r)),e.ipv6=r=>e.check(Ga(xs,r)),e.cidrv4=r=>e.check(Ba(Ss,r)),e.cidrv6=r=>e.check(Wa(Es,r)),e.e164=r=>e.check(Ha(As,r)),e.datetime=r=>e.check(sh(r)),e.date=r=>e.check(ch(r)),e.time=r=>e.check(lh(r)),e.duration=r=>e.check(dh(r))});ve=w("ZodStringFormat",(e,t)=>{ye.init(e,t),hs.init(e,t)}),ms=w("ZodEmail",(e,t)=>{Sd.init(e,t),ve.init(e,t)});Ho=w("ZodGUID",(e,t)=>{kd.init(e,t),ve.init(e,t)});Rt=w("ZodUUID",(e,t)=>{xd.init(e,t),ve.init(e,t)});qo=w("ZodURL",(e,t)=>{Ed.init(e,t),ve.init(e,t)});fs=w("ZodEmoji",(e,t)=>{$d.init(e,t),ve.init(e,t)});gs=w("ZodNanoID",(e,t)=>{Td.init(e,t),ve.init(e,t)});ys=w("ZodCUID",(e,t)=>{Ad.init(e,t),ve.init(e,t)});vs=w("ZodCUID2",(e,t)=>{Id.init(e,t),ve.init(e,t)});bs=w("ZodULID",(e,t)=>{Pd.init(e,t),ve.init(e,t)});ws=w("ZodXID",(e,t)=>{Cd.init(e,t),ve.init(e,t)});_s=w("ZodKSUID",(e,t)=>{Od.init(e,t),ve.init(e,t)});ks=w("ZodIPv4",(e,t)=>{jd.init(e,t),ve.init(e,t)});Eh=w("ZodMAC",(e,t)=>{Ud.init(e,t),ve.init(e,t)});xs=w("ZodIPv6",(e,t)=>{Md.init(e,t),ve.init(e,t)});Ss=w("ZodCIDRv4",(e,t)=>{zd.init(e,t),ve.init(e,t)});Es=w("ZodCIDRv6",(e,t)=>{Fd.init(e,t),ve.init(e,t)});$s=w("ZodBase64",(e,t)=>{Bd.init(e,t),ve.init(e,t)});Ts=w("ZodBase64URL",(e,t)=>{Wd.init(e,t),ve.init(e,t)});As=w("ZodE164",(e,t)=>{Kd.init(e,t),ve.init(e,t)});Is=w("ZodJWT",(e,t)=>{Zd.init(e,t),ve.init(e,t)});Ur=w("ZodCustomStringFormat",(e,t)=>{Hd.init(e,t),ve.init(e,t)});zr=w("ZodNumber",(e,t)=>{ba.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Ep(e,o,n,i),Jo(e,"ZodNumber",{gt(o,n){return this.check(Ot(o,n))},gte(o,n){return this.check(Xe(o,n))},min(o,n){return this.check(Xe(o,n))},lt(o,n){return this.check(Ct(o,n))},lte(o,n){return this.check(pt(o,n))},max(o,n){return this.check(pt(o,n))},int(o){return this.check(us(o))},safe(o){return this.check(us(o))},positive(o){return this.check(Ot(0,o))},nonnegative(o){return this.check(Xe(0,o))},negative(o){return this.check(Ct(0,o))},nonpositive(o){return this.check(pt(0,o))},multipleOf(o,n){return this.check(mn(o,n))},step(o,n){return this.check(mn(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});Jn=w("ZodNumberFormat",(e,t)=>{Vd.init(e,t),zr.init(e,t)});Fr=w("ZodBoolean",(e,t)=>{No.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>$p(e,r,o,n)});Gr=w("ZodBigInt",(e,t)=>{wa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Tp(e,o,n,i),e.gte=(o,n)=>e.check(Xe(o,n)),e.min=(o,n)=>e.check(Xe(o,n)),e.gt=(o,n)=>e.check(Ot(o,n)),e.gte=(o,n)=>e.check(Xe(o,n)),e.min=(o,n)=>e.check(Xe(o,n)),e.lt=(o,n)=>e.check(Ct(o,n)),e.lte=(o,n)=>e.check(pt(o,n)),e.max=(o,n)=>e.check(pt(o,n)),e.positive=o=>e.check(Ot(BigInt(0),o)),e.negative=o=>e.check(Ct(BigInt(0),o)),e.nonpositive=o=>e.check(pt(BigInt(0),o)),e.nonnegative=o=>e.check(Xe(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(mn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ps=w("ZodBigIntFormat",(e,t)=>{Yd.init(e,t),Gr.init(e,t)});Ah=w("ZodSymbol",(e,t)=>{Jd.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ap(e,r,o,n)});Ih=w("ZodUndefined",(e,t)=>{qd.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pp(e,r,o,n)});Ph=w("ZodNull",(e,t)=>{Xd.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ip(e,r,o,n)});Oh=w("ZodAny",(e,t)=>{Qd.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Np(e,r,o,n)});Nh=w("ZodUnknown",(e,t)=>{eu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rp(e,r,o,n)});Rh=w("ZodNever",(e,t)=>{tu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Op(e,r,o,n)});Lh=w("ZodVoid",(e,t)=>{nu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cp(e,r,o,n)});Xo=w("ZodDate",(e,t)=>{ru.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Lp(e,o,n,i),e.min=(o,n)=>e.check(Xe(o,n)),e.max=(o,n)=>e.check(pt(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});Dh=w("ZodArray",(e,t)=>{ou.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hp(e,r,o,n),e.element=t.element,Jo(e,"ZodArray",{min(r,o){return this.check(Yt(r,o))},nonempty(r){return this.check(Yt(1,r))},max(r,o){return this.check(Hn(r,o))},length(r,o){return this.check(Vn(r,o))},unwrap(){return this.element}})});ei=w("ZodObject",(e,t)=>{iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n),G.defineLazy(e,"shape",()=>t.shape),Jo(e,"ZodObject",{keyof(){return Ns(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Yn()})},loose(){return this.clone({...this._zod.def,catchall:Yn()})},strict(){return this.clone({...this._zod.def,catchall:Cs()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return G.extend(this,r)},safeExtend(r){return G.safeExtend(this,r)},merge(r){return G.merge(this,r)},pick(r){return G.pick(this,r)},omit(r){return G.omit(this,r)},partial(...r){return G.partial(Ls,this,r[0])},required(...r){return G.required(Ds,this,r[0])}})});ti=w("ZodUnion",(e,t)=>{Ro.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ts(e,r,o,n),e.options=t.options});jh=w("ZodXor",(e,t)=>{ti.init(e,t),au.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ts(e,r,o,n),e.options=t.options});Mh=w("ZodDiscriminatedUnion",(e,t)=>{ti.init(e,t),su.init(e,t)});Uh=w("ZodIntersection",(e,t)=>{cu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n)});Fh=w("ZodTuple",(e,t)=>{_a.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jp(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});Dr=w("ZodRecord",(e,t)=>{lu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});Wh=w("ZodMap",(e,t)=>{du.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Nt(...r)),e.nonempty=r=>e.check(Nt(1,r)),e.max=(...r)=>e.check(fn(...r)),e.size=(...r)=>e.check(Zn(...r))});Kh=w("ZodSet",(e,t)=>{uu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n),e.min=(...r)=>e.check(Nt(...r)),e.nonempty=r=>e.check(Nt(1,r)),e.max=(...r)=>e.check(fn(...r)),e.size=(...r)=>e.check(Zn(...r))});jr=w("ZodEnum",(e,t)=>{pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Dp(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 jr({...t,checks:[],...G.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 jr({...t,checks:[],...G.normalizeParams(n),entries:i})}});Zh=w("ZodLiteral",(e,t)=>{hu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jp(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]}})});Hh=w("ZodFile",(e,t)=>{mu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zp(e,r,o,n),e.min=(r,o)=>e.check(Nt(r,o)),e.max=(r,o)=>e.check(fn(r,o)),e.mime=(r,o)=>e.check(Tr(Array.isArray(r)?r:[r],o))});Vh=w("ZodTransform",(e,t)=>{fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(G.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(G.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)}});Ls=w("ZodOptional",(e,t)=>{ka.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ns(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Yh=w("ZodExactOptional",(e,t)=>{gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ns(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});qh=w("ZodNullable",(e,t)=>{yu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Xh=w("ZodDefault",(e,t)=>{vu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});em=w("ZodPrefault",(e,t)=>{bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>th(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Ds=w("ZodNonOptional",(e,t)=>{wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});rm=w("ZodSuccess",(e,t)=>{_u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});om=w("ZodCatch",(e,t)=>{ku.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});am=w("ZodNaN",(e,t)=>{xu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mp(e,r,o,n)});ni=w("ZodPipe",(e,t)=>{xa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rh(e,r,o,n),e.in=t.in,e.out=t.out});ri=w("ZodCodec",(e,t)=>{ni.init(e,t),Lo.init(e,t)});sm=w("ZodPreprocess",(e,t)=>{ni.init(e,t),Su.init(e,t)}),cm=w("ZodReadonly",(e,t)=>{Eu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dm=w("ZodTemplateLiteral",(e,t)=>{$u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Up(e,r,o,n)});um=w("ZodLazy",(e,t)=>{Iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ah(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});hm=w("ZodPromise",(e,t)=>{Au.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ih(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});mm=w("ZodFunction",(e,t)=>{Tu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bp(e,r,o,n)});oi=w("ZodCustom",(e,t)=>{Pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gp(e,r,o,n)});d_=wp,u_=_p;h_=(...e)=>kp({Codec:ri,Boolean:Fr,String:Mr},...e)});function w0(e){$e({customError:e})}function _0(){return $e().customError}var b0,ym,g_=v(()=>{ht();b0={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"};ym||(ym={})});function x0(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 S0(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 y_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Y.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 Y.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=S0(n,t),a=Be(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 Y.null();if(n.length===0)return Y.never();if(n.length===1)return Y.literal(n[0]);if(n.every(a=>typeof a=="string"))return Y.enum(n);let i=n.map(a=>Y.literal(a));return i.length<2?i[0]:Y.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Y.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return y_(a,t)});return n.length===0?Y.never():n.length===1?n[0]:Y.union(n)}if(!r)return Y.any();let o;switch(r){case"string":{let n=Y.string();if(e.format){let i=e.format;i==="email"?n=n.check(Y.email()):i==="uri"||i==="uri-reference"?n=n.check(Y.url()):i==="uuid"||i==="guid"?n=n.check(Y.uuid()):i==="date-time"?n=n.check(Y.iso.datetime()):i==="date"?n=n.check(Y.iso.date()):i==="time"?n=n.check(Y.iso.time()):i==="duration"?n=n.check(Y.iso.duration()):i==="ipv4"?n=n.check(Y.ipv4()):i==="ipv6"?n=n.check(Y.ipv6()):i==="mac"?n=n.check(Y.mac()):i==="cidr"?n=n.check(Y.cidrv4()):i==="cidr-v6"?n=n.check(Y.cidrv6()):i==="base64"?n=n.check(Y.base64()):i==="base64url"?n=n.check(Y.base64url()):i==="e164"?n=n.check(Y.e164()):i==="jwt"?n=n.check(Y.jwt()):i==="emoji"?n=n.check(Y.emoji()):i==="nanoid"?n=n.check(Y.nanoid()):i==="cuid"?n=n.check(Y.cuid()):i==="cuid2"?n=n.check(Y.cuid2()):i==="ulid"?n=n.check(Y.ulid()):i==="xid"?n=n.check(Y.xid()):i==="ksuid"&&(n=n.check(Y.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"?Y.number().int():Y.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=Y.boolean();break}case"null":{o=Y.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[u,l]of Object.entries(i)){let p=Be(l,t);n[u]=a.has(u)?p:p.optional()}if(e.propertyNames){let u=Be(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Be(e.additionalProperties,t):Y.any();if(Object.keys(n).length===0){o=Y.record(u,l);break}let p=Y.object(n).passthrough(),h=Y.looseRecord(u,l);o=Y.intersection(p,h);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),p=[];for(let f of l){let g=Be(u[f],t),k=Y.string().regex(new RegExp(f));p.push(Y.looseRecord(k,g))}let h=[];if(Object.keys(n).length>0&&h.push(Y.object(n).passthrough()),h.push(...p),h.length===0)o=Y.object({}).passthrough();else if(h.length===1)o=h[0];else{let f=Y.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)f=Y.intersection(f,h[g]);o=f}break}let s=Y.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Be(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(u=>Be(u,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Be(i,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(u=>Be(u,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Be(e.additionalItems,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(i!==void 0){let a=Be(i,t),s=Y.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=Y.array(Y.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Be(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r=y_(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=>Be(l,t)),u=Y.union(s);r=o?Y.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>Be(l,t)),u=Y.xor(s);r=o?Y.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:Y.any();else{let s=o?r:Be(e.allOf[0],t),u=o?0:1;for(let l=u;l<e.allOf.length;l++)s=Y.intersection(s,Be(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=Y.nullable(r)),e.readOnly===!0&&(r=Y.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))k0.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 v_(e,t){if(typeof e=="boolean")return e?Y.any():Y.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=x0(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??je};return Be(r,i)}var Y,k0,b_=v(()=>{Mo();as();Bo();Ko();Y={...Wo,...is,iso:Lr},k0=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 vm={};It(vm,{bigint:()=>A0,boolean:()=>T0,date:()=>I0,number:()=>$0,string:()=>E0});function E0(e){return Uu(Mr,e)}function $0(e){return Hu(zr,e)}function T0(e){return ep(Fr,e)}function A0(e){return np(Gr,e)}function I0(e){return hp(Xo,e)}var w_=v(()=>{ht();Ko()});var c={};It(c,{$brand:()=>sl,$input:()=>ju,$output:()=>Du,NEVER:()=>al,TimePrecision:()=>Fu,ZodAny:()=>Oh,ZodArray:()=>Dh,ZodBase64:()=>$s,ZodBase64URL:()=>Ts,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ps,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Ss,ZodCIDRv6:()=>Es,ZodCUID:()=>ys,ZodCUID2:()=>vs,ZodCatch:()=>om,ZodCodec:()=>ri,ZodCustom:()=>oi,ZodCustomStringFormat:()=>Ur,ZodDate:()=>Xo,ZodDefault:()=>Xh,ZodDiscriminatedUnion:()=>Mh,ZodE164:()=>As,ZodEmail:()=>ms,ZodEmoji:()=>fs,ZodEnum:()=>jr,ZodError:()=>y0,ZodExactOptional:()=>Yh,ZodFile:()=>Hh,ZodFirstPartyTypeKind:()=>ym,ZodFunction:()=>mm,ZodGUID:()=>Ho,ZodIPv4:()=>ks,ZodIPv6:()=>xs,ZodISODate:()=>cs,ZodISODateTime:()=>ss,ZodISODuration:()=>ds,ZodISOTime:()=>ls,ZodIntersection:()=>Uh,ZodIssueCode:()=>b0,ZodJWT:()=>Is,ZodKSUID:()=>_s,ZodLazy:()=>um,ZodLiteral:()=>Zh,ZodMAC:()=>Eh,ZodMap:()=>Wh,ZodNaN:()=>am,ZodNanoID:()=>gs,ZodNever:()=>Rh,ZodNonOptional:()=>Ds,ZodNull:()=>Ph,ZodNullable:()=>qh,ZodNumber:()=>zr,ZodNumberFormat:()=>Jn,ZodObject:()=>ei,ZodOptional:()=>Ls,ZodPipe:()=>ni,ZodPrefault:()=>em,ZodPreprocess:()=>sm,ZodPromise:()=>hm,ZodReadonly:()=>cm,ZodRealError:()=>it,ZodRecord:()=>Dr,ZodSet:()=>Kh,ZodString:()=>Mr,ZodStringFormat:()=>ve,ZodSuccess:()=>rm,ZodSymbol:()=>Ah,ZodTemplateLiteral:()=>dm,ZodTransform:()=>Vh,ZodTuple:()=>Fh,ZodType:()=>le,ZodULID:()=>bs,ZodURL:()=>qo,ZodUUID:()=>Rt,ZodUndefined:()=>Ih,ZodUnion:()=>ti,ZodUnknown:()=>Nh,ZodVoid:()=>Lh,ZodXID:()=>ws,ZodXor:()=>jh,_ZodString:()=>hs,_default:()=>Qh,_function:()=>s_,any:()=>Mw,array:()=>Qo,base64:()=>_w,base64url:()=>kw,bigint:()=>Nw,boolean:()=>Th,catch:()=>im,check:()=>c_,cidrv4:()=>bw,cidrv6:()=>ww,clone:()=>Je,codec:()=>r_,coerce:()=>vm,config:()=>$e,core:()=>Jt,cuid:()=>uw,cuid2:()=>pw,custom:()=>l_,date:()=>zw,decode:()=>yh,decodeAsync:()=>bh,describe:()=>d_,discriminatedUnion:()=>Zw,e164:()=>xw,email:()=>tw,emoji:()=>lw,encode:()=>gh,encodeAsync:()=>vh,endsWith:()=>$r,enum:()=>Ns,exactOptional:()=>Jh,file:()=>Qw,flattenError:()=>Ao,float32:()=>Iw,float64:()=>Pw,formatError:()=>Io,fromJSONSchema:()=>v_,function:()=>s_,getErrorMap:()=>_0,globalRegistry:()=>je,gt:()=>Ot,gte:()=>Xe,guid:()=>nw,hash:()=>Aw,hex:()=>Tw,hostname:()=>$w,httpUrl:()=>cw,includes:()=>Sr,instanceof:()=>p_,int:()=>us,int32:()=>Cw,int64:()=>Rw,intersection:()=>zh,invertCodec:()=>o_,ipv4:()=>gw,ipv6:()=>vw,iso:()=>Lr,json:()=>m_,jwt:()=>Sw,keyof:()=>Fw,ksuid:()=>fw,lazy:()=>pm,length:()=>Vn,literal:()=>Xw,locales:()=>jo,looseObject:()=>Ww,looseRecord:()=>Vw,lowercase:()=>kr,lt:()=>Ct,lte:()=>pt,mac:()=>yw,map:()=>Yw,maxLength:()=>Hn,maxSize:()=>fn,meta:()=>u_,mime:()=>Tr,minLength:()=>Yt,minSize:()=>Nt,multipleOf:()=>mn,nan:()=>n_,nanoid:()=>dw,nativeEnum:()=>qw,negative:()=>Ja,never:()=>Cs,nonnegative:()=>Xa,nonoptional:()=>nm,nonpositive:()=>qa,normalize:()=>Ar,null:()=>Ch,nullable:()=>Yo,nullish:()=>e_,number:()=>$h,object:()=>Gw,optional:()=>Vo,overwrite:()=>Et,parse:()=>ph,parseAsync:()=>hh,partialRecord:()=>Hw,pipe:()=>ps,positive:()=>Ya,prefault:()=>tm,preprocess:()=>f_,prettifyError:()=>wl,promise:()=>a_,property:()=>Qa,readonly:()=>lm,record:()=>Bh,refine:()=>fm,regex:()=>_r,regexes:()=>ut,registry:()=>Aa,safeDecode:()=>_h,safeDecodeAsync:()=>xh,safeEncode:()=>wh,safeEncodeAsync:()=>kh,safeParse:()=>mh,safeParseAsync:()=>fh,set:()=>Jw,setErrorMap:()=>w0,size:()=>Zn,slugify:()=>Or,startsWith:()=>Er,strictObject:()=>Bw,string:()=>Zo,stringFormat:()=>Ew,stringbool:()=>h_,success:()=>t_,superRefine:()=>gm,symbol:()=>Dw,templateLiteral:()=>i_,toJSONSchema:()=>rs,toLowerCase:()=>Pr,toUpperCase:()=>Cr,transform:()=>Rs,treeifyError:()=>bl,trim:()=>Ir,tuple:()=>Gh,uint32:()=>Ow,uint64:()=>Lw,ulid:()=>hw,undefined:()=>jw,union:()=>Os,unknown:()=>Yn,uppercase:()=>xr,url:()=>sw,util:()=>G,uuid:()=>rw,uuidv4:()=>ow,uuidv6:()=>iw,uuidv7:()=>aw,void:()=>Uw,xid:()=>mw,xor:()=>Kw});var bm=v(()=>{ht();Ko();as();uh();Sh();g_();ht();Ou();ht();Go();b_();Lu();Bo();Bo();w_();$e(Sa())});var at=v(()=>{bm();bm()});function __(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(C0.has(t)||P0.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 __(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function k_(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(__(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var P0,C0,wm=v(()=>{"use strict";P0=[".localhost",".local",".internal",".test",".localdomain"],C0=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var ii,ai=v(()=>{"use strict";at();ii=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var si,js=v(()=>{"use strict";at();si=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 bn,_m,ci,et,Lt,Br,Wr=v(()=>{"use strict";bn="penalty_v1",_m=["easy_v1","balanced_v1","hard_v1"],ci="balanced_v1",et={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Lt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},Br="shoot"});function $_(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 Ms(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 wn(e){return`round-${e.number}`}var km,O0,N0,R0,L0,x_,D0,xm,S_,j0,E_,M0,Us,U0,We,s2,c2,l2,Dt=v(()=>{"use strict";at();Ht();ai();js();Wr();km=c.object({archetype:c.literal("hunt"),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(),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.`})}),O0=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative()}),N0=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(O0).min(1)}),R0=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),L0=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],x_=c.object({archetype:c.literal("push"),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(N0).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(R0).default(L0),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,u=!1;for(let l of e.line){let h=e.slates.find(f=>f.id===l.slate)?.entries.find(f=>f.key===l.key);if(!h){u=!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}!u&&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(u=>u.key)),n=[...new Set(o.filter((s,u)=>o.indexOf(s)!==u))];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,u)=>s+Math.min(...u.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,u)=>u===0||s.within>e.tiers[u-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."})}),D0=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),xm=c.object({archetype:c.literal("group"),number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(D0).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 u=r.get(s);u&&u!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${u} 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.`})}),S_=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),j0=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(S_).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."})}),E_=c.object({archetype:c.literal("predict"),number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(S_).min(2).optional(),questions:c.array(j0).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.`})});M0=c.object({archetype:c.literal("bingo"),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.`})}}),Us=c.object({archetype:c.literal("shoot"),number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(bn).default(bn),difficulty:c.enum(_m).default(ci),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.`})}),U0=c.discriminatedUnion("archetype",[km,x_,xm,E_,M0,Us]),We=c.preprocess(wy,U0);s2=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),c2=c.object({game:c.string().min(1),round:We,origin:si.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:We,origin:si.optional()})).min(1)}).optional()}),l2=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(ii).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function W0(e){return P_.includes(e)}function K0(e){return O_.includes(Ge(e))}function N_(e){let t=[],r=e.backend.archetype;r&&K0(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Ji.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&&W0(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Tm}\`: 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=k_(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 li,Sm,Em,$m,T_,_n,kn,A_,z0,jt,F0,G0,B0,I_,Tm,P_,C_,xn,O_,Z0,H0,V0,Y0,J0,q0,X0,Q0,eP,tP,nP,rP,oP,Sn,Kr,En=v(()=>{"use strict";at();wm();wo();Ht();Dt();li="1.0",Sm=c.enum(["missing","proposed","confirmed","verified","approved"]),Em={missing:0,proposed:1,confirmed:2,verified:3,approved:4},$m=c.enum(["runtime","live","enterprise"]),T_="Accounts must be approved before the first deploy.",_n=c.enum(["L0","L1","L2","L3","L4","L5"]),kn={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},A_={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},z0=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()})]),jt={status:Sm.default("missing"),provenance:c.array(z0).default([])},F0=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:_n.default("L0")}),G0=c.object({repository:c.string().url(),branch:c.string().default("main")}),B0=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:G0.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...jt}),I_=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Tm="managed_runtime",P_=I_.options.filter(e=>e!==Tm);C_=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot"]),xn=c.preprocess(e=>typeof e=="string"?Ge(e):e,C_),O_=C_.options.filter(e=>!Ji.includes(e));Z0=c.object({route:I_.optional().describe(`Only ${Tm} is a route Gamestage implements: every game runs on our Engine. ${P_.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:xn.optional().describe(`The formats the Engine marks are ${Ji.join(", ")}. ${O_.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:We.optional(),...jt}),H0=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(ur),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:_n.optional()}).optional(),...jt}),V0=c.object({spec_url:c.string().optional(),version:c.string().optional(),...jt}),Y0=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...jt}),J0=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...jt}),q0=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()}),X0=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),Q0=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:X0.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:q0.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...jt}),eP=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),tP=c.object({destinations:c.array(eP).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({}),...jt}),nP=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...jt}),rP=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([])}),oP=c.object({support_tier:$m.optional(),runbook:c.string().optional(),promotion:rP.prefault({}),...jt}),Sn=c.object({manifest:F0,app:B0,experience:H0.prefault({}),studio_app:V0.prefault({}),studio_surface:Y0.prefault({}),backend:Z0.prefault({}),interaction_cloud:J0.prefault({}),identity:Q0.prefault({}),measurement:tP.prefault({}),deployment:nP.prefault({}),operations:oP.prefault({})});Kr=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function st(e,t={}){let r=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),o=Am.filter(f=>f.checkable).map(r),n=Am.filter(f=>!f.checkable).map(r),i="L0",a=!0;for(let f of Im){let g=o.filter(L=>L.level===f);g.length>0&&g.every(L=>L.passed)&&a?i=f:a=!1}let s=o.filter(f=>f.level==="L0").every(f=>f.passed),u=kn[i]+1,l=Im[u],p=l?o.filter(f=>f.level===l&&!f.passed):[],h=e.manifest.conformance;return{computed:i,computedName:A_[i],claimed:h,overclaimed:!s||Math.min(kn[h],kn[R_])>kn[i],results:o,blockers:s?p:o.filter(f=>f.level==="L0"&&!f.passed),ceiling:R_,advice:n}}function L_(e,t){let o=st(e).results.filter(n=>!n.passed&&kn[n.level]<=kn[t]);return{ok:o.length===0,missing:o}}var qn,Me,Am,Im,iP,v2,R_,zs=v(()=>{"use strict";En();qn=(e,t,r)=>{let o=e[t];return Em[o?.status??"missing"]>=Em[r]},Me=e=>typeof e=="string"?e.trim().length>0:e!=null,Am=[{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=>Me(e.app.id)&&Me(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=>qn(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=>Me(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=>Me(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=>qn(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=>Me(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)=>Me(t.backendComponent)||Me(e.backend.component)&&Me(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=>Me(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)=>Me(t.platformProject)||Me(e.studio_app.spec_url)||Me(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)=>Me(t.playgroundUrl)||Me(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=>Me(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=>qn(e,"experience","confirmed")&&qn(e,"backend","confirmed")&&qn(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=>qn(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=>Me(e.operations.support_tier)&&Me(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=>qn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Im=["L0","L1","L2","L3","L4","L5"],iP=[{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"}],v2=new Map(iP.map(e=>[e.level,e])),R_=[...Im].reverse().find(e=>Am.some(t=>t.level===e&&t.checkable))??"L0"});function aP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function di(){if(D_)return $n;D_=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 u=Object.keys(s);for(let l=0,p=u.length;l<p;l+=1){let h=u[l];a[h]=s[h]}}return a}function n(a,s){let u="";for(let l=0;l<s;l+=1)u+=a;return u}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return $n.isNothing=e,$n.isObject=t,$n.toArray=r,$n.repeat=n,$n.isNegativeZero=i,$n.extend=o,$n}function ui(){if(j_)return Pm;j_=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+=`
10144
+ 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 vn(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 u=e.seen.get(s);if(u.ref===null)return;let l=u.def??u.schema,p={...l},h=u.ref;if(u.ref=null,h){o(h);let g=e.seen.get(h),k=g.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(k)):Object.assign(l,k),Object.assign(l,p),s._zod.parent===h)for(let b in l)b==="$ref"||b==="allOf"||b in p||delete l[b];if(k.$ref&&g.def)for(let b in l)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(l[b])===JSON.stringify(g.def[b])&&delete l[b]}let f=s._zod.parent;if(f&&f!==h){o(f);let g=e.seen.get(f);if(g?.schema.$ref&&(l.$ref=g.schema.$ref,g.def))for(let k in l)k==="$ref"||k==="allOf"||k in g.def&&JSON.stringify(l[k])===JSON.stringify(g.def[k])&&delete l[k]}e.override({zodSchema:s,jsonSchema:l,path:u.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 u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,a[u.defId]=u.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:Rr(t,"input",e.processors),output:Rr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qe(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 Qe(o.element,r);if(o.type==="set")return Qe(o.valueType,r);if(o.type==="lazy")return Qe(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 Qe(o.innerType,r);if(o.type==="intersection")return Qe(o.left,r)||Qe(o.right,r);if(o.type==="record"||o.type==="map")return Qe(o.keyType,r)||Qe(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Qe(o.in,r)||Qe(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Qe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Qe(n,r))return!0;return!!(o.rest&&Qe(o.rest,r))}return!1}var Pp,Rr,Go=v(()=>{Uo();Pp=(e,t={})=>r=>{let o=gn({...r,processors:t});return fe(e,o),yn(o,e),vn(o,e)},Rr=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=gn({...n??{},target:i,io:t,processors:r});return fe(e,a),yn(a,e),vn(a,e)}});function as(e,t){if("_idmap"in e){let o=e,n=gn({...t,processors:rs}),i={};for(let u of o._idmap.entries()){let[l,p]=u;fe(p,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let u of o._idmap.entries()){let[l,p]=u;yn(n,p),a[l]=vn(n,p)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let r=gn({...t,processors:rs});return fe(e,r),yn(r,e),vn(r,e)}var N0,Cp,Op,Np,Rp,Lp,Dp,jp,Mp,Up,zp,Fp,Gp,Bp,Wp,Kp,Zp,Hp,Vp,Yp,Jp,qp,Xp,Qp,eh,th,os,nh,rh,oh,ih,ah,sh,ch,lh,dh,uh,ph,is,hh,rs,Bo=v(()=>{Go();te();N0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cp=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:u,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=N0[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),l&&(n.contentEncoding=l),u&&u.size>0){let p=[...u];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}))])}},Op=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:u,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),f=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";h?g?(n.minimum=p,n.exclusiveMinimum=!0):n.exclusiveMinimum=p:typeof i=="number"&&(n.minimum=i),f?g?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof a=="number"&&(n.maximum=a),typeof u=="number"&&(n.multipleOf=u)},Np=(e,t,r,o)=>{r.type="boolean"},Rp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Lp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Dp=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},jp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Mp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Up=(e,t,r,o)=>{r.not={}},zp=(e,t,r,o)=>{},Fp=(e,t,r,o)=>{},Gp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Bp=(e,t,r,o)=>{let n=e._zod.def,i=xo(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Wp=(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},Kp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Zp=(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},Hp=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:u}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(n,i)},Vp=(e,t,r,o)=>{r.type="boolean"},Yp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Jp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Xp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Qp=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},eh=(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=fe(i.element,t,{...o,path:[...o.path,"items"]})},th=(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]=fe(a[l],t,{...o,path:[...o.path,"properties",l]});let s=new Set(Object.keys(a)),u=new Set([...s].filter(l=>{let p=i.shape[l]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=fe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},os=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,u)=>fe(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=a:r.anyOf=a},nh=(e,t,r,o)=>{let n=e._zod.def,i=fe(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=fe(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,u=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=u},rh=(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",u=i.items.map((f,g)=>fe(f,t,{...o,path:[...o.path,a,g]})),l=i.rest?fe(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:u},l&&n.items.anyOf.push(l),n.minItems=u.length,l||(n.maxItems=u.length)):(n.items=u,l&&(n.additionalItems=l));let{minimum:p,maximum:h}=e._zod.bag;typeof p=="number"&&(n.minItems=p),typeof h=="number"&&(n.maxItems=h)},oh=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let p=fe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let h of u)n.patternProperties[h.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=fe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=fe(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)}},ih=(e,t,r,o)=>{let n=e._zod.def,i=fe(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"}]},ah=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},sh=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},ch=(e,t,r,o)=>{let n=e._zod.def;fe(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)))},lh=(e,t,r,o)=>{let n=e._zod.def;fe(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},dh=(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;fe(a,t,o);let s=t.seen.get(e);s.ref=a},uh=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},ph=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},is=(e,t,r,o)=>{let n=e._zod.def;fe(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},hh=(e,t,r,o)=>{let n=e._zod.innerType;fe(n,t,o);let i=t.seen.get(e);i.ref=n},rs={string:Cp,number:Op,boolean:Np,bigint:Rp,symbol:Lp,null:Dp,undefined:jp,void:Mp,never:Up,any:zp,unknown:Fp,date:Gp,enum:Bp,literal:Wp,nan:Kp,template_literal:Zp,file:Hp,success:Vp,custom:Yp,function:Jp,transform:qp,map:Xp,set:Qp,array:eh,object:th,union:os,intersection:nh,tuple:rh,record:oh,nullable:ih,nonoptional:ah,default:sh,prefault:ch,catch:lh,pipe:dh,readonly:uh,promise:ph,optional:is,lazy:hh}});var ss,iw=v(()=>{Bo();Go();ss=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=gn({processors:rs,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 fe(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)),yn(this.ctx,t);let o=vn(this.ctx,t),{"~standard":n,...i}=o;return i}}});var aw={};var sw=v(()=>{});var Jt={};It(Jt,{$ZodAny:()=>au,$ZodArray:()=>uu,$ZodAsyncError:()=>St,$ZodBase64:()=>Jd,$ZodBase64URL:()=>qd,$ZodBigInt:()=>xa,$ZodBigIntFormat:()=>nu,$ZodBoolean:()=>Ro,$ZodCIDRv4:()=>Hd,$ZodCIDRv6:()=>Vd,$ZodCUID:()=>Ld,$ZodCUID2:()=>Dd,$ZodCatch:()=>Iu,$ZodCheck:()=>be,$ZodCheckBigIntFormat:()=>ld,$ZodCheckEndsWith:()=>_d,$ZodCheckGreaterThan:()=>ga,$ZodCheckIncludes:()=>bd,$ZodCheckLengthEquals:()=>fd,$ZodCheckLessThan:()=>fa,$ZodCheckLowerCase:()=>yd,$ZodCheckMaxLength:()=>hd,$ZodCheckMaxSize:()=>dd,$ZodCheckMimeType:()=>xd,$ZodCheckMinLength:()=>md,$ZodCheckMinSize:()=>ud,$ZodCheckMultipleOf:()=>sd,$ZodCheckNumberFormat:()=>cd,$ZodCheckOverwrite:()=>Sd,$ZodCheckProperty:()=>kd,$ZodCheckRegex:()=>gd,$ZodCheckSizeEquals:()=>pd,$ZodCheckStartsWith:()=>wd,$ZodCheckStringFormat:()=>br,$ZodCheckUpperCase:()=>vd,$ZodCodec:()=>Do,$ZodCustom:()=>ju,$ZodCustomStringFormat:()=>eu,$ZodDate:()=>du,$ZodDefault:()=>Eu,$ZodDiscriminatedUnion:()=>mu,$ZodE164:()=>Xd,$ZodEmail:()=>Cd,$ZodEmoji:()=>Nd,$ZodEncodeError:()=>ln,$ZodEnum:()=>bu,$ZodError:()=>Ao,$ZodExactOptional:()=>xu,$ZodFile:()=>_u,$ZodFunction:()=>Ru,$ZodGUID:()=>Id,$ZodIPv4:()=>Wd,$ZodIPv6:()=>Kd,$ZodISODate:()=>Fd,$ZodISODateTime:()=>zd,$ZodISODuration:()=>Bd,$ZodISOTime:()=>Gd,$ZodIntersection:()=>fu,$ZodJWT:()=>Qd,$ZodKSUID:()=>Ud,$ZodLazy:()=>Du,$ZodLiteral:()=>wu,$ZodMAC:()=>Zd,$ZodMap:()=>yu,$ZodNaN:()=>Pu,$ZodNanoID:()=>Rd,$ZodNever:()=>cu,$ZodNonOptional:()=>Tu,$ZodNull:()=>iu,$ZodNullable:()=>Su,$ZodNumber:()=>ka,$ZodNumberFormat:()=>tu,$ZodObject:()=>sv,$ZodObjectJIT:()=>pu,$ZodOptional:()=>Ea,$ZodPipe:()=>$a,$ZodPrefault:()=>$u,$ZodPreprocess:()=>Cu,$ZodPromise:()=>Lu,$ZodReadonly:()=>Ou,$ZodRealError:()=>ot,$ZodRecord:()=>gu,$ZodRegistry:()=>Pa,$ZodSet:()=>vu,$ZodString:()=>Kn,$ZodStringFormat:()=>ye,$ZodSuccess:()=>Au,$ZodSymbol:()=>ru,$ZodTemplateLiteral:()=>Nu,$ZodTransform:()=>ku,$ZodTuple:()=>Sa,$ZodType:()=>ie,$ZodULID:()=>jd,$ZodURL:()=>Od,$ZodUUID:()=>Pd,$ZodUndefined:()=>ou,$ZodUnion:()=>Lo,$ZodUnknown:()=>su,$ZodVoid:()=>lu,$ZodXID:()=>Md,$ZodXor:()=>hu,$brand:()=>ml,$constructor:()=>w,$input:()=>Wu,$output:()=>Bu,Doc:()=>No,JSONSchema:()=>aw,JSONSchemaGenerator:()=>ss,NEVER:()=>hl,TimePrecision:()=>Vu,_any:()=>fp,_array:()=>kp,_base64:()=>Va,_base64url:()=>Ya,_bigint:()=>cp,_boolean:()=>ap,_catch:()=>T0,_check:()=>rw,_cidrv4:()=>Za,_cidrv6:()=>Ha,_coercedBigint:()=>lp,_coercedBoolean:()=>sp,_coercedDate:()=>wp,_coercedNumber:()=>ep,_coercedString:()=>Zu,_cuid:()=>Ua,_cuid2:()=>za,_custom:()=>Sp,_date:()=>bp,_decode:()=>ia,_decodeAsync:()=>sa,_default:()=>S0,_discriminatedUnion:()=>p0,_e164:()=>Ja,_email:()=>Oa,_emoji:()=>ja,_encode:()=>oa,_encodeAsync:()=>aa,_endsWith:()=>$r,_enum:()=>v0,_file:()=>xp,_float32:()=>np,_float64:()=>rp,_gt:()=>Ot,_gte:()=>Xe,_guid:()=>zo,_includes:()=>Sr,_int:()=>tp,_int32:()=>op,_int64:()=>dp,_intersection:()=>h0,_ipv4:()=>Wa,_ipv6:()=>Ka,_isoDate:()=>Ju,_isoDateTime:()=>Yu,_isoDuration:()=>Xu,_isoTime:()=>qu,_jwt:()=>qa,_ksuid:()=>Ba,_lazy:()=>C0,_length:()=>Vn,_literal:()=>w0,_lowercase:()=>kr,_lt:()=>Ct,_lte:()=>pt,_mac:()=>Hu,_map:()=>g0,_max:()=>pt,_maxLength:()=>Hn,_maxSize:()=>fn,_mime:()=>Tr,_min:()=>Xe,_minLength:()=>Yt,_minSize:()=>Nt,_multipleOf:()=>mn,_nan:()=>_p,_nanoid:()=>Ma,_nativeEnum:()=>b0,_negative:()=>Qa,_never:()=>yp,_nonnegative:()=>ts,_nonoptional:()=>E0,_nonpositive:()=>es,_normalize:()=>Ar,_null:()=>mp,_nullable:()=>x0,_number:()=>Qu,_optional:()=>k0,_overwrite:()=>Et,_parse:()=>fr,_parseAsync:()=>gr,_pipe:()=>A0,_positive:()=>Xa,_promise:()=>O0,_property:()=>ns,_readonly:()=>I0,_record:()=>f0,_refine:()=>Ep,_regex:()=>_r,_safeDecode:()=>la,_safeDecodeAsync:()=>ua,_safeEncode:()=>ca,_safeEncodeAsync:()=>da,_safeParse:()=>yr,_safeParseAsync:()=>vr,_set:()=>y0,_size:()=>Zn,_slugify:()=>Or,_startsWith:()=>Er,_string:()=>Ku,_stringFormat:()=>Nr,_stringbool:()=>Ip,_success:()=>$0,_superRefine:()=>$p,_symbol:()=>pp,_templateLiteral:()=>P0,_toLowerCase:()=>Pr,_toUpperCase:()=>Cr,_transform:()=>_0,_trim:()=>Ir,_tuple:()=>m0,_uint32:()=>ip,_uint64:()=>up,_ulid:()=>Fa,_undefined:()=>hp,_union:()=>d0,_unknown:()=>gp,_uppercase:()=>xr,_url:()=>Fo,_uuid:()=>Na,_uuidv4:()=>Ra,_uuidv6:()=>La,_uuidv7:()=>Da,_void:()=>vp,_xid:()=>Ga,_xor:()=>u0,clone:()=>Je,config:()=>Te,createStandardJSONSchemaMethod:()=>Rr,createToJSONSchemaMethod:()=>Pp,decode:()=>OA,decodeAsync:()=>RA,describe:()=>Tp,encode:()=>CA,encodeAsync:()=>NA,extractDefs:()=>yn,finalize:()=>vn,flattenError:()=>Io,formatError:()=>Po,globalConfig:()=>Fn,globalRegistry:()=>je,initializeContext:()=>gn,isValidBase64:()=>Yd,isValidBase64URL:()=>rv,isValidJWT:()=>ov,locales:()=>Mo,meta:()=>Ap,parse:()=>na,parseAsync:()=>ra,prettifyError:()=>Tl,process:()=>fe,regexes:()=>ut,registry:()=>Ca,safeDecode:()=>DA,safeDecodeAsync:()=>MA,safeEncode:()=>LA,safeEncodeAsync:()=>jA,safeParse:()=>Il,safeParseAsync:()=>Pl,toDotPath:()=>Dy,toJSONSchema:()=>as,treeifyError:()=>$l,util:()=>B,version:()=>$d});var ht=v(()=>{Gn();Cl();Al();Mu();ya();Td();te();ma();Gu();Uo();Ed();ow();Go();Bo();iw();sw()});var cs={};It(cs,{endsWith:()=>$r,gt:()=>Ot,gte:()=>Xe,includes:()=>Sr,length:()=>Vn,lowercase:()=>kr,lt:()=>Ct,lte:()=>pt,maxLength:()=>Hn,maxSize:()=>fn,mime:()=>Tr,minLength:()=>Yt,minSize:()=>Nt,multipleOf:()=>mn,negative:()=>Qa,nonnegative:()=>ts,nonpositive:()=>es,normalize:()=>Ar,overwrite:()=>Et,positive:()=>Xa,property:()=>ns,regex:()=>_r,size:()=>Zn,slugify:()=>Or,startsWith:()=>Er,toLowerCase:()=>Pr,toUpperCase:()=>Cr,trim:()=>Ir,uppercase:()=>xr});var ls=v(()=>{ht()});var Lr={};It(Lr,{ZodISODate:()=>us,ZodISODateTime:()=>ds,ZodISODuration:()=>hs,ZodISOTime:()=>ps,date:()=>fh,datetime:()=>mh,duration:()=>yh,time:()=>gh});function mh(e){return Yu(ds,e)}function fh(e){return Ju(us,e)}function gh(e){return qu(ps,e)}function yh(e){return Xu(hs,e)}var ds,us,ps,hs,Wo=v(()=>{ht();Zo();ds=w("ZodISODateTime",(e,t)=>{zd.init(e,t),ve.init(e,t)});us=w("ZodISODate",(e,t)=>{Fd.init(e,t),ve.init(e,t)});ps=w("ZodISOTime",(e,t)=>{Gd.init(e,t),ve.init(e,t)});hs=w("ZodISODuration",(e,t)=>{Bd.init(e,t),ve.init(e,t)})});var cw,L0,it,vh=v(()=>{ht();ht();te();cw=(e,t)=>{Ao.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Po(e,r)},flatten:{value:r=>Io(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,pr,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,pr,2)}},isEmpty:{get(){return e.issues.length===0}}})},L0=w("ZodError",cw),it=w("ZodError",cw,{Parent:Error})});var bh,wh,_h,kh,xh,Sh,Eh,$h,Th,Ah,Ih,Ph,Ch=v(()=>{ht();vh();bh=fr(it),wh=gr(it),_h=yr(it),kh=vr(it),xh=oa(it),Sh=ia(it),Eh=aa(it),$h=sa(it),Th=ca(it),Ah=la(it),Ih=da(it),Ph=ua(it)});var Ko={};It(Ko,{ZodAny:()=>Uh,ZodArray:()=>Bh,ZodBase64:()=>Is,ZodBase64URL:()=>Ps,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ns,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Ts,ZodCIDRv6:()=>As,ZodCUID:()=>ws,ZodCUID2:()=>_s,ZodCatch:()=>um,ZodCodec:()=>oi,ZodCustom:()=>ii,ZodCustomStringFormat:()=>Ur,ZodDate:()=>Qo,ZodDefault:()=>im,ZodDiscriminatedUnion:()=>Kh,ZodE164:()=>Cs,ZodEmail:()=>ys,ZodEmoji:()=>vs,ZodEnum:()=>jr,ZodExactOptional:()=>nm,ZodFile:()=>em,ZodFunction:()=>_m,ZodGUID:()=>Vo,ZodIPv4:()=>Es,ZodIPv6:()=>$s,ZodIntersection:()=>Zh,ZodJWT:()=>Os,ZodKSUID:()=>Ss,ZodLazy:()=>vm,ZodLiteral:()=>Qh,ZodMAC:()=>Oh,ZodMap:()=>qh,ZodNaN:()=>hm,ZodNanoID:()=>bs,ZodNever:()=>Fh,ZodNonOptional:()=>Us,ZodNull:()=>jh,ZodNullable:()=>om,ZodNumber:()=>zr,ZodNumberFormat:()=>Jn,ZodObject:()=>ti,ZodOptional:()=>Ms,ZodPipe:()=>ri,ZodPrefault:()=>sm,ZodPreprocess:()=>mm,ZodPromise:()=>wm,ZodReadonly:()=>fm,ZodRecord:()=>Dr,ZodSet:()=>Xh,ZodString:()=>Mr,ZodStringFormat:()=>ve,ZodSuccess:()=>dm,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>ym,ZodTransform:()=>tm,ZodTuple:()=>Vh,ZodType:()=>le,ZodULID:()=>ks,ZodURL:()=>Xo,ZodUUID:()=>Rt,ZodUndefined:()=>Dh,ZodUnion:()=>ni,ZodUnknown:()=>zh,ZodVoid:()=>Gh,ZodXID:()=>xs,ZodXor:()=>Wh,_ZodString:()=>gs,_default:()=>am,_function:()=>g_,any:()=>Hw,array:()=>ei,base64:()=>Pw,base64url:()=>Cw,bigint:()=>Gw,boolean:()=>Rh,catch:()=>pm,check:()=>y_,cidrv4:()=>Aw,cidrv6:()=>Iw,codec:()=>p_,cuid:()=>ww,cuid2:()=>_w,custom:()=>v_,date:()=>Yw,describe:()=>b_,discriminatedUnion:()=>t_,e164:()=>Ow,email:()=>dw,emoji:()=>vw,enum:()=>Ds,exactOptional:()=>rm,file:()=>c_,float32:()=>Mw,float64:()=>Uw,function:()=>g_,guid:()=>uw,hash:()=>jw,hex:()=>Dw,hostname:()=>Lw,httpUrl:()=>yw,instanceof:()=>__,int:()=>ms,int32:()=>zw,int64:()=>Bw,intersection:()=>Hh,invertCodec:()=>h_,ipv4:()=>Ew,ipv6:()=>Tw,json:()=>x_,jwt:()=>Nw,keyof:()=>Jw,ksuid:()=>Sw,lazy:()=>bm,literal:()=>s_,looseObject:()=>Qw,looseRecord:()=>r_,mac:()=>$w,map:()=>o_,meta:()=>w_,nan:()=>u_,nanoid:()=>bw,nativeEnum:()=>a_,never:()=>Rs,nonoptional:()=>lm,null:()=>Mh,nullable:()=>Jo,nullish:()=>l_,number:()=>Nh,object:()=>qw,optional:()=>Yo,partialRecord:()=>n_,pipe:()=>fs,prefault:()=>cm,preprocess:()=>S_,promise:()=>f_,readonly:()=>gm,record:()=>Jh,refine:()=>km,set:()=>i_,strictObject:()=>Xw,string:()=>Ho,stringFormat:()=>Rw,stringbool:()=>k_,success:()=>d_,superRefine:()=>xm,symbol:()=>Kw,templateLiteral:()=>m_,transform:()=>js,tuple:()=>Yh,uint32:()=>Fw,uint64:()=>Ww,ulid:()=>kw,undefined:()=>Zw,union:()=>Ls,unknown:()=>Yn,url:()=>gw,uuid:()=>pw,uuidv4:()=>hw,uuidv6:()=>mw,uuidv7:()=>fw,void:()=>Vw,xid:()=>xw,xor:()=>e_});function qo(e,t,r){let o=Object.getPrototypeOf(e),n=lw.get(o);if(n||(n=new Set,lw.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 Ho(e){return Ku(Mr,e)}function dw(e){return Oa(ys,e)}function uw(e){return zo(Vo,e)}function pw(e){return Na(Rt,e)}function hw(e){return Ra(Rt,e)}function mw(e){return La(Rt,e)}function fw(e){return Da(Rt,e)}function gw(e){return Fo(Xo,e)}function yw(e){return Fo(Xo,{protocol:ut.httpProtocol,hostname:ut.domain,...B.normalizeParams(e)})}function vw(e){return ja(vs,e)}function bw(e){return Ma(bs,e)}function ww(e){return Ua(ws,e)}function _w(e){return za(_s,e)}function kw(e){return Fa(ks,e)}function xw(e){return Ga(xs,e)}function Sw(e){return Ba(Ss,e)}function Ew(e){return Wa(Es,e)}function $w(e){return Hu(Oh,e)}function Tw(e){return Ka($s,e)}function Aw(e){return Za(Ts,e)}function Iw(e){return Ha(As,e)}function Pw(e){return Va(Is,e)}function Cw(e){return Ya(Ps,e)}function Ow(e){return Ja(Cs,e)}function Nw(e){return qa(Os,e)}function Rw(e,t,r={}){return Nr(Ur,e,t,r)}function Lw(e){return Nr(Ur,"hostname",ut.hostname,e)}function Dw(e){return Nr(Ur,"hex",ut.hex,e)}function jw(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=ut[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Nr(Ur,o,n,t)}function Nh(e){return Qu(zr,e)}function ms(e){return tp(Jn,e)}function Mw(e){return np(Jn,e)}function Uw(e){return rp(Jn,e)}function zw(e){return op(Jn,e)}function Fw(e){return ip(Jn,e)}function Rh(e){return ap(Fr,e)}function Gw(e){return cp(Gr,e)}function Bw(e){return dp(Ns,e)}function Ww(e){return up(Ns,e)}function Kw(e){return pp(Lh,e)}function Zw(e){return hp(Dh,e)}function Mh(e){return mp(jh,e)}function Hw(){return fp(Uh)}function Yn(){return gp(zh)}function Rs(e){return yp(Fh,e)}function Vw(e){return vp(Gh,e)}function Yw(e){return bp(Qo,e)}function ei(e,t){return kp(Bh,e,t)}function Jw(e){let t=e._zod.def.shape;return Ds(Object.keys(t))}function qw(e,t){let r={type:"object",shape:e??{},...B.normalizeParams(t)};return new ti(r)}function Xw(e,t){return new ti({type:"object",shape:e,catchall:Rs(),...B.normalizeParams(t)})}function Qw(e,t){return new ti({type:"object",shape:e,catchall:Yn(),...B.normalizeParams(t)})}function Ls(e,t){return new ni({type:"union",options:e,...B.normalizeParams(t)})}function e_(e,t){return new Wh({type:"union",options:e,inclusive:!1,...B.normalizeParams(t)})}function t_(e,t,r){return new Kh({type:"union",options:t,discriminator:e,...B.normalizeParams(r)})}function Hh(e,t){return new Zh({type:"intersection",left:e,right:t})}function Yh(e,t,r){let o=t instanceof ie,n=o?r:t,i=o?t:null;return new Vh({type:"tuple",items:e,rest:i,...B.normalizeParams(n)})}function Jh(e,t,r){return!t||!t._zod?new Dr({type:"record",keyType:Ho(),valueType:e,...B.normalizeParams(t)}):new Dr({type:"record",keyType:e,valueType:t,...B.normalizeParams(r)})}function n_(e,t,r){let o=Je(e);return o._zod.values=void 0,new Dr({type:"record",keyType:o,valueType:t,...B.normalizeParams(r)})}function r_(e,t,r){return new Dr({type:"record",keyType:e,valueType:t,mode:"loose",...B.normalizeParams(r)})}function o_(e,t,r){return new qh({type:"map",keyType:e,valueType:t,...B.normalizeParams(r)})}function i_(e,t){return new Xh({type:"set",valueType:e,...B.normalizeParams(t)})}function Ds(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new jr({type:"enum",entries:r,...B.normalizeParams(t)})}function a_(e,t){return new jr({type:"enum",entries:e,...B.normalizeParams(t)})}function s_(e,t){return new Qh({type:"literal",values:Array.isArray(e)?e:[e],...B.normalizeParams(t)})}function c_(e){return xp(em,e)}function js(e){return new tm({type:"transform",transform:e})}function Yo(e){return new Ms({type:"optional",innerType:e})}function rm(e){return new nm({type:"optional",innerType:e})}function Jo(e){return new om({type:"nullable",innerType:e})}function l_(e){return Yo(Jo(e))}function am(e,t){return new im({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function cm(e,t){return new sm({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():B.shallowClone(t)}})}function lm(e,t){return new Us({type:"nonoptional",innerType:e,...B.normalizeParams(t)})}function d_(e){return new dm({type:"success",innerType:e})}function pm(e,t){return new um({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function u_(e){return _p(hm,e)}function fs(e,t){return new ri({type:"pipe",in:e,out:t})}function p_(e,t,r){return new oi({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function h_(e){let t=e._zod.def;return new oi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function gm(e){return new fm({type:"readonly",innerType:e})}function m_(e,t){return new ym({type:"template_literal",parts:e,...B.normalizeParams(t)})}function bm(e){return new vm({type:"lazy",getter:e})}function f_(e){return new wm({type:"promise",innerType:e})}function g_(e){return new _m({type:"function",input:Array.isArray(e?.input)?Yh(e?.input):e?.input??ei(Yn()),output:e?.output??Yn()})}function y_(e){let t=new be({check:"custom"});return t._zod.check=e,t}function v_(e,t){return Sp(ii,e??(()=>!0),t)}function km(e,t={}){return Ep(ii,e,t)}function xm(e,t){return $p(e,t)}function __(e,t={}){let r=new ii({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...B.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 x_(e){let t=bm(()=>Ls([Ho(e),Nh(),Rh(),Mh(),ei(t),Jh(Ho(),t)]));return t}function S_(e,t){return new mm({type:"pipe",in:js(e),out:t})}var lw,le,gs,Mr,ve,ys,Vo,Rt,Xo,vs,bs,ws,_s,ks,xs,Ss,Es,Oh,$s,Ts,As,Is,Ps,Cs,Os,Ur,zr,Jn,Fr,Gr,Ns,Lh,Dh,jh,Uh,zh,Fh,Gh,Qo,Bh,ti,ni,Wh,Kh,Zh,Vh,Dr,qh,Xh,jr,Qh,em,tm,Ms,nm,om,im,sm,Us,dm,um,hm,ri,oi,mm,fm,ym,vm,wm,_m,ii,b_,w_,k_,Zo=v(()=>{ht();ht();Bo();Go();ls();Wo();Ch();lw=new WeakMap;le=w("ZodType",(e,t)=>(ie.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rr(e,"input"),output:Rr(e,"output")}}),e.toJSONSchema=Pp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>bh(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>_h(e,r,o),e.parseAsync=async(r,o)=>wh(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>kh(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>xh(e,r,o),e.decode=(r,o)=>Sh(e,r,o),e.encodeAsync=async(r,o)=>Eh(e,r,o),e.decodeAsync=async(r,o)=>$h(e,r,o),e.safeEncode=(r,o)=>Th(e,r,o),e.safeDecode=(r,o)=>Ah(e,r,o),e.safeEncodeAsync=async(r,o)=>Ih(e,r,o),e.safeDecodeAsync=async(r,o)=>Ph(e,r,o),qo(e,"ZodType",{check(...r){let o=this.def;return this.clone(B.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 Je(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(km(r,o))},superRefine(r,o){return this.check(xm(r,o))},overwrite(r){return this.check(Et(r))},optional(){return Yo(this)},exactOptional(){return rm(this)},nullable(){return Jo(this)},nullish(){return Yo(Jo(this))},nonoptional(r){return lm(this,r)},array(){return ei(this)},or(r){return Ls([this,r])},and(r){return Hh(this,r)},transform(r){return fs(this,js(r))},default(r){return am(this,r)},prefault(r){return cm(this,r)},catch(r){return pm(this,r)},pipe(r){return fs(this,r)},readonly(){return gm(this)},describe(r){let o=this.clone();return je.add(o,{description:r}),o},meta(...r){if(r.length===0)return je.get(this);let o=this.clone();return je.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 je.get(e)?.description},configurable:!0}),e)),gs=w("_ZodString",(e,t)=>{Kn.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Cp(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,qo(e,"_ZodString",{regex(...o){return this.check(_r(...o))},includes(...o){return this.check(Sr(...o))},startsWith(...o){return this.check(Er(...o))},endsWith(...o){return this.check($r(...o))},min(...o){return this.check(Yt(...o))},max(...o){return this.check(Hn(...o))},length(...o){return this.check(Vn(...o))},nonempty(...o){return this.check(Yt(1,...o))},lowercase(o){return this.check(kr(o))},uppercase(o){return this.check(xr(o))},trim(){return this.check(Ir())},normalize(...o){return this.check(Ar(...o))},toLowerCase(){return this.check(Pr())},toUpperCase(){return this.check(Cr())},slugify(){return this.check(Or())}})}),Mr=w("ZodString",(e,t)=>{Kn.init(e,t),gs.init(e,t),e.email=r=>e.check(Oa(ys,r)),e.url=r=>e.check(Fo(Xo,r)),e.jwt=r=>e.check(qa(Os,r)),e.emoji=r=>e.check(ja(vs,r)),e.guid=r=>e.check(zo(Vo,r)),e.uuid=r=>e.check(Na(Rt,r)),e.uuidv4=r=>e.check(Ra(Rt,r)),e.uuidv6=r=>e.check(La(Rt,r)),e.uuidv7=r=>e.check(Da(Rt,r)),e.nanoid=r=>e.check(Ma(bs,r)),e.guid=r=>e.check(zo(Vo,r)),e.cuid=r=>e.check(Ua(ws,r)),e.cuid2=r=>e.check(za(_s,r)),e.ulid=r=>e.check(Fa(ks,r)),e.base64=r=>e.check(Va(Is,r)),e.base64url=r=>e.check(Ya(Ps,r)),e.xid=r=>e.check(Ga(xs,r)),e.ksuid=r=>e.check(Ba(Ss,r)),e.ipv4=r=>e.check(Wa(Es,r)),e.ipv6=r=>e.check(Ka($s,r)),e.cidrv4=r=>e.check(Za(Ts,r)),e.cidrv6=r=>e.check(Ha(As,r)),e.e164=r=>e.check(Ja(Cs,r)),e.datetime=r=>e.check(mh(r)),e.date=r=>e.check(fh(r)),e.time=r=>e.check(gh(r)),e.duration=r=>e.check(yh(r))});ve=w("ZodStringFormat",(e,t)=>{ye.init(e,t),gs.init(e,t)}),ys=w("ZodEmail",(e,t)=>{Cd.init(e,t),ve.init(e,t)});Vo=w("ZodGUID",(e,t)=>{Id.init(e,t),ve.init(e,t)});Rt=w("ZodUUID",(e,t)=>{Pd.init(e,t),ve.init(e,t)});Xo=w("ZodURL",(e,t)=>{Od.init(e,t),ve.init(e,t)});vs=w("ZodEmoji",(e,t)=>{Nd.init(e,t),ve.init(e,t)});bs=w("ZodNanoID",(e,t)=>{Rd.init(e,t),ve.init(e,t)});ws=w("ZodCUID",(e,t)=>{Ld.init(e,t),ve.init(e,t)});_s=w("ZodCUID2",(e,t)=>{Dd.init(e,t),ve.init(e,t)});ks=w("ZodULID",(e,t)=>{jd.init(e,t),ve.init(e,t)});xs=w("ZodXID",(e,t)=>{Md.init(e,t),ve.init(e,t)});Ss=w("ZodKSUID",(e,t)=>{Ud.init(e,t),ve.init(e,t)});Es=w("ZodIPv4",(e,t)=>{Wd.init(e,t),ve.init(e,t)});Oh=w("ZodMAC",(e,t)=>{Zd.init(e,t),ve.init(e,t)});$s=w("ZodIPv6",(e,t)=>{Kd.init(e,t),ve.init(e,t)});Ts=w("ZodCIDRv4",(e,t)=>{Hd.init(e,t),ve.init(e,t)});As=w("ZodCIDRv6",(e,t)=>{Vd.init(e,t),ve.init(e,t)});Is=w("ZodBase64",(e,t)=>{Jd.init(e,t),ve.init(e,t)});Ps=w("ZodBase64URL",(e,t)=>{qd.init(e,t),ve.init(e,t)});Cs=w("ZodE164",(e,t)=>{Xd.init(e,t),ve.init(e,t)});Os=w("ZodJWT",(e,t)=>{Qd.init(e,t),ve.init(e,t)});Ur=w("ZodCustomStringFormat",(e,t)=>{eu.init(e,t),ve.init(e,t)});zr=w("ZodNumber",(e,t)=>{ka.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Op(e,o,n,i),qo(e,"ZodNumber",{gt(o,n){return this.check(Ot(o,n))},gte(o,n){return this.check(Xe(o,n))},min(o,n){return this.check(Xe(o,n))},lt(o,n){return this.check(Ct(o,n))},lte(o,n){return this.check(pt(o,n))},max(o,n){return this.check(pt(o,n))},int(o){return this.check(ms(o))},safe(o){return this.check(ms(o))},positive(o){return this.check(Ot(0,o))},nonnegative(o){return this.check(Xe(0,o))},negative(o){return this.check(Ct(0,o))},nonpositive(o){return this.check(pt(0,o))},multipleOf(o,n){return this.check(mn(o,n))},step(o,n){return this.check(mn(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});Jn=w("ZodNumberFormat",(e,t)=>{tu.init(e,t),zr.init(e,t)});Fr=w("ZodBoolean",(e,t)=>{Ro.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Np(e,r,o,n)});Gr=w("ZodBigInt",(e,t)=>{xa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Rp(e,o,n,i),e.gte=(o,n)=>e.check(Xe(o,n)),e.min=(o,n)=>e.check(Xe(o,n)),e.gt=(o,n)=>e.check(Ot(o,n)),e.gte=(o,n)=>e.check(Xe(o,n)),e.min=(o,n)=>e.check(Xe(o,n)),e.lt=(o,n)=>e.check(Ct(o,n)),e.lte=(o,n)=>e.check(pt(o,n)),e.max=(o,n)=>e.check(pt(o,n)),e.positive=o=>e.check(Ot(BigInt(0),o)),e.negative=o=>e.check(Ct(BigInt(0),o)),e.nonpositive=o=>e.check(pt(BigInt(0),o)),e.nonnegative=o=>e.check(Xe(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(mn(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Ns=w("ZodBigIntFormat",(e,t)=>{nu.init(e,t),Gr.init(e,t)});Lh=w("ZodSymbol",(e,t)=>{ru.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lp(e,r,o,n)});Dh=w("ZodUndefined",(e,t)=>{ou.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jp(e,r,o,n)});jh=w("ZodNull",(e,t)=>{iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dp(e,r,o,n)});Uh=w("ZodAny",(e,t)=>{au.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zp(e,r,o,n)});zh=w("ZodUnknown",(e,t)=>{su.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fp(e,r,o,n)});Fh=w("ZodNever",(e,t)=>{cu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Up(e,r,o,n)});Gh=w("ZodVoid",(e,t)=>{lu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mp(e,r,o,n)});Qo=w("ZodDate",(e,t)=>{du.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Gp(e,o,n,i),e.min=(o,n)=>e.check(Xe(o,n)),e.max=(o,n)=>e.check(pt(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});Bh=w("ZodArray",(e,t)=>{uu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eh(e,r,o,n),e.element=t.element,qo(e,"ZodArray",{min(r,o){return this.check(Yt(r,o))},nonempty(r){return this.check(Yt(1,r))},max(r,o){return this.check(Hn(r,o))},length(r,o){return this.check(Vn(r,o))},unwrap(){return this.element}})});ti=w("ZodObject",(e,t)=>{pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>th(e,r,o,n),B.defineLazy(e,"shape",()=>t.shape),qo(e,"ZodObject",{keyof(){return Ds(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Yn()})},loose(){return this.clone({...this._zod.def,catchall:Yn()})},strict(){return this.clone({...this._zod.def,catchall:Rs()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return B.extend(this,r)},safeExtend(r){return B.safeExtend(this,r)},merge(r){return B.merge(this,r)},pick(r){return B.pick(this,r)},omit(r){return B.omit(this,r)},partial(...r){return B.partial(Ms,this,r[0])},required(...r){return B.required(Us,this,r[0])}})});ni=w("ZodUnion",(e,t)=>{Lo.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>os(e,r,o,n),e.options=t.options});Wh=w("ZodXor",(e,t)=>{ni.init(e,t),hu.init(e,t),e._zod.processJSONSchema=(r,o,n)=>os(e,r,o,n),e.options=t.options});Kh=w("ZodDiscriminatedUnion",(e,t)=>{ni.init(e,t),mu.init(e,t)});Zh=w("ZodIntersection",(e,t)=>{fu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nh(e,r,o,n)});Vh=w("ZodTuple",(e,t)=>{Sa.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rh(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});Dr=w("ZodRecord",(e,t)=>{gu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oh(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});qh=w("ZodMap",(e,t)=>{yu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xp(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Nt(...r)),e.nonempty=r=>e.check(Nt(1,r)),e.max=(...r)=>e.check(fn(...r)),e.size=(...r)=>e.check(Zn(...r))});Xh=w("ZodSet",(e,t)=>{vu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qp(e,r,o,n),e.min=(...r)=>e.check(Nt(...r)),e.nonempty=r=>e.check(Nt(1,r)),e.max=(...r)=>e.check(fn(...r)),e.size=(...r)=>e.check(Zn(...r))});jr=w("ZodEnum",(e,t)=>{bu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bp(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 jr({...t,checks:[],...B.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 jr({...t,checks:[],...B.normalizeParams(n),entries:i})}});Qh=w("ZodLiteral",(e,t)=>{wu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wp(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]}})});em=w("ZodFile",(e,t)=>{_u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hp(e,r,o,n),e.min=(r,o)=>e.check(Nt(r,o)),e.max=(r,o)=>e.check(fn(r,o)),e.mime=(r,o)=>e.check(Tr(Array.isArray(r)?r:[r],o))});tm=w("ZodTransform",(e,t)=>{ku.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qp(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new ln(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(B.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(B.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)}});Ms=w("ZodOptional",(e,t)=>{Ea.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});nm=w("ZodExactOptional",(e,t)=>{xu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>is(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});om=w("ZodNullable",(e,t)=>{Su.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ih(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});im=w("ZodDefault",(e,t)=>{Eu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});sm=w("ZodPrefault",(e,t)=>{$u.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ch(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Us=w("ZodNonOptional",(e,t)=>{Tu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ah(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});dm=w("ZodSuccess",(e,t)=>{Au.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vp(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});um=w("ZodCatch",(e,t)=>{Iu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});hm=w("ZodNaN",(e,t)=>{Pu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kp(e,r,o,n)});ri=w("ZodPipe",(e,t)=>{$a.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dh(e,r,o,n),e.in=t.in,e.out=t.out});oi=w("ZodCodec",(e,t)=>{ri.init(e,t),Do.init(e,t)});mm=w("ZodPreprocess",(e,t)=>{ri.init(e,t),Cu.init(e,t)}),fm=w("ZodReadonly",(e,t)=>{Ou.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});ym=w("ZodTemplateLiteral",(e,t)=>{Nu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zp(e,r,o,n)});vm=w("ZodLazy",(e,t)=>{Du.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hh(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});wm=w("ZodPromise",(e,t)=>{Lu.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ph(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});_m=w("ZodFunction",(e,t)=>{Ru.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jp(e,r,o,n)});ii=w("ZodCustom",(e,t)=>{ju.init(e,t),le.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yp(e,r,o,n)});b_=Tp,w_=Ap;k_=(...e)=>Ip({Codec:oi,Boolean:Fr,String:Mr},...e)});function M0(e){Te({customError:e})}function U0(){return Te().customError}var j0,Sm,E_=v(()=>{ht();j0={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"};Sm||(Sm={})});function F0(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 G0(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 $_(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Y.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 Y.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=G0(n,t),a=Be(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 Y.null();if(n.length===0)return Y.never();if(n.length===1)return Y.literal(n[0]);if(n.every(a=>typeof a=="string"))return Y.enum(n);let i=n.map(a=>Y.literal(a));return i.length<2?i[0]:Y.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Y.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return $_(a,t)});return n.length===0?Y.never():n.length===1?n[0]:Y.union(n)}if(!r)return Y.any();let o;switch(r){case"string":{let n=Y.string();if(e.format){let i=e.format;i==="email"?n=n.check(Y.email()):i==="uri"||i==="uri-reference"?n=n.check(Y.url()):i==="uuid"||i==="guid"?n=n.check(Y.uuid()):i==="date-time"?n=n.check(Y.iso.datetime()):i==="date"?n=n.check(Y.iso.date()):i==="time"?n=n.check(Y.iso.time()):i==="duration"?n=n.check(Y.iso.duration()):i==="ipv4"?n=n.check(Y.ipv4()):i==="ipv6"?n=n.check(Y.ipv6()):i==="mac"?n=n.check(Y.mac()):i==="cidr"?n=n.check(Y.cidrv4()):i==="cidr-v6"?n=n.check(Y.cidrv6()):i==="base64"?n=n.check(Y.base64()):i==="base64url"?n=n.check(Y.base64url()):i==="e164"?n=n.check(Y.e164()):i==="jwt"?n=n.check(Y.jwt()):i==="emoji"?n=n.check(Y.emoji()):i==="nanoid"?n=n.check(Y.nanoid()):i==="cuid"?n=n.check(Y.cuid()):i==="cuid2"?n=n.check(Y.cuid2()):i==="ulid"?n=n.check(Y.ulid()):i==="xid"?n=n.check(Y.xid()):i==="ksuid"&&(n=n.check(Y.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"?Y.number().int():Y.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=Y.boolean();break}case"null":{o=Y.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[u,l]of Object.entries(i)){let p=Be(l,t);n[u]=a.has(u)?p:p.optional()}if(e.propertyNames){let u=Be(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Be(e.additionalProperties,t):Y.any();if(Object.keys(n).length===0){o=Y.record(u,l);break}let p=Y.object(n).passthrough(),h=Y.looseRecord(u,l);o=Y.intersection(p,h);break}if(e.patternProperties){let u=e.patternProperties,l=Object.keys(u),p=[];for(let f of l){let g=Be(u[f],t),k=Y.string().regex(new RegExp(f));p.push(Y.looseRecord(k,g))}let h=[];if(Object.keys(n).length>0&&h.push(Y.object(n).passthrough()),h.push(...p),h.length===0)o=Y.object({}).passthrough();else if(h.length===1)o=h[0];else{let f=Y.intersection(h[0],h[1]);for(let g=2;g<h.length;g++)f=Y.intersection(f,h[g]);o=f}break}let s=Y.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(Be(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(u=>Be(u,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?Be(i,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(u=>Be(u,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?Be(e.additionalItems,t):void 0;s?o=Y.tuple(a).rest(s):o=Y.tuple(a),typeof e.minItems=="number"&&(o=o.check(Y.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(Y.maxLength(e.maxItems)))}else if(i!==void 0){let a=Be(i,t),s=Y.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=Y.array(Y.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function Be(e,t){if(typeof e=="boolean")return e?Y.any():Y.never();let r=$_(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=>Be(l,t)),u=Y.union(s);r=o?Y.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>Be(l,t)),u=Y.xor(s);r=o?Y.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:Y.any();else{let s=o?r:Be(e.allOf[0],t),u=o?0:1;for(let l=u;l<e.allOf.length;l++)s=Y.intersection(s,Be(e.allOf[l],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=Y.nullable(r)),e.readOnly===!0&&(r=Y.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))z0.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 T_(e,t){if(typeof e=="boolean")return e?Y.any():Y.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=F0(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??je};return Be(r,i)}var Y,z0,A_=v(()=>{Uo();ls();Wo();Zo();Y={...Ko,...cs,iso:Lr},z0=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 Em={};It(Em,{bigint:()=>Z0,boolean:()=>K0,date:()=>H0,number:()=>W0,string:()=>B0});function B0(e){return Zu(Mr,e)}function W0(e){return ep(zr,e)}function K0(e){return sp(Fr,e)}function Z0(e){return lp(Gr,e)}function H0(e){return wp(Qo,e)}var I_=v(()=>{ht();Zo()});var c={};It(c,{$brand:()=>ml,$input:()=>Wu,$output:()=>Bu,NEVER:()=>hl,TimePrecision:()=>Vu,ZodAny:()=>Uh,ZodArray:()=>Bh,ZodBase64:()=>Is,ZodBase64URL:()=>Ps,ZodBigInt:()=>Gr,ZodBigIntFormat:()=>Ns,ZodBoolean:()=>Fr,ZodCIDRv4:()=>Ts,ZodCIDRv6:()=>As,ZodCUID:()=>ws,ZodCUID2:()=>_s,ZodCatch:()=>um,ZodCodec:()=>oi,ZodCustom:()=>ii,ZodCustomStringFormat:()=>Ur,ZodDate:()=>Qo,ZodDefault:()=>im,ZodDiscriminatedUnion:()=>Kh,ZodE164:()=>Cs,ZodEmail:()=>ys,ZodEmoji:()=>vs,ZodEnum:()=>jr,ZodError:()=>L0,ZodExactOptional:()=>nm,ZodFile:()=>em,ZodFirstPartyTypeKind:()=>Sm,ZodFunction:()=>_m,ZodGUID:()=>Vo,ZodIPv4:()=>Es,ZodIPv6:()=>$s,ZodISODate:()=>us,ZodISODateTime:()=>ds,ZodISODuration:()=>hs,ZodISOTime:()=>ps,ZodIntersection:()=>Zh,ZodIssueCode:()=>j0,ZodJWT:()=>Os,ZodKSUID:()=>Ss,ZodLazy:()=>vm,ZodLiteral:()=>Qh,ZodMAC:()=>Oh,ZodMap:()=>qh,ZodNaN:()=>hm,ZodNanoID:()=>bs,ZodNever:()=>Fh,ZodNonOptional:()=>Us,ZodNull:()=>jh,ZodNullable:()=>om,ZodNumber:()=>zr,ZodNumberFormat:()=>Jn,ZodObject:()=>ti,ZodOptional:()=>Ms,ZodPipe:()=>ri,ZodPrefault:()=>sm,ZodPreprocess:()=>mm,ZodPromise:()=>wm,ZodReadonly:()=>fm,ZodRealError:()=>it,ZodRecord:()=>Dr,ZodSet:()=>Xh,ZodString:()=>Mr,ZodStringFormat:()=>ve,ZodSuccess:()=>dm,ZodSymbol:()=>Lh,ZodTemplateLiteral:()=>ym,ZodTransform:()=>tm,ZodTuple:()=>Vh,ZodType:()=>le,ZodULID:()=>ks,ZodURL:()=>Xo,ZodUUID:()=>Rt,ZodUndefined:()=>Dh,ZodUnion:()=>ni,ZodUnknown:()=>zh,ZodVoid:()=>Gh,ZodXID:()=>xs,ZodXor:()=>Wh,_ZodString:()=>gs,_default:()=>am,_function:()=>g_,any:()=>Hw,array:()=>ei,base64:()=>Pw,base64url:()=>Cw,bigint:()=>Gw,boolean:()=>Rh,catch:()=>pm,check:()=>y_,cidrv4:()=>Aw,cidrv6:()=>Iw,clone:()=>Je,codec:()=>p_,coerce:()=>Em,config:()=>Te,core:()=>Jt,cuid:()=>ww,cuid2:()=>_w,custom:()=>v_,date:()=>Yw,decode:()=>Sh,decodeAsync:()=>$h,describe:()=>b_,discriminatedUnion:()=>t_,e164:()=>Ow,email:()=>dw,emoji:()=>vw,encode:()=>xh,encodeAsync:()=>Eh,endsWith:()=>$r,enum:()=>Ds,exactOptional:()=>rm,file:()=>c_,flattenError:()=>Io,float32:()=>Mw,float64:()=>Uw,formatError:()=>Po,fromJSONSchema:()=>T_,function:()=>g_,getErrorMap:()=>U0,globalRegistry:()=>je,gt:()=>Ot,gte:()=>Xe,guid:()=>uw,hash:()=>jw,hex:()=>Dw,hostname:()=>Lw,httpUrl:()=>yw,includes:()=>Sr,instanceof:()=>__,int:()=>ms,int32:()=>zw,int64:()=>Bw,intersection:()=>Hh,invertCodec:()=>h_,ipv4:()=>Ew,ipv6:()=>Tw,iso:()=>Lr,json:()=>x_,jwt:()=>Nw,keyof:()=>Jw,ksuid:()=>Sw,lazy:()=>bm,length:()=>Vn,literal:()=>s_,locales:()=>Mo,looseObject:()=>Qw,looseRecord:()=>r_,lowercase:()=>kr,lt:()=>Ct,lte:()=>pt,mac:()=>$w,map:()=>o_,maxLength:()=>Hn,maxSize:()=>fn,meta:()=>w_,mime:()=>Tr,minLength:()=>Yt,minSize:()=>Nt,multipleOf:()=>mn,nan:()=>u_,nanoid:()=>bw,nativeEnum:()=>a_,negative:()=>Qa,never:()=>Rs,nonnegative:()=>ts,nonoptional:()=>lm,nonpositive:()=>es,normalize:()=>Ar,null:()=>Mh,nullable:()=>Jo,nullish:()=>l_,number:()=>Nh,object:()=>qw,optional:()=>Yo,overwrite:()=>Et,parse:()=>bh,parseAsync:()=>wh,partialRecord:()=>n_,pipe:()=>fs,positive:()=>Xa,prefault:()=>cm,preprocess:()=>S_,prettifyError:()=>Tl,promise:()=>f_,property:()=>ns,readonly:()=>gm,record:()=>Jh,refine:()=>km,regex:()=>_r,regexes:()=>ut,registry:()=>Ca,safeDecode:()=>Ah,safeDecodeAsync:()=>Ph,safeEncode:()=>Th,safeEncodeAsync:()=>Ih,safeParse:()=>_h,safeParseAsync:()=>kh,set:()=>i_,setErrorMap:()=>M0,size:()=>Zn,slugify:()=>Or,startsWith:()=>Er,strictObject:()=>Xw,string:()=>Ho,stringFormat:()=>Rw,stringbool:()=>k_,success:()=>d_,superRefine:()=>xm,symbol:()=>Kw,templateLiteral:()=>m_,toJSONSchema:()=>as,toLowerCase:()=>Pr,toUpperCase:()=>Cr,transform:()=>js,treeifyError:()=>$l,trim:()=>Ir,tuple:()=>Yh,uint32:()=>Fw,uint64:()=>Ww,ulid:()=>kw,undefined:()=>Zw,union:()=>Ls,unknown:()=>Yn,uppercase:()=>xr,url:()=>gw,util:()=>B,uuid:()=>pw,uuidv4:()=>hw,uuidv6:()=>mw,uuidv7:()=>fw,void:()=>Vw,xid:()=>xw,xor:()=>e_});var $m=v(()=>{ht();Zo();ls();vh();Ch();E_();ht();Uu();ht();Bo();A_();Gu();Wo();Wo();I_();Te(Ta())});var at=v(()=>{$m();$m()});function P_(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(Y0.has(t)||V0.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 P_(i)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t))}function C_(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(P_(t.hostname))return"local";if(t.protocol!=="https:")return"insecure"}var V0,Y0,Tm=v(()=>{"use strict";V0=[".localhost",".local",".internal",".test",".localdomain"],Y0=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});var ai,si=v(()=>{"use strict";at();ai=c.object({date:c.string(),plays:c.number(),players:c.number().nullable()})});var ci,zs=v(()=>{"use strict";at();ci=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 bn,Am,li,et,Lt,Br,Wr=v(()=>{"use strict";bn="penalty_v1",Am=["easy_v1","balanced_v1","hard_v1"],li="balanced_v1",et={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},Lt={postX:1e3,barY:1e3,postWidth:60,barHeight:60,ballRadius:40,keeperStart:{x:0,y:420}},Br="shoot"});function L_(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 Fs(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 wn(e){return`round-${e.number}`}var Im,J0,q0,X0,Q0,O_,eP,Pm,N_,tP,R_,nP,Gs,rP,We,$2,T2,A2,Dt=v(()=>{"use strict";at();Ht();si();zs();Wr();Im=c.object({archetype:c.literal("hunt"),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(),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.`})}),J0=c.object({key:c.string().min(1),label:c.string().min(1),value:c.number().int().nonnegative()}),q0=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(J0).min(1)}),X0=c.object({within:c.number().min(0).max(1),label:c.string().min(1)}),Q0=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],O_=c.object({archetype:c.literal("push"),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(q0).min(1),line:c.array(c.object({slate:c.string(),key:c.string()})).optional(),tiers:c.array(X0).default(Q0),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,u=!1;for(let l of e.line){let h=e.slates.find(f=>f.id===l.slate)?.entries.find(f=>f.key===l.key);if(!h){u=!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}!u&&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(u=>u.key)),n=[...new Set(o.filter((s,u)=>o.indexOf(s)!==u))];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,u)=>s+Math.min(...u.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,u)=>u===0||s.within>e.tiers[u-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."})}),eP=c.object({key:c.string().min(1),label:c.string().min(1),members:c.array(c.string().min(1)).min(2)}),Pm=c.object({archetype:c.literal("group"),number:c.number().int().positive().default(1),prompt:c.string().default(""),board:c.array(c.string().min(1)).min(4),groups:c.array(eP).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 u=r.get(s);u&&u!==i.key&&t.addIssue({code:"custom",path:["groups"],message:`${s} is in both ${u} 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.`})}),N_=c.object({key:c.string().min(1),label:c.string().min(1),points:c.number().int().nonnegative().optional()}),tP=c.object({id:c.string().min(1),kind:c.enum(["choice","number"]).default("choice"),prompt:c.string().default(""),options:c.array(N_).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."})}),R_=c.object({archetype:c.literal("predict"),number:c.number().int().positive().default(1),prompt:c.string().default(""),options:c.array(N_).min(2).optional(),questions:c.array(tP).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.`})});nP=c.object({archetype:c.literal("bingo"),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.`})}}),Gs=c.object({archetype:c.literal("shoot"),number:c.number().int().positive().default(1),prompt:c.string().default(""),model:c.literal(bn).default(bn),difficulty:c.enum(Am).default(li),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.`})}),rP=c.discriminatedUnion("archetype",[Im,O_,Pm,R_,nP,Gs]),We=c.preprocess(Iy,rP);$2=c.object({action:c.literal("settle"),game:c.string().min(1),roundId:c.string().min(1),result:c.string().min(1)}),T2=c.object({game:c.string().min(1),round:We,origin:ci.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:We,origin:ci.optional()})).min(1)}).optional()}),A2=c.object({roundId:c.string(),version:c.number().int().nonnegative(),changed:c.boolean(),current:c.boolean(),activity:c.array(ai).optional(),monthlyPlayers:c.number().int().nonnegative().optional()})});function cP(e){return U_.includes(e)}function lP(e){return F_.includes(Ge(e))}function G_(e){let t=[],r=e.backend.archetype;r&&lP(r)&&t.push({path:"backend.archetype",message:`\`${r}\` is a classification, not a format the Engine marks. The formats it marks are ${Qi.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&&cP(o)&&t.push({path:"backend.route",message:`\`${o}\` is a classification, not a route Gamestage implements. Set \`${Rm}\`: 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=C_(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 di,Cm,Om,Nm,D_,_n,kn,j_,oP,jt,iP,aP,sP,M_,Rm,U_,z_,xn,F_,dP,uP,pP,hP,mP,fP,gP,yP,vP,bP,wP,_P,kP,Sn,Kr,En=v(()=>{"use strict";at();Tm();_o();Ht();Dt();di="1.0",Cm=c.enum(["missing","proposed","confirmed","verified","approved"]),Om={missing:0,proposed:1,confirmed:2,verified:3,approved:4},Nm=c.enum(["runtime","live","enterprise"]),D_="Accounts must be approved before the first deploy.",_n=c.enum(["L0","L1","L2","L3","L4","L5"]),kn={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},j_={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},oP=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()})]),jt={status:Cm.default("missing"),provenance:c.array(oP).default([])},iP=c.object({schema_version:c.string(),revision:c.number().int().nonnegative().default(0),conformance:_n.default("L0")}),aP=c.object({repository:c.string().url(),branch:c.string().default("main")}),sP=c.object({id:c.string().min(1),title:c.string().min(1),summary:c.string().optional(),source:aP.optional(),owners:c.object({ip:c.string().optional(),delivery:c.string().optional(),platform:c.string().optional()}).prefault({}),...jt}),M_=c.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Rm="managed_runtime",U_=M_.options.filter(e=>e!==Rm);z_=c.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot"]),xn=c.preprocess(e=>typeof e=="string"?Ge(e):e,z_),F_=z_.options.filter(e=>!Qi.includes(e));dP=c.object({route:M_.optional().describe(`Only ${Rm} is a route Gamestage implements: every game runs on our Engine. ${U_.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:xn.optional().describe(`The formats the Engine marks are ${Qi.join(", ")}. ${F_.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:We.optional(),...jt}),uP=c.object({surfaces:c.array(c.string()).default([]),container_label:c.string().min(1).default(ur),screen_graph:c.string().optional(),design:c.object({figma_file:c.string().optional(),figma_version:c.string().optional(),tokens:c.string().optional(),fidelity:_n.optional()}).optional(),...jt}),pP=c.object({spec_url:c.string().optional(),version:c.string().optional(),...jt}),hP=c.object({family:c.string().optional(),version:c.string().optional(),configuration_schema:c.string().optional(),...jt}),mP=c.object({project_template:c.string().optional(),project_id:c.string().optional(),events:c.array(c.string()).default([]),elements:c.array(c.string()).default([]),...jt}),fP=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()}),gP=c.object({issuer:c.string().url(),jwks_uri:c.string().url(),audience:c.string().optional()}),yP=c.object({provider:c.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:gP.optional(),require_authenticated_writes:c.boolean().default(!0),age_gate:fP.prefault({}),consent:c.object({analytics_requires_consent:c.boolean().default(!0),provider:c.string().optional()}).prefault({}),...jt}),vP=c.object({type:c.enum(["monterosa","posthog","ga4","webhook"]),enabled:c.boolean().default(!0),config:c.record(c.string(),c.string()).default({})}),bP=c.object({destinations:c.array(vP).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({}),...jt}),wP=c.object({hosting:c.string().optional(),space_spec:c.string().optional(),environments:c.array(c.enum(["local","playground","staging","production"])).default(["local"]),...jt}),_P=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([])}),kP=c.object({support_tier:Nm.optional(),runbook:c.string().optional(),promotion:_P.prefault({}),...jt}),Sn=c.object({manifest:iP,app:sP,experience:uP.prefault({}),studio_app:pP.prefault({}),studio_surface:hP.prefault({}),backend:dP.prefault({}),interaction_cloud:mP.prefault({}),identity:yP.prefault({}),measurement:bP.prefault({}),deployment:wP.prefault({}),operations:kP.prefault({})});Kr=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function st(e,t={}){let r=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),o=Lm.filter(f=>f.checkable).map(r),n=Lm.filter(f=>!f.checkable).map(r),i="L0",a=!0;for(let f of Dm){let g=o.filter(L=>L.level===f);g.length>0&&g.every(L=>L.passed)&&a?i=f:a=!1}let s=o.filter(f=>f.level==="L0").every(f=>f.passed),u=kn[i]+1,l=Dm[u],p=l?o.filter(f=>f.level===l&&!f.passed):[],h=e.manifest.conformance;return{computed:i,computedName:j_[i],claimed:h,overclaimed:!s||Math.min(kn[h],kn[B_])>kn[i],results:o,blockers:s?p:o.filter(f=>f.level==="L0"&&!f.passed),ceiling:B_,advice:n}}function W_(e,t){let o=st(e).results.filter(n=>!n.passed&&kn[n.level]<=kn[t]);return{ok:o.length===0,missing:o}}var qn,Me,Lm,Dm,xP,j2,B_,Bs=v(()=>{"use strict";En();qn=(e,t,r)=>{let o=e[t];return Om[o?.status??"missing"]>=Om[r]},Me=e=>typeof e=="string"?e.trim().length>0:e!=null,Lm=[{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=>Me(e.app.id)&&Me(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=>qn(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=>Me(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=>Me(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=>qn(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=>Me(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)=>Me(t.backendComponent)||Me(e.backend.component)&&Me(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=>Me(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)=>Me(t.platformProject)||Me(e.studio_app.spec_url)||Me(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)=>Me(t.playgroundUrl)||Me(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=>Me(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=>qn(e,"experience","confirmed")&&qn(e,"backend","confirmed")&&qn(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=>qn(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=>Me(e.operations.support_tier)&&Me(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=>qn(e,"operations","approved")&&e.deployment.environments.includes("production")}],Dm=["L0","L1","L2","L3","L4","L5"],xP=[{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"}],j2=new Map(xP.map(e=>[e.level,e])),B_=[...Dm].reverse().find(e=>Lm.some(t=>t.level===e&&t.checkable))??"L0"});function SP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ui(){if(K_)return $n;K_=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 u=Object.keys(s);for(let l=0,p=u.length;l<p;l+=1){let h=u[l];a[h]=s[h]}}return a}function n(a,s){let u="";for(let l=0;l<s;l+=1)u+=a;return u}function i(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return $n.isNothing=e,$n.isObject=t,$n.toArray=r,$n.repeat=n,$n.isNegativeZero=i,$n.extend=o,$n}function pi(){if(Z_)return jm;Z_=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+=`
10145
10145
 
10146
- `+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)},Pm=t,Pm}function sP(){if(M_)return Cm;M_=1;let e=di();function t(n,i,a,s,u){let l="",p="",h=Math.floor(u/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],u=[],l,p=-1;for(;l=a.exec(n.buffer);)u.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="",f=Math.min(n.line+i.linesAfter,u.length).toString().length,g=i.maxLength-(i.indent+f+3);for(let L=1;L<=i.linesBefore&&!(p-L<0);L++){let b=t(n.buffer,s[p-L],u[p-L],n.position-(s[p]-s[p-L]),g);h=e.repeat(" ",i.indent)+r((n.line-L+1).toString(),f)+" | "+b.str+`
10146
+ `+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)},jm=t,jm}function EP(){if(H_)return Mm;H_=1;let e=ui();function t(n,i,a,s,u){let l="",p="",h=Math.floor(u/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],u=[],l,p=-1;for(;l=a.exec(n.buffer);)u.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="",f=Math.min(n.line+i.linesAfter,u.length).toString().length,g=i.maxLength-(i.indent+f+3);for(let L=1;L<=i.linesBefore&&!(p-L<0);L++){let b=t(n.buffer,s[p-L],u[p-L],n.position-(s[p]-s[p-L]),g);h=e.repeat(" ",i.indent)+r((n.line-L+1).toString(),f)+" | "+b.str+`
10147
10147
  `+h}let k=t(n.buffer,s[p],u[p],n.position,g);h+=e.repeat(" ",i.indent)+r((n.line+1).toString(),f)+" | "+k.str+`
10148
10148
  `,h+=e.repeat("-",i.indent+f+3+k.pos)+`^
10149
10149
  `;for(let L=1;L<=i.linesAfter&&!(p+L>=u.length);L++){let b=t(n.buffer,s[p+L],u[p+L],n.position-(s[p]-s[p+L]),g);h+=e.repeat(" ",i.indent)+r((n.line+L+1).toString(),f)+" | "+b.str+`
10150
- `}return h.replace(/\n$/,"")}return Cm=o,Cm}function tt(){if(U_)return Om;U_=1;let e=ui(),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(u){a[String(u)]=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 Om=n,Om}function sk(){if(z_)return Nm;z_=1;let e=ui(),t=tt();function r(i,a){let s=[];return i[a].forEach(function(u){let l=s.length;s.forEach(function(p,h){p.tag===u.tag&&p.kind===u.kind&&p.multi===u.multi&&(l=h)}),s[l]=u}),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,u=arguments.length;s<u;s+=1)arguments[s].forEach(a);return i}function n(i){return this.extend(i)}return n.prototype.extend=function(a){let s=[],u=[];if(a instanceof t)u.push(a);else if(Array.isArray(a))u=u.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(s=s.concat(a.implicit)),a.explicit&&(u=u.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.")}),u.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(u),l.compiledImplicit=r(l,"implicit"),l.compiledExplicit=r(l,"explicit"),l.compiledTypeMap=o(l.compiledImplicit,l.compiledExplicit),l},Nm=n,Nm}function ck(){if(F_)return Rm;F_=1;let e=tt();return Rm=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Rm}function lk(){if(G_)return Lm;G_=1;let e=tt();return Lm=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Lm}function dk(){if(B_)return Dm;B_=1;let e=tt();return Dm=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Dm}function uk(){if(W_)return jm;W_=1;let e=sk();return jm=new e({explicit:[ck(),lk(),dk()]}),jm}function pk(){if(K_)return Mm;K_=1;let e=tt();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 Mm=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"}),Mm}function hk(){if(Z_)return Um;Z_=1;let e=tt();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 Um=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"}),Um}function mk(){if(H_)return zm;H_=1;let e=di(),t=tt();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,f=!1;if(!p)return!1;let g=l[h];if((g==="-"||g==="+")&&(g=l[++h]),g==="0"){if(h+1===p)return!0;if(g=l[++h],g==="b"){for(h++;h<p;h++){if(g=l[h],g!=="0"&&g!=="1")return!1;f=!0}return f&&isFinite(a(l))}if(g==="x"){for(h++;h<p;h++){if(!r(l.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(l))}if(g==="o"){for(h++;h<p;h++){if(!o(l.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(l))}}for(;h<p;h++){if(!n(l.charCodeAt(h)))return!1;f=!0}return f?isFinite(a(l)):!1}function a(l){let p=l,h=1,f=p[0];if((f==="-"||f==="+")&&(f==="-"&&(h=-1),p=p.slice(1),f=p[0]),p==="0")return 0;if(f==="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 u(l){return Object.prototype.toString.call(l)==="[object Number]"&&l%1===0&&!e.isNegativeZero(l)}return zm=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:s,predicate:u,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"]}}),zm}function fk(){if(V_)return Fm;V_=1;let e=di(),t=tt(),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 u(l){return Object.prototype.toString.call(l)==="[object Number]"&&(l%1!==0||e.isNegativeZero(l))}return Fm=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:u,represent:s,defaultStyle:"lowercase"}),Fm}function gk(){return Y_||(Y_=1,Gm=uk().extend({implicit:[pk(),hk(),mk(),fk()]})),Gm}function yk(){return J_||(J_=1,Bm=gk()),Bm}function vk(){if(q_)return Wm;q_=1;let e=tt(),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,u=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,f=+l[3];if(!l[4])return new Date(Date.UTC(p,h,f));let g=+l[4],k=+l[5],L=+l[6];if(l[7]){for(s=l[7].slice(0,3);s.length<3;)s+="0";s=+s}if(l[9]){let x=+l[10],S=+(l[11]||0);u=(x*60+S)*6e4,l[9]==="-"&&(u=-u)}let b=new Date(Date.UTC(p,h,f,g,k,L,s));return u&&b.setTime(b.getTime()-u),b}function i(a){return a.toISOString()}return Wm=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:n,instanceOf:Date,represent:i}),Wm}function bk(){if(X_)return Km;X_=1;let e=tt();function t(r){return r==="<<"||r===null}return Km=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),Km}function wk(){if(Q_)return Zm;Q_=1;let e=tt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
10151
- \r`;function r(a){if(a===null)return!1;let s=0,u=a.length,l=t;for(let p=0;p<u;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,""),u=s.length,l=t,p=0,h=[];for(let g=0;g<u;g++)g%4===0&&g&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|l.indexOf(s.charAt(g));let f=u%4*6;return f===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):f===18?(h.push(p>>10&255),h.push(p>>2&255)):f===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",u=0,l=a.length,p=t;for(let f=0;f<l;f++)f%3===0&&f&&(s+=p[u>>18&63],s+=p[u>>12&63],s+=p[u>>6&63],s+=p[u&63]),u=(u<<8)+a[f];let h=l%3;return h===0?(s+=p[u>>18&63],s+=p[u>>12&63],s+=p[u>>6&63],s+=p[u&63]):h===2?(s+=p[u>>10&63],s+=p[u>>4&63],s+=p[u<<2&63],s+=p[64]):h===1&&(s+=p[u>>2&63],s+=p[u<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return Zm=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),Zm}function _k(){if(ek)return Hm;ek=1;let e=tt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let a={},s=i;for(let u=0,l=s.length;u<l;u+=1){let p=s[u],h=!1;if(r.call(p)!=="[object Object]")return!1;let f;for(f in p)if(t.call(p,f))if(!h)h=!0;else return!1;if(!h||t.call(a,f))return!1;Object.defineProperty(a,f,{value:!0})}return!0}function n(i){return i!==null?i:[]}return Hm=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),Hm}function kk(){if(tk)return Vm;tk=1;let e=tt(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,a=new Array(i.length);for(let s=0,u=i.length;s<u;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,u=i.length;s<u;s+=1){let l=i[s],p=Object.keys(l);a[s]=[p[0],l[p[0]]]}return a}return Vm=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),Vm}function xk(){if(nk)return Ym;nk=1;let e=tt(),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 Ym=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),Ym}function Xm(){return rk||(rk=1,Jm=yk().extend({implicit:[vk(),bk()],explicit:[wk(),_k(),kk(),xk()]})),Jm}function cP(){if(ok)return Fs;ok=1;let e=di(),t=ui(),r=sP(),o=Xm(),n=Object.prototype.hasOwnProperty,i=1,a=2,s=3,u=4,l=1,p=2,h=3,f=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,k=/[,\[\]{}]/,L=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function x(d){return Object.prototype.toString.call(d)}function S(d){return d===10||d===13}function $(d){return d===9||d===32}function j(d){return d===9||d===32||d===10||d===13}function I(d){return d===44||d===91||d===93||d===123||d===125}function ae(d){if(d>=48&&d<=57)return d-48;let _=d|32;return _>=97&&_<=102?_-97+10:-1}function oe(d){return d===120?2:d===117?4:d===85?8:0}function de(d){return d>=48&&d<=57?d-48:-1}function lt(d){switch(d){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
10152
- `;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 Ln(d){return d<=65535?String.fromCharCode(d):String.fromCharCode((d-65536>>10)+55296,(d-65536&1023)+56320)}function Ce(d,_,R){_==="__proto__"?Object.defineProperty(d,_,{configurable:!0,enumerable:!0,writable:!0,value:R}):d[_]=R}let _t=new Array(256),ft=new Array(256);for(let d=0;d<256;d++)_t[d]=lt(d)?1:0,ft[d]=lt(d);function se(d,_){this.input=d,this.filename=_.filename||null,this.schema=_.schema||o,this.onWarning=_.onWarning||null,this.legacy=_.legacy||!1,this.json=_.json||!1,this.listener=_.listener||null,this.maxDepth=typeof _.maxDepth=="number"?_.maxDepth:100,this.maxTotalMergeKeys=typeof _.maxTotalMergeKeys=="number"?_.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=d.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 Se(d,_){let R={name:d.filename,buffer:d.input.slice(0,-1),position:d.position,line:d.line,column:d.position-d.lineStart};return R.snippet=r(R),new t(_,R)}function q(d,_){throw Se(d,_)}function dt(d,_){d.onWarning&&d.onWarning.call(null,Se(d,_))}function ze(d,_,R){let D=d.anchorMapTransactions;if(D.length!==0){let P=D[D.length-1];n.call(P,_)||(P[_]={existed:n.call(d.anchorMap,_),value:d.anchorMap[_]})}d.anchorMap[_]=R}function Dn(d){d.anchorMapTransactions.push(Object.create(null))}function _e(d){let _=d.anchorMapTransactions.pop(),R=d.anchorMapTransactions;if(R.length===0)return;let D=R[R.length-1],P=Object.keys(_);for(let m=0,E=P.length;m<E;m+=1){let A=P[m];n.call(D,A)||(D[A]=_[A])}}function Ve(d){let _=d.anchorMapTransactions.pop(),R=Object.keys(_);for(let D=R.length-1;D>=0;D-=1){let P=_[R[D]];P.existed?d.anchorMap[R[D]]=P.value:delete d.anchorMap[R[D]]}}function J(d){return{position:d.position,line:d.line,lineStart:d.lineStart,lineIndent:d.lineIndent,firstTabInLine:d.firstTabInLine,tag:d.tag,anchor:d.anchor,kind:d.kind,result:d.result}}function we(d,_){d.position=_.position,d.line=_.line,d.lineStart=_.lineStart,d.lineIndent=_.lineIndent,d.firstTabInLine=_.firstTabInLine,d.tag=_.tag,d.anchor=_.anchor,d.kind=_.kind,d.result=_.result}let Ye={YAML:function(_,R,D){_.version!==null&&q(_,"duplication of %YAML directive"),D.length!==1&&q(_,"YAML directive accepts exactly one argument");let P=/^([0-9]+)\.([0-9]+)$/.exec(D[0]);P===null&&q(_,"ill-formed argument of the YAML directive");let m=parseInt(P[1],10),E=parseInt(P[2],10);m!==1&&q(_,"unacceptable YAML version of the document"),_.version=D[0],_.checkLineBreaks=E<2,E!==1&&E!==2&&dt(_,"unsupported YAML version of the document")},TAG:function(_,R,D){let P;D.length!==2&&q(_,"TAG directive accepts exactly two arguments");let m=D[0];P=D[1],L.test(m)||q(_,"ill-formed tag handle (first argument) of the TAG directive"),n.call(_.tagMap,m)&&q(_,'there is a previously declared suffix for "'+m+'" tag handle'),b.test(P)||q(_,"ill-formed tag prefix (second argument) of the TAG directive");try{P=decodeURIComponent(P)}catch{q(_,"tag prefix is malformed: "+P)}_.tagMap[m]=P}};function Fe(d,_,R,D){if(_<R){let P=d.input.slice(_,R);if(D)for(let m=0,E=P.length;m<E;m+=1){let A=P.charCodeAt(m);A===9||A>=32&&A<=1114111||q(d,"expected valid JSON character")}else f.test(P)&&q(d,"the stream contains non-printable characters");d.result+=P}}function kt(d){d.totalMergeKeys++,d.maxTotalMergeKeys!==-1&&d.totalMergeKeys>d.maxTotalMergeKeys&&q(d,"merge keys exceeded maxTotalMergeKeys ("+d.maxTotalMergeKeys+")")}function jn(d,_,R,D){e.isObject(R)||q(d,"cannot merge mappings; the provided source object is unacceptable"),kt(d);let P=Object.keys(R);for(let m=0,E=P.length;m<E;m+=1){let A=P[m];kt(d),n.call(_,A)||(Ce(_,A,R[A]),D[A]=!0)}}function Wt(d,_,R,D,P,m,E,A,M){if(Array.isArray(P)){P=Array.prototype.slice.call(P);for(let F=0,B=P.length;F<B;F+=1)Array.isArray(P[F])&&q(d,"nested arrays are not supported inside keys"),typeof P=="object"&&x(P[F])==="[object Object]"&&(P[F]="[object Object]")}if(typeof P=="object"&&x(P)==="[object Object]"&&(P="[object Object]"),P=String(P),_===null&&(_={}),D==="tag:yaml.org,2002:merge")if(Array.isArray(m)){m.length>100&&q(d,"abnormal merge sequence size");for(let F=0,B=m.length;F<B;F+=1)jn(d,_,m[F],R)}else jn(d,_,m,R);else!d.json&&!n.call(R,P)&&n.call(_,P)&&(d.line=E||d.line,d.lineStart=A||d.lineStart,d.position=M||d.position,q(d,"duplicated mapping key")),Ce(_,P,m),delete R[P];return _}function po(d){let _=d.input.charCodeAt(d.position);_===10?d.position++:_===13?(d.position++,d.input.charCodeAt(d.position)===10&&d.position++):q(d,"a line break is expected"),d.line+=1,d.lineStart=d.position,d.firstTabInLine=-1}function Ee(d,_,R){let D=0,P=d.input.charCodeAt(d.position);for(;P!==0;){for(;$(P);)P===9&&d.firstTabInLine===-1&&(d.firstTabInLine=d.position),P=d.input.charCodeAt(++d.position);if(_&&P===35)do P=d.input.charCodeAt(++d.position);while(P!==10&&P!==13&&P!==0);if(S(P))for(po(d),P=d.input.charCodeAt(d.position),D++,d.lineIndent=0;P===32;)d.lineIndent++,P=d.input.charCodeAt(++d.position);else break}return R!==-1&&D!==0&&d.lineIndent<R&&dt(d,"deficient indentation"),D}function At(d){let _=d.position,R=d.input.charCodeAt(_);return!!((R===45||R===46)&&R===d.input.charCodeAt(_+1)&&R===d.input.charCodeAt(_+2)&&(_+=3,R=d.input.charCodeAt(_),R===0||j(R)))}function ar(d,_){_===1?d.result+=" ":_>1&&(d.result+=e.repeat(`
10153
- `,_-1))}function Mi(d,_,R){let D,P,m,E,A,M,F=d.kind,B=d.result,N=d.input.charCodeAt(d.position);if(j(N)||I(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 Z=d.input.charCodeAt(d.position+1);if(j(Z)||R&&I(Z))return!1}for(d.kind="scalar",d.result="",D=P=d.position,m=!1;N!==0;){if(N===58){let Z=d.input.charCodeAt(d.position+1);if(j(Z)||R&&I(Z))break}else if(N===35){let Z=d.input.charCodeAt(d.position-1);if(j(Z))break}else{if(d.position===d.lineStart&&At(d)||R&&I(N))break;if(S(N))if(E=d.line,A=d.lineStart,M=d.lineIndent,Ee(d,!1,-1),d.lineIndent>=_){m=!0,N=d.input.charCodeAt(d.position);continue}else{d.position=P,d.line=E,d.lineStart=A,d.lineIndent=M;break}}m&&(Fe(d,D,P,!1),ar(d,d.line-E),D=P=d.position,m=!1),$(N)||(P=d.position+1),N=d.input.charCodeAt(++d.position)}return Fe(d,D,P,!1),d.result?!0:(d.kind=F,d.result=B,!1)}function ho(d,_){let R,D,P=d.input.charCodeAt(d.position);if(P!==39)return!1;for(d.kind="scalar",d.result="",d.position++,R=D=d.position;(P=d.input.charCodeAt(d.position))!==0;)if(P===39)if(Fe(d,R,d.position,!0),P=d.input.charCodeAt(++d.position),P===39)R=d.position,d.position++,D=d.position;else return!0;else S(P)?(Fe(d,R,D,!0),ar(d,Ee(d,!1,_)),R=D=d.position):d.position===d.lineStart&&At(d)?q(d,"unexpected end of the document within a single quoted scalar"):(d.position++,$(P)||(D=d.position));q(d,"unexpected end of the stream within a single quoted scalar")}function Ui(d,_){let R,D,P,m=d.input.charCodeAt(d.position);if(m!==34)return!1;for(d.kind="scalar",d.result="",d.position++,R=D=d.position;(m=d.input.charCodeAt(d.position))!==0;){if(m===34)return Fe(d,R,d.position,!0),d.position++,!0;if(m===92){if(Fe(d,R,d.position,!0),m=d.input.charCodeAt(++d.position),S(m))Ee(d,!1,_);else if(m<256&&_t[m])d.result+=ft[m],d.position++;else if((P=oe(m))>0){let E=P,A=0;for(;E>0;E--)m=d.input.charCodeAt(++d.position),(P=ae(m))>=0?A=(A<<4)+P:q(d,"expected hexadecimal character");d.result+=Ln(A),d.position++}else q(d,"unknown escape sequence");R=D=d.position}else S(m)?(Fe(d,R,D,!0),ar(d,Ee(d,!1,_)),R=D=d.position):d.position===d.lineStart&&At(d)?q(d,"unexpected end of the document within a double quoted scalar"):(d.position++,$(m)||(D=d.position))}q(d,"unexpected end of the stream within a double quoted scalar")}function zi(d,_){let R=!0,D,P,m,E=d.tag,A,M=d.anchor,F,B,N,Z,Q=Object.create(null),ne,re,ce,ue=d.input.charCodeAt(d.position);if(ue===91)F=93,Z=!1,A=[];else if(ue===123)F=125,Z=!0,A={};else return!1;for(d.anchor!==null&&ze(d,d.anchor,A),ue=d.input.charCodeAt(++d.position);ue!==0;){if(Ee(d,!0,_),ue=d.input.charCodeAt(d.position),ue===F)return d.position++,d.tag=E,d.anchor=M,d.kind=Z?"mapping":"sequence",d.result=A,!0;if(R?ue===44&&q(d,"expected the node content, but found ','"):q(d,"missed comma between flow collection entries"),re=ne=ce=null,B=N=!1,ue===63){let an=d.input.charCodeAt(d.position+1);j(an)&&(B=N=!0,d.position++,Ee(d,!0,_))}D=d.line,P=d.lineStart,m=d.position,on(d,_,i,!1,!0),re=d.tag,ne=d.result,Ee(d,!0,_),ue=d.input.charCodeAt(d.position),(N||d.line===D)&&ue===58&&(B=!0,ue=d.input.charCodeAt(++d.position),Ee(d,!0,_),on(d,_,i,!1,!0),ce=d.result),Z?Wt(d,A,Q,re,ne,ce,D,P,m):B?A.push(Wt(d,null,Q,re,ne,ce,D,P,m)):A.push(ne),Ee(d,!0,_),ue=d.input.charCodeAt(d.position),ue===44?(R=!0,ue=d.input.charCodeAt(++d.position)):R=!1}q(d,"unexpected end of the stream within a flow collection")}function rn(d,_){let R,D=l,P=!1,m=!1,E=_,A=0,M=!1,F,B=d.input.charCodeAt(d.position);if(B===124)R=!1;else if(B===62)R=!0;else return!1;for(d.kind="scalar",d.result="";B!==0;)if(B=d.input.charCodeAt(++d.position),B===43||B===45)l===D?D=B===43?h:p:q(d,"repeat of a chomping mode identifier");else if((F=de(B))>=0)F===0?q(d,"bad explicit indentation width of a block scalar; it cannot be less than one"):m?q(d,"repeat of an indentation width identifier"):(E=_+F-1,m=!0);else break;if($(B)){do B=d.input.charCodeAt(++d.position);while($(B));if(B===35)do B=d.input.charCodeAt(++d.position);while(!S(B)&&B!==0)}for(;B!==0;){for(po(d),d.lineIndent=0,B=d.input.charCodeAt(d.position);(!m||d.lineIndent<E)&&B===32;)d.lineIndent++,B=d.input.charCodeAt(++d.position);if(!m&&d.lineIndent>E&&(E=d.lineIndent),S(B)){A++;continue}if(!m&&E===0&&q(d,"missing indentation for block scalar"),d.lineIndent<E){D===h?d.result+=e.repeat(`
10154
- `,P?1+A:A):D===l&&P&&(d.result+=`
10155
- `);break}R?$(B)?(M=!0,d.result+=e.repeat(`
10156
- `,P?1+A:A)):M?(M=!1,d.result+=e.repeat(`
10157
- `,A+1)):A===0?P&&(d.result+=" "):d.result+=e.repeat(`
10150
+ `}return h.replace(/\n$/,"")}return Mm=o,Mm}function tt(){if(V_)return Um;V_=1;let e=pi(),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(u){a[String(u)]=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 Um=n,Um}function gk(){if(Y_)return zm;Y_=1;let e=pi(),t=tt();function r(i,a){let s=[];return i[a].forEach(function(u){let l=s.length;s.forEach(function(p,h){p.tag===u.tag&&p.kind===u.kind&&p.multi===u.multi&&(l=h)}),s[l]=u}),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,u=arguments.length;s<u;s+=1)arguments[s].forEach(a);return i}function n(i){return this.extend(i)}return n.prototype.extend=function(a){let s=[],u=[];if(a instanceof t)u.push(a);else if(Array.isArray(a))u=u.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(s=s.concat(a.implicit)),a.explicit&&(u=u.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.")}),u.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(u),l.compiledImplicit=r(l,"implicit"),l.compiledExplicit=r(l,"explicit"),l.compiledTypeMap=o(l.compiledImplicit,l.compiledExplicit),l},zm=n,zm}function yk(){if(J_)return Fm;J_=1;let e=tt();return Fm=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Fm}function vk(){if(q_)return Gm;q_=1;let e=tt();return Gm=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Gm}function bk(){if(X_)return Bm;X_=1;let e=tt();return Bm=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Bm}function wk(){if(Q_)return Wm;Q_=1;let e=gk();return Wm=new e({explicit:[yk(),vk(),bk()]}),Wm}function _k(){if(ek)return Km;ek=1;let e=tt();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 Km=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"}),Km}function kk(){if(tk)return Zm;tk=1;let e=tt();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 Zm=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"}),Zm}function xk(){if(nk)return Hm;nk=1;let e=ui(),t=tt();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,f=!1;if(!p)return!1;let g=l[h];if((g==="-"||g==="+")&&(g=l[++h]),g==="0"){if(h+1===p)return!0;if(g=l[++h],g==="b"){for(h++;h<p;h++){if(g=l[h],g!=="0"&&g!=="1")return!1;f=!0}return f&&isFinite(a(l))}if(g==="x"){for(h++;h<p;h++){if(!r(l.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(l))}if(g==="o"){for(h++;h<p;h++){if(!o(l.charCodeAt(h)))return!1;f=!0}return f&&isFinite(a(l))}}for(;h<p;h++){if(!n(l.charCodeAt(h)))return!1;f=!0}return f?isFinite(a(l)):!1}function a(l){let p=l,h=1,f=p[0];if((f==="-"||f==="+")&&(f==="-"&&(h=-1),p=p.slice(1),f=p[0]),p==="0")return 0;if(f==="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 u(l){return Object.prototype.toString.call(l)==="[object Number]"&&l%1===0&&!e.isNegativeZero(l)}return Hm=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:s,predicate:u,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"]}}),Hm}function Sk(){if(rk)return Vm;rk=1;let e=ui(),t=tt(),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 u(l){return Object.prototype.toString.call(l)==="[object Number]"&&(l%1!==0||e.isNegativeZero(l))}return Vm=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:u,represent:s,defaultStyle:"lowercase"}),Vm}function Ek(){return ok||(ok=1,Ym=wk().extend({implicit:[_k(),kk(),xk(),Sk()]})),Ym}function $k(){return ik||(ik=1,Jm=Ek()),Jm}function Tk(){if(ak)return qm;ak=1;let e=tt(),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,u=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,f=+l[3];if(!l[4])return new Date(Date.UTC(p,h,f));let g=+l[4],k=+l[5],L=+l[6];if(l[7]){for(s=l[7].slice(0,3);s.length<3;)s+="0";s=+s}if(l[9]){let x=+l[10],S=+(l[11]||0);u=(x*60+S)*6e4,l[9]==="-"&&(u=-u)}let b=new Date(Date.UTC(p,h,f,g,k,L,s));return u&&b.setTime(b.getTime()-u),b}function i(a){return a.toISOString()}return qm=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:n,instanceOf:Date,represent:i}),qm}function Ak(){if(sk)return Xm;sk=1;let e=tt();function t(r){return r==="<<"||r===null}return Xm=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),Xm}function Ik(){if(ck)return Qm;ck=1;let e=tt(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
10151
+ \r`;function r(a){if(a===null)return!1;let s=0,u=a.length,l=t;for(let p=0;p<u;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,""),u=s.length,l=t,p=0,h=[];for(let g=0;g<u;g++)g%4===0&&g&&(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)),p=p<<6|l.indexOf(s.charAt(g));let f=u%4*6;return f===0?(h.push(p>>16&255),h.push(p>>8&255),h.push(p&255)):f===18?(h.push(p>>10&255),h.push(p>>2&255)):f===12&&h.push(p>>4&255),new Uint8Array(h)}function n(a){let s="",u=0,l=a.length,p=t;for(let f=0;f<l;f++)f%3===0&&f&&(s+=p[u>>18&63],s+=p[u>>12&63],s+=p[u>>6&63],s+=p[u&63]),u=(u<<8)+a[f];let h=l%3;return h===0?(s+=p[u>>18&63],s+=p[u>>12&63],s+=p[u>>6&63],s+=p[u&63]):h===2?(s+=p[u>>10&63],s+=p[u>>4&63],s+=p[u<<2&63],s+=p[64]):h===1&&(s+=p[u>>2&63],s+=p[u<<4&63],s+=p[64],s+=p[64]),s}function i(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return Qm=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),Qm}function Pk(){if(lk)return ef;lk=1;let e=tt(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let a={},s=i;for(let u=0,l=s.length;u<l;u+=1){let p=s[u],h=!1;if(r.call(p)!=="[object Object]")return!1;let f;for(f in p)if(t.call(p,f))if(!h)h=!0;else return!1;if(!h||t.call(a,f))return!1;Object.defineProperty(a,f,{value:!0})}return!0}function n(i){return i!==null?i:[]}return ef=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),ef}function Ck(){if(dk)return tf;dk=1;let e=tt(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,a=new Array(i.length);for(let s=0,u=i.length;s<u;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,u=i.length;s<u;s+=1){let l=i[s],p=Object.keys(l);a[s]=[p[0],l[p[0]]]}return a}return tf=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),tf}function Ok(){if(uk)return nf;uk=1;let e=tt(),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 nf=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),nf}function af(){return pk||(pk=1,rf=$k().extend({implicit:[Tk(),Ak()],explicit:[Ik(),Pk(),Ck(),Ok()]})),rf}function $P(){if(hk)return Ws;hk=1;let e=ui(),t=pi(),r=EP(),o=af(),n=Object.prototype.hasOwnProperty,i=1,a=2,s=3,u=4,l=1,p=2,h=3,f=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g=/[\x85\u2028\u2029]/,k=/[,\[\]{}]/,L=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function x(d){return Object.prototype.toString.call(d)}function S(d){return d===10||d===13}function $(d){return d===9||d===32}function j(d){return d===9||d===32||d===10||d===13}function P(d){return d===44||d===91||d===93||d===123||d===125}function ae(d){if(d>=48&&d<=57)return d-48;let _=d|32;return _>=97&&_<=102?_-97+10:-1}function oe(d){return d===120?2:d===117?4:d===85?8:0}function de(d){return d>=48&&d<=57?d-48:-1}function lt(d){switch(d){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
10152
+ `;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 Ln(d){return d<=65535?String.fromCharCode(d):String.fromCharCode((d-65536>>10)+55296,(d-65536&1023)+56320)}function Oe(d,_,R){_==="__proto__"?Object.defineProperty(d,_,{configurable:!0,enumerable:!0,writable:!0,value:R}):d[_]=R}let _t=new Array(256),ft=new Array(256);for(let d=0;d<256;d++)_t[d]=lt(d)?1:0,ft[d]=lt(d);function se(d,_){this.input=d,this.filename=_.filename||null,this.schema=_.schema||o,this.onWarning=_.onWarning||null,this.legacy=_.legacy||!1,this.json=_.json||!1,this.listener=_.listener||null,this.maxDepth=typeof _.maxDepth=="number"?_.maxDepth:100,this.maxTotalMergeKeys=typeof _.maxTotalMergeKeys=="number"?_.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=d.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 Ee(d,_){let R={name:d.filename,buffer:d.input.slice(0,-1),position:d.position,line:d.line,column:d.position-d.lineStart};return R.snippet=r(R),new t(_,R)}function X(d,_){throw Ee(d,_)}function dt(d,_){d.onWarning&&d.onWarning.call(null,Ee(d,_))}function ze(d,_,R){let D=d.anchorMapTransactions;if(D.length!==0){let C=D[D.length-1];n.call(C,_)||(C[_]={existed:n.call(d.anchorMap,_),value:d.anchorMap[_]})}d.anchorMap[_]=R}function Dn(d){d.anchorMapTransactions.push(Object.create(null))}function _e(d){let _=d.anchorMapTransactions.pop(),R=d.anchorMapTransactions;if(R.length===0)return;let D=R[R.length-1],C=Object.keys(_);for(let m=0,E=C.length;m<E;m+=1){let A=C[m];n.call(D,A)||(D[A]=_[A])}}function Ve(d){let _=d.anchorMapTransactions.pop(),R=Object.keys(_);for(let D=R.length-1;D>=0;D-=1){let C=_[R[D]];C.existed?d.anchorMap[R[D]]=C.value:delete d.anchorMap[R[D]]}}function J(d){return{position:d.position,line:d.line,lineStart:d.lineStart,lineIndent:d.lineIndent,firstTabInLine:d.firstTabInLine,tag:d.tag,anchor:d.anchor,kind:d.kind,result:d.result}}function we(d,_){d.position=_.position,d.line=_.line,d.lineStart=_.lineStart,d.lineIndent=_.lineIndent,d.firstTabInLine=_.firstTabInLine,d.tag=_.tag,d.anchor=_.anchor,d.kind=_.kind,d.result=_.result}let Ye={YAML:function(_,R,D){_.version!==null&&X(_,"duplication of %YAML directive"),D.length!==1&&X(_,"YAML directive accepts exactly one argument");let C=/^([0-9]+)\.([0-9]+)$/.exec(D[0]);C===null&&X(_,"ill-formed argument of the YAML directive");let m=parseInt(C[1],10),E=parseInt(C[2],10);m!==1&&X(_,"unacceptable YAML version of the document"),_.version=D[0],_.checkLineBreaks=E<2,E!==1&&E!==2&&dt(_,"unsupported YAML version of the document")},TAG:function(_,R,D){let C;D.length!==2&&X(_,"TAG directive accepts exactly two arguments");let m=D[0];C=D[1],L.test(m)||X(_,"ill-formed tag handle (first argument) of the TAG directive"),n.call(_.tagMap,m)&&X(_,'there is a previously declared suffix for "'+m+'" tag handle'),b.test(C)||X(_,"ill-formed tag prefix (second argument) of the TAG directive");try{C=decodeURIComponent(C)}catch{X(_,"tag prefix is malformed: "+C)}_.tagMap[m]=C}};function Fe(d,_,R,D){if(_<R){let C=d.input.slice(_,R);if(D)for(let m=0,E=C.length;m<E;m+=1){let A=C.charCodeAt(m);A===9||A>=32&&A<=1114111||X(d,"expected valid JSON character")}else f.test(C)&&X(d,"the stream contains non-printable characters");d.result+=C}}function kt(d){d.totalMergeKeys++,d.maxTotalMergeKeys!==-1&&d.totalMergeKeys>d.maxTotalMergeKeys&&X(d,"merge keys exceeded maxTotalMergeKeys ("+d.maxTotalMergeKeys+")")}function jn(d,_,R,D){e.isObject(R)||X(d,"cannot merge mappings; the provided source object is unacceptable"),kt(d);let C=Object.keys(R);for(let m=0,E=C.length;m<E;m+=1){let A=C[m];kt(d),n.call(_,A)||(Oe(_,A,R[A]),D[A]=!0)}}function Wt(d,_,R,D,C,m,E,A,M){if(Array.isArray(C)){C=Array.prototype.slice.call(C);for(let G=0,W=C.length;G<W;G+=1)Array.isArray(C[G])&&X(d,"nested arrays are not supported inside keys"),typeof C=="object"&&x(C[G])==="[object Object]"&&(C[G]="[object Object]")}if(typeof C=="object"&&x(C)==="[object Object]"&&(C="[object Object]"),C=String(C),_===null&&(_={}),D==="tag:yaml.org,2002:merge")if(Array.isArray(m)){m.length>100&&X(d,"abnormal merge sequence size");for(let G=0,W=m.length;G<W;G+=1)jn(d,_,m[G],R)}else jn(d,_,m,R);else!d.json&&!n.call(R,C)&&n.call(_,C)&&(d.line=E||d.line,d.lineStart=A||d.lineStart,d.position=M||d.position,X(d,"duplicated mapping key")),Oe(_,C,m),delete R[C];return _}function ho(d){let _=d.input.charCodeAt(d.position);_===10?d.position++:_===13?(d.position++,d.input.charCodeAt(d.position)===10&&d.position++):X(d,"a line break is expected"),d.line+=1,d.lineStart=d.position,d.firstTabInLine=-1}function $e(d,_,R){let D=0,C=d.input.charCodeAt(d.position);for(;C!==0;){for(;$(C);)C===9&&d.firstTabInLine===-1&&(d.firstTabInLine=d.position),C=d.input.charCodeAt(++d.position);if(_&&C===35)do C=d.input.charCodeAt(++d.position);while(C!==10&&C!==13&&C!==0);if(S(C))for(ho(d),C=d.input.charCodeAt(d.position),D++,d.lineIndent=0;C===32;)d.lineIndent++,C=d.input.charCodeAt(++d.position);else break}return R!==-1&&D!==0&&d.lineIndent<R&&dt(d,"deficient indentation"),D}function At(d){let _=d.position,R=d.input.charCodeAt(_);return!!((R===45||R===46)&&R===d.input.charCodeAt(_+1)&&R===d.input.charCodeAt(_+2)&&(_+=3,R=d.input.charCodeAt(_),R===0||j(R)))}function ar(d,_){_===1?d.result+=" ":_>1&&(d.result+=e.repeat(`
10153
+ `,_-1))}function Fi(d,_,R){let D,C,m,E,A,M,G=d.kind,W=d.result,N=d.input.charCodeAt(d.position);if(j(N)||P(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 H=d.input.charCodeAt(d.position+1);if(j(H)||R&&P(H))return!1}for(d.kind="scalar",d.result="",D=C=d.position,m=!1;N!==0;){if(N===58){let H=d.input.charCodeAt(d.position+1);if(j(H)||R&&P(H))break}else if(N===35){let H=d.input.charCodeAt(d.position-1);if(j(H))break}else{if(d.position===d.lineStart&&At(d)||R&&P(N))break;if(S(N))if(E=d.line,A=d.lineStart,M=d.lineIndent,$e(d,!1,-1),d.lineIndent>=_){m=!0,N=d.input.charCodeAt(d.position);continue}else{d.position=C,d.line=E,d.lineStart=A,d.lineIndent=M;break}}m&&(Fe(d,D,C,!1),ar(d,d.line-E),D=C=d.position,m=!1),$(N)||(C=d.position+1),N=d.input.charCodeAt(++d.position)}return Fe(d,D,C,!1),d.result?!0:(d.kind=G,d.result=W,!1)}function mo(d,_){let R,D,C=d.input.charCodeAt(d.position);if(C!==39)return!1;for(d.kind="scalar",d.result="",d.position++,R=D=d.position;(C=d.input.charCodeAt(d.position))!==0;)if(C===39)if(Fe(d,R,d.position,!0),C=d.input.charCodeAt(++d.position),C===39)R=d.position,d.position++,D=d.position;else return!0;else S(C)?(Fe(d,R,D,!0),ar(d,$e(d,!1,_)),R=D=d.position):d.position===d.lineStart&&At(d)?X(d,"unexpected end of the document within a single quoted scalar"):(d.position++,$(C)||(D=d.position));X(d,"unexpected end of the stream within a single quoted scalar")}function Gi(d,_){let R,D,C,m=d.input.charCodeAt(d.position);if(m!==34)return!1;for(d.kind="scalar",d.result="",d.position++,R=D=d.position;(m=d.input.charCodeAt(d.position))!==0;){if(m===34)return Fe(d,R,d.position,!0),d.position++,!0;if(m===92){if(Fe(d,R,d.position,!0),m=d.input.charCodeAt(++d.position),S(m))$e(d,!1,_);else if(m<256&&_t[m])d.result+=ft[m],d.position++;else if((C=oe(m))>0){let E=C,A=0;for(;E>0;E--)m=d.input.charCodeAt(++d.position),(C=ae(m))>=0?A=(A<<4)+C:X(d,"expected hexadecimal character");d.result+=Ln(A),d.position++}else X(d,"unknown escape sequence");R=D=d.position}else S(m)?(Fe(d,R,D,!0),ar(d,$e(d,!1,_)),R=D=d.position):d.position===d.lineStart&&At(d)?X(d,"unexpected end of the document within a double quoted scalar"):(d.position++,$(m)||(D=d.position))}X(d,"unexpected end of the stream within a double quoted scalar")}function Bi(d,_){let R=!0,D,C,m,E=d.tag,A,M=d.anchor,G,W,N,H,ee=Object.create(null),ne,re,ce,ue=d.input.charCodeAt(d.position);if(ue===91)G=93,H=!1,A=[];else if(ue===123)G=125,H=!0,A={};else return!1;for(d.anchor!==null&&ze(d,d.anchor,A),ue=d.input.charCodeAt(++d.position);ue!==0;){if($e(d,!0,_),ue=d.input.charCodeAt(d.position),ue===G)return d.position++,d.tag=E,d.anchor=M,d.kind=H?"mapping":"sequence",d.result=A,!0;if(R?ue===44&&X(d,"expected the node content, but found ','"):X(d,"missed comma between flow collection entries"),re=ne=ce=null,W=N=!1,ue===63){let an=d.input.charCodeAt(d.position+1);j(an)&&(W=N=!0,d.position++,$e(d,!0,_))}D=d.line,C=d.lineStart,m=d.position,on(d,_,i,!1,!0),re=d.tag,ne=d.result,$e(d,!0,_),ue=d.input.charCodeAt(d.position),(N||d.line===D)&&ue===58&&(W=!0,ue=d.input.charCodeAt(++d.position),$e(d,!0,_),on(d,_,i,!1,!0),ce=d.result),H?Wt(d,A,ee,re,ne,ce,D,C,m):W?A.push(Wt(d,null,ee,re,ne,ce,D,C,m)):A.push(ne),$e(d,!0,_),ue=d.input.charCodeAt(d.position),ue===44?(R=!0,ue=d.input.charCodeAt(++d.position)):R=!1}X(d,"unexpected end of the stream within a flow collection")}function rn(d,_){let R,D=l,C=!1,m=!1,E=_,A=0,M=!1,G,W=d.input.charCodeAt(d.position);if(W===124)R=!1;else if(W===62)R=!0;else return!1;for(d.kind="scalar",d.result="";W!==0;)if(W=d.input.charCodeAt(++d.position),W===43||W===45)l===D?D=W===43?h:p:X(d,"repeat of a chomping mode identifier");else if((G=de(W))>=0)G===0?X(d,"bad explicit indentation width of a block scalar; it cannot be less than one"):m?X(d,"repeat of an indentation width identifier"):(E=_+G-1,m=!0);else break;if($(W)){do W=d.input.charCodeAt(++d.position);while($(W));if(W===35)do W=d.input.charCodeAt(++d.position);while(!S(W)&&W!==0)}for(;W!==0;){for(ho(d),d.lineIndent=0,W=d.input.charCodeAt(d.position);(!m||d.lineIndent<E)&&W===32;)d.lineIndent++,W=d.input.charCodeAt(++d.position);if(!m&&d.lineIndent>E&&(E=d.lineIndent),S(W)){A++;continue}if(!m&&E===0&&X(d,"missing indentation for block scalar"),d.lineIndent<E){D===h?d.result+=e.repeat(`
10154
+ `,C?1+A:A):D===l&&C&&(d.result+=`
10155
+ `);break}R?$(W)?(M=!0,d.result+=e.repeat(`
10156
+ `,C?1+A:A)):M?(M=!1,d.result+=e.repeat(`
10157
+ `,A+1)):A===0?C&&(d.result+=" "):d.result+=e.repeat(`
10158
10158
  `,A):d.result+=e.repeat(`
10159
- `,P?1+A:A),P=!0,m=!0,A=0;let N=d.position;for(;!S(B)&&B!==0;)B=d.input.charCodeAt(++d.position);Fe(d,N,d.position,!1)}return!0}function Fi(d,_){let R=d.tag,D=d.anchor,P=[],m=!1;if(d.firstTabInLine!==-1)return!1;d.anchor!==null&&ze(d,d.anchor,P);let E=d.input.charCodeAt(d.position);for(;E!==0&&(d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,q(d,"tab characters must not be used in indentation")),E===45);){let A=d.input.charCodeAt(d.position+1);if(!j(A))break;if(m=!0,d.position++,Ee(d,!0,-1)&&d.lineIndent<=_){P.push(null),E=d.input.charCodeAt(d.position);continue}let M=d.line;if(on(d,_,s,!1,!0),P.push(d.result),Ee(d,!0,-1),E=d.input.charCodeAt(d.position),(d.line===M||d.lineIndent>_)&&E!==0)q(d,"bad indentation of a sequence entry");else if(d.lineIndent<_)break}return m?(d.tag=R,d.anchor=D,d.kind="sequence",d.result=P,!0):!1}function Gi(d,_,R){let D,P,m,E,A=d.tag,M=d.anchor,F={},B=Object.create(null),N=null,Z=null,Q=null,ne=!1,re=!1;if(d.firstTabInLine!==-1)return!1;d.anchor!==null&&ze(d,d.anchor,F);let ce=d.input.charCodeAt(d.position);for(;ce!==0;){!ne&&d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,q(d,"tab characters must not be used in indentation"));let ue=d.input.charCodeAt(d.position+1),an=d.line;if((ce===63||ce===58)&&j(ue))ce===63?(ne&&(Wt(d,F,B,N,Z,null,P,m,E),N=Z=Q=null),re=!0,ne=!0,D=!0):ne?(ne=!1,D=!0):q(d,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),d.position+=1,ce=ue;else{if(P=d.line,m=d.lineStart,E=d.position,!on(d,R,a,!1,!0))break;if(d.line===an){for(ce=d.input.charCodeAt(d.position);$(ce);)ce=d.input.charCodeAt(++d.position);if(ce===58)ce=d.input.charCodeAt(++d.position),j(ce)||q(d,"a whitespace character is expected after the key-value separator within a block mapping"),ne&&(Wt(d,F,B,N,Z,null,P,m,E),N=Z=Q=null),re=!0,ne=!1,D=!1,N=d.tag,Z=d.result;else if(re)q(d,"can not read an implicit mapping pair; a colon is missed");else return d.tag=A,d.anchor=M,!0}else if(re)q(d,"can not read a block mapping entry; a multiline key may not be an implicit key");else return d.tag=A,d.anchor=M,!0}if((d.line===an||d.lineIndent>_)&&(ne&&(P=d.line,m=d.lineStart,E=d.position),on(d,_,u,!0,D)&&(ne?Z=d.result:Q=d.result),ne||(Wt(d,F,B,N,Z,Q,P,m,E),N=Z=Q=null),Ee(d,!0,-1),ce=d.input.charCodeAt(d.position)),(d.line===an||d.lineIndent>_)&&ce!==0)q(d,"bad indentation of a mapping entry");else if(d.lineIndent<_)break}return ne&&Wt(d,F,B,N,Z,null,P,m,E),re&&(d.tag=A,d.anchor=M,d.kind="mapping",d.result=F),re}function Bi(d){let _=!1,R=!1,D,P,m=d.input.charCodeAt(d.position);if(m!==33)return!1;d.tag!==null&&q(d,"duplication of a tag property"),m=d.input.charCodeAt(++d.position),m===60?(_=!0,m=d.input.charCodeAt(++d.position)):m===33?(R=!0,D="!!",m=d.input.charCodeAt(++d.position)):D="!";let E=d.position;if(_){do m=d.input.charCodeAt(++d.position);while(m!==0&&m!==62);d.position<d.length?(P=d.input.slice(E,d.position),m=d.input.charCodeAt(++d.position)):q(d,"unexpected end of the stream within a verbatim tag")}else{for(;m!==0&&!j(m);)m===33&&(R?q(d,"tag suffix cannot contain exclamation marks"):(D=d.input.slice(E-1,d.position+1),L.test(D)||q(d,"named tag handle cannot contain such characters"),R=!0,E=d.position+1)),m=d.input.charCodeAt(++d.position);P=d.input.slice(E,d.position),k.test(P)&&q(d,"tag suffix cannot contain flow indicator characters")}P&&!b.test(P)&&q(d,"tag name cannot contain such characters: "+P);try{P=decodeURIComponent(P)}catch{q(d,"tag name is malformed: "+P)}return _?d.tag=P:n.call(d.tagMap,D)?d.tag=d.tagMap[D]+P:D==="!"?d.tag="!"+P:D==="!!"?d.tag="tag:yaml.org,2002:"+P:q(d,'undeclared tag handle "'+D+'"'),!0}function Wi(d){let _=d.input.charCodeAt(d.position);if(_!==38)return!1;d.anchor!==null&&q(d,"duplication of an anchor property"),_=d.input.charCodeAt(++d.position);let R=d.position;for(;_!==0&&!j(_)&&!I(_);)_=d.input.charCodeAt(++d.position);return d.position===R&&q(d,"name of an anchor node must contain at least one character"),d.anchor=d.input.slice(R,d.position),!0}function Qc(d){let _=d.input.charCodeAt(d.position);if(_!==42)return!1;_=d.input.charCodeAt(++d.position);let R=d.position;for(;_!==0&&!j(_)&&!I(_);)_=d.input.charCodeAt(++d.position);d.position===R&&q(d,"name of an alias node must contain at least one character");let D=d.input.slice(R,d.position);return n.call(d.anchorMap,D)||q(d,'unidentified alias "'+D+'"'),d.result=d.anchorMap[D],Ee(d,!0,-1),!0}function Ki(d,_,R,D){let P=J(d);return Dn(d),we(d,_),d.tag=null,d.anchor=null,d.kind=null,d.result=null,Gi(d,R,D)&&d.kind==="mapping"?(_e(d),!0):(Ve(d),we(d,P),!1)}function on(d,_,R,D,P){let m,E,A=1,M=!1,F=!1,B=null,N,Z,Q;d.depth>=d.maxDepth&&q(d,"nesting exceeded maxDepth ("+d.maxDepth+")"),d.depth+=1,d.listener!==null&&d.listener("open",d),d.tag=null,d.anchor=null,d.kind=null,d.result=null;let ne=m=E=u===R||s===R;if(D&&Ee(d,!0,-1)&&(M=!0,d.lineIndent>_?A=1:d.lineIndent===_?A=0:d.lineIndent<_&&(A=-1)),A===1)for(;;){let re=d.input.charCodeAt(d.position),ce=J(d);if(M&&(re===33&&d.tag!==null||re===38&&d.anchor!==null)||!Bi(d)&&!Wi(d))break;B===null&&(B=ce),Ee(d,!0,-1)?(M=!0,E=ne,d.lineIndent>_?A=1:d.lineIndent===_?A=0:d.lineIndent<_&&(A=-1)):E=!1}if(E&&(E=M||P),A===1||u===R)if(i===R||a===R?Z=_:Z=_+1,Q=d.position-d.lineStart,A===1)if(E&&(Fi(d,Q)||Gi(d,Q,Z))||zi(d,Z))F=!0;else{let re=d.input.charCodeAt(d.position);B!==null&&ne&&!E&&re!==124&&re!==62&&Ki(d,B,B.position-B.lineStart,Z)||m&&rn(d,Z)||ho(d,Z)||Ui(d,Z)?F=!0:Qc(d)?(F=!0,(d.tag!==null||d.anchor!==null)&&q(d,"alias node should not have any properties")):Mi(d,Z,i===R)&&(F=!0,d.tag===null&&(d.tag="?")),d.anchor!==null&&ze(d,d.anchor,d.result)}else A===0&&(F=E&&Fi(d,Q));if(d.tag===null)d.anchor!==null&&ze(d,d.anchor,d.result);else if(d.tag==="?"){d.result!==null&&d.kind!=="scalar"&&q(d,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+d.kind+'"');for(let re=0,ce=d.implicitTypes.length;re<ce;re+=1)if(N=d.implicitTypes[re],N.resolve(d.result)){d.result=N.construct(d.result),d.tag=N.tag,d.anchor!==null&&ze(d,d.anchor,d.result);break}}else if(d.tag!=="!"){if(n.call(d.typeMap[d.kind||"fallback"],d.tag))N=d.typeMap[d.kind||"fallback"][d.tag];else{N=null;let re=d.typeMap.multi[d.kind||"fallback"];for(let ce=0,ue=re.length;ce<ue;ce+=1)if(d.tag.slice(0,re[ce].tag.length)===re[ce].tag){N=re[ce];break}}N||q(d,"unknown tag !<"+d.tag+">"),d.result!==null&&N.kind!==d.kind&&q(d,"unacceptable node kind for !<"+d.tag+'> tag; it should be "'+N.kind+'", not "'+d.kind+'"'),N.resolve(d.result,d.tag)?(d.result=N.construct(d.result,d.tag),d.anchor!==null&&ze(d,d.anchor,d.result)):q(d,"cannot resolve a node with !<"+d.tag+"> explicit tag")}return d.listener!==null&&d.listener("close",d),d.depth-=1,d.tag!==null||d.anchor!==null||F}function el(d){let _=d.position,R=!1,D;for(d.version=null,d.checkLineBreaks=d.legacy,d.tagMap=Object.create(null),d.anchorMap=Object.create(null);(D=d.input.charCodeAt(d.position))!==0&&(Ee(d,!0,-1),D=d.input.charCodeAt(d.position),!(d.lineIndent>0||D!==37));){R=!0,D=d.input.charCodeAt(++d.position);let P=d.position;for(;D!==0&&!j(D);)D=d.input.charCodeAt(++d.position);let m=d.input.slice(P,d.position),E=[];for(m.length<1&&q(d,"directive name must not be less than one character in length");D!==0;){for(;$(D);)D=d.input.charCodeAt(++d.position);if(D===35){do D=d.input.charCodeAt(++d.position);while(D!==0&&!S(D));break}if(S(D))break;for(P=d.position;D!==0&&!j(D);)D=d.input.charCodeAt(++d.position);E.push(d.input.slice(P,d.position))}D!==0&&po(d),n.call(Ye,m)?Ye[m](d,m,E):dt(d,'unknown document directive "'+m+'"')}if(Ee(d,!0,-1),d.lineIndent===0&&d.input.charCodeAt(d.position)===45&&d.input.charCodeAt(d.position+1)===45&&d.input.charCodeAt(d.position+2)===45?(d.position+=3,Ee(d,!0,-1)):R&&q(d,"directives end mark is expected"),on(d,d.lineIndent-1,u,!1,!0),Ee(d,!0,-1),d.checkLineBreaks&&g.test(d.input.slice(_,d.position))&&dt(d,"non-ASCII line breaks are interpreted as content"),d.documents.push(d.result),d.position===d.lineStart&&At(d)){d.input.charCodeAt(d.position)===46&&(d.position+=3,Ee(d,!0,-1));return}d.position<d.length-1&&q(d,"end of the stream or a document separator is expected")}function mo(d,_){d=String(d),_=_||{},d.length!==0&&(d.charCodeAt(d.length-1)!==10&&d.charCodeAt(d.length-1)!==13&&(d+=`
10160
- `),d.charCodeAt(0)===65279&&(d=d.slice(1)));let R=new se(d,_),D=d.indexOf("\0");for(D!==-1&&(R.position=D,q(R,"null byte is not allowed in input")),R.input+="\0";R.input.charCodeAt(R.position)===32;)R.lineIndent+=1,R.position+=1;for(;R.position<R.length-1;)el(R);return R.documents}function tl(d,_,R){_!==null&&typeof _=="object"&&typeof R>"u"&&(R=_,_=null);let D=mo(d,R);if(typeof _!="function")return D;for(let P=0,m=D.length;P<m;P+=1)_(D[P])}function nl(d,_){let R=mo(d,_);if(R.length!==0){if(R.length===1)return R[0];throw new t("expected a single document in the stream, but found more")}}return Fs.loadAll=tl,Fs.load=nl,Fs}function lP(){if(ik)return qm;ik=1;let e=di(),t=ui(),r=Xm(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,a=9,s=10,u=13,l=32,p=33,h=34,f=35,g=37,k=38,L=39,b=42,x=44,S=45,$=58,j=61,I=62,ae=63,oe=64,de=91,lt=93,Ln=96,Ce=123,_t=124,ft=125,se={};se[0]="\\0",se[7]="\\a",se[8]="\\b",se[9]="\\t",se[10]="\\n",se[11]="\\v",se[12]="\\f",se[13]="\\r",se[27]="\\e",se[34]='\\"',se[92]="\\\\",se[133]="\\N",se[160]="\\_",se[8232]="\\L",se[8233]="\\P";let Se=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],q=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function dt(m,E){if(E===null)return{};let A={},M=Object.keys(E);for(let F=0,B=M.length;F<B;F+=1){let N=M[F],Z=String(E[N]);N.slice(0,2)==="!!"&&(N="tag:yaml.org,2002:"+N.slice(2));let Q=m.compiledTypeMap.fallback[N];Q&&n.call(Q.styleAliases,Z)&&(Z=Q.styleAliases[Z]),A[N]=Z}return A}function ze(m){let E,A,M=m.toString(16).toUpperCase();if(m<=255)E="x",A=2;else if(m<=65535)E="u",A=4;else if(m<=4294967295)E="U",A=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+E+e.repeat("0",A-M.length)+M}let Dn=1,_e=2;function Ve(m){this.schema=m.schema||r,this.indent=Math.max(1,m.indent||2),this.noArrayIndent=m.noArrayIndent||!1,this.skipInvalid=m.skipInvalid||!1,this.flowLevel=e.isNothing(m.flowLevel)?-1:m.flowLevel,this.styleMap=dt(this.schema,m.styles||null),this.sortKeys=m.sortKeys||!1,this.lineWidth=m.lineWidth||80,this.noRefs=m.noRefs||!1,this.noCompatMode=m.noCompatMode||!1,this.condenseFlow=m.condenseFlow||!1,this.quotingType=m.quotingType==='"'?_e:Dn,this.forceQuotes=m.forceQuotes||!1,this.replacer=typeof m.replacer=="function"?m.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function J(m,E){let A=e.repeat(" ",E),M=0,F="",B=m.length;for(;M<B;){let N,Z=m.indexOf(`
10161
- `,M);Z===-1?(N=m.slice(M),M=B):(N=m.slice(M,Z+1),M=Z+1),N.length&&N!==`
10162
- `&&(F+=A),F+=N}return F}function we(m,E){return`
10163
- `+e.repeat(" ",m.indent*E)}function Ye(m,E){for(let A=0,M=m.implicitTypes.length;A<M;A+=1)if(m.implicitTypes[A].resolve(E))return!0;return!1}function Fe(m){return m===l||m===a}function kt(m){return m>=32&&m<=126||m>=161&&m<=55295&&m!==8232&&m!==8233||m>=57344&&m<=65533&&m!==i||m>=65536&&m<=1114111}function jn(m){return kt(m)&&m!==i&&m!==u&&m!==s}function Wt(m,E,A){let M=jn(m),F=M&&!Fe(m);return(A?M:M&&m!==x&&m!==de&&m!==lt&&m!==Ce&&m!==ft)&&m!==f&&!(E===$&&!F)||jn(E)&&!Fe(E)&&m===f||E===$&&F}function po(m){return kt(m)&&m!==i&&!Fe(m)&&m!==S&&m!==ae&&m!==$&&m!==x&&m!==de&&m!==lt&&m!==Ce&&m!==ft&&m!==f&&m!==k&&m!==b&&m!==p&&m!==_t&&m!==j&&m!==I&&m!==L&&m!==h&&m!==g&&m!==oe&&m!==Ln}function Ee(m){return!Fe(m)&&m!==$}function At(m,E){let A=m.charCodeAt(E),M;return A>=55296&&A<=56319&&E+1<m.length&&(M=m.charCodeAt(E+1),M>=56320&&M<=57343)?(A-55296)*1024+M-56320+65536:A}function ar(m){return/^\n* /.test(m)}let Mi=1,ho=2,Ui=3,zi=4,rn=5;function Fi(m,E,A,M,F,B,N,Z){let Q,ne=0,re=null,ce=!1,ue=!1,an=M!==-1,fo=-1,go=po(At(m,0))&&Ee(At(m,m.length-1));if(E||N)for(Q=0;Q<m.length;ne>=65536?Q+=2:Q++){if(ne=At(m,Q),!kt(ne))return rn;go=go&&Wt(ne,re,Z),re=ne}else{for(Q=0;Q<m.length;ne>=65536?Q+=2:Q++){if(ne=At(m,Q),ne===s)ce=!0,an&&(ue=ue||Q-fo-1>M&&m[fo+1]!==" ",fo=Q);else if(!kt(ne))return rn;go=go&&Wt(ne,re,Z),re=ne}ue=ue||an&&Q-fo-1>M&&m[fo+1]!==" "}return!ce&&!ue?go&&!N&&!F(m)?Mi:B===_e?rn:ho:A>9&&ar(m)?rn:N?B===_e?rn:ho:ue?zi:Ui}function Gi(m,E,A,M,F){m.dump=(function(){if(E.length===0)return m.quotingType===_e?'""':"''";if(!m.noCompatMode&&(Se.indexOf(E)!==-1||q.test(E)))return m.quotingType===_e?'"'+E+'"':"'"+E+"'";let B=m.indent*Math.max(1,A),N=m.lineWidth===-1?-1:Math.max(Math.min(m.lineWidth,40),m.lineWidth-B),Z=M||m.flowLevel>-1&&A>=m.flowLevel;function Q(ne){return Ye(m,ne)}switch(Fi(E,Z,m.indent,N,Q,m.quotingType,m.forceQuotes&&!M,F)){case Mi:return E;case ho:return"'"+E.replace(/'/g,"''")+"'";case Ui:return"|"+Bi(E,m.indent)+Wi(J(E,B));case zi:return">"+Bi(E,m.indent)+Wi(J(Qc(E,N),B));case rn:return'"'+on(E)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function Bi(m,E){let A=ar(m)?String(E):"",M=m[m.length-1]===`
10164
- `,B=M&&(m[m.length-2]===`
10159
+ `,C?1+A:A),C=!0,m=!0,A=0;let N=d.position;for(;!S(W)&&W!==0;)W=d.input.charCodeAt(++d.position);Fe(d,N,d.position,!1)}return!0}function Wi(d,_){let R=d.tag,D=d.anchor,C=[],m=!1;if(d.firstTabInLine!==-1)return!1;d.anchor!==null&&ze(d,d.anchor,C);let E=d.input.charCodeAt(d.position);for(;E!==0&&(d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,X(d,"tab characters must not be used in indentation")),E===45);){let A=d.input.charCodeAt(d.position+1);if(!j(A))break;if(m=!0,d.position++,$e(d,!0,-1)&&d.lineIndent<=_){C.push(null),E=d.input.charCodeAt(d.position);continue}let M=d.line;if(on(d,_,s,!1,!0),C.push(d.result),$e(d,!0,-1),E=d.input.charCodeAt(d.position),(d.line===M||d.lineIndent>_)&&E!==0)X(d,"bad indentation of a sequence entry");else if(d.lineIndent<_)break}return m?(d.tag=R,d.anchor=D,d.kind="sequence",d.result=C,!0):!1}function Ki(d,_,R){let D,C,m,E,A=d.tag,M=d.anchor,G={},W=Object.create(null),N=null,H=null,ee=null,ne=!1,re=!1;if(d.firstTabInLine!==-1)return!1;d.anchor!==null&&ze(d,d.anchor,G);let ce=d.input.charCodeAt(d.position);for(;ce!==0;){!ne&&d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,X(d,"tab characters must not be used in indentation"));let ue=d.input.charCodeAt(d.position+1),an=d.line;if((ce===63||ce===58)&&j(ue))ce===63?(ne&&(Wt(d,G,W,N,H,null,C,m,E),N=H=ee=null),re=!0,ne=!0,D=!0):ne?(ne=!1,D=!0):X(d,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),d.position+=1,ce=ue;else{if(C=d.line,m=d.lineStart,E=d.position,!on(d,R,a,!1,!0))break;if(d.line===an){for(ce=d.input.charCodeAt(d.position);$(ce);)ce=d.input.charCodeAt(++d.position);if(ce===58)ce=d.input.charCodeAt(++d.position),j(ce)||X(d,"a whitespace character is expected after the key-value separator within a block mapping"),ne&&(Wt(d,G,W,N,H,null,C,m,E),N=H=ee=null),re=!0,ne=!1,D=!1,N=d.tag,H=d.result;else if(re)X(d,"can not read an implicit mapping pair; a colon is missed");else return d.tag=A,d.anchor=M,!0}else if(re)X(d,"can not read a block mapping entry; a multiline key may not be an implicit key");else return d.tag=A,d.anchor=M,!0}if((d.line===an||d.lineIndent>_)&&(ne&&(C=d.line,m=d.lineStart,E=d.position),on(d,_,u,!0,D)&&(ne?H=d.result:ee=d.result),ne||(Wt(d,G,W,N,H,ee,C,m,E),N=H=ee=null),$e(d,!0,-1),ce=d.input.charCodeAt(d.position)),(d.line===an||d.lineIndent>_)&&ce!==0)X(d,"bad indentation of a mapping entry");else if(d.lineIndent<_)break}return ne&&Wt(d,G,W,N,H,null,C,m,E),re&&(d.tag=A,d.anchor=M,d.kind="mapping",d.result=G),re}function Zi(d){let _=!1,R=!1,D,C,m=d.input.charCodeAt(d.position);if(m!==33)return!1;d.tag!==null&&X(d,"duplication of a tag property"),m=d.input.charCodeAt(++d.position),m===60?(_=!0,m=d.input.charCodeAt(++d.position)):m===33?(R=!0,D="!!",m=d.input.charCodeAt(++d.position)):D="!";let E=d.position;if(_){do m=d.input.charCodeAt(++d.position);while(m!==0&&m!==62);d.position<d.length?(C=d.input.slice(E,d.position),m=d.input.charCodeAt(++d.position)):X(d,"unexpected end of the stream within a verbatim tag")}else{for(;m!==0&&!j(m);)m===33&&(R?X(d,"tag suffix cannot contain exclamation marks"):(D=d.input.slice(E-1,d.position+1),L.test(D)||X(d,"named tag handle cannot contain such characters"),R=!0,E=d.position+1)),m=d.input.charCodeAt(++d.position);C=d.input.slice(E,d.position),k.test(C)&&X(d,"tag suffix cannot contain flow indicator characters")}C&&!b.test(C)&&X(d,"tag name cannot contain such characters: "+C);try{C=decodeURIComponent(C)}catch{X(d,"tag name is malformed: "+C)}return _?d.tag=C:n.call(d.tagMap,D)?d.tag=d.tagMap[D]+C:D==="!"?d.tag="!"+C:D==="!!"?d.tag="tag:yaml.org,2002:"+C:X(d,'undeclared tag handle "'+D+'"'),!0}function Hi(d){let _=d.input.charCodeAt(d.position);if(_!==38)return!1;d.anchor!==null&&X(d,"duplication of an anchor property"),_=d.input.charCodeAt(++d.position);let R=d.position;for(;_!==0&&!j(_)&&!P(_);)_=d.input.charCodeAt(++d.position);return d.position===R&&X(d,"name of an anchor node must contain at least one character"),d.anchor=d.input.slice(R,d.position),!0}function il(d){let _=d.input.charCodeAt(d.position);if(_!==42)return!1;_=d.input.charCodeAt(++d.position);let R=d.position;for(;_!==0&&!j(_)&&!P(_);)_=d.input.charCodeAt(++d.position);d.position===R&&X(d,"name of an alias node must contain at least one character");let D=d.input.slice(R,d.position);return n.call(d.anchorMap,D)||X(d,'unidentified alias "'+D+'"'),d.result=d.anchorMap[D],$e(d,!0,-1),!0}function Vi(d,_,R,D){let C=J(d);return Dn(d),we(d,_),d.tag=null,d.anchor=null,d.kind=null,d.result=null,Ki(d,R,D)&&d.kind==="mapping"?(_e(d),!0):(Ve(d),we(d,C),!1)}function on(d,_,R,D,C){let m,E,A=1,M=!1,G=!1,W=null,N,H,ee;d.depth>=d.maxDepth&&X(d,"nesting exceeded maxDepth ("+d.maxDepth+")"),d.depth+=1,d.listener!==null&&d.listener("open",d),d.tag=null,d.anchor=null,d.kind=null,d.result=null;let ne=m=E=u===R||s===R;if(D&&$e(d,!0,-1)&&(M=!0,d.lineIndent>_?A=1:d.lineIndent===_?A=0:d.lineIndent<_&&(A=-1)),A===1)for(;;){let re=d.input.charCodeAt(d.position),ce=J(d);if(M&&(re===33&&d.tag!==null||re===38&&d.anchor!==null)||!Zi(d)&&!Hi(d))break;W===null&&(W=ce),$e(d,!0,-1)?(M=!0,E=ne,d.lineIndent>_?A=1:d.lineIndent===_?A=0:d.lineIndent<_&&(A=-1)):E=!1}if(E&&(E=M||C),A===1||u===R)if(i===R||a===R?H=_:H=_+1,ee=d.position-d.lineStart,A===1)if(E&&(Wi(d,ee)||Ki(d,ee,H))||Bi(d,H))G=!0;else{let re=d.input.charCodeAt(d.position);W!==null&&ne&&!E&&re!==124&&re!==62&&Vi(d,W,W.position-W.lineStart,H)||m&&rn(d,H)||mo(d,H)||Gi(d,H)?G=!0:il(d)?(G=!0,(d.tag!==null||d.anchor!==null)&&X(d,"alias node should not have any properties")):Fi(d,H,i===R)&&(G=!0,d.tag===null&&(d.tag="?")),d.anchor!==null&&ze(d,d.anchor,d.result)}else A===0&&(G=E&&Wi(d,ee));if(d.tag===null)d.anchor!==null&&ze(d,d.anchor,d.result);else if(d.tag==="?"){d.result!==null&&d.kind!=="scalar"&&X(d,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+d.kind+'"');for(let re=0,ce=d.implicitTypes.length;re<ce;re+=1)if(N=d.implicitTypes[re],N.resolve(d.result)){d.result=N.construct(d.result),d.tag=N.tag,d.anchor!==null&&ze(d,d.anchor,d.result);break}}else if(d.tag!=="!"){if(n.call(d.typeMap[d.kind||"fallback"],d.tag))N=d.typeMap[d.kind||"fallback"][d.tag];else{N=null;let re=d.typeMap.multi[d.kind||"fallback"];for(let ce=0,ue=re.length;ce<ue;ce+=1)if(d.tag.slice(0,re[ce].tag.length)===re[ce].tag){N=re[ce];break}}N||X(d,"unknown tag !<"+d.tag+">"),d.result!==null&&N.kind!==d.kind&&X(d,"unacceptable node kind for !<"+d.tag+'> tag; it should be "'+N.kind+'", not "'+d.kind+'"'),N.resolve(d.result,d.tag)?(d.result=N.construct(d.result,d.tag),d.anchor!==null&&ze(d,d.anchor,d.result)):X(d,"cannot resolve a node with !<"+d.tag+"> explicit tag")}return d.listener!==null&&d.listener("close",d),d.depth-=1,d.tag!==null||d.anchor!==null||G}function al(d){let _=d.position,R=!1,D;for(d.version=null,d.checkLineBreaks=d.legacy,d.tagMap=Object.create(null),d.anchorMap=Object.create(null);(D=d.input.charCodeAt(d.position))!==0&&($e(d,!0,-1),D=d.input.charCodeAt(d.position),!(d.lineIndent>0||D!==37));){R=!0,D=d.input.charCodeAt(++d.position);let C=d.position;for(;D!==0&&!j(D);)D=d.input.charCodeAt(++d.position);let m=d.input.slice(C,d.position),E=[];for(m.length<1&&X(d,"directive name must not be less than one character in length");D!==0;){for(;$(D);)D=d.input.charCodeAt(++d.position);if(D===35){do D=d.input.charCodeAt(++d.position);while(D!==0&&!S(D));break}if(S(D))break;for(C=d.position;D!==0&&!j(D);)D=d.input.charCodeAt(++d.position);E.push(d.input.slice(C,d.position))}D!==0&&ho(d),n.call(Ye,m)?Ye[m](d,m,E):dt(d,'unknown document directive "'+m+'"')}if($e(d,!0,-1),d.lineIndent===0&&d.input.charCodeAt(d.position)===45&&d.input.charCodeAt(d.position+1)===45&&d.input.charCodeAt(d.position+2)===45?(d.position+=3,$e(d,!0,-1)):R&&X(d,"directives end mark is expected"),on(d,d.lineIndent-1,u,!1,!0),$e(d,!0,-1),d.checkLineBreaks&&g.test(d.input.slice(_,d.position))&&dt(d,"non-ASCII line breaks are interpreted as content"),d.documents.push(d.result),d.position===d.lineStart&&At(d)){d.input.charCodeAt(d.position)===46&&(d.position+=3,$e(d,!0,-1));return}d.position<d.length-1&&X(d,"end of the stream or a document separator is expected")}function fo(d,_){d=String(d),_=_||{},d.length!==0&&(d.charCodeAt(d.length-1)!==10&&d.charCodeAt(d.length-1)!==13&&(d+=`
10160
+ `),d.charCodeAt(0)===65279&&(d=d.slice(1)));let R=new se(d,_),D=d.indexOf("\0");for(D!==-1&&(R.position=D,X(R,"null byte is not allowed in input")),R.input+="\0";R.input.charCodeAt(R.position)===32;)R.lineIndent+=1,R.position+=1;for(;R.position<R.length-1;)al(R);return R.documents}function sl(d,_,R){_!==null&&typeof _=="object"&&typeof R>"u"&&(R=_,_=null);let D=fo(d,R);if(typeof _!="function")return D;for(let C=0,m=D.length;C<m;C+=1)_(D[C])}function cl(d,_){let R=fo(d,_);if(R.length!==0){if(R.length===1)return R[0];throw new t("expected a single document in the stream, but found more")}}return Ws.loadAll=sl,Ws.load=cl,Ws}function TP(){if(mk)return of;mk=1;let e=ui(),t=pi(),r=af(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,a=9,s=10,u=13,l=32,p=33,h=34,f=35,g=37,k=38,L=39,b=42,x=44,S=45,$=58,j=61,P=62,ae=63,oe=64,de=91,lt=93,Ln=96,Oe=123,_t=124,ft=125,se={};se[0]="\\0",se[7]="\\a",se[8]="\\b",se[9]="\\t",se[10]="\\n",se[11]="\\v",se[12]="\\f",se[13]="\\r",se[27]="\\e",se[34]='\\"',se[92]="\\\\",se[133]="\\N",se[160]="\\_",se[8232]="\\L",se[8233]="\\P";let Ee=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],X=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function dt(m,E){if(E===null)return{};let A={},M=Object.keys(E);for(let G=0,W=M.length;G<W;G+=1){let N=M[G],H=String(E[N]);N.slice(0,2)==="!!"&&(N="tag:yaml.org,2002:"+N.slice(2));let ee=m.compiledTypeMap.fallback[N];ee&&n.call(ee.styleAliases,H)&&(H=ee.styleAliases[H]),A[N]=H}return A}function ze(m){let E,A,M=m.toString(16).toUpperCase();if(m<=255)E="x",A=2;else if(m<=65535)E="u",A=4;else if(m<=4294967295)E="U",A=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+E+e.repeat("0",A-M.length)+M}let Dn=1,_e=2;function Ve(m){this.schema=m.schema||r,this.indent=Math.max(1,m.indent||2),this.noArrayIndent=m.noArrayIndent||!1,this.skipInvalid=m.skipInvalid||!1,this.flowLevel=e.isNothing(m.flowLevel)?-1:m.flowLevel,this.styleMap=dt(this.schema,m.styles||null),this.sortKeys=m.sortKeys||!1,this.lineWidth=m.lineWidth||80,this.noRefs=m.noRefs||!1,this.noCompatMode=m.noCompatMode||!1,this.condenseFlow=m.condenseFlow||!1,this.quotingType=m.quotingType==='"'?_e:Dn,this.forceQuotes=m.forceQuotes||!1,this.replacer=typeof m.replacer=="function"?m.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function J(m,E){let A=e.repeat(" ",E),M=0,G="",W=m.length;for(;M<W;){let N,H=m.indexOf(`
10161
+ `,M);H===-1?(N=m.slice(M),M=W):(N=m.slice(M,H+1),M=H+1),N.length&&N!==`
10162
+ `&&(G+=A),G+=N}return G}function we(m,E){return`
10163
+ `+e.repeat(" ",m.indent*E)}function Ye(m,E){for(let A=0,M=m.implicitTypes.length;A<M;A+=1)if(m.implicitTypes[A].resolve(E))return!0;return!1}function Fe(m){return m===l||m===a}function kt(m){return m>=32&&m<=126||m>=161&&m<=55295&&m!==8232&&m!==8233||m>=57344&&m<=65533&&m!==i||m>=65536&&m<=1114111}function jn(m){return kt(m)&&m!==i&&m!==u&&m!==s}function Wt(m,E,A){let M=jn(m),G=M&&!Fe(m);return(A?M:M&&m!==x&&m!==de&&m!==lt&&m!==Oe&&m!==ft)&&m!==f&&!(E===$&&!G)||jn(E)&&!Fe(E)&&m===f||E===$&&G}function ho(m){return kt(m)&&m!==i&&!Fe(m)&&m!==S&&m!==ae&&m!==$&&m!==x&&m!==de&&m!==lt&&m!==Oe&&m!==ft&&m!==f&&m!==k&&m!==b&&m!==p&&m!==_t&&m!==j&&m!==P&&m!==L&&m!==h&&m!==g&&m!==oe&&m!==Ln}function $e(m){return!Fe(m)&&m!==$}function At(m,E){let A=m.charCodeAt(E),M;return A>=55296&&A<=56319&&E+1<m.length&&(M=m.charCodeAt(E+1),M>=56320&&M<=57343)?(A-55296)*1024+M-56320+65536:A}function ar(m){return/^\n* /.test(m)}let Fi=1,mo=2,Gi=3,Bi=4,rn=5;function Wi(m,E,A,M,G,W,N,H){let ee,ne=0,re=null,ce=!1,ue=!1,an=M!==-1,go=-1,yo=ho(At(m,0))&&$e(At(m,m.length-1));if(E||N)for(ee=0;ee<m.length;ne>=65536?ee+=2:ee++){if(ne=At(m,ee),!kt(ne))return rn;yo=yo&&Wt(ne,re,H),re=ne}else{for(ee=0;ee<m.length;ne>=65536?ee+=2:ee++){if(ne=At(m,ee),ne===s)ce=!0,an&&(ue=ue||ee-go-1>M&&m[go+1]!==" ",go=ee);else if(!kt(ne))return rn;yo=yo&&Wt(ne,re,H),re=ne}ue=ue||an&&ee-go-1>M&&m[go+1]!==" "}return!ce&&!ue?yo&&!N&&!G(m)?Fi:W===_e?rn:mo:A>9&&ar(m)?rn:N?W===_e?rn:mo:ue?Bi:Gi}function Ki(m,E,A,M,G){m.dump=(function(){if(E.length===0)return m.quotingType===_e?'""':"''";if(!m.noCompatMode&&(Ee.indexOf(E)!==-1||X.test(E)))return m.quotingType===_e?'"'+E+'"':"'"+E+"'";let W=m.indent*Math.max(1,A),N=m.lineWidth===-1?-1:Math.max(Math.min(m.lineWidth,40),m.lineWidth-W),H=M||m.flowLevel>-1&&A>=m.flowLevel;function ee(ne){return Ye(m,ne)}switch(Wi(E,H,m.indent,N,ee,m.quotingType,m.forceQuotes&&!M,G)){case Fi:return E;case mo:return"'"+E.replace(/'/g,"''")+"'";case Gi:return"|"+Zi(E,m.indent)+Hi(J(E,W));case Bi:return">"+Zi(E,m.indent)+Hi(J(il(E,N),W));case rn:return'"'+on(E)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function Zi(m,E){let A=ar(m)?String(E):"",M=m[m.length-1]===`
10164
+ `,W=M&&(m[m.length-2]===`
10165
10165
  `||m===`
10166
- `)?"+":M?"":"-";return A+B+`
10167
- `}function Wi(m){return m[m.length-1]===`
10168
- `?m.slice(0,-1):m}function Qc(m,E){let A=/(\n+)([^\n]*)/g,M=(function(){let Z=m.indexOf(`
10169
- `);return Z=Z!==-1?Z:m.length,A.lastIndex=Z,Ki(m.slice(0,Z),E)})(),F=m[0]===`
10170
- `||m[0]===" ",B,N;for(;N=A.exec(m);){let Z=N[1],Q=N[2];B=Q[0]===" ",M+=Z+(!F&&!B&&Q!==""?`
10171
- `:"")+Ki(Q,E),F=B}return M}function Ki(m,E){if(m===""||m[0]===" ")return m;let A=/ [^ ]/g,M,F=0,B,N=0,Z=0,Q="";for(;M=A.exec(m);)Z=M.index,Z-F>E&&(B=N>F?N:Z,Q+=`
10172
- `+m.slice(F,B),F=B+1),N=Z;return Q+=`
10173
- `,m.length-F>E&&N>F?Q+=m.slice(F,N)+`
10174
- `+m.slice(N+1):Q+=m.slice(F),Q.slice(1)}function on(m){let E="",A=0;for(let M=0;M<m.length;A>=65536?M+=2:M++){A=At(m,M);let F=se[A];!F&&kt(A)?(E+=m[M],A>=65536&&(E+=m[M+1])):E+=F||ze(A)}return E}function el(m,E,A){let M="",F=m.tag;for(let B=0,N=A.length;B<N;B+=1){let Z=A[B];m.replacer&&(Z=m.replacer.call(A,String(B),Z)),(_(m,E,Z,!1,!1)||typeof Z>"u"&&_(m,E,null,!1,!1))&&(M!==""&&(M+=","+(m.condenseFlow?"":" ")),M+=m.dump)}m.tag=F,m.dump="["+M+"]"}function mo(m,E,A,M){let F="",B=m.tag;for(let N=0,Z=A.length;N<Z;N+=1){let Q=A[N];m.replacer&&(Q=m.replacer.call(A,String(N),Q)),(_(m,E+1,Q,!0,!0,!1,!0)||typeof Q>"u"&&_(m,E+1,null,!0,!0,!1,!0))&&((!M||F!=="")&&(F+=we(m,E)),m.dump&&s===m.dump.charCodeAt(0)?F+="-":F+="- ",F+=m.dump)}m.tag=B,m.dump=F||"[]"}function tl(m,E,A){let M="",F=m.tag,B=Object.keys(A);for(let N=0,Z=B.length;N<Z;N+=1){let Q="";M!==""&&(Q+=", "),m.condenseFlow&&(Q+='"');let ne=B[N],re=A[ne];m.replacer&&(re=m.replacer.call(A,ne,re)),_(m,E,ne,!1,!1)&&(m.dump.length>1024&&(Q+="? "),Q+=m.dump+(m.condenseFlow?'"':"")+":"+(m.condenseFlow?"":" "),_(m,E,re,!1,!1)&&(Q+=m.dump,M+=Q))}m.tag=F,m.dump="{"+M+"}"}function nl(m,E,A,M){let F="",B=m.tag,N=Object.keys(A);if(m.sortKeys===!0)N.sort();else if(typeof m.sortKeys=="function")N.sort(m.sortKeys);else if(m.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Z=0,Q=N.length;Z<Q;Z+=1){let ne="";(!M||F!=="")&&(ne+=we(m,E));let re=N[Z],ce=A[re];if(m.replacer&&(ce=m.replacer.call(A,re,ce)),!_(m,E+1,re,!0,!0,!0))continue;let ue=m.tag!==null&&m.tag!=="?"||m.dump&&m.dump.length>1024;ue&&(m.dump&&s===m.dump.charCodeAt(0)?ne+="?":ne+="? "),ne+=m.dump,ue&&(ne+=we(m,E)),_(m,E+1,ce,!0,ue)&&(m.dump&&s===m.dump.charCodeAt(0)?ne+=":":ne+=": ",ne+=m.dump,F+=ne)}m.tag=B,m.dump=F||"{}"}function d(m,E,A){let M=A?m.explicitTypes:m.implicitTypes;for(let F=0,B=M.length;F<B;F+=1){let N=M[F];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof E=="object"&&E instanceof N.instanceOf)&&(!N.predicate||N.predicate(E))){if(A?N.multi&&N.representName?m.tag=N.representName(E):m.tag=N.tag:m.tag="?",N.represent){let Z=m.styleMap[N.tag]||N.defaultStyle,Q;if(o.call(N.represent)==="[object Function]")Q=N.represent(E,Z);else if(n.call(N.represent,Z))Q=N.represent[Z](E,Z);else throw new t("!<"+N.tag+'> tag resolver accepts not "'+Z+'" style');m.dump=Q}return!0}}return!1}function _(m,E,A,M,F,B,N){m.tag=null,m.dump=A,d(m,A,!1)||d(m,A,!0);let Z=o.call(m.dump),Q=M;M&&(M=m.flowLevel<0||m.flowLevel>E);let ne=Z==="[object Object]"||Z==="[object Array]",re,ce;if(ne&&(re=m.duplicates.indexOf(A),ce=re!==-1),(m.tag!==null&&m.tag!=="?"||ce||m.indent!==2&&E>0)&&(F=!1),ce&&m.usedDuplicates[re])m.dump="*ref_"+re;else{if(ne&&ce&&!m.usedDuplicates[re]&&(m.usedDuplicates[re]=!0),Z==="[object Object]")M&&Object.keys(m.dump).length!==0?(nl(m,E,m.dump,F),ce&&(m.dump="&ref_"+re+m.dump)):(tl(m,E,m.dump),ce&&(m.dump="&ref_"+re+" "+m.dump));else if(Z==="[object Array]")M&&m.dump.length!==0?(m.noArrayIndent&&!N&&E>0?mo(m,E-1,m.dump,F):mo(m,E,m.dump,F),ce&&(m.dump="&ref_"+re+m.dump)):(el(m,E,m.dump),ce&&(m.dump="&ref_"+re+" "+m.dump));else if(Z==="[object String]")m.tag!=="?"&&Gi(m,m.dump,E,B,Q);else{if(Z==="[object Undefined]")return!1;if(m.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Z)}if(m.tag!==null&&m.tag!=="?"){let ue=encodeURI(m.tag[0]==="!"?m.tag.slice(1):m.tag).replace(/!/g,"%21");m.tag[0]==="!"?ue="!"+ue:ue.slice(0,18)==="tag:yaml.org,2002:"?ue="!!"+ue.slice(18):ue="!<"+ue+">",m.dump=ue+" "+m.dump}}return!0}function R(m,E){let A=[],M=[];D(m,A,M);let F=M.length;for(let B=0;B<F;B+=1)E.duplicates.push(A[M[B]]);E.usedDuplicates=new Array(F)}function D(m,E,A){if(m!==null&&typeof m=="object"){let M=E.indexOf(m);if(M!==-1)A.indexOf(M)===-1&&A.push(M);else if(E.push(m),Array.isArray(m))for(let F=0,B=m.length;F<B;F+=1)D(m[F],E,A);else{let F=Object.keys(m);for(let B=0,N=F.length;B<N;B+=1)D(m[F[B]],E,A)}}}function P(m,E){E=E||{};let A=new Ve(E);A.noRefs||R(m,A);let M=m;return A.replacer&&(M=A.replacer.call({"":M},"",M)),_(A,0,M,!0,!0)?A.dump+`
10175
- `:""}return qm.dump=P,qm}function dP(){if(ak)return Ke;ak=1;let e=cP(),t=lP();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 Ke.Type=tt(),Ke.Schema=sk(),Ke.FAILSAFE_SCHEMA=uk(),Ke.JSON_SCHEMA=gk(),Ke.CORE_SCHEMA=yk(),Ke.DEFAULT_SCHEMA=Xm(),Ke.load=e.load,Ke.loadAll=e.loadAll,Ke.dump=t.dump,Ke.YAMLException=ui(),Ke.types={binary:wk(),float:fk(),map:dk(),null:pk(),pairs:kk(),set:xk(),timestamp:vk(),bool:hk(),int:mk(),merge:bk(),omap:_k(),seq:lk(),str:ck()},Ke.safeLoad=r("safeLoad","load"),Ke.safeLoadAll=r("safeLoadAll","loadAll"),Ke.safeDump=r("safeDump","dump"),Ke}var Ke,Fs,$n,D_,Pm,j_,Cm,M_,Om,U_,Nm,z_,Rm,F_,Lm,G_,Dm,B_,jm,W_,Mm,K_,Um,Z_,zm,H_,Fm,V_,Gm,Y_,Bm,J_,Wm,q_,Km,X_,Zm,Q_,Hm,ek,Vm,tk,Ym,nk,Jm,rk,ok,qm,ik,ak,uP,Zr,w2,_2,k2,x2,S2,E2,Sk,$2,T2,A2,I2,P2,C2,O2,Gs=v(()=>{Ke={},Fs={},$n={};qm={};uP=dP(),Zr=aP(uP),{Type:w2,Schema:_2,FAILSAFE_SCHEMA:k2,JSON_SCHEMA:x2,CORE_SCHEMA:S2,DEFAULT_SCHEMA:E2,load:Sk,loadAll:$2,dump:T2,YAMLException:A2,types:I2,safeLoad:P2,safeLoadAll:C2,safeDump:O2}=Zr});function Oe(e){let t;try{t=Zr.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=Sn.safeParse(t);if(!r.success)return{ok:!1,issues:pP(r.error)};let o=N_(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function pP(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function pi(e){return Zr.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Bs(e,t){return Sn.parse({manifest:{schema_version:li,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Ws=v(()=>{"use strict";Gs();En()});var Qm=v(()=>{"use strict";Ws();En();zs()});var Ek=v(()=>{"use strict"});function $k(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:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(o=>({section:o,status:e[o].status}))}}function Tk(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 Ak=v(()=>{"use strict";zs();Ws();En()});var Ae,Ks,Ik=v(()=>{"use strict";Ae={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",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},Ks="/play"});function Zs(e,t){let r=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:r,max_streak:Math.max(e.max_streak,r)}}var Pk,Mt,hP,mP,fP,J2,Ok,gP,yP,q2,vP,X2,Q2,eU,Nk,bP,wP,tU,_P,kP,nU,Ck,rU,oU,ef=v(()=>{"use strict";at();En();js();Ik();Pk="2.0",Mt=c.object({server_time:c.string(),snapshot:c.string()}),hP=c.enum(["at_commit","at_settlement"]),mP=c.enum(["shared","per_player","feed"]),fP=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),J2=Mt.extend({game:c.string(),api_version:c.literal(Pk).default(Pk),archetype:xn,marking:hP,challenge_source:mP,schedule:fP,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([])}),Ok=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),gP=Mt.extend({id:c.string(),number:c.number().int().positive().optional(),origin:si.optional(),version:c.number().int().nonnegative(),can:Ok,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()}),yP=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Ok,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),q2=Mt.extend({rounds:c.array(yP)}),vP=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),X2=Mt.extend({player_id:c.string(),played:c.array(vP)}),Q2=Mt.extend({status:c.enum(["ready","exhausted"]),round:gP.optional()}),eU=Mt.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Nk=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"]})}),bP=c.enum(["accepted","rejected","duplicate","stale","busy"]),wP=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),tU=Mt.extend({play_id:c.string(),outcome:bP,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(wP).default([]),round_state:c.lazy(()=>kP).optional()}),_P=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),kP=Mt.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:_P.optional()}),nU=Mt.extend({player_id:c.string(),display_name: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),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});Ck=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),score:c.number()}),rU=Mt.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(Ck).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:Ck.optional()}),oU=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})})});function Rk(e){return TP[Ge(e)]}function Lk(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:Rk(t)?.[0]}function Dk(e,t){return Rk(e)?.includes(t)??!1}function Hs(e){return tf({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function tf(e){if(Array.isArray(e))return`[${e.map(tf).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)}:${tf(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var xP,SP,EP,$P,nf,dU,TP,jk=v(()=>{"use strict";at();Ht();Wr();xP=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),SP=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),EP=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(),$P=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),nf=c.object({op:c.literal(Br),model:c.literal(bn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(et.aimX.min).max(et.aimX.max),aimY:c.number().int().min(et.aimY.min).max(et.aimY.max),power:c.number().int().min(et.power.min).max(et.power.max)}).strict(),dU=c.union([SP,EP,$P,nf,xP]),TP={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[Br]}});function Uk(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 zk(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 Wk(e,t=Vs){return e.terms?.version===t}function Js(e){let t=Kk.safeParse(e.access);return t.success?t.data:"pending"}function Zk(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 Hk(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 of(e){return BP.includes(e)}function af(e,t){return!e.prodApproval||of(t.tier)?"dev":"prod"}function Yk(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function Jk(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var AP,IP,Mk,PP,CP,OP,rf,NP,RP,Fk,Gk,LP,Vs,Ys,Bk,DP,jP,Kk,vU,bU,MP,UP,zP,wU,_U,kU,xU,SU,FP,EU,Vk,$U,GP,BP,qs=v(()=>{"use strict";at();En();wo();ai();ai();Dt();AP=c.enum(["draft","live","sleeping","throttled","expired","archived"]),IP=c.enum(["scheduled","open","locked","settled"]),Mk=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),PP=c.object({id:c.string(),label:c.string(),state:IP,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),CP=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),OP=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),rf=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),NP=c.enum(["absent","pending","ready","failed"]),RP=c.object({state:NP.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)});Fk=c.object({section:c.string(),status:Sm}),Gk=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(ur),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(OP).default([]),archetype:xn,offersPrize:c.boolean().default(!1),state:AP,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:RP.prefault({}).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),conformance:_n,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(Fk),meters:c.array(Mk),history:c.array(ii),rounds:c.array(PP),destinations:c.array(CP),logs:c.array(rf),updatedAt:c.string()}),LP=c.object({login:c.string(),linkedAt:c.string()}),Vs="2026-09-06",Ys="https://gamestage.ai/terms",Bk="https://gamestage.ai/stage",DP=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});jP=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),Kk=c.enum(["pending","approved","refused"]),vU=c.enum(["manual","automatic"]);bU=c.enum(["approved","refused"]),MP=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});UP=c.object({id:c.string(),name:c.string(),tier:$m,ownerEmail:c.string(),access:Kk.default("pending"),profile:MP.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:LP.nullable().default(null),terms:DP.nullable().default(null),signal:jP.prefault({}),meters:c.array(Mk),games:c.array(Gk)}),zP=Gk.extend({logs:c.array(rf).optional()}),wU=UP.extend({games:c.array(zP),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),_U=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),kU=c.object({id:c.string(),name:c.string(),archetype:xn,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:_n,offersPrize:c.boolean().default(!1),sections:c.array(Fk).default([]),containerLabel:c.string().min(1).optional()}),xU=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),SU=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:_n,offersPrize:c.boolean().default(!1),round:We.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),notes:c.string().max(500).optional()}),FP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:rf.shape.level.nullable().default(null)}),EU=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"]),Vk=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.promoted","game.withdrawn","game.deleted","game.deleted","workspace.plan_changed","workspace.plan_refused","engine.integrity_violation","destination.changed","signal.enabled","signal.disabled"]),$U=c.object({id:c.string(),at:c.string(),action:Vk,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({})}),GP=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:Vk.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)}),BP=["runtime"]});var Ut=v(()=>{"use strict"});function VP(e){return`slate-${e+1}`}function Qk(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:VP(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var ZP,HP,Xk,Tn=v(()=>{"use strict";at();Ut();ZP=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),HP=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(ZP).min(1)}),Xk=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(HP).min(1)})});var MU,Xs=v(()=>{"use strict";at();Dt();Tn();Ut();MU=c.discriminatedUnion("archetype",[Xk,km,xm,Us])});var Qs=v(()=>{"use strict";Dt();Ut();Wr()});var ec=v(()=>{"use strict"});var sf=v(()=>{"use strict";Ht();Tn();Xs();Qs();ec();Ut()});import{createHash as YP}from"node:crypto";function qP(e){return YP("sha256").update(e).digest("hex").slice(0,16)}function tc(e){return qP(e)}var JP,An,Qn=v(()=>{"use strict";at();Ut();Dt();JP=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative())}),An=c.object({corpus:c.literal("1"),measures:c.array(JP).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 XP,tx,QP,pz,nx,hz,mz,fz,cf=v(()=>{"use strict";at();XP=c.enum(["push","pull"]),tx=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({}),bytes:c.number().int().nonnegative().default(0),origin:XP.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)}),QP=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([])}),pz=c.object({dataset:tx,usedBy:c.array(QP).default([])}),nx=c.enum(["pushed","pulled","joined","refused","failed"]),hz=c.object({at:c.string(),event:nx,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)}),mz=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(nx).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),fz=c.object({datasets:c.array(tx).default([]),unavailable:c.string().nullable().default(null)})});var lf=v(()=>{"use strict";Ut();Dt()});var df=v(()=>{"use strict";Tn();Ut()});var uf=v(()=>{"use strict";Qn();Tn();df();Qs();Ut();Tn();Dt();Ht();ec();Xs()});function bf(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)?!0:t==="analyticsUrl"}function nc(e){return pf.filter(t=>bf(e,vf[t.key])).map(t=>t.key)}var pf,hf,rx,mf,tC,ff,nC,ox,ix,rC,oC,ax,iC,aC,gf,yf,vf,wf=v(()=>{"use strict";pf=[{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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own words.`,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}. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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!". Leave it empty to keep the game's own words.`,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". Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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}." Leave it empty to keep the game's own words.`,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}." Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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?" Leave it empty 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?" Leave it empty 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. Leave it empty to keep the game's own words.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}],hf=pf.map(e=>e.key),rx=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",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. Leave it empty 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:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...pf,{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}],mf=[{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"}],tC=[{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"}],ff=[{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"}],nC=[{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"}]}]}],ox="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",ix={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"}]},rC=[{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"},ix,{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". ${ox}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],oC=[{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"},ix,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${ox}`,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"}]}],ax=[{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"}],iC=[{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}],aC=[{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"}],gf={hunt:rC,push:nC,group:oC,predict:[],bingo:iC,shoot:aC},yf={hunt:[],push:[],group:[],predict:[],bingo:tC,shoot:[]},vf={display_name:"displayName",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"}});function lC(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function _f(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function dC(e){let t=e.archetypes.map(Ge);for(let i of t)if(!sx[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??hf),n=rx.filter(i=>!hf.includes(i.key)||o.has(i.key));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:sx[i],content_type:cx(i),derived_from:rc[i]?.derivedFrom??"data",duration:rc[i]?.duration??{mode:"instant"},label:rc[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:_f([...ff,...gf[Ge(i)]??[]]),...rc[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":lC([...n,...mf,...ff,...Object.values(gf).flat(),...Object.values(yf).flat(),...ax]).map(cC),"project_settings.json":{sections:_f(n)},"event_settings.json":{sections:_f([...mf,...t.flatMap(i=>yf[i]??[])])}}}function lx(e){return dC({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var sx,cx,rc,sC,cC,kf=v(()=>{"use strict";wf();Ht();sx=_y,cx=e=>{let t=Ge(e);return il[t]??`gamestage-${t.replaceAll("_","-")}-element`},rc={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{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}}},sC=new Set(["freetext","wysiwyg","image","file"]),cC=e=>({key:e.key,type:e.type,...sC.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}})});var xf=v(()=>{"use strict";Ht()});var dx=v(()=>{"use strict";wo();qs();sf();Qn();cf();lf();uf();kf();xf();Qm();ef();Dt()});function pC(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function hx(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let u=globalThis.location?.origin,l=new URL(`${o}${a}`,o.startsWith("/")?u:void 0);for(let[h,f]of Object.entries(s.query??{}))f!=null&&l.searchParams.set(h,String(f));let p;for(let h=1;h<=r;h++){let f=typeof e.token=="function"?await e.token():e.token,g=await t(l,{method:i,headers:{authorization:`Bearer ${f}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)});if(g.ok)return await g.json();let k=await g.json().catch(()=>({}));if(p=new yt(g.status,k.error?.code??"unknown",k.error?.message??g.statusText,k.error?.retryable??!1),!p.retryable||h===r)break;let L=Number(g.headers.get("retry-after"));await uC(Number.isFinite(L)&&L>0?L*1e3:pC(h))}throw p??new yt(0,"unknown","Request failed.",!1)}}function mx(e){let t=hx(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(Zk);return Hk(o)},setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function Hr(e){let t=hx(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let u of r)Array.isArray(s[u])||(s[u]=[]);return s},n=a=>({...a,access:Js(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:Js(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 yt)||a.status!==404)throw a;return ux||(ux=!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 yt&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,u)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:u}}),registerGame:a=>t("POST","/v1/games",{body:a}),archiveGame:a=>t("POST",`/v1/games/${encodeURIComponent(a)}/archive`),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(u){throw u instanceof yt&&u.status===404&&!/no such game/i.test(u.message)?new yt(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):u}},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 yt&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:u}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return u},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:px}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof yt&&a.status===404)return{datasets:[],unavailable:px};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 yt&&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 yt&&s.status===404)return[];throw s}}}}var yt,uC,ux,px,fx=v(()=>{"use strict";qs();yt=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"}},uC=e=>new Promise(t=>setTimeout(t,e)),ux=!1;px="This control plane is running a build older than this screen, so it cannot list datasets yet."});function hC(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 gx(e,t){let r=hC(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var yx=v(()=>{"use strict"});var vx=v(()=>{"use strict";Tn()});var mC,fC,gC,V4,Sf=v(()=>{"use strict";at();mC=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")})]),fC=c.enum(["licensed","unofficial","creator"]),gC=c.enum(["ours","creator"]),V4=c.object({id:c.string().min(1),label:c.string().min(1),standing:fC,origin:gC,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),audience:mC.optional()})});var bx=v(()=>{"use strict";Sf()});var wx=v(()=>{"use strict";Qn()});var _x=v(()=>{"use strict";Qn()});function yC(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=An.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:tc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function kx(e,t){let r=yC(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var xx=v(()=>{"use strict";Qn()});var Sx=v(()=>{"use strict"});var Ex=v(()=>{"use strict"});function Ef(e){return e.sourceIp?.trim()||"unknown"}function $f(e,t){return`${e.length}:${e}${t}`}var vC,$x,Tx,Ax,Ix,s6,c6,l6,Px=v(()=>{"use strict";vC=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},$x=e=>typeof process>"u"?void 0:vC(process.env?.[e]),Tx=(e,t,r)=>({burst:$x(t)??e.burst,perMinute:$x(r)??e.perMinute}),Ax={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},Ix={player:Tx(Ax.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Tx(Ax.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},s6=Ix.player,c6=Ix.publicRoutes,l6=600*1e3});var Cx=v(()=>{"use strict"});var ke=v(()=>{"use strict";wo();Ht();En();wm();zs();Qm();Ek();Ws();Ak();js();ef();jk();ai();Dt();qs();dx();fx();wf();Ut();lf();yx();Tn();Xs();df();Qs();Wr();vx();Qn();bx();Sf();wx();_x();xx();cf();ec();uf();Sx();kf();sf();Ex();xf();Px();Cx()});import{spawn as jx}from"node:child_process";import{chmod as Ox,mkdir as Nx,readFile as Rx,rm as Lx,writeFile as Dx}from"node:fs/promises";import{homedir as bC,platform as Vr}from"node:os";import{dirname as wC,join as Mx}from"node:path";async function Ux(){let e=await fetch(`${Tf}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Af})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function zx(e){let t=await fetch(`${Tf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Af,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 Fx(e){let t=Vr()==="darwin"?"open":Vr()==="win32"?"cmd":"xdg-open",r=Vr()==="win32"?["/c","start","",e]:[e];try{jx(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function If(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function Pf(e,t){return new Promise(r=>{let o=jx("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 Cf(e){let t=JSON.stringify(e),r=If();return r?(await Nx(wC(r),{recursive:!0,mode:448}),await Dx(r,t,{mode:384}),await Ox(r,384),"file"):Vr()==="darwin"&&await Pf(["add-generic-password","-a",Yr,"-s",Yr,"-U","-w",t])!==null?"keychain":(await Nx(Gx,{recursive:!0,mode:448}),await Dx(oc,t,{mode:384}),await Ox(oc,384),"file")}function _C(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 kC(e){if(!e.refreshToken)return null;let t=await fetch(`${Tf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Af,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 xC(){let e=If();if(e)try{return JSON.parse(await Rx(e,"utf8"))}catch{return null}if(Vr()==="darwin"){let t=await Pf(["find-generic-password","-a",Yr,"-s",Yr,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await Rx(oc,"utf8"))}catch{return null}}async function Bx(){let e=If();if(e){await Lx(e,{force:!0});return}Vr()==="darwin"&&await Pf(["delete-generic-password","-a",Yr,"-s",Yr]),await Lx(oc,{force:!0})}async function Ue(){let e=await xC();if(!e)return null;if(!_C(e.accessToken)||!e.refreshToken)return e;let t=await kC(e);return t?(await Cf(t),t):null}var Tf,Af,Yr,Gx,oc,er=v(()=>{"use strict";Tf="https://api.workos.com",Af=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";Yr="gamestage-cli",Gx=Mx(bC(),".gamestage"),oc=Mx(Gx,"credentials.json")});function Kx(e){return`${qt}/stage/games/${encodeURIComponent(e)}?tab=overview`}function Zx(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${qt}/docs/game-formats#${e}`:`${qt}/docs`}var qt,Of=v(()=>{"use strict";qt=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function $C(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function TC(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function AC(e=Ze,t=process.env){if(TC(t)&&!$C(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 Jr(e=Ze){let t=AC(e);t&&V(t)}async function mi(){let e=await Ue();return e||V("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 Ie(){let e=await mi();return{client:Hr({baseUrl:Ze,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Hx(){let e=await Ue();return e||V("You are not signed in.",["Run `gamestage login`. Approving a creator needs an operator's own session."]),{admin:mx({baseUrl:Ze,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function ac(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===Nf?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${Ze}.`,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 ${Ze}.`,"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 ${Ze}.`,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:Nf,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: ${qt}.`]};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 Vx(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 qr(e){if(H(e.heading),y(` ${e.message}`),e.next.length){y();for(let t of e.next)O(t)}y()}function Ne(e){let t=[],r=e.status,o=e.code;if(o===Nf){let n=fi({access:"pending"});X()?te({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):qr(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: ${Ze}`),V(e instanceof Error?e.message:"The control plane call failed.",t)}var Ze,Nf,$t=v(()=>{"use strict";ke();er();Pe();Of();Ze=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";Nf="access_pending"});import{open as NC,readFile as Qx}from"node:fs/promises";import{createHash as RC}from"node:crypto";import{gunzipSync as LC}from"node:zlib";function MC(e){for(let{pattern:t,what:r}of jC)if(t.test(e))return r}function Df(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||DC.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function tS(e,t){let r;try{r=await NC(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(`
10176
- `),a])}catch{return}finally{await r.close()}}async function zC(e){return(await tS(e,eS))?.toString("latin1")}async function vi(e){let t=await tS(e,eS);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await Qx(e);t=LC(s,{maxOutputLength:UC})}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 FC(e){let t=Oe(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function Xr(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(`
10166
+ `)?"+":M?"":"-";return A+W+`
10167
+ `}function Hi(m){return m[m.length-1]===`
10168
+ `?m.slice(0,-1):m}function il(m,E){let A=/(\n+)([^\n]*)/g,M=(function(){let H=m.indexOf(`
10169
+ `);return H=H!==-1?H:m.length,A.lastIndex=H,Vi(m.slice(0,H),E)})(),G=m[0]===`
10170
+ `||m[0]===" ",W,N;for(;N=A.exec(m);){let H=N[1],ee=N[2];W=ee[0]===" ",M+=H+(!G&&!W&&ee!==""?`
10171
+ `:"")+Vi(ee,E),G=W}return M}function Vi(m,E){if(m===""||m[0]===" ")return m;let A=/ [^ ]/g,M,G=0,W,N=0,H=0,ee="";for(;M=A.exec(m);)H=M.index,H-G>E&&(W=N>G?N:H,ee+=`
10172
+ `+m.slice(G,W),G=W+1),N=H;return ee+=`
10173
+ `,m.length-G>E&&N>G?ee+=m.slice(G,N)+`
10174
+ `+m.slice(N+1):ee+=m.slice(G),ee.slice(1)}function on(m){let E="",A=0;for(let M=0;M<m.length;A>=65536?M+=2:M++){A=At(m,M);let G=se[A];!G&&kt(A)?(E+=m[M],A>=65536&&(E+=m[M+1])):E+=G||ze(A)}return E}function al(m,E,A){let M="",G=m.tag;for(let W=0,N=A.length;W<N;W+=1){let H=A[W];m.replacer&&(H=m.replacer.call(A,String(W),H)),(_(m,E,H,!1,!1)||typeof H>"u"&&_(m,E,null,!1,!1))&&(M!==""&&(M+=","+(m.condenseFlow?"":" ")),M+=m.dump)}m.tag=G,m.dump="["+M+"]"}function fo(m,E,A,M){let G="",W=m.tag;for(let N=0,H=A.length;N<H;N+=1){let ee=A[N];m.replacer&&(ee=m.replacer.call(A,String(N),ee)),(_(m,E+1,ee,!0,!0,!1,!0)||typeof ee>"u"&&_(m,E+1,null,!0,!0,!1,!0))&&((!M||G!=="")&&(G+=we(m,E)),m.dump&&s===m.dump.charCodeAt(0)?G+="-":G+="- ",G+=m.dump)}m.tag=W,m.dump=G||"[]"}function sl(m,E,A){let M="",G=m.tag,W=Object.keys(A);for(let N=0,H=W.length;N<H;N+=1){let ee="";M!==""&&(ee+=", "),m.condenseFlow&&(ee+='"');let ne=W[N],re=A[ne];m.replacer&&(re=m.replacer.call(A,ne,re)),_(m,E,ne,!1,!1)&&(m.dump.length>1024&&(ee+="? "),ee+=m.dump+(m.condenseFlow?'"':"")+":"+(m.condenseFlow?"":" "),_(m,E,re,!1,!1)&&(ee+=m.dump,M+=ee))}m.tag=G,m.dump="{"+M+"}"}function cl(m,E,A,M){let G="",W=m.tag,N=Object.keys(A);if(m.sortKeys===!0)N.sort();else if(typeof m.sortKeys=="function")N.sort(m.sortKeys);else if(m.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let H=0,ee=N.length;H<ee;H+=1){let ne="";(!M||G!=="")&&(ne+=we(m,E));let re=N[H],ce=A[re];if(m.replacer&&(ce=m.replacer.call(A,re,ce)),!_(m,E+1,re,!0,!0,!0))continue;let ue=m.tag!==null&&m.tag!=="?"||m.dump&&m.dump.length>1024;ue&&(m.dump&&s===m.dump.charCodeAt(0)?ne+="?":ne+="? "),ne+=m.dump,ue&&(ne+=we(m,E)),_(m,E+1,ce,!0,ue)&&(m.dump&&s===m.dump.charCodeAt(0)?ne+=":":ne+=": ",ne+=m.dump,G+=ne)}m.tag=W,m.dump=G||"{}"}function d(m,E,A){let M=A?m.explicitTypes:m.implicitTypes;for(let G=0,W=M.length;G<W;G+=1){let N=M[G];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof E=="object"&&E instanceof N.instanceOf)&&(!N.predicate||N.predicate(E))){if(A?N.multi&&N.representName?m.tag=N.representName(E):m.tag=N.tag:m.tag="?",N.represent){let H=m.styleMap[N.tag]||N.defaultStyle,ee;if(o.call(N.represent)==="[object Function]")ee=N.represent(E,H);else if(n.call(N.represent,H))ee=N.represent[H](E,H);else throw new t("!<"+N.tag+'> tag resolver accepts not "'+H+'" style');m.dump=ee}return!0}}return!1}function _(m,E,A,M,G,W,N){m.tag=null,m.dump=A,d(m,A,!1)||d(m,A,!0);let H=o.call(m.dump),ee=M;M&&(M=m.flowLevel<0||m.flowLevel>E);let ne=H==="[object Object]"||H==="[object Array]",re,ce;if(ne&&(re=m.duplicates.indexOf(A),ce=re!==-1),(m.tag!==null&&m.tag!=="?"||ce||m.indent!==2&&E>0)&&(G=!1),ce&&m.usedDuplicates[re])m.dump="*ref_"+re;else{if(ne&&ce&&!m.usedDuplicates[re]&&(m.usedDuplicates[re]=!0),H==="[object Object]")M&&Object.keys(m.dump).length!==0?(cl(m,E,m.dump,G),ce&&(m.dump="&ref_"+re+m.dump)):(sl(m,E,m.dump),ce&&(m.dump="&ref_"+re+" "+m.dump));else if(H==="[object Array]")M&&m.dump.length!==0?(m.noArrayIndent&&!N&&E>0?fo(m,E-1,m.dump,G):fo(m,E,m.dump,G),ce&&(m.dump="&ref_"+re+m.dump)):(al(m,E,m.dump),ce&&(m.dump="&ref_"+re+" "+m.dump));else if(H==="[object String]")m.tag!=="?"&&Ki(m,m.dump,E,W,ee);else{if(H==="[object Undefined]")return!1;if(m.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+H)}if(m.tag!==null&&m.tag!=="?"){let ue=encodeURI(m.tag[0]==="!"?m.tag.slice(1):m.tag).replace(/!/g,"%21");m.tag[0]==="!"?ue="!"+ue:ue.slice(0,18)==="tag:yaml.org,2002:"?ue="!!"+ue.slice(18):ue="!<"+ue+">",m.dump=ue+" "+m.dump}}return!0}function R(m,E){let A=[],M=[];D(m,A,M);let G=M.length;for(let W=0;W<G;W+=1)E.duplicates.push(A[M[W]]);E.usedDuplicates=new Array(G)}function D(m,E,A){if(m!==null&&typeof m=="object"){let M=E.indexOf(m);if(M!==-1)A.indexOf(M)===-1&&A.push(M);else if(E.push(m),Array.isArray(m))for(let G=0,W=m.length;G<W;G+=1)D(m[G],E,A);else{let G=Object.keys(m);for(let W=0,N=G.length;W<N;W+=1)D(m[G[W]],E,A)}}}function C(m,E){E=E||{};let A=new Ve(E);A.noRefs||R(m,A);let M=m;return A.replacer&&(M=A.replacer.call({"":M},"",M)),_(A,0,M,!0,!0)?A.dump+`
10175
+ `:""}return of.dump=C,of}function AP(){if(fk)return Ke;fk=1;let e=$P(),t=TP();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 Ke.Type=tt(),Ke.Schema=gk(),Ke.FAILSAFE_SCHEMA=wk(),Ke.JSON_SCHEMA=Ek(),Ke.CORE_SCHEMA=$k(),Ke.DEFAULT_SCHEMA=af(),Ke.load=e.load,Ke.loadAll=e.loadAll,Ke.dump=t.dump,Ke.YAMLException=pi(),Ke.types={binary:Ik(),float:Sk(),map:bk(),null:_k(),pairs:Ck(),set:Ok(),timestamp:Tk(),bool:kk(),int:xk(),merge:Ak(),omap:Pk(),seq:vk(),str:yk()},Ke.safeLoad=r("safeLoad","load"),Ke.safeLoadAll=r("safeLoadAll","loadAll"),Ke.safeDump=r("safeDump","dump"),Ke}var Ke,Ws,$n,K_,jm,Z_,Mm,H_,Um,V_,zm,Y_,Fm,J_,Gm,q_,Bm,X_,Wm,Q_,Km,ek,Zm,tk,Hm,nk,Vm,rk,Ym,ok,Jm,ik,qm,ak,Xm,sk,Qm,ck,ef,lk,tf,dk,nf,uk,rf,pk,hk,of,mk,fk,IP,Zr,U2,z2,F2,G2,B2,W2,Nk,K2,Z2,H2,V2,Y2,J2,q2,Ks=v(()=>{Ke={},Ws={},$n={};of={};IP=AP(),Zr=SP(IP),{Type:U2,Schema:z2,FAILSAFE_SCHEMA:F2,JSON_SCHEMA:G2,CORE_SCHEMA:B2,DEFAULT_SCHEMA:W2,load:Nk,loadAll:K2,dump:Z2,YAMLException:H2,types:V2,safeLoad:Y2,safeLoadAll:J2,safeDump:q2}=Zr});function Ne(e){let t;try{t=Zr.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=Sn.safeParse(t);if(!r.success)return{ok:!1,issues:PP(r.error)};let o=G_(r.data);return o.length?{ok:!1,issues:o}:{ok:!0,manifest:r.data}}function PP(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function hi(e){return Zr.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Zs(e,t){return Sn.parse({manifest:{schema_version:di,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var Hs=v(()=>{"use strict";Ks();En()});var sf=v(()=>{"use strict";Hs();En();Bs()});var Rk=v(()=>{"use strict"});function Lk(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:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(o=>({section:o,status:e[o].status}))}}function Dk(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 jk=v(()=>{"use strict";Bs();Hs();En()});var Ie,Vs,Mk=v(()=>{"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",roundState:"/play/v1/games/{game}/rounds/{round}/players/me",profile:"/play/v1/games/{game}/players/me/profile",leaderboard:"/play/v1/games/{game}/leaderboard"},Vs="/play"});function Ys(e,t){let r=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:r,max_streak:Math.max(e.max_streak,r)}}var Uk,Mt,CP,OP,NP,fU,Fk,RP,LP,gU,DP,yU,vU,bU,Gk,jP,MP,wU,UP,zP,_U,zk,kU,xU,cf=v(()=>{"use strict";at();En();zs();Mk();Uk="2.0",Mt=c.object({server_time:c.string(),snapshot:c.string()}),CP=c.enum(["at_commit","at_settlement"]),OP=c.enum(["shared","per_player","feed"]),NP=c.object({kind:c.enum(["fixed","local_midnight","feed","continuous"]),timezone:c.string().optional()}),fU=Mt.extend({game:c.string(),api_version:c.literal(Uk).default(Uk),archetype:xn,marking:CP,challenge_source:OP,schedule:NP,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([])}),Fk=c.object({accepting_plays:c.boolean(),results_available:c.boolean(),solution_revealed:c.boolean(),closed:c.boolean(),optimistic_play:c.boolean().default(!1)}),RP=Mt.extend({id:c.string(),number:c.number().int().positive().optional(),origin:ci.optional(),version:c.number().int().nonnegative(),can:Fk,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()}),LP=c.object({id:c.string(),number:c.number().int().positive().optional(),version:c.number().int().nonnegative(),can:Fk,opens_at:c.string().optional(),locks_at:c.string().optional(),current:c.boolean().default(!1),theme:c.string().default("")}),gU=Mt.extend({rounds:c.array(LP)}),DP=c.object({round_id:c.string(),finished:c.boolean(),score:c.number(),outcome:c.enum(["won","lost","partial","incomplete","pending"]).optional()}),yU=Mt.extend({player_id:c.string(),played:c.array(DP)}),vU=Mt.extend({status:c.enum(["ready","exhausted"]),round:RP.optional()}),bU=Mt.extend({token:c.string(),player_id:c.string(),kind:c.literal("anonymous")}),Gk=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"]})}),jP=c.enum(["accepted","rejected","duplicate","stale","busy"]),MP=c.object({key:c.string(),verdict:c.enum(["correct","close","wrong","higher","lower","unknown"]),label:c.string().optional()}),wU=Mt.extend({play_id:c.string(),outcome:jP,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(MP).default([]),round_state:c.lazy(()=>zP).optional()}),UP=c.object({title:c.string(),grid:c.array(c.string()).default([]),text:c.string().optional()}),zP=Mt.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:UP.optional()}),_U=Mt.extend({player_id:c.string(),display_name: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),distribution:c.record(c.string(),c.number()).default({}),constraints:c.record(c.string(),c.unknown()).default({})});zk=c.object({rank:c.number().int().positive(),player_id:c.string(),display_name:c.string().optional(),score:c.number()}),kU=Mt.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(zk).default([]),total:c.number().int().nonnegative().default(0),truncated:c.boolean().default(!1),me:zk.optional()}),xU=c.object({error:c.object({code:c.string(),message:c.string(),retryable:c.boolean()})})});function Bk(e){return KP[Ge(e)]}function Wk(e,t){let r=e.op;return typeof r=="string"&&r.length>0?r:Bk(t)?.[0]}function Kk(e,t){return Bk(e)?.includes(t)??!1}function Js(e){return lf({round_id:e.round_id,round_version:e.round_version,challenge_instance_id:e.challenge_instance_id??null,payload:e.payload})}function lf(e){if(Array.isArray(e))return`[${e.map(lf).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)}:${lf(t[o])}`).join(",")}}`}return JSON.stringify(e)??"null"}var FP,GP,BP,WP,df,IU,KP,Zk=v(()=>{"use strict";at();Ht();Wr();FP=c.object({op:c.string().min(1),model:c.string().min(1).optional()}).passthrough(),GP=c.object({op:c.literal("pick"),picks:c.array(c.string())}).passthrough(),BP=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(),WP=c.object({op:c.enum(["deal","reshuffle","lock"]),centre:c.unknown().optional(),board:c.number().int().nonnegative().optional()}).passthrough(),df=c.object({op:c.literal(Br),model:c.literal(bn).optional(),shotIndex:c.number().int().nonnegative(),aimX:c.number().int().min(et.aimX.min).max(et.aimX.max),aimY:c.number().int().min(et.aimY.min).max(et.aimY.max),power:c.number().int().min(et.power.min).max(et.power.max)}).strict(),IU=c.union([GP,BP,WP,df,FP]),KP={hunt:["pick"],push:["pick"],group:["pick"],predict:["answer"],bingo:["deal","reshuffle","lock"],shoot:[Br]}});function Vk(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 Yk(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 Qk(e,t=qs){return e.terms?.version===t}function Qs(e){let t=ex.safeParse(e.access);return t.success?t.data:"pending"}function tx(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 nx(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 pf(e){return cC.includes(e)}function hf(e,t){return!e.prodApproval||pf(t.tier)?"dev":"prod"}function ox(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function ix(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var ZP,HP,Hk,VP,YP,JP,uf,qP,XP,Jk,QP,jU,qk,eC,qs,Xs,Xk,tC,nC,ex,MU,UU,rC,oC,iC,zU,FU,GU,BU,WU,aC,KU,rx,ZU,sC,cC,ec=v(()=>{"use strict";at();En();_o();si();si();Dt();ZP=c.enum(["draft","live","sleeping","throttled","expired","archived"]),HP=c.enum(["scheduled","open","locked","settled"]),Hk=c.object({id:c.string(),label:c.string(),used:c.number(),limit:c.number(),unit:c.string()}),VP=c.object({id:c.string(),label:c.string(),state:HP,opensAt:c.string(),locksAt:c.string(),settledAt:c.string().nullable(),plays:c.number()}),YP=c.object({id:c.string(),name:c.string(),enabled:c.boolean(),consentRequired:c.boolean(),note:c.string()}),JP=c.object({number:c.number().int().positive(),title:c.string(),openedAt:c.string(),labels:c.array(c.string()).default([]),fromGame:c.boolean().default(!1)}),uf=c.object({at:c.string(),level:c.enum(["info","warn","error"]),roundId:c.string().nullable(),message:c.string(),dataset:c.string().optional()}),qP=c.enum(["absent","pending","ready","failed"]),XP=c.object({state:qP.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)});Jk=c.object({section:c.string(),status:Cm}),QP=c.object({instanceId:c.string(),embedSlug:c.string(),template:c.string(),type:c.enum(["leaderboard","qr"]),createdAt:c.string(),consentBy:c.string()}),jU=c.object({template:c.string().min(1),consent:c.literal(!0)}),qk=c.object({id:c.string(),name:c.string(),containerLabel:c.string().min(1).default(ur),repository:c.string().nullable(),openIssues:c.number().int().nonnegative(),issues:c.array(JP).default([]),archetype:xn,offersPrize:c.boolean().default(!1),state:ZP,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:XP.prefault({}).optional(),graphics:c.array(QP).optional(),playgroundUrl:c.string().nullable(),playerEndpoint:c.string().nullable(),manifestRevision:c.string(),manifestSource:c.string().optional(),conformance:_n,contentHash:c.string(),referenceDigest:c.string().optional(),referenceName:c.string().optional(),monthlyPlayers:c.number().int().nonnegative().optional(),sections:c.array(Jk),meters:c.array(Hk),history:c.array(ai),rounds:c.array(VP),destinations:c.array(YP),logs:c.array(uf),updatedAt:c.string()}),eC=c.object({login:c.string(),linkedAt:c.string()}),qs="2026-09-06",Xs="https://gamestage.ai/terms",Xk="https://gamestage.ai/stage",tC=c.object({version:c.string(),acceptedAt:c.string(),by:c.string()});nC=c.object({enabled:c.boolean().default(!1),applicationId:c.string().nullable().default(null),writeKey:c.string().nullable().default(null)}),ex=c.enum(["pending","approved","refused"]),MU=c.enum(["manual","automatic"]);UU=c.enum(["approved","refused"]),rC=c.object({company:c.string().trim().max(120).nullish(),role:c.string().trim().max(120).nullish(),intent:c.string().trim().max(500).nullish()});oC=c.object({id:c.string(),name:c.string(),tier:Nm,ownerEmail:c.string(),access:ex.default("pending"),profile:rC.optional(),platformSpace:c.string().optional(),liveGameAllowance:c.number(),supplierGrants:c.array(c.string()).default([]),github:eC.nullable().default(null),terms:tC.nullable().default(null),signal:nC.prefault({}),meters:c.array(Hk),games:c.array(qk)}),iC=qk.extend({logs:c.array(uf).optional()}),zU=oC.extend({games:c.array(iC),gamesTotal:c.number().int().nonnegative(),archivedTotal:c.number().int().nonnegative().default(0)}),FU=c.object({player:c.string().nullable(),control:c.string().nullable(),playground:c.string().nullable()}),GU=c.object({id:c.string(),name:c.string(),archetype:xn,repository:c.string().nullable().default(null),manifestRevision:c.string(),contentHash:c.string(),conformance:_n,offersPrize:c.boolean().default(!1),sections:c.array(Jk).default([]),containerLabel:c.string().min(1).optional()}),BU=c.object({uploadUrl:c.string(),publicUrl:c.string(),key:c.string(),expiresInSeconds:c.number().int().positive(),cacheControl:c.string().optional(),playerApiOrigin:c.string()}),WU=c.object({manifestRevision:c.string(),contentHash:c.string(),conformance:_n,offersPrize:c.boolean().default(!1),round:We.optional(),wording:c.array(c.string()).optional(),manifestSource:c.string().optional(),notes:c.string().max(500).optional()}),aC=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),since:c.string().nullable().default(null),level:uf.shape.level.nullable().default(null)}),KU=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"]),rx=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"]),ZU=c.object({id:c.string(),at:c.string(),action:rx,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({})}),sC=c.object({limit:c.coerce.number().int().positive().max(1e3).default(100),action:rx.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)}),cC=["runtime"]});var Ut=v(()=>{"use strict"});function hC(e){return`slate-${e+1}`}function cx(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:hC(r),label:t.label??"",entries:t.entries.map(o=>({key:o.key,label:o.label??""}))}))}}var uC,pC,sx,Tn=v(()=>{"use strict";at();Ut();uC=c.object({key:c.string().min(1),label:c.string().default(""),note:c.string().optional()}),pC=c.object({id:c.string().min(1),label:c.string().default(""),entries:c.array(uC).min(1)}),sx=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(pC).min(1)})});var oz,tc=v(()=>{"use strict";at();Dt();Tn();Ut();oz=c.discriminatedUnion("archetype",[sx,Im,Pm,Gs])});var nc=v(()=>{"use strict";Dt();Ut();Wr()});var rc=v(()=>{"use strict"});var mf=v(()=>{"use strict";Ht();Tn();tc();nc();rc();Ut()});import{createHash as mC}from"node:crypto";function gC(e){return mC("sha256").update(e).digest("hex").slice(0,16)}function oc(e){return gC(e)}var fC,An,Qn=v(()=>{"use strict";at();Ut();Dt();fC=c.object({key:c.string().min(1),label:c.string().default(""),values:c.record(c.string(),c.number().int().nonnegative())}),An=c.object({corpus:c.literal("1"),measures:c.array(fC).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 yC,dx,vC,Oz,ux,Nz,Rz,Lz,ff=v(()=>{"use strict";at();yC=c.enum(["push","pull"]),dx=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({}),bytes:c.number().int().nonnegative().default(0),origin:yC.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)}),vC=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([])}),Oz=c.object({dataset:dx,usedBy:c.array(vC).default([])}),ux=c.enum(["pushed","pulled","joined","refused","failed"]),Nz=c.object({at:c.string(),event:ux,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)}),Rz=c.object({dataset:c.string().optional(),gameId:c.string().optional(),event:c.array(ux).optional(),since:c.string().optional(),search:c.string().optional(),before:c.string().optional(),limit:c.number().int().positive().max(500).default(100)}),Lz=c.object({datasets:c.array(dx).default([]),unavailable:c.string().nullable().default(null)})});var gf=v(()=>{"use strict";Ut();Dt()});var yf=v(()=>{"use strict";Tn();Ut()});var vf=v(()=>{"use strict";Qn();Tn();yf();nc();Ut();Tn();Dt();Ht();rc();tc()});function $f(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)?!0:t==="analyticsUrl"}function ic(e){return bf.filter(t=>$f(e,Ef[t.key])).map(t=>t.key)}var bf,wf,px,_f,wC,kf,_C,hx,mx,kC,xC,fx,SC,EC,xf,Sf,Ef,Tf=v(()=>{"use strict";bf=[{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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own word.",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. Leave it empty to keep the game's own words.`,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}. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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!". Leave it empty to keep the game's own words.`,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". Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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}." Leave it empty to keep the game's own words.`,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}." Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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. Leave it empty to keep the game's own words.`,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?" Leave it empty 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?" Leave it empty 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. Leave it empty to keep the game's own words.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"}],wf=bf.map(e=>e.key),px=[{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Leave it empty to use the name the game was deployed with.",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. Leave it empty 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:"The colour of the button a fan presses. Everything else stays as the game was built.",readBy:"The game's own page, as the --gamestage-primary custom property.",section:"Brand"},{key:"play_button_label",label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Leave it empty to keep the game's own word.",readBy:"The game's own page, on its submit button.",section:"Wording"},...bf,{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}],_f=[{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"}],wC=[{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"}],kf=[{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"}],_C=[{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"}]}]}],hx="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",mx={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"}]},kC=[{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"},mx,{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". ${hx}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1}],xC=[{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"},mx,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${hx}`,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"}]}],fx=[{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"}],SC=[{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}],EC=[{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"}],xf={hunt:kC,push:_C,group:xC,predict:[],bingo:SC,shoot:EC},Sf={hunt:[],push:[],group:[],predict:[],bingo:wC,shoot:[]},Ef={display_name:"displayName",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"}});function AC(e){let t=new Map,r=o=>{for(let n of o){let i=t.get(n.key);if(i){if(i.type!==n.type)throw new Error(`The field "${n.key}" is declared as both ${i.type} and ${n.type}. One key is one declaration; a level's own label and description travel on its field set entry, its type does not.`)}else t.set(n.key,n);r(n.fieldset??[])}};return r(e),[...t.values()]}function Af(e){let t=[];for(let r of e){let o=r.public===!1,n={label:r.label,key:r.key,description:r.description,...r.type==="collection"?{}:{mandatory:!1},...o?{public:!1,cloneable:!1}:{}},i=t.find(a=>a.name===r.section);i?i.properties.push(n):t.push({name:r.section,properties:[n]})}return t}function IC(e){let t=e.archetypes.map(Ge);for(let i of t)if(!gx[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??wf),n=px.filter(i=>!wf.includes(i.key)||o.has(i.key));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:gx[i],content_type:yx(i),derived_from:ac[i]?.derivedFrom??"data",duration:ac[i]?.duration??{mode:"instant"},label:ac[i]?.derivedFrom==="prediction"?"{{question.text}}":e.name,custom_fields:Af([...kf,...xf[Ge(i)]??[]]),...ac[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":AC([...n,..._f,...kf,...Object.values(xf).flat(),...Object.values(Sf).flat(),...fx]).map(TC),"project_settings.json":{sections:Af(n)},"event_settings.json":{sections:Af([..._f,...t.flatMap(i=>Sf[i]??[])])}}}function vx(e){return IC({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls})}var gx,yx,ac,$C,TC,If=v(()=>{"use strict";Tf();Ht();gx=Py,yx=e=>{let t=Ge(e);return pl[t]??`gamestage-${t.replaceAll("_","-")}-element`},ac={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{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}}},$C=new Set(["freetext","wysiwyg","image","file"]),TC=e=>({key:e.key,type:e.type,...$C.has(e.type)?{localisable:!1}:{},...e.type==="collection"?{...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,...t.description?{description:t.description}:{}}))}:{}})});var Pf=v(()=>{"use strict";Ht()});var bx=v(()=>{"use strict";_o();ec();mf();Qn();ff();gf();vf();If();Pf();sf();cf();Dt()});function CC(e){let t=1e3*2**(e-1),r=t*.2*(Math.random()*2-1);return Math.round(t+r)}function kx(e){let t=e.fetch??globalThis.fetch,r=e.maxAttempts??4,o=e.baseUrl.replace(/\/+$/,"");return async function(i,a,s={}){let u=globalThis.location?.origin,l=new URL(`${o}${a}`,o.startsWith("/")?u:void 0);for(let[h,f]of Object.entries(s.query??{}))f!=null&&l.searchParams.set(h,String(f));let p;for(let h=1;h<=r;h++){let f=typeof e.token=="function"?await e.token():e.token,g=await t(l,{method:i,headers:{authorization:`Bearer ${f}`,...s.body===void 0?{}:{"content-type":"application/json"}},body:s.body===void 0?void 0:JSON.stringify(s.body)});if(g.ok)return await g.json();let k=await g.json().catch(()=>({}));if(p=new yt(g.status,k.error?.code??"unknown",k.error?.message??g.statusText,k.error?.retryable??!1),!p.retryable||h===r)break;let L=Number(g.headers.get("retry-after"));await PC(Number.isFinite(L)&&L>0?L*1e3:CC(h))}throw p??new yt(0,"unknown","Request failed.",!1)}}function xx(e){let t=kx(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(tx);return nx(o)},setWorkspacePlan:(r,o,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(r)}/plan`,{body:{tier:o,...n===void 0?{}:{liveGameAllowance:n}}})}}function Hr(e){let t=kx(e),r=["meters","rounds","history","destinations","sections","issues"],o=a=>{let s={...a,containerLabel:a.containerLabel??"Round"};for(let u of r)Array.isArray(s[u])||(s[u]=[]);return s},n=a=>({...a,access:Qs(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:Qs(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 yt)||a.status!==404)throw a;return wx||(wx=!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 yt&&s.status===404)return;throw s}},setAwake:(a,s)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/state`,{body:{awake:s}}),setDestination:(a,s,u)=>t("PUT",`/v1/games/${encodeURIComponent(a)}/destinations`,{body:{destination_id:s,enabled:u}}),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(u){throw u instanceof yt&&u.status===404&&!/no such game/i.test(u.message)?new yt(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):u}},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 yt&&s.status===404)return;throw s}},async getLogs(a,s){let{lines:u}=await t("GET",`/v1/games/${encodeURIComponent(a)}/logs`,{query:s});return u},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:_x}:{datasets:a.datasets,unavailable:a.unavailable??null}}catch(a){if(a instanceof yt&&a.status===404)return{datasets:[],unavailable:_x};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 yt&&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 yt&&s.status===404)return[];throw s}}}}var yt,PC,wx,_x,Sx=v(()=>{"use strict";ec();yt=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"}},PC=e=>new Promise(t=>setTimeout(t,e)),wx=!1;_x="This control plane is running a build older than this screen, so it cannot list datasets yet."});function OC(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 Ex(e,t){let r=OC(e);if(r===void 0)return!1;let o=typeof t=="number"?t:Date.parse(t);return Number.isFinite(o)?o>r:!1}var $x=v(()=>{"use strict"});var Tx=v(()=>{"use strict";Tn()});var NC,RC,LC,mF,Cf=v(()=>{"use strict";at();NC=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")})]),RC=c.enum(["licensed","unofficial","creator"]),LC=c.enum(["ours","creator"]),mF=c.object({id:c.string().min(1),label:c.string().min(1),standing:RC,origin:LC,tiers:c.array(c.enum(["runtime","live","enterprise"])).min(1),produces:c.array(c.string()),note:c.string().min(1),audience:NC.optional()})});var Ax=v(()=>{"use strict";Cf()});var Ix=v(()=>{"use strict";Qn()});var Px=v(()=>{"use strict";Qn()});function DC(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=An.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:oc(e),measures:r.data.measures.map(o=>o.key),counts:Object.fromEntries(r.data.measures.map(o=>[o.key,Object.keys(o.values).length]))}}}async function Cx(e,t){let r=DC(e);return r.ok&&(await t("copy",e),await t("pointer",e)),r}var Ox=v(()=>{"use strict";Qn()});var Nx=v(()=>{"use strict"});var Rx=v(()=>{"use strict"});function Of(e){return e.sourceIp?.trim()||"unknown"}function Nf(e,t){return`${e.length}:${e}${t}`}var jC,Lx,Dx,jx,Mx,TF,AF,IF,Ux=v(()=>{"use strict";jC=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},Lx=e=>typeof process>"u"?void 0:jC(process.env?.[e]),Dx=(e,t,r)=>({burst:Lx(t)??e.burst,perMinute:Lx(r)??e.perMinute}),jx={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},Mx={player:Dx(jx.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Dx(jx.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},TF=Mx.player,AF=Mx.publicRoutes,IF=600*1e3});var zx=v(()=>{"use strict"});var xe=v(()=>{"use strict";_o();Ht();En();Tm();Bs();sf();Rk();Hs();jk();zs();cf();Zk();si();Dt();ec();bx();Sx();Tf();Ut();gf();$x();Tn();tc();yf();nc();Wr();Tx();Qn();Ax();Cf();Ix();Px();Ox();ff();rc();vf();Nx();If();mf();Rx();Pf();Ux();zx()});import{spawn as Zx}from"node:child_process";import{chmod as Fx,mkdir as Gx,readFile as Bx,rm as Wx,writeFile as Kx}from"node:fs/promises";import{homedir as MC,platform as Vr}from"node:os";import{dirname as UC,join as Hx}from"node:path";async function Vx(){let e=await fetch(`${Rf}/user_management/authorize/device`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:Lf})});if(!e.ok)throw new Error(`Could not start sign-in (${e.status}). ${await e.text()}`);return await e.json()}async function Yx(e){let t=await fetch(`${Rf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Lf,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 Jx(e){let t=Vr()==="darwin"?"open":Vr()==="win32"?"cmd":"xdg-open",r=Vr()==="win32"?["/c","start","",e]:[e];try{Zx(t,r,{stdio:"ignore",detached:!0}).unref()}catch{}}function Df(){let e=process.env.GAMESTAGE_CREDENTIALS?.trim();return e||void 0}function jf(e,t){return new Promise(r=>{let o=Zx("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 Mf(e){let t=JSON.stringify(e),r=Df();return r?(await Gx(UC(r),{recursive:!0,mode:448}),await Kx(r,t,{mode:384}),await Fx(r,384),"file"):Vr()==="darwin"&&await jf(["add-generic-password","-a",Yr,"-s",Yr,"-U","-w",t])!==null?"keychain":(await Gx(qx,{recursive:!0,mode:448}),await Kx(sc,t,{mode:384}),await Fx(sc,384),"file")}function zC(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 FC(e){if(!e.refreshToken)return null;let t=await fetch(`${Rf}/user_management/authenticate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:Lf,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 GC(){let e=Df();if(e)try{return JSON.parse(await Bx(e,"utf8"))}catch{return null}if(Vr()==="darwin"){let t=await jf(["find-generic-password","-a",Yr,"-s",Yr,"-w"]);if(t)try{return JSON.parse(t)}catch{}}try{return JSON.parse(await Bx(sc,"utf8"))}catch{return null}}async function Xx(){let e=Df();if(e){await Wx(e,{force:!0});return}Vr()==="darwin"&&await jf(["delete-generic-password","-a",Yr,"-s",Yr]),await Wx(sc,{force:!0})}async function Ue(){let e=await GC();if(!e)return null;if(!zC(e.accessToken)||!e.refreshToken)return e;let t=await FC(e);return t?(await Mf(t),t):null}var Rf,Lf,Yr,qx,sc,er=v(()=>{"use strict";Rf="https://api.workos.com",Lf=process.env.GAMESTAGE_CLIENT_ID??"client_01KYVPJ1MA6GA9EXTJ7GJ81YW4";Yr="gamestage-cli",qx=Hx(MC(),".gamestage"),sc=Hx(qx,"credentials.json")});function eS(e){return`${qt}/stage/games/${encodeURIComponent(e)}?tab=overview`}function tS(e){return e&&new Set(["hunt","push","group","predict"]).has(e)?`${qt}/docs/game-formats#${e}`:`${qt}/docs`}var qt,Uf=v(()=>{"use strict";qt=process.env.GAMESTAGE_SITE_URL??"https://gamestage.ai"});function KC(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function ZC(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function HC(e=Ze,t=process.env){if(ZC(t)&&!KC(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 Jr(e=Ze){let t=HC(e);t&&V(t)}async function fi(){let e=await Ue();return e||V("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 ke(){let e=await fi();return{client:Hr({baseUrl:Ze,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function nS(){let e=await Ue();return e||V("You are not signed in.",["Run `gamestage login`. Approving a creator needs an operator's own session."]),{admin:xx({baseUrl:Ze,token:async()=>(await Ue())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function lc(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===zf?{access:"pending"}:r===404||o==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${Ze}.`,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 ${Ze}.`,"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 ${Ze}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function gi(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:zf,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: ${qt}.`]};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 rS(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 qr(e){if(K(e.heading),y(` ${e.message}`),e.next.length){y();for(let t of e.next)I(t)}y()}function Pe(e){let t=[],r=e.status,o=e.code;if(o===zf){let n=gi({access:"pending"});q()?Q({ok:n.ok,status:n.status,access:n.access,code:n.code,message:n.message,next:n.next}):qr(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: ${Ze}`),V(e instanceof Error?e.message:"The control plane call failed.",t)}var Ze,zf,$t=v(()=>{"use strict";xe();er();Ce();Uf();Ze=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";zf="access_pending"});import{open as XC,readFile as cS}from"node:fs/promises";import{createHash as QC}from"node:crypto";import{gunzipSync as eO}from"node:zlib";function rO(e){for(let{pattern:t,what:r}of nO)if(t.test(e))return r}function Bf(e){let t=(e.split("/").pop()??e).toLowerCase();return t===".env"||t.startsWith(".env.")||tO.has(t)||/^(credentials|secrets)\.(json|ya?ml|ini|toml|txt|env)$/.test(t)||/\.(pem|key|p12|pfx|keystore|jks)$/.test(t)}async function dS(e,t){let r;try{r=await XC(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(`
10176
+ `),a])}catch{return}finally{await r.close()}}async function iO(e){return(await dS(e,lS))?.toString("latin1")}async function bi(e){let t=await dS(e,lS);if(!t)return;if(t.byteLength>=2&&t[0]===31&&t[1]===139)try{let s=await cS(e);t=eO(s,{maxOutputLength:oO})}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 aO(e){let t=Ne(e);if(t.ok)return{manifest:!0,round:!!t.manifest.backend.round}}function Xr(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(`
10177
10177
  `).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(`
10178
- `).some(u=>i.members.every(l=>new RegExp(`["\`']${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(u)))&&n.push(i.label)}return n}if(t.archetype==="shoot")return[];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(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),u=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||u.test(e))&&o.push(i.label)}return o}function Qr(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.`;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 BC(e){try{return JSON.parse(e)}catch{}try{let t=Sk(e);return typeof t=="object"?t:void 0}catch{return}}function WC(e){let t=BC(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,u]of Object.entries(i)){if(GC.has(s.toLowerCase())){r=s;return}n(u,a+1)}}};return n(t,0),r}function KC(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Lf+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<Lf+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),u=!1,l=!1;for(let p=0;p<s;p+=1){let h=a.map(f=>f[p].trim());h.every(f=>f.length>0&&/^-?\d+(\.\d+)?$/.test(f))?u=!0:h.every(f=>f.length>0&&!/^-?\d+(\.\d+)?$/.test(f))&&(l=!0)}if(u&&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>=Lf&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function VC(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&HC.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:ZC.has(t.slice(r+1))}function JC(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>YC.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function qC(e){if(e.relativePath!==Te)return;let t;try{t=await Qx(e.path)}catch{return}if(RC("sha256").update(t).digest("hex").slice(0,16)!==Pt)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 nS(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),u;for(let l of e){let p=JC(l.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await qC(l);if(h){u??=h;continue}if(s.has(l.relativePath)){r.push(l);continue}let f=await jf(l,t.round);if(!f){r.push(l);continue}if(f.confidence==="suspected"&&a.has(l.relativePath)){n.push(f),r.push(l);continue}if(f.alwaysWithheld||VC(l.relativePath)){o.push(f);continue}u??=f}return{publish:r,withheld:o,allowed:n,walkedPast:i,...u?{refuse:u}:{}}}async function jf(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(Df(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await vi(e.path);if(o!==void 0){let i=MC(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=FC(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=Xr(o,t);if(s.length)return r(Qr(t,s),"certain")}}if(t&&o===void 0){let i=await zC(e.path);if(i!==void 0){let a=Xr(i,t);if(a.length)return r(Qr(t,a),"certain")}}if(o===void 0)return;let n=WC(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(KC(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 DC,jC,eS,UC,GC,Lf,ZC,HC,YC,cc=v(()=>{"use strict";Gs();ke();Zt();DC=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),jC=[{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"}];eS=8e6,UC=32e6;GC=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Lf=20;ZC=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),HC=new Set(["gz","br","zst","zz"]);YC=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function lc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Te||o===De)continue;let n=await vi(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var Mf=v(()=>{"use strict";Zt();cc()});import{lstatSync as XC,readdirSync as QC}from"node:fs";import{relative as eO,resolve as rS,sep as tO}from"node:path";function oS(e){let t=e.split("/").pop()??e;return nO.has(t)||t.startsWith(".env.")}function Uf(e,t={}){let r=t.symlinks??"throw",o=rS(e),n=[],i=[];function a(s){for(let u of QC(s,{withFileTypes:!0}).sort((l,p)=>l.name.localeCompare(p.name))){let l=rS(s,u.name),p=eO(o,l).split(tO).join("/");if(u.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${p}`);i.push(p);continue}if(u.isDirectory())a(l);else if(u.isFile()){if(oS(p))continue;n.push({path:l,relativePath:p})}}}if(!XC(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function zf(e){return Uf(e,{symlinks:"throw"}).files}var nO,Ff=v(()=>{"use strict";nO=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"])});import{createHash as rO}from"node:crypto";function bi(e){return rO("sha256").update(e,"utf8").digest()[0]&127}var dc,Gf=v(()=>{"use strict";dc=128});import{createHmac as oO,randomBytes as iO,timingSafeEqual as aO}from"node:crypto";function Wf(e){return e.startsWith(Bf)}function wi(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Bf}${t||"unknown"}`}async function aS(e){if(!e.token)return e.sessionSecret?{playerId:cO(e.anonymousId,e.sessionSecret)??wi(void 0)}:{playerId:wi(e.anonymousId)};let t=e.resolver??iS,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:wi(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function cS(e){let t=`${Bf}${iO(16).toString("base64url")}`;return{playerId:t,token:sO(t,e)}}function lS(e,t){return oO("sha256",t).update(e).digest("base64url")}function sO(e,t){return`${e}${sS}${lS(e,t)}`}function cO(e,t){if(!e)return;let r=e.lastIndexOf(sS);if(r<=0)return;let o=e.slice(0,r);if(!Wf(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(lS(o,t));if(n.length===i.length)return aO(n,i)?o:void 0}var Bf,iS,sS,uc=v(()=>{"use strict";Bf="anon:";iS={async resolve(){}};sS="."});function nr(e){return e instanceof Error?e.name:"unknown"}function In(e){console.error(lO,e)}function dS(e,t){console.error(dO,{violation:e,...t})}var lO,dO,pc=v(()=>{"use strict";lO="engine_error",dO="engine_integrity_violation"});function hS(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 uO(e){let t=uS[hS(`a:${e}`)%uS.length],r=pS[hS(`n:${e}`)%pS.length];return`${t} ${r}`}function hc(e,t){return t?.trim()||uO(e)}var uS,pS,Kf=v(()=>{"use strict";uS=["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"],pS=["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"]});import{createHash as pO}from"node:crypto";function zt(e){return gx({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function hO(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 mc(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function mO(e){return pO("sha256").update(Hs(e)).digest("hex")}function fS(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}`),u=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=S=>S;function p(S,$){return!n.settle||!S.round.can.results_available||$.outcome!=="pending"?$:n.settle({secret:S.secret,state:$,limits:S.limits,now:i()})}function h(S){if(!S.fusedUntil)return 0;let $=Math.ceil((Date.parse(S.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite($)&&$>0?$:0}async function f(S,$){let j=e.fuse?.note(t,bi(r),$);if(!j)return;let I=new Date(Date.parse(i())+j.holdSeconds*1e3).toISOString();if(j.kind==="stop")try{await o.setFuse(t,S,I)}catch(ae){In({event:"fuse_write_failed",tenant:t,round_id:S,name:nr(ae)})}try{await e.onFuse?.({...j,until:I})}catch(ae){In({event:"fuse_notify_failed",tenant:t,round_id:S,name:nr(ae)})}}function g(S){let $=h(S)>0,j=mc({limits:S.limits,now:i()});return!$&&!j?S.round:{...S.round,can:{...S.round.can,accepting_plays:!1}}}function k(S,$){let j=S.round.number??Number.POSITIVE_INFINITY,I=$.round.number??Number.POSITIVE_INFINITY;return j!==I?j-I:S.round.id.localeCompare($.round.id)}async function L(S){let $=S.round.id,j=await o.getState(t,$,r);return j?{state:j.state,version:j.version}:{state:{...n.initialState({playerId:r,roundId:$,limits:S.limits,now:i(),round:S.round,secret:S.secret}),started_at:i()},version:void 0}}async function b(S,$,j,I){if($.timerSeconds===void 0||I!==void 0)return j;try{if(await o.putStateIfVersion(t,j,void 0))return j}catch(oe){return In({event:"round_open_write_failed",tenant:t,round_id:S,name:nr(oe)}),j}return(await o.getState(t,S,r))?.state??j}let x=(S,$,j)=>({...u(),play_id:s(),outcome:S,reason:$,round_version:j,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...u()}},async getCurrentRound(){let S=await o.getCurrentRound(t);if(!S)throw new Error(Zf);return{...g(S),...u()}},async getRound(S){let $=await o.getRound(t,S);return $?{...g($),...u()}:void 0},async getRoundPool(){let[S,$]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),j=$?.round.id,I=[...S].sort(k).map(ae=>{let oe=g(ae);return{id:oe.id,number:oe.number,version:oe.version,can:oe.can,opens_at:oe.opens_at,locks_at:oe.locks_at,current:oe.id===j,theme:typeof oe.challenge?.theme=="string"?oe.challenge.theme:""}});return{...u(),rounds:I}},async getPlayedRounds(){let S=await o.listStatesForPlayer(t,r);return{...u(),player_id:r,played:S.map($=>({round_id:$.round_id,finished:$.finished,score:$.score,outcome:$.outcome})).sort(($,j)=>$.round_id.localeCompare(j.round_id))}},async getNextRound(){let[S,$]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),j=new Set($.filter(de=>de.finished).map(de=>de.round_id)),I=new Set($.map(de=>de.round_id)),ae=[...S].filter(de=>g(de).can.accepting_plays&&!j.has(de.round.id)).sort(k),oe=ae.find(de=>!I.has(de.round.id))??ae[0];return oe?{...u(),status:"ready",round:{...g(oe),...u()}}:{...u(),status:"exhausted"}},async getRoundState(S){let $=await o.getRound(t,S);if(!$)throw new Error(Zf);let j=l($),{state:I,version:ae}=await L(j),oe=await b(S,j.limits,I,ae),de=p(j,oe);return de!==oe&&de.finished&&await o.recordScore(t,S,r,de.score),{...de,...u()}},async getProfile(){let S=await o.getProfile(t,r);return{...S,display_name:hc(r,S.display_name),...u()}},async getLeaderboard(S){let j=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,j,{limit:S,viewerId:r}),...u()}},async play(S,$){let j=await o.getRound(t,S);if(!j)return x("rejected",Zf,0);let I=l(j);if(e.runtime.identity?.required&&Wf(r))return x("rejected",e.identityRefusal??"identity_required",I.round.version);if(h(I)>0)return{...x("busy","fair_use",I.round.version),retry_after_seconds:h(I)};if(I.limits.playsPerSecond!==void 0){let J=i().slice(0,19),we=await o.countPlay(t,S,J,r),Ye=Math.max(1,Math.ceil(I.limits.playsPerSecond/we.buckets));if(we.inBucket>Ye)return await f(S,J),{...x("busy","capped",I.round.version),retry_after_seconds:1}}if(I.limits.playsPerDay!==void 0){let J=i().slice(0,10),we=await o.countPlay(t,S,J,r),Ye=Math.max(1,Math.ceil(I.limits.playsPerDay/we.buckets));if(we.inBucket>Ye)return await f(S,J),{...x("busy","capped_today",I.round.version),retry_after_seconds:hO(i())}}let ae=mO({round_id:S,round_version:$.round_version,challenge_instance_id:$.challenge_instance_id,payload:$.payload}),oe=J=>J.intent!==void 0&&J.intent.fingerprint!==ae,de=await o.getPlay(t,r,$.idempotency_key);if(de)return oe(de)?x("rejected",mS,I.round.version):{...de.result,...u(),outcome:"duplicate"};let lt=Lk($.payload,n.archetype),Ln=lt!==void 0&&(n.operations?n.operations.includes(lt):Dk(n.archetype,lt));if($.payload.op!==void 0&&!Ln)return x("rejected","unknown_operation",I.round.version);let{state:Ce,version:_t}=await L(I),ft=n.admissible({accepting:I.round.can.accepting_plays,roundVersion:I.round.version,playedVersion:$.round_version,challengeInstanceId:I.round.challenge_instance_id??null,playedChallengeInstanceId:$.challenge_instance_id??null,state:Ce,secret:I.secret,limits:I.limits,now:i()});if(!ft.ok){let J=ft.reason==="round_version"?"stale":"rejected";return x(J,ft.reason,I.round.version)}if(mc({limits:I.limits,now:i()}))return x("rejected","lock_deadline_passed",I.round.version);let se=n.mark({payload:$.payload,secret:I.secret,state:Ce,limits:I.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(se.outcome!=="accepted")return x("rejected",se.reason??"rejected",I.round.version);let Se={...u(),play_id:s(),outcome:se.outcome,round_version:I.round.version,marked:se.marked,feedback:se.feedback,round_state:{...se.next,...u()}},q=`play:${JSON.stringify([t,r,$.idempotency_key])}`,dt=[{id:q,at:Se.server_time,tenant:t,round_id:S,player_id:r,action:"play.committed",detail:{play_id:Se.play_id,idempotency_key:$.idempotency_key,outcome:Se.outcome,marked:Se.marked,round_version:Se.round_version,score_before:Ce.score,score_after:se.next.score,attempts_used:se.next.attempts_used,attempts_allowed:se.next.attempts_allowed,mistakes_used:se.next.mistakes_used,mistakes_allowed:se.next.mistakes_allowed,...n.auditDetail({secret:I.secret,before:Ce,decision:se,payload:$.payload})}}],ze=se.marked&&(se.participation?.score??!0),Dn=se.participation?.profile??!0;ze&&dt.push({id:`score:${JSON.stringify([t,r,$.idempotency_key])}`,at:Se.server_time,tenant:t,round_id:S,player_id:r,action:"score.recorded",detail:{play_id:Se.play_id,score_before:Ce.score,score_after:se.next.score,marked:!0,outcome:se.next.outcome}});let _e=Dn&&se.next.finished&&!Ce.finished?Zs(await o.getProfile(t,r),se.next.outcome):void 0,Ve=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:$.idempotency_key,date:i().slice(0,10),play:{result:Se,intent:{fingerprint:ae,round_id:S,round_version:$.round_version}},state:se.next,expectedVersion:_t,audit:dt,...ze?{score:{roundId:S,score:se.next.score}}:{},..._e?{profile:_e}:{},round:{roundId:S,version:I.round.version,sharded:I.sharded===!0}});if(!Ve.ok&&Ve.reason==="contended")return x("busy","contended",I.round.version);if(!Ve.ok&&Ve.reason==="play_exists"){let J=await o.getPlay(t,r,$.idempotency_key);return J&&oe(J)?x("rejected",mS,I.round.version):J?{...J.result,...u(),outcome:"duplicate"}:(In({stage:"play_receipt_missing",tenant:t,round_id:S,player_id:r}),x("rejected","play_conflict",I.round.version))}if(!Ve.ok&&Ve.reason==="round_changed"){let J=await o.getRound(t,S),we=J===void 0||J.round.version!==I.round.version,Ye=we?"round_changed":"round_closed";return await o.appendAudit({id:q,at:Se.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:Se.play_id,idempotency_key:$.idempotency_key,reason:Ye,decided_against_version:I.round.version,attempt_spent:!1}}),x(we?"stale":"rejected",Ye,J?.round.version??I.round.version)}return Ve.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),Se):(await o.appendAudit({id:q,at:Se.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:Se.play_id,idempotency_key:$.idempotency_key,reason:"round_version",attempt_spent:!1}}),x("stale","round_version",I.round.version))}}}var Ft,mS,Zf,Qt=v(()=>{"use strict";Gf();uc();pc();Kf();ke();Ft="time_expired";mS="idempotency_conflict",Zf="round_not_found"});function fO(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"}:zt(e)?{ok:!1,reason:Ft}: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 gO(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(x=>r.targets.includes(x)&&!i.has(x)),s=t.picks.filter(x=>!r.targets.includes(x)),u=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let x of a)i.add(x);let p=i.size>=r.required,h=l>=n.mistakesAllowed,f=u>=n.attemptsAllowed,g=p||h||f,k=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),L={...o,server_time:e.now,attempts_used:u,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:k,finished:g,outcome:e.markAtSettlement?"pending":p?"won":g?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:L}:{outcome:"accepted",marked:!0,feedback:t.picks.map(x=>({key:x,verdict:r.targets.includes(x)?"correct":"wrong"})),next:L}}function yO(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 Hf,Vf=v(()=>{"use strict";Qt();Hf={archetype:"hunt",admissible:fO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return gO({...e,attempt:{picks:t}})},initialState:yO,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 Yf(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 vO(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 bO(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function wO(e){let{secret:t,state:r,limits:o}=e,n=Yf(r),i=x=>({outcome:"rejected",reason:x,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,u=a.entries.find(x=>x.key===s);if(!u)return i("not_on_slate");let l=n.total+u.value,p=l>t.target,h=[...n.picks,{slate:a.id,key:u.key,label:u.label,value:u.value}],f=r.attempts_used+1,g=f>=o.picksAllowed,k=p||g,L={...r,server_time:e.now,attempts_used:f,attempts_allowed:o.picksAllowed,progress:{total:l,picks:h,bust:p,...k?{tier:vO(t,l)}:{}},score:e.markAtSettlement?r.score:p?t.target-l:l,finished:k,outcome:e.markAtSettlement?"pending":p?"lost":k?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:L}:{outcome:"accepted",marked:!0,feedback:[{key:u.key,verdict:p?"wrong":"correct",label:String(u.value)}],next:L}}function _O(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 Jf,qf=v(()=>{"use strict";Qt();Jf={archetype:"push",admissible:bO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return wO({...e,attempt:{picks:t}})},initialState:_O,auditDetail({secret:e,before:t,decision:r}){let o=Yf(t),n=Yf(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 SO(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"}:zt(e)?{ok:!1,reason:Ft}: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 EO(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(I=>!i.has(I.key)),u=s.find(I=>kO(I.members,t.picks)),l=o.attempts_used+1,p=o.mistakes_used+(u?0:1);u&&(i.add(u.key),a.push({key:u.key,label:u.label,members:[...u.members]}));let h=i.size>=r.groups.length,f=p>=n.mistakesAllowed,g=l>=n.attemptsAllowed,k=h||f||g,L=e.markAtSettlement?o.score:o.score+(u?r.pointsPerGroup:0)+(h?r.completionBonus:0),b={...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:L,finished:k,outcome:e.markAtSettlement?"pending":h?"won":k?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:b};let x=s.reduce((I,ae)=>Math.max(I,xO(t.picks,ae)),0),S=!u&&t.picks.length>1&&x===t.picks.length-1,$=u?"correct":S?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((I,ae)=>({key:I,verdict:$,...u&&ae===0?{label:u.label}:{}})),next:b}}function $O(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 kO,xO,gS,yS=v(()=>{"use strict";Qt();kO=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,xO=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;gS={archetype:"group",admissible:SO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return EO({...e,attempt:{picks:t}})},initialState:$O,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 TO(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 AO(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 IO(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function PO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=TO(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 u=r.questions.find(p=>!AO(p,i[p.id]));if(u)return{outcome:"rejected",reason:u.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:CO(r,i),next:vS(r,l,i)}}function CO(e,t){return e.questions.map(r=>{let o=t[r.id],n=Ms(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 vS(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Ms(i,r[i.id],e.pointsForCorrect);o+=a,a!==Ms(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function OO(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=NO(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...vS(t,r,o),server_time:e.now}}function NO(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 RO(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 bS,wS=v(()=>{"use strict";ke();Qt();bS={archetype:"predict",admissible:IO,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 PO({...e,attempt:r?{answers:r}:{pick:o}})},initialState:RO,settle:OO,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 LO(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function Xf(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 DO(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function jO(e){let t=Xf(e),r=DO(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 MO(e){let t=LO(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),u=r.splice(s,1)[0];o.push(u.key),n[u.key]=u.label,u.note&&(i[u.key]=u.note)}return{board:o,cards:n,notes:i}}function _S(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function UO(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,u=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let f=p*o+h,g=i&&f>a*o+s?1:0;return t.cells[f-g]},l=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)l.push(Array.from({length:o},(f,g)=>u(h,g)).filter(f=>!!f));else if(p==="column")for(let h=0;h<o;h++)l.push(Array.from({length:r},(f,g)=>u(g,h)).filter(f=>!!f));else if(p==="diagonal"&&r===o)l.push(Array.from({length:r},(h,f)=>u(f,f)).filter(h=>!!h)),l.push(Array.from({length:r},(h,f)=>u(f,r-1-f)).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 zO(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"}:mc({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 FO(e){let{secret:t,state:r,limits:o}=e;if(Xf(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 u=0;u<n;u++){let l=MO(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 GO(e){let{secret:t,state:r}=e,o=Xf(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 BO(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=jO(r);if(o===void 0)return r;let n=UO(t,o),i=n.filter(f=>_S(f,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(f=>t.cardStatus?.[f]==="correct"),u=a.some(f=>t.cardStatus?.[f]===void 0),l=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let f of a){let g=t.cardStatus?.[f];g&&(p[f]=g)}let h=n.map(f=>{let g=_S(f,t.cardStatus),k=f.filter(b=>t.cardStatus?.[b]==="correct").length,L=f.some(b=>t.cardStatus?.[b]==="incorrect");return{cards:f,complete:g,oneAway:!g&&!L&&k===f.length-1}});return{...r,server_time:e.now,score:l,progress:{...r.progress,marks:p,lines:h},outcome:u?"pending":i>0||s?"won":"lost"}}function WO(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 KO(e){return e.op==="deal"||e.op==="reshuffle"?FO({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?GO({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 kS,xS=v(()=>{"use strict";Qt();kS={archetype:"bingo",admissible:zO,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}:KO({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:WO,settle:BO,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as ZO}from"node:crypto";function _i(e,t,r){return ZO("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 ES(e){let t=SS[e.profile];return{targetX:_i(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:_i(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:_i(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:_i(e,"dispersion_x",2001)-1e3,dispersionY:_i(e,"dispersion_y",2001)-1e3}}function $S(e,t,r){let o=SS[r],n=Lt,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),u=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),f=Math.floor(h*o.speedPerSecond/1e3),g=t.targetX-n.keeperStart.x,k=t.targetY-n.keeperStart.y,L=Math.round(Math.hypot(g,k)),b=L===0?0:Math.min(1,f/L),x=n.keeperStart.x+Math.trunc(g*b),S=n.keeperStart.y+Math.trunc(k*b),$={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:x,endY:S,diveStartMs:t.reactionMs},j={endX:u,endY:l,arcHeight:p},I=(Ce,_t)=>({result:Ce,replay:{flightMs:a,ball:j,keeper:$,contact:_t}}),ae=Math.abs(u),oe=ae+i>=n.postX&&ae-i<=n.postX+n.postWidth&&l-i<=n.barY+n.barHeight,de=l+i>=n.barY&&l-i<=n.barY+n.barHeight&&ae-i<=n.postX+n.postWidth;return oe?I("frame",{with:"post",x:Math.sign(u||1)*n.postX,y:l,atMs:a}):de?I("frame",{with:"bar",x:u,y:n.barY,atMs:a}):ae+i<n.postX&&l+i<n.barY?Math.abs(u-x)<=o.reachX+i&&Math.abs(l-S)<=o.reachY+i?I("saved",{with:"keeper",x:u,y:l,atMs:a}):I("goal",null):I("wide",null)}var SS,TS=v(()=>{"use strict";Wr();SS={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 HO(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 VO(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function YO(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function JO(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 qO(e){let{secret:t,state:r,limits:o}=e,n=S=>({outcome:"rejected",reason:S,marked:!1,feedback:[],next:r});if(!VO(t.entropy))return n("entropy_missing");if(t.model!==bn)return n("unknown_model");let i=nf.safeParse(e.payload.op===void 0?{...e.payload,op:Br}:e.payload);if(!i.success)return n(JO(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=ES({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),u=$S({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),l=HO(r,t),p=u.result==="goal",h=p?t.pointsPerGoal:0,f=l.goals+(p?1:0),g={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:u.result,points:h,replay:u.replay},k=r.attempts_used+1,L=k>=o.attemptsAllowed,b={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,progress:{...l,goals:f,shots:[...l.shots,g]},score:f*t.pointsPerGoal,finished:L,outcome:L?f>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:u.result}],next:b}}function XO(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??bn,profile:t.profile??ci,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var AS,IS=v(()=>{"use strict";ke();Qt();TS();AS={archetype:"shoot",admissible:YO,mark:qO,initialState:XO,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??Br,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 QO(e){return PS[Ge(e)]}function CS(e){return QO(e.archetype??"hunt")}function OS(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 PS,rr,fc=v(()=>{"use strict";ke();Vf();qf();yS();wS();xS();IS();PS={hunt:Hf,push:Jf,group:gS,predict:bS,bingo:kS,shoot:AS},rr=Object.keys(PS)});function NS(e){let t=CS(e.round);if(t)return fS({...e,rules:t})}var RS=v(()=>{"use strict";Qt();fc();Vf();qf();Qt()});function LS(e){let t=new Map,r=new Map,o=(b,x)=>`${x}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,u=new Map,l=new Set,p=new Map,h=new Map,f=new Map,g=e.currentRoundId,k,L=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set(Re(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,x){let S=t.get(x);return S?structuredClone(S):void 0},async putRound(b,x,S){for(let $=0;$<dc;$+=1)r.set(o(x.round.id,$),{version:x.round.version,accepting:x.round.can.accepting_plays});t.set(x.round.id,{...structuredClone(x),sharded:!0}),S&&(g=x.round.id,k=void 0)},async setRotation(b,x,S){k={roundIds:[...x],windowSeconds:S}},async getCurrentRound(){let b=k?k.roundIds[Math.floor(L()/1e3/k.windowSeconds)%k.roundIds.length]:g,x=t.get(b);return x?structuredClone(x):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,x){return[...n.entries()].filter(([S,$])=>S.startsWith(`${b}#`)&&$.state.player_id===x).map(([,S])=>structuredClone(S.state))},async getState(b,x,S){let $=n.get(Re(b,x,S));return $?structuredClone($):void 0},async putStateIfVersion(b,x,S){let $=Re(b,x.round_id,x.player_id),j=n.get($);return S===void 0?j?!1:(n.set($,{state:structuredClone(x),version:0}),!0):!j||j.version!==S?!1:(n.set($,{state:structuredClone(x),version:j.version+1}),!0)},async getPlay(b,x,S){let $=i.get(Re(b,x,S));return $?structuredClone($):void 0},async putPlayIfAbsent(b,x,S,$){let j=Re(b,x,S);return i.has(j)?!1:(i.set(j,structuredClone($)),!0)},async getLeaderboard(b,x,S){if(e.leaderboard)return structuredClone(e.leaderboard);let $=[...a.entries()].filter(([I])=>I.startsWith(Re(b,x)+"#")).map(([I,ae])=>({rank:0,player_id:I.slice(I.lastIndexOf("#")+1),display_name:hc(I.slice(I.lastIndexOf("#")+1)),score:ae})).sort((I,ae)=>ae.score-I.score).map((I,ae)=>({...I,rank:ae+1})),j=S?.limit??$.length;return{server_time:"",snapshot:"",round_id:x,order:"high_first",tie_break:"earliest_play",entries:$.slice(0,j),total:$.length,truncated:!1,me:S?.viewerId?$.find(I=>I.player_id===S.viewerId):void 0}},async getProfile(b,x){let S=f.get(Re(b,x));return S?structuredClone(S):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:x,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,x,S,$){let j=Re(b,x,S,String(bi($))),I=(s.get(j)??0)+1;return s.set(j,I),{inBucket:I,buckets:dc}},async getDailyActivity(b,x){return x.map(S=>({date:S,plays:u.get(Re(b,S))??0,players:null}))},async markMonthlyPlayer(b,x,S){let $=`${Re(b,x)}#${S}`;if(l.has($))return;l.add($);let j=Re(b,x);p.set(j,(p.get(j)??0)+1)},async getMonthlyPlayers(b,x){return p.get(Re(b,x))??0},async setFuse(b,x,S){let $=t.get(x);$&&($.fusedUntil=S)},async setResult(b,x,S){let $=t.get(x);if(!$)return;let I=$.secret.questions??[];if(typeof S=="string")I[0]&&(I[0].result=S);else for(let oe of I){let de=S[oe.id];de!==void 0&&(oe.result=de)}let ae=I.every(oe=>oe.result!==void 0);$.round.challenge={...$.round.challenge,...ae?{questions:I.map(oe=>({...$.round.challenge.questions?.find(de=>de.id===oe.id),id:oe.id,result:oe.result})),...typeof S=="string"?{result:S}:{}}:{}},$.round.can={...$.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let oe=0;oe<dc;oe+=1){let de=r.get(o(x,oe));de&&(de.accepting=!1)}},async recordScore(b,x,S,$){a.set(Re(b,x,S),$)},async appendAudit(b){if(h.has(b.id))throw dS("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 x=Re(b.tenant,b.playerId,b.idempotencyKey);if(i.has(x))return{ok:!1,reason:"play_exists"};let S=Re(b.tenant,b.state.round_id,b.state.player_id),$=n.get(S);if(b.expectedVersion===void 0){if($)return{ok:!1,reason:"state_version"}}else if(!$||$.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let I of b.audit)if(h.has(I.id))throw new Error("audit_record_exists");if(b.round?.sharded){let I=r.get(o(b.round.roundId,bi(b.playerId)));if(!I||I.version!==b.round.version||!I.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let I=t.get(b.round.roundId);if(!I||I.round.version!==b.round.version||!I.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set(x,structuredClone(b.play)),n.set(S,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let I of b.audit)h.set(I.id,structuredClone(I));b.score&&a.set(Re(b.tenant,b.score.roundId,b.playerId),b.score.score),b.profile&&f.set(Re(b.tenant,b.playerId),structuredClone(b.profile));let j=Re(b.tenant,b.date);return u.set(j,(u.get(j)??0)+1),{ok:!0}}}}var Re,DS=v(()=>{"use strict";Kf();Gf();pc();Re=(...e)=>e.join("#")});import{randomBytes as eN}from"node:crypto";function tN(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:wn(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},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function nN(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:wn(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}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function rN(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:wn(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}}}}function oN(e,t){let r=$_(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:wn(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}}}}function iN(e,t){let r=cN(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 aN(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:wn(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}}}}function sN(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:wn(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:[et.aimX.min,et.aimX.max],aim_y:[et.aimY.min,et.aimY.max],power:[et.power.min,et.power.max]},geometry:{post_x:Lt.postX,bar_y:Lt.barY,post_width:Lt.postWidth,bar_height:Lt.barHeight,ball_radius:Lt.ballRadius,keeper_start:{x:Lt.keeperStart.x,y:Lt.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}}}}function cN(e,t){switch(e.archetype){case"hunt":return tN(e,t);case"push":return nN(e,t);case"group":return rN(e,t);case"predict":return oN(e,t);case"bingo":return aN(e,t);case"shoot":return sN(e,t)}}function lN(){return eN(32).toString("hex")}function dN(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 eo(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(eo).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)}:${eo(o)}`).join(",")}}`}function jS(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...u}=i,{version:l,...p}=u;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:f,...g}=p.can;return{...p,can:g}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return eo({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===eo({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function uN(e,t){if(e.archetype!=="bingo"||!jS(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)||eo(n[i])!==eo(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function Qf(e,t,r,o,n=!0,i,a,s){let u=i??wn(r),l=await e.getRound(t,u),p=dN(iN(r,o),l,s?.newEntropy??lN);if(p.round.id=u,a&&(p.round.origin=a),l&&jS(p,l)){let{fusedUntil:g,...k}=l;return await e.putRound(t,{...k,archetype:p.archetype},n),{roundId:u,version:l.round.version,changed:!1,current:n}}if(l&&uN(p,l)){let g=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),await e.appendAudit({id:`round_${u}_settle_${g}`,at:new Date().toISOString(),tenant:t,round_id:u,player_id:null,action:"round.settled",detail:{version:l.round.version,resolved:g,snapshot:o}}),{roundId:u,version:l.round.version,changed:!1,current:n}}let h=l?l.round.version+1:1,f={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,f,n),await e.appendAudit({id:`round_${u}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:u,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:u,version:h,changed:!0,current:n}}var MS=v(()=>{"use strict";ke()});function zS(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 US,pN,BG,FS=v(()=>{"use strict";at();US="/play/v1/games/{game}/gfx/leaderboard",pN=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),BG=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(pN),withheld:c.number().int().nonnegative()})});function bt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function BS(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:eg,body:void 0};if(e.method==="GET"&&n===`${Ks}/health`)return ct(200,{status:"ok"});let i=wt.session.exec(n);if(i){if(e.method!=="POST")return Gt(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),u=o?.check($f(s,Ef(e)));if(u&&!u.allowed)return GS(u.retryAfterSeconds);let l=r?.issue(s);return l?ct(200,{server_time:"",snapshot:"",token:l.token,player_id:l.playerId,kind:"anonymous"}):Gt(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",wt.runtime],["currentRound",wt.currentRound],["rounds",wt.rounds],["roundsMine",wt.roundsMine],["nextRound",wt.nextRound],["plays",wt.plays],["roundState",wt.roundState],["profile",wt.profile],["graphicsFeed",wt.graphicsFeed],["leaderboard",wt.leaderboard],["round",wt.round]];for(let[s,u]of a){let l=u.exec(n);if(!l)continue;let p=decodeURIComponent(l[1]),h=l[2]?decodeURIComponent(l[2]):void 0,f=o?.check($f(p,Ef(e)));if(f&&!f.allowed)return GS(f.retryAfterSeconds);let g=s==="plays";if(g?e.method!=="POST":e.method!=="GET")return Gt(405,"method_not_allowed",`This route accepts ${g?"POST":"GET"}.`);let k;try{k=await t.forPlayer(p,e)}catch(L){return In({path:e.path,method:e.method,game:p,stage:"resolve",name:nr(L)}),Gt(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!k)return Gt(404,"not_found",`No game with id "${p}".`);try{switch(s){case"runtime":return ct(200,await k.getRuntime());case"currentRound":return ct(200,await k.getCurrentRound());case"rounds":return ct(200,await k.getRoundPool());case"roundsMine":return ct(200,await k.getPlayedRounds());case"nextRound":return ct(200,await k.getNextRound());case"round":{let L=await k.getRound(h);return L?ct(200,L):Gt(404,"not_found","No such round.")}case"roundState":return ct(200,await k.getRoundState(h));case"profile":return ct(200,await k.getProfile());case"leaderboard":return ct(200,await k.getLeaderboard());case"graphicsFeed":{let L=await k.getLeaderboard(),b=zS(L,new Date().toISOString()),x=ct(200,b);return x.headers["cache-control"]="public, max-age=5",x}case"plays":{let L=Nk.safeParse(e.body);if(!L.success)return Gt(422,"invalid_request",L.error.issues.map(S=>`${S.path.join(".")||"body"}: ${S.message}`).join("; "));let b=await k.play(h,L.data),x=ct(200,b);return b.outcome==="busy"&&b.retry_after_seconds&&(x.headers["retry-after"]=String(b.retry_after_seconds)),x}}}catch(L){return L instanceof Error&&L.message==="round_not_found"?Gt(404,"not_found","No such round."):(In({path:e.path,method:e.method,game:p,name:nr(L)}),Gt(500,"internal","Something went wrong at our end.",!0))}}return hN}var eg,ct,Gt,wt,hN,GS,WS=v(()=>{"use strict";ke();FS();pc();eg={"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"},ct=(e,t)=>({status:e,headers:{"content-type":"application/json",...eg},body:t}),Gt=(e,t,r,o=!1)=>ct(e,{error:{code:t,message:r,retryable:o}});wt={runtime:bt(Ae.runtime),currentRound:bt(Ae.currentRound),rounds:bt(Ae.rounds),roundsMine:bt(Ae.roundsMine),nextRound:bt(Ae.nextRound),round:bt(Ae.round),plays:bt(Ae.plays),roundState:bt(Ae.roundState),profile:bt(Ae.profile),leaderboard:bt(Ae.leaderboard),graphicsFeed:bt(US),session:bt(Ae.session)},hN=Gt(404,"not_found","No such route on the player API."),GS=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...eg},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function yc(...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 en(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 or,ki,gc,YG,to=v(()=>{or=new TextEncoder,ki=new TextDecoder,gc=new TextDecoder("utf-8",{fatal:!0}),YG=2**32});function mN(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function KS(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw vc(t.name);if(t.hash&&o.hash?.name!==t.hash)throw vc(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw vc(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw vc(t.length,"algorithm.length");mN(e,r)}var vc,ZS=v(()=>{vc=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function HS(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 VS,tg,ng=v(()=>{VS=(e,...t)=>HS("Key must be ",e,...t),tg=(e,t,...r)=>HS(`Key for the ${e} algorithm must be `,t,...r)});var He,mt,xi,bc,Le,xe,Pn,Si,no,wc,_c,kc,nt=v(()=>{He=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)}},mt=class extends He{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}},xi=class extends He{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}},bc=class extends He{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Le=class extends He{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},xe=class extends He{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Pn=class extends He{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Si=class extends He{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},no=class extends He{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)}},wc=class extends He{[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)}},_c=class extends He{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},kc=class extends He{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var ro,rg,og,ig=v(()=>{ro=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},rg=e=>e?.[Symbol.toStringTag]==="KeyObject",og=e=>ro(e)||rg(e)});function ag(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 xc(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 sg=v(()=>{});function Ei(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:ki.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=ki.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 xc(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function oo(e){let t=e;return typeof t=="string"&&(t=or.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):ag(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var $i=v(()=>{to();sg()});function Tt(e){if(!fN(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 Sc(...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 fN,cg,YS,JS,qS,Cn=v(()=>{fN=e=>typeof e=="object"&&e!==null;cg=e=>Tt(e)&&typeof e.kty=="string",YS=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),JS=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,qS=e=>e.kty==="oct"&&typeof e.k=="string"});function lg(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function dg(e,t,r){try{return Ei(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function XS(e,t,r){try{return en(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function QS(e,t,r){let o;try{o=JSON.parse(gc.decode(Ei(e)))}catch{throw new t(r)}if(!Tt(o))throw new t(r);return o}var ug=v(()=>{$i();to();Cn()});function vN(e,t){if(!e.kty.includes(t.kty))throw new Le(yN);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Ec(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Le('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=vN(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 yN,pg=v(()=>{nt();yN='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function _N(e,t,r){return e.symmetric?bN(e,t,r):wN(e,t,r)}function nE(e,t){return Tc||=new WeakMap,Tc.get(e)?.[t]}function rE(e,t,r){let o=Tc.get(e);return o?o[t]=r:Tc.set(e,{[t]:r}),r}async function Ac(e,t,r){let o=_N(e,t,r);switch(o.kind){case tE:case mg:return o.key;case $c:{if(o.key.k)return Ei(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 eE(o.key,o.key,e)}case fg:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?xN(n,e):eE(n,n.export({format:"jwk"}),e)}}}var io,hg,bN,wN,tE,mg,fg,$c,Tc,kN,eE,xN,gg=v(()=>{ng();ig();Cn();$i();pg();io=e=>e[Symbol.toStringTag],hg=(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},bN=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:tE,key:t};if(cg(t)){if(qS(t)&&hg(e,t,r))return{kind:$c,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(!og(t))throw new TypeError(tg(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 ro(t)?{kind:mg,key:t}:{kind:fg,key:t}},wN=(e,t,r)=>{let{alg:o}=e;if(cg(t))switch(r){case"decrypt":case"sign":if(YS(t)&&hg(e,t,r))return{kind:$c,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(JS(t)&&hg(e,t,r))return{kind:$c,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!og(t))throw new TypeError(tg(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 ro(t)?{kind:mg,key:t}:{kind:fg,key:t}},tE=Symbol(),mg=Symbol(),fg=Symbol(),$c=Symbol();kN={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};eE=async(e,t,r)=>{let o=nE(e,r.alg);if(o)return o;let n=await Ec(r,{...t,alg:r.alg});return rE(e,r.alg,n)},xN=(e,t)=>{let r=nE(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=kN[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return rE(e,t.alg,e.toCryptoKey(s,o,n))}});function Ti(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var yg=v(()=>{});function Ic(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:SN,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Pc(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 Le('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:EN,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function vg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Cc,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function bg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Cc,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function wg(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Cc,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function _g(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:oE,keyOps:iE,cekBits:e,ivBits:96,cbc:!1}}function kg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:oE,keyOps:iE,cekBits:e,ivBits:128,cbc:!0}}function aE(e){return $N[e]}var SN,EN,Cc,$N,oE,iE,bB,sE=v(()=>{nt();yg();SN={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},EN={public:[],private:["deriveBits"]},Cc={public:[],private:[]};$N=Ti({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Cc,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":Ic(1),"RSA-OAEP-256":Ic(256),"RSA-OAEP-384":Ic(384),"RSA-OAEP-512":Ic(512),"ECDH-ES":Pc(),"ECDH-ES+A128KW":Pc(128),"ECDH-ES+A192KW":Pc(192),"ECDH-ES+A256KW":Pc(256),A128KW:vg(128),A192KW:vg(192),A256KW:vg(256),A128GCMKW:bg(128),A192GCMKW:bg(192),A256GCMKW:bg(256),"PBES2-HS256+A128KW":wg(256,128),"PBES2-HS384+A192KW":wg(384,192),"PBES2-HS512+A256KW":wg(512,256)}),oE={public:[],private:[]},iE={encrypt:"encrypt",decrypt:"decrypt"};bB=Ti({A128GCM:_g(128),A192GCM:_g(192),A256GCM:_g(256),"A128CBC-HS256":kg(256),"A192CBC-HS384":kg(384),"A256CBC-HS512":kg(512)})});function TN(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 AN(e,t,r){KS(t,e.subtle,r),e.minModulusLength&&TN(e.alg,t)}async function cE(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(AN(e,t,r),t)}async function lE(e,t,r){let o=await cE(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function dE(e,t,r,o){let n=await cE(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var xg=v(()=>{ZS()});function uE(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 pE(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 Nc(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 Le(`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 Oc,Sg=v(()=>{nt();Oc=new Map([["b64",!0]])});function Eg(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:Ai}}function ao(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:Ai,minModulusLength:2048}}function $g(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:Ai}}function hE(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:Ai}}function Tg(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:Ai}}function Rc(e){let t=mE[e];if(!t)throw new Le(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Lc(e){return mE[e]}var Ai,mE,Ii=v(()=>{nt();yg();Ai={public:["verify"],private:["sign"]};mE=Ti({HS256:Eg(256),HS384:Eg(384),HS512:Eg(512),RS256:ao("RSASSA-PKCS1-v1_5",256),RS384:ao("RSASSA-PKCS1-v1_5",384),RS512:ao("RSASSA-PKCS1-v1_5",512),PS256:ao("RSA-PSS",256,32),PS384:ao("RSA-PSS",384,48),PS512:ao("RSA-PSS",512,64),ES256:$g("P-256",256),ES384:$g("P-384",384),ES512:$g("P-521",512),EdDSA:hE(),Ed25519:hE(),"ML-DSA-44":Tg("ML-DSA-44"),"ML-DSA-65":Tg("ML-DSA-65"),"ML-DSA-87":Tg("ML-DSA-87")})});function fE(e){return{algorithms:e&&uE("algorithms",e.algorithms),crit:e?.crit}}async function IN(e,t,r){let o={};e.protected&&(o=QS(e.protected,xe,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Sc(o,e.header))throw new xe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Nc(xe,Oc,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new xe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new xe('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new bc('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new xe("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new xe("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof r=="function"&&(r=await r(o,e),u=!0);let l=Rc(s),p=yc(e.protected!==void 0?en(e.protected):new Uint8Array,en("."),typeof e.payload=="string"?a?t.b64p??=XS(e.payload,"payload",xe):or.encode(e.payload):e.payload),h=dg(e.signature,"signature",xe),f=await Ac(l,r,"verify");if(!await dE(l,f,h,p))throw new kc;let k;return a?k=dg(e.payload,"payload",xe):typeof e.payload=="string"?k=or.encode(e.payload):k=e.payload,{payload:k,parsedProt:o,b64:a,key:f,resolvedKey:u}}async function gE(e,t,r){if(e instanceof Uint8Array&&(e=ki.decode(e)),typeof e!="string")throw new xe("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new xe("Invalid Compact JWS");return IN({payload:n,protected:o,signature:i},t,r)}var yE=v(()=>{xg();Ii();nt();to();ug();Cn();Sg();gg()});function Pi(e){let t=ON.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*bE);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*wE);break;case"day":case"days":case"d":n=Math.round(r*Ag);break;case"week":case"weeks":case"w":n=Math.round(r*PN);break;default:n=Math.round(r*CN);break}return t[1]==="-"||t[4]==="ago"?-n:n}function tn(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(gc.decode(t))}catch{}if(!Tt(o))throw new Pn("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||vE(e.typ)!==vE(n)))throw new mt('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:u,maxTokenAge:l}=r,p=[...i];l!==void 0&&p.push("iat"),u!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let k of new Set(p.reverse()))if(!(k in o))throw new mt(`missing required "${k}" claim`,o,k,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new mt('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new mt('unexpected "sub" claim value',o,"sub","check_failed");if(u!==void 0&&!NN(o.aud,typeof u=="string"?[u]:u))throw new mt('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=Pi(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}tn("clockTolerance option",h);let{currentDate:f}=r,g=tn("currentDate option",On(f||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new mt('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new mt('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>g+h)throw new mt('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new mt('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=g-h)throw new xi('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let k=g-o.iat,L=typeof l=="number"?l:Pi(l);if(k-h>L)throw new xi('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(k<0-h)throw new mt('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var On,bE,wE,Ag,PN,CN,ON,vE,NN,Dc,Ig=v(()=>{nt();to();Cn();On=e=>Math.floor(e.getTime()/1e3),bE=60,wE=bE*60,Ag=wE*24,PN=Ag*7,CN=Ag*365.25,ON=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;vE=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,NN=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Dc=class{#e;constructor(t){if(!Tt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return or.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=tn("setNotBefore",t):t instanceof Date?this.#e.nbf=tn("setNotBefore",On(t)):this.#e.nbf=On(new Date)+Pi(t)}set exp(t){typeof t=="number"?this.#e.exp=tn("setExpirationTime",t):t instanceof Date?this.#e.exp=tn("setExpirationTime",On(t)):this.#e.exp=On(new Date)+Pi(t)}set iat(t){t===void 0?this.#e.iat=On(new Date):t instanceof Date?this.#e.iat=tn("setIssuedAt",On(t)):typeof t=="string"?this.#e.iat=tn("setIssuedAt",On(new Date)+Pi(t)):this.#e.iat=tn("setIssuedAt",t)}}});async function Pg(e,t,r){let o=await gE(e,fE(r),t);if(!o.b64)throw new Pn("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 kE=v(()=>{yE();Ig();nt()});function jc(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function xE(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Sc(r,o))throw new xe("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};pE(xe,r);let i=Nc(xe,Oc,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new xe('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new xe('JWS "alg" (Algorithm) Header Parameter missing or invalid');let u=Rc(s),l,p;if(a){let x=e.encoded??={};x.b64??=oo(e.payload),x.raw??=en(x.b64),l=x.b64,p=x.raw}else p=e.payload,l="";let h,f;r?(h=oo(JSON.stringify(r)),f=en(h)):(h="",f=new Uint8Array);let g=yc(f,en("."),p),k=await Ac(u,t,"sign"),L=await lE(u,k,g),b={signature:oo(L),payload:l};return r&&(b.protected=h),b}var Mc=v(()=>{$i();xg();Ii();Cn();nt();to();Sg();gg()});var Uc,SE=v(()=>{nt();Mc();ug();Uc=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 lg(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return lg(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new xe("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await xE({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var zc,EE=v(()=>{SE();Mc();zc=class{#e;#t;constructor(t){this.#e=new Uc(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(jc(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 Ci,$E=v(()=>{EE();Mc();nt();Ig();Ci=class{#e;#t;constructor(t={}){this.#t=new Dc(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 zc(this.#t.data());if(o.setProtectedHeader(this.#e),jc(this.#e))throw new Pn("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function TE(){return new Le('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function AE(e){if(typeof e!="string")throw TE();let t=Lc(e)??aE(e);if(!t)throw TE();return t}var IE=v(()=>{nt();Ii();sE()});function DN(e){Ni(e,48,"Invalid PKCS#8 structure"),Oi(e),Ni(e,2,"Expected version field");let t=Oi(e);e.pos+=t,Ni(e,48,"Expected algorithm identifier");let r=Oi(e);return{algIdStart:e.pos,algIdLength:r}}var Cg,RN,Og,Oi,Ni,PE,LN,jN,MN,UN,CE,OE=v(()=>{sg();nt();IE();Cg=(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},RN=e=>({data:e,pos:0}),Og=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Oi=e=>{let t=Og(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|Og(e);return o}return t},Ni=(e,t,r)=>{if(Og(e)!==t)throw new Error(r)},PE=(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},LN=e=>{Ni(e,6,"Expected algorithm OID");let t=Oi(e);return PE(e,t)};jN=e=>{let t=LN(e);if(Cg(t,[43,101,110]))return"X25519";if(!Cg(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Ni(e,6,"Expected curve OID");let r=Oi(e),o=PE(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(Cg(o,i))return n;throw new Error("Unsupported named curve")},MN=async(e,t,r,o)=>{let n=AE(r);if(n.symmetric)throw new Le('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 Le("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)},UN=(e,t)=>xc(e.replace(t,"")),CE=(e,t,r)=>{let o=UN(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=RN(i);return DN(a),jN(a)}),MN("pkcs8",o,t,n)}});function zN(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function FN(e){if(rg(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:oo(e)};if(!ro(e))throw new TypeError(VS(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}=zN(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function Ng(e){return FN(e)}var NE=v(()=>{ng();$i();ig()});function GN(e){let t=typeof e=="string"?Lc(e):void 0;if(!t||t.symmetric)throw new Le('Unsupported "alg" value for a JSON Web Key Set');return t}function BN(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(WN)}function WN(e){return Tt(e)}async function RE(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Ec(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Si("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Lg(e){let t=new Rg(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 Rg,LE=v(()=>{pg();Ii();nt();Cn();Rg=class{#e;#t=new WeakMap;constructor(t){if(!BN(t))throw new Si("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=GN(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:u}=a;if(u===0)throw new no;if(u!==1){let l=new wc,p=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await RE(p,h,i)}catch{}},l}return RE(this.#t,s,i)}}});function KN(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function ZN(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 _c:i});if(n.status!==200)throw new He("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new He("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function HN(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!Tt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Tt))}function Mg(e,t){let r=new jg(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 Dg,DE,Fc,jg,jE=v(()=>{nt();LE();Cn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Dg="jose/v6.2.5");DE=Symbol();Fc=Symbol();jg=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),Dg&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Dg),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[DE],r?.[Fc]!==void 0&&(this.#s=r?.[Fc],HN(r?.[Fc],this.#c)&&(this.#i=this.#s.uat,this.#a=Lg(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 no&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&KN()&&(this.#r=void 0),this.#r||=ZN(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Lg(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 Ug(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return CE(e,t,r)}var ME=v(()=>{OE()});var zg=v(()=>{kE();$E();jE();NE();ME()});function VN(e){let t=UE.get(e);return t||(t=Mg(new URL(e)),UE.set(e,t)),t}function zE(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await Pg(r,VN(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:`${YN}${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 UE,YN,FE=v(()=>{"use strict";zg();uc();UE=new Map;YN="id:"});import{createPublicKey as JN,generateKeyPairSync as qN}from"node:crypto";async function Fg(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Gc}`,{privateKey:n,publicKey:i}=qN("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Ug(n,"RS256"),s=await Ng(JN(i)),u="gamestage-dev",l={keys:[{...s,kid:u,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:zE({issuer:r,jwksUri:o}),async mint(p,h={}){let f=Math.floor(Date.now()/1e3);return new Ci({name:p}).setProtectedHeader({alg:"RS256",kid:u}).setIssuer(r).setSubject(p).setIssuedAt(f).setExpirationTime(f+(h.expiresInSeconds??3600)).sign(a)}}}var Gc,Gg=v(()=>{"use strict";zg();FE();Gc="/.well-known/jwks.json"});import{createServer as XN}from"node:http";import{randomBytes as QN}from"node:crypto";async function tR(e){let t=LS({tenant:e.game,rounds:[],currentRoundId:""});await Qf(t,e.game,We.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await Qf(t,e.game,We.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=OS({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 NS({tenant:e.game,playerId:n.playerId??wi(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function nR(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 Bc(e){let t=await tR(e),r=QN(32).toString("base64"),o={issue:()=>cS(r)},n=e.devIdentity,i=XN((a,s)=>{(async()=>{let u=new URL(a.url??"/","http://localhost");if(n&&u.pathname===Gc){let f=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(u.pathname)){let f=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}let l=a.headers[eR],p=a.headers.authorization,h=await BS({method:a.method??"GET",path:u.pathname,body:await nR(a),...(({playerId:f,refused:g})=>({playerId:f,identityRefusal:g}))(await aS({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 eR,Bg=v(()=>{"use strict";ke();RS();fc();DS();MS();WS();uc();Gg();Gg();fc();eR="x-gamestage-player"});import{spawn as rR}from"node:child_process";import{createHash as oR,randomBytes as BE}from"node:crypto";import{constants as iR}from"node:fs";import{access as aR,mkdtemp as sR,rm as WE}from"node:fs/promises";import{request as cR}from"node:http";import{homedir as Wc,tmpdir as lR}from"node:os";import{join as Ri}from"node:path";function Wg(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??BE(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 Yg(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??uR].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await aR(s,iR.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 sR(Ri(lR(),"gamestage-chrome-")),i=rR(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 hR(await pR(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:u}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await Vg.create(a,u,i,n)}}catch(s){throw a?.close(),await KE(i),await WE(n,{recursive:!0,force:!0}),s}}function pR(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",u),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)),u=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",u);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function hR(e){return new Promise((t,r)=>{let o=new URL(e),n=BE(16).toString("base64"),i=oR("sha1").update(n+dR).digest("base64"),a=cR({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,u,l)=>{s.headers["sec-websocket-accept"]!==i?(u.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new Hg(u,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 KE(e){e.exitCode===null&&(e.kill("SIGTERM"),!await GE(e,1e3)&&(e.kill("SIGKILL"),await GE(e,1e3)))}function GE(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 Kg(e){return new Promise(t=>setTimeout(t,e))}var dR,Zg,Hg,Vg,uR,ZE=v(()=>{"use strict";dR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";Zg=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,u=n&127,l=2;if(u===126){if(this.buffered.length<l+2)break;u=this.buffered.readUInt16BE(l),l+=2}else if(u===127){if(this.buffered.length<l+8)break;let f=this.buffered.readBigUInt64BE(l);if(f>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");u=Number(f),l+=8}let p=l;if(s&&(l+=4),this.buffered.length<l+u)break;let h=Buffer.from(this.buffered.subarray(l,l+u));if(s)for(let f=0;f<h.length;f++)h[f]^=this.buffered[p+f%4];if(this.buffered=this.buffered.subarray(l+u),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}},Hg=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 Zg;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(Wg(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(Wg(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(Wg(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()}},Vg=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,u=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(u.split(`
10178
+ `).some(u=>i.members.every(l=>new RegExp(`["\`']${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}["\`']`,"i").test(u)))&&n.push(i.label)}return n}if(t.archetype==="shoot")return[];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(`(?:${a})[^\\n]{0,120}?\\b${i.value}\\b`,"i"),u=new RegExp(`\\b${i.value}\\b[^\\n]{0,120}?(?:${a})`,"i");(s.test(e)||u.test(e))&&o.push(i.label)}return o}function Qr(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.`;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 cO(e){try{return JSON.parse(e)}catch{}try{let t=Nk(e);return typeof t=="object"?t:void 0}catch{return}}function lO(e){let t=cO(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,u]of Object.entries(i)){if(sO.has(s.toLowerCase())){r=s;return}n(u,a+1)}}};return n(t,0),r}function dO(e){let t=e.split(/\r?\n/).filter(r=>r.trim().length>0);if(t.length<Gf+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<Gf+1)continue;let a=i.slice(1),s=Math.min(...a.map(p=>p.length)),u=!1,l=!1;for(let p=0;p<s;p+=1){let h=a.map(f=>f[p].trim());h.every(f=>f.length>0&&/^-?\d+(\.\d+)?$/.test(f))?u=!0:h.every(f=>f.length>0&&!/^-?\d+(\.\d+)?$/.test(f))&&(l=!0)}if(u&&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>=Gf&&o.every(n=>typeof n=="number"))return!0}}catch{}return!1}function hO(e){let t=(e.split("/").pop()??e).toLowerCase(),r=t.lastIndexOf(".");return r>0&&pO.has(t.slice(r+1))&&(t=t.slice(0,r)),r=t.lastIndexOf("."),r<=0?!0:uO.has(t.slice(r+1))}function fO(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>mO.includes(o));return r===-1?void 0:`${t.slice(0,r+1).join("/")}/`}async function gO(e){if(e.relativePath!==Ae)return;let t;try{t=await cS(e.path)}catch{return}if(QC("sha256").update(t).digest("hex").slice(0,16)!==Pt)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 uS(e,t={}){let r=[],o=[],n=[],i=[],a=new Set(t.allow??[]),s=new Set(t.exempt??[]),u;for(let l of e){let p=fO(l.relativePath);if(p){i.includes(p)||i.push(p);continue}let h=await gO(l);if(h){u??=h;continue}if(s.has(l.relativePath)){r.push(l);continue}let f=await Wf(l,t.round);if(!f){r.push(l);continue}if(f.confidence==="suspected"&&a.has(l.relativePath)){n.push(f),r.push(l);continue}if(f.alwaysWithheld||hO(l.relativePath)){o.push(f);continue}u??=f}return{publish:r,withheld:o,allowed:n,walkedPast:i,...u?{refuse:u}:{}}}async function Wf(e,t){let r=(i,a,s=!1)=>({path:e.relativePath,why:i,confidence:a,...s?{alwaysWithheld:s}:{}});if(Bf(e.relativePath))return r("is environment or credential shaped","certain",!0);let o=await bi(e.path);if(o!==void 0){let i=rO(o);if(i)return r(`carries ${i}, whatever the file is called`,"certain",!0);let a=aO(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=Xr(o,t);if(s.length)return r(Qr(t,s),"certain")}}if(t&&o===void 0){let i=await iO(e.path);if(i!==void 0){let a=Xr(i,t);if(a.length)return r(Qr(t,a),"certain")}}if(o===void 0)return;let n=lO(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(dO(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 tO,nO,lS,oO,sO,Gf,uO,pO,mO,uc=v(()=>{"use strict";Ks();xe();Zt();tO=new Set([".envrc",".netrc",".npmrc",".pgpass","id_rsa","id_ed25519","credentials","secrets","env.local"]),nO=[{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"}];lS=8e6,oO=32e6;sO=new Set(["answers","answer_key","answerkey","solution","solutions","targets","correct","correct_option","correct_options","groups","corpus","reference_data","referencedata"]);Gf=20;uO=new Set(["txt","log","md","markdown","yaml","yml","toml","ini","cfg","csv","tsv","map","bak","orig","rej","lock"]),pO=new Set(["gz","br","zst","zz"]);mO=[".git","node_modules",".next",".nuxt",".svelte-kit",".cache"]});async function pc(e){let t=[];for(let r of e){let o=r.relativePath.split("/").pop();if(o===Ae||o===De)continue;let n=await bi(r.path);n!==void 0&&t.push({relative:r.relativePath,text:n})}return t}var Kf=v(()=>{"use strict";Zt();uc()});import{lstatSync as yO,readdirSync as vO}from"node:fs";import{relative as bO,resolve as pS,sep as wO}from"node:path";function hS(e){let t=e.split("/").pop()??e;return _O.has(t)||t.startsWith(".env.")}function Zf(e,t={}){let r=t.symlinks??"throw",o=pS(e),n=[],i=[];function a(s){for(let u of vO(s,{withFileTypes:!0}).sort((l,p)=>l.name.localeCompare(p.name))){let l=pS(s,u.name),p=bO(o,l).split(wO).join("/");if(u.isSymbolicLink()){if(r==="throw")throw new Error(`Directory ${e} contains a symlink: ${p}`);i.push(p);continue}if(u.isDirectory())a(l);else if(u.isFile()){if(hS(p))continue;n.push({path:l,relativePath:p})}}}if(!yO(o).isDirectory())throw new Error(`${e} is not a directory.`);return a(o),{files:n,skippedLinks:i}}function Hf(e){return Zf(e,{symlinks:"throw"}).files}var _O,Vf=v(()=>{"use strict";_O=new Set(["gamestage.yaml","gamestage.yml",".env",".env.local","gamestage.mjs","cli.mjs"])});import{createHash as kO}from"node:crypto";function wi(e){return kO("sha256").update(e,"utf8").digest()[0]&127}var hc,Yf=v(()=>{"use strict";hc=128});import{createHmac as xO,randomBytes as SO,timingSafeEqual as EO}from"node:crypto";function qf(e){return e.startsWith(Jf)}function _i(e){let t=(e??"").replace(/[^A-Za-z0-9_.-]/g,"").slice(0,64);return`${Jf}${t||"unknown"}`}async function fS(e){if(!e.token)return e.sessionSecret?{playerId:TO(e.anonymousId,e.sessionSecret)??_i(void 0)}:{playerId:_i(e.anonymousId)};let t=e.resolver??mS,r=await t.resolve(e.token);return r?{playerId:r.playerId,alias:r.alias}:{playerId:_i(e.anonymousId),refused:t.lastRefusal?.()??"identity_unresolved"}}function yS(e){let t=`${Jf}${SO(16).toString("base64url")}`;return{playerId:t,token:$O(t,e)}}function vS(e,t){return xO("sha256",t).update(e).digest("base64url")}function $O(e,t){return`${e}${gS}${vS(e,t)}`}function TO(e,t){if(!e)return;let r=e.lastIndexOf(gS);if(r<=0)return;let o=e.slice(0,r);if(!qf(o))return;let n=Buffer.from(e.slice(r+1)),i=Buffer.from(vS(o,t));if(n.length===i.length)return EO(n,i)?o:void 0}var Jf,mS,gS,mc=v(()=>{"use strict";Jf="anon:";mS={async resolve(){}};gS="."});function nr(e){return e instanceof Error?e.name:"unknown"}function In(e){console.error(AO,e)}function bS(e,t){console.error(IO,{violation:e,...t})}var AO,IO,fc=v(()=>{"use strict";AO="engine_error",IO="engine_integrity_violation"});function kS(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 PO(e){let t=wS[kS(`a:${e}`)%wS.length],r=_S[kS(`n:${e}`)%_S.length];return`${t} ${r}`}function gc(e,t){return t?.trim()||PO(e)}var wS,_S,Xf=v(()=>{"use strict";wS=["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"],_S=["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"]});import{createHash as CO}from"node:crypto";function zt(e){return Ex({startedAt:e.state.started_at,timerSeconds:e.limits.timerSeconds},e.now)}function OO(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 yc(e){return e.limits.locksAt!==void 0&&e.now>=e.limits.locksAt}function NO(e){return CO("sha256").update(Js(e)).digest("hex")}function SS(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}`),u=()=>({server_time:i(),snapshot:e.runtime.snapshot}),l=S=>S;function p(S,$){return!n.settle||!S.round.can.results_available||$.outcome!=="pending"?$:n.settle({secret:S.secret,state:$,limits:S.limits,now:i()})}function h(S){if(!S.fusedUntil)return 0;let $=Math.ceil((Date.parse(S.fusedUntil)-Date.parse(i()))/1e3);return Number.isFinite($)&&$>0?$:0}async function f(S,$){let j=e.fuse?.note(t,wi(r),$);if(!j)return;let P=new Date(Date.parse(i())+j.holdSeconds*1e3).toISOString();if(j.kind==="stop")try{await o.setFuse(t,S,P)}catch(ae){In({event:"fuse_write_failed",tenant:t,round_id:S,name:nr(ae)})}try{await e.onFuse?.({...j,until:P})}catch(ae){In({event:"fuse_notify_failed",tenant:t,round_id:S,name:nr(ae)})}}function g(S){let $=h(S)>0,j=yc({limits:S.limits,now:i()});return!$&&!j?S.round:{...S.round,can:{...S.round.can,accepting_plays:!1}}}function k(S,$){let j=S.round.number??Number.POSITIVE_INFINITY,P=$.round.number??Number.POSITIVE_INFINITY;return j!==P?j-P:S.round.id.localeCompare($.round.id)}async function L(S){let $=S.round.id,j=await o.getState(t,$,r);return j?{state:j.state,version:j.version}:{state:{...n.initialState({playerId:r,roundId:$,limits:S.limits,now:i(),round:S.round,secret:S.secret}),started_at:i()},version:void 0}}async function b(S,$,j,P){if($.timerSeconds===void 0||P!==void 0)return j;try{if(await o.putStateIfVersion(t,j,void 0))return j}catch(oe){return In({event:"round_open_write_failed",tenant:t,round_id:S,name:nr(oe)}),j}return(await o.getState(t,S,r))?.state??j}let x=(S,$,j)=>({...u(),play_id:s(),outcome:S,reason:$,round_version:j,marked:!1,feedback:[]});return{async getRuntime(){return{...e.runtime,...u()}},async getCurrentRound(){let S=await o.getCurrentRound(t);if(!S)throw new Error(Qf);return{...g(S),...u()}},async getRound(S){let $=await o.getRound(t,S);return $?{...g($),...u()}:void 0},async getRoundPool(){let[S,$]=await Promise.all([o.listRounds(t),o.getCurrentRound(t)]),j=$?.round.id,P=[...S].sort(k).map(ae=>{let oe=g(ae);return{id:oe.id,number:oe.number,version:oe.version,can:oe.can,opens_at:oe.opens_at,locks_at:oe.locks_at,current:oe.id===j,theme:typeof oe.challenge?.theme=="string"?oe.challenge.theme:""}});return{...u(),rounds:P}},async getPlayedRounds(){let S=await o.listStatesForPlayer(t,r);return{...u(),player_id:r,played:S.map($=>({round_id:$.round_id,finished:$.finished,score:$.score,outcome:$.outcome})).sort(($,j)=>$.round_id.localeCompare(j.round_id))}},async getNextRound(){let[S,$]=await Promise.all([o.listRounds(t),o.listStatesForPlayer(t,r)]),j=new Set($.filter(de=>de.finished).map(de=>de.round_id)),P=new Set($.map(de=>de.round_id)),ae=[...S].filter(de=>g(de).can.accepting_plays&&!j.has(de.round.id)).sort(k),oe=ae.find(de=>!P.has(de.round.id))??ae[0];return oe?{...u(),status:"ready",round:{...g(oe),...u()}}:{...u(),status:"exhausted"}},async getRoundState(S){let $=await o.getRound(t,S);if(!$)throw new Error(Qf);let j=l($),{state:P,version:ae}=await L(j),oe=await b(S,j.limits,P,ae),de=p(j,oe);return de!==oe&&de.finished&&await o.recordScore(t,S,r,de.score),{...de,...u()}},async getProfile(){let S=await o.getProfile(t,r);return{...S,display_name:gc(r,S.display_name),...u()}},async getLeaderboard(S){let j=(await o.getCurrentRound(t))?.round.id??"";return{...await o.getLeaderboard(t,j,{limit:S,viewerId:r}),...u()}},async play(S,$){let j=await o.getRound(t,S);if(!j)return x("rejected",Qf,0);let P=l(j);if(e.runtime.identity?.required&&qf(r))return x("rejected",e.identityRefusal??"identity_required",P.round.version);if(h(P)>0)return{...x("busy","fair_use",P.round.version),retry_after_seconds:h(P)};if(P.limits.playsPerSecond!==void 0){let J=i().slice(0,19),we=await o.countPlay(t,S,J,r),Ye=Math.max(1,Math.ceil(P.limits.playsPerSecond/we.buckets));if(we.inBucket>Ye)return await f(S,J),{...x("busy","capped",P.round.version),retry_after_seconds:1}}if(P.limits.playsPerDay!==void 0){let J=i().slice(0,10),we=await o.countPlay(t,S,J,r),Ye=Math.max(1,Math.ceil(P.limits.playsPerDay/we.buckets));if(we.inBucket>Ye)return await f(S,J),{...x("busy","capped_today",P.round.version),retry_after_seconds:OO(i())}}let ae=NO({round_id:S,round_version:$.round_version,challenge_instance_id:$.challenge_instance_id,payload:$.payload}),oe=J=>J.intent!==void 0&&J.intent.fingerprint!==ae,de=await o.getPlay(t,r,$.idempotency_key);if(de)return oe(de)?x("rejected",xS,P.round.version):{...de.result,...u(),outcome:"duplicate"};let lt=Wk($.payload,n.archetype),Ln=lt!==void 0&&(n.operations?n.operations.includes(lt):Kk(n.archetype,lt));if($.payload.op!==void 0&&!Ln)return x("rejected","unknown_operation",P.round.version);let{state:Oe,version:_t}=await L(P),ft=n.admissible({accepting:P.round.can.accepting_plays,roundVersion:P.round.version,playedVersion:$.round_version,challengeInstanceId:P.round.challenge_instance_id??null,playedChallengeInstanceId:$.challenge_instance_id??null,state:Oe,secret:P.secret,limits:P.limits,now:i()});if(!ft.ok){let J=ft.reason==="round_version"?"stale":"rejected";return x(J,ft.reason,P.round.version)}if(yc({limits:P.limits,now:i()}))return x("rejected","lock_deadline_passed",P.round.version);let se=n.mark({payload:$.payload,secret:P.secret,state:Oe,limits:P.limits,markAtSettlement:e.runtime.marking==="at_settlement",now:i()});if(se.outcome!=="accepted")return x("rejected",se.reason??"rejected",P.round.version);let Ee={...u(),play_id:s(),outcome:se.outcome,round_version:P.round.version,marked:se.marked,feedback:se.feedback,round_state:{...se.next,...u()}},X=`play:${JSON.stringify([t,r,$.idempotency_key])}`,dt=[{id:X,at:Ee.server_time,tenant:t,round_id:S,player_id:r,action:"play.committed",detail:{play_id:Ee.play_id,idempotency_key:$.idempotency_key,outcome:Ee.outcome,marked:Ee.marked,round_version:Ee.round_version,score_before:Oe.score,score_after:se.next.score,attempts_used:se.next.attempts_used,attempts_allowed:se.next.attempts_allowed,mistakes_used:se.next.mistakes_used,mistakes_allowed:se.next.mistakes_allowed,...n.auditDetail({secret:P.secret,before:Oe,decision:se,payload:$.payload})}}],ze=se.marked&&(se.participation?.score??!0),Dn=se.participation?.profile??!0;ze&&dt.push({id:`score:${JSON.stringify([t,r,$.idempotency_key])}`,at:Ee.server_time,tenant:t,round_id:S,player_id:r,action:"score.recorded",detail:{play_id:Ee.play_id,score_before:Oe.score,score_after:se.next.score,marked:!0,outcome:se.next.outcome}});let _e=Dn&&se.next.finished&&!Oe.finished?Ys(await o.getProfile(t,r),se.next.outcome):void 0,Ve=await o.commitPlay({tenant:t,playerId:r,idempotencyKey:$.idempotency_key,date:i().slice(0,10),play:{result:Ee,intent:{fingerprint:ae,round_id:S,round_version:$.round_version}},state:se.next,expectedVersion:_t,audit:dt,...ze?{score:{roundId:S,score:se.next.score}}:{},..._e?{profile:_e}:{},round:{roundId:S,version:P.round.version,sharded:P.sharded===!0}});if(!Ve.ok&&Ve.reason==="contended")return x("busy","contended",P.round.version);if(!Ve.ok&&Ve.reason==="play_exists"){let J=await o.getPlay(t,r,$.idempotency_key);return J&&oe(J)?x("rejected",xS,P.round.version):J?{...J.result,...u(),outcome:"duplicate"}:(In({stage:"play_receipt_missing",tenant:t,round_id:S,player_id:r}),x("rejected","play_conflict",P.round.version))}if(!Ve.ok&&Ve.reason==="round_changed"){let J=await o.getRound(t,S),we=J===void 0||J.round.version!==P.round.version,Ye=we?"round_changed":"round_closed";return await o.appendAudit({id:X,at:Ee.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:Ee.play_id,idempotency_key:$.idempotency_key,reason:Ye,decided_against_version:P.round.version,attempt_spent:!1}}),x(we?"stale":"rejected",Ye,J?.round.version??P.round.version)}return Ve.ok?(await o.markMonthlyPlayer(t,i().slice(0,7),r),Ee):(await o.appendAudit({id:X,at:Ee.server_time,tenant:t,round_id:S,player_id:r,action:"play.refused",detail:{play_id:Ee.play_id,idempotency_key:$.idempotency_key,reason:"round_version",attempt_spent:!1}}),x("stale","round_version",P.round.version))}}}var Ft,xS,Qf,Qt=v(()=>{"use strict";Yf();mc();fc();Xf();xe();Ft="time_expired";xS="idempotency_conflict",Qf="round_not_found"});function RO(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"}:zt(e)?{ok:!1,reason:Ft}: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 LO(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(x=>r.targets.includes(x)&&!i.has(x)),s=t.picks.filter(x=>!r.targets.includes(x)),u=o.attempts_used+1,l=o.mistakes_used+(s.length>0?1:0);for(let x of a)i.add(x);let p=i.size>=r.required,h=l>=n.mistakesAllowed,f=u>=n.attemptsAllowed,g=p||h||f,k=e.markAtSettlement?o.score:a.length*r.pointsPerTarget+o.score+(p?r.completionBonus:0),L={...o,server_time:e.now,attempts_used:u,attempts_allowed:n.attemptsAllowed,mistakes_used:l,mistakes_allowed:n.mistakesAllowed,progress:{...o.progress,solved:[...i]},score:k,finished:g,outcome:e.markAtSettlement?"pending":p?"won":g?"lost":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:L}:{outcome:"accepted",marked:!0,feedback:t.picks.map(x=>({key:x,verdict:r.targets.includes(x)?"correct":"wrong"})),next:L}}function DO(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 eg,tg=v(()=>{"use strict";Qt();eg={archetype:"hunt",admissible:RO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return LO({...e,attempt:{picks:t}})},initialState:DO,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 ng(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 jO(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 MO(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.picksAllowed?{ok:!1,reason:"picks_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function UO(e){let{secret:t,state:r,limits:o}=e,n=ng(r),i=x=>({outcome:"rejected",reason:x,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,u=a.entries.find(x=>x.key===s);if(!u)return i("not_on_slate");let l=n.total+u.value,p=l>t.target,h=[...n.picks,{slate:a.id,key:u.key,label:u.label,value:u.value}],f=r.attempts_used+1,g=f>=o.picksAllowed,k=p||g,L={...r,server_time:e.now,attempts_used:f,attempts_allowed:o.picksAllowed,progress:{total:l,picks:h,bust:p,...k?{tier:jO(t,l)}:{}},score:e.markAtSettlement?r.score:p?t.target-l:l,finished:k,outcome:e.markAtSettlement?"pending":p?"lost":k?"won":"incomplete"};return e.markAtSettlement?{outcome:"accepted",marked:!1,feedback:[],next:L}:{outcome:"accepted",marked:!0,feedback:[{key:u.key,verdict:p?"wrong":"correct",label:String(u.value)}],next:L}}function zO(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 rg,og=v(()=>{"use strict";Qt();rg={archetype:"push",admissible:MO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return UO({...e,attempt:{picks:t}})},initialState:zO,auditDetail({secret:e,before:t,decision:r}){let o=ng(t),n=ng(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 BO(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"}:zt(e)?{ok:!1,reason:Ft}: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 WO(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(P=>!i.has(P.key)),u=s.find(P=>FO(P.members,t.picks)),l=o.attempts_used+1,p=o.mistakes_used+(u?0:1);u&&(i.add(u.key),a.push({key:u.key,label:u.label,members:[...u.members]}));let h=i.size>=r.groups.length,f=p>=n.mistakesAllowed,g=l>=n.attemptsAllowed,k=h||f||g,L=e.markAtSettlement?o.score:o.score+(u?r.pointsPerGroup:0)+(h?r.completionBonus:0),b={...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:L,finished:k,outcome:e.markAtSettlement?"pending":h?"won":k?"lost":"incomplete"};if(e.markAtSettlement)return{outcome:"accepted",marked:!1,feedback:[],next:b};let x=s.reduce((P,ae)=>Math.max(P,GO(t.picks,ae)),0),S=!u&&t.picks.length>1&&x===t.picks.length-1,$=u?"correct":S?"close":"wrong";return{outcome:"accepted",marked:!0,feedback:t.picks.map((P,ae)=>({key:P,verdict:$,...u&&ae===0?{label:u.label}:{}})),next:b}}function KO(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 FO,GO,ES,$S=v(()=>{"use strict";Qt();FO=(e,t)=>e.length===t.length&&new Set([...e,...t]).size===e.length,GO=(e,t)=>new Set(e.filter(r=>t.members.includes(r))).size;ES={archetype:"group",admissible:BO,mark(e){let t=Array.isArray(e.payload.picks)?e.payload.picks:[];return WO({...e,attempt:{picks:t}})},initialState:KO,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 ZO(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 HO(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 VO(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"attempts_exhausted"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function YO(e){let{attempt:t,secret:r,state:o,limits:n}=e,i=ZO(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 u=r.questions.find(p=>!HO(p,i[p.id]));if(u)return{outcome:"rejected",reason:u.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:JO(r,i),next:TS(r,l,i)}}function JO(e,t){return e.questions.map(r=>{let o=t[r.id],n=Fs(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 TS(e,t,r){let o=0,n=!0;for(let i of e.questions){let a=Fs(i,r[i.id],e.pointsForCorrect);o+=a,a!==Fs(i,i.result,e.pointsForCorrect)&&(n=!1)}return{...t,score:o,finished:!0,outcome:n?"won":o>0?"partial":"lost"}}function qO(e){let{secret:t,state:r}=e;if(t.questions.some(n=>n.result===void 0))return r;let o=XO(r);return Object.keys(o).length===0?{...r,server_time:e.now,finished:!0,outcome:"lost"}:{...TS(t,r,o),server_time:e.now}}function XO(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 QO(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 AS,IS=v(()=>{"use strict";xe();Qt();AS={archetype:"predict",admissible:VO,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 YO({...e,attempt:r?{answers:r}:{pick:o}})},initialState:QO,settle:qO,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 eN(e){let t=e.rows*e.columns;return e.centreMode==="free"?t-1:t}function ig(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 tN(e){let r=e.progress?.chosen;return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:void 0}function nN(e){let t=ig(e),r=tN(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 rN(e){let t=eN(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),u=r.splice(s,1)[0];o.push(u.key),n[u.key]=u.label,u.note&&(i[u.key]=u.note)}return{board:o,cards:n,notes:i}}function PS(e,t){return e.length===0?!1:e.every(r=>t?.[r]==="correct")}function oN(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,u=(p,h)=>{if(i&&p===a&&h===s)return t.centre;let f=p*o+h,g=i&&f>a*o+s?1:0;return t.cells[f-g]},l=[];for(let p of e.lineTypes)if(p==="row")for(let h=0;h<r;h++)l.push(Array.from({length:o},(f,g)=>u(h,g)).filter(f=>!!f));else if(p==="column")for(let h=0;h<o;h++)l.push(Array.from({length:r},(f,g)=>u(g,h)).filter(f=>!!f));else if(p==="diagonal"&&r===o)l.push(Array.from({length:r},(h,f)=>u(f,f)).filter(h=>!!h)),l.push(Array.from({length:r},(h,f)=>u(f,r-1-f)).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 iN(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"}:yc({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 aN(e){let{secret:t,state:r,limits:o}=e;if(ig(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 u=0;u<n;u++){let l=rN(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 sN(e){let{secret:t,state:r}=e,o=ig(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 cN(e){let{secret:t,state:r}=e;if(!r.finished)return r;let o=nN(r);if(o===void 0)return r;let n=oN(t,o),i=n.filter(f=>PS(f,t.cardStatus)).length,a=[...o.cells,...o.centre?[o.centre]:[]],s=a.length>0&&a.every(f=>t.cardStatus?.[f]==="correct"),u=a.some(f=>t.cardStatus?.[f]===void 0),l=i*t.pointsPerLine+(s?t.pointsForFullBoard:0),p={};for(let f of a){let g=t.cardStatus?.[f];g&&(p[f]=g)}let h=n.map(f=>{let g=PS(f,t.cardStatus),k=f.filter(b=>t.cardStatus?.[b]==="correct").length,L=f.some(b=>t.cardStatus?.[b]==="incorrect");return{cards:f,complete:g,oneAway:!g&&!L&&k===f.length-1}});return{...r,server_time:e.now,score:l,progress:{...r.progress,marks:p,lines:h},outcome:u?"pending":i>0||s?"won":"lost"}}function lN(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 dN(e){return e.op==="deal"||e.op==="reshuffle"?aN({secret:e.secret,state:e.state,limits:e.limits,now:e.now}):e.op==="lock"?sN({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 CS,OS=v(()=>{"use strict";Qt();CS={archetype:"bingo",admissible:iN,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}:dN({op:t,centre:e.payload.centre,board:e.payload.board,secret:e.secret,state:e.state,limits:e.limits,now:e.now})},initialState:lN,settle:cN,auditDetail({decision:e,payload:t}){return{op:t.op,accepted:e.outcome==="accepted",...e.outcome==="rejected"?{refused:e.reason}:{}}}}});import{createHmac as uN}from"node:crypto";function ki(e,t,r){return uN("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 RS(e){let t=NS[e.profile];return{targetX:ki(e,"keeper_x",2*t.diveMaxX+1)-t.diveMaxX,targetY:ki(e,"keeper_y",t.diveMaxY-t.diveMinY+1)+t.diveMinY,reactionMs:ki(e,"keeper_reaction",t.reactionMaxMs-t.reactionMinMs+1)+t.reactionMinMs,dispersionX:ki(e,"dispersion_x",2001)-1e3,dispersionY:ki(e,"dispersion_y",2001)-1e3}}function LS(e,t,r){let o=NS[r],n=Lt,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),u=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),f=Math.floor(h*o.speedPerSecond/1e3),g=t.targetX-n.keeperStart.x,k=t.targetY-n.keeperStart.y,L=Math.round(Math.hypot(g,k)),b=L===0?0:Math.min(1,f/L),x=n.keeperStart.x+Math.trunc(g*b),S=n.keeperStart.y+Math.trunc(k*b),$={startX:n.keeperStart.x,startY:n.keeperStart.y,endX:x,endY:S,diveStartMs:t.reactionMs},j={endX:u,endY:l,arcHeight:p},P=(Oe,_t)=>({result:Oe,replay:{flightMs:a,ball:j,keeper:$,contact:_t}}),ae=Math.abs(u),oe=ae+i>=n.postX&&ae-i<=n.postX+n.postWidth&&l-i<=n.barY+n.barHeight,de=l+i>=n.barY&&l-i<=n.barY+n.barHeight&&ae-i<=n.postX+n.postWidth;return oe?P("frame",{with:"post",x:Math.sign(u||1)*n.postX,y:l,atMs:a}):de?P("frame",{with:"bar",x:u,y:n.barY,atMs:a}):ae+i<n.postX&&l+i<n.barY?Math.abs(u-x)<=o.reachX+i&&Math.abs(l-S)<=o.reachY+i?P("saved",{with:"keeper",x:u,y:l,atMs:a}):P("goal",null):P("wide",null)}var NS,DS=v(()=>{"use strict";Wr();NS={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 pN(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 hN(e){return typeof e=="string"&&/^[0-9a-f]{64}$/.test(e)}function mN(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"}:zt(e)?{ok:!1,reason:Ft}:e.state.attempts_used>=e.limits.attemptsAllowed?{ok:!1,reason:"shootout_spent"}:{ok:!0}:{ok:!1,reason:"round_closed"}}function fN(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 gN(e){let{secret:t,state:r,limits:o}=e,n=S=>({outcome:"rejected",reason:S,marked:!1,feedback:[],next:r});if(!hN(t.entropy))return n("entropy_missing");if(t.model!==bn)return n("unknown_model");let i=df.safeParse(e.payload.op===void 0?{...e.payload,op:Br}:e.payload);if(!i.success)return n(fN(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=RS({entropy:t.entropy,roundId:r.round_id,playerId:r.player_id,model:t.model,profile:t.profile,shotIndex:a.shotIndex}),u=LS({aimX:a.aimX,aimY:a.aimY,power:a.power},s,t.profile),l=pN(r,t),p=u.result==="goal",h=p?t.pointsPerGoal:0,f=l.goals+(p?1:0),g={shotIndex:a.shotIndex,aimX:a.aimX,aimY:a.aimY,power:a.power,result:u.result,points:h,replay:u.replay},k=r.attempts_used+1,L=k>=o.attemptsAllowed,b={...r,server_time:e.now,attempts_used:k,attempts_allowed:o.attemptsAllowed,progress:{...l,goals:f,shots:[...l.shots,g]},score:f*t.pointsPerGoal,finished:L,outcome:L?f>=t.goalsToWin?"won":"lost":"incomplete"};return{outcome:"accepted",marked:!0,feedback:[{key:`shot-${a.shotIndex}`,verdict:p?"correct":"wrong",label:u.result}],next:b}}function yN(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??bn,profile:t.profile??li,goals:0,shots:[]},score:0,score_revision:0,finished:!1,outcome:"incomplete"}}var jS,MS=v(()=>{"use strict";xe();Qt();DS();jS={archetype:"shoot",admissible:mN,mark:gN,initialState:yN,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??Br,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 vN(e){return US[Ge(e)]}function zS(e){return vN(e.archetype??"hunt")}function FS(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 US,rr,vc=v(()=>{"use strict";xe();tg();og();$S();IS();OS();MS();US={hunt:eg,push:rg,group:ES,predict:AS,bingo:CS,shoot:jS},rr=Object.keys(US)});function GS(e){let t=zS(e.round);if(t)return SS({...e,rules:t})}var BS=v(()=>{"use strict";Qt();vc();tg();og();Qt()});function WS(e){let t=new Map,r=new Map,o=(b,x)=>`${x}#${b}`,n=new Map,i=new Map,a=new Map,s=new Map,u=new Map,l=new Set,p=new Map,h=new Map,f=new Map,g=e.currentRoundId,k,L=e.now??Date.now;for(let b of e.rounds)t.set(b.round.id,b);for(let b of e.states??[])n.set(Re(e.tenant,b.round_id,b.player_id),{state:b,version:0});return{async getRound(b,x){let S=t.get(x);return S?structuredClone(S):void 0},async putRound(b,x,S){for(let $=0;$<hc;$+=1)r.set(o(x.round.id,$),{version:x.round.version,accepting:x.round.can.accepting_plays});t.set(x.round.id,{...structuredClone(x),sharded:!0}),S&&(g=x.round.id,k=void 0)},async setRotation(b,x,S){k={roundIds:[...x],windowSeconds:S}},async getCurrentRound(){let b=k?k.roundIds[Math.floor(L()/1e3/k.windowSeconds)%k.roundIds.length]:g,x=t.get(b);return x?structuredClone(x):void 0},async listRounds(){return[...t.values()].map(b=>structuredClone(b))},async listStatesForPlayer(b,x){return[...n.entries()].filter(([S,$])=>S.startsWith(`${b}#`)&&$.state.player_id===x).map(([,S])=>structuredClone(S.state))},async getState(b,x,S){let $=n.get(Re(b,x,S));return $?structuredClone($):void 0},async putStateIfVersion(b,x,S){let $=Re(b,x.round_id,x.player_id),j=n.get($);return S===void 0?j?!1:(n.set($,{state:structuredClone(x),version:0}),!0):!j||j.version!==S?!1:(n.set($,{state:structuredClone(x),version:j.version+1}),!0)},async getPlay(b,x,S){let $=i.get(Re(b,x,S));return $?structuredClone($):void 0},async putPlayIfAbsent(b,x,S,$){let j=Re(b,x,S);return i.has(j)?!1:(i.set(j,structuredClone($)),!0)},async getLeaderboard(b,x,S){if(e.leaderboard)return structuredClone(e.leaderboard);let $=[...a.entries()].filter(([P])=>P.startsWith(Re(b,x)+"#")).map(([P,ae])=>({rank:0,player_id:P.slice(P.lastIndexOf("#")+1),display_name:gc(P.slice(P.lastIndexOf("#")+1)),score:ae})).sort((P,ae)=>ae.score-P.score).map((P,ae)=>({...P,rank:ae+1})),j=S?.limit??$.length;return{server_time:"",snapshot:"",round_id:x,order:"high_first",tie_break:"earliest_play",entries:$.slice(0,j),total:$.length,truncated:!1,me:S?.viewerId?$.find(P=>P.player_id===S.viewerId):void 0}},async getProfile(b,x){let S=f.get(Re(b,x));return S?structuredClone(S):e.profile?structuredClone(e.profile):{server_time:"",snapshot:"",player_id:x,played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}}},async countPlay(b,x,S,$){let j=Re(b,x,S,String(wi($))),P=(s.get(j)??0)+1;return s.set(j,P),{inBucket:P,buckets:hc}},async getDailyActivity(b,x){return x.map(S=>({date:S,plays:u.get(Re(b,S))??0,players:null}))},async markMonthlyPlayer(b,x,S){let $=`${Re(b,x)}#${S}`;if(l.has($))return;l.add($);let j=Re(b,x);p.set(j,(p.get(j)??0)+1)},async getMonthlyPlayers(b,x){return p.get(Re(b,x))??0},async setFuse(b,x,S){let $=t.get(x);$&&($.fusedUntil=S)},async setResult(b,x,S){let $=t.get(x);if(!$)return;let P=$.secret.questions??[];if(typeof S=="string")P[0]&&(P[0].result=S);else for(let oe of P){let de=S[oe.id];de!==void 0&&(oe.result=de)}let ae=P.every(oe=>oe.result!==void 0);$.round.challenge={...$.round.challenge,...ae?{questions:P.map(oe=>({...$.round.challenge.questions?.find(de=>de.id===oe.id),id:oe.id,result:oe.result})),...typeof S=="string"?{result:S}:{}}:{}},$.round.can={...$.round.can,accepting_plays:!1,results_available:!0,solution_revealed:!0,closed:!0};for(let oe=0;oe<hc;oe+=1){let de=r.get(o(x,oe));de&&(de.accepting=!1)}},async recordScore(b,x,S,$){a.set(Re(b,x,S),$)},async appendAudit(b){if(h.has(b.id))throw bS("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 x=Re(b.tenant,b.playerId,b.idempotencyKey);if(i.has(x))return{ok:!1,reason:"play_exists"};let S=Re(b.tenant,b.state.round_id,b.state.player_id),$=n.get(S);if(b.expectedVersion===void 0){if($)return{ok:!1,reason:"state_version"}}else if(!$||$.version!==b.expectedVersion)return{ok:!1,reason:"state_version"};for(let P of b.audit)if(h.has(P.id))throw new Error("audit_record_exists");if(b.round?.sharded){let P=r.get(o(b.round.roundId,wi(b.playerId)));if(!P||P.version!==b.round.version||!P.accepting)return{ok:!1,reason:"round_changed"}}else if(b.round){let P=t.get(b.round.roundId);if(!P||P.round.version!==b.round.version||!P.round.can.accepting_plays)return{ok:!1,reason:"round_changed"}}i.set(x,structuredClone(b.play)),n.set(S,{state:structuredClone(b.state),version:b.expectedVersion===void 0?0:b.expectedVersion+1});for(let P of b.audit)h.set(P.id,structuredClone(P));b.score&&a.set(Re(b.tenant,b.score.roundId,b.playerId),b.score.score),b.profile&&f.set(Re(b.tenant,b.playerId),structuredClone(b.profile));let j=Re(b.tenant,b.date);return u.set(j,(u.get(j)??0)+1),{ok:!0}}}}var Re,KS=v(()=>{"use strict";Xf();Yf();fc();Re=(...e)=>e.join("#")});import{randomBytes as bN}from"node:crypto";function wN(e,t){return{archetype:"hunt",round:{server_time:"",snapshot:t,id:wn(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},limits:{attemptsAllowed:e.attemptsAllowed,mistakesAllowed:e.mistakesAllowed,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function _N(e,t){return{archetype:"push",round:{server_time:"",snapshot:t,id:wn(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}},secret:{target:e.target,targetLabel:e.targetLabel,slates:e.slates,tiers:e.tiers,floorLabel:e.floorLabel,bustLabel:e.bustLabel,...e.line?{line:e.line}:{}},limits:{picksAllowed:e.slates.length,...e.playsPerSecond===void 0?{}:{playsPerSecond:e.playsPerSecond},...e.playsPerDay===void 0?{}:{playsPerDay:e.playsPerDay}}}}function kN(e,t){return{archetype:"group",round:{server_time:"",snapshot:t,id:wn(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}}}}function xN(e,t){let r=L_(e),o=r.every(i=>i.result!==void 0);return{archetype:"predict",round:{server_time:"",snapshot:t,id:wn(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}}}}function SN(e,t){let r=TN(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 EN(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:wn(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}}}}function $N(e,t){return{archetype:"shoot",round:{server_time:"",snapshot:t,id:wn(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:[et.aimX.min,et.aimX.max],aim_y:[et.aimY.min,et.aimY.max],power:[et.power.min,et.power.max]},geometry:{post_x:Lt.postX,bar_y:Lt.barY,post_width:Lt.postWidth,bar_height:Lt.barHeight,ball_radius:Lt.ballRadius,keeper_start:{x:Lt.keeperStart.x,y:Lt.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}}}}function TN(e,t){switch(e.archetype){case"hunt":return wN(e,t);case"push":return _N(e,t);case"group":return kN(e,t);case"predict":return xN(e,t);case"bingo":return EN(e,t);case"shoot":return $N(e,t)}}function AN(){return bN(32).toString("hex")}function IN(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 eo(e){return e===null||typeof e!="object"?JSON.stringify(e):Array.isArray(e)?`[${e.map(eo).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)}:${eo(o)}`).join(",")}}`}function ZS(e,t,r={}){let o=i=>{let{server_time:a,snapshot:s,...u}=i,{version:l,...p}=u;if(!r.ignoringSettlement)return p;let{results_available:h,solution_revealed:f,...g}=p.can;return{...p,can:g}},n=i=>{if(!r.ignoringSettlement)return i;let{cardStatus:a,...s}=i??{};return s};return eo({round:o(e.round),secret:n(e.secret),limits:e.limits,archetype:e.archetype})===eo({round:o(t.round),secret:n(t.secret),limits:t.limits,archetype:t.archetype??"hunt"})}function PN(e,t){if(e.archetype!=="bingo"||!ZS(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)||eo(n[i])!==eo(a))return!1;return Object.keys(n).length>Object.keys(o).length}async function ag(e,t,r,o,n=!0,i,a,s){let u=i??wn(r),l=await e.getRound(t,u),p=IN(SN(r,o),l,s?.newEntropy??AN);if(p.round.id=u,a&&(p.round.origin=a),l&&ZS(p,l)){let{fusedUntil:g,...k}=l;return await e.putRound(t,{...k,archetype:p.archetype},n),{roundId:u,version:l.round.version,changed:!1,current:n}}if(l&&PN(p,l)){let g=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),await e.appendAudit({id:`round_${u}_settle_${g}`,at:new Date().toISOString(),tenant:t,round_id:u,player_id:null,action:"round.settled",detail:{version:l.round.version,resolved:g,snapshot:o}}),{roundId:u,version:l.round.version,changed:!1,current:n}}let h=l?l.round.version+1:1,f={round:{...p.round,version:h},secret:p.secret,limits:p.limits,archetype:p.archetype};return await e.putRound(t,f,n),await e.appendAudit({id:`round_${u}_v${h}`,at:new Date().toISOString(),tenant:t,round_id:u,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:u,version:h,changed:!0,current:n}}var HS=v(()=>{"use strict";xe()});function YS(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 VS,CN,lB,JS=v(()=>{"use strict";at();VS="/play/v1/games/{game}/gfx/leaderboard",CN=c.object({external_id:c.string(),name:c.string().min(1),primary_score:c.number()}),lB=c.object({generated_at:c.string(),last_updated:c.string(),round_id:c.string().optional(),order:c.string(),entries:c.array(CN),withheld:c.number().int().nonnegative()})});function bt(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}async function XS(e,t,r,o){let n=e.path.replace(/\/+$/,"")||e.path;if(e.method==="OPTIONS")return{status:204,headers:sg,body:void 0};if(e.method==="GET"&&n===`${Vs}/health`)return ct(200,{status:"ok"});let i=wt.session.exec(n);if(i){if(e.method!=="POST")return Gt(405,"method_not_allowed","This route accepts POST.");let s=decodeURIComponent(i[1]),u=o?.check(Nf(s,Of(e)));if(u&&!u.allowed)return qS(u.retryAfterSeconds);let l=r?.issue(s);return l?ct(200,{server_time:"",snapshot:"",token:l.token,player_id:l.playerId,kind:"anonymous"}):Gt(503,"unavailable","This deployment cannot issue a session.",!0)}let a=[["runtime",wt.runtime],["currentRound",wt.currentRound],["rounds",wt.rounds],["roundsMine",wt.roundsMine],["nextRound",wt.nextRound],["plays",wt.plays],["roundState",wt.roundState],["profile",wt.profile],["graphicsFeed",wt.graphicsFeed],["leaderboard",wt.leaderboard],["round",wt.round]];for(let[s,u]of a){let l=u.exec(n);if(!l)continue;let p=decodeURIComponent(l[1]),h=l[2]?decodeURIComponent(l[2]):void 0,f=o?.check(Nf(p,Of(e)));if(f&&!f.allowed)return qS(f.retryAfterSeconds);let g=s==="plays";if(g?e.method!=="POST":e.method!=="GET")return Gt(405,"method_not_allowed",`This route accepts ${g?"POST":"GET"}.`);let k;try{k=await t.forPlayer(p,e)}catch(L){return In({path:e.path,method:e.method,game:p,stage:"resolve",name:nr(L)}),Gt(503,"unavailable","The Engine is briefly unavailable.",!0)}if(!k)return Gt(404,"not_found",`No game with id "${p}".`);try{switch(s){case"runtime":return ct(200,await k.getRuntime());case"currentRound":return ct(200,await k.getCurrentRound());case"rounds":return ct(200,await k.getRoundPool());case"roundsMine":return ct(200,await k.getPlayedRounds());case"nextRound":return ct(200,await k.getNextRound());case"round":{let L=await k.getRound(h);return L?ct(200,L):Gt(404,"not_found","No such round.")}case"roundState":return ct(200,await k.getRoundState(h));case"profile":return ct(200,await k.getProfile());case"leaderboard":return ct(200,await k.getLeaderboard());case"graphicsFeed":{let L=await k.getLeaderboard(),b=YS(L,new Date().toISOString()),x=ct(200,b);return x.headers["cache-control"]="public, max-age=5",x}case"plays":{let L=Gk.safeParse(e.body);if(!L.success)return Gt(422,"invalid_request",L.error.issues.map(S=>`${S.path.join(".")||"body"}: ${S.message}`).join("; "));let b=await k.play(h,L.data),x=ct(200,b);return b.outcome==="busy"&&b.retry_after_seconds&&(x.headers["retry-after"]=String(b.retry_after_seconds)),x}}}catch(L){return L instanceof Error&&L.message==="round_not_found"?Gt(404,"not_found","No such round."):(In({path:e.path,method:e.method,game:p,name:nr(L)}),Gt(500,"internal","Something went wrong at our end.",!0))}}return ON}var sg,ct,Gt,wt,ON,qS,QS=v(()=>{"use strict";xe();JS();fc();sg={"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"},ct=(e,t)=>({status:e,headers:{"content-type":"application/json",...sg},body:t}),Gt=(e,t,r,o=!1)=>ct(e,{error:{code:t,message:r,retryable:o}});wt={runtime:bt(Ie.runtime),currentRound:bt(Ie.currentRound),rounds:bt(Ie.rounds),roundsMine:bt(Ie.roundsMine),nextRound:bt(Ie.nextRound),round:bt(Ie.round),plays:bt(Ie.plays),roundState:bt(Ie.roundState),profile:bt(Ie.profile),leaderboard:bt(Ie.leaderboard),graphicsFeed:bt(VS),session:bt(Ie.session)},ON=Gt(404,"not_found","No such route on the player API."),qS=e=>({status:429,headers:{"content-type":"application/json","retry-after":String(e),...sg},body:{error:{code:"rate_limited",message:"Too many requests for this game from one caller. Slow down.",retryable:!0}}})});function wc(...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 en(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 or,xi,bc,fB,to=v(()=>{or=new TextEncoder,xi=new TextDecoder,bc=new TextDecoder("utf-8",{fatal:!0}),fB=2**32});function NN(e,t){if(t&&!e.usages.includes(t))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function eE(e,t,r){let o=e.algorithm;if(o.name!==t.name)throw _c(t.name);if(t.hash&&o.hash?.name!==t.hash)throw _c(t.hash,"algorithm.hash");if(t.namedCurve&&o.namedCurve!==t.namedCurve)throw _c(t.namedCurve,"algorithm.namedCurve");if(t.length!==void 0&&o.length!==t.length)throw _c(t.length,"algorithm.length");NN(e,r)}var _c,tE=v(()=>{_c=(e,t="algorithm.name")=>new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)});function nE(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 rE,cg,lg=v(()=>{rE=(e,...t)=>nE("Key must be ",e,...t),cg=(e,t,...r)=>nE(`Key for the ${e} algorithm must be `,t,...r)});var He,mt,Si,kc,Le,Se,Pn,Ei,no,xc,Sc,Ec,nt=v(()=>{He=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)}},mt=class extends He{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}},Si=class extends He{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}},kc=class extends He{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},Le=class extends He{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Se=class extends He{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Pn=class extends He{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},Ei=class extends He{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},no=class extends He{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)}},xc=class extends He{[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)}},Sc=class extends He{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(t="request timed out",r){super(t,r)}},Ec=class extends He{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(t="signature verification failed",r){super(t,r)}}});var ro,dg,ug,pg=v(()=>{ro=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},dg=e=>e?.[Symbol.toStringTag]==="KeyObject",ug=e=>ro(e)||dg(e)});function hg(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 $c(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 mg=v(()=>{});function $i(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:xi.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=xi.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 $c(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function oo(e){let t=e;return typeof t=="string"&&(t=or.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):hg(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Ti=v(()=>{to();mg()});function Tt(e){if(!RN(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 Tc(...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 RN,fg,oE,iE,aE,Cn=v(()=>{RN=e=>typeof e=="object"&&e!==null;fg=e=>Tt(e)&&typeof e.kty=="string",oE=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),iE=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,aE=e=>e.kty==="oct"&&typeof e.k=="string"});function gg(e,t){if(e)throw new TypeError(`${t} can only be called once`)}function yg(e,t,r){try{return $i(e)}catch{throw new r(`Failed to base64url decode the ${t}`)}}function sE(e,t,r){try{return en(e)}catch{throw new r(`The ${t} is not a valid base64url string`)}}function cE(e,t,r){let o;try{o=JSON.parse(bc.decode($i(e)))}catch{throw new t(r)}if(!Tt(o))throw new t(r);return o}var vg=v(()=>{Ti();to();Cn()});function jN(e,t){if(!e.kty.includes(t.kty))throw new Le(DN);return e.subtleFor?.({kty:t.kty,crv:t.crv})??e.subtle}async function Ac(e,t){if(t.kty==="RSA"&&"oth"in t&&t.oth!==void 0)throw new Le('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');let r=jN(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 DN,bg=v(()=>{nt();DN='Invalid or unsupported JWK "alg" (Algorithm) Parameter value'});function zN(e,t,r){return e.symmetric?MN(e,t,r):UN(e,t,r)}function uE(e,t){return Pc||=new WeakMap,Pc.get(e)?.[t]}function pE(e,t,r){let o=Pc.get(e);return o?o[t]=r:Pc.set(e,{[t]:r}),r}async function Cc(e,t,r){let o=zN(e,t,r);switch(o.kind){case dE:case _g:return o.key;case Ic:{if(o.key.k)return $i(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 lE(o.key,o.key,e)}case kg:{let n=o.key;return n.type==="secret"?n.export():"toCryptoKey"in n&&typeof n.toCryptoKey=="function"?GN(n,e):lE(n,n.export({format:"jwk"}),e)}}}var io,wg,MN,UN,dE,_g,kg,Ic,Pc,FN,lE,GN,xg=v(()=>{lg();pg();Cn();Ti();bg();io=e=>e[Symbol.toStringTag],wg=(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},MN=(e,t,r)=>{let{alg:o}=e;if(t instanceof Uint8Array)return{kind:dE,key:t};if(fg(t)){if(aE(t)&&wg(e,t,r))return{kind:Ic,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(!ug(t))throw new TypeError(cg(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 ro(t)?{kind:_g,key:t}:{kind:kg,key:t}},UN=(e,t,r)=>{let{alg:o}=e;if(fg(t))switch(r){case"decrypt":case"sign":if(oE(t)&&wg(e,t,r))return{kind:Ic,key:t};throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(iE(t)&&wg(e,t,r))return{kind:Ic,key:t};throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!ug(t))throw new TypeError(cg(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 ro(t)?{kind:_g,key:t}:{kind:kg,key:t}},dE=Symbol(),_g=Symbol(),kg=Symbol(),Ic=Symbol();FN={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};lE=async(e,t,r)=>{let o=uE(e,r.alg);if(o)return o;let n=await Ac(r,{...t,alg:r.alg});return pE(e,r.alg,n)},GN=(e,t)=>{let r=uE(e,t.alg);if(r)return r;let o=e.type==="public",n=o?t.usages.public:t.usages.private,{asymmetricKeyType:i}=e,a=FN[e.asymmetricKeyDetails?.namedCurve],s=t.subtleFor?.({crv:a,asymmetricKeyType:i})??t.subtle;return pE(e,t.alg,e.toCryptoKey(s,o,n))}});function Ai(e){let t={__proto__:null};for(let r of Object.keys(e))t[r]={...e[r],alg:r};return t}var Sg=v(()=>{});function Oc(e){return{kty:["RSA"],subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:BN,minModulusLength:2048,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function Nc(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 Le('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:WN,kwBits:e,keyOps:{decrypt:"deriveBits"}}}function Eg(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-KW",length:e},usages:Rc,keyOps:{encrypt:"wrapKey",decrypt:"unwrapKey"}}}function $g(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:Rc,gcmkw:`A${e}GCM`,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}}}function Tg(e,t){return{kty:["oct"],symmetric:!0,subtle:{name:"PBKDF2"},usages:Rc,pbes2Hash:`SHA-${e}`,kwBits:t,keyOps:{encrypt:"deriveBits",decrypt:"deriveBits"}}}function Ag(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM",length:e},usages:hE,keyOps:mE,cekBits:e,ivBits:96,cbc:!1}}function Ig(e){return{kty:["oct"],symmetric:!0,subtle:{name:"AES-CBC",length:e},usages:hE,keyOps:mE,cekBits:e,ivBits:128,cbc:!0}}function fE(e){return KN[e]}var BN,WN,Rc,KN,hE,mE,UB,gE=v(()=>{nt();Sg();BN={public:["encrypt","wrapKey"],private:["decrypt","unwrapKey"]},WN={public:[],private:["deriveBits"]},Rc={public:[],private:[]};KN=Ai({dir:{kty:["oct"],symmetric:!0,subtle:{name:"AES-GCM"},usages:Rc,keyOps:{encrypt:"encrypt",decrypt:"decrypt"}},"RSA-OAEP":Oc(1),"RSA-OAEP-256":Oc(256),"RSA-OAEP-384":Oc(384),"RSA-OAEP-512":Oc(512),"ECDH-ES":Nc(),"ECDH-ES+A128KW":Nc(128),"ECDH-ES+A192KW":Nc(192),"ECDH-ES+A256KW":Nc(256),A128KW:Eg(128),A192KW:Eg(192),A256KW:Eg(256),A128GCMKW:$g(128),A192GCMKW:$g(192),A256GCMKW:$g(256),"PBES2-HS256+A128KW":Tg(256,128),"PBES2-HS384+A192KW":Tg(384,192),"PBES2-HS512+A256KW":Tg(512,256)}),hE={public:[],private:[]},mE={encrypt:"encrypt",decrypt:"decrypt"};UB=Ai({A128GCM:Ag(128),A192GCM:Ag(192),A256GCM:Ag(256),"A128CBC-HS256":Ig(256),"A192CBC-HS384":Ig(384),"A256CBC-HS512":Ig(512)})});function ZN(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 HN(e,t,r){eE(t,e.subtle,r),e.minModulusLength&&ZN(e.alg,t)}async function yE(e,t,r){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,e.subtle,!1,[r]):(HN(e,t,r),t)}async function vE(e,t,r){let o=await yE(e,t,"sign"),n=await crypto.subtle.sign(e.operation,o,r);return new Uint8Array(n)}async function bE(e,t,r,o){let n=await yE(e,t,"verify");try{return await crypto.subtle.verify(e.operation,n,r,o)}catch{return!1}}var Pg=v(()=>{tE()});function wE(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 _E(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 Dc(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 Le(`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 Lc,Cg=v(()=>{nt();Lc=new Map([["b64",!0]])});function Og(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],symmetric:!0,subtle:t,operation:t,usages:Ii}}function ao(e,t,r){let o={name:e,hash:`SHA-${t}`};return{kty:["RSA"],subtle:o,operation:r?{...o,saltLength:r}:o,usages:Ii,minModulusLength:2048}}function Ng(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},operation:{name:"ECDSA",hash:`SHA-${t}`},usages:Ii}}function kE(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,operation:e,usages:Ii}}function Rg(e){let t={name:e};return{kty:["AKP"],subtle:t,operation:t,usages:Ii}}function jc(e){let t=xE[e];if(!t)throw new Le(`alg ${e} is not supported either by JOSE or your javascript runtime`);return t}function Mc(e){return xE[e]}var Ii,xE,Pi=v(()=>{nt();Sg();Ii={public:["verify"],private:["sign"]};xE=Ai({HS256:Og(256),HS384:Og(384),HS512:Og(512),RS256:ao("RSASSA-PKCS1-v1_5",256),RS384:ao("RSASSA-PKCS1-v1_5",384),RS512:ao("RSASSA-PKCS1-v1_5",512),PS256:ao("RSA-PSS",256,32),PS384:ao("RSA-PSS",384,48),PS512:ao("RSA-PSS",512,64),ES256:Ng("P-256",256),ES384:Ng("P-384",384),ES512:Ng("P-521",512),EdDSA:kE(),Ed25519:kE(),"ML-DSA-44":Rg("ML-DSA-44"),"ML-DSA-65":Rg("ML-DSA-65"),"ML-DSA-87":Rg("ML-DSA-87")})});function SE(e){return{algorithms:e&&wE("algorithms",e.algorithms),crit:e?.crit}}async function VN(e,t,r){let o={};e.protected&&(o=cE(e.protected,Se,"JWS Protected Header is invalid"));let n;if(e.header!==void 0){if(!Tc(o,e.header))throw new Se("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");n={...o,...e.header}}else n=o;let i=Dc(Se,Lc,t.crit,o,n),a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Se('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Se('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(t.algorithms&&!t.algorithms.has(s))throw new kc('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new Se("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new Se("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof r=="function"&&(r=await r(o,e),u=!0);let l=jc(s),p=wc(e.protected!==void 0?en(e.protected):new Uint8Array,en("."),typeof e.payload=="string"?a?t.b64p??=sE(e.payload,"payload",Se):or.encode(e.payload):e.payload),h=yg(e.signature,"signature",Se),f=await Cc(l,r,"verify");if(!await bE(l,f,h,p))throw new Ec;let k;return a?k=yg(e.payload,"payload",Se):typeof e.payload=="string"?k=or.encode(e.payload):k=e.payload,{payload:k,parsedProt:o,b64:a,key:f,resolvedKey:u}}async function EE(e,t,r){if(e instanceof Uint8Array&&(e=xi.decode(e)),typeof e!="string")throw new Se("Compact JWS must be a string or Uint8Array");let{0:o,1:n,2:i,length:a}=e.split(".");if(a!==3)throw new Se("Invalid Compact JWS");return VN({payload:n,protected:o,signature:i},t,r)}var $E=v(()=>{Pg();Pi();nt();to();vg();Cn();Cg();xg()});function Ci(e){let t=qN.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*AE);break;case"hour":case"hours":case"hr":case"hrs":case"h":n=Math.round(r*IE);break;case"day":case"days":case"d":n=Math.round(r*Lg);break;case"week":case"weeks":case"w":n=Math.round(r*YN);break;default:n=Math.round(r*JN);break}return t[1]==="-"||t[4]==="ago"?-n:n}function tn(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}function PE(e,t,r={}){let o;try{o=JSON.parse(bc.decode(t))}catch{}if(!Tt(o))throw new Pn("JWT Claims Set must be a top-level JSON object");let{typ:n}=r;if(n&&(typeof e.typ!="string"||TE(e.typ)!==TE(n)))throw new mt('unexpected "typ" JWT header value',o,"typ","check_failed");let{requiredClaims:i=[],issuer:a,subject:s,audience:u,maxTokenAge:l}=r,p=[...i];l!==void 0&&p.push("iat"),u!==void 0&&p.push("aud"),s!==void 0&&p.push("sub"),a!==void 0&&p.push("iss");for(let k of new Set(p.reverse()))if(!(k in o))throw new mt(`missing required "${k}" claim`,o,k,"missing");if(a!==void 0&&!(Array.isArray(a)?a:[a]).includes(o.iss))throw new mt('unexpected "iss" claim value',o,"iss","check_failed");if(s!==void 0&&o.sub!==s)throw new mt('unexpected "sub" claim value',o,"sub","check_failed");if(u!==void 0&&!XN(o.aud,typeof u=="string"?[u]:u))throw new mt('unexpected "aud" claim value',o,"aud","check_failed");let h;switch(typeof r.clockTolerance){case"string":h=Ci(r.clockTolerance);break;case"number":h=r.clockTolerance;break;case"undefined":h=0;break;default:throw new TypeError("Invalid clockTolerance option type")}tn("clockTolerance option",h);let{currentDate:f}=r,g=tn("currentDate option",On(f||new Date));if((o.iat!==void 0||l!==void 0)&&typeof o.iat!="number")throw new mt('"iat" claim must be a number',o,"iat","invalid");if(o.nbf!==void 0){if(typeof o.nbf!="number")throw new mt('"nbf" claim must be a number',o,"nbf","invalid");if(o.nbf>g+h)throw new mt('"nbf" claim timestamp check failed',o,"nbf","check_failed")}if(o.exp!==void 0){if(typeof o.exp!="number")throw new mt('"exp" claim must be a number',o,"exp","invalid");if(o.exp<=g-h)throw new Si('"exp" claim timestamp check failed',o,"exp","check_failed")}if(l!==void 0){let k=g-o.iat,L=typeof l=="number"?l:Ci(l);if(k-h>L)throw new Si('"iat" claim timestamp check failed (too far in the past)',o,"iat","check_failed");if(k<0-h)throw new mt('"iat" claim timestamp check failed (it should be in the past)',o,"iat","check_failed")}return o}var On,AE,IE,Lg,YN,JN,qN,TE,XN,Uc,Dg=v(()=>{nt();to();Cn();On=e=>Math.floor(e.getTime()/1e3),AE=60,IE=AE*60,Lg=IE*24,YN=Lg*7,JN=Lg*365.25,qN=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;TE=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,XN=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1;Uc=class{#e;constructor(t){if(!Tt(t))throw new TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(t)}data(){return or.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=tn("setNotBefore",t):t instanceof Date?this.#e.nbf=tn("setNotBefore",On(t)):this.#e.nbf=On(new Date)+Ci(t)}set exp(t){typeof t=="number"?this.#e.exp=tn("setExpirationTime",t):t instanceof Date?this.#e.exp=tn("setExpirationTime",On(t)):this.#e.exp=On(new Date)+Ci(t)}set iat(t){t===void 0?this.#e.iat=On(new Date):t instanceof Date?this.#e.iat=tn("setIssuedAt",On(t)):typeof t=="string"?this.#e.iat=tn("setIssuedAt",On(new Date)+Ci(t)):this.#e.iat=tn("setIssuedAt",t)}}});async function jg(e,t,r){let o=await EE(e,SE(r),t);if(!o.b64)throw new Pn("JWTs MUST NOT use unencoded payload");let i={payload:PE(o.parsedProt,o.payload,r),protectedHeader:o.parsedProt};return typeof t=="function"?{...i,key:o.key}:i}var CE=v(()=>{$E();Dg();nt()});function zc(e){return e?.b64===!1&&Array.isArray(e.crit)&&e.crit.includes("b64")}async function OE(e,t){let{protectedHeader:r,unprotectedHeader:o}=e;if(!Tc(r,o))throw new Se("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...r,...o};_E(Se,r);let i=Dc(Se,Lc,e.crit,r,n),a=!0;if(i.has("b64")&&(a=r.b64,typeof a!="boolean"))throw new Se('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=n;if(typeof s!="string"||!s)throw new Se('JWS "alg" (Algorithm) Header Parameter missing or invalid');let u=jc(s),l,p;if(a){let x=e.encoded??={};x.b64??=oo(e.payload),x.raw??=en(x.b64),l=x.b64,p=x.raw}else p=e.payload,l="";let h,f;r?(h=oo(JSON.stringify(r)),f=en(h)):(h="",f=new Uint8Array);let g=wc(f,en("."),p),k=await Cc(u,t,"sign"),L=await vE(u,k,g),b={signature:oo(L),payload:l};return r&&(b.protected=h),b}var Fc=v(()=>{Ti();Pg();Pi();Cn();nt();to();Cg();xg()});var Gc,NE=v(()=>{nt();Fc();vg();Gc=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 gg(this.#t,"setProtectedHeader"),this.#t=t,this}setUnprotectedHeader(t){return gg(this.#n,"setUnprotectedHeader"),this.#n=t,this}async sign(t,r){if(!this.#t&&!this.#n)throw new Se("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");let o=await OE({payload:this.#e,protectedHeader:this.#t,unprotectedHeader:this.#n,crit:r?.crit},t);return this.#n&&(o.header=this.#n),o}}});var Bc,RE=v(()=>{NE();Fc();Bc=class{#e;#t;constructor(t){this.#e=new Gc(t)}setProtectedHeader(t){return this.#e.setProtectedHeader(t),this.#t=t,this}async sign(t,r){if(zc(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 Oi,LE=v(()=>{RE();Fc();nt();Dg();Oi=class{#e;#t;constructor(t={}){this.#t=new Uc(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 Bc(this.#t.data());if(o.setProtectedHeader(this.#e),zc(this.#e))throw new Pn("JWTs MUST NOT use unencoded payload");return o.sign(t,r)}}});function DE(){return new Le('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}function jE(e){if(typeof e!="string")throw DE();let t=Mc(e)??fE(e);if(!t)throw DE();return t}var ME=v(()=>{nt();Pi();gE()});function tR(e){Ri(e,48,"Invalid PKCS#8 structure"),Ni(e),Ri(e,2,"Expected version field");let t=Ni(e);e.pos+=t,Ri(e,48,"Expected algorithm identifier");let r=Ni(e);return{algIdStart:e.pos,algIdLength:r}}var Mg,QN,Ug,Ni,Ri,UE,eR,nR,rR,oR,zE,FE=v(()=>{mg();nt();ME();Mg=(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},QN=e=>({data:e,pos:0}),Ug=e=>{let t=e.data[e.pos++];if(t===void 0)throw new Error("Unexpected end of ASN.1 input");return t},Ni=e=>{let t=Ug(e);if(t&128){let r=t&127,o=0;for(let n=0;n<r;n++)o=o<<8|Ug(e);return o}return t},Ri=(e,t,r)=>{if(Ug(e)!==t)throw new Error(r)},UE=(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},eR=e=>{Ri(e,6,"Expected algorithm OID");let t=Ni(e);return UE(e,t)};nR=e=>{let t=eR(e);if(Mg(t,[43,101,110]))return"X25519";if(!Mg(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Ri(e,6,"Expected curve OID");let r=Ni(e),o=UE(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(Mg(o,i))return n;throw new Error("Unsupported named curve")},rR=async(e,t,r,o)=>{let n=jE(r);if(n.symmetric)throw new Le('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 Le("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)},oR=(e,t)=>$c(e.replace(t,"")),zE=(e,t,r)=>{let o=oR(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),n=r;return t?.startsWith?.("ECDH-ES")&&(n||={},n.getNamedCurve=i=>{let a=QN(i);return tR(a),nR(a)}),rR("pkcs8",o,t,n)}});function iR(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}async function aR(e){if(dg(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:oo(e)};if(!ro(e))throw new TypeError(rE(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}=iR(await crypto.subtle.exportKey("jwk",e));return i.kty==="AKP"&&(i.alg=o),i}async function zg(e){return aR(e)}var GE=v(()=>{lg();Ti();pg()});function sR(e){let t=typeof e=="string"?Mc(e):void 0;if(!t||t.symmetric)throw new Le('Unsupported "alg" value for a JSON Web Key Set');return t}function cR(e){if(!e||typeof e!="object")return!1;let{keys:t}=e;return Array.isArray(t)&&t.every(lR)}function lR(e){return Tt(e)}async function BE(e,t,r){let o=e.get(t)||e.set(t,{}).get(t);if(o[r.alg]===void 0){let n=await Ac(r,{...t,alg:r.alg,ext:!0});if(n.type!=="public")throw new Ei("JSON Web Key Set members must be public keys");o[r.alg]=n}return o[r.alg]}function Gg(e){let t=new Fg(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 Fg,WE=v(()=>{bg();Pi();nt();Cn();Fg=class{#e;#t=new WeakMap;constructor(t){if(!cR(t))throw new Ei("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=sR(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:u}=a;if(u===0)throw new no;if(u!==1){let l=new xc,p=this.#t;throw l[Symbol.asyncIterator]=async function*(){for(let h of a)try{yield await BE(p,h,i)}catch{}},l}return BE(this.#t,s,i)}}});function dR(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}async function uR(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 Sc:i});if(n.status!==200)throw new He("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await n.json()}catch{throw new He("Failed to parse the JSON Web Key Set HTTP response as JSON")}}function pR(e,t){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=t||!("jwks"in e)||!Tt(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,Tt))}function Kg(e,t){let r=new Wg(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 Bg,KE,Wc,Wg,ZE=v(()=>{nt();WE();Cn();(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Bg="jose/v6.2.5");KE=Symbol();Wc=Symbol();Wg=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),Bg&&!this.#o.has("User-Agent")&&this.#o.set("User-Agent",Bg),this.#o.has("accept")||(this.#o.set("accept","application/json"),this.#o.append("accept","application/jwk-set+json")),this.#l=r?.[KE],r?.[Wc]!==void 0&&(this.#s=r?.[Wc],pR(r?.[Wc],this.#c)&&(this.#i=this.#s.uat,this.#a=Gg(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 no&&this.coolingDown()===!1)return await this.reload(),this.#a(t,r);throw o}}async reload(){this.#r&&dR()&&(this.#r=void 0),this.#r||=uR(this.#e.href,this.#o,AbortSignal.timeout(this.#t),this.#l).then(t=>{this.#a=Gg(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 Zg(e,t,r){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return zE(e,t,r)}var HE=v(()=>{FE()});var Hg=v(()=>{CE();LE();ZE();GE();HE()});function hR(e){let t=VE.get(e);return t||(t=Kg(new URL(e)),VE.set(e,t)),t}function YE(e){let t;return{lastRefusal:()=>t,async resolve(r){t=void 0;try{let{payload:o}=await jg(r,hR(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:`${mR}${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 VE,mR,JE=v(()=>{"use strict";Hg();mc();VE=new Map;mR="id:"});import{createPublicKey as fR,generateKeyPairSync as gR}from"node:crypto";async function Vg(e){let t=e.replace(/\/+$/,""),r=t,o=`${t}${Kc}`,{privateKey:n,publicKey:i}=gR("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"pem"}}),a=await Zg(n,"RS256"),s=await zg(fR(i)),u="gamestage-dev",l={keys:[{...s,kid:u,alg:"RS256",use:"sig"}]};return{issuer:r,jwksUri:o,jwks:l,resolver:YE({issuer:r,jwksUri:o}),async mint(p,h={}){let f=Math.floor(Date.now()/1e3);return new Oi({name:p}).setProtectedHeader({alg:"RS256",kid:u}).setIssuer(r).setSubject(p).setIssuedAt(f).setExpirationTime(f+(h.expiresInSeconds??3600)).sign(a)}}}var Kc,Yg=v(()=>{"use strict";Hg();JE();Kc="/.well-known/jwks.json"});import{createServer as yR}from"node:http";import{randomBytes as vR}from"node:crypto";async function wR(e){let t=WS({tenant:e.game,rounds:[],currentRoundId:""});await ag(t,e.game,We.parse(e.round),"local",!0,void 0,{source:"manifest"});for(let[o,n]of(e.alsoRounds??[]).entries())await ag(t,e.game,We.parse(n),`local-${o+2}`,!1,void 0,{source:"manifest"});let r=FS({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 GS({tenant:e.game,playerId:n.playerId??_i(void 0),identityRefusal:n.identityRefusal,runtime:r,store:t,now:e.now,round:{archetype:e.round.archetype}})}}}async function _R(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 Zc(e){let t=await wR(e),r=vR(32).toString("base64"),o={issue:()=>yS(r)},n=e.devIdentity,i=yR((a,s)=>{(async()=>{let u=new URL(a.url??"/","http://localhost");if(n&&u.pathname===Kc){let f=JSON.stringify(n.jwks);s.writeHead(200,{"content-type":"application/jwk-set+json; charset=utf-8","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}if(e.clientBundle&&a.method==="GET"&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(u.pathname)){let f=e.clientBundle;s.writeHead(200,{"content-type":"text/javascript; charset=utf-8","cache-control":"no-store","access-control-allow-origin":"*","content-length":Buffer.byteLength(f)}),s.end(f);return}let l=a.headers[bR],p=a.headers.authorization,h=await XS({method:a.method??"GET",path:u.pathname,body:await _R(a),...(({playerId:f,refused:g})=>({playerId:f,identityRefusal:g}))(await fS({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 bR,Jg=v(()=>{"use strict";xe();BS();vc();KS();HS();QS();mc();Yg();Yg();vc();bR="x-gamestage-player"});import{spawn as kR}from"node:child_process";import{createHash as xR,randomBytes as XE}from"node:crypto";import{constants as SR}from"node:fs";import{access as ER,mkdtemp as $R,rm as QE}from"node:fs/promises";import{request as TR}from"node:http";import{homedir as Hc,tmpdir as AR}from"node:os";import{join as Li}from"node:path";function qg(e,t={}){let r=Buffer.isBuffer(e)?e:Buffer.from(e),o=t.maskingKey??XE(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 ny(e={}){let r=[(e.env??process.env).GAMESTAGE_CHROME,...e.locations??PR].filter(s=>!!s),o;for(let s of[...new Set(r)])try{await ER(s,SR.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 $R(Li(AR(),"gamestage-chrome-")),i=kR(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 OR(await CR(i,1e4));let{targetId:s}=await a.send("Target.createTarget",{url:"about:blank"}),{sessionId:u}=await a.send("Target.attachToTarget",{targetId:s,flatten:!0});return{status:"available",browser:await ty.create(a,u,i,n)}}catch(s){throw a?.close(),await e$(i),await QE(n,{recursive:!0,force:!0}),s}}function CR(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",u),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)),u=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",u);let l=setTimeout(()=>i(()=>o(new Error("Chrome did not open DevTools within 10000ms."))),t)})}function OR(e){return new Promise((t,r)=>{let o=new URL(e),n=XE(16).toString("base64"),i=xR("sha1").update(n+IR).digest("base64"),a=TR({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,u,l)=>{s.headers["sec-websocket-accept"]!==i?(u.destroy(),r(new Error("Chrome returned an invalid WebSocket handshake."))):t(new ey(u,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 e$(e){e.exitCode===null&&(e.kill("SIGTERM"),!await qE(e,1e3)&&(e.kill("SIGKILL"),await qE(e,1e3)))}function qE(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 Xg(e){return new Promise(t=>setTimeout(t,e))}var IR,Qg,ey,ty,PR,t$=v(()=>{"use strict";IR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";Qg=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,u=n&127,l=2;if(u===126){if(this.buffered.length<l+2)break;u=this.buffered.readUInt16BE(l),l+=2}else if(u===127){if(this.buffered.length<l+8)break;let f=this.buffered.readBigUInt64BE(l);if(f>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("WebSocket frame is too large to decode safely.");u=Number(f),l+=8}let p=l;if(s&&(l+=4),this.buffered.length<l+u)break;let h=Buffer.from(this.buffered.subarray(l,l+u));if(s)for(let f=0;f<h.length;f++)h[f]^=this.buffered[p+f%4];if(this.buffered=this.buffered.subarray(l+u),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}},ey=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 Qg;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(qg(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(qg(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(qg(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()}},ty=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,u=s?.exception?.description??s?.text??"Unknown page error";this.pageErrors.push(u.split(`
10179
10179
  `)[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()});let i=a=>{this.inflight.delete(String(a.requestId)),this.lastNetworkActivity=Date.now()};this.on("Network.loadingFinished",i),this.on("Network.loadingFailed",i)}cdp;sessionId;child;profile;pageErrors=[];requests=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){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(`(() => {
10180
10180
  const element = document.querySelectorAll(${JSON.stringify(t)})[${r}];
10181
10181
  if (!element) return false;
@@ -10193,68 +10193,153 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10193
10193
  if ("disabled" in element && element.disabled) return { ok: false, error: "Element is disabled." };
10194
10194
  element.click();
10195
10195
  return { ok: true };
10196
- })()`);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 Kg(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(u),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))}))}),u=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await KE(this.child),await WE(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(u),s(),l()},s=this.on(t,()=>a(n)),u=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 Kg(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 Kg(25)}throw n}},uR=["/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",Ri(Wc(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),Ri(Wc(),"Applications/Chromium.app/Contents/MacOS/Chromium"),Ri(Wc(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),Ri(Wc(),"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 Jg(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function HE(e){let t=Jg(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||fR.test(t)||mR.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function VE(e){for(let t of gR)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 yR(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
10196
+ })()`);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 Xg(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(u),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))}))}),u=setTimeout(()=>a(()=>n(new Error(`Timed out after ${r}ms waiting for a response.`))),r)})}html(){return this.evaluate("document.documentElement.outerHTML")}async close(){this.closed||(this.closed=!0,this.cdp.close(),await e$(this.child),await QE(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(u),s(),l()},s=this.on(t,()=>a(n)),u=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 Xg(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 Xg(25)}throw n}},PR=["/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",Li(Hc(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),Li(Hc(),"Applications/Chromium.app/Contents/MacOS/Chromium"),Li(Hc(),"Applications/Brave Browser.app/Contents/MacOS/Brave Browser"),Li(Hc(),"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 ry(e){return e.replace(/^[\s,.;:)\]}\-+*/=&|]+/,"").replace(/[\s+*/=&|]+$/,"").trim()}function n$(e){let t=ry(e);return!(t.length<2||t.length>160||!/[A-Za-z]/.test(t)||RR.test(t)||NR.some(r=>r.test(t))||!/\s/.test(t)&&t===t.toLowerCase())}function r$(e){for(let t of LR)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 DR(e){let t=[];return e.text.replace(/<script[\s\S]*?<\/script>/gi,n=>`
10197
10197
  `.repeat(n.split(`
10198
10198
  `).length-1)).replace(/<style[\s\S]*?<\/style>/gi,n=>`
10199
10199
  `.repeat(n.split(`
10200
10200
  `).length-1)).split(`
10201
- `).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 u=s.replace(/\s+/g," ");if(!HE(u))continue;let l=Jg(u);t.push({text:l,...VE(l),file:e.relative,line:i+1})}}),t}function vR(e){let t=[];return e.text.split(`
10202
- `).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(!HE(i))continue;let a=Jg(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...VE(a),file:e.relative,line:o+1})}}),t}function Kc(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...yR(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...vR(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 mR,fR,gR,qg=v(()=>{"use strict";mR=[/^(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*$/],fR=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;gR=[{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 p$={};It(p$,{browserCheck:()=>kR,browserChecks:()=>i$,connectionCheck:()=>d$,runVerify:()=>ny,scanPublishSet:()=>u$,shootPlayCheck:()=>l$,verificationResult:()=>o$});import{readFile as Xg}from"node:fs/promises";import{dirname as YE,resolve as Qg}from"node:path";function bR(e){switch(e){case"hunt":return We.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return We.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 We.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 We.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 We.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 wR(e,t,r){return(lx({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=vf[i.key];return a?[[i.key,a]]:[]})}function o$(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function ey(e){return _R.map(t=>({...t,status:"skipped",detail:e}))}async function i$(e,t,r,o){let n;try{n=await Yg()}catch(a){return ey("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 ey(n.detail);let i=n.browser;try{return[await c$(i,e,t,r,o),await d$(i,e)]}finally{await i.close().catch(()=>{})}}async function kR(e,t,r,o){let n;try{n=await Yg()}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 c$(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function xR(e){let t=Date.now()+ty;do{if((await e.query(Li)).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,a$))}while(Date.now()<t)}async function s$(e){for(let t=0;t<3&&!((await e.query(Li)).length>0);t++){let r=await xR(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(Li,5e3).catch(()=>{})}}async function c$(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),Ge(n??"")==="shoot")return await l$(e);await s$(e);let i=await e.query(Li);if(i.length===0){let k=e.pageErrors[0],L=await e.query("#prompt").then(()=>e.html()).then(x=>/id="prompt"[^>]*>([^<]{0,160})/.exec(x)?.[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.${k?` The page threw: ${k}`:L?` The page says: ${L}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let k of i)if(await e.click(Li,k).catch(()=>{}),s+=1,(await e.query(qE)).length>0)break;let u=await e.query(JE);if(u.length===0){let k=Symbol("pending"),L=await Promise.race([a,new Promise(b=>setTimeout(()=>b(k),5e3))]);if(L===k||L===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(qE)).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(JE,u[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(),f=p.round_state?.score,g=f===void 0||h.includes(String(f))||h.includes(f.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:g?"verified":"open",detail:g?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${f} 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 t$(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,a$))}while(Date.now()<o);return!1}async function l$(e){let t="rendered-outcome",r="the screen shows what the server decided",o=b=>({id:t,what:r,status:"open",detail:b});if(!await t$(e,XE,ty)){let b=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."+(b?` The page threw: ${b}`:""))}if(await e.click(XE,0).catch(()=>{}),(await e.query(QE)).length>0&&await e.click(QE,0).catch(()=>{}),!await t$(e,e$,ty))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(e$,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 b=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(b)}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 u=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,l=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+SR,h=await e.html();for(;!l.test(h)&&Date.now()<p;)await new Promise(b=>setTimeout(b,100)),h=await e.html();let f=[...h.matchAll(u)].map(b=>b[1]);if(!l.test(h))return o(`The Engine committed ${s.result} and the page shows ${f.length?f.map(b=>`"${b}"`).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 g=a.round_state?.attempts_used;if(typeof g=="number"&&f.length!==g)return o(`The Engine has taken ${g} shot${g===1?"":"s"} and the page draws ${f.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let k=a.round_state?.score;return k===void 0||h.includes(String(k))||h.includes(k.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 ${k}.`}:o(`The Engine committed a score of ${k} and the page does not show it.`)}async function d$(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await s$(e);let n=await e.html();await e.setOffline(!0);let i=await n$(e,n,3e3);return i?(await e.setOffline(!1),await n$(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 n$(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 $R(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>ER.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function r$(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 u$(e,t){let{files:r,skippedLinks:o}=Uf(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 u=$R(s.relativePath);if(u){i.has(u)||(i.add(u),n.push({path:`${u}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(Df(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=Oe(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=Xr(l,t);if(h.length){n.push({path:s.relativePath,why:Qr(t,h),fatal:!0});continue}let f;try{let g=JSON.parse(l);g&&Array.isArray(g.sourcesContent)&&(f=g)}catch{}if(f){let g=f.sourcesContent.filter(L=>typeof L=="string").join(`
10203
- `),k=g?Xr(g,t):[];if(k.length){n.push({path:s.relativePath,why:`${Qr(t,k)} 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}r$(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)r$(s.relativePath)&&!n.some(u=>u.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 ny(e){await mi();let t=e.manifest??"gamestage.yaml",r,o="";try{o=await Xg(t,"utf8");let J=Oe(o);if(!J.ok)return V(`${t} is not a valid App Manifest.`,J.issues.map(we=>`${C.cyan(we.path)} ${we.message}`));r=J.manifest}catch{return V(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let n=r.backend.round??bR(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(!rr.includes(n.archetype))return V(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${rr.join(", ")}.`]);let a=Qg(e.file??"index.html"),s;try{s=await Xg(a,"utf8")}catch{return V(`Cannot read ${e.file??"index.html"}.`)}let u=[];u.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",f=new RegExp(`^\\s*${l}\\s*:`,"m").test(o);u.push({id:"attempts-cap-chosen",what:"the attempt cap was chosen rather than defaulted",status:r.backend.round&&h?f?"verified":"open":"skipped",detail:r.backend.round?h?f?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 g=Qg(e.dir??YE(a)),k;try{k=await u$(g,n)}catch(J){return V(`Cannot read the publish set at ${e.dir??YE(a)}.`,[J instanceof Error?J.message:"The directory could not be walked."])}let L=k.findings.filter(J=>J.fatal),b=Xr(s,n),x=b.length>0||L.length>0;u.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${k.files.length} file${k.files.length===1?"":"s"}, ${k.read} read)`,status:x?"open":"verified",detail:x?[b.length?Qr(n,b):void 0,...L.map(J=>`${J.path}: ${J.why}`)].filter(Boolean).join(" "):void 0});let S=await lc(k.files),$=S.map(J=>J.text).join(`
10204
- `),j=nc($),I=wR(r,n.archetype,j).filter(([,J])=>!bf($,J)).map(([J])=>J);u.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(j.length?`, and it offers ${j.length} more for controls it has (${j.join(", ")})`:""),status:I.length?"open":"verified",detail:I.length?`The page does not read: ${I.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let ae=Kc(S),de=k.files.some(J=>{let we=J.relativePath.split("/").pop();return we===Te||we===De})||s.includes(Te)||s.includes(De),lt=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);u.push({id:"client-present",what:"the client the page imports is there",status:de||!lt?"verified":"open",detail:lt&&!de?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let Ce=["@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(J=>$.includes(J));u.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:Ce.length===0?"verified":"open",detail:Ce.length===0?void 0:`This game imports ${Ce.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 _t=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test($),ft=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test($);u.push({id:"server-time",what:"a deadline comes from the server's clock",status:_t&&ft?"skipped":"verified",detail:_t&&ft?"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 se=await Bc({game:r.app.id,round:n,title:r.app.title});await new Promise(J=>se.listen(0,"127.0.0.1",()=>J()));let Se=se.address(),q=Se&&typeof Se!="string"?`http://127.0.0.1:${Se.port}`:"",dt=await import("node:http").then(({createServer:J})=>J(async(we,Ye)=>{let Fe=(we.url??"/").split("?")[0],kt=Fe==="/"?a:Qg(a,"..",Fe.slice(1));try{let jn=await Xg(kt);Ye.writeHead(200,{"content-type":kt.endsWith(".js")?"text/javascript":"text/html"}),Ye.end(jn)}catch{Ye.writeHead(404).end()}}));await new Promise(J=>dt.listen(0,"127.0.0.1",()=>J()));let ze=dt.address(),Dn=ze&&typeof ze!="string"?`http://127.0.0.1:${ze.port}/`:"";try{u.push(...e.noBrowser?ey("Asked not to open a browser."):await i$(Dn,q,r.app.id,n.archetype))}finally{se.close(),dt.close()}let _e=o$(u),Ve=k.findings.filter(J=>!J.fatal);if(X()){te({ok:_e.outcome==="verified",outcome:_e.outcome,exitCode:_e.exitCode,checks:u,open:_e.open,skipped:_e.skipped,round:i,copy_candidates:ae,publish_set:{directory:g,files:k.files.map(J=>J.relativePath),read:k.read,warnings:Ve}}),_e.exitCode!==0&&process.exit(_e.exitCode);return}H(_e.outcome==="verified"?"Verified":_e.outcome==="failed"?"Verification failed":"Verification incomplete"),W("round used for verification",i.source),y(` ${C.dim(i.detail)}`);for(let J of u){let we=J.status==="verified"?C.green("ok"):J.status==="open"?C.yellow("open"):C.dim("skipped");W(J.what,we),J.detail&&y(` ${C.dim(J.detail)}`)}if(Ve.length){y(),y(C.dim(" Also in the publish set, and a deploy would upload it:"));for(let J of Ve)y(` ${C.dim("\xB7")} ${C.cyan(J.path)} ${C.dim(J.why)}`)}if(ae.length){y(),y(C.dim(" Copy a producer may need to own:"));for(let J of ae)y(` ${C.dim("\xB7")} ${C.cyan(`${J.file}:${J.line}`)} ${J.text} ${C.dim(`(${J.confidence}, ${J.level})`)}`)}y(),_e.outcome==="verified"?O("The Engine decided the outcome and the page showed it. That is the migration done."):_e.outcome==="failed"?O("A check remains open, so the game failed verification. Read the open check and fix its cause."):O("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),y(),_e.exitCode!==0&&process.exit(_e.exitCode)}var Li,JE,qE,_R,ty,a$,XE,QE,e$,SR,ER,ry=v(()=>{"use strict";ke();Bg();$t();Zt();ZE();Mf();qg();Ff();cc();Pe();Li="button.pick, [data-pick]",JE="#submit, button[type=submit], .submit",qE="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",_R=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];ty=15e3,a$=250;XE="[data-aim]",QE="[data-power]",e$="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",SR=4e3;ER=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var sn=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}},Mn=class extends sn{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var yo=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 Mn(`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 Zi(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as wT}from"node:events";import ol from"node:child_process";import Kt from"node:path";import Vi from"node:fs";import he from"node:process";import{stripVTControlCharacters as _T}from"node:util";import{stripVTControlCharacters as yT}from"node:util";var vo=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=>Zi(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,f){return r.formatItem(h,o,f,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 u=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,f)=>{let g=h.map(k=>i(r.styleOptionTerm(r.optionTerm(k)),r.styleOptionDescription(r.optionDescription(k))));a=a.concat(this.formatItemList(f,g,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,f)=>{let g=h.map(k=>i(r.styleSubcommandTerm(r.subcommandTerm(k)),r.styleSubcommandDescription(r.subcommandDescription(k))));a=a.concat(this.formatItemList(f,g,r))}),a.join(`
10205
- `)}displayWidth(t){return yT(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)),u=2,p=(this.helpWidth??80)-r-u-2,h;return p<this.minWidthToWrap||n.preformatted(o)?h=o:h=n.boxWrap(o,p).replace(/\n/g,`
10201
+ `).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 u=s.replace(/\s+/g," ");if(!n$(u))continue;let l=ry(u);t.push({text:l,...r$(l),file:e.relative,line:i+1})}}),t}function jR(e){let t=[];return e.text.split(`
10202
+ `).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(!n$(i))continue;let a=ry(i),s=r.slice((n.index??0)+n[0].length);/^\s*[:\]]/.test(s)||t.push({text:a,...r$(a),file:e.relative,line:o+1})}}),t}function Vc(e){let t=[];for(let o of e)/\.(html?|svelte|vue)$/i.test(o.relative)&&t.push(...DR(o)),/\.(m?[jt]sx?|svelte|vue)$/i.test(o.relative)&&t.push(...jR(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 NR,RR,LR,oy=v(()=>{"use strict";NR=[/^(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*$/],RR=/[{}<>|]|=>|\(\)|;\s*$|^\s*(function|const|let|var|import|export)\b/;LR=[{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 _$={};It(_$,{browserCheck:()=>FR,browserChecks:()=>m$,connectionCheck:()=>b$,runVerify:()=>ly,scanPublishSet:()=>w$,shootPlayCheck:()=>v$,verificationResult:()=>h$});import{readFile as iy}from"node:fs/promises";import{dirname as o$,resolve as ay}from"node:path";function MR(e){switch(e){case"hunt":return We.parse({archetype:e,number:1,prompt:"Pick the two that belong",board:["alpha","beta","gamma","delta"],targets:["alpha","beta"],open:!0});case"push":return We.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 We.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 We.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 We.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 UR(e,t,r){return(vx({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=Ef[i.key];return a?[[i.key,a]]:[]})}function h$(e){let t=e.filter(o=>o.status==="open").length,r=e.filter(o=>o.status==="skipped").length;return t>0?{outcome:"failed",exitCode:1,open:t,skipped:r}:r>0?{outcome:"unverified",exitCode:2,open:t,skipped:r}:{outcome:"verified",exitCode:0,open:t,skipped:r}}function sy(e){return zR.map(t=>({...t,status:"skipped",detail:e}))}async function m$(e,t,r,o){let n;try{n=await ny()}catch(a){return sy("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 sy(n.detail);let i=n.browser;try{return[await y$(i,e,t,r,o),await b$(i,e)]}finally{await i.close().catch(()=>{})}}async function FR(e,t,r,o){let n;try{n=await ny()}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 y$(i,e,t,r,o)}finally{await i.close().catch(()=>{})}}async function GR(e){let t=Date.now()+cy;do{if((await e.query(Di)).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,f$))}while(Date.now()<t)}async function g$(e){for(let t=0;t<3&&!((await e.query(Di)).length>0);t++){let r=await GR(e);if(r===void 0)break;await e.click("[data-gamestage-start]:not([disabled])",r).catch(()=>{}),await e.waitForSelector(Di,5e3).catch(()=>{})}}async function y$(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),Ge(n??"")==="shoot")return await v$(e);await g$(e);let i=await e.query(Di);if(i.length===0){let k=e.pageErrors[0],L=await e.query("#prompt").then(()=>e.html()).then(x=>/id="prompt"[^>]*>([^<]{0,160})/.exec(x)?.[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.${k?` The page threw: ${k}`:L?` The page says: ${L}`:""}`}}let a=e.waitForResponse({urlIncludes:"/plays",method:"POST",timeout:15e3}).catch(()=>{}),s=0;for(let k of i)if(await e.click(Di,k).catch(()=>{}),s+=1,(await e.query(a$)).length>0)break;let u=await e.query(i$);if(u.length===0){let k=Symbol("pending"),L=await Promise.race([a,new Promise(b=>setTimeout(()=>b(k),5e3))]);if(L===k||L===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(a$)).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(i$,u[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(),f=p.round_state?.score,g=f===void 0||h.includes(String(f))||h.includes(f.toLocaleString("en-US"));return{id:"rendered-outcome",what:"the screen shows what the server decided",status:g?"verified":"open",detail:g?`The play went to the Engine and came back ${p.outcome}.`:`The Engine committed a score of ${f} 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 d$(e,t,r){let o=Date.now()+r;do{if((await e.query(t)).length>0)return!0;await new Promise(n=>setTimeout(n,f$))}while(Date.now()<o);return!1}async function v$(e){let t="rendered-outcome",r="the screen shows what the server decided",o=b=>({id:t,what:r,status:"open",detail:b});if(!await d$(e,s$,cy)){let b=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."+(b?` The page threw: ${b}`:""))}if(await e.click(s$,0).catch(()=>{}),(await e.query(c$)).length>0&&await e.click(c$,0).catch(()=>{}),!await d$(e,l$,cy))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(l$,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 b=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(b)}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 u=/<[a-z][^>]*\sdata-shot-result="([a-z]+)"/g,l=new RegExp(`<[a-z][^>]*\\sdata-shot-result="${s.result}"`),p=Date.now()+BR,h=await e.html();for(;!l.test(h)&&Date.now()<p;)await new Promise(b=>setTimeout(b,100)),h=await e.html();let f=[...h.matchAll(u)].map(b=>b[1]);if(!l.test(h))return o(`The Engine committed ${s.result} and the page shows ${f.length?f.map(b=>`"${b}"`).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 g=a.round_state?.attempts_used;if(typeof g=="number"&&f.length!==g)return o(`The Engine has taken ${g} shot${g===1?"":"s"} and the page draws ${f.length}. A shot on the screen that the Engine never committed is a shot the page invented.`);let k=a.round_state?.score;return k===void 0||h.includes(String(k))||h.includes(k.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 ${k}.`}:o(`The Engine committed a score of ${k} and the page does not show it.`)}async function b$(e,t){let r="connection-noticed",o="the page notices the connection going and coming back";try{await e.navigate(t,2e4),await g$(e);let n=await e.html();await e.setOffline(!0);let i=await u$(e,n,3e3);return i?(await e.setOffline(!1),await u$(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 u$(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 KR(e){let t=e.split("/").slice(0,-1),r=t.findIndex(o=>WR.includes(o));return r===-1?void 0:t.slice(0,r+1).join("/")}function p$(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 w$(e,t){let{files:r,skippedLinks:o}=Zf(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 u=KR(s.relativePath);if(u){i.has(u)||(i.add(u),n.push({path:`${u}/`,why:"a build or history directory; `deploy --dir` would upload it whole",fatal:!1}));continue}if(Bf(s.relativePath)){n.push({path:s.relativePath,why:"environment or credential shaped",fatal:!0});continue}let l=await bi(s.path);if(l===void 0)continue;a+=1;let p=Ne(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=Xr(l,t);if(h.length){n.push({path:s.relativePath,why:Qr(t,h),fatal:!0});continue}let f;try{let g=JSON.parse(l);g&&Array.isArray(g.sourcesContent)&&(f=g)}catch{}if(f){let g=f.sourcesContent.filter(L=>typeof L=="string").join(`
10203
+ `),k=g?Xr(g,t):[];if(k.length){n.push({path:s.relativePath,why:`${Qr(t,k)} 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}p$(s.relativePath)&&n.push({path:s.relativePath,why:"an editor or merge leftover",fatal:!1})}for(let s of r)p$(s.relativePath)&&!n.some(u=>u.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 ly(e){await fi();let t=e.manifest??"gamestage.yaml",r,o="";try{o=await iy(t,"utf8");let J=Ne(o);if(!J.ok)return V(`${t} is not a valid App Manifest.`,J.issues.map(we=>`${O.cyan(we.path)} ${we.message}`));r=J.manifest}catch{return V(`Cannot read ${t}.`,["Run `gamestage inspect .` or `gamestage create` first."])}let n=r.backend.round??MR(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(!rr.includes(n.archetype))return V(`No Engine here serves the ${n.archetype} archetype yet.`,[`Built so far: ${rr.join(", ")}.`]);let a=ay(e.file??"index.html"),s;try{s=await iy(a,"utf8")}catch{return V(`Cannot read ${e.file??"index.html"}.`)}let u=[];u.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",f=new RegExp(`^\\s*${l}\\s*:`,"m").test(o);u.push({id:"attempts-cap-chosen",what:"the attempt cap was chosen rather than defaulted",status:r.backend.round&&h?f?"verified":"open":"skipped",detail:r.backend.round?h?f?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 g=ay(e.dir??o$(a)),k;try{k=await w$(g,n)}catch(J){return V(`Cannot read the publish set at ${e.dir??o$(a)}.`,[J instanceof Error?J.message:"The directory could not be walked."])}let L=k.findings.filter(J=>J.fatal),b=Xr(s,n),x=b.length>0||L.length>0;u.push({id:"solution-absent",what:`the answers are not in what a deploy publishes (${k.files.length} file${k.files.length===1?"":"s"}, ${k.read} read)`,status:x?"open":"verified",detail:x?[b.length?Qr(n,b):void 0,...L.map(J=>`${J.path}: ${J.why}`)].filter(Boolean).join(" "):void 0});let S=await pc(k.files),$=S.map(J=>J.text).join(`
10204
+ `),j=ic($),P=UR(r,n.archetype,j).filter(([,J])=>!$f($,J)).map(([J])=>J);u.push({id:"settings-read",what:"every producer setting the page offers is read by the game"+(j.length?`, and it offers ${j.length} more for controls it has (${j.join(", ")})`:""),status:P.length?"open":"verified",detail:P.length?`The page does not read: ${P.join(", ")}. Apply each setting from game.presentation before deploying.`:void 0});let ae=Vc(S),de=k.files.some(J=>{let we=J.relativePath.split("/").pop();return we===Ae||we===De})||s.includes(Ae)||s.includes(De),lt=s.includes("createPlayerClient")||/\bstart\s*\(/.test(s);u.push({id:"client-present",what:"the client the page imports is there",status:de||!lt?"verified":"open",detail:lt&&!de?"The page uses a Gamestage client but does not import the one we ship. Run `gamestage client`.":void 0});let Oe=["@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(J=>$.includes(J));u.push({id:"client-is-the-door",what:"the game reaches Monterosa through the client, not around it",status:Oe.length===0?"verified":"open",detail:Oe.length===0?void 0:`This game imports ${Oe.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 _t=/\bDate\.now\s*\(|\bnew\s+Date\s*\(\s*\)/.test($),ft=/\blocks_at\b|\bopens_at\b|\bcountdown\b|\bdeadline\b|\btimeRemaining\b/i.test($);u.push({id:"server-time",what:"a deadline comes from the server's clock",status:_t&&ft?"skipped":"verified",detail:_t&&ft?"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 se=await Zc({game:r.app.id,round:n,title:r.app.title});await new Promise(J=>se.listen(0,"127.0.0.1",()=>J()));let Ee=se.address(),X=Ee&&typeof Ee!="string"?`http://127.0.0.1:${Ee.port}`:"",dt=await import("node:http").then(({createServer:J})=>J(async(we,Ye)=>{let Fe=(we.url??"/").split("?")[0],kt=Fe==="/"?a:ay(a,"..",Fe.slice(1));try{let jn=await iy(kt);Ye.writeHead(200,{"content-type":kt.endsWith(".js")?"text/javascript":"text/html"}),Ye.end(jn)}catch{Ye.writeHead(404).end()}}));await new Promise(J=>dt.listen(0,"127.0.0.1",()=>J()));let ze=dt.address(),Dn=ze&&typeof ze!="string"?`http://127.0.0.1:${ze.port}/`:"";try{u.push(...e.noBrowser?sy("Asked not to open a browser."):await m$(Dn,X,r.app.id,n.archetype))}finally{se.close(),dt.close()}let _e=h$(u),Ve=k.findings.filter(J=>!J.fatal);if(q()){Q({ok:_e.outcome==="verified",outcome:_e.outcome,exitCode:_e.exitCode,checks:u,open:_e.open,skipped:_e.skipped,round:i,copy_candidates:ae,publish_set:{directory:g,files:k.files.map(J=>J.relativePath),read:k.read,warnings:Ve}}),_e.exitCode!==0&&await ul(_e.exitCode);return}K(_e.outcome==="verified"?"Verified":_e.outcome==="failed"?"Verification failed":"Verification incomplete"),U("round used for verification",i.source),y(` ${O.dim(i.detail)}`);for(let J of u){let we=J.status==="verified"?O.green("ok"):J.status==="open"?O.yellow("open"):O.dim("skipped");U(J.what,we),J.detail&&y(` ${O.dim(J.detail)}`)}if(Ve.length){y(),y(O.dim(" Also in the publish set, and a deploy would upload it:"));for(let J of Ve)y(` ${O.dim("\xB7")} ${O.cyan(J.path)} ${O.dim(J.why)}`)}if(ae.length){y(),y(O.dim(" Copy a producer may need to own:"));for(let J of ae)y(` ${O.dim("\xB7")} ${O.cyan(`${J.file}:${J.line}`)} ${J.text} ${O.dim(`(${J.confidence}, ${J.level})`)}`)}y(),_e.outcome==="verified"?I("The Engine decided the outcome and the page showed it. That is the migration done."):_e.outcome==="failed"?I("A check remains open, so the game failed verification. Read the open check and fix its cause."):I("No check is open, but the game could not be fully proved here. Run the skipped check before treating it as verified."),y(),_e.exitCode!==0&&await ul(_e.exitCode)}var Di,i$,a$,zR,cy,f$,s$,c$,l$,BR,WR,dy=v(()=>{"use strict";xe();Jg();$t();Zt();t$();Kf();oy();Vf();uc();Ce();Di="button.pick, [data-pick]",i$="#submit, button[type=submit], .submit",a$="#submit:not([disabled]), button[type=submit]:not([disabled]), .submit:not([disabled])",zR=[{id:"rendered-outcome",what:"the screen shows what the server decided"},{id:"connection-noticed",what:"the page notices the connection going and coming back"}];cy=15e3,f$=250;s$="[data-aim]",c$="[data-power]",l$="#shoot:not([disabled]), [data-gamestage-shoot]:not([disabled])",BR=4e3;WR=[".git","node_modules",".next",".nuxt",".svelte-kit","dist","build"]});var sn=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}},Mn=class extends sn{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var vo=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 Mn(`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 Yi(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as MT}from"node:events";import dl from"node:child_process";import Kt from"node:path";import qi from"node:fs";import he from"node:process";import{stripVTControlCharacters as UT}from"node:util";import{stripVTControlCharacters as LT}from"node:util";var bo=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=>Yi(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,f){return r.formatItem(h,o,f,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 u=r.visibleArguments(t).map(h=>i(r.styleArgumentTerm(r.argumentTerm(h)),r.styleArgumentDescription(r.argumentDescription(h))));if(a=a.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),h=>h.helpGroupHeading??"Options:").forEach((h,f)=>{let g=h.map(k=>i(r.styleOptionTerm(r.optionTerm(k)),r.styleOptionDescription(r.optionDescription(k))));a=a.concat(this.formatItemList(f,g,r))}),r.showGlobalOptions){let h=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));a=a.concat(this.formatItemList("Global Options:",h,r))}return this.groupItems(t.commands,r.visibleCommands(t),h=>h.helpGroup()||"Commands:").forEach((h,f)=>{let g=h.map(k=>i(r.styleSubcommandTerm(r.subcommandTerm(k)),r.styleSubcommandDescription(r.subcommandDescription(k))));a=a.concat(this.formatItemList(f,g,r))}),a.join(`
10205
+ `)}displayWidth(t){return LT(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)),u=2,p=(this.helpWidth??80)-r-u-2,h;return p<this.minWidthToWrap||n.preformatted(o)?h=o:h=n.boxWrap(o,p).replace(/\n/g,`
10206
10206
  `+" ".repeat(r+u)),a+s+" ".repeat(u)+h.replace(/\n/g,`
10207
10207
  ${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 u=[s.shift()],l=this.displayWidth(u[0]);s.forEach(p=>{let h=this.displayWidth(p);if(l+h<=r){u.push(p),l+=h;return}i.push(u.join(""));let f=p.trimStart();u=[f],l=this.displayWidth(f)}),i.push(u.join(""))}),i.join(`
10208
- `)}};var cn=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=vT(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 Mn(`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?hy(this.name().replace(/^no-/,"")):hy(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}},Hi=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 hy(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function vT(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}
10208
+ `)}};var cn=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=DT(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 Mn(`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?ky(this.name().replace(/^no-/,"")):ky(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}},Ji=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 ky(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function DT(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}
10209
10209
  - a short flag is a single dash and a single character
10210
10210
  - either use a single dash and a single character (for a short flag)
10211
10211
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(a)?new Error(`${s}
10212
10212
  - too many short flags`):n.test(a)?new Error(`${s}
10213
10213
  - too many long flags`):new Error(`${s}
10214
- - 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 bT(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 rl(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=bT(e,a),u=Math.max(e.length,a.length);(u-s)/u>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?`
10214
+ - 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 jT(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 ll(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=jT(e,a),u=Math.max(e.length,a.length);(u-s)/u>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?`
10215
10215
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
10216
- (Did you mean ${o[0]}?)`:""}var sr=class e extends wT{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=>he.stdout.write(r),writeErr:r=>he.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>he.stdout.isTTY?he.stdout.columns:void 0,getErrHelpWidth:()=>he.stderr.isTTY?he.stderr.columns:void 0,getOutHasColors:()=>fy()??(he.stdout.isTTY&&he.stdout.hasColors?.()),getErrHasColors:()=>fy()??(he.stderr.isTTY&&he.stderr.hasColors?.()),stripColor:r=>_T(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(/([^ ]+) *(.*)/),u=this.createCommand(a);return n&&(u.description(n),u._executableHandler=!0),i.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(i.noHelp||i.hidden),u._executableFile=i.executableFile||null,s&&u.arguments(s),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new vo,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
10217
- - 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 yo(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}'.
10216
+ (Did you mean ${o[0]}?)`:""}var sr=class e extends MT{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=>he.stdout.write(r),writeErr:r=>he.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>he.stdout.isTTY?he.stdout.columns:void 0,getErrHelpWidth:()=>he.stderr.isTTY?he.stderr.columns:void 0,getOutHasColors:()=>Sy()??(he.stdout.isTTY&&he.stdout.hasColors?.()),getErrHasColors:()=>Sy()??(he.stderr.isTTY&&he.stderr.hasColors?.()),stripColor:r=>UT(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(/([^ ]+) *(.*)/),u=this.createCommand(a);return n&&(u.description(n),u._executableHandler=!0),i.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(i.noHelp||i.hidden),u._executableFile=i.executableFile||null,s&&u.arguments(s),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new bo,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
10217
+ - 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 vo(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}'.
10218
10218
  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 sn(t,r,o)),he.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 cn(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}'
10219
10219
  - 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 u=this.getOptionValue(o);i!==null&&t.parseArg?i=this._callParseArg(t,i,u,a):i!==null&&t.variadic&&(i=t._collectValue(i,u)),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 cn)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=(u,l)=>{let p=s.exec(u);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){he.versions?.electron&&(r.from="electron");let n=he.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=he.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":he.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.
10220
- - 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(Vi.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
10220
+ - 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(qi.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
10221
10221
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
10222
10222
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
10223
- - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(p,h){let f=Kt.resolve(p,h);if(Vi.existsSync(f))return f;if(o.includes(Kt.extname(h)))return;let g=o.find(k=>Vi.existsSync(`${f}${k}`));if(g)return`${f}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=Vi.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=Kt.resolve(Kt.dirname(p),a)}if(a){let p=n(a,i);if(!p&&!t._executableFile&&this._scriptPath){let h=Kt.basename(this._scriptPath,Kt.extname(this._scriptPath));h!==this._name&&(p=n(a,`${h}-${t._name}`))}i=p||i}let s=o.includes(Kt.extname(i)),u;he.platform!=="win32"?s?(r.unshift(i),r=my(he.execArgv).concat(r),u=ol.spawn(he.argv[0],r,{stdio:"inherit"})):u=ol.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=my(he.execArgv).concat(r),u=ol.spawn(he.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{he.on(h,()=>{u.killed===!1&&u.exitCode===null&&u.kill(h)})});let l=this._exitCallback;u.on("close",p=>{p=p??1,l?l(new sn(p,"commander.executeSubCommandAsync","(close)")):he.exit(p)}),u.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)he.exit(1);else{let h=new sn(1,"commander.executeSubCommandAsync","(error)");h.nestedError=p,l(h)}}),this.runningCommand=u}_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(f=>f.short).some(f=>/^-\d$/.test(f))):!1,s=null,u=null,l=0;for(;l<t.length||u;){let p=u??t[l++];if(u=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 f=t[l++];f===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,f)}else if(h.optional){let f=null;l<t.length&&(!i(t[l])||a(t[l]))&&(f=t[l++]),this.emit(`option:${h.name()}`,f)}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()}`),u=`-${p.slice(2)}`);continue}}if(/^--[^=]+=/.test(p)){let h=p.indexOf("="),f=this._findOption(p.slice(0,h));if(f&&(f.required||f.optional)){this.emit(`option:${f.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}
10223
+ - ${n}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let o=[".js",".ts",".tsx",".mjs",".cjs"];function n(p,h){let f=Kt.resolve(p,h);if(qi.existsSync(f))return f;if(o.includes(Kt.extname(h)))return;let g=o.find(k=>qi.existsSync(`${f}${k}`));if(g)return`${f}${g}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let p;try{p=qi.realpathSync(this._scriptPath)}catch{p=this._scriptPath}a=Kt.resolve(Kt.dirname(p),a)}if(a){let p=n(a,i);if(!p&&!t._executableFile&&this._scriptPath){let h=Kt.basename(this._scriptPath,Kt.extname(this._scriptPath));h!==this._name&&(p=n(a,`${h}-${t._name}`))}i=p||i}let s=o.includes(Kt.extname(i)),u;he.platform!=="win32"?s?(r.unshift(i),r=xy(he.execArgv).concat(r),u=dl.spawn(he.argv[0],r,{stdio:"inherit"})):u=dl.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,t._name),r.unshift(i),r=xy(he.execArgv).concat(r),u=dl.spawn(he.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{he.on(h,()=>{u.killed===!1&&u.exitCode===null&&u.kill(h)})});let l=this._exitCallback;u.on("close",p=>{p=p??1,l?l(new sn(p,"commander.executeSubCommandAsync","(close)")):he.exit(p)}),u.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)he.exit(1);else{let h=new sn(1,"commander.executeSubCommandAsync","(error)");h.nestedError=p,l(h)}}),this.runningCommand=u}_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(f=>f.short).some(f=>/^-\d$/.test(f))):!1,s=null,u=null,l=0;for(;l<t.length||u;){let p=u??t[l++];if(u=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 f=t[l++];f===void 0&&this.optionMissingArgument(h),this.emit(`option:${h.name()}`,f)}else if(h.optional){let f=null;l<t.length&&(!i(t[l])||a(t[l]))&&(f=t[l++]),this.emit(`option:${h.name()}`,f)}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()}`),u=`-${p.slice(2)}`);continue}}if(/^--[^=]+=/.test(p)){let h=p.indexOf("="),f=this._findOption(p.slice(0,h));if(f&&(f.required||f.optional)){this.emit(`option:${f.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}
10224
10224
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
10225
10225
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
10226
- `),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 he.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()}`,he.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Hi(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(),u=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&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:p||a},n=a=>{let s=o(a),u=s.attributeName();return this.getOptionValueSource(u)==="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=rl(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=rl(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}
10227
- `),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=>Zi(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=Kt.basename(t,Kt.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(he.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.
10226
+ `),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 he.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()}`,he.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Ji(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(),u=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&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:p||a},n=a=>{let s=o(a),u=s.attributeName();return this.getOptionValueSource(u)==="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=ll(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=ll(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}
10227
+ `),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=>Yi(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=Kt.basename(t,Kt.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(he.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.
10228
10228
  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}
10229
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function my(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 fy(){if(he.env.NO_COLOR||he.env.FORCE_COLOR==="0"||he.env.FORCE_COLOR==="false")return!1;if(he.env.FORCE_COLOR||he.env.CLICOLOR_FORCE!==void 0)return!0}var WL=new sr;Zt();Pe();import{mkdir as OT,readFile as NT,writeFile as RT}from"node:fs/promises";import{dirname as LT,join as DT,relative as jT,resolve as MT}from"node:path";async function UT(e,t){let r;try{r=await NT(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function vy(e,t,r){let o=DT(e,t),n=await UT(o,r);try{await OT(LT(o),{recursive:!0}),await RT(o,r,"utf8")}catch{throw V(`Cannot write ${o}.`),new Error("unreachable")}return{where:jT(process.cwd(),o)||t,state:n}}async function by(e){let t=MT(e.out??"."),r=await vy(t,Te,xt),o=await vy(t,De,cr),n=`import { start } from "./${Te}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${De}";`,a=r.state==="same"&&o.state==="same";if(X())return te({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Pt,import:n},{path:o.where,digest:Un,import:i}],path:r.where,digest:Pt,import:n});H(a?"Already current":"Wrote the Gamestage client"),W("Library",`${r.where} (${Pt})`),W("Player client",`${o.where} (${Un})`),y(),O(`Import it: ${C.cyan(n)}`),O(`The player API on its own: ${C.cyan(i)}`),(r.state==="different"||o.state==="different")&&O("An earlier copy was replaced. It is generated, so nothing of yours was in it."),y()}ke();Zt();er();import{stat as PC,writeFile as Jx}from"node:fs/promises";import{createHash as CC}from"node:crypto";var vt="0.34.0",hi="2026-09-09";import{randomUUID as SC}from"node:crypto";var EC=/-[0-9a-f]{4}$/;function ic(e){return`${e}-${SC().replace(/-/g,"").slice(0,4)}`}function Wx(e){return EC.test(e)}$t();var Xt="favicon.svg",gi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
10229
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function xy(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 Sy(){if(he.env.NO_COLOR||he.env.FORCE_COLOR==="0"||he.env.FORCE_COLOR==="false")return!1;if(he.env.FORCE_COLOR||he.env.CLICOLOR_FORCE!==void 0)return!0}var lD=new sr;Zt();Ce();import{mkdir as JT,readFile as qT,writeFile as XT}from"node:fs/promises";import{dirname as QT,join as eA,relative as tA,resolve as nA}from"node:path";async function rA(e,t){let r;try{r=await qT(e,"utf8")}catch{return"absent"}return r===t?"same":"different"}async function Ty(e,t,r){let o=eA(e,t),n=await rA(o,r);try{await JT(QT(o),{recursive:!0}),await XT(o,r,"utf8")}catch{throw V(`Cannot write ${o}.`),new Error("unreachable")}return{where:tA(process.cwd(),o)||t,state:n}}async function Ay(e){let t=nA(e.out??"."),r=await Ty(t,Ae,xt),o=await Ty(t,De,cr),n=`import { start } from "./${Ae}";`,i=`import { createPlayerClient, newIdempotencyKey } from "./${De}";`,a=r.state==="same"&&o.state==="same";if(q())return Q({ok:!0,status:a?"unchanged":"written",files:[{path:r.where,digest:Pt,import:n},{path:o.where,digest:Un,import:i}],path:r.where,digest:Pt,import:n});K(a?"Already current":"Wrote the Gamestage client"),U("Library",`${r.where} (${Pt})`),U("Player client",`${o.where} (${Un})`),y(),I(`Import it: ${O.cyan(n)}`),I(`The player API on its own: ${O.cyan(i)}`),(r.state==="different"||o.state==="different")&&I("An earlier copy was replaced. It is generated, so nothing of yours was in it."),y()}xe();Zt();er();import{stat as YC,writeFile as iS}from"node:fs/promises";import{createHash as JC}from"node:crypto";var vt="0.35.0",mi="2026-09-14";import{randomUUID as BC}from"node:crypto";var WC=/-[0-9a-f]{4}$/;function cc(e){return`${e}-${BC().replace(/-/g,"").slice(0,4)}`}function Qx(e){return WC.test(e)}$t();var Xt="favicon.svg",yi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
10230
10230
  <rect width="32" height="32" rx="7" fill="#1b1c1f"/>
10231
10231
  <path d="m12 8 12 8-12 8Z" fill="#fff"/>
10232
10232
  </svg>
10233
- `;function Rf(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function yi(e){if(Rf(e))return e;let t=`<link rel="icon" href="./${Xt}" type="image/svg+xml">
10234
- `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function IC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Yx(e,t){let r=t.trim();if(!r)return e;let o=IC(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`)}Pe();async function qx(e){try{return await PC(e),!0}catch{return!1}}var tr={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.",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."},sc=Object.keys(bo).map(e=>({format:e,summary:tr[e]}));async function OC(e,t,r){let o=await Ue();if(!o)return!1;Jr();let i=await Hr({baseUrl:Ze,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:${CC("sha256").update(t).digest("hex")}`,conformance:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function Xx(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return V("Give the game a name with --name.");let r=e.format??e.archetype;if(!r){X()&&(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(tr).map(([b,x])=>({archetype:b,summary:x})),formats:Object.entries(tr).map(([b,x])=>({format:b,summary:x})),example:`gamestage create --name "${e.name??t}" --format hunt`}),process.exit(1)),H("Choose how the game is played first"),y(C.dim(` The format decides what the server owns: answers, locks, scoring
10233
+ `;function Ff(e){return/<link\b[^>]*\brel\s*=\s*(?:"[^"]*\bicon\b[^"]*"|'[^']*\bicon\b[^']*'|[^\s>]*\bicon\b[^\s>]*)[^>]*>/i.test(e)}function vi(e){if(Ff(e))return e;let t=`<link rel="icon" href="./${Xt}" type="image/svg+xml">
10234
+ `,r=e.search(/<\/head>/i);return r===-1?t+e:e.slice(0,r)+t+e.slice(r)}function VC(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function oS(e,t){let r=t.trim();if(!r)return e;let o=VC(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`)}Ce();async function aS(e){try{return await YC(e),!0}catch{return!1}}var tr={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.",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."},dc=Object.keys(wo).map(e=>({format:e,summary:tr[e]}));async function qC(e,t,r){let o=await Ue();if(!o)return!1;Jr();let i=await Hr({baseUrl:Ze,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:${JC("sha256").update(t).digest("hex")}`,conformance:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function sS(e){let t=(e.name??"new-game").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(!t)return V("Give the game a name with --name.");let r=e.format??e.archetype;if(!r){q()&&(Q({ok:!1,status:"archetype_required",message:"Choose a format before scaffolding. How the game is played is decided first, on purpose.",archetypes:Object.entries(tr).map(([b,x])=>({archetype:b,summary:x})),formats:Object.entries(tr).map(([b,x])=>({format:b,summary:x})),example:`gamestage create --name "${e.name??t}" --format hunt`}),process.exit(1)),K("Choose how the game is played first"),y(O.dim(` The format decides what the server owns: answers, locks, scoring
10235
10235
  and settlement. Picking it before any client code is what keeps the
10236
- game trustworthy later.`)),y();for(let[b,x]of Object.entries(tr))y(` ${C.cyan(b.padEnd(20))} ${C.dim(x)}`);y(),y(` ${C.dim("Then run:")} ${C.cyan(`gamestage create --name "${e.name??t}" --format <format>`)}`),y(),process.exit(1)}let o=xn.safeParse(r);if(!o.success)return V(`Unknown format "${r}".`,[...Object.keys(tr).map(b=>C.cyan(b)),"",`You are running gamestage ${vt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${C.cyan("npx gamestage@latest create ...")} run the current one`]);let n=bo[o.data];if(!n&&!X())return V(`"${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(bo).map(b=>` ${C.cyan(b.padEnd(10))} ${C.dim(tr[b])}`),"",`${C.dim("Then run:")} ${C.cyan(`gamestage create --name "${e.name??t}" --format hunt`)}`]);let i=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(i&&!e.force&&await qx(i))return V(`${i} 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.","",`${C.cyan(`gamestage manifest validate ${i}`)} check what you have`,`${C.cyan("gamestage start")} find the next step for this directory`,"",C.dim("There is a --force, and it replaces your page and clients as well as the"),C.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let a=ic(t),s=Bs(a,e.name??a);s.app.status="confirmed",s.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],s.experience.status="proposed",s.experience.surfaces=["web-embed"],s.backend.status="confirmed",s.backend.route="managed_runtime",s.backend.archetype=o.data,s.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${o.data}`}],s.identity.status="proposed",s.identity.provider="identify";let u=Sn.parse(s),l=st(u);u.manifest.conformance=l.computed;let p=pi(u),h=!1,f;try{h=await OC(u,p,o.data)}catch(b){f=b instanceof Error?b.message:"The control plane did not answer."}let g=null;i&&(g=i,await Jx(g,p,"utf8"));let k=!!n&&e.write!==!1,L=[];if(k){let b=[["index.html",Yx(yi(n),u.app.title)],[Xt,gi],[Te,xt],[De,cr]];for(let[x,S]of b){if(!e.force&&await qx(x)){L.push(x);continue}await Jx(x,S,"utf8")}}if(X()){te({ok:!0,manifest:u,manifest_yaml:p,written_to:g,conformance:{computed:l.computed,blockers:l.blockers},registered:h,...f?{registration_failed:f}:{},scaffolded:k,files:k?["index.html",Xt,Te,De].filter(b=>!L.includes(b)):[],kept:L,...n?{}:{scaffold_skipped:"no_engine",engines:Object.keys(bo)},next:"gamestage dev"});return}H(`Created ${u.app.title}`),W("Game id",u.app.id),W("Game format",o.data),k&&L.length===0?W("Files","index.html, with the Gamestage client beside it"):k&&W("Kept",`${L.join(", ")} (already here, left as they were)`),W("Authority","managed runtime (server-owned)"),W("Build stage",`${l.computed} ${l.computedName}`),g&&W("Manifest",g),y(h?" Registered in Studio as a draft.":f?` Not registered in Studio: ${f} (${Ze})`:" No account found, so registration was skipped."),H("What the server will own"),y(` ${C.dim(tr[o.data])}`),H("Next"),L.includes("index.html")&&O(`${C.cyan("gamestage inspect .")} find what in your page has to move to the Engine`),O(`${C.cyan("gamestage dev")} run the game locally against the real Engine`),O(`${C.cyan("gamestage manifest validate "+(g??"gamestage.yaml"))} check where it stands`),y()}ke();Zt();$t();Mf();Ff();cc();import{readFileSync as iy}from"node:fs";import{readFile as Di}from"node:fs/promises";import{createInterface as TR}from"node:readline/promises";import{extname as AR,resolve as IR}from"node:path";import{createHash as m$}from"node:crypto";Pe();Of();function ji(e,t){return e.refused?X()?(te({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(H("Not done"),y(` ${e.refused}`),y(),!0):!1}function ay(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=af(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!of(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 f$(e,t=e.playgroundUrl,r){if(W("Game",`${e.name} (${e.id})`),W("State",e.state),r!==void 0){let{stage:o,reason:n}=ay(e,r);W("Serving",o==="prod"?"prod":`dev: ${n}`)}W("Build stage",e.conformance),W("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&W("Playground",t),e.playerEndpoint&&W("Player API",e.playerEndpoint),W("Manage",Kx(e.id)),e.studioUrl&&W("Studio",e.studioUrl),W("Docs",Zx(e.archetype))}async function g$(e){let{client:t,email:r}=await Ie(),o=await ac(t),n=fi(o);if(n.ok||V(n.message,n.next),n.access==="pending"||n.access==="refused"){if(X())return te({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});H("Your account"),W("Signed in as",r),W("Access",n.access),qr(n);return}try{if(e){let l=await t.getGame(e);l||V(...S$(e));let p=await t.getWorkspaceSummary().then(g=>g.tier).catch(()=>{}),{stage:h,reason:f}=ay(l,p);if(X())return te({ok:!0,stage:h,...f?{stageReason:f}:{},game:l});if(H(l.name),f$(l,void 0,p),p===void 0&&W("Serving",`unchecked: ${f}`),l.meters.length){y();for(let g of l.meters){let k=Math.round(Jk(g)*100);W(g.label,`${g.used} of ${g.limit}${g.unit} (${k}%)`)}}y();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(X())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}=ay(l,i.tier);return{...l,stage:p,...h?{stageReason:h}:{}}})}});if(H(i.name),W("Signed in as",r),W("Access",n.access??"not reported by this control plane"),W("Tier",i.tier),W("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),y(),s===0){O("No games yet. `gamestage create` or `gamestage inspect .` starts one."),y();return}for(let l of i.games)W(l.name,`${l.state}${l.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(y(),O(`Showing ${a} of ${s} games.`));let u=Yk(i.meters);if(u.length){y(),H("At a cap");for(let l of u)O(`${l.label}: ${l.used} of ${l.limit}${l.unit}`)}y()}catch(i){Ne(i)}}async function PR(e,t){let r;try{r=await Di(e,"utf8")}catch{t&&V(`Cannot read ${e}.`);return}let o=Oe(r);if(!o.ok){V(`${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 CR(e){try{let t=await lc(zf(e));return nc(t.map(r=>r.text).join(`
10237
- `))}catch{return}}async function OR(e){try{let t=await Di(e,"utf8");return`c${m$("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function NR(e){try{return await Di(e,"utf8")}catch{return}}async function RR(e){try{let t=Oe(await Di(e,"utf8"));return t.ok?st(t.manifest).computed:"L0"}catch{return"L0"}}async function y$(e,t){t.file&&t.dir&&V("Choose either --file or --dir for a deploy, not both.");let{client:r}=await Ie(),o=await PR(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await DR(r,e,t.file,i):t.dir&&(n=await zR(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await OR(a),u=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await RR(a),...await NR(a).then(g=>g===void 0?{}:{manifestSource:g}),offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await CR(t.dir)}:{}});if(ji(u,"deploy"))return;let l=o?u.game.rounds.some(g=>g.id===`round-${o.number}`):null,p=l===!1?[...u.game.logs].reverse().find(g=>g.level==="error"):void 0;if(X())return te({ok:!0,status:"deployed",roundProvisioned:l,...p?{roundError:p.message}:{},game:n?{...u.game,playgroundUrl:n}:u.game});let h=zn(u.game.containerLabel),f=zn(u.game.containerLabel,{lower:!0});if(H("Deployed"),f$(u.game,n),l&&W(h,`${o.number} is live`),y(),u.game.appSpec?.refusal&&(H("But Studio would not take the game's settings"),y(` ${u.game.appSpec.refusal.reason}`),y(),O("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."),O("Deploy again once it is fixed; nothing else needs doing."),y()),await jR(n??u.game.playgroundUrl,u.game.playerEndpoint,e,t.check===!1,u.game.archetype),l===!1){H(`But there is no ${f}`),y(` ${p?.message??`The Engine did not accept the ${f}.`}`),y(),O("Anyone opening the game will find nothing on. Deploy again once it is fixed."),y();return}if(l===null){let g=u.game.rounds?.length??0;O(g?`No ${f} in the manifest, which is right: the game is playing ${g} from Studio.`:`No ${f} in the manifest and none in Studio, so the game has nothing on yet.`)}O("Share the playground URL. It sleeps when idle and wakes on a request."),y()}catch(n){Ne(n)}}async function v$(e){let{client:t}=await Ie();try{let r=await t.archiveGame(e);if(ji(r,"archive"))return;if(X()){te({ok:!0,status:"archived",game:r.game});return}H("Archived"),W("Game",`${r.game.name} (${r.game.id})`),y(),O("Taken off the air. Its record and files are retained outside the served bundle."),y()}catch(r){Ne(r)}}async function b$(e){let{client:t}=await Ie();try{let r=await t.promoteGame(e);if(ji(r,"promote"))return;let o=await t.getWorkspace(),n=af(r.game,o);if(X()){te({ok:!0,status:"promoted",stage:n,game:r.game});return}H("Approved"),W("Game",`${r.game.name} (${r.game.id})`),y(),n==="prod"?O("Live. Your workspace's plan already carries prod."):O("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."),y()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(X()){te({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}H("Not yet"),y(" This control plane does not have promotion yet."),y(),O("Your game is untouched and still serving dev."),O("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),y();return}Ne(r)}}async function w$(e){let{client:t}=await Ie();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){y("Nothing to remove. Every archived game here was deployed at some point.");return}if(!X()){H(`${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,u]of[...a].sort((l,p)=>p[1]-l[1]))O(u>1?`${s} x${u}`:s);y(),O("A live game, or one that ever deployed, is refused by the server."),y()}if(!e.yes){process.stdin.isTTY||V("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=TR({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){y("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}),!X()){H("Removed"),O(`${n} records gone.`);for(let a of i)O(a);y()}}catch(r){Ne(r)}}async function _$(e){let{client:t}=await Ie();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(X()){te({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}H("Not done"),y(` ${o}`),y();return}if(X())return te({ok:!0,workspace:r});H("Plan changed"),W("Plan",r.tier),W("Live games",String(r.liveGameAllowance||"Contracted")),y()}catch(r){Ne(r)}}async function sy(e,t){let{admin:r,email:o}=await Hx();try{let n=await r.setWorkspaceAccess(e,t),i=Vx(n);if(X())return te({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});qr(i),n.changed&&(W("Decided by",o),y())}catch(n){Ne(n)}}async function k$(e){let t;try{t=await Di(e,"utf8")}catch{return V(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=Oe(t);if(!r.ok)return V(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${C.cyan(a.path)} ${a.message}`),"",`${C.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=Tk(o);if(n.length)return V(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await Ie();Jr();try{let a=await i.registerGame($k(o,`sha256:${m$("sha256").update(t).digest("hex")}`));if(ji(a,"register"))return;if(X()){te({ok:!0,status:"registered",game:a.game});return}H("Registered"),W("Game",`${a.game.name} (${a.game.id})`),W("State",a.game.state),W("Conformance",a.game.conformance),y(),O(`${C.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),y()}catch(a){Ne(a)}}async function cy(e,t){let{client:r}=await Ie();try{let o=await r.setAwake(e,t);if(ji(o,t?"wake":"suspend"))return;if(X()){te({ok:!0,status:o.game.state,game:o.game});return}H(t?"Awake":"Suspended"),W("Game",`${o.game.name} (${o.game.id})`),W("State",o.game.state),y(),O(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),y()}catch(o){Ne(o)}}async function x$(e,t){let{client:r}=await Ie();try{let o=await r.getEndpoints(e);if(o||V(...S$(e)),X())return te({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||V(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),y(n);return}H("Endpoints"),W("Player",o.player??"not deployed"),W("Control",o.control??"not deployed"),W("Playground",o.playground??"not deployed"),y()}catch(o){Ne(o)}}function S$(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 E$(e,t){let{client:r}=await Ie();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?Uk(n):{state:"none"},a=zk(i);if(X())return te({ok:!0,lines:o,freshness:i});if(a&&(H("This game is serving a closed round"),y(),O(a),y()),o.length===0){H("No log lines"),y(),O("Nothing yet, or everything is older than the tier's retention."),y();return}for(let s of o){let u=s.roundId?` [${s.roundId}]`:"";y(`${s.at} ${s.level.padEnd(5)}${u} ${s.message}`)}}catch(o){Ne(o)}}function oy(e=gy,t=vt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&V("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",`${qt}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${C.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${C.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function h$(e,t,r=qt){let o=`${r}/client/${t}/${Te}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function $$(e,t,r){let o=`<script>
10236
+ game trustworthy later.`)),y();for(let[b,x]of Object.entries(tr))y(` ${O.cyan(b.padEnd(20))} ${O.dim(x)}`);y(),y(` ${O.dim("Then run:")} ${O.cyan(`gamestage create --name "${e.name??t}" --format <format>`)}`),y(),process.exit(1)}let o=xn.safeParse(r);if(!o.success)return V(`Unknown format "${r}".`,[...Object.keys(tr).map(b=>O.cyan(b)),"",`You are running gamestage ${vt}. If the name you used came from`,"the documentation, this CLI is probably older than it:",`${O.cyan("npx gamestage@latest create ...")} run the current one`]);let n=wo[o.data];if(!n&&!q())return V(`"${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(wo).map(b=>` ${O.cyan(b.padEnd(10))} ${O.dim(tr[b])}`),"",`${O.dim("Then run:")} ${O.cyan(`gamestage create --name "${e.name??t}" --format hunt`)}`]);let i=e.write===!1?null:typeof e.write=="string"?e.write:"gamestage.yaml";if(i&&!e.force&&await aS(i))return V(`${i} 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.","",`${O.cyan(`gamestage manifest validate ${i}`)} check what you have`,`${O.cyan("gamestage start")} find the next step for this directory`,"",O.dim("There is a --force, and it replaces your page and clients as well as the"),O.dim("manifest. Move the directory aside instead if you want a fresh start.")]);let a=cc(t),s=Zs(a,e.name??a);s.app.status="confirmed",s.app.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:"Created with gamestage create"}],s.experience.status="proposed",s.experience.surfaces=["web-embed"],s.backend.status="confirmed",s.backend.route="managed_runtime",s.backend.archetype=o.data,s.backend.provenance=[{kind:"human_decision",owner:"creator",date:new Date().toISOString().slice(0,10),note:`Archetype chosen at create time: ${o.data}`}],s.identity.status="proposed",s.identity.provider="identify";let u=Sn.parse(s),l=st(u);u.manifest.conformance=l.computed;let p=hi(u),h=!1,f;try{h=await qC(u,p,o.data)}catch(b){f=b instanceof Error?b.message:"The control plane did not answer."}let g=null;i&&(g=i,await iS(g,p,"utf8"));let k=!!n&&e.write!==!1,L=[];if(k){let b=[["index.html",oS(vi(n),u.app.title)],[Xt,yi],[Ae,xt],[De,cr]];for(let[x,S]of b){if(!e.force&&await aS(x)){L.push(x);continue}await iS(x,S,"utf8")}}if(q()){Q({ok:!0,manifest:u,manifest_yaml:p,written_to:g,conformance:{computed:l.computed,blockers:l.blockers},registered:h,...f?{registration_failed:f}:{},scaffolded:k,files:k?["index.html",Xt,Ae,De].filter(b=>!L.includes(b)):[],kept:L,...n?{}:{scaffold_skipped:"no_engine",engines:Object.keys(wo)},next:"gamestage dev"});return}K(`Created ${u.app.title}`),U("Game id",u.app.id),U("Game format",o.data),k&&L.length===0?U("Files","index.html, with the Gamestage client beside it"):k&&U("Kept",`${L.join(", ")} (already here, left as they were)`),U("Authority","managed runtime (server-owned)"),U("Build stage",`${l.computed} ${l.computedName}`),g&&U("Manifest",g),y(h?" Registered in Studio as a draft.":f?` Not registered in Studio: ${f} (${Ze})`:" No account found, so registration was skipped."),K("What the server will own"),y(` ${O.dim(tr[o.data])}`),K("Next"),L.includes("index.html")&&I(`${O.cyan("gamestage inspect .")} find what in your page has to move to the Engine`),I(`${O.cyan("gamestage dev")} run the game locally against the real Engine`),I(`${O.cyan("gamestage manifest validate "+(g??"gamestage.yaml"))} check where it stands`),y()}xe();Zt();$t();Kf();Vf();uc();import{readFileSync as py}from"node:fs";import{readFile as ji}from"node:fs/promises";import{createInterface as ZR}from"node:readline/promises";import{extname as HR,resolve as VR}from"node:path";import{createHash as x$}from"node:crypto";Ce();Uf();function Mi(e,t){return e.refused?q()?(Q({ok:!0,status:"refused",action:t,code:e.code,reason:e.refused,game:e.game}),!0):(K("Not done"),y(` ${e.refused}`),y(),!0):!1}function hy(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=hf(e,{tier:t});if(r==="prod")return{stage:r};let o=!!e.prodApproval,n=!pf(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 S$(e,t=e.playgroundUrl,r){if(U("Game",`${e.name} (${e.id})`),U("State",e.state),r!==void 0){let{stage:o,reason:n}=hy(e,r);U("Serving",o==="prod"?"prod":`dev: ${n}`)}U("Build stage",e.conformance),U("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&U("Playground",t),e.playerEndpoint&&U("Player API",e.playerEndpoint),U("Manage",eS(e.id)),e.studioUrl&&U("Studio",e.studioUrl),U("Docs",tS(e.archetype))}async function E$(e){let{client:t,email:r}=await ke(),o=await lc(t),n=gi(o);if(n.ok||V(n.message,n.next),n.access==="pending"||n.access==="refused"){if(q())return Q({ok:!0,status:n.status,access:n.access,...n.code?{code:n.code}:{},message:n.message,next:n.next,email:r});K("Your account"),U("Signed in as",r),U("Access",n.access),qr(n);return}try{if(e){let l=await t.getGame(e);l||V(...N$(e));let p=await t.getWorkspaceSummary().then(g=>g.tier).catch(()=>{}),{stage:h,reason:f}=hy(l,p);if(q())return Q({ok:!0,stage:h,...f?{stageReason:f}:{},game:l});if(K(l.name),S$(l,void 0,p),p===void 0&&U("Serving",`unchecked: ${f}`),l.meters.length){y();for(let g of l.meters){let k=Math.round(ix(g)*100);U(g.label,`${g.used} of ${g.limit}${g.unit} (${k}%)`)}}y();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(q())return Q({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}=hy(l,i.tier);return{...l,stage:p,...h?{stageReason:h}:{}}})}});if(K(i.name),U("Signed in as",r),U("Access",n.access??"not reported by this control plane"),U("Tier",i.tier),U("Games",s===void 0?`${a} listed, and this control plane does not report a total`:`${s} ${s===1?"game":"games"}`),y(),s===0){I("No games yet. `gamestage create` or `gamestage inspect .` starts one."),y();return}for(let l of i.games)U(l.name,`${l.state}${l.playgroundUrl?"":" (never deployed)"}`);s!==void 0&&a<s&&(y(),I(`Showing ${a} of ${s} games.`));let u=ox(i.meters);if(u.length){y(),K("At a cap");for(let l of u)I(`${l.label}: ${l.used} of ${l.limit}${l.unit}`)}y()}catch(i){Pe(i)}}async function YR(e,t){let r;try{r=await ji(e,"utf8")}catch{t&&V(`Cannot read ${e}.`);return}let o=Ne(r);if(!o.ok){V(`${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 JR(e){try{let t=await pc(Hf(e));return ic(t.map(r=>r.text).join(`
10237
+ `))}catch{return}}async function qR(e){try{let t=await ji(e,"utf8");return`c${x$("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function XR(e){try{return await ji(e,"utf8")}catch{return}}async function QR(e){try{let t=Ne(await ji(e,"utf8"));return t.ok?st(t.manifest).computed:"L0"}catch{return"L0"}}async function $$(e,t){t.file&&t.dir&&V("Choose either --file or --dir for a deploy, not both.");let{client:r}=await ke(),o=await YR(t.manifest??"gamestage.yaml",!!t.manifest);try{let n,i={...o?{round:o}:{},...t.allow?.length?{allow:t.allow}:{}};t.file?n=await t1(r,e,t.file,i):t.dir&&(n=await i1(r,e,t.dir,i));let a=t.manifest??"gamestage.yaml",s=t.revision??await qR(a),u=await r.deploy(e,{manifestRevision:s,contentHash:t.hash??`sha256:${s}`,conformance:t.level??await QR(a),...await XR(a).then(g=>g===void 0?{}:{manifestSource:g}),offersPrize:!!t.prize,round:o,...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.dir?{wording:await JR(t.dir)}:{}});if(Mi(u,"deploy"))return;let l=o?u.game.rounds.some(g=>g.id===`round-${o.number}`):null,p=l===!1?[...u.game.logs].reverse().find(g=>g.level==="error"):void 0;if(q())return Q({ok:!0,status:"deployed",roundProvisioned:l,...p?{roundError:p.message}:{},game:n?{...u.game,playgroundUrl:n}:u.game});let h=zn(u.game.containerLabel),f=zn(u.game.containerLabel,{lower:!0});if(K("Deployed"),S$(u.game,n),l&&U(h,`${o.number} is live`),y(),u.game.appSpec?.refusal&&(K("But Studio would not take the game's settings"),y(` ${u.game.appSpec.refusal.reason}`),y(),I("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."),I("Deploy again once it is fixed; nothing else needs doing."),y()),await n1(n??u.game.playgroundUrl,u.game.playerEndpoint,e,t.check===!1,u.game.archetype),l===!1){K(`But there is no ${f}`),y(` ${p?.message??`The Engine did not accept the ${f}.`}`),y(),I("Anyone opening the game will find nothing on. Deploy again once it is fixed."),y();return}if(l===null){let g=u.game.rounds?.length??0;I(g?`No ${f} in the manifest, which is right: the game is playing ${g} from Studio.`:`No ${f} in the manifest and none in Studio, so the game has nothing on yet.`)}I("Share the playground URL. It sleeps when idle and wakes on a request."),y()}catch(n){Pe(n)}}async function T$(e){let{client:t}=await ke();try{let r=await t.archiveGame(e);if(Mi(r,"archive"))return;if(q()){Q({ok:!0,status:"archived",game:r.game});return}K("Archived"),U("Game",`${r.game.name} (${r.game.id})`),y(),I("Taken off the air. Its record and files are retained outside the served bundle."),y()}catch(r){Pe(r)}}async function A$(e){let{client:t}=await ke();try{let r=await t.promoteGame(e);if(Mi(r,"promote"))return;let o=await t.getWorkspace(),n=hf(r.game,o);if(q()){Q({ok:!0,status:"promoted",stage:n,game:r.game});return}K("Approved"),U("Game",`${r.game.name} (${r.game.id})`),y(),n==="prod"?I("Live. Your workspace's plan already carries prod."):I("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."),y()}catch(r){let o=r.status,n=r instanceof Error?r.message:"";if(o===404&&/unknown action/i.test(n)){if(q()){Q({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}K("Not yet"),y(" This control plane does not have promotion yet."),y(),I("Your game is untouched and still serving dev."),I("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),y();return}Pe(r)}}async function I$(e){let{client:t}=await ke();try{let o=(await t.getWorkspace()).games.filter(a=>a.state==="archived"&&!a.playgroundUrl&&!a.playerEndpoint&&!a.space);if(o.length===0){y("Nothing to remove. Every archived game here was deployed at some point.");return}if(!q()){K(`${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,u]of[...a].sort((l,p)=>p[1]-l[1]))I(u>1?`${s} x${u}`:s);y(),I("A live game, or one that ever deployed, is refused by the server."),y()}if(!e.yes){process.stdin.isTTY||V("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let a=ZR({input:process.stdin,output:process.stdout});try{if((await a.question(`Delete ${o.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){y("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(Q({removed:n,refused:i.length}),!q()){K("Removed"),I(`${n} records gone.`);for(let a of i)I(a);y()}}catch(r){Pe(r)}}async function P$(e){let{client:t}=await ke();try{let{workspace:r,refused:o,code:n}=await t.setPlan(e);if(o){if(q()){Q({ok:!0,status:"refused",action:"plan",code:n,reason:o,workspace:r});return}K("Not done"),y(` ${o}`),y();return}if(q())return Q({ok:!0,workspace:r});K("Plan changed"),U("Plan",r.tier),U("Live games",String(r.liveGameAllowance||"Contracted")),y()}catch(r){Pe(r)}}async function my(e,t){let{admin:r,email:o}=await nS();try{let n=await r.setWorkspaceAccess(e,t),i=rS(n);if(q())return Q({ok:!0,status:i.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:i.message});qr(i),n.changed&&(U("Decided by",o),y())}catch(n){Pe(n)}}async function C$(e){let t;try{t=await ji(e,"utf8")}catch{return V(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let r=Ne(t);if(!r.ok)return V(`${e} is not a valid App Manifest.`,[...r.issues.map(a=>`${O.cyan(a.path)} ${a.message}`),"",`${O.cyan(`gamestage manifest validate ${e}`)} the full report`]);let o=r.manifest,n=Dk(o);if(n.length)return V(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let{client:i}=await ke();Jr();try{let a=await i.registerGame(Lk(o,`sha256:${x$("sha256").update(t).digest("hex")}`));if(Mi(a,"register"))return;if(q()){Q({ok:!0,status:"registered",game:a.game});return}K("Registered"),U("Game",`${a.game.name} (${a.game.id})`),U("State",a.game.state),U("Conformance",a.game.conformance),y(),I(`${O.cyan(`gamestage deploy ${a.game.id} --dir .`)} publish it`),y()}catch(a){Pe(a)}}async function fy(e,t){let{client:r}=await ke();try{let o=await r.setAwake(e,t);if(Mi(o,t?"wake":"suspend"))return;if(q()){Q({ok:!0,status:o.game.state,game:o.game});return}K(t?"Awake":"Suspended"),U("Game",`${o.game.name} (${o.game.id})`),U("State",o.game.state),y(),I(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),y()}catch(o){Pe(o)}}async function O$(e,t){let{client:r}=await ke();try{let o=await r.getEndpoints(e);if(o||V(...N$(e)),q())return Q({ok:!0,endpoints:o});if(t==="player"||t==="control"||t==="playground"){let n=o[t];n||V(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),y(n);return}K("Endpoints"),U("Player",o.player??"not deployed"),U("Control",o.control??"not deployed"),U("Playground",o.playground??"not deployed"),y()}catch(o){Pe(o)}}function N$(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 R$(e,t){let{client:r}=await ke();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?Vk(n):{state:"none"},a=Yk(i);if(q())return Q({ok:!0,lines:o,freshness:i});if(a&&(K("This game is serving a closed round"),y(),I(a),y()),o.length===0){K("No log lines"),y(),I("Nothing yet, or everything is older than the tier's retention."),y();return}for(let s of o){let u=s.roundId?` [${s.roundId}]`:"";y(`${s.at} ${s.level.padEnd(5)}${u} ${s.message}`)}}catch(o){Pe(o)}}function uy(e=Ey,t=vt){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&V("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",`${qt}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${O.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${O.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}function k$(e,t,r=qt){let o=`${r}/client/${t}/${Ae}`;return e.replace(/(["'])\.?\/?gamestage\.js\1/g,(n,i)=>`${i}${o}${i}`)}function L$(e,t,r){let o=`<script>
10238
10238
  // Written by \`gamestage deploy\`. Where this game's Engine answers.
10239
10239
  window.GAMESTAGE_API = ${JSON.stringify(t)};
10240
10240
  window.GAMESTAGE_GAME = ${JSON.stringify(r)};
10241
10241
  // This page was deployed, so it may ask which Interaction Cloud project it is.
10242
10242
  window.GAMESTAGE_IC_LOOKUP = true;
10243
10243
  </script>
10244
- `,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 so(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||V(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function Zc(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function LR(e){switch(AR(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 DR(e,t,r,o={}){let n=IR(r),i;try{i=iy(n)}catch{throw V(`Cannot read ${r}.`),new Error("unreachable")}let a=await jf({path:n,relativePath:r},o.round);a&&V(`${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"),u=$$(yi(i.toString("utf8")),`${s.playerApiOrigin}`,t);await so(s.uploadUrl,u,"text/html; charset=utf-8",s.cacheControl);let l=await e.uploadTarget(t,De);await so(l.uploadUrl,cr,"text/javascript; charset=utf-8",l.cacheControl);let p=await e.uploadTarget(t,Te);await so(p.uploadUrl,xt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,Xt);return await so(h.uploadUrl,gi,"image/svg+xml",h.cacheControl),X()||(y(),O(`Uploaded ${r} to ${Zc(s)}`),O(`Wired it to ${s.playerApiOrigin} as "${t}"`),O(`Shipped @monterosa/gamestage beside it (${Pt})`),O(`Shipped the player client beside it (${Un})`)),Zc(s)}async function jR(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(ry(),p$));MR(await i(e,t,r,n))}function MR(e){if(e.status==="verified"){W("Checked","the page loads and plays in a browser"),y();return}if(e.status==="skipped"){O(C.dim(`Not checked in a browser: ${e.detail??""}`.trim())),y();return}H("The published page did not start"),y(` ${e.detail??""}`),y(),O("The files are published, so the game is live and broken rather than unpublished."),O(`${C.cyan("gamestage verify")} the same check, with the rest of them`),y(),process.exitCode=1}function UR(e){for(let t of e.walkedPast)O(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)O(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)O(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&V(`${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 zR(e,t,r,o={}){let n;try{n=zf(r)}catch(x){throw V(x instanceof Error?x.message:`Cannot read ${r}.`),new Error("unreachable")}let i=await nS(n,{...o,exempt:[Te,De]});UR(i);let a=i.publish,s=a.find(x=>x.relativePath==="index.html");s||V(`Directory ${r} must contain an index.html file.`);let u=iy(s.path,"utf8"),l=Rf(u),p=a.some(x=>x.relativePath==="favicon.ico"),h=a.some(x=>x.relativePath===Xt),f=!l&&!p,g=f&&!h,k=oy();if(k!=="0.0.0-test"){let x=`${qt}/client/${k}/${Te}`,S=!1;try{S=(await fetch(x,{method:"HEAD"})).ok}catch{S=!0}S||V(`The client this deploy would pin, ${k}, is not published yet.`,[`Every page uploaded here will import ${x},`,"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>/.","",`${C.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let L;for(let x of a){if(x.relativePath===Te||x.relativePath===De)continue;let S;try{S=await e.uploadTarget(t,x.relativePath)}catch(oe){throw new Error(`${x.relativePath} cannot be published: ${oe instanceof Error?oe.message:String(oe)}`,{cause:oe})}x.relativePath==="index.html"&&(L=S);let $=iy(x.path),j=/\.(m?js)$/i.test(x.relativePath),ae=/\.html$/i.test(x.relativePath)?$$(h$(f&&x.relativePath==="index.html"?yi($.toString("utf8")):$.toString("utf8"),oy()),S.playerApiOrigin,t):j?h$($.toString("utf8"),oy()):$;await so(S.uploadUrl,ae,LR(x.relativePath),S.cacheControl)}if(g){let x=await e.uploadTarget(t,Xt);await so(x.uploadUrl,gi,"image/svg+xml",x.cacheControl)}let b=[...a.map(x=>x.relativePath),...g?[Xt]:[]];try{await e.pruneBundle(t,b);for(let x of i.withheld)O(`Removed ${x.path} from the playground.`)}catch(x){let S=x instanceof Error?x.message:String(x),$=i.withheld.map(j=>j.path);H("The playground still holds files this deploy did not publish"),y(` ${S}`),y(),$.length?(O(`Could not remove ${$.join(", ")} from the playground: ${S}`),O("Anything an earlier deploy put there is still being served.")):O("Anything an earlier deploy put there is still being served."),y(),process.exitCode=1}if(!X()&&L&&(y(),O(`Uploaded ${a.length} files from ${r}`),O(`Playground: ${Zc(L)}`),O(`Wired it to ${L.playerApiOrigin} as "${t}"`),g&&O("Added a replaceable starter favicon")),!L)throw new Error("The directory index was not uploaded.");return Zc(L)}er();ke();import{readFile as n1}from"node:fs/promises";ke();var A$="player-conformance",ly="round-current",FR="sha256:emulator-conformance";function nn(e){return structuredClone(e)}function Bt(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:FR}}var GR="2026-08-01T08:00:00.000Z";function BR(e){let t=e==="per-player-challenge",r=e==="locked";return{...Bt(),id:ly,number:412,version:2,...r?{locks_at:GR}:{},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 T$(e,t){let r=t==="mistakes";return{...Bt(),player_id:A$,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 WR(e){let t=BR(e),r=new Map([[t.id,t]]),o=new Map([[t.id,T$(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",T$("round-revealed",e))),{runtime:{...Bt(),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:{...Bt(),round_id:ly,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...Bt(),player_id:A$,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function Hc(e,t){return{...Bt(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function dy(e){let t=WR(e);return{async getRuntime(){return nn(t.runtime)},async getCurrentRound(){return nn(t.rounds.get(ly))},async getRound(r){let o=t.rounds.get(r);return o?nn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return Hc(t,"round_not_found");let i=Hs({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?Hc(t,"idempotency_conflict"):{...nn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...Bt(),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 Hc(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=Bt().server_time)return Hc(t,"lock_deadline_passed");let s=t.roundStates.get(r),u=t.runtime.marking==="at_settlement",l={...s,...Bt(),attempts_used:s.attempts_used+1,score:s.score+(u?0:10),finished:!u,outcome:u?"pending":"won"},p={...Bt(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!u,feedback:u?[]:[{key:"answer",verdict:"correct"}],round_state:nn(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=Zs(t.profile,l.outcome)),nn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return nn(o)},async getProfile(){return nn(t.profile)},async getLeaderboard(){return nn(t.leaderboard)}}}function KR(){return e=>dy(e)}var eZ=KR();ke();import{createServer as ZR}from"node:http";function ir(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var HR=ir(Ae.runtime),VR=ir(Ae.currentRound),YR=ir(Ae.round),JR=ir(Ae.plays),qR=ir(Ae.roundState),XR=ir(Ae.profile),QR=ir(Ae.leaderboard);function Nn(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function co(e,t,r,o){Nn(e,t,{error:{code:r,message:o,retryable:!1}})}async function e1(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 t1(e,t,r,o){if(!e.url){co(t,400,"invalid_request","The request URL is missing.");return}let i=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(i)){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(HR.test(i)){Nn(t,200,await r.getRuntime());return}if(VR.test(i)){Nn(t,200,await r.getCurrentRound());return}let a=YR.exec(i);if(a){let u=await r.getRound(decodeURIComponent(a[2]));if(!u){co(t,404,"round_not_found","The requested round was not found.");return}Nn(t,200,u);return}let s=qR.exec(i);if(s){let u=decodeURIComponent(s[2]);try{Nn(t,200,await r.getRoundState(u))}catch{co(t,404,"round_not_found","The requested round was not found.")}return}if(XR.test(i)){Nn(t,200,await r.getProfile());return}if(QR.test(i)){Nn(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let a=JR.exec(i);if(a){try{let s=await e1(e);Nn(t,200,await r.play(decodeURIComponent(a[2]),s))}catch(s){co(t,400,"invalid_request",s instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}co(t,404,"not_found","The requested player API route was not found.")}function Vc(e="default",t){let r=dy(e);return ZR((o,n)=>{t1(o,n,r,t).catch(()=>{n.headersSent?n.destroy():co(n,500,"internal_error","The emulator could not answer the request.")})})}Zt();Bg();$t();Pe();async function r1(e){let t;try{t=await n1(e,"utf8")}catch{return}let r=Oe(t);if(!r.ok){V(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${C.cyan(o.path)} ${o.message}`));return}return r.manifest}async function o1(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:Vc(r,xt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await r1(e.manifest??"gamestage.yaml");if(!o)return{server:Vc(r,xt),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:Vc(r,xt),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&V(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),rr.includes(n.archetype)||V(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${rr.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Bc({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:xt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function I$(e){await mi();let t=await o1(e),{server:r}=t,o=()=>new Promise((p,h)=>{r.close(f=>f?h(f):p())}),n=new Promise(p=>{let h=async()=>{process.off("SIGINT",h),process.off("SIGTERM",h),await o(),p()};process.once("SIGINT",h),process.once("SIGTERM",h)});await new Promise((p,h)=>{r.once("error",h),r.listen(Number(e.port),"127.0.0.1",()=>p())});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,u;t.as&&(s=await Fg(a),r.attachDevIdentity?.(s),u=await s.mint(t.as));let l=(await Ue().catch(()=>null))?.email;if(X())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&&u?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:u,required:!0}}:{}});else if(t.what==="engine"){H(t.title??t.game);let p=zn(t.containerLabel);W("Serving",`your ${zn(t.containerLabel,{lower:!0})}, through the real Engine`),W(p,`${t.round.number} (round-${t.round.number})`),W("API",a),W("Game id",t.game),l&&W("Signed in",l),y(),O(`<script src="${a}/gamestage.js"></script>`),O(`window.GAMESTAGE_API = "${a}"`),O(`window.GAMESTAGE_GAME = "${t.game}"`),u&&O(`window.GAMESTAGE_TOKEN = "${u}"`),y(),s&&u&&(W("Playing as",`${t.as} (${C.cyan(`id:${t.as}`)})`),W("Identity","required, so an anonymous play is refused here too"),W("Keys",s.jwksUri),y(),O("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),O(`This harness cannot be deployed: its issuer is a loopback URL, and ${C.cyan("gamestage manifest validate")} refuses a manifest that names one.`),y()),O(`Edit the ${zn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),y()}else H(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),W("API",a),W("Game id",t.game),y(),O(`<script src="${a}/gamestage.js"></script>`),y(),t.fixtureReason==="studio-round"?(O("A round is configured in Studio, but `gamestage dev` cannot reach it."),O("Play the deployed game to use the Studio round. This fixture is only local wiring.")):t.fixtureReason==="unconfigured"?(O("No round is configured in Studio yet. This local run is a Gamestage stand-in, not your game."),O("Set up the first round in Studio, then play the deployed game.")):(O("There is no round here to serve, so this is the shell rather than your game."),O("`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.")),y();await n}ry();ke();Pe();import{stat as i1}from"node:fs/promises";async function P$(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${li} bundled`,blocking:!1});let r=!1;try{await i1("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"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 o=e.filter(n=>!n.ok&&n.blocking);X()&&(te({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),H("Environment");for(let n of e){let i=n.ok?C.green("ok"):n.blocking?C.red("blocked"):C.dim("--");y(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${C.dim(n.detail)}`)}y(),o.length&&(y(` ${C.red("Fix the blocked items above before continuing.")}`),y(),process.exit(1)),y(` ${C.green("Ready.")}`),y()}Gs();ke();er();import{readFile as x1,stat as S1,writeFile as E1}from"node:fs/promises";import{createHash as $1}from"node:crypto";import{basename as T1}from"node:path";$t();qg();Zt();import{readdir as a1,readFile as Yc,stat as uy}from"node:fs/promises";import{createHash as s1}from"node:crypto";import{basename as O$,extname as c1,join as py,relative as l1}from"node:path";var d1=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),u1=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function p1(e){return s1("sha256").update(e).digest("hex").slice(0,16)}var h1={[De]:Un,[Te]:Pt};function m1(e){let t=O$(e.relative),r=h1[t];return!r||p1(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 f1(e,t=200){let r=await uy(e),o=[],n=[],i=s=>{let u=m1(s);u?n.push({file:s.relative,reason:u}):o.push(s)};if(r.isFile())return i({path:e,relative:O$(e),text:await Yc(e,"utf8")}),{files:o,skipped:n};let a=async s=>{if(o.length>=t)return;let u=await a1(s,{withFileTypes:!0});for(let l of u){if(o.length>=t)return;if(l.name.startsWith(".")&&l.name!==".openai")continue;let p=py(s,l.name);if(l.isDirectory()){if(d1.has(l.name))continue;await a(p)}else if(u1.has(c1(l.name)))try{i({path:p,relative:l1(e,p),text:await Yc(p,"utf8")})}catch{}}};return await a(e),{files:o,skipped:n}}function g1(e,t){let r=e.text.split(`
10245
- `);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 y1(e,t){if(!(await uy(e)).isFile())try{let o=JSON.parse(await Yc(py(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=C$(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=C$(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function C$(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var v1=[{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"}}],b1=[{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}],w1=[{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 _1(e){let t=e.map(s=>s.text).join(`
10246
- `),r=w1.map(s=>{let u=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:u.length,because:u}}).filter(s=>s.hits>0).sort((s,u)=>u.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 k1(e,t){let o=(await uy(e)).isFile()?null:e;if(o)try{let i=await Yc(py(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},u=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:u,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 N$(e){let{files:t,skipped:r}=await f1(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(f=>f.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 k1(e,t),n=_1(t),i=[];for(let f of v1){let g=[];for(let k of t){for(let L of f.patterns){let b=g1(k,L);if(b){g.push(b);break}}if(g.length>=3)break}if(g.length>0){let k=n?f.remedies?.[n.archetype]??f.remedy:f.remedy;i.push({...k?{remedy:k}:{},id:f.id,title:f.title,detail:f.detail,evidence:g})}}let a=t.map(f=>f.text).join(`
10247
- `),s=b1.filter(f=>!f.present.test(a)).map(f=>({id:f.id,title:f.title,detail:f.detail,evidence:[]})),u=[];t.some(f=>/<(div|section|main|canvas)/i.test(f.text))&&u.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(f=>({file:f.relative}))});let p=Kc(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(f=>f.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:u,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await y1(e,t),skipped:r}}Pe();var A1=e=>T1(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",I1=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function P1(e,t){let r=A1(e.name??e.target),o=t&&Wx(t)?t:ic(r),n=e.name??I1(r),i=Bs(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),Sn.parse(i)}async function C1(e,t){let r=await Ue();if(!r)return!1;Jr();let o=e.backend.archetype;if(!o)return!1;let i=await Hr({baseUrl:Ze,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:${$1("sha256").update(t).digest("hex")}`,conformance:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function O1(e){try{let t=Zr.load(await x1(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 N1(e){try{return await S1(e),!0}catch{return!1}}async function R$(e,t){let r;try{r=await N$(e)}catch(l){return V(l instanceof Error?l.message:"Inspection failed")}let o=P1(r,await O1(typeof t.write=="string"?t.write:"gamestage.yaml")),n=st(o);o.manifest.conformance=n.computed;let i=pi(o),a=!1,s,u=null;if(t.write){if(u=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await N1(u))return V(`${u} 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.","",`${C.cyan(`gamestage manifest validate ${u}`)} check what you have`,`${C.cyan("gamestage inspect . --force")} replace it anyway`]);await E1(u,i,"utf8");try{a=await C1(o,i)}catch(l){s=l instanceof Error?l.message:"The control plane did not answer."}}if(X()){te({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:u,registered:a,...s?{registration_failed:s}:{}});return}if(H(`Inspection report ${C.dim(r.target)}`),W("Files inspected",String(r.scanned_files)),W("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&W("Archetype",`${r.archetype.archetype} ${C.dim(`(${r.archetype.confidence} confidence)`)}`),r.skipped.length){H("Skipped");for(let l of r.skipped)O(`${C.dim(l.file)} \u2014 not scanned`),y(` ${C.dim(l.reason)}`)}if(r.keep.length){H("Keep as yours");for(let l of r.keep)O(C.green(l.title)),y(` ${C.dim(l.detail)}`)}if(r.move_behind_authority.length){H("Must move behind an authoritative boundary");for(let l of r.move_behind_authority){O(C.yellow(l.title)),y(` ${C.dim(l.detail)}`);for(let p of l.evidence.slice(0,2)){let h=p.line?`${p.file}:${p.line}`:p.file;y(` ${C.dim("\u2192")} ${C.cyan(h)}${p.excerpt?C.dim(" "+p.excerpt):""}`)}l.remedy&&(y(` ${C.dim("delete")} ${l.remedy.delete}`),y(` ${C.dim("call")} ${C.cyan(l.remedy.call)}`),l.remedy.render&&y(` ${C.dim("render")} ${l.remedy.render}`),l.remedy.move&&y(` ${C.dim("move")} ${l.remedy.move}`),y(` ${C.dim("keep")} ${l.remedy.keep}`))}}if(r.missing_integrations.length){H("Platform integrations not present yet");for(let l of r.missing_integrations)O(l.title),y(` ${C.dim(l.detail)}`)}if(r.unknowns.length){H("Needs a human answer");for(let l of r.unknowns)O(l,"?")}if(H("App Manifest"),W("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){y(),y(C.dim(" To reach the next level:"));for(let l of n.blockers)y(` ${C.dim("\xB7")} ${l.requirement}`)}y(),u?(y(` Written to ${C.cyan(u)}`),y(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${Ze})`:" No account found, so registration was skipped.")):(y(C.dim(" Nothing written and nothing registered. Re-run with --write to save")),y(C.dim(" this manifest and register the game."))),y()}var L$="https://github.com",R1="https://api.github.com",Jc=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function D$(){let e=await fetch(`${L$}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Jc,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function j$(e){let r=await(await fetch(`${L$}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Jc,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await L1(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 L1(e){let t=await fetch(`${R1}/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}$t();Pe();var D1=e=>new Promise(t=>setTimeout(t,e));async function M$(){let{client:e}=await Ie();try{let t=await D$();X()?te({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Jc}):(H("Link GitHub"),W("Code",t.user_code),W("Open",t.verification_uri),y(),O("Enter the code on that page. This waits until you do."),y());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await D1(o*1e3);let n=await j$(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return V("You declined the request on GitHub.");if(n.status==="expired")return V("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(X())return te({ok:!0,status:"linked",github:i.github});H("Linked"),W("Account",n.login),y(),O("Your first deploy is no longer gated. Run `gamestage deploy`."),y();return}V("The code expired before it was entered.")}catch(t){Ne(t)}}er();$t();Pe();ke();var j1=e=>new Promise(t=>setTimeout(t,e));function M1(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)+`
10248
- `)}async function U$(e,t,r){let{client:o}=await Ie(),n=await ac(o),i=fi(n),a=n.access==="approved"||n.access==="pending"?n.workspace:void 0,s=a!==void 0&&!Wk(a),u;if(r&&(u=await o.getWorkspace().then(l=>l.id).catch(()=>{})),X()){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:Ze,...s?{terms:{accepted:!1,url:Ys,version:Vs}}:{}}),i.ok||process.exit(1);return}y(),H("Signed in"),W("Account",e.email??e.userId??"unknown"),t&&W("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),y(),O("Never written into the project, and never passed to your agent."),O("`gamestage logout` removes it."),r&&u&&u!==r?(y(),H("Not the workspace you asked for"),W("You asked for",r),W("You are in",u),y(),O("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&u&&W("Workspace",u),qr(i),s&&(H("Terms of Service"),y(` ${U1}`),y()),i.ok||process.exit(1)}var U1=`Read the Gamestage Terms of Service at ${Ys} and accept them at ${Bk} 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 z$(e){let t=await Ue();if(t){await U$(t,void 0,e);return}let r;try{r=await Ux()}catch(s){V("Could not reach the sign-in service.",[String(s)])}if(X())M1(r);else{H("Sign in to Gamestage"),y(" This also creates your account if you do not have one. Google or email."),y(" A new account is approved by a person, so this may end in a wait."),y(" Taking a while? Email support@monterosa.co."),y(),W("Open",r.verification_uri_complete),W("Or enter",`${r.user_code} at ${r.verification_uri}`);let s=!!process.env.GAMESTAGE_CREDENTIALS;s&&(y(),y(" Signing in to a second credential file, so this does NOT open a browser."),O("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."),O("Copy the address above into a private window and approve it there."),O("Signing out at auth.gamestage.ai first works too.")),y(),y(" Waiting for you to confirm in the browser..."),s||Fx(r.verification_uri_complete)}let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await j1(n);let s=await zx(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"&&V("That code expired.",["Run `gamestage login` again."]),V("Sign-in was refused.",[s.reason]))}i||V("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await Cf(i);await U$(i,a,e)}async function F$(){let e=await Ue();if(await Bx(),X()){te({ok:!0,status:e?"signed_out":"not_signed_in"});return}H(e?"Signed out":"Not signed in"),e&&W("Removed",e.email??"session"),y()}async function G$(){let e=await Ue();if(X()){te(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){H("Not signed in"),y(),O("Inspecting, scaffolding and local rounds need no account."),O("Run `gamestage login` when you want to deploy a playground."),y();return}H("Signed in"),W("Account",e.email??"unknown"),e.userId&&W("User",e.userId),y(),O("`gamestage status` says whether this account is approved."),y()}ke();er();import{readdir as z1,readFile as B$,stat as F1}from"node:fs/promises";Pe();import{homedir as G1}from"node:os";import{join as B1}from"node:path";async function W1(e){let t=[];try{t=await z1(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 F1(`${e}/${a}`),n=!0;try{let s=Oe(await B$(`${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 K1(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 Z1(){try{return(await B$(B1(G1(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function W$(){let e=process.cwd(),t=await W1(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:ge("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, \`${ge("dev")}\` serves the contract fixture rather than your game, and \`${ge("verify")}\` has nothing to verify.`,prompt:"This project has a Gamestage manifest with no round yet. Write the round into gamestage.yaml from the game's own content, and keep every answer out of the page and out of anything the browser downloads."},play:{command:ge("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine.",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:ge("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:ge("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 Ue().catch(()=>null);if(X()){te({ok:!0,cwd:e,version:vt,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:Yi(),account:{signed_in:!!n?.email,email:n?.email??null,sign_in:ge("login")},authentication:n?.email?`Signed in as ${n.email}. \`${ge("deploy")}\` also needs the account approved; \`${ge("status")}\` says whether it is.`:`Not signed in. \`${ge("inspect")}\`, \`${ge("create")}\` and \`${ge("manifest validate")}\` work without an account, so do that work now. \`${ge("dev")}\`, \`${ge("verify")}\` and \`${ge("deploy")}\` refuse until \`${ge("login")}\`, which creates the account too. Tell the person once, when you reach the first command that needs it.`});return}H(`Gamestage ${vt}`);let i=hi?await Z1():null;if(i&&hi&&i<hi&&y(C.dim(` Your installed Gamestage skill is ${i}; the current one is ${hi}.
10249
- Refresh it: `)+C.cyan("npx skills add https://gamestage.ai/skill")),y(C.dim(" Take an agent-built game to production, on the platform behind the")),y(C.dim(" world's biggest fan experiences.")),H("What this does"),y(C.dim(` Your game keeps its interface. Its answers, scoring and locks move
10244
+ `,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 so(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||V(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}function Yc(e){let t=new URL(e.publicUrl);return t.pathname=`/${e.key.split("/").map(encodeURIComponent).join("/")}`,t.search="",t.hash="",t.toString()}function e1(e){switch(HR(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 t1(e,t,r,o={}){let n=VR(r),i;try{i=py(n)}catch{throw V(`Cannot read ${r}.`),new Error("unreachable")}let a=await Wf({path:n,relativePath:r},o.round);a&&V(`${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"),u=L$(vi(i.toString("utf8")),`${s.playerApiOrigin}`,t);await so(s.uploadUrl,u,"text/html; charset=utf-8",s.cacheControl);let l=await e.uploadTarget(t,De);await so(l.uploadUrl,cr,"text/javascript; charset=utf-8",l.cacheControl);let p=await e.uploadTarget(t,Ae);await so(p.uploadUrl,xt,"text/javascript; charset=utf-8",p.cacheControl);let h=await e.uploadTarget(t,Xt);return await so(h.uploadUrl,yi,"image/svg+xml",h.cacheControl),q()||(y(),I(`Uploaded ${r} to ${Yc(s)}`),I(`Wired it to ${s.playerApiOrigin} as "${t}"`),I(`Shipped @monterosa/gamestage beside it (${Pt})`),I(`Shipped the player client beside it (${Un})`)),Yc(s)}async function n1(e,t,r,o,n){if(o||!e||!t)return;let{browserCheck:i}=await Promise.resolve().then(()=>(dy(),_$));r1(await i(e,t,r,n))}function r1(e){if(e.status==="verified"){U("Checked","the page loads and plays in a browser"),y();return}if(e.status==="skipped"){I(O.dim(`Not checked in a browser: ${e.detail??""}`.trim())),y();return}K("The published page did not start"),y(` ${e.detail??""}`),y(),I("The files are published, so the game is live and broken rather than unpublished."),I(`${O.cyan("gamestage verify")} the same check, with the rest of them`),y(),process.exitCode=1}function o1(e){for(let t of e.walkedPast)I(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)I(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)I(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse&&V(`${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 i1(e,t,r,o={}){let n;try{n=Hf(r)}catch(x){throw V(x instanceof Error?x.message:`Cannot read ${r}.`),new Error("unreachable")}let i=await uS(n,{...o,exempt:[Ae,De]});o1(i);let a=i.publish,s=a.find(x=>x.relativePath==="index.html");s||V(`Directory ${r} must contain an index.html file.`);let u=py(s.path,"utf8"),l=Ff(u),p=a.some(x=>x.relativePath==="favicon.ico"),h=a.some(x=>x.relativePath===Xt),f=!l&&!p,g=f&&!h,k=uy();if(k!=="0.0.0-test"){let x=`${qt}/client/${k}/${Ae}`,S=!1;try{S=(await fetch(x,{method:"HEAD"})).ok}catch{S=!0}S||V(`The client this deploy would pin, ${k}, is not published yet.`,[`Every page uploaded here will import ${x},`,"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>/.","",`${O.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let L;for(let x of a){if(x.relativePath===Ae||x.relativePath===De)continue;let S;try{S=await e.uploadTarget(t,x.relativePath)}catch(oe){throw new Error(`${x.relativePath} cannot be published: ${oe instanceof Error?oe.message:String(oe)}`,{cause:oe})}x.relativePath==="index.html"&&(L=S);let $=py(x.path),j=/\.(m?js)$/i.test(x.relativePath),ae=/\.html$/i.test(x.relativePath)?L$(k$(f&&x.relativePath==="index.html"?vi($.toString("utf8")):$.toString("utf8"),uy()),S.playerApiOrigin,t):j?k$($.toString("utf8"),uy()):$;await so(S.uploadUrl,ae,e1(x.relativePath),S.cacheControl)}if(g){let x=await e.uploadTarget(t,Xt);await so(x.uploadUrl,yi,"image/svg+xml",x.cacheControl)}let b=[...a.map(x=>x.relativePath),...g?[Xt]:[]];try{await e.pruneBundle(t,b);for(let x of i.withheld)I(`Removed ${x.path} from the playground.`)}catch(x){let S=x instanceof Error?x.message:String(x),$=i.withheld.map(j=>j.path);K("The playground still holds files this deploy did not publish"),y(` ${S}`),y(),$.length?(I(`Could not remove ${$.join(", ")} from the playground: ${S}`),I("Anything an earlier deploy put there is still being served.")):I("Anything an earlier deploy put there is still being served."),y(),process.exitCode=1}if(!q()&&L&&(y(),I(`Uploaded ${a.length} files from ${r}`),I(`Playground: ${Yc(L)}`),I(`Wired it to ${L.playerApiOrigin} as "${t}"`),g&&I("Added a replaceable starter favicon")),!L)throw new Error("The directory index was not uploaded.");return Yc(L)}er();xe();import{readFile as _1}from"node:fs/promises";xe();var j$="player-conformance",gy="round-current",a1="sha256:emulator-conformance";function nn(e){return structuredClone(e)}function Bt(){return{server_time:"2026-08-01T09:00:00.000Z",snapshot:a1}}var s1="2026-08-01T08:00:00.000Z";function c1(e){let t=e==="per-player-challenge",r=e==="locked";return{...Bt(),id:gy,number:412,version:2,...r?{locks_at:s1}:{},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 D$(e,t){let r=t==="mistakes";return{...Bt(),player_id:j$,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 l1(e){let t=c1(e),r=new Map([[t.id,t]]),o=new Map([[t.id,D$(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",D$("round-revealed",e))),{runtime:{...Bt(),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:{...Bt(),round_id:gy,order:"high_first",tie_break:"earliest_play",entries:[{rank:1,player_id:"player-example",display_name:"Example",score:20}],total:1,truncated:!1},profile:{...Bt(),player_id:j$,display_name:"Example",played:0,won:0,current_streak:0,max_streak:0,distribution:{},constraints:{}},plays:new Map,intents:new Map,nextPlay:1}}function Jc(e,t){return{...Bt(),play_id:`rejected-${e.nextPlay++}`,outcome:"rejected",reason:t,round_version:2,marked:!1,feedback:[]}}function yy(e){let t=l1(e);return{async getRuntime(){return nn(t.runtime)},async getCurrentRound(){return nn(t.rounds.get(gy))},async getRound(r){let o=t.rounds.get(r);return o?nn(o):void 0},async play(r,o){let n=t.rounds.get(r);if(!n)return Jc(t,"round_not_found");let i=Js({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?Jc(t,"idempotency_conflict"):{...nn(a),outcome:"duplicate"};if(o.round_version!==n.version)return{...Bt(),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 Jc(t,"challenge_instance_id");if(n.locks_at!==void 0&&n.locks_at<=Bt().server_time)return Jc(t,"lock_deadline_passed");let s=t.roundStates.get(r),u=t.runtime.marking==="at_settlement",l={...s,...Bt(),attempts_used:s.attempts_used+1,score:s.score+(u?0:10),finished:!u,outcome:u?"pending":"won"},p={...Bt(),play_id:`play-${t.nextPlay++}`,outcome:"accepted",round_version:n.version,marked:!u,feedback:u?[]:[{key:"answer",verdict:"correct"}],round_state:nn(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=Ys(t.profile,l.outcome)),nn(p)},async getRoundState(r){let o=t.roundStates.get(r);if(!o)throw new Error(`No such round: ${r}`);return nn(o)},async getProfile(){return nn(t.profile)},async getLeaderboard(){return nn(t.leaderboard)}}}function d1(){return e=>yy(e)}var wZ=d1();xe();import{createServer as u1}from"node:http";function ir(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${t.replace(/\\\{[^}]+\\\}/g,"([^/]+)")}$`)}var p1=ir(Ie.runtime),h1=ir(Ie.currentRound),m1=ir(Ie.round),f1=ir(Ie.plays),g1=ir(Ie.roundState),y1=ir(Ie.profile),v1=ir(Ie.leaderboard);function Nn(e,t,r){let o=JSON.stringify(r);e.writeHead(t,{"content-type":"application/json; charset=utf-8","content-length":Buffer.byteLength(o)}),e.end(o)}function co(e,t,r,o){Nn(e,t,{error:{code:r,message:o,retryable:!1}})}async function b1(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 w1(e,t,r,o){if(!e.url){co(t,400,"invalid_request","The request URL is missing.");return}let i=new URL(e.url,"http://localhost").pathname;if(e.method==="GET"){if(o&&/^\/(client\/[^/]+\/)?gamestage\.js$/.test(i)){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(p1.test(i)){Nn(t,200,await r.getRuntime());return}if(h1.test(i)){Nn(t,200,await r.getCurrentRound());return}let a=m1.exec(i);if(a){let u=await r.getRound(decodeURIComponent(a[2]));if(!u){co(t,404,"round_not_found","The requested round was not found.");return}Nn(t,200,u);return}let s=g1.exec(i);if(s){let u=decodeURIComponent(s[2]);try{Nn(t,200,await r.getRoundState(u))}catch{co(t,404,"round_not_found","The requested round was not found.")}return}if(y1.test(i)){Nn(t,200,await r.getProfile());return}if(v1.test(i)){Nn(t,200,await r.getLeaderboard());return}}if(e.method==="POST"){let a=f1.exec(i);if(a){try{let s=await b1(e);Nn(t,200,await r.play(decodeURIComponent(a[2]),s))}catch(s){co(t,400,"invalid_request",s instanceof SyntaxError?"The request body must be valid JSON.":"The request body is invalid.")}return}}co(t,404,"not_found","The requested player API route was not found.")}function qc(e="default",t){let r=yy(e);return u1((o,n)=>{w1(o,n,r,t).catch(()=>{n.headersSent?n.destroy():co(n,500,"internal_error","The emulator could not answer the request.")})})}Zt();Jg();$t();Ce();async function k1(e){let t;try{t=await _1(e,"utf8")}catch{return}let r=Ne(t);if(!r.ok){V(`${e} is not a valid App Manifest.`,r.issues.map(o=>`${O.cyan(o.path)} ${o.message}`));return}return r.manifest}async function x1(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:qc(r,xt),what:"fixture",fixtureReason:"requested",game:"conformance-game"};let o=await k1(e.manifest??"gamestage.yaml");if(!o)return{server:qc(r,xt),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:qc(r,xt),what:"fixture",fixtureReason:a,game:o.app.id,title:o.app.title}}let i=o.backend.archetype;return i&&i!==n.archetype&&V(`The manifest declares the ${i} format and a ${n.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),rr.includes(n.archetype)||V(`No Engine here serves the ${n.archetype} format yet.`,[`Built so far: ${rr.join(", ")}. \`gamestage dev --fixture\` serves`,"the contract fixture if you are working against the wire rather than the rules."]),{server:await Zc({game:o.app.id,round:n,title:o.app.title,identityRequired:!!e.as,clientBundle:xt}),what:"engine",game:o.app.id,round:n,title:o.app.title,containerLabel:o.experience.container_label,as:e.as}}async function M$(e){await fi();let t=await x1(e),{server:r}=t,o=()=>new Promise((p,h)=>{r.close(f=>f?h(f):p())}),n=new Promise(p=>{let h=async()=>{process.off("SIGINT",h),process.off("SIGTERM",h),await o(),p()};process.once("SIGINT",h),process.once("SIGTERM",h)});await new Promise((p,h)=>{r.once("error",h),r.listen(Number(e.port),"127.0.0.1",()=>p())});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,u;t.as&&(s=await Vg(a),r.attachDevIdentity?.(s),u=await s.mint(t.as));let l=(await Ue().catch(()=>null))?.email;if(q())Q({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&&u?{identity:{as:t.as,player_id:`id:${t.as}`,issuer:s.issuer,jwks_uri:s.jwksUri,token:u,required:!0}}:{}});else if(t.what==="engine"){K(t.title??t.game);let p=zn(t.containerLabel);U("Serving",`your ${zn(t.containerLabel,{lower:!0})}, through the real Engine`),U(p,`${t.round.number} (round-${t.round.number})`),U("API",a),U("Game id",t.game),l&&U("Signed in",l),y(),I(`<script src="${a}/gamestage.js"></script>`),I(`window.GAMESTAGE_API = "${a}"`),I(`window.GAMESTAGE_GAME = "${t.game}"`),u&&I(`window.GAMESTAGE_TOKEN = "${u}"`),y(),s&&u&&(U("Playing as",`${t.as} (${O.cyan(`id:${t.as}`)})`),U("Identity","required, so an anonymous play is refused here too"),U("Keys",s.jwksUri),y(),I("A real RS256 token, validated by the code that validates a customer's. The keypair lives for this run only."),I(`This harness cannot be deployed: its issuer is a loopback URL, and ${O.cyan("gamestage manifest validate")} refuses a manifest that names one.`),y()),I(`Edit the ${zn(t.containerLabel,{lower:!0})} in your manifest and restart to see it change.`),y()}else K(t.fixtureReason==="studio-round"?"Studio round, unavailable locally":t.fixtureReason==="unconfigured"?"No round configured yet":"Serving the contract fixture"),U("API",a),U("Game id",t.game),y(),I(`<script src="${a}/gamestage.js"></script>`),y(),t.fixtureReason==="studio-round"?(I("A round is configured in Studio, but `gamestage dev` cannot reach it."),I("Play the deployed game to use the Studio round. This fixture is only local wiring.")):t.fixtureReason==="unconfigured"?(I("No round is configured in Studio yet. This local run is a Gamestage stand-in, not your game."),I("Set up the first round in Studio, then play the deployed game.")):(I("There is no round here to serve, so this is the shell rather than your game."),I("`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.")),y();await n}dy();xe();Ce();import{stat as S1}from"node:fs/promises";async function U$(){let e=[],[t]=process.versions.node.split(".").map(Number);e.push({id:"node",label:"Node.js",ok:t>=20,detail:t>=20?`v${process.versions.node}`:`v${process.versions.node} - Gamestage needs Node 20 or newer`,blocking:!0}),e.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${di} bundled`,blocking:!1});let r=!1;try{await S1("gamestage.yaml"),r=!0}catch{}e.push({id:"manifest",label:"App Manifest",ok:r,detail:r?"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 o=e.filter(n=>!n.ok&&n.blocking);q()&&(Q({ok:o.length===0,checks:e}),process.exit(o.length===0?0:1)),K("Environment");for(let n of e){let i=n.ok?O.green("ok"):n.blocking?O.red("blocked"):O.dim("--");y(` ${i.padEnd(18)} ${n.label.padEnd(16)} ${O.dim(n.detail)}`)}y(),o.length&&(y(` ${O.red("Fix the blocked items above before continuing.")}`),y(),process.exit(1)),y(` ${O.green("Ready.")}`),y()}Ks();xe();er();import{readFile as G1,stat as B1,writeFile as W1}from"node:fs/promises";import{createHash as K1}from"node:crypto";import{basename as Z1}from"node:path";$t();oy();Zt();import{readdir as E1,readFile as Xc,stat as vy}from"node:fs/promises";import{createHash as $1}from"node:crypto";import{basename as F$,extname as T1,join as by,relative as A1}from"node:path";var I1=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),P1=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function C1(e){return $1("sha256").update(e).digest("hex").slice(0,16)}var O1={[De]:Un,[Ae]:Pt};function N1(e){let t=F$(e.relative),r=O1[t];return!r||C1(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 R1(e,t=200){let r=await vy(e),o=[],n=[],i=s=>{let u=N1(s);u?n.push({file:s.relative,reason:u}):o.push(s)};if(r.isFile())return i({path:e,relative:F$(e),text:await Xc(e,"utf8")}),{files:o,skipped:n};let a=async s=>{if(o.length>=t)return;let u=await E1(s,{withFileTypes:!0});for(let l of u){if(o.length>=t)return;if(l.name.startsWith(".")&&l.name!==".openai")continue;let p=by(s,l.name);if(l.isDirectory()){if(I1.has(l.name))continue;await a(p)}else if(P1.has(T1(l.name)))try{i({path:p,relative:A1(e,p),text:await Xc(p,"utf8")})}catch{}}};return await a(e),{files:o,skipped:n}}function L1(e,t){let r=e.text.split(`
10245
+ `);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 D1(e,t){if(!(await vy(e)).isFile())try{let o=JSON.parse(await Xc(by(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=z$(n[1]);if(a)return a}let i=/<title[^>]*>([^<]+)<\/title>/i.exec(o.text);if(i){let a=z$(i[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(a)return a}}return null}function z$(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var j1=[{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"}}],M1=[{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}],U1=[{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 z1(e){let t=e.map(s=>s.text).join(`
10246
+ `),r=U1.map(s=>{let u=s.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:s.archetype,hits:u.length,because:u}}).filter(s=>s.hits>0).sort((s,u)=>u.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 F1(e,t){let o=(await vy(e)).isFile()?null:e;if(o)try{let i=await Xc(by(o,"package.json"),"utf8"),a=JSON.parse(i),s={...a.dependencies,...a.devDependencies},u=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:u,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 G$(e){let{files:t,skipped:r}=await R1(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(f=>f.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 F1(e,t),n=z1(t),i=[];for(let f of j1){let g=[];for(let k of t){for(let L of f.patterns){let b=L1(k,L);if(b){g.push(b);break}}if(g.length>=3)break}if(g.length>0){let k=n?f.remedies?.[n.archetype]??f.remedy:f.remedy;i.push({...k?{remedy:k}:{},id:f.id,title:f.title,detail:f.detail,evidence:g})}}let a=t.map(f=>f.text).join(`
10247
+ `),s=M1.filter(f=>!f.present.test(a)).map(f=>({id:f.id,title:f.title,detail:f.detail,evidence:[]})),u=[];t.some(f=>/<(div|section|main|canvas)/i.test(f.text))&&u.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(f=>({file:f.relative}))});let p=Vc(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(f=>f.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:u,move_behind_authority:i,missing_integrations:s,copy_to_studio:p,unknowns:h,archetype:n,name:await D1(e,t),skipped:r}}Ce();var H1=e=>Z1(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",V1=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function Y1(e,t){let r=H1(e.name??e.target),o=t&&Qx(t)?t:cc(r),n=e.name??V1(r),i=Zs(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),Sn.parse(i)}async function J1(e,t){let r=await Ue();if(!r)return!1;Jr();let o=e.backend.archetype;if(!o)return!1;let i=await Hr({baseUrl:Ze,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:${K1("sha256").update(t).digest("hex")}`,conformance:st(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:Kr.map(a=>({section:a,status:e[a].status}))});if(i.refused)throw new Error(i.refused);return!0}async function q1(e){try{let t=Zr.load(await G1(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 X1(e){try{return await B1(e),!0}catch{return!1}}async function B$(e,t){let r;try{r=await G$(e)}catch(l){return V(l instanceof Error?l.message:"Inspection failed")}let o=Y1(r,await q1(typeof t.write=="string"?t.write:"gamestage.yaml")),n=st(o);o.manifest.conformance=n.computed;let i=hi(o),a=!1,s,u=null;if(t.write){if(u=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await X1(u))return V(`${u} 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.","",`${O.cyan(`gamestage manifest validate ${u}`)} check what you have`,`${O.cyan("gamestage inspect . --force")} replace it anyway`]);await W1(u,i,"utf8");try{a=await J1(o,i)}catch(l){s=l instanceof Error?l.message:"The control plane did not answer."}}if(q()){Q({ok:!0,report:r,manifest:o,conformance:{computed:n.computed,blockers:n.blockers},manifest_yaml:i,written_to:u,registered:a,...s?{registration_failed:s}:{}});return}if(K(`Inspection report ${O.dim(r.target)}`),U("Files inspected",String(r.scanned_files)),U("Stack",r.stack.framework?`${r.stack.kind} (${r.stack.framework})`:r.stack.kind),r.archetype&&U("Archetype",`${r.archetype.archetype} ${O.dim(`(${r.archetype.confidence} confidence)`)}`),r.skipped.length){K("Skipped");for(let l of r.skipped)I(`${O.dim(l.file)} \u2014 not scanned`),y(` ${O.dim(l.reason)}`)}if(r.keep.length){K("Keep as yours");for(let l of r.keep)I(O.green(l.title)),y(` ${O.dim(l.detail)}`)}if(r.move_behind_authority.length){K("Must move behind an authoritative boundary");for(let l of r.move_behind_authority){I(O.yellow(l.title)),y(` ${O.dim(l.detail)}`);for(let p of l.evidence.slice(0,2)){let h=p.line?`${p.file}:${p.line}`:p.file;y(` ${O.dim("\u2192")} ${O.cyan(h)}${p.excerpt?O.dim(" "+p.excerpt):""}`)}l.remedy&&(y(` ${O.dim("delete")} ${l.remedy.delete}`),y(` ${O.dim("call")} ${O.cyan(l.remedy.call)}`),l.remedy.render&&y(` ${O.dim("render")} ${l.remedy.render}`),l.remedy.move&&y(` ${O.dim("move")} ${l.remedy.move}`),y(` ${O.dim("keep")} ${l.remedy.keep}`))}}if(r.missing_integrations.length){K("Platform integrations not present yet");for(let l of r.missing_integrations)I(l.title),y(` ${O.dim(l.detail)}`)}if(r.unknowns.length){K("Needs a human answer");for(let l of r.unknowns)I(l,"?")}if(K("App Manifest"),U("Conformance",`${n.computed} ${n.computedName}`),n.blockers.length){y(),y(O.dim(" To reach the next level:"));for(let l of n.blockers)y(` ${O.dim("\xB7")} ${l.requirement}`)}y(),u?(y(` Written to ${O.cyan(u)}`),y(a?" Registered in Studio as a draft.":s?` Not registered in Studio: ${s} (${Ze})`:" No account found, so registration was skipped.")):(y(O.dim(" Nothing written and nothing registered. Re-run with --write to save")),y(O.dim(" this manifest and register the game."))),y()}var W$="https://github.com",Q1="https://api.github.com",Qc=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function K$(){let e=await fetch(`${W$}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Qc,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function Z$(e){let r=await(await fetch(`${W$}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Qc,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(r.access_token)return{status:"linked",login:await eL(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 eL(e){let t=await fetch(`${Q1}/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}$t();Ce();var tL=e=>new Promise(t=>setTimeout(t,e));async function H$(){let{client:e}=await ke();try{let t=await K$();q()?Q({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Qc}):(K("Link GitHub"),U("Code",t.user_code),U("Open",t.verification_uri),y(),I("Enter the code on that page. This waits until you do."),y());let r=Date.now()+t.expires_in*1e3,o=Math.max(t.interval,5);for(;Date.now()<r;){await tL(o*1e3);let n=await Z$(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){o=n.interval;continue}if(n.status==="denied")return V("You declined the request on GitHub.");if(n.status==="expired")return V("The code expired. Run `gamestage link github` again.");let{workspace:i}=await e.linkGitHub(n.login);if(q())return Q({ok:!0,status:"linked",github:i.github});K("Linked"),U("Account",n.login),y(),I("Your first deploy is no longer gated. Run `gamestage deploy`."),y();return}V("The code expired before it was entered.")}catch(t){Pe(t)}}er();$t();Ce();xe();var nL=e=>new Promise(t=>setTimeout(t,e));function rL(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)+`
10248
+ `)}async function V$(e,t,r){let{client:o}=await ke(),n=await lc(o),i=gi(n),a=n.access==="approved"||n.access==="pending"?n.workspace:void 0,s=a!==void 0&&!Qk(a),u;if(r&&(u=await o.getWorkspace().then(l=>l.id).catch(()=>{})),q()){Q({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:Ze,...s?{terms:{accepted:!1,url:Xs,version:qs}}:{}}),i.ok||process.exit(1);return}y(),K("Signed in"),U("Account",e.email??e.userId??"unknown"),t&&U("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),y(),I("Never written into the project, and never passed to your agent."),I("`gamestage logout` removes it."),r&&u&&u!==r?(y(),K("Not the workspace you asked for"),U("You asked for",r),U("You are in",u),y(),I("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):r&&u&&U("Workspace",u),qr(i),s&&(K("Terms of Service"),y(` ${oL}`),y()),i.ok||process.exit(1)}var oL=`Read the Gamestage Terms of Service at ${Xs} and accept them at ${Xk} 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 Y$(e){let t=await Ue();if(t){await V$(t,void 0,e);return}let r;try{r=await Vx()}catch(s){V("Could not reach the sign-in service.",[String(s)])}if(q())rL(r);else{K("Sign in to Gamestage"),y(" This also creates your account if you do not have one. Google or email."),y(" A new account is approved by a person, so this may end in a wait."),y(" Taking a while? Email support@monterosa.co."),y(),U("Open",r.verification_uri_complete),U("Or enter",`${r.user_code} at ${r.verification_uri}`);let s=!!process.env.GAMESTAGE_CREDENTIALS;s&&(y(),y(" Signing in to a second credential file, so this does NOT open a browser."),I("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."),I("Copy the address above into a private window and approve it there."),I("Signing out at auth.gamestage.ai first works too.")),y(),y(" Waiting for you to confirm in the browser..."),s||Jx(r.verification_uri_complete)}let o=Date.now()+r.expires_in*1e3,n=r.interval*1e3,i=null;for(;Date.now()<o;){await nL(n);let s=await Yx(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"&&V("That code expired.",["Run `gamestage login` again."]),V("Sign-in was refused.",[s.reason]))}i||V("Timed out waiting for approval.",["Run `gamestage login` again."]);let a=await Mf(i);await V$(i,a,e)}async function J$(){let e=await Ue();if(await Xx(),q()){Q({ok:!0,status:e?"signed_out":"not_signed_in"});return}K(e?"Signed out":"Not signed in"),e&&U("Removed",e.email??"session"),y()}async function q$(){let e=await Ue();if(q()){Q(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){K("Not signed in"),y(),I("Inspecting, scaffolding and local rounds need no account."),I("Run `gamestage login` when you want to deploy a playground."),y();return}K("Signed in"),U("Account",e.email??"unknown"),e.userId&&U("User",e.userId),y(),I("`gamestage status` says whether this account is approved."),y()}xe();er();import{readdir as iL,readFile as X$,stat as aL}from"node:fs/promises";Ce();import{homedir as sL}from"node:os";import{join as cL}from"node:path";async function lL(e){let t=[];try{t=await iL(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 aL(`${e}/${a}`),n=!0;try{let s=Ne(await X$(`${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 dL(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 uL(){try{return(await X$(cL(sL(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function Q$(){let e=process.cwd(),t=await lL(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:ge("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, \`${ge("dev")}\` serves the contract fixture rather than your game, and \`${ge("verify")}\` has nothing to verify.`,prompt:"This project has a Gamestage manifest with no round yet. Write the round into gamestage.yaml from the game's own content, and keep every answer out of the page and out of anything the browser downloads."},play:{command:ge("dev"),why:"The manifest declares a round. Serve it locally, through the real Engine.",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:ge("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:ge("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 Ue().catch(()=>null);if(q()){Q({ok:!0,cwd:e,version:vt,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:Xi(),account:{signed_in:!!n?.email,email:n?.email??null,sign_in:ge("login")},authentication:n?.email?`Signed in as ${n.email}. \`${ge("deploy")}\` also needs the account approved; \`${ge("status")}\` says whether it is.`:`Not signed in. \`${ge("inspect")}\`, \`${ge("create")}\` and \`${ge("manifest validate")}\` work without an account, so do that work now. \`${ge("dev")}\`, \`${ge("verify")}\` and \`${ge("deploy")}\` refuse until \`${ge("login")}\`, which creates the account too. Tell the person once, when you reach the first command that needs it.`});return}K(`Gamestage ${vt}`);let i=mi?await uL():null;if(i&&mi&&i<mi&&y(O.dim(` Your installed Gamestage skill is ${i}; the current one is ${mi}.
10249
+ Refresh it: `)+O.cyan("npx skills add https://gamestage.ai/skill")),y(O.dim(" Take an agent-built game to production, on the platform behind the")),y(O.dim(" world's biggest fan experiences.")),K("What this does"),y(O.dim(` Your game keeps its interface. Its answers, scoring and locks move
10250
10250
  behind an Engine the player's browser cannot reach, so nobody can read
10251
- the answer out of the page or award themselves a score.`)),y(),y(` ${C.dim("A")} ${C.cyan("round")} ${C.dim("is one playable thing: a board, a question, a slate.")}`),y(` ${C.dim("Your")} ${C.cyan("manifest")} ${C.dim("is gamestage.yaml, which describes the game.")}`),y(` ${C.dim("The")} ${C.cyan("Engine")} ${C.dim("marks a play, holds the score and refuses a cheat.")}`),H("Who you are"),n?.email?(W("Signed in",n.email),y(C.dim(` ${ge("status")} names your workspace and whether it is approved.`)),y(C.dim(` If that is not the account you signed up with, ${ge("login")} rebinds
10252
- this machine. Stage shows the command with your workspace in it.`))):(y(` Not signed in. ${C.cyan(ge("login"))} binds this machine to your account,`),y(" and creates the account if you do not have one."),y(C.dim(" Inspect, create and validate need no account, so start there.")),y(C.dim(` ${ge("dev")}, ${ge("verify")} and ${ge("deploy")} ask you to sign in first.`))),H("Where you are"),t.has_manifest&&t.has_round===!1)y(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)y(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)y(" 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);y(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else y(" Nothing here yet. This looks like a fresh start.");if(H("Do this next"),y(` ${C.cyan(o[r].command)}`),y(` ${C.dim(o[r].why)}`),r==="create"||r==="inspect"){y(),y(` ${C.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of sc)y(` ${C.cyan(a.padEnd(10))} ${C.dim(s)}`)}y(),y(` ${C.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let a of K1(o[r].prompt,74))y(` ${C.cyan(a)}`);H("Good to know"),y(C.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
10251
+ the answer out of the page or award themselves a score.`)),y(),y(` ${O.dim("A")} ${O.cyan("round")} ${O.dim("is one playable thing: a board, a question, a slate.")}`),y(` ${O.dim("Your")} ${O.cyan("manifest")} ${O.dim("is gamestage.yaml, which describes the game.")}`),y(` ${O.dim("The")} ${O.cyan("Engine")} ${O.dim("marks a play, holds the score and refuses a cheat.")}`),K("Who you are"),n?.email?(U("Signed in",n.email),y(O.dim(` ${ge("status")} names your workspace and whether it is approved.`)),y(O.dim(` If that is not the account you signed up with, ${ge("login")} rebinds
10252
+ this machine. Stage shows the command with your workspace in it.`))):(y(` Not signed in. ${O.cyan(ge("login"))} binds this machine to your account,`),y(" and creates the account if you do not have one."),y(O.dim(" Inspect, create and validate need no account, so start there.")),y(O.dim(` ${ge("dev")}, ${ge("verify")} and ${ge("deploy")} ask you to sign in first.`))),K("Where you are"),t.has_manifest&&t.has_round===!1)y(" An App Manifest is present, and it declares no round.");else if(t.has_manifest&&t.has_round===!0)y(" An App Manifest is present, with a round the Engine can serve.");else if(t.has_manifest)y(" 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);y(` Found ${a.join(" and ")}. This looks like a game to inspect.`)}else y(" Nothing here yet. This looks like a fresh start.");if(K("Do this next"),y(` ${O.cyan(o[r].command)}`),y(` ${O.dim(o[r].why)}`),r==="create"||r==="inspect"){y(),y(` ${O.dim("The formats you can build today:")}`);for(let{format:a,summary:s}of dc)y(` ${O.cyan(a.padEnd(10))} ${O.dim(s)}`)}y(),y(` ${O.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let a of dL(o[r].prompt,74))y(` ${O.cyan(a)}`);K("Good to know"),y(O.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
10253
10253
  need you signed in, because they run your round through a real
10254
10254
  Engine. \`gamestage login\` creates the account if you do not have
10255
- one yet. ${T_}`)),y()}var lo=class extends Error{};function K$(e){let t=e.what.trim();if(!t)throw new lo("Say what you were trying to build.");if(t.length>2e3)throw new lo(`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 Z$(e){return JSON.stringify(e,null,2)}async function qc(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=[H$(a.value)];for(let l=await o.next();!l.done;l=await o.next())s.push(H$(l.value));let u=s.join("");return u.trim()?u:e??""}function H$(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Pe();var H1=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function V$(e,t,r,o=process.stdin){let n=await qc(e,o),i;try{i=K$({what:n,closest:t.closest,cliVersion:r})}catch(u){throw u instanceof lo&&V(u.message),u}if(!t.send){if(X()){te({sent:!1,would_send:i});return}H("This is everything that would be sent"),y(),y(Z$(i)),y(),O("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),O(n===e?`Send it with ${ge('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ge("suggest --send")}.`);return}let a;try{a=await fetch(H1,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(u){V("Could not reach Gamestage to send that.",[u instanceof Error?u.message:String(u)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),X()){te({sent:!0,reference:s.reference??null});return}H("Sent"),s.reference&&O(`Reference ${s.reference}. Quote it if you follow up.`),O("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var uo=class extends Error{};function Y$(e){let t=e.what.trim();if(!t)throw new uo("Say what went wrong.");if(t.length>2e3)throw new uo(`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 J$(e){return JSON.stringify(e,null,2)}Pe();var V1=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function q$(e,t,r,o=process.stdin){let n=await qc(e,o),i;try{i=Y$({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(u){throw u instanceof uo&&V(u.message),u}if(!t.send){if(X()){te({sent:!1,would_send:i});return}H("This is everything that would be sent"),y(),y(J$(i)),y(),O("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),O(n===e?`Send it with ${ge('issue "..." --send')}.`:`Send it by piping the same text again, with ${ge("issue --send")}.`);return}let a;try{a=await fetch(V1,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(u){V("Could not reach Gamestage to send that.",[u instanceof Error?u.message:String(u)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),X()){te({sent:!0,reference:s.reference??null});return}H("Reported"),s.reference&&O(`Reference ${s.reference}. Quote it if you follow up.`),O("It is in the backlog now. Somebody at Monterosa reads these.")}ke();$t();Pe();import{readFile as Y1}from"node:fs/promises";import{resolve as J1}from"node:path";async function X$(e){let t=J1(e),r;try{r=await Y1(t,"utf8")}catch{V(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){V(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=An.safeParse(o);if(!n.success){let i=n.error.issues[0];V(`${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 q1(e){let t=An.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var X1={copy:"immutable copy",pointer:"reference data"};async function Q1(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||V(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function Q$(e,t){let{client:r}=await Ie(),{body:o}=await X$(t),n=tc(o),i=await r.referenceUploadTarget(e,n),a=await kx(o,async(l,p)=>{await Q1(l==="copy"?i.copy:i.pointer,p,X1[l])});a.ok||V(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:u}=a.summary;if(X())return te({ok:!0,name:e,digest:n,measures:s,counts:u,key:i.pointer.key});H("Pushed"),O(`${e} is now the reference data for this workspace`);for(let l of s)O(`${l}: ${u[l].toLocaleString("en-GB")} values`);O(`Digest ${n}, kept so a round can say what it was scored on`),y(),O("A round provisioned from now on uses this. One already in play keeps"),O("the numbers it opened with, which is deliberate.")}async function eT(e,t){let{body:r,measures:o}=await X$(e),n=q1(r),i=An.parse(JSON.parse(r)),a={};for(let s of i.measures){let u=t.filter(l=>typeof s.values[l]!="number");u.length&&(a[s.key]=u)}if(X())return te({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});H("Reference data");for(let s of o)O(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){y(),O("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(y(),!Object.keys(a).length){O(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,u]of Object.entries(a))O(`${s} has no value for ${u.map(l=>`"${l}"`).join(", ")}`);V("A round using those keys would be refused rather than scoring them as nothing.")}ke();$t();Pe();import{readFile as eL}from"node:fs/promises";import{resolve as tL}from"node:path";import{createInterface as nL}from"node:readline/promises";async function rL(e){let t;try{t=await eL(tL(e),"utf8")}catch{V(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=Oe(t);r.ok||V(`${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||V(`${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"&&V("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 oL(e){if(H("What goes into Studio"),O(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){O(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)O(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);y(),y("No point values go with it. They stay in your reference data, where only"),y("the Engine reads them.")}else if(e.archetype==="shoot")O(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),O(`Keeper: ${e.difficulty}`),y(),y("Nothing here is an answer. The keeper is decided by the Engine at play time,"),y("from entropy it minted when the round was provisioned.");else{if(O(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")O(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)O(`${t.label}: ${t.members.join(", ")}`);y(),y("The answer goes with it, into a field Studio withholds from a fan's browser."),y("Only a producer signed into Studio can read it.")}y()}async function iL(e,t){if(t)return!0;process.stdin.isTTY||V("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=nL({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 tT(e,t){let r=t.manifest??"gamestage.yaml",o=await rL(r),n=o.archetype==="push"?Qk(o):o;if(X()||oL(n),!await iL(e,!!t.yes)){y("Nothing was written.");return}try{let{client:i}=await Ie(),a=await i.seedRound(e,n);a.refused&&V("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}),X()||(H("Written"),O(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),O("A producer can change every word of it without another deploy."),O("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),y())}catch(i){Ne(i)}}$t();Pe();import{createServer as aL}from"node:http";import{readFile as rT}from"node:fs/promises";import{extname as sL}from"node:path";var Rn=1e4,Xc="preview",cL=[{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:"Bright Heron",primaryScore:47230},{name:"Still Fox",primaryScore:44112}];function lL(e){switch(sL(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 dL(e){let t="";try{t=await rT(e.css,"utf8")}catch{}let r=Number(e.rows)||10,o=new Date().toISOString();return{instance:{instanceId:Xc,name:"Preview",type:"leaderboard",embedSlug:Xc,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:o,updatedAt:o,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:r,storyModeEnabled:!1,storySegmentSize:5,storySegmentDuration:8,accentColour:e.accent??"#FFD700",colourPreset:"dark",embedPageSize:r,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,cssOverrides:t}},entries:cL.slice(0,r).map((n,i)=>({entryId:`preview-${i}`,instanceId:Xc,name:n.name,gender:"",primaryScore:n.primaryScore,rank:i+1,createdAt:o,updatedAt:o})),generatedAt:o}}async function nT(e,t){let r=new URL(t.replace(/^\/r\//,""),e.endsWith("/")?e:`${e}/`);return fetch(r,{redirect:"follow"})}async function oT(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}.
10256
- Pass --renderer <url> if your Space serves it somewhere else.`);let o=aL((a,s)=>{(async()=>{let u=(a.url??"/").split("?")[0]??"/";try{if(u.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await dL(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(u==="/"||u==="/index.html"){let h=e.bigscreen?"bigscreen.html":"embed.html",g=await(await nT(t,h)).text();g=g.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),s.writeHead(200,{"content-type":"text/html; charset=utf-8"}),s.end(g);return}let l=await nT(t,u);if(!l.ok){s.writeHead(l.status),s.end();return}let p=Buffer.from(await l.arrayBuffer());s.writeHead(200,{"content-type":lL(u)}),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)}
10257
- `)}})()});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=${Xc}${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(`
10258
- `)),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 uL(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function iT(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,X()){te({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}H(n);for(let[u,l]of Object.entries(a))W(u,l);y();for(let u of i)O(u);y()};try{let o;try{o=await rT(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>Rn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Rn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Rn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Rn.toLocaleString()} characters`},{characters:o.length,limit:Rn});return}let{client:n}=await Ie(),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=uL(i.playgroundUrl,t.css),s=!1,u=0;try{let l=await fetch(a);u=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:u?String(u):"nothing"},{url:a,status:u,characters:o.length,limit:Rn});return}if(X()){te({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Rn,url:a});return}H("Ready for a producer"),W("Game",`${i.name} (${i.id})`),W("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Rn.toLocaleString()} characters)`),W("Address",a),y(),O("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),O("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."),y()}catch(o){Ne(o)}}ke();Pe();import{readFile as pL}from"node:fs/promises";async function aT(e,t){let r;try{r=await pL(e,"utf8")}catch{return V(`Cannot read ${e}`)}let o=Oe(r);if(!o.ok)return X()&&(te({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),V(`${e} is not a valid App Manifest`,o.issues.map(l=>`${C.cyan(l.path)} ${l.message}`));let n=o.manifest,i=st(n),a=null;if(t.level){let l=_n.safeParse(t.level.toUpperCase());if(!l.success)return V(`Unknown level "${t.level}". Use L0 through L5.`);a=l.data}let s=a?L_(n,a):null,u=!i.overclaimed&&(s?.ok??!0);if(X()&&(te({ok:u,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}),process.exit(u?0:1)),H(`${n.app.title} ${C.dim(n.app.id)}`),W("Schema",n.manifest.schema_version),W("Revision",String(n.manifest.revision)),W("Conformance",i.overclaimed?`${C.red(i.claimed)} claimed, ${C.bold(i.computed)} evidenced`:`${C.green(i.computed)} ${i.computedName}`),i.overclaimed){H("Overclaimed"),y(C.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let l of i.blockers)O(C.red(l.requirement))}if(a&&s&&!s.ok){H(`Not yet ${a}`);for(let l of s.missing)O(`${C.yellow(l.id)} ${l.requirement}`)}if(u&&(y(),y(` ${C.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){y(),y(C.dim(" Next level needs:"));for(let l of i.blockers)y(` ${C.dim("\xB7")} ${l.requirement}`)}y(),process.exit(u?0:1)}var sT={start:"none",doctor:"none",inspect:"none",create:"none","graphic dev":"none","graphic push":"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",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","round push":"approved","link github":"approved"};function cT(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function lT(e,t){return e.commands.filter(r=>!r._hidden).map(r=>hL(r,t))}function hL(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:cT(e),...o?{account:sT[r]??"none"}:{},commands:lT(e,r)}}function dT(e,t){return{name:e.name(),version:t,summary:e.description(),options:cT(e),commands:lT(e,"")}}function uT(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Pe();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var me=new sr,mL=(()=>{let e=sc.map(t=>t.format);return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();me.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(vt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{yy(!!e.opts().json)});me.command("start").description("read the current directory and point at the right next step").action(W$);me.command("doctor").description("check the local environment").action(P$);me.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(R$);me.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${mL}`).addOption(new cn("--archetype <format>").hideHelp()).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(Xx);me.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=>ny({...e,noBrowser:e.browser===!1}));me.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(by);var pT=me.command("manifest").description("work with the App Manifest");pT.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(k$);pT.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(aT);me.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(g$);me.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(y$);var hT=me.command("reference").description("the private data a round is scored against");hT.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").action(Q$);hT.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(eT);var fL=me.command("round").description("the round a fan plays, and getting it into Studio");fL.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(tT);var mT=me.command("graphic").description("the graphic your game puts on a screen");mT.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(oT);mT.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(iT);me.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(v$);me.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(b$);me.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(w$);me.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(_$);me.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>cy(e,!1));me.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>cy(e,!0));me.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(x$);me.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(E$);me.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").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(I$);me.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)=>V$(e,t,vt));me.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)=>q$(e,t,vt));me.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=>z$(e.workspace));var gL=me.command("link").description("connect an account Gamestage needs (requires sign-in)");gL.command("github").description("link your GitHub account, which a first deploy requires").action(M$);var fT=me.command("admin").description("approve or refuse a creator's account (operators only)");fT.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>sy(e,"approved"));fT.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>sy(e,"refused"));me.command("logout").description("forget the stored session").action(F$);me.command("whoami").description("show who the CLI is signed in as").action(G$);uT(process.argv)&&(process.stdout.write(`${JSON.stringify(dT(me,vt),null,2)}
10255
+ one yet. ${D_}`)),y()}var lo=class extends Error{};function eT(e){let t=e.what.trim();if(!t)throw new lo("Say what you were trying to build.");if(t.length>2e3)throw new lo(`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 tT(e){return JSON.stringify(e,null,2)}async function el(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=[nT(a.value)];for(let l=await o.next();!l.done;l=await o.next())s.push(nT(l.value));let u=s.join("");return u.trim()?u:e??""}function nT(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Ce();var pL=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function rT(e,t,r,o=process.stdin){let n=await el(e,o),i;try{i=eT({what:n,closest:t.closest,cliVersion:r})}catch(u){throw u instanceof lo&&V(u.message),u}if(!t.send){if(q()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),y(),y(tT(i)),y(),I("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),I(n===e?`Send it with ${ge('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ge("suggest --send")}.`);return}let a;try{a=await fetch(pL,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(u){V("Could not reach Gamestage to send that.",[u instanceof Error?u.message:String(u)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that suggestion (${a.status}).`,[s.error?.message??"It said nothing more."]),q()){Q({sent:!0,reference:s.reference??null});return}K("Sent"),s.reference&&I(`Reference ${s.reference}. Quote it if you follow up.`),I("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var uo=class extends Error{};function oT(e){let t=e.what.trim();if(!t)throw new uo("Say what went wrong.");if(t.length>2e3)throw new uo(`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 iT(e){return JSON.stringify(e,null,2)}Ce();var hL=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function aT(e,t,r,o=process.stdin){let n=await el(e,o),i;try{i=oT({what:n,game:t.game,cliVersion:r,nodeVersion:process.version,platform:process.platform})}catch(u){throw u instanceof uo&&V(u.message),u}if(!t.send){if(q()){Q({sent:!1,would_send:i});return}K("This is everything that would be sent"),y(),y(iT(i)),y(),I("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),I(n===e?`Send it with ${ge('issue "..." --send')}.`:`Send it by piping the same text again, with ${ge("issue --send")}.`);return}let a;try{a=await fetch(hL,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i)})}catch(u){V("Could not reach Gamestage to send that.",[u instanceof Error?u.message:String(u)])}let s=await a.json().catch(()=>({}));if(a.ok||V(`Gamestage refused that report (${a.status}).`,[s.error?.message??"It said nothing more."]),q()){Q({sent:!0,reference:s.reference??null});return}K("Reported"),s.reference&&I(`Reference ${s.reference}. Quote it if you follow up.`),I("It is in the backlog now. Somebody at Monterosa reads these.")}xe();$t();Ce();import{readFile as mL}from"node:fs/promises";import{resolve as fL}from"node:path";async function sT(e){let t=fL(e),r;try{r=await mL(t,"utf8")}catch{V(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let o;try{o=JSON.parse(r)}catch(i){V(`${e} is not JSON.`,[i instanceof Error?i.message:"Could not parse it."])}let n=An.safeParse(o);if(!n.success){let i=n.error.issues[0];V(`${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 gL(e){let t=An.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(r=>[r.key,Object.keys(r.values).length]))}var yL={copy:"immutable copy",pointer:"reference data"};async function vL(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||V(`The ${r} upload was refused with ${o.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function cT(e,t){let{client:r}=await ke(),{body:o}=await sT(t),n=oc(o),i=await r.referenceUploadTarget(e,n),a=await Cx(o,async(l,p)=>{await vL(l==="copy"?i.copy:i.pointer,p,yL[l])});a.ok||V(`${t} is not valid reference data.`,[a.detail??"No detail."]);let{measures:s,counts:u}=a.summary;if(q())return Q({ok:!0,name:e,digest:n,measures:s,counts:u,key:i.pointer.key});K("Pushed"),I(`${e} is now the reference data for this workspace`);for(let l of s)I(`${l}: ${u[l].toLocaleString("en-GB")} values`);I(`Digest ${n}, kept so a round can say what it was scored on`),y(),I("A round provisioned from now on uses this. One already in play keeps"),I("the numbers it opened with, which is deliberate.")}async function lT(e,t){let{body:r,measures:o}=await sT(e),n=gL(r),i=An.parse(JSON.parse(r)),a={};for(let s of i.measures){let u=t.filter(l=>typeof s.values[l]!="number");u.length&&(a[s.key]=u)}if(q())return Q({ok:Object.keys(a).length===0,measures:o,counts:n,missing:a});K("Reference data");for(let s of o)I(`${s}: ${n[s].toLocaleString("en-GB")} values`);if(!t.length){y(),I("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(y(),!Object.keys(a).length){I(`All ${t.length} key(s) are present in every measure.`);return}for(let[s,u]of Object.entries(a))I(`${s} has no value for ${u.map(l=>`"${l}"`).join(", ")}`);V("A round using those keys would be refused rather than scoring them as nothing.")}xe();$t();Ce();import{readFile as bL}from"node:fs/promises";import{resolve as wL}from"node:path";import{createInterface as _L}from"node:readline/promises";async function kL(e){let t;try{t=await bL(wL(e),"utf8")}catch{V(`Cannot read ${e}.`,["Point at the manifest holding the round, e.g. `--manifest gamestage.yaml`."])}let r=Ne(t);r.ok||V(`${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||V(`${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"&&V("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 xL(e){if(K("What goes into Studio"),I(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){I(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)I(`${t.label||t.id}: ${t.entries.map(r=>r.label||r.key).join(", ")}`);y(),y("No point values go with it. They stay in your reference data, where only"),y("the Engine reads them.")}else if(e.archetype==="shoot")I(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),I(`Keeper: ${e.difficulty}`),y(),y("Nothing here is an answer. The keeper is decided by the Engine at play time,"),y("from entropy it minted when the round was provisioned.");else{if(I(`Board: ${e.board.join(", ")}`),e.archetype==="hunt")I(`The answer: ${e.targets.join(", ")}`);else for(let t of e.groups)I(`${t.label}: ${t.members.join(", ")}`);y(),y("The answer goes with it, into a field Studio withholds from a fan's browser."),y("Only a producer signed into Studio can read it.")}y()}async function SL(e,t){if(t)return!0;process.stdin.isTTY||V("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=_L({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 dT(e,t){let r=t.manifest??"gamestage.yaml",o=await kL(r),n=o.archetype==="push"?cx(o):o;if(q()||xL(n),!await SL(e,!!t.yes)){y("Nothing was written.");return}try{let{client:i}=await ke(),a=await i.seedRound(e,n);a.refused&&V("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"};Q({game:e,seeded:!0,archetype:n.archetype,parts:s.count}),q()||(K("Written"),I(`${s.count} ${s.noun} are now on ${e}'s round in Studio.`),I("A producer can change every word of it without another deploy."),I("Take the round out of your manifest when you are ready: `gamestage dev` is the only thing that still reads it."),y())}catch(i){Pe(i)}}var tl={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},nl=`
10256
+ /* Prev and Next render as bordered web buttons on a graphic nobody can
10257
+ click, next to "PAGE 1 OF 4". A director seeing browser chrome concludes
10258
+ the feed is a screen-share rather than a broadcast source. */
10259
+ .table-footer, .footer-text, .pagination-btn { display: none !important; }
10260
+
10261
+ /* Ranks 1 to 3 get metallic gradients and 4 and below get solid white, so
10262
+ second place renders dimmer than fourth: the hierarchy inverts in the one
10263
+ column the graphic exists for. The gradient also relies on
10264
+ background-clip:text with color:transparent and no fallback, so if that
10265
+ does not paint on the playout device the top three scores are invisible
10266
+ while the rest of the board looks fine. */
10267
+ .entry-score, .rank-text--1, .rank-text--2, .rank-text--3 {
10268
+ color: #fff !important;
10269
+ -webkit-text-fill-color: #fff !important;
10270
+ background: none !important;
10271
+ }
10272
+
10273
+ /* Proportional figures swing 34% in width between 11111 and 88888, so a live
10274
+ number shimmies as it updates, and a right-aligned column stops being
10275
+ readable as a shape at distance. */
10276
+ .entry-score, .entry-rank, .col-score { font-variant-numeric: tabular-nums; }
10277
+
10278
+ `,uT=`
10279
+ .leaderboard { border: none !important; border-radius: 0 !important; background: transparent !important; }
10280
+ /* A fixed row rather than flex-fill. Filling was tried first and the rows are
10281
+ not the direct children of .entries, so the flex basis and the max-height
10282
+ both landed on a wrapper and one row rendered 879px tall. Rows on black at
10283
+ a known height need no cooperation from the renderer's layout, and with the
10284
+ frame gone there is nothing left to look empty. */
10285
+ .entry-row { height: 132px !important; max-height: 132px !important; }
10286
+ `,pT=`
10287
+ .leaderboard { border-width: 3px !important; }
10288
+ `,hT=`
10289
+ #root { padding: 54px 96px !important; }
10290
+ `,mT=`
10291
+ html[data-mode="embed"], html[data-mode="embed"] body, #root {
10292
+ background: transparent !important;
10293
+ }
10294
+ body { padding: 0 !important; }
10295
+ `;function rl(e,t,r){return`
10296
+ .entry-name { font-size: ${e}px !important; }
10297
+ .entry-score { font-size: ${t}px !important; }
10298
+ .table-header .col { font-size: ${r}px !important; }
10299
+ `}var Ui=[{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:{...tl,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:"#E8113C",cssOverrides:`${nl}${mT}${rl(40,48,20)}${pT}
10300
+ /* The lower third of the frame, inside the title-safe area. */
10301
+ #root {
10302
+ position: fixed;
10303
+ left: 96px; right: 96px; bottom: 76px;
10304
+ height: auto; padding: 0 !important;
10305
+ }
10306
+ /* A box over grass is a grey smear rather than a black bar, so the text
10307
+ needs its own edge once this is keyed over a picture. */
10308
+ .leaderboard { background: rgba(0,0,0,0.78); border-radius: 6px; }
10309
+ .entry-name, .entry-score { text-shadow: 0 2px 6px rgba(0,0,0,0.9); }
10310
+ .entry-row { height: 68px; }
10311
+ `}},{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:{...tl,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:"#E8113C",cssOverrides:`${nl}${mT}${rl(34,40,18)}${pT}
10312
+ /* The right 30%, full height, inside the title-safe area. The picture keeps
10313
+ the left two thirds, which is where the action is. */
10314
+ #root {
10315
+ position: fixed;
10316
+ top: 54px; bottom: 54px; right: 96px;
10317
+ width: 30%; padding: 0 !important;
10318
+ display: flex; align-items: stretch;
10319
+ }
10320
+ .leaderboard { background: rgba(0,0,0,0.82); border-radius: 8px; width: 100%; }
10321
+ .entry-name, .entry-score { text-shadow: 0 2px 6px rgba(0,0,0,0.9); }
10322
+ /* Rows share the height rather than leaving a framed empty strip below them,
10323
+ which reads as a crashed feed. */
10324
+ .entries { display: flex; flex-direction: column; }
10325
+ .entry-row { flex: 1 1 0; min-height: 0; max-height: none; }
10326
+ /* A narrow column cannot let a long name push the score off the end. */
10327
+ .col-name { min-width: 0; }
10328
+ .entry-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
10329
+ `}},{id:"bigscreen",summary:"A stadium screen or a Jumbotron",madeFor:"The big screen in the ground",type:"leaderboard",attributes:{...tl,rowsPerScreen:10,embedPageSize:10,showAvatars:!0,avatarStyle:"circle",aspectRatio:"16/9",accentColour:"#E8113C",cssOverrides:`${nl}${hT}${rl(72,88,28)}${uT}
10330
+ /* Sized for a 20m board serving a 150m bowl. The renderer's own cap is
10331
+ 30.4px on a name, which is comfortable to about 44m and no further.
10332
+ A closer room wants smaller numbers than these, set per venue. */
10333
+ .entries { display: flex; flex-direction: column; }
10334
+ .entry-row { flex: 1 1 0; min-height: 0; max-height: none; }
10335
+ `,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:{...tl,rowsPerScreen:8,embedPageSize:8,showAvatars:!0,avatarStyle:"circle",aspectRatio:"9/16",accentColour:"#E8113C",cssOverrides:`${nl}${hT}${rl(48,56,24)}${uT}
10336
+ /* A concourse panel is read from a few metres, not from a stand, so the type
10337
+ is smaller than the big screen's. Rows share the height: on a 9:16 panel
10338
+ the board otherwise sits in the top third with a framed empty strip below
10339
+ it, which reads as a crashed feed. */
10340
+ `}},{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"}}],zi="bigscreen";function wy(e){return Ui.find(t=>t.id===e)}function fT(){return Ui.map(e=>e.id)}import{createServer as EL}from"node:http";import{readFile as yT}from"node:fs/promises";import{extname as $L}from"node:path";$t();Ce();var Rn=1e4,ol="preview",TL=[{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:"Bright Heron",primaryScore:47230},{name:"Still Fox",primaryScore:44112}];function AL(e){switch($L(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 IL(e){let t="";try{t=await yT(e.css,"utf8")}catch{}let r=Number(e.rows)||10,o=new Date().toISOString();return{instance:{instanceId:ol,name:"Preview",type:"leaderboard",embedSlug:ol,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:o,updatedAt:o,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:r,storyModeEnabled:!1,storySegmentSize:5,storySegmentDuration:8,accentColour:e.accent??"#FFD700",colourPreset:"dark",embedPageSize:r,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,cssOverrides:t}},entries:TL.slice(0,r).map((n,i)=>({entryId:`preview-${i}`,instanceId:ol,name:n.name,gender:"",primaryScore:n.primaryScore,rank:i+1,createdAt:o,updatedAt:o})),generatedAt:o}}async function gT(e,t){let r=new URL(t.replace(/^\/r\//,""),e.endsWith("/")?e:`${e}/`);return fetch(r,{redirect:"follow"})}async function vT(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}.
10341
+ Pass --renderer <url> if your Space serves it somewhere else.`);let o=EL((a,s)=>{(async()=>{let u=(a.url??"/").split("?")[0]??"/";try{if(u.startsWith("/api/gfx/instances/")){let h=JSON.stringify(await IL(e));s.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),s.end(h);return}if(u==="/"||u==="/index.html"){let h=e.bigscreen?"bigscreen.html":"embed.html",g=await(await gT(t,h)).text();g=g.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),s.writeHead(200,{"content-type":"text/html; charset=utf-8"}),s.end(g);return}let l=await gT(t,u);if(!l.ok){s.writeHead(l.status),s.end();return}let p=Buffer.from(await l.arrayBuffer());s.writeHead(200,{"content-type":AL(u)}),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)}
10342
+ `)}})()});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=${ol}${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(`
10343
+ `)),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 PL(e,t){let r=new URL(e),o=r.pathname.split("/");return o.pop(),r.pathname=[...o,t.replace(/^\.?\//,"")].join("/"),r.toString()}async function bT(e,t){let r=(o,n,i,a={},s={})=>{if(process.exitCode=1,q()){Q({ok:!1,reason:o,game:e,stylesheet:t.css,...s});return}K(n);for(let[u,l]of Object.entries(a))U(u,l);y();for(let u of i)I(u);y()};try{let o;try{o=await yT(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>Rn){r("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Rn.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(o.length-Rn).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${o.length.toLocaleString()} characters`,Limit:`${Rn.toLocaleString()} characters`},{characters:o.length,limit:Rn});return}let{client:n}=await ke(),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=PL(i.playgroundUrl,t.css),s=!1,u=0;try{let l=await fetch(a);u=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:u?String(u):"nothing"},{url:a,status:u,characters:o.length,limit:Rn});return}if(q()){Q({ok:!0,game:i.id,stylesheet:t.css,characters:o.length,limit:Rn,url:a});return}K("Ready for a producer"),U("Game",`${i.name} (${i.id})`),U("Stylesheet",`${t.css} (${o.length.toLocaleString()} of ${Rn.toLocaleString()} characters)`),U("Address",a),y(),I("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),I("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."),y()}catch(o){Pe(o)}}function _y(e,t){let o=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:o};let n=wy(t.template)?.attributes?.rowsPerScreen,i=n?`${o}&rows=${n}`:o;return t.template==="bigscreen"?{Address:`${o}&bigscreen=true`,"Overlay form":i}:{Address:i}}function wT(e,t){return e.refused?(process.exitCode=1,q()?(Q({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(K("Not done"),y(` ${e.refused}`),y(),!0)):!1}async function _T(e,t){let r=(n,i,a)=>{if(process.exitCode=1,q()){Q({ok:!1,reason:n,game:e,template:t.template});return}K(i),y();for(let s of a)I(s);y()},o=wy(t.template);if(!o){r("no_such_template",`No template called ${t.template}`,[`The templates are: ${fT().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 ke(),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(wT(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 u=_y(i.playgroundUrl,s);if(q()){Q({ok:!0,game:i.id,graphic:s,addresses:u});return}K("On screen"),U("Game",`${i.name} (${i.id})`),U("Template",`${o.id} - ${o.summary}`),U("Made for",o.madeFor);for(let[l,p]of Object.entries(u))U(l,p);y(),I("Open that address on the screen. It is a web page and needs no sign-in."),I(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."),I(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${i.id}\`.`),y()}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}Pe(n)}}async function kT(e){try{let{client:t}=await ke(),r=await t.getGame(e);if(!r){process.exitCode=1,q()?Q({ok:!1,reason:"no_such_game",game:e}):(K("No such game"),y(),I(`Nothing in your workspace has the id ${e}.`),y());return}let o=r.graphics??[];if(q()){Q({ok:!0,game:r.id,graphics:o.map(n=>({...n,addresses:r.playgroundUrl?_y(r.playgroundUrl,n):{}}))});return}if(o.length===0){K("No graphics yet"),y(),I(`Make one with \`gamestage graphic create ${r.id} --template bigscreen --consent\`.`),y();return}K(`${o.length} graphic${o.length===1?"":"s"}`);for(let n of o){if(y(),U("Template",`${n.template} (${n.type})`),U("Id",n.instanceId),r.playgroundUrl)for(let[i,a]of Object.entries(_y(r.playgroundUrl,n)))U(i,a);U("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}y(),I(`Take one down with \`gamestage graphic remove ${r.id} <id>\`.`),y()}catch(t){Pe(t)}}async function xT(e,t){try{let{client:r}=await ke(),o=await r.removeGraphic(e,t);if(wT(o,"graphic remove"))return;if(q()){Q({ok:!0,game:o.game.id,removed:t});return}K("Taken down"),U("Game",`${o.game.name} (${o.game.id})`),U("Removed",t),y(),I("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),y()}catch(r){Pe(r)}}function ST(){if(q()){Q({ok:!0,default:zi,templates:Ui.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}K("Graphic templates");for(let e of Ui)y(),U(e.id,e.id===zi?`${e.summary} (the default)`:e.summary),U("",e.madeFor);y(),I("Pick one with `gamestage graphic create <game> --template <id> --consent`."),y()}xe();Ce();import{readFile as CL}from"node:fs/promises";async function ET(e,t){let r;try{r=await CL(e,"utf8")}catch{return V(`Cannot read ${e}`)}let o=Ne(r);if(!o.ok)return q()&&(Q({ok:!1,stage:"parse",issues:o.issues}),process.exit(1)),V(`${e} is not a valid App Manifest`,o.issues.map(l=>`${O.cyan(l.path)} ${l.message}`));let n=o.manifest,i=st(n),a=null;if(t.level){let l=_n.safeParse(t.level.toUpperCase());if(!l.success)return V(`Unknown level "${t.level}". Use L0 through L5.`);a=l.data}let s=a?W_(n,a):null,u=!i.overclaimed&&(s?.ok??!0);if(q()&&(Q({ok:u,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}),process.exit(u?0:1)),K(`${n.app.title} ${O.dim(n.app.id)}`),U("Schema",n.manifest.schema_version),U("Revision",String(n.manifest.revision)),U("Conformance",i.overclaimed?`${O.red(i.claimed)} claimed, ${O.bold(i.computed)} evidenced`:`${O.green(i.computed)} ${i.computedName}`),i.overclaimed){K("Overclaimed"),y(O.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let l of i.blockers)I(O.red(l.requirement))}if(a&&s&&!s.ok){K(`Not yet ${a}`);for(let l of s.missing)I(`${O.yellow(l.id)} ${l.requirement}`)}if(u&&(y(),y(` ${O.green("Valid")}${a?` at ${a}`:""}.`),i.blockers.length)){y(),y(O.dim(" Next level needs:"));for(let l of i.blockers)y(` ${O.dim("\xB7")} ${l.requirement}`)}y(),process.exit(u?0:1)}var $T={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",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","round push":"approved","link github":"approved"};function TT(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function AT(e,t){return e.commands.filter(r=>!r._hidden).map(r=>OL(r,t))}function OL(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:TT(e),...o?{account:$T[r]??"none"}:{},commands:AT(e,r)}}function IT(e,t){return{name:e.name(),version:t,summary:e.description(),options:TT(e),commands:AT(e,"")}}function PT(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Ce();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var me=new sr,NL=(()=>{let e=dc.map(t=>t.format);return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();me.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(vt).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{$y(!!e.opts().json)});me.command("start").description("read the current directory and point at the right next step").action(Q$);me.command("doctor").description("check the local environment").action(U$);me.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(B$);me.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${NL}`).addOption(new cn("--archetype <format>").hideHelp()).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(sS);me.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=>ly({...e,noBrowser:e.browser===!1}));me.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(Ay);var CT=me.command("manifest").description("work with the App Manifest");CT.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(C$);CT.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(ET);me.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(E$);me.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($$);var OT=me.command("reference").description("the private data a round is scored against");OT.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").action(cT);OT.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(lT);var RL=me.command("round").description("the round a fan plays, and getting it into Studio");RL.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(dT);var po=me.command("graphic").description("the graphic your game puts on a screen");po.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(vT);po.command("templates").description("the screens a graphic can be cut for").action(ST);po.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",zi).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(_T);po.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(kT);po.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action(xT);po.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(bT);me.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(T$);me.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(A$);me.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(I$);me.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(P$);me.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>fy(e,!1));me.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>fy(e,!0));me.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(O$);me.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(R$);me.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").description("serve your round locally, through the Engine that will serve it in the cloud (requires sign-in)").action(M$);me.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)=>rT(e,t,vt));me.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)=>aT(e,t,vt));me.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=>Y$(e.workspace));var LL=me.command("link").description("connect an account Gamestage needs (requires sign-in)");LL.command("github").description("link your GitHub account, which a first deploy requires").action(H$);var NT=me.command("admin").description("approve or refuse a creator's account (operators only)");NT.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>my(e,"approved"));NT.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>my(e,"refused"));me.command("logout").description("forget the stored session").action(J$);me.command("whoami").description("show who the CLI is signed in as").action(q$);PT(process.argv)&&(process.stdout.write(`${JSON.stringify(IT(me,vt),null,2)}
10259
10344
  `),process.exit(0));me.parseAsync(process.argv).catch(e=>{process.stderr.write(`${e instanceof Error?e.message:String(e)}
10260
10345
  `),process.exit(1)});