gamestage 0.57.0 → 0.58.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 +40 -40
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -74,13 +74,13 @@ var AN=Object.defineProperty;var _=(e,t,o)=>()=>{if(o)throw o[0];try{return e&&(
74
74
 
75
75
  `)}g.write("payload.value = newResult;"),g.write("return payload;");let F=g.compile();return(U,W)=>F(f,U,W)},a,i=Jo,c=!Ko.jitless,l=c&&Vm.value,u=t.catchall,p;e._zod.parse=(f,g)=>{p??(p=r.value);let b=f.value;return i(b)?c&&l&&g?.async===!1&&g.jitless!==!0?(a||(a=n(t.shape)),f=a(f,g),u?Ox([],b,f,g,p,e):f):o(f,g):(f.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),f)}});xi=E("$ZodUnion",(e,t)=>{Ee.init(e,t),Oe(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Oe(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Oe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Oe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>mi(n.source)).join("|")})$`)}});let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let a=!1,i=[];for(let c of t.options){let d=c._zod.run({value:r.value,issues:[]},n);if(d instanceof Promise)i.push(d),a=!0;else{if(d.issues.length===0)return d;i.push(d)}}return a?Promise.all(i).then(c=>fx(c,r,e,n)):fx(i,r,e,n)}});Gh=E("$ZodXor",(e,t)=>{xi.init(e,t),t.inclusive=!1;let o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,n)=>{if(o)return o(r,n);let a=!1,i=[];for(let c of t.options){let d=c._zod.run({value:r.value,issues:[]},n);d instanceof Promise?(i.push(d),a=!0):i.push(d)}return a?Promise.all(i).then(c=>gx(c,r,e,n)):gx(i,r,e,n)}}),Bh=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xi.init(e,t);let o=e._zod.parse;Oe(e._zod,"propValues",()=>{let n={};for(let a of t.options){let i=a._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[c,d]of Object.entries(i)){n[c]||(n[c]=new Set);for(let l of d)n[c].add(l)}}return n});let r=zr(()=>{let n=t.options,a=new Map;for(let i of n){let c=i._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let d of c){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,i)}}return a});e._zod.parse=(n,a)=>{let i=n.value;if(!Jo(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let c=r.value.get(i?.[t.discriminator]);return c?c._zod.run(n,a):t.unionFallback||a.direction==="backward"?o(n,a):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:i,path:[t.discriminator],inst:e}),n)}}),qh=E("$ZodIntersection",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,a=t.left._zod.run({value:n,issues:[]},r),i=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([d,l])=>yx(o,d,l)):yx(o,a,i)}});Kc=E("$ZodTuple",(e,t)=>{Ee.init(e,t);let o=t.items;e._zod.parse=(r,n)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let i=[],c=bx(o,"optin"),d=bx(o,"optout");if(!t.rest){if(a.length<c)return r.issues.push({code:"too_small",minimum:c,inclusive:!0,input:a,inst:e,origin:"array"}),r;a.length>o.length&&r.issues.push({code:"too_big",maximum:o.length,inclusive:!0,input:a,inst:e,origin:"array"})}let l=new Array(o.length);for(let u=0;u<o.length;u++){let p=o[u]._zod.run({value:a[u],issues:[]},n);p instanceof Promise?i.push(p.then(f=>{l[u]=f})):l[u]=p}if(t.rest){let u=o.length-1,p=a.slice(o.length);for(let f of p){u++;let g=t.rest._zod.run({value:f,issues:[]},n);g instanceof Promise?i.push(g.then(b=>wx(b,r,u))):wx(g,r,u)}}return i.length?Promise.all(i).then(()=>vx(l,r,o,a,d)):vx(l,r,o,a,d)}});Wh=E("$ZodRecord",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!ho(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let a=[],i=t.keyType._zod.values;if(i){o.value={};let c=new Set;for(let l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(g=>Tt(g,r,it())),input:l,path:[l],inst:e});continue}let p=u.value,f=t.valueType._zod.run({value:n[l],issues:[]},r);f instanceof Promise?a.push(f.then(g=>{g.issues.length&&o.issues.push(...Ot(l,g.issues)),o.value[p]=g.value})):(f.issues.length&&o.issues.push(...Ot(l,f.issues)),o.value[p]=f.value)}let d;for(let l in n)c.has(l)||(d=d??[],d.push(l));d&&d.length>0&&o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:d})}else{o.value={};for(let c of Reflect.ownKeys(n)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,c))continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Dc.test(c)&&d.issues.length){let p=t.keyType._zod.run({value:Number(c),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(d=p)}if(d.issues.length){t.mode==="loose"?o.value[c]=n[c]:o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>Tt(p,r,it())),input:c,path:[c],inst:e});continue}let u=t.valueType._zod.run({value:n[c],issues:[]},r);u instanceof Promise?a.push(u.then(p=>{p.issues.length&&o.issues.push(...Ot(c,p.issues)),o.value[d.value]=p.value})):(u.issues.length&&o.issues.push(...Ot(c,u.issues)),o.value[d.value]=u.value)}}return a.length?Promise.all(a).then(()=>o):o}}),Hh=E("$ZodMap",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),o;let a=[];o.value=new Map;for(let[i,c]of n){let d=t.keyType._zod.run({value:i,issues:[]},r),l=t.valueType._zod.run({value:c,issues:[]},r);d instanceof Promise||l instanceof Promise?a.push(Promise.all([d,l]).then(([u,p])=>{kx(u,p,o,i,n,e,r)})):kx(d,l,o,i,n,e,r)}return a.length?Promise.all(a).then(()=>o):o}});Yh=E("$ZodSet",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Set))return o.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),o;let a=[];o.value=new Set;for(let i of n){let c=t.valueType._zod.run({value:i,issues:[]},r);c instanceof Promise?a.push(c.then(d=>_x(d,o))):_x(c,o)}return a.length?Promise.all(a).then(()=>o):o}});Vh=E("$ZodEnum",(e,t)=>{Ee.init(e,t);let o=ui(t.entries),r=new Set(o);e._zod.values=r,e._zod.pattern=new RegExp(`^(${o.filter(n=>pi.has(typeof n)).map(n=>typeof n=="string"?Ht(n):n.toString()).join("|")})$`),e._zod.parse=(n,a)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:o,input:i,inst:e}),n}}),Kh=E("$ZodLiteral",(e,t)=>{if(Ee.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ht(r):r?Ht(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),Zh=E("$ZodFile",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return n instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),o}}),Jh=E("$ZodTransform",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new uo(e.constructor.name);let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(o.value=i,o.fallback=!0,o));if(n instanceof Promise)throw new on;return o.value=n,o.fallback=!0,o}});Zc=E("$ZodOptional",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Oe(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${mi(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>{if(t.innerType._zod.optin==="optional"){let n=o.value,a=t.innerType._zod.run(o,r);return a instanceof Promise?a.then(i=>xx(i,n)):xx(a,n)}return o.value===void 0?o:t.innerType._zod.run(o,r)}}),Xh=E("$ZodExactOptional",(e,t)=>{Zc.init(e,t),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,r)=>t.innerType._zod.run(o,r)}),Qh=E("$ZodNullable",(e,t)=>{Ee.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${mi(o.source)}|null)$`):void 0}),Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>o.value===null?o:t.innerType._zod.run(o,r)}),ef=E("$ZodDefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(a=>Sx(a,t)):Sx(n,t)}});tf=E("$ZodPrefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>(r.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,r))}),nf=E("$ZodNonOptional",(e,t)=>{Ee.init(e,t),Oe(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter(r=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(a=>Tx(a,e)):Tx(n,e)}});of=E("$ZodSuccess",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new uo("ZodSuccess");let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(a=>(o.value=a.issues.length===0,o)):(o.value=n.issues.length===0,o)}}),rf=E("$ZodCatch",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(i=>Tt(i,r,it()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=n.value,n.issues.length&&(o.value=t.catchValue({...o,error:{issues:n.issues.map(a=>Tt(a,r,it()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),af=E("$ZodNaN",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),Jc=E("$ZodPipe",(e,t)=>{Ee.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if(r.direction==="backward"){let a=t.out._zod.run(o,r);return a instanceof Promise?a.then(i=>Bc(i,t.in,r)):Bc(a,t.in,r)}let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(a=>Bc(a,t.out,r)):Bc(n,t.out,r)}});Si=E("$ZodCodec",(e,t)=>{Ee.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,r)=>{if((r.direction||"forward")==="forward"){let a=t.in._zod.run(o,r);return a instanceof Promise?a.then(i=>qc(i,t,r)):qc(a,t,r)}else{let a=t.out._zod.run(o,r);return a instanceof Promise?a.then(i=>qc(i,t,r)):qc(a,t,r)}}});sf=E("$ZodPreprocess",(e,t)=>{Jc.init(e,t)}),cf=E("$ZodReadonly",(e,t)=>{Ee.init(e,t),Oe(e._zod,"propValues",()=>t.innerType._zod.propValues),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"optin",()=>t.innerType?._zod?.optin),Oe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,r)=>{if(r.direction==="backward")return t.innerType._zod.run(o,r);let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(Ex):Ex(n)}});lf=E("$ZodTemplateLiteral",(e,t)=>{Ee.init(e,t);let o=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let a=n.startsWith("^")?1:0,i=n.endsWith("$")?n.length-1:n.length;o.push(n.slice(a,i))}else if(r===null||Zm.has(typeof r))o.push(Ht(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),df=E("$ZodFunction",(e,t)=>(Ee.init(e,t),e._def=t,e._zod.def=t,e.implement=o=>{if(typeof o!="function")throw new Error("implement() must be called with a function");return function(...r){let n=e._def.input?$c(e._def.input,r):r,a=Reflect.apply(o,this,n);return e._def.output?$c(e._def.output,a):a}},e.implementAsync=o=>{if(typeof o!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await Ac(e._def.input,r):r,a=await Reflect.apply(o,this,n);return e._def.output?await Ac(e._def.output,a):a}},e._zod.parse=(o,r)=>typeof o.value!="function"?(o.issues.push({code:"invalid_type",expected:"function",input:o.value,inst:e}),o):(e._def.output&&e._def.output._zod.def.type==="promise"?o.value=e.implementAsync(o.value):o.value=e.implement(o.value),o),e.input=(...o)=>{let r=e.constructor;return Array.isArray(o[0])?new r({type:"function",input:new Kc({type:"tuple",items:o[0],rest:o[1]}),output:e._def.output}):new r({type:"function",input:o[0],output:e._def.output})},e.output=o=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:o})},e)),uf=E("$ZodPromise",(e,t)=>{Ee.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),mf=E("$ZodLazy",(e,t)=>{Ee.init(e,t),Oe(e._zod,"innerType",()=>{let o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),Oe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Oe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Oe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Oe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),pf=E("$ZodCustom",(e,t)=>{Ze.init(e,t),Ee.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=o=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then(a=>$x(a,o,r,e));$x(n,o,r,e)}})});function Rx(){return{localeError:jL()}}var jL,Nx=_(()=>{me();jL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}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 ${K(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: ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?` \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"} ${a} ${n.maximum.toString()} ${i.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"} ${a} ${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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 ${a} ${n.minimum.toString()} ${i.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 ${a} ${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`${o[a.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":""}: ${N(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 Lx(){return{localeError:DL()}}var DL,zx=_(()=>{me();DL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${c}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${K(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${a}${n.maximum.toString()} ${i.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${a}${n.minimum.toString()} ${i.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[a.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":""}: ${N(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 jx(e,t,o,r){let n=Math.abs(e),a=n%10,i=n%100;return i>=11&&i<=19?r:a===1?t:a>=2&&a<=4?o:r}function Dx(){return{localeError:ML()}}var ML,Mx=_(()=>{me();ML=()=>{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 o={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"},r={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);if(i){let c=Number(n.maximum),d=jx(c,i.unit.one,i.unit.few,i.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 ${i.verb} ${a}${n.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);if(i){let c=Number(n.minimum),d=jx(c,i.unit.one,i.unit.few,i.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 ${i.verb} ${a}${n.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[a.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"}: ${N(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 Fx(){return{localeError:FL()}}var FL,Ux=_(()=>{me();FL=()=>{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 o={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"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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 ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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 ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;if(a.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 "${a.prefix}"`;if(a.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 "${a.suffix}"`;if(a.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 "${a.includes}"`;if(a.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 ${a.pattern}`;let i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(i="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${i} ${o[a.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":""}: ${N(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 Gx(){return{localeError:UL()}}var UL,Bx=_(()=>{me();UL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${c}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${K(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${N(n.values," o ")}`;case"too_big":{let a=n.inclusive?"com a m\xE0xim":"menys de",i=t(n.origin);return i?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${a} ${n.maximum.toString()} ${i.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${a} ${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?"com a m\xEDnim":"m\xE9s de",i=t(n.origin);return i?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${a} ${n.minimum.toString()} ${i.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${a} ${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${o[a.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":""}: ${N(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 qx(){return{localeError:GL()}}var GL,Wx=_(()=>{me();GL=()=>{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 o={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"},r={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${c}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${K(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${a}${n.maximum.toString()} ${i.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${a}${n.minimum.toString()} ${i.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${o[a.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: ${N(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 Hx(){return{localeError:BL()}}var BL,Yx=_(()=>{me();BL=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${c}`:`Ugyldigt input: forventede ${a}, fik ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${K(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin),c=r[n.origin]??n.origin;return i?`For stor: forventede ${c??"value"} ${i.verb} ${a} ${n.maximum.toString()} ${i.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${a} ${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin),c=r[n.origin]??n.origin;return i?`For lille: forventede ${c} ${i.verb} ${a} ${n.minimum.toString()} ${i.unit}`:`For lille: forventede ${c} havde ${a} ${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${o[a.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"}: ${N(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 Vx(){return{localeError:qL()}}var qL,Kx=_(()=>{me();qL=()=>{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 o={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"},r={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${c}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${K(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${a}${n.maximum.toString()} ${i.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${a}${n.maximum.toString()} ist`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Zu klein: erwartet, dass ${n.origin} ${a}${n.minimum.toString()} ${i.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${a}${n.minimum.toString()} ist`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${o[a.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"}: ${N(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 Zx(){return{localeError:WL()}}var WL,Jx=_(()=>{me();WL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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 ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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 ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${o[a.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"}: ${N(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 Xc(){return{localeError:HL()}}var HL,ff=_(()=>{me();HL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${K(n.values[0])}`:`Invalid option: expected one of ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${a}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Too small: expected ${n.origin} to have ${a}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${o[a.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":""}: ${N(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(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function Xx(){return{localeError:YL()}}var YL,Qx=_(()=>{me();YL=()=>{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 o={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"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${c}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${K(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${a}${n.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${a}${n.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${o[a.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":""}: ${N(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 eS(){return{localeError:VL()}}var VL,tS=_(()=>{me();VL=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${K(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin),c=r[n.origin]??n.origin;return i?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${a}${n.maximum.toString()} ${i.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin),c=r[n.origin]??n.origin;return i?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${a}${n.minimum.toString()} ${i.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${o[a.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":""}: ${N(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function nS(){return{localeError:KL()}}var KL,oS=_(()=>{me();KL=()=>{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 o={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"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c} \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 ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \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 ${K(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 ${N(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${a}${n.minimum.toString()} ${i.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${a}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[a.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: ${N(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 rS(){return{localeError:ZL()}}var ZL,aS=_(()=>{me();ZL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${c}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${K(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Liian suuri: ${i.subject} t\xE4ytyy olla ${a}${n.maximum.toString()} ${i.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Liian pieni: ${i.subject} t\xE4ytyy olla ${a}${n.minimum.toString()} ${i.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${o[a.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"}: ${N(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 iS(){return{localeError:JL()}}var JL,sS=_(()=>{me();JL=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${c} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${K(n.values[0])} attendu`:`Option invalide : une valeur parmi ${N(n.values,"|")} attendue`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Trop grand : ${r[n.origin]??"valeur"} doit ${i.verb} ${a}${n.maximum.toString()} ${i.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r[n.origin]??"valeur"} doit \xEAtre ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Trop petit : ${r[n.origin]??"valeur"} doit ${i.verb} ${a}${n.minimum.toString()} ${i.unit}`:`Trop petit : ${r[n.origin]??"valeur"} doit \xEAtre ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${o[a.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":""} : ${N(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 cS(){return{localeError:XL()}}var XL,lS=_(()=>{me();XL=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${c}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${K(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"\u2264":"<",i=t(n.origin);return i?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${a}${n.maximum.toString()} ${i.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?"\u2265":">",i=t(n.origin);return i?`Trop petit : attendu que ${n.origin} ait ${a}${n.minimum.toString()} ${i.unit}`:`Trop petit : attendu que ${n.origin} soit ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${o[a.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":""} : ${N(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 dS(){return{localeError:QL()}}var QL,uS=_(()=>{me();QL=()=>{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"}},o=l=>l?e[l]:void 0,r=l=>{let u=o(l);return u?u.label:l??e.unknown.label},n=l=>`\u05D4${r(l)}`,a=l=>(o(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",i=l=>l?t[l]??null:null,c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,p=d[u??""]??r(u),f=J(l.input),g=d[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 ${p}, \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 ${K(l.values[0])}`;let u=l.values.map(g=>K(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 ${u[0]} \u05D0\u05D5 ${u[1]}`;let p=u[u.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 ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let u=i(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let b=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: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${b}`}if(l.origin==="array"||l.origin==="set"){let b=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",v=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let f=l.inclusive?"<=":"<",g=a(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${l.maximum.toString()}`}case"too_small":{let u=i(l.origin),p=n(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let b=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: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${b}`}if(l.origin==="array"||l.origin==="set"){let b=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let x=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let v=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let f=l.inclusive?">=":">",g=a(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${g} ${f}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.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 ${u.pattern}`;let p=c[u.format],f=p?.label??u.format,b=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${b}`}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"}: ${N(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 mS(){return{localeError:ez()}}var ez,pS=_(()=>{me();ez=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${a}, a primljeno je ${c}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${K(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin),c=r[n.origin]??n.origin;return i?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${a}${n.maximum.toString()} ${i.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin),c=r[n.origin]??n.origin;return i?`Premalo: o\u010Dekivano da ${c} ima ${a}${n.minimum.toString()} ${i.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${a.prefix}"`:a.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${a.suffix}"`:a.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${a.includes}"`:a.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${a.pattern}`:`Neispravna ${o[a.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"}: ${N(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${r[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${r[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function hS(){return{localeError:tz()}}var tz,fS=_(()=>{me();tz=()=>{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 o={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"},r={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${K(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${n.maximum.toString()} ${i.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${a}${n.minimum.toString()} ${i.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[a.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":""}: ${N(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 gS(e,t,o){return Math.abs(e)===1?t:o}function Br(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],o=e[e.length-1];return e+(t.includes(o)?"\u0576":"\u0568")}function yS(){return{localeError:nz()}}var nz,bS=_(()=>{me();nz=()=>{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 o={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"},r={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);if(i){let c=Number(n.maximum),d=gS(c,i.unit.one,i.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 ${Br(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${n.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Br(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);if(i){let c=Number(n.minimum),d=gS(c,i.unit.one,i.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 ${Br(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${n.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Br(n.origin)} \u056C\u056B\u0576\u056B ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.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 ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${o[a.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":""}. ${N(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Br(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 ${Br(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function wS(){return{localeError:oz()}}var oz,vS=_(()=>{me();oz=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${a}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${K(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${a}${n.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Terlalu kecil: diharapkan ${n.origin} memiliki ${a}${n.minimum.toString()} ${i.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${o[a.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":""}: ${N(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 kS(){return{localeError:rz()}}var rz,_S=_(()=>{me();rz=()=>{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 o={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"},r={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${K(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${a}${n.maximum.toString()} ${i.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${a}${n.minimum.toString()} ${i.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${o[a.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"}: ${N(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 xS(){return{localeError:az()}}var az,SS=_(()=>{me();az=()=>{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 o={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"},r={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${c}`:`Input non valido: atteso ${a}, ricevuto ${c}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${K(n.values[0])}`:`Opzione non valida: atteso uno tra ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Troppo grande: ${n.origin??"valore"} deve avere ${a}${n.maximum.toString()} ${i.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Troppo piccolo: ${n.origin} deve avere ${a}${n.minimum.toString()} ${i.unit}`:`Troppo piccolo: ${n.origin} deve essere ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Input non valido: ${o[a.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"}: ${N(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 TS(){return{localeError:iz()}}var iz,ES=_(()=>{me();iz=()=>{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 o={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"},r={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${K(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${N(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",i=t(n.origin);return i?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",i=t(n.origin);return i?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[a.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":""}: ${N(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 $S(){return{localeError:sz()}}var sz,AS=_(()=>{me();sz=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}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 ${K(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 ${N(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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"} ${i.verb} ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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} ${i.verb} ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"-\u10D8\u10D7`:a.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 "${a.suffix}"-\u10D8\u10D7`:a.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 "${a.includes}"-\u10E1`:a.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 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${o[a.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"}: ${N(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 Qc(){return{localeError:cz()}}var cz,gf=_(()=>{me();cz=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${n.maximum.toString()} ${i.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"} ${a} ${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${a} ${n.minimum.toString()} ${i.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${a} ${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[a.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 ${N(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 CS(){return Qc()}var IS=_(()=>{gf()});function OS(){return{localeError:lz()}}var lz,PS=_(()=>{me();lz=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${K(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${N(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",i=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),d=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${d} ${a}${i}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${a}${i}`}case"too_small":{let a=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",i=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),d=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${d} ${a}${i}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${a}${i}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[a.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: ${N(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 RS(e){let t=Math.abs(e),o=t%10,r=t%100;return r>=11&&r<=19||o===0?"many":o===1?"one":"few"}function NS(){return{localeError:dz()}}var Ti,dz,LS=_(()=>{me();Ti=e=>e.charAt(0).toUpperCase()+e.slice(1);dz=()=>{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,a,i,c){let d=e[n]??null;return d===null?d:{unit:d.unit[a],verb:d.verb[c][i?"inclusive":"notInclusive"]}}let o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${a}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${K(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${N(n.values,"|")} pasirinkim\u0173`;case"too_big":{let a=r[n.origin]??n.origin,i=t(n.origin,RS(Number(n.maximum)),n.inclusive??!1,"smaller");if(i?.verb)return`${Ti(a??n.origin??"reik\u0161m\u0117")} ${i.verb} ${n.maximum.toString()} ${i.unit??"element\u0173"}`;let c=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ti(a??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.maximum.toString()} ${i?.unit}`}case"too_small":{let a=r[n.origin]??n.origin,i=t(n.origin,RS(Number(n.minimum)),n.inclusive??!1,"bigger");if(i?.verb)return`${Ti(a??n.origin??"reik\u0161m\u0117")} ${i.verb} ${n.minimum.toString()} ${i.unit??"element\u0173"}`;let c=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ti(a??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${n.minimum.toString()} ${i?.unit}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${o[a.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"}: ${N(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=r[n.origin]??n.origin;return`${Ti(a??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function zS(){return{localeError:uz()}}var uz,jS=_(()=>{me();uz=()=>{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 o={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"},r={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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 ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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 ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`Invalid ${o[a.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"}: ${N(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 DS(){return{localeError:mz()}}var mz,MS=_(()=>{me();mz=()=>{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 o={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"},r={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${c}`:`Input tidak sah: dijangka ${a}, diterima ${c}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${K(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Terlalu besar: dijangka ${n.origin??"nilai"} ${i.verb} ${a}${n.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Terlalu kecil: dijangka ${n.origin} ${i.verb} ${a}${n.minimum.toString()} ${i.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${o[a.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${N(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 FS(){return{localeError:pz()}}var pz,US=_(()=>{me();pz=()=>{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 o={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"},r={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${a}, ontving ${c}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${K(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin),c=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return i?`Te ${c}: verwacht dat ${n.origin??"waarde"} ${a}${n.maximum.toString()} ${i.unit??"elementen"} ${i.verb}`:`Te ${c}: verwacht dat ${n.origin??"waarde"} ${a}${n.maximum.toString()} is`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin),c=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return i?`Te ${c}: verwacht dat ${n.origin} ${a}${n.minimum.toString()} ${i.unit} ${i.verb}`:`Te ${c}: verwacht dat ${n.origin} ${a}${n.minimum.toString()} is`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${o[a.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":""}: ${N(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 GS(){return{localeError:hz()}}var hz,BS=_(()=>{me();hz=()=>{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 o={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"},r={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${c}`:`Ugyldig input: forventet ${a}, fikk ${c}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${K(n.values[0])}`:`Ugyldig valg: forventet en av ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${a}${n.maximum.toString()} ${i.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`For lite(n): forventet ${n.origin} til \xE5 ha ${a}${n.minimum.toString()} ${i.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${o[a.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"}: ${N(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 qS(){return{localeError:fz()}}var fz,WS=_(()=>{me();fz=()=>{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 o={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"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${K(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${a}${n.maximum.toString()} ${i.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${a}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${a}${n.minimum.toString()} ${i.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${a}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=n;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[a.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":""}: ${N(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 HS(){return{localeError:gz()}}var gz,YS=_(()=>{me();gz=()=>{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 o={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"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \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 ${K(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${N(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${a}${n.minimum.toString()} ${i.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${a}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[a.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"}: ${N(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 VS(){return{localeError:yz()}}var yz,KS=_(()=>{me();yz=()=>{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 o={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"},r={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${c}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${K(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${n.maximum.toString()} ${i.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${n.minimum.toString()} ${i.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[a.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":""}: ${N(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 ZS(){return{localeError:bz()}}var bz,JS=_(()=>{me();bz=()=>{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 o={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"},r={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${c}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${K(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${a}${n.maximum.toString()} ${i.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Muito pequeno: esperado que ${n.origin} tivesse ${a}${n.minimum.toString()} ${i.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${o[a.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":""}: ${N(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 XS(){return{localeError:wz()}}var wz,QS=_(()=>{me();wz=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return`Intrare invalid\u0103: a\u0219teptat ${a}, primit ${c}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${K(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${i.verb} ${a}${n.maximum.toString()} ${i.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Prea mic: a\u0219teptat ca ${n.origin} ${i.verb} ${a}${n.minimum.toString()} ${i.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${a.prefix}"`:a.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${a.suffix}"`:a.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${a.includes}"`:a.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${a.pattern}`:`Format invalid: ${o[a.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: ${N(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 e0(e,t,o,r){let n=Math.abs(e),a=n%10,i=n%100;return i>=11&&i<=19?r:a===1?t:a>=2&&a<=4?o:r}function t0(){return{localeError:vz()}}var vz,n0=_(()=>{me();vz=()=>{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 o={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"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);if(i){let c=Number(n.maximum),d=e0(c,i.unit.one,i.unit.few,i.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 ${a}${n.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);if(i){let c=Number(n.minimum),d=e0(c,i.unit.one,i.unit.few,i.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 ${a}${n.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[a.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":""}: ${N(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 o0(){return{localeError:kz()}}var kz,r0=_(()=>{me();kz=()=>{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 o={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"},r={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${c}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${K(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${a}${n.maximum.toString()} ${i.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${a}${n.minimum.toString()} ${i.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${o[a.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"}: ${N(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 a0(){return{localeError:_z()}}var _z,i0=_(()=>{me();_z=()=>{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 o={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"},r={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${c}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${K(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${a}${n.maximum.toString()} ${i.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${a}${n.minimum.toString()} ${i.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${o[a.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"}: ${N(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 s0(){return{localeError:xz()}}var xz,c0=_(()=>{me();xz=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}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 ${K(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 ${N(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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"} ${a}${n.maximum.toString()} ${i.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"} ${a}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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} ${a}${n.minimum.toString()} ${i.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} ${a}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.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 ${o[a.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":""}: ${N(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 l0(){return{localeError:Sz()}}var Sz,d0=_(()=>{me();Sz=()=>{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 o={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"},r={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 a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",i=t(n.origin);return i?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${n.maximum.toString()} ${i.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${a} ${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",i=t(n.origin);return i?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${n.minimum.toString()} ${i.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.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 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[a.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: ${N(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 u0(){return{localeError:Tz()}}var Tz,m0=_(()=>{me();Tz=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${c}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${K(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${a}${n.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${a}${n.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${o[a.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":""}: ${N(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 el(){return{localeError:Ez()}}var Ez,yf=_(()=>{me();Ez=()=>{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 o={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"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\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 ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}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 ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\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"} ${i.verb} ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\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} ${i.verb} ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.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 "${a.suffix}"`:a.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 "${a.includes}"`:a.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 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[a.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":""}: ${N(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 p0(){return el()}var h0=_(()=>{yf()});function f0(){return{localeError:$z()}}var $z,g0=_(()=>{me();$z=()=>{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 o={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"},r={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${K(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${N(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${n.maximum.toString()} ${i.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 ${a}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${a}${n.minimum.toString()} ${i.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 ${a}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[a.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":""}: ${N(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 y0(){return{localeError:Az()}}var Az,b0=_(()=>{me();Az=()=>{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 o={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"},r={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${c}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${K(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Juda katta: kutilgan ${n.origin??"qiymat"} ${a}${n.maximum.toString()} ${i.unit} ${i.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Juda kichik: kutilgan ${n.origin} ${a}${n.minimum.toString()} ${i.unit} ${i.verb}`:`Juda kichik: kutilgan ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${o[a.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":""}: ${N(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 w0(){return{localeError:Cz()}}var Cz,v0=_(()=>{me();Cz=()=>{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 o={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"},r={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${K(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 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i.verb} ${a}${n.maximum.toString()} ${i.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i.verb} ${a}${n.minimum.toString()} ${i.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${o[a.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: ${N(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 k0(){return{localeError:Iz()}}var Iz,_0=_(()=>{me();Iz=()=>{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 o={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"},r={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${K(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${a}${n.maximum.toString()} ${i.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${a}${n.minimum.toString()} ${i.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${o[a.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): ${N(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 x0(){return{localeError:Oz()}}var Oz,S0=_(()=>{me();Oz=()=>{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 o={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${K(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${a}${n.maximum.toString()} ${i.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${a}${n.maximum.toString()}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${a}${n.minimum.toString()} ${i.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${a}${n.minimum.toString()}`}case"invalid_format":{let a=n;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${o[a.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${N(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 T0(){return{localeError:Pz()}}var Pz,E0=_(()=>{me();Pz=()=>{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 o={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"},r={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let a=r[n.expected]??n.expected,i=J(n.input),c=r[i]??i;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 ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${K(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${N(n.values,"|")}`;case"too_big":{let a=n.inclusive?"<=":"<",i=t(n.origin);return i?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${i.verb} ${a}${n.maximum} ${i.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${n.maximum}`}case"too_small":{let a=n.inclusive?">=":">",i=t(n.origin);return i?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${i.verb} ${a}${n.minimum} ${i.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${n.minimum}`}case"invalid_format":{let a=n;return a.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 "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${o[a.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: ${N(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 Ei={};_n(Ei,{ar:()=>Rx,az:()=>Lx,be:()=>Dx,bg:()=>Fx,ca:()=>Gx,cs:()=>qx,da:()=>Hx,de:()=>Vx,el:()=>Zx,en:()=>Xc,eo:()=>Xx,es:()=>eS,fa:()=>nS,fi:()=>rS,fr:()=>iS,frCA:()=>cS,he:()=>dS,hr:()=>mS,hu:()=>hS,hy:()=>yS,id:()=>wS,is:()=>kS,it:()=>xS,ja:()=>TS,ka:()=>$S,kh:()=>CS,km:()=>Qc,ko:()=>OS,lt:()=>NS,mk:()=>zS,ms:()=>DS,nl:()=>FS,no:()=>GS,ota:()=>qS,pl:()=>VS,ps:()=>HS,pt:()=>ZS,ro:()=>XS,ru:()=>t0,sl:()=>o0,sv:()=>a0,ta:()=>s0,th:()=>l0,tr:()=>u0,ua:()=>p0,uk:()=>el,ur:()=>f0,uz:()=>y0,vi:()=>w0,yo:()=>T0,zhCN:()=>k0,zhTW:()=>x0});var bf=_(()=>{Nx();zx();Mx();Ux();Bx();Wx();Yx();Kx();Jx();ff();Qx();tS();oS();aS();sS();lS();uS();pS();fS();bS();vS();_S();SS();ES();AS();IS();gf();PS();LS();jS();MS();US();BS();WS();YS();KS();JS();QS();n0();r0();i0();c0();d0();m0();h0();yf();g0();b0();v0();_0();S0();E0()});function nl(){return new tl}var $0,wf,vf,tl,pt,$i=_(()=>{wf=Symbol("ZodOutput"),vf=Symbol("ZodInput"),tl=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){let r=o[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let r={...this.get(o)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};($0=globalThis).__zod_globalRegistry??($0.__zod_globalRegistry=nl());pt=globalThis.__zod_globalRegistry});function kf(e,t){return new e({type:"string",...ne(t)})}function _f(e,t){return new e({type:"string",coerce:!0,...ne(t)})}function ol(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function Ai(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function rl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function al(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function il(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function sl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function Ci(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function cl(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function ll(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function dl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function ul(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function ml(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function pl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function hl(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function fl(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function gl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function xf(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ne(t)})}function yl(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function bl(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function wl(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function vl(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function kl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function _l(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function Tf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function Ef(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function $f(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function Af(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function Cf(e,t){return new e({type:"number",checks:[],...ne(t)})}function If(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}function Of(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function Pf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ne(t)})}function Rf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ne(t)})}function Nf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ne(t)})}function Lf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ne(t)})}function zf(e,t){return new e({type:"boolean",...ne(t)})}function jf(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}function Df(e,t){return new e({type:"bigint",...ne(t)})}function Mf(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}function Ff(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ne(t)})}function Uf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ne(t)})}function Gf(e,t){return new e({type:"symbol",...ne(t)})}function Bf(e,t){return new e({type:"undefined",...ne(t)})}function qf(e,t){return new e({type:"null",...ne(t)})}function Wf(e){return new e({type:"any"})}function Hf(e){return new e({type:"unknown"})}function Yf(e,t){return new e({type:"never",...ne(t)})}function Vf(e,t){return new e({type:"void",...ne(t)})}function Kf(e,t){return new e({type:"date",...ne(t)})}function Zf(e,t){return new e({type:"date",coerce:!0,...ne(t)})}function Jf(e,t){return new e({type:"nan",...ne(t)})}function xn(e,t){return new Fc({check:"less_than",...ne(t),value:e,inclusive:!1})}function Mt(e,t){return new Fc({check:"less_than",...ne(t),value:e,inclusive:!0})}function Sn(e,t){return new Uc({check:"greater_than",...ne(t),value:e,inclusive:!1})}function Et(e,t){return new Uc({check:"greater_than",...ne(t),value:e,inclusive:!0})}function xl(e){return Sn(0,e)}function Sl(e){return xn(0,e)}function Tl(e){return Mt(0,e)}function El(e){return Et(0,e)}function go(e,t){return new zp({check:"multiple_of",...ne(t),value:e})}function yo(e,t){return new Mp({check:"max_size",...ne(t),maximum:e})}function Tn(e,t){return new Fp({check:"min_size",...ne(t),minimum:e})}function er(e,t){return new Up({check:"size_equals",...ne(t),size:e})}function tr(e,t){return new Gp({check:"max_length",...ne(t),maximum:e})}function qn(e,t){return new Bp({check:"min_length",...ne(t),minimum:e})}function nr(e,t){return new qp({check:"length_equals",...ne(t),length:e})}function qr(e,t){return new Wp({check:"string_format",format:"regex",...ne(t),pattern:e})}function Wr(e){return new Hp({check:"string_format",format:"lowercase",...ne(e)})}function Hr(e){return new Yp({check:"string_format",format:"uppercase",...ne(e)})}function Yr(e,t){return new Vp({check:"string_format",format:"includes",...ne(t),includes:e})}function Vr(e,t){return new Kp({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function Kr(e,t){return new Zp({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function $l(e,t,o){return new Jp({check:"property",property:e,schema:t,...ne(o)})}function Zr(e,t){return new Xp({check:"mime_type",mime:e,...ne(t)})}function rn(e){return new Qp({check:"overwrite",tx:e})}function Jr(e){return rn(t=>t.normalize(e))}function Xr(){return rn(e=>e.trim())}function Qr(){return rn(e=>e.toLowerCase())}function ea(){return rn(e=>e.toUpperCase())}function ta(){return rn(e=>Ym(e))}function Xf(e,t,o){return new e({type:"array",element:t,...ne(o)})}function Nz(e,t,o){return new e({type:"union",options:t,...ne(o)})}function Lz(e,t,o){return new e({type:"union",options:t,inclusive:!1,...ne(o)})}function zz(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...ne(r)})}function jz(e,t,o){return new e({type:"intersection",left:t,right:o})}function Dz(e,t,o,r){let n=o instanceof Ee,a=n?r:o,i=n?o:null;return new e({type:"tuple",items:t,rest:i,...ne(a)})}function Mz(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...ne(r)})}function Fz(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...ne(r)})}function Uz(e,t,o){return new e({type:"set",valueType:t,...ne(o)})}function Gz(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...ne(o)})}function Bz(e,t,o){return new e({type:"enum",entries:t,...ne(o)})}function qz(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ne(o)})}function Qf(e,t){return new e({type:"file",...ne(t)})}function Wz(e,t){return new e({type:"transform",transform:t})}function Hz(e,t){return new e({type:"optional",innerType:t})}function Yz(e,t){return new e({type:"nullable",innerType:t})}function Vz(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():Km(o)}})}function Kz(e,t,o){return new e({type:"nonoptional",innerType:t,...ne(o)})}function Zz(e,t){return new e({type:"success",innerType:t})}function Jz(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function Xz(e,t,o){return new e({type:"pipe",in:t,out:o})}function Qz(e,t){return new e({type:"readonly",innerType:t})}function ej(e,t,o){return new e({type:"template_literal",parts:t,...ne(o)})}function tj(e,t){return new e({type:"lazy",getter:t})}function nj(e,t){return new e({type:"promise",innerType:t})}function eg(e,t,o){let r=ne(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function tg(e,t,o){return new e({type:"custom",check:"custom",fn:t,...ne(o)})}function ng(e,t){let o=A0(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(jr(n,r.value,o._zod.def));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=o),a.continue??(a.continue=!o._zod.def.abort),r.issues.push(jr(a))}},e(r.value,r)),t);return o}function A0(e,t){let o=new Ze({check:"custom",...ne(t)});return o._zod.check=e,o}function og(e){let t=new Ze({check:"describe"});return t._zod.onattach=[o=>{let r=pt.get(o)??{};pt.add(o,{...r,description:e})}],t._zod.check=()=>{},t}function rg(e){let t=new Ze({check:"meta"});return t._zod.onattach=[o=>{let r=pt.get(o)??{};pt.add(o,{...r,...e})}],t._zod.check=()=>{},t}function ag(e,t){let o=ne(t),r=o.truthy??["true","1","yes","on","y","enabled"],n=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(r=r.map(g=>typeof g=="string"?g.toLowerCase():g),n=n.map(g=>typeof g=="string"?g.toLowerCase():g));let a=new Set(r),i=new Set(n),c=e.Codec??Si,d=e.Boolean??_i,l=e.String??Qo,u=new l({type:"string",error:o.error}),p=new d({type:"boolean",error:o.error}),f=new c({type:"pipe",in:u,out:p,transform:((g,b)=>{let v=g;return o.case!=="sensitive"&&(v=v.toLowerCase()),a.has(v)?!0:i.has(v)?!1:(b.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...i],input:b.value,inst:f,continue:!1}),{})}),reverseTransform:((g,b)=>g===!0?r[0]||"true":n[0]||"false"),error:o.error});return f}function na(e,t,o,r={}){let n=ne(r),a={...ne(r),check:"string_format",type:"string",format:t,fn:typeof o=="function"?o:c=>o.test(c),...n};return o instanceof RegExp&&(a.pattern=o),new e(a)}var Sf,C0=_(()=>{Gc();$i();hf();me();Sf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function bo(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??pt,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 Be(e,t,o={path:[],schemaPath:[]}){var r;let n=e._zod.def,a=t.seen.get(e);if(a)return a.count++,o.schemaPath.includes(e)&&(a.cycle=o.path),a.schema;let i={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,i);let c=e._zod.toJSONSchema?.();if(c)i.schema=c;else{let u={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{let f=i.schema,g=t.processors[n.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);g(e,t,f,u)}let p=e._zod.parent;p&&(i.ref||(i.ref=p),Be(p,t,u),t.seen.get(p).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(i.schema,d),t.io==="input"&&$t(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function wo(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let i of e.seen.entries()){let c=e.metadataRegistry.get(i[0])?.id;if(c){let d=r.get(c);if(d&&d!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,i[0])}}let n=i=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(i[0])?.id,f=e.external.uri??(b=>b);if(p)return{ref:f(p)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${f("__shared")}#/${c}/${g}`}}if(i[1]===o)return{ref:"#"};let l=`#/${c}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},a=i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:d,defId:l}=n(i);c.def={...c.schema},l&&(c.defId=l);let u=c.schema;for(let p in u)delete u[p];u.$ref=d};if(e.cycles==="throw")for(let i of e.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
76
76
 
77
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){a(i);continue}if(e.external){let l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(c.cycle){a(i);continue}if(c.count>1&&e.reused==="ref"){a(i);continue}}}function vo(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=c=>{let d=e.seen.get(c);if(d.ref===null)return;let l=d.def??d.schema,u={...l},p=d.ref;if(d.ref=null,p){r(p);let g=e.seen.get(p),b=g.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(b)):Object.assign(l,b),Object.assign(l,u),c._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in u||delete l[x];if(b.$ref&&g.def)for(let x in l)x==="$ref"||x==="allOf"||x in g.def&&JSON.stringify(l[x])===JSON.stringify(g.def[x])&&delete l[x]}let f=c._zod.parent;if(f&&f!==p){r(f);let g=e.seen.get(f);if(g?.schema.$ref&&(l.$ref=g.schema.$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]}e.override({zodSchema:c,jsonSchema:l,path:d.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[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 c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&n.id===a&&delete n.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let d=c[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,i[d.defId]=d.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:oa(t,"input",e.processors),output:oa(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function $t(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $t(r.element,o);if(r.type==="set")return $t(r.valueType,o);if(r.type==="lazy")return $t(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $t(r.innerType,o);if(r.type==="intersection")return $t(r.left,o)||$t(r.right,o);if(r.type==="record"||r.type==="map")return $t(r.keyType,o)||$t(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:$t(r.in,o)||$t(r.out,o);if(r.type==="object"){for(let n in r.shape)if($t(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if($t(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if($t(n,o))return!0;return!!(r.rest&&$t(r.rest,o))}return!1}var ig,oa,Ii=_(()=>{$i();ig=(e,t={})=>o=>{let r=bo({...o,processors:t});return Be(e,r),wo(r,e),vo(r,e)},oa=(e,t,o={})=>r=>{let{libraryOptions:n,target:a}=r??{},i=bo({...n??{},target:a,io:t,processors:o});return Be(e,i),wo(i,e),vo(i,e)}});function Ol(e,t){if("_idmap"in e){let r=e,n=bo({...t,processors:Al}),a={};for(let d of r._idmap.entries()){let[l,u]=d;Be(u,n)}let i={},c={registry:r,uri:t?.uri,defs:a};n.external=c;for(let d of r._idmap.entries()){let[l,u]=d;wo(n,u),i[l]=vo(n,u)}if(Object.keys(a).length>0){let d=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[d]:a}}return{schemas:i}}let o=bo({...t,processors:Al});return Be(e,o),wo(o,e),vo(o,e)}var oj,sg,cg,lg,dg,ug,mg,pg,hg,fg,gg,yg,bg,wg,vg,kg,_g,xg,Sg,Tg,Eg,$g,Ag,Cg,Ig,Og,Cl,Pg,Rg,Ng,Lg,zg,jg,Dg,Mg,Fg,Ug,Gg,Il,Bg,Al,Oi=_(()=>{Ii();me();oj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sg=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:a,maximum:i,format:c,patterns:d,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(n.minLength=a),typeof i=="number"&&(n.maxLength=i),c&&(n.format=oj[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),l&&(n.contentEncoding=l),d&&d.size>0){let u=[...d];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},cg=(e,t,o,r)=>{let n=o,{minimum:a,maximum:i,format:c,multipleOf:d,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let p=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";p?g?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof a=="number"&&(n.minimum=a),f?g?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof i=="number"&&(n.maximum=i),typeof d=="number"&&(n.multipleOf=d)},lg=(e,t,o,r)=>{o.type="boolean"},dg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ug=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mg=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},pg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fg=(e,t,o,r)=>{o.not={}},gg=(e,t,o,r)=>{},yg=(e,t,o,r)=>{},bg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wg=(e,t,o,r)=>{let n=e._zod.def,a=ui(n.entries);a.every(i=>typeof i=="number")&&(o.type="number"),a.every(i=>typeof i=="string")&&(o.type="string"),o.enum=a},vg=(e,t,o,r)=>{let n=e._zod.def,a=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){let i=a[0];o.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[i]:o.const=i}else a.every(i=>typeof i=="number")&&(o.type="number"),a.every(i=>typeof i=="string")&&(o.type="string"),a.every(i=>typeof i=="boolean")&&(o.type="boolean"),a.every(i=>i===null)&&(o.type="null"),o.enum=a},kg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},_g=(e,t,o,r)=>{let n=o,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source},xg=(e,t,o,r)=>{let n=o,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:d}=e._zod.bag;i!==void 0&&(a.minLength=i),c!==void 0&&(a.maxLength=c),d?d.length===1?(a.contentMediaType=d[0],Object.assign(n,a)):(Object.assign(n,a),n.anyOf=d.map(l=>({contentMediaType:l}))):Object.assign(n,a)},Sg=(e,t,o,r)=>{o.type="boolean"},Tg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Eg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$g=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ag=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Cg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ig=(e,t,o,r)=>{let n=o,a=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=Be(a.element,t,{...r,path:[...r.path,"items"]})},Og=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="object",n.properties={};let i=a.shape;for(let l in i)n.properties[l]=Be(i[l],t,{...r,path:[...r.path,"properties",l]});let c=new Set(Object.keys(i)),d=new Set([...c].filter(l=>{let u=a.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));d.size>0&&(n.required=Array.from(d)),a.catchall?._zod.def.type==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=Be(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Cl=(e,t,o,r)=>{let n=e._zod.def,a=n.inclusive===!1,i=n.options.map((c,d)=>Be(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?o.oneOf=i:o.anyOf=i},Pg=(e,t,o,r)=>{let n=e._zod.def,a=Be(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=Be(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,d=[...c(a)?a.allOf:[a],...c(i)?i.allOf:[i]];o.allOf=d},Rg=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=a.items.map((f,g)=>Be(f,t,{...r,path:[...r.path,i,g]})),l=a.rest?Be(a.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=d,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:d},l&&n.items.anyOf.push(l),n.minItems=d.length,l||(n.maxItems=d.length)):(n.items=d,l&&(n.additionalItems=l));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof p=="number"&&(n.maxItems=p)},Ng=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="object";let i=a.keyType,d=i._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){let u=Be(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let p of d)n.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Be(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=Be(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let l=i._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(n.required=u)}},Lg=(e,t,o,r)=>{let n=e._zod.def,a=Be(n.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,o.nullable=!0):o.anyOf=[a,{type:"null"}]},zg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},jg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},Dg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Mg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=i},Fg=(e,t,o,r)=>{let n=e._zod.def,a=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?n.out:n.in:n.out;Be(i,t,r);let c=t.seen.get(e);c.ref=i},Ug=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,o.readOnly=!0},Gg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},Il=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},Bg=(e,t,o,r)=>{let n=e._zod.innerType;Be(n,t,r);let a=t.seen.get(e);a.ref=n},Al={string:sg,number:cg,boolean:lg,bigint:dg,symbol:ug,null:mg,undefined:pg,void:hg,never:fg,any:gg,unknown:yg,date:bg,enum:wg,literal:vg,nan:kg,template_literal:_g,file:xg,success:Sg,custom:Tg,function:Eg,transform:$g,map:Ag,set:Cg,array:Ig,object:Og,union:Cl,intersection:Pg,tuple:Rg,record:Ng,nullable:Lg,nonoptional:zg,default:jg,prefault:Dg,catch:Mg,pipe:Fg,readonly:Ug,promise:Gg,optional:Il,lazy:Bg}});var Pl,I0=_(()=>{Oi();Ii();Pl=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 o=t?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=bo({processors:Al,target:o,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,o={path:[],schemaPath:[]}){return Be(t,this.ctx,o)}emit(t,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),wo(this.ctx,t);let r=vo(this.ctx,t),{"~standard":n,...a}=r;return a}}});var O0={};var P0=_(()=>{});var Wn={};_n(Wn,{$ZodAny:()=>Lh,$ZodArray:()=>Fh,$ZodAsyncError:()=>on,$ZodBase64:()=>Th,$ZodBase64URL:()=>Eh,$ZodBigInt:()=>Vc,$ZodBigIntFormat:()=>Oh,$ZodBoolean:()=>_i,$ZodCIDRv4:()=>_h,$ZodCIDRv6:()=>xh,$ZodCUID:()=>dh,$ZodCUID2:()=>uh,$ZodCatch:()=>rf,$ZodCheck:()=>Ze,$ZodCheckBigIntFormat:()=>Dp,$ZodCheckEndsWith:()=>Zp,$ZodCheckGreaterThan:()=>Uc,$ZodCheckIncludes:()=>Vp,$ZodCheckLengthEquals:()=>qp,$ZodCheckLessThan:()=>Fc,$ZodCheckLowerCase:()=>Hp,$ZodCheckMaxLength:()=>Gp,$ZodCheckMaxSize:()=>Mp,$ZodCheckMimeType:()=>Xp,$ZodCheckMinLength:()=>Bp,$ZodCheckMinSize:()=>Fp,$ZodCheckMultipleOf:()=>zp,$ZodCheckNumberFormat:()=>jp,$ZodCheckOverwrite:()=>Qp,$ZodCheckProperty:()=>Jp,$ZodCheckRegex:()=>Wp,$ZodCheckSizeEquals:()=>Up,$ZodCheckStartsWith:()=>Kp,$ZodCheckStringFormat:()=>Gr,$ZodCheckUpperCase:()=>Yp,$ZodCodec:()=>Si,$ZodCustom:()=>pf,$ZodCustomStringFormat:()=>Ch,$ZodDate:()=>Mh,$ZodDefault:()=>ef,$ZodDiscriminatedUnion:()=>Bh,$ZodE164:()=>$h,$ZodEmail:()=>ih,$ZodEmoji:()=>ch,$ZodEncodeError:()=>uo,$ZodEnum:()=>Vh,$ZodError:()=>gi,$ZodExactOptional:()=>Xh,$ZodFile:()=>Zh,$ZodFunction:()=>df,$ZodGUID:()=>rh,$ZodIPv4:()=>wh,$ZodIPv6:()=>vh,$ZodISODate:()=>gh,$ZodISODateTime:()=>fh,$ZodISODuration:()=>bh,$ZodISOTime:()=>yh,$ZodIntersection:()=>qh,$ZodJWT:()=>Ah,$ZodKSUID:()=>hh,$ZodLazy:()=>mf,$ZodLiteral:()=>Kh,$ZodMAC:()=>kh,$ZodMap:()=>Hh,$ZodNaN:()=>af,$ZodNanoID:()=>lh,$ZodNever:()=>jh,$ZodNonOptional:()=>nf,$ZodNull:()=>Nh,$ZodNullable:()=>Qh,$ZodNumber:()=>Yc,$ZodNumberFormat:()=>Ih,$ZodObject:()=>Px,$ZodObjectJIT:()=>Uh,$ZodOptional:()=>Zc,$ZodPipe:()=>Jc,$ZodPrefault:()=>tf,$ZodPreprocess:()=>sf,$ZodPromise:()=>uf,$ZodReadonly:()=>cf,$ZodRealError:()=>Pt,$ZodRecord:()=>Wh,$ZodRegistry:()=>tl,$ZodSet:()=>Yh,$ZodString:()=>Qo,$ZodStringFormat:()=>He,$ZodSuccess:()=>of,$ZodSymbol:()=>Ph,$ZodTemplateLiteral:()=>lf,$ZodTransform:()=>Jh,$ZodTuple:()=>Kc,$ZodType:()=>Ee,$ZodULID:()=>mh,$ZodURL:()=>sh,$ZodUUID:()=>ah,$ZodUndefined:()=>Rh,$ZodUnion:()=>xi,$ZodUnknown:()=>zh,$ZodVoid:()=>Dh,$ZodXID:()=>ph,$ZodXor:()=>Gh,$brand:()=>Bm,$constructor:()=>E,$input:()=>vf,$output:()=>wf,Doc:()=>ki,JSONSchema:()=>O0,JSONSchemaGenerator:()=>Pl,NEVER:()=>Gm,TimePrecision:()=>Sf,_any:()=>Wf,_array:()=>Xf,_base64:()=>wl,_base64url:()=>vl,_bigint:()=>Df,_boolean:()=>zf,_catch:()=>Jz,_check:()=>A0,_cidrv4:()=>yl,_cidrv6:()=>bl,_coercedBigint:()=>Mf,_coercedBoolean:()=>jf,_coercedDate:()=>Zf,_coercedNumber:()=>If,_coercedString:()=>_f,_cuid:()=>dl,_cuid2:()=>ul,_custom:()=>eg,_date:()=>Kf,_decode:()=>Ic,_decodeAsync:()=>Pc,_default:()=>Vz,_discriminatedUnion:()=>zz,_e164:()=>kl,_email:()=>ol,_emoji:()=>cl,_encode:()=>Cc,_encodeAsync:()=>Oc,_endsWith:()=>Kr,_enum:()=>Gz,_file:()=>Qf,_float32:()=>Pf,_float64:()=>Rf,_gt:()=>Sn,_gte:()=>Et,_guid:()=>Ai,_includes:()=>Yr,_int:()=>Of,_int32:()=>Nf,_int64:()=>Ff,_intersection:()=>jz,_ipv4:()=>fl,_ipv6:()=>gl,_isoDate:()=>Ef,_isoDateTime:()=>Tf,_isoDuration:()=>Af,_isoTime:()=>$f,_jwt:()=>_l,_ksuid:()=>hl,_lazy:()=>tj,_length:()=>nr,_literal:()=>qz,_lowercase:()=>Wr,_lt:()=>xn,_lte:()=>Mt,_mac:()=>xf,_map:()=>Fz,_max:()=>Mt,_maxLength:()=>tr,_maxSize:()=>yo,_mime:()=>Zr,_min:()=>Et,_minLength:()=>qn,_minSize:()=>Tn,_multipleOf:()=>go,_nan:()=>Jf,_nanoid:()=>ll,_nativeEnum:()=>Bz,_negative:()=>Sl,_never:()=>Yf,_nonnegative:()=>El,_nonoptional:()=>Kz,_nonpositive:()=>Tl,_normalize:()=>Jr,_null:()=>qf,_nullable:()=>Yz,_number:()=>Cf,_optional:()=>Hz,_overwrite:()=>rn,_parse:()=>Dr,_parseAsync:()=>Mr,_pipe:()=>Xz,_positive:()=>xl,_promise:()=>nj,_property:()=>$l,_readonly:()=>Qz,_record:()=>Mz,_refine:()=>tg,_regex:()=>qr,_safeDecode:()=>Nc,_safeDecodeAsync:()=>zc,_safeEncode:()=>Rc,_safeEncodeAsync:()=>Lc,_safeParse:()=>Fr,_safeParseAsync:()=>Ur,_set:()=>Uz,_size:()=>er,_slugify:()=>ta,_startsWith:()=>Vr,_string:()=>kf,_stringFormat:()=>na,_stringbool:()=>ag,_success:()=>Zz,_superRefine:()=>ng,_symbol:()=>Gf,_templateLiteral:()=>ej,_toLowerCase:()=>Qr,_toUpperCase:()=>ea,_transform:()=>Wz,_trim:()=>Xr,_tuple:()=>Dz,_uint32:()=>Lf,_uint64:()=>Uf,_ulid:()=>ml,_undefined:()=>Bf,_union:()=>Nz,_unknown:()=>Hf,_uppercase:()=>Hr,_url:()=>Ci,_uuid:()=>rl,_uuidv4:()=>al,_uuidv6:()=>il,_uuidv7:()=>sl,_void:()=>Vf,_xid:()=>pl,_xor:()=>Lz,clone:()=>St,config:()=>it,createStandardJSONSchemaMethod:()=>oa,createToJSONSchemaMethod:()=>ig,decode:()=>nL,decodeAsync:()=>rL,describe:()=>og,encode:()=>tL,encodeAsync:()=>oL,extractDefs:()=>wo,finalize:()=>vo,flattenError:()=>yi,formatError:()=>bi,globalConfig:()=>Ko,globalRegistry:()=>pt,initializeContext:()=>bo,isValidBase64:()=>Sh,isValidBase64URL:()=>Ax,isValidJWT:()=>Cx,locales:()=>Ei,meta:()=>rg,parse:()=>$c,parseAsync:()=>Ac,prettifyError:()=>np,process:()=>Be,regexes:()=>Dt,registry:()=>nl,safeDecode:()=>iL,safeDecodeAsync:()=>cL,safeEncode:()=>aL,safeEncodeAsync:()=>sL,safeParse:()=>rp,safeParseAsync:()=>ap,toDotPath:()=>sx,toJSONSchema:()=>Ol,treeifyError:()=>tp,util:()=>Q,version:()=>th});var Ft=_(()=>{Zo();ip();op();hf();Gc();nh();me();Mc();bf();$i();eh();C0();Ii();Oi();I0();P0()});var Rl={};_n(Rl,{endsWith:()=>Kr,gt:()=>Sn,gte:()=>Et,includes:()=>Yr,length:()=>nr,lowercase:()=>Wr,lt:()=>xn,lte:()=>Mt,maxLength:()=>tr,maxSize:()=>yo,mime:()=>Zr,minLength:()=>qn,minSize:()=>Tn,multipleOf:()=>go,negative:()=>Sl,nonnegative:()=>El,nonpositive:()=>Tl,normalize:()=>Jr,overwrite:()=>rn,positive:()=>xl,property:()=>$l,regex:()=>qr,size:()=>er,slugify:()=>ta,startsWith:()=>Vr,toLowerCase:()=>Qr,toUpperCase:()=>ea,trim:()=>Xr,uppercase:()=>Hr});var Nl=_(()=>{Ft()});var ra={};_n(ra,{ZodISODate:()=>zl,ZodISODateTime:()=>Ll,ZodISODuration:()=>Dl,ZodISOTime:()=>jl,date:()=>Wg,datetime:()=>qg,duration:()=>Yg,time:()=>Hg});function qg(e){return Tf(Ll,e)}function Wg(e){return Ef(zl,e)}function Hg(e){return $f(jl,e)}function Yg(e){return Af(Dl,e)}var Ll,zl,jl,Dl,Pi=_(()=>{Ft();Ni();Ll=E("ZodISODateTime",(e,t)=>{fh.init(e,t),Ye.init(e,t)});zl=E("ZodISODate",(e,t)=>{gh.init(e,t),Ye.init(e,t)});jl=E("ZodISOTime",(e,t)=>{yh.init(e,t),Ye.init(e,t)});Dl=E("ZodISODuration",(e,t)=>{bh.init(e,t),Ye.init(e,t)})});var R0,aj,Rt,Vg=_(()=>{Ft();Ft();me();R0=(e,t)=>{gi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>bi(e,o)},flatten:{value:o=>yi(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Lr,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Lr,2)}},isEmpty:{get(){return e.issues.length===0}}})},aj=E("ZodError",R0),Rt=E("ZodError",R0,{Parent:Error})});var Kg,Zg,Jg,Xg,Qg,ey,ty,ny,oy,ry,ay,iy,sy=_(()=>{Ft();Vg();Kg=Dr(Rt),Zg=Mr(Rt),Jg=Fr(Rt),Xg=Ur(Rt),Qg=Cc(Rt),ey=Ic(Rt),ty=Oc(Rt),ny=Pc(Rt),oy=Rc(Rt),ry=Nc(Rt),ay=Lc(Rt),iy=zc(Rt)});var Ri={};_n(Ri,{ZodAny:()=>fy,ZodArray:()=>wy,ZodBase64:()=>ed,ZodBase64URL:()=>td,ZodBigInt:()=>ua,ZodBigIntFormat:()=>rd,ZodBoolean:()=>da,ZodCIDRv4:()=>Xl,ZodCIDRv6:()=>Ql,ZodCUID:()=>Wl,ZodCUID2:()=>Hl,ZodCatch:()=>Uy,ZodCodec:()=>Hi,ZodCustom:()=>Yi,ZodCustomStringFormat:()=>ca,ZodDate:()=>Ui,ZodDefault:()=>Ly,ZodDiscriminatedUnion:()=>ky,ZodE164:()=>nd,ZodEmail:()=>Gl,ZodEmoji:()=>Bl,ZodEnum:()=>ia,ZodExactOptional:()=>Py,ZodFile:()=>Iy,ZodFunction:()=>Jy,ZodGUID:()=>zi,ZodIPv4:()=>Zl,ZodIPv6:()=>Jl,ZodIntersection:()=>_y,ZodJWT:()=>od,ZodKSUID:()=>Kl,ZodLazy:()=>Vy,ZodLiteral:()=>Cy,ZodMAC:()=>cy,ZodMap:()=>$y,ZodNaN:()=>By,ZodNanoID:()=>ql,ZodNever:()=>yy,ZodNonOptional:()=>dd,ZodNull:()=>py,ZodNullable:()=>Ny,ZodNumber:()=>la,ZodNumberFormat:()=>rr,ZodObject:()=>Bi,ZodOptional:()=>ld,ZodPipe:()=>Wi,ZodPrefault:()=>jy,ZodPreprocess:()=>qy,ZodPromise:()=>Zy,ZodReadonly:()=>Wy,ZodRecord:()=>aa,ZodSet:()=>Ay,ZodString:()=>sa,ZodStringFormat:()=>Ye,ZodSuccess:()=>Fy,ZodSymbol:()=>uy,ZodTemplateLiteral:()=>Yy,ZodTransform:()=>Oy,ZodTuple:()=>Sy,ZodType:()=>Ce,ZodULID:()=>Yl,ZodURL:()=>Fi,ZodUUID:()=>En,ZodUndefined:()=>my,ZodUnion:()=>qi,ZodUnknown:()=>gy,ZodVoid:()=>by,ZodXID:()=>Vl,ZodXor:()=>vy,_ZodString:()=>Ul,_default:()=>zy,_function:()=>UT,any:()=>bT,array:()=>Gi,base64:()=>tT,base64url:()=>nT,bigint:()=>pT,boolean:()=>dy,catch:()=>Gy,check:()=>GT,cidrv4:()=>Q0,cidrv6:()=>eT,codec:()=>jT,cuid:()=>W0,cuid2:()=>H0,custom:()=>BT,date:()=>vT,describe:()=>qT,discriminatedUnion:()=>ET,e164:()=>oT,email:()=>L0,emoji:()=>B0,enum:()=>sd,exactOptional:()=>Ry,file:()=>RT,float32:()=>lT,float64:()=>dT,function:()=>UT,guid:()=>z0,hash:()=>cT,hex:()=>sT,hostname:()=>iT,httpUrl:()=>G0,instanceof:()=>HT,int:()=>Ml,int32:()=>uT,int64:()=>hT,intersection:()=>xy,invertCodec:()=>DT,ipv4:()=>Z0,ipv6:()=>X0,json:()=>VT,jwt:()=>rT,keyof:()=>kT,ksuid:()=>K0,lazy:()=>Ky,literal:()=>PT,looseObject:()=>ST,looseRecord:()=>AT,mac:()=>J0,map:()=>CT,meta:()=>WT,nan:()=>zT,nanoid:()=>q0,nativeEnum:()=>OT,never:()=>ad,nonoptional:()=>My,null:()=>hy,nullable:()=>Di,nullish:()=>NT,number:()=>ly,object:()=>_T,optional:()=>ji,partialRecord:()=>$T,pipe:()=>Fl,prefault:()=>Dy,preprocess:()=>KT,promise:()=>FT,readonly:()=>Hy,record:()=>Ey,refine:()=>Xy,set:()=>IT,strictObject:()=>xT,string:()=>Li,stringFormat:()=>aT,stringbool:()=>YT,success:()=>LT,superRefine:()=>Qy,symbol:()=>gT,templateLiteral:()=>MT,transform:()=>cd,tuple:()=>Ty,uint32:()=>mT,uint64:()=>fT,ulid:()=>Y0,undefined:()=>yT,union:()=>id,unknown:()=>or,url:()=>U0,uuid:()=>j0,uuidv4:()=>D0,uuidv6:()=>M0,uuidv7:()=>F0,void:()=>wT,xid:()=>V0,xor:()=>TT});function Mi(e,t,o){let r=Object.getPrototypeOf(e),n=N0.get(r);if(n||(n=new Set,N0.set(r,n)),!n.has(t)){n.add(t);for(let a in o){let i=o[a];Object.defineProperty(r,a,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}function Li(e){return kf(sa,e)}function L0(e){return ol(Gl,e)}function z0(e){return Ai(zi,e)}function j0(e){return rl(En,e)}function D0(e){return al(En,e)}function M0(e){return il(En,e)}function F0(e){return sl(En,e)}function U0(e){return Ci(Fi,e)}function G0(e){return Ci(Fi,{protocol:Dt.httpProtocol,hostname:Dt.domain,...Q.normalizeParams(e)})}function B0(e){return cl(Bl,e)}function q0(e){return ll(ql,e)}function W0(e){return dl(Wl,e)}function H0(e){return ul(Hl,e)}function Y0(e){return ml(Yl,e)}function V0(e){return pl(Vl,e)}function K0(e){return hl(Kl,e)}function Z0(e){return fl(Zl,e)}function J0(e){return xf(cy,e)}function X0(e){return gl(Jl,e)}function Q0(e){return yl(Xl,e)}function eT(e){return bl(Ql,e)}function tT(e){return wl(ed,e)}function nT(e){return vl(td,e)}function oT(e){return kl(nd,e)}function rT(e){return _l(od,e)}function aT(e,t,o={}){return na(ca,e,t,o)}function iT(e){return na(ca,"hostname",Dt.hostname,e)}function sT(e){return na(ca,"hex",Dt.hex,e)}function cT(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Dt[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return na(ca,r,n,t)}function ly(e){return Cf(la,e)}function Ml(e){return Of(rr,e)}function lT(e){return Pf(rr,e)}function dT(e){return Rf(rr,e)}function uT(e){return Nf(rr,e)}function mT(e){return Lf(rr,e)}function dy(e){return zf(da,e)}function pT(e){return Df(ua,e)}function hT(e){return Ff(rd,e)}function fT(e){return Uf(rd,e)}function gT(e){return Gf(uy,e)}function yT(e){return Bf(my,e)}function hy(e){return qf(py,e)}function bT(){return Wf(fy)}function or(){return Hf(gy)}function ad(e){return Yf(yy,e)}function wT(e){return Vf(by,e)}function vT(e){return Kf(Ui,e)}function Gi(e,t){return Xf(wy,e,t)}function kT(e){let t=e._zod.def.shape;return sd(Object.keys(t))}function _T(e,t){let o={type:"object",shape:e??{},...Q.normalizeParams(t)};return new Bi(o)}function xT(e,t){return new Bi({type:"object",shape:e,catchall:ad(),...Q.normalizeParams(t)})}function ST(e,t){return new Bi({type:"object",shape:e,catchall:or(),...Q.normalizeParams(t)})}function id(e,t){return new qi({type:"union",options:e,...Q.normalizeParams(t)})}function TT(e,t){return new vy({type:"union",options:e,inclusive:!1,...Q.normalizeParams(t)})}function ET(e,t,o){return new ky({type:"union",options:t,discriminator:e,...Q.normalizeParams(o)})}function xy(e,t){return new _y({type:"intersection",left:e,right:t})}function Ty(e,t,o){let r=t instanceof Ee,n=r?o:t,a=r?t:null;return new Sy({type:"tuple",items:e,rest:a,...Q.normalizeParams(n)})}function Ey(e,t,o){return!t||!t._zod?new aa({type:"record",keyType:Li(),valueType:e,...Q.normalizeParams(t)}):new aa({type:"record",keyType:e,valueType:t,...Q.normalizeParams(o)})}function $T(e,t,o){let r=St(e);return r._zod.values=void 0,new aa({type:"record",keyType:r,valueType:t,...Q.normalizeParams(o)})}function AT(e,t,o){return new aa({type:"record",keyType:e,valueType:t,mode:"loose",...Q.normalizeParams(o)})}function CT(e,t,o){return new $y({type:"map",keyType:e,valueType:t,...Q.normalizeParams(o)})}function IT(e,t){return new Ay({type:"set",valueType:e,...Q.normalizeParams(t)})}function sd(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ia({type:"enum",entries:o,...Q.normalizeParams(t)})}function OT(e,t){return new ia({type:"enum",entries:e,...Q.normalizeParams(t)})}function PT(e,t){return new Cy({type:"literal",values:Array.isArray(e)?e:[e],...Q.normalizeParams(t)})}function RT(e){return Qf(Iy,e)}function cd(e){return new Oy({type:"transform",transform:e})}function ji(e){return new ld({type:"optional",innerType:e})}function Ry(e){return new Py({type:"optional",innerType:e})}function Di(e){return new Ny({type:"nullable",innerType:e})}function NT(e){return ji(Di(e))}function zy(e,t){return new Ly({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Q.shallowClone(t)}})}function Dy(e,t){return new jy({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Q.shallowClone(t)}})}function My(e,t){return new dd({type:"nonoptional",innerType:e,...Q.normalizeParams(t)})}function LT(e){return new Fy({type:"success",innerType:e})}function Gy(e,t){return new Uy({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function zT(e){return Jf(By,e)}function Fl(e,t){return new Wi({type:"pipe",in:e,out:t})}function jT(e,t,o){return new Hi({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function DT(e){let t=e._zod.def;return new Hi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Hy(e){return new Wy({type:"readonly",innerType:e})}function MT(e,t){return new Yy({type:"template_literal",parts:e,...Q.normalizeParams(t)})}function Ky(e){return new Vy({type:"lazy",getter:e})}function FT(e){return new Zy({type:"promise",innerType:e})}function UT(e){return new Jy({type:"function",input:Array.isArray(e?.input)?Ty(e?.input):e?.input??Gi(or()),output:e?.output??or()})}function GT(e){let t=new Ze({check:"custom"});return t._zod.check=e,t}function BT(e,t){return eg(Yi,e??(()=>!0),t)}function Xy(e,t={}){return tg(Yi,e,t)}function Qy(e,t){return ng(e,t)}function HT(e,t={}){let o=new Yi({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Q.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:o,path:[...o._zod.def.path??[]]})},o}function VT(e){let t=Ky(()=>id([Li(e),ly(),dy(),hy(),Gi(t),Ey(Li(),t)]));return t}function KT(e,t){return new qy({type:"pipe",in:cd(e),out:t})}var N0,Ce,Ul,sa,Ye,Gl,zi,En,Fi,Bl,ql,Wl,Hl,Yl,Vl,Kl,Zl,cy,Jl,Xl,Ql,ed,td,nd,od,ca,la,rr,da,ua,rd,uy,my,py,fy,gy,yy,by,Ui,wy,Bi,qi,vy,ky,_y,Sy,aa,$y,Ay,ia,Cy,Iy,Oy,ld,Py,Ny,Ly,jy,dd,Fy,Uy,By,Wi,Hi,qy,Wy,Yy,Vy,Zy,Jy,Yi,qT,WT,YT,Ni=_(()=>{Ft();Ft();Oi();Ii();Nl();Pi();sy();N0=new WeakMap;Ce=E("ZodType",(e,t)=>(Ee.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oa(e,"input"),output:oa(e,"output")}}),e.toJSONSchema=ig(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Kg(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>Jg(e,o,r),e.parseAsync=async(o,r)=>Zg(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Xg(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Qg(e,o,r),e.decode=(o,r)=>ey(e,o,r),e.encodeAsync=async(o,r)=>ty(e,o,r),e.decodeAsync=async(o,r)=>ny(e,o,r),e.safeEncode=(o,r)=>oy(e,o,r),e.safeDecode=(o,r)=>ry(e,o,r),e.safeEncodeAsync=async(o,r)=>ay(e,o,r),e.safeDecodeAsync=async(o,r)=>iy(e,o,r),Mi(e,"ZodType",{check(...o){let r=this.def;return this.clone(Q.mergeDefs(r,{checks:[...r.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return St(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Xy(o,r))},superRefine(o,r){return this.check(Qy(o,r))},overwrite(o){return this.check(rn(o))},optional(){return ji(this)},exactOptional(){return Ry(this)},nullable(){return Di(this)},nullish(){return ji(Di(this))},nonoptional(o){return My(this,o)},array(){return Gi(this)},or(o){return id([this,o])},and(o){return xy(this,o)},transform(o){return Fl(this,cd(o))},default(o){return zy(this,o)},prefault(o){return Dy(this,o)},catch(o){return Gy(this,o)},pipe(o){return Fl(this,o)},readonly(){return Hy(this)},describe(o){let r=this.clone();return pt.add(r,{description:o}),r},meta(...o){if(o.length===0)return pt.get(this);let r=this.clone();return pt.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return pt.get(e)?.description},configurable:!0}),e)),Ul=E("_ZodString",(e,t)=>{Qo.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>sg(e,r,n,a);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Mi(e,"_ZodString",{regex(...r){return this.check(qr(...r))},includes(...r){return this.check(Yr(...r))},startsWith(...r){return this.check(Vr(...r))},endsWith(...r){return this.check(Kr(...r))},min(...r){return this.check(qn(...r))},max(...r){return this.check(tr(...r))},length(...r){return this.check(nr(...r))},nonempty(...r){return this.check(qn(1,...r))},lowercase(r){return this.check(Wr(r))},uppercase(r){return this.check(Hr(r))},trim(){return this.check(Xr())},normalize(...r){return this.check(Jr(...r))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check(ea())},slugify(){return this.check(ta())}})}),sa=E("ZodString",(e,t)=>{Qo.init(e,t),Ul.init(e,t),e.email=o=>e.check(ol(Gl,o)),e.url=o=>e.check(Ci(Fi,o)),e.jwt=o=>e.check(_l(od,o)),e.emoji=o=>e.check(cl(Bl,o)),e.guid=o=>e.check(Ai(zi,o)),e.uuid=o=>e.check(rl(En,o)),e.uuidv4=o=>e.check(al(En,o)),e.uuidv6=o=>e.check(il(En,o)),e.uuidv7=o=>e.check(sl(En,o)),e.nanoid=o=>e.check(ll(ql,o)),e.guid=o=>e.check(Ai(zi,o)),e.cuid=o=>e.check(dl(Wl,o)),e.cuid2=o=>e.check(ul(Hl,o)),e.ulid=o=>e.check(ml(Yl,o)),e.base64=o=>e.check(wl(ed,o)),e.base64url=o=>e.check(vl(td,o)),e.xid=o=>e.check(pl(Vl,o)),e.ksuid=o=>e.check(hl(Kl,o)),e.ipv4=o=>e.check(fl(Zl,o)),e.ipv6=o=>e.check(gl(Jl,o)),e.cidrv4=o=>e.check(yl(Xl,o)),e.cidrv6=o=>e.check(bl(Ql,o)),e.e164=o=>e.check(kl(nd,o)),e.datetime=o=>e.check(qg(o)),e.date=o=>e.check(Wg(o)),e.time=o=>e.check(Hg(o)),e.duration=o=>e.check(Yg(o))});Ye=E("ZodStringFormat",(e,t)=>{He.init(e,t),Ul.init(e,t)}),Gl=E("ZodEmail",(e,t)=>{ih.init(e,t),Ye.init(e,t)});zi=E("ZodGUID",(e,t)=>{rh.init(e,t),Ye.init(e,t)});En=E("ZodUUID",(e,t)=>{ah.init(e,t),Ye.init(e,t)});Fi=E("ZodURL",(e,t)=>{sh.init(e,t),Ye.init(e,t)});Bl=E("ZodEmoji",(e,t)=>{ch.init(e,t),Ye.init(e,t)});ql=E("ZodNanoID",(e,t)=>{lh.init(e,t),Ye.init(e,t)});Wl=E("ZodCUID",(e,t)=>{dh.init(e,t),Ye.init(e,t)});Hl=E("ZodCUID2",(e,t)=>{uh.init(e,t),Ye.init(e,t)});Yl=E("ZodULID",(e,t)=>{mh.init(e,t),Ye.init(e,t)});Vl=E("ZodXID",(e,t)=>{ph.init(e,t),Ye.init(e,t)});Kl=E("ZodKSUID",(e,t)=>{hh.init(e,t),Ye.init(e,t)});Zl=E("ZodIPv4",(e,t)=>{wh.init(e,t),Ye.init(e,t)});cy=E("ZodMAC",(e,t)=>{kh.init(e,t),Ye.init(e,t)});Jl=E("ZodIPv6",(e,t)=>{vh.init(e,t),Ye.init(e,t)});Xl=E("ZodCIDRv4",(e,t)=>{_h.init(e,t),Ye.init(e,t)});Ql=E("ZodCIDRv6",(e,t)=>{xh.init(e,t),Ye.init(e,t)});ed=E("ZodBase64",(e,t)=>{Th.init(e,t),Ye.init(e,t)});td=E("ZodBase64URL",(e,t)=>{Eh.init(e,t),Ye.init(e,t)});nd=E("ZodE164",(e,t)=>{$h.init(e,t),Ye.init(e,t)});od=E("ZodJWT",(e,t)=>{Ah.init(e,t),Ye.init(e,t)});ca=E("ZodCustomStringFormat",(e,t)=>{Ch.init(e,t),Ye.init(e,t)});la=E("ZodNumber",(e,t)=>{Yc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>cg(e,r,n,a),Mi(e,"ZodNumber",{gt(r,n){return this.check(Sn(r,n))},gte(r,n){return this.check(Et(r,n))},min(r,n){return this.check(Et(r,n))},lt(r,n){return this.check(xn(r,n))},lte(r,n){return this.check(Mt(r,n))},max(r,n){return this.check(Mt(r,n))},int(r){return this.check(Ml(r))},safe(r){return this.check(Ml(r))},positive(r){return this.check(Sn(0,r))},nonnegative(r){return this.check(Et(0,r))},negative(r){return this.check(xn(0,r))},nonpositive(r){return this.check(Mt(0,r))},multipleOf(r,n){return this.check(go(r,n))},step(r,n){return this.check(go(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});rr=E("ZodNumberFormat",(e,t)=>{Ih.init(e,t),la.init(e,t)});da=E("ZodBoolean",(e,t)=>{_i.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>lg(e,o,r,n)});ua=E("ZodBigInt",(e,t)=>{Vc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>dg(e,r,n,a),e.gte=(r,n)=>e.check(Et(r,n)),e.min=(r,n)=>e.check(Et(r,n)),e.gt=(r,n)=>e.check(Sn(r,n)),e.gte=(r,n)=>e.check(Et(r,n)),e.min=(r,n)=>e.check(Et(r,n)),e.lt=(r,n)=>e.check(xn(r,n)),e.lte=(r,n)=>e.check(Mt(r,n)),e.max=(r,n)=>e.check(Mt(r,n)),e.positive=r=>e.check(Sn(BigInt(0),r)),e.negative=r=>e.check(xn(BigInt(0),r)),e.nonpositive=r=>e.check(Mt(BigInt(0),r)),e.nonnegative=r=>e.check(Et(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(go(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});rd=E("ZodBigIntFormat",(e,t)=>{Oh.init(e,t),ua.init(e,t)});uy=E("ZodSymbol",(e,t)=>{Ph.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ug(e,o,r,n)});my=E("ZodUndefined",(e,t)=>{Rh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>pg(e,o,r,n)});py=E("ZodNull",(e,t)=>{Nh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mg(e,o,r,n)});fy=E("ZodAny",(e,t)=>{Lh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gg(e,o,r,n)});gy=E("ZodUnknown",(e,t)=>{zh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yg(e,o,r,n)});yy=E("ZodNever",(e,t)=>{jh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fg(e,o,r,n)});by=E("ZodVoid",(e,t)=>{Dh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hg(e,o,r,n)});Ui=E("ZodDate",(e,t)=>{Mh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>bg(e,r,n,a),e.min=(r,n)=>e.check(Et(r,n)),e.max=(r,n)=>e.check(Mt(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});wy=E("ZodArray",(e,t)=>{Fh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ig(e,o,r,n),e.element=t.element,Mi(e,"ZodArray",{min(o,r){return this.check(qn(o,r))},nonempty(o){return this.check(qn(1,o))},max(o,r){return this.check(tr(o,r))},length(o,r){return this.check(nr(o,r))},unwrap(){return this.element}})});Bi=E("ZodObject",(e,t)=>{Uh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Og(e,o,r,n),Q.defineLazy(e,"shape",()=>t.shape),Mi(e,"ZodObject",{keyof(){return sd(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:or()})},loose(){return this.clone({...this._zod.def,catchall:or()})},strict(){return this.clone({...this._zod.def,catchall:ad()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return Q.extend(this,o)},safeExtend(o){return Q.safeExtend(this,o)},merge(o){return Q.merge(this,o)},pick(o){return Q.pick(this,o)},omit(o){return Q.omit(this,o)},partial(...o){return Q.partial(ld,this,o[0])},required(...o){return Q.required(dd,this,o[0])}})});qi=E("ZodUnion",(e,t)=>{xi.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cl(e,o,r,n),e.options=t.options});vy=E("ZodXor",(e,t)=>{qi.init(e,t),Gh.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cl(e,o,r,n),e.options=t.options});ky=E("ZodDiscriminatedUnion",(e,t)=>{qi.init(e,t),Bh.init(e,t)});_y=E("ZodIntersection",(e,t)=>{qh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Pg(e,o,r,n)});Sy=E("ZodTuple",(e,t)=>{Kc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rg(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});aa=E("ZodRecord",(e,t)=>{Wh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ng(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});$y=E("ZodMap",(e,t)=>{Hh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ag(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Tn(...o)),e.nonempty=o=>e.check(Tn(1,o)),e.max=(...o)=>e.check(yo(...o)),e.size=(...o)=>e.check(er(...o))});Ay=E("ZodSet",(e,t)=>{Yh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cg(e,o,r,n),e.min=(...o)=>e.check(Tn(...o)),e.nonempty=o=>e.check(Tn(1,o)),e.max=(...o)=>e.check(yo(...o)),e.size=(...o)=>e.check(er(...o))});ia=E("ZodEnum",(e,t)=>{Vh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>wg(e,r,n,a),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let a={};for(let i of r)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ia({...t,checks:[],...Q.normalizeParams(n),entries:a})},e.exclude=(r,n)=>{let a={...t.entries};for(let i of r)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new ia({...t,checks:[],...Q.normalizeParams(n),entries:a})}});Cy=E("ZodLiteral",(e,t)=>{Kh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vg(e,o,r,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]}})});Iy=E("ZodFile",(e,t)=>{Zh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xg(e,o,r,n),e.min=(o,r)=>e.check(Tn(o,r)),e.max=(o,r)=>e.check(yo(o,r)),e.mime=(o,r)=>e.check(Zr(Array.isArray(o)?o:[o],r))});Oy=E("ZodTransform",(e,t)=>{Jh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$g(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new uo(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Q.issue(a,o.value,t));else{let i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Q.issue(i))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(a=>(o.value=a,o.fallback=!0,o)):(o.value=n,o.fallback=!0,o)}});ld=E("ZodOptional",(e,t)=>{Zc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Il(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Py=E("ZodExactOptional",(e,t)=>{Xh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Il(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Ny=E("ZodNullable",(e,t)=>{Qh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Ly=E("ZodDefault",(e,t)=>{ef.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});jy=E("ZodPrefault",(e,t)=>{tf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});dd=E("ZodNonOptional",(e,t)=>{nf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Fy=E("ZodSuccess",(e,t)=>{of.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Uy=E("ZodCatch",(e,t)=>{rf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});By=E("ZodNaN",(e,t)=>{af.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kg(e,o,r,n)});Wi=E("ZodPipe",(e,t)=>{Jc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Fg(e,o,r,n),e.in=t.in,e.out=t.out});Hi=E("ZodCodec",(e,t)=>{Wi.init(e,t),Si.init(e,t)});qy=E("ZodPreprocess",(e,t)=>{Wi.init(e,t),sf.init(e,t)}),Wy=E("ZodReadonly",(e,t)=>{cf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ug(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Yy=E("ZodTemplateLiteral",(e,t)=>{lf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_g(e,o,r,n)});Vy=E("ZodLazy",(e,t)=>{mf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Bg(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});Zy=E("ZodPromise",(e,t)=>{uf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Gg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Jy=E("ZodFunction",(e,t)=>{df.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eg(e,o,r,n)});Yi=E("ZodCustom",(e,t)=>{pf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tg(e,o,r,n)});qT=og,WT=rg;YT=(...e)=>ag({Codec:Hi,Boolean:da,String:sa},...e)});function cj(e){it({customError:e})}function lj(){return it().customError}var sj,eb,ZT=_(()=>{Ft();sj={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"};eb||(eb={})});function uj(e,t){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function mj(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===r){let n=o[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 JT(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return le.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 le.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let a=mj(n,t),i=vt(a,t);return t.refs.set(n,i),t.processing.delete(n),i}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 le.null();if(n.length===0)return le.never();if(n.length===1)return le.literal(n[0]);if(n.every(i=>typeof i=="string"))return le.enum(n);let a=n.map(i=>le.literal(i));return a.length<2?a[0]:le.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return le.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(a=>{let i={...e,type:a};return JT(i,t)});return n.length===0?le.never():n.length===1?n[0]:le.union(n)}if(!o)return le.any();let r;switch(o){case"string":{let n=le.string();if(e.format){let a=e.format;a==="email"?n=n.check(le.email()):a==="uri"||a==="uri-reference"?n=n.check(le.url()):a==="uuid"||a==="guid"?n=n.check(le.uuid()):a==="date-time"?n=n.check(le.iso.datetime()):a==="date"?n=n.check(le.iso.date()):a==="time"?n=n.check(le.iso.time()):a==="duration"?n=n.check(le.iso.duration()):a==="ipv4"?n=n.check(le.ipv4()):a==="ipv6"?n=n.check(le.ipv6()):a==="mac"?n=n.check(le.mac()):a==="cidr"?n=n.check(le.cidrv4()):a==="cidr-v6"?n=n.check(le.cidrv6()):a==="base64"?n=n.check(le.base64()):a==="base64url"?n=n.check(le.base64url()):a==="e164"?n=n.check(le.e164()):a==="jwt"?n=n.check(le.jwt()):a==="emoji"?n=n.check(le.emoji()):a==="nanoid"?n=n.check(le.nanoid()):a==="cuid"?n=n.check(le.cuid()):a==="cuid2"?n=n.check(le.cuid2()):a==="ulid"?n=n.check(le.ulid()):a==="xid"?n=n.check(le.xid()):a==="ksuid"&&(n=n.check(le.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))),r=n;break}case"number":case"integer":{let n=o==="integer"?le.number().int():le.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)),r=n;break}case"boolean":{r=le.boolean();break}case"null":{r=le.null();break}case"object":{let n={},a=e.properties||{},i=new Set(e.required||[]);for(let[d,l]of Object.entries(a)){let u=vt(l,t);n[d]=i.has(d)?u:u.optional()}if(e.propertyNames){let d=vt(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?vt(e.additionalProperties,t):le.any();if(Object.keys(n).length===0){r=le.record(d,l);break}let u=le.object(n).passthrough(),p=le.looseRecord(d,l);r=le.intersection(u,p);break}if(e.patternProperties){let d=e.patternProperties,l=Object.keys(d),u=[];for(let f of l){let g=vt(d[f],t),b=le.string().regex(new RegExp(f));u.push(le.looseRecord(b,g))}let p=[];if(Object.keys(n).length>0&&p.push(le.object(n).passthrough()),p.push(...u),p.length===0)r=le.object({}).passthrough();else if(p.length===1)r=p[0];else{let f=le.intersection(p[0],p[1]);for(let g=2;g<p.length;g++)f=le.intersection(f,p[g]);r=f}break}let c=le.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(vt(e.additionalProperties,t)):r=c.passthrough();break}case"array":{let n=e.prefixItems,a=e.items;if(n&&Array.isArray(n)){let i=n.map(d=>vt(d,t)),c=a&&typeof a=="object"&&!Array.isArray(a)?vt(a,t):void 0;c?r=le.tuple(i).rest(c):r=le.tuple(i),typeof e.minItems=="number"&&(r=r.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(le.maxLength(e.maxItems)))}else if(Array.isArray(a)){let i=a.map(d=>vt(d,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?vt(e.additionalItems,t):void 0;c?r=le.tuple(i).rest(c):r=le.tuple(i),typeof e.minItems=="number"&&(r=r.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(le.maxLength(e.maxItems)))}else if(a!==void 0){let i=vt(a,t),c=le.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=le.array(le.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function vt(e,t){if(typeof e=="boolean")return e?le.any():le.never();let o=JT(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>vt(l,t)),d=le.union(c);o=r?le.intersection(o,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>vt(l,t)),d=le.xor(c);o=r?le.intersection(o,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:le.any();else{let c=r?o:vt(e.allOf[0],t),d=r?0:1;for(let l=d;l<e.allOf.length;l++)c=le.intersection(c,vt(e.allOf[l],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=le.nullable(o)),e.readOnly===!0&&(o=le.readonly(o)),e.default!==void 0&&(o=o.default(e.default));let n={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of a)c in e&&(n[c]=e[c]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let c of i)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))dj.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(o,n),e.description&&(o=o.describe(e.description)),o}function XT(e,t){if(typeof e=="boolean")return e?le.any():le.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=uj(o,t?.defaultTarget),n=o.$defs||o.definitions||{},a={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??pt};return vt(o,a)}var le,dj,QT=_(()=>{$i();Nl();Pi();Ni();le={...Ri,...Rl,iso:ra},dj=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 tb={};_n(tb,{bigint:()=>gj,boolean:()=>fj,date:()=>yj,number:()=>hj,string:()=>pj});function pj(e){return _f(sa,e)}function hj(e){return If(la,e)}function fj(e){return jf(da,e)}function gj(e){return Mf(ua,e)}function yj(e){return Zf(Ui,e)}var eE=_(()=>{Ft();Ni()});var s={};_n(s,{$brand:()=>Bm,$input:()=>vf,$output:()=>wf,NEVER:()=>Gm,TimePrecision:()=>Sf,ZodAny:()=>fy,ZodArray:()=>wy,ZodBase64:()=>ed,ZodBase64URL:()=>td,ZodBigInt:()=>ua,ZodBigIntFormat:()=>rd,ZodBoolean:()=>da,ZodCIDRv4:()=>Xl,ZodCIDRv6:()=>Ql,ZodCUID:()=>Wl,ZodCUID2:()=>Hl,ZodCatch:()=>Uy,ZodCodec:()=>Hi,ZodCustom:()=>Yi,ZodCustomStringFormat:()=>ca,ZodDate:()=>Ui,ZodDefault:()=>Ly,ZodDiscriminatedUnion:()=>ky,ZodE164:()=>nd,ZodEmail:()=>Gl,ZodEmoji:()=>Bl,ZodEnum:()=>ia,ZodError:()=>aj,ZodExactOptional:()=>Py,ZodFile:()=>Iy,ZodFirstPartyTypeKind:()=>eb,ZodFunction:()=>Jy,ZodGUID:()=>zi,ZodIPv4:()=>Zl,ZodIPv6:()=>Jl,ZodISODate:()=>zl,ZodISODateTime:()=>Ll,ZodISODuration:()=>Dl,ZodISOTime:()=>jl,ZodIntersection:()=>_y,ZodIssueCode:()=>sj,ZodJWT:()=>od,ZodKSUID:()=>Kl,ZodLazy:()=>Vy,ZodLiteral:()=>Cy,ZodMAC:()=>cy,ZodMap:()=>$y,ZodNaN:()=>By,ZodNanoID:()=>ql,ZodNever:()=>yy,ZodNonOptional:()=>dd,ZodNull:()=>py,ZodNullable:()=>Ny,ZodNumber:()=>la,ZodNumberFormat:()=>rr,ZodObject:()=>Bi,ZodOptional:()=>ld,ZodPipe:()=>Wi,ZodPrefault:()=>jy,ZodPreprocess:()=>qy,ZodPromise:()=>Zy,ZodReadonly:()=>Wy,ZodRealError:()=>Rt,ZodRecord:()=>aa,ZodSet:()=>Ay,ZodString:()=>sa,ZodStringFormat:()=>Ye,ZodSuccess:()=>Fy,ZodSymbol:()=>uy,ZodTemplateLiteral:()=>Yy,ZodTransform:()=>Oy,ZodTuple:()=>Sy,ZodType:()=>Ce,ZodULID:()=>Yl,ZodURL:()=>Fi,ZodUUID:()=>En,ZodUndefined:()=>my,ZodUnion:()=>qi,ZodUnknown:()=>gy,ZodVoid:()=>by,ZodXID:()=>Vl,ZodXor:()=>vy,_ZodString:()=>Ul,_default:()=>zy,_function:()=>UT,any:()=>bT,array:()=>Gi,base64:()=>tT,base64url:()=>nT,bigint:()=>pT,boolean:()=>dy,catch:()=>Gy,check:()=>GT,cidrv4:()=>Q0,cidrv6:()=>eT,clone:()=>St,codec:()=>jT,coerce:()=>tb,config:()=>it,core:()=>Wn,cuid:()=>W0,cuid2:()=>H0,custom:()=>BT,date:()=>vT,decode:()=>ey,decodeAsync:()=>ny,describe:()=>qT,discriminatedUnion:()=>ET,e164:()=>oT,email:()=>L0,emoji:()=>B0,encode:()=>Qg,encodeAsync:()=>ty,endsWith:()=>Kr,enum:()=>sd,exactOptional:()=>Ry,file:()=>RT,flattenError:()=>yi,float32:()=>lT,float64:()=>dT,formatError:()=>bi,fromJSONSchema:()=>XT,function:()=>UT,getErrorMap:()=>lj,globalRegistry:()=>pt,gt:()=>Sn,gte:()=>Et,guid:()=>z0,hash:()=>cT,hex:()=>sT,hostname:()=>iT,httpUrl:()=>G0,includes:()=>Yr,instanceof:()=>HT,int:()=>Ml,int32:()=>uT,int64:()=>hT,intersection:()=>xy,invertCodec:()=>DT,ipv4:()=>Z0,ipv6:()=>X0,iso:()=>ra,json:()=>VT,jwt:()=>rT,keyof:()=>kT,ksuid:()=>K0,lazy:()=>Ky,length:()=>nr,literal:()=>PT,locales:()=>Ei,looseObject:()=>ST,looseRecord:()=>AT,lowercase:()=>Wr,lt:()=>xn,lte:()=>Mt,mac:()=>J0,map:()=>CT,maxLength:()=>tr,maxSize:()=>yo,meta:()=>WT,mime:()=>Zr,minLength:()=>qn,minSize:()=>Tn,multipleOf:()=>go,nan:()=>zT,nanoid:()=>q0,nativeEnum:()=>OT,negative:()=>Sl,never:()=>ad,nonnegative:()=>El,nonoptional:()=>My,nonpositive:()=>Tl,normalize:()=>Jr,null:()=>hy,nullable:()=>Di,nullish:()=>NT,number:()=>ly,object:()=>_T,optional:()=>ji,overwrite:()=>rn,parse:()=>Kg,parseAsync:()=>Zg,partialRecord:()=>$T,pipe:()=>Fl,positive:()=>xl,prefault:()=>Dy,preprocess:()=>KT,prettifyError:()=>np,promise:()=>FT,property:()=>$l,readonly:()=>Hy,record:()=>Ey,refine:()=>Xy,regex:()=>qr,regexes:()=>Dt,registry:()=>nl,safeDecode:()=>ry,safeDecodeAsync:()=>iy,safeEncode:()=>oy,safeEncodeAsync:()=>ay,safeParse:()=>Jg,safeParseAsync:()=>Xg,set:()=>IT,setErrorMap:()=>cj,size:()=>er,slugify:()=>ta,startsWith:()=>Vr,strictObject:()=>xT,string:()=>Li,stringFormat:()=>aT,stringbool:()=>YT,success:()=>LT,superRefine:()=>Qy,symbol:()=>gT,templateLiteral:()=>MT,toJSONSchema:()=>Ol,toLowerCase:()=>Qr,toUpperCase:()=>ea,transform:()=>cd,treeifyError:()=>tp,trim:()=>Xr,tuple:()=>Ty,uint32:()=>mT,uint64:()=>fT,ulid:()=>Y0,undefined:()=>yT,union:()=>id,unknown:()=>or,uppercase:()=>Hr,url:()=>U0,util:()=>Q,uuid:()=>j0,uuidv4:()=>D0,uuidv6:()=>M0,uuidv7:()=>F0,void:()=>wT,xid:()=>V0,xor:()=>TT});var nb=_(()=>{Ft();Ni();Nl();Vg();sy();ZT();Ft();ff();Ft();Oi();QT();bf();Pi();Pi();eE();it(Xc())});var je=_(()=>{nb();nb()});var ob=_(()=>{"use strict";je();s.config(s.locales.en())});function pa(e,t={}){let o=e?.trim()||ma;return t.lower&&!/[A-Z]/.test(o.slice(1))&&(o=o.toLowerCase()),t.plural?bj(o):o}function bj(e){let t=/([A-Za-z]+)$/.exec(e);if(!t)return`${e}s`;let o=t[1],r=e.slice(0,e.length-o.length),n=o.length>1&&o===o.toUpperCase(),a=o.toLowerCase(),i=c=>n?c.toUpperCase():c;return/[^aeiou]y$/.test(a)?r+o.slice(0,-1)+i("ies"):/(^|[^aeiou]|qu)[aeiou]z$/.test(a)&&!/zz$/.test(a)?r+o+i("zes"):/(s|x|z|ch|sh)$/.test(a)?r+o+i("es"):r+o+i("s")}var ma,Vi=_(()=>{"use strict";ma="Round"});var ud=_(()=>{"use strict"});var md,Ki=_(()=>{"use strict";md=["consent_brand_name","privacy_policy_url"]});var tE=_(()=>{"use strict";Ki()});function fd(e){return e?!wj.includes(De(e)):!0}function De(e){return vj[e]??e}function nE(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let o=De(t.archetype);return o===t.archetype?e:{...t,archetype:o}}var Yt,pd,hd,wj,vj,rb,Zi,oE,ko,Vt=_(()=>{"use strict";Yt=["hunt","push","group","predict","bingo","shoot","place","mystery","arcade"],pd={mystery:"@proxima/deduction-engine",arcade:"@proxima/arcade-engine"},hd=Object.keys(pd),wj=["arcade"];vj={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};rb={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element",mystery:"gamestage-mystery-element",arcade:"gamestage-arcade-element"},Zi={scoreline:{contentType:"gamestage-scoreline-element",name:"Scoreline"},number:{contentType:"gamestage-number-element",name:"Number question"}},oE={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face",mystery:"Mystery",arcade:"Arcade"},ko={hunt:{name:"Search",short:"Search",japanese:"\u63A2\u7D22"},push:{name:"Push Your Luck",short:"Push",japanese:"\u904B\u8A66\u3057"},group:{name:"Find the Groups",short:"Groups",japanese:"\u5171\u901A\u70B9\u63A2\u3057"},predict:{name:"Predict",short:"Predict",japanese:"\u4E88\u60F3"},bingo:{name:"Bingo",short:"Bingo",japanese:"\u30D3\u30F3\u30B4"},shoot:{name:"Kicker",short:"Kicker",japanese:"\u30AD\u30C3\u30AB\u30FC"},place:{name:"Place the Face",short:"Place",japanese:"Place the Face"},mystery:{name:"Mystery",short:"Mystery",japanese:"Mystery"},arcade:{name:"Arcade",short:"Arcade",japanese:"\u30A2\u30FC\u30B1\u30FC\u30C9"}}});function xj(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Sj(e){let{name:t,japanese:o}=ko[e];return o===t?"":o}var kj,_j,CH,rE=_(()=>{"use strict";Vt();kj="https://typesafe.ai/blog/introducing-system-one-models-and-jev",_j=[["predict",{when:"Before an event",group:"live",one:"Users predict what will happen and get points for correctness.",ideas:"Call the winners on awards night, locked when the event starts.",prompt:"Make a Prediction game with Gamestage. Call the winners on awards night, locked when the event starts.",game:"Answer one or more questions before the event. Scores arrive with the result.",settings:"The questions, options and points, and how close a number has to be. You enter the result in Monterosa Studio when it's known.",limits:"For now, scores are issued when all the questions have results. Calls can't be changed."}],["bingo",{when:"During an event",group:"live",one:"Your own card of moments, checked off as they happen.",ideas:"Buzzword bingo: a driver's favourite phrases during the race.",prompt:"Make a Bingo game with Gamestage. Buzzword bingo: a driver's favourite phrases during the race.",game:"Choose a board, lock it in, and watch it fill as the items happen.",settings:'The pool of "moments", board size, re-deals and points per line. Someone marks each moment in Monterosa Studio.',limits:"A board can't change once it's locked."}],["hunt",{when:"Any time",group:"know",one:"Find the right answers on a board.",ideas:"Find the five songs that hit #1 in 2000, from a board of twenty.",prompt:"Make a Search game with Gamestage. Find the five songs that reached number one in 2000, from a board of twenty.",game:"Pick from a board. Each pick is marked right or wrong, and wrong picks cost you an attempt.",settings:"The board, the right answers (kept hidden), how many to find and how many attempts.",limits:"For now, everyone gets the same board, and the answers can't change mid-game."}],["push",{when:"Any time",group:"know",one:"Get as close to a target as you dare, without going over.",ideas:"Box Office: pick films to reach $3bn in takings without going over.",game:"Pick one at a time and watch your total climb. Stop before you pass the target.",settings:"The target, the picks, and a hidden number on each pick.",limits:"For now, everyone gets the same picks, and it isn't built for live events."}],["group",{when:"Any time",group:"know",one:"Sort a board into hidden groupings.",ideas:"TV Show Characters: 16 characters from a show and the four things they have in common.",game:"Choose a set of items and submit it. You're given right, wrong or one away.",settings:"The board, the hidden groups and their names, and how many guesses.",limits:"For now, an item can only belong to one group."}],["place",{when:"Any time",group:"know",one:"Drop each card on a category it fits.",ideas:"Film Facts: drop each film on the right box, such as won an Oscar, over three hours or a sequel.",game:"Take each card and drop it on a category it fits. A wrong drop costs you a life.",settings:"The categories, the cards, which card fits where (kept hidden), lives and passes.",limits:"For now, there's no starter template."}],["mystery",{when:"Special order",group:"know",soon:!0,poweredBy:{name:"Jev",href:kj},one:"Find one hidden person by asking yes-or-no questions.",ideas:"Mystery Musician: guess the hidden artist from a list of 500.",game:"Ask yes-or-no questions in your own words until hundreds of people narrow to one.",settings:"The answer, two clues, the difficulty, and a dataset of people.",limits:"For now, the answer is always a person."}],["shoot",{when:"Any time",group:"play",one:"Shoot past a keeper, or kick at the posts.",ideas:"Shoot-out: five penalties past a keeper, or a rugby conversion challenge from further out each kick.",game:"Aim, pick a power and kick. A replay shows each kick go in, get saved, or go over or wide.",settings:"Keeper or posts, how many kicks, goals to win, and the keeper's difficulty or the distance and wind. No answers to write.",limits:"For now, only shots past a keeper are built, and kicks at the posts are coming soon. Timing and reflexes aren't scored."}],["arcade",{when:"Any time",group:"play",one:"A real-time phone game with a leaderboard of each player's best run.",ideas:"Endless Runner: dodge obstacles for as long as you can, themed to your brand.",game:"Play a fast game on your phone. Your best run goes on the leaderboard.",settings:"Your game, plus the fastest anyone could score and the longest a run can last.",limits:"For now, no prizes: impossible scores are stopped, but believable fakes are not."}]];CH=_j.map(([e,t])=>({format:e,slug:xj(ko[e].name),name:ko[e].name,japanese:Sj(e),...t}))});function iE(e,t){return e==="side"?`side:${t?.id}`:e}async function sE(e,t){let o=globalThis.crypto?.subtle;if(!o)throw new Error("liveChannel needs WebCrypto (a browser, or Node 18+)");let r=new Uint8Array(await o.digest("SHA-1",new TextEncoder().encode(`gamestage/live/${e}/${t}`)));r[6]=r[6]&15|80,r[8]=r[8]&63|128;let n=[...r.subarray(0,16)].map(a=>a.toString(16).padStart(2,"0")).join("");return`l-${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function cE(e){let t=new Set;for(let n of e)n.sides.forEach((a,i)=>Object.keys(a).forEach(c=>t.add(`${i}.${c}`)));let o=["elapsed",...[...t].sort()],r=e.map(n=>o.map(a=>{if(a==="elapsed")return n.elapsed;let i=a.indexOf(".");return n.sides[Number(a.slice(0,i))]?.[a.slice(i+1)]??0}));return{columns:o,rows:r}}var _o,aE,ab,ar=_(()=>{"use strict";_o=["sportmonks"],aE={state:21600,clock:21600,side:21600,moments:21600,moment:30,timeline:21600,health:120};ab="edition_live_contest"});var lE,ib=_(()=>{"use strict";je();lE=s.object({points_per_second:s.number().positive().max(1e6).optional(),max_run_seconds:s.number().int().min(5).max(3600),min_run_ms:s.number().int().min(0).max(36e5).optional(),score_max:s.number().int().positive().optional(),score_min:s.number().int().min(-Number.MAX_SAFE_INTEGER).optional(),ranking:s.enum(["highest","lowest"]).default("highest"),max_runs_per_day:s.number().int().positive().max(1e4).optional(),rank_by:s.enum(["best","total"]).optional(),signed_scores:s.boolean().optional()}).strict().superRefine((e,t)=>{e.ranking==="highest"&&e.points_per_second===void 0&&t.addIssue({code:"custom",path:["points_per_second"],message:"A game where the highest score wins needs points_per_second: the fastest a fair run can score."}),e.ranking==="lowest"&&e.score_min===void 0&&t.addIssue({code:"custom",path:["score_min"],message:"A game where the lowest score wins needs score_min: the best score a fair run can reach."}),e.score_min!==void 0&&e.score_min<0&&!e.signed_scores&&t.addIssue({code:"custom",path:["score_min"],message:"A score_min below 0 needs signed_scores: true, so a run may score below 0."}),e.ranking==="lowest"&&e.points_per_second!==void 0&&t.addIssue({code:"custom",path:["points_per_second"],message:"points_per_second bounds a high score and means nothing when the lowest score wins."})})});function wd(e,t){return t==="article-launch"||t==="article-embed"?t==="article-embed"?"card":"launch":e==="predict"?"page":"screen"}var gd,yd,ir,bd,sb,cb,lb,dE,db,ub,Hn,vd=_(()=>{"use strict";je();gd=s.enum(["screen","canvas","launch","card","page","sheet"]),yd=s.enum(["fullscreen","article-launch","article-embed","app-webview"]),ir={screen:{name:"Screen",summary:"fills the phone and nothing scrolls; the layout adapts to the phone's size"},canvas:{name:"Scaled canvas",summary:"drawn at one size and scaled to fit the phone, with bars where the shape differs"},launch:{name:"Card that opens to full screen",summary:"a preview in the host page; tapping it opens the game full screen over the page"},card:{name:"Card",summary:"a fixed box inside a page that scrolls, with no scrolling inside the box"},page:{name:"Page",summary:"scrolls like a web page; for long question lists and results tables"},sheet:{name:"Sheet",summary:"slides up over part of a host app for one quick question"}},bd={fullscreen:{name:"Full screen",summary:"opened full screen, from a carousel, a Hub or a link"},"article-launch":{name:"Article, opening full screen",summary:"a card in an article that opens the game full screen over it"},"article-embed":{name:"Article embed",summary:"a box inside an article, played where it sits"},"app-webview":{name:"Web view in a native app",summary:"inside a club's or publisher's own app, in a web view"}},sb="Players come back to a game they can play properly. Full screen, a game feels like an app and gets played; a widget in an article reads as throwaway and gets scrolled past. Choose full screen unless your host can't allow it.",cb="An article box is small, easy to scroll past, and the page's own scrolling fights swipes inside the game. Use it only where the host can't open the game full screen.",lb="Inside a native app, set the web view's own background to the game's background colour and create it before the player taps, so nothing flashes white while it loads.";dE=["screen","canvas","card","sheet"],db={screen:{jsKb:350,cssKb:60,fontKb:150,totalKb:900,firstRenderMs:1800,playableMs:3500},canvas:{jsKb:500,cssKb:60,fontKb:150,totalKb:1500,firstRenderMs:1800,playableMs:4500},launch:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},card:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},page:{jsKb:400,cssKb:80,fontKb:150,totalKb:1100,firstRenderMs:1800,playableMs:4e3},sheet:{jsKb:250,cssKb:40,fontKb:100,totalKb:600,firstRenderMs:1200,playableMs:2500}},ub={name:"mid-range phone on 4G",cpuSlowdown:4,latencyMs:60,downloadKbps:9e3,uploadKbps:1500},Hn="gamestage:playable"});function uE(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(Ej.has(t)||Tj.some(r=>t.endsWith(r))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let o=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(o){let r=Number.parseInt(o[1],16),n=Number.parseInt(o[2],16),a=`${r>>8}.${r&255}.${n>>8}.${n&255}`;if(a!==t)return uE(a)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t)||Aj(t)&&!Cj(t))}function mb(e){let t=e.split(".");if(t.length!==4)return;let o=t.map(r=>/^(0|[1-9][0-9]{0,2})$/.test(r)?Number(r):NaN);return o.every(r=>r>=0&&r<=255)?o:void 0}function mE(e){let t=e.replace(/^\[/,"").replace(/\]$/,""),o=t.indexOf("%");if(o>=0&&(t=t.slice(0,o)),!t.includes(":")||!/^[0-9a-f:.]+$/i.test(t))return;let r;if(t.includes(".")){let l=t.lastIndexOf(":");if(r=mb(t.slice(l+1)),!r)return;t=`${t.slice(0,l+1)}0:0`}let n=t.split("::");if(n.length>2)return;let a=l=>l===""?[]:l.split(":").map(u=>/^[0-9a-f]{1,4}$/i.test(u)?Number.parseInt(u,16):NaN),i=a(n[0]),c=n.length===2?a(n[1]):[];if([...i,...c].some(Number.isNaN))return;let d;if(n.length===2){let l=8-i.length-c.length;if(l<1)return;d=[...i,...new Array(l).fill(0),...c]}else d=i;if(d.length===8)return r&&(d[6]=r[0]<<8|r[1],d[7]=r[2]<<8|r[3]),d}function Ji([e,t,o]){return!(e===0||e===10||e===127||e===100&&t>=64&&t<=127||e===169&&t===254||e===172&&t>=16&&t<=31||e===192&&t===168||e===192&&t===0&&(o===0||o===2)||e===192&&t===88&&o===99||e===198&&(t===18||t===19)||e===198&&t===51&&o===100||e===203&&t===0&&o===113||e>=224)}function kd(e,t){return[e>>8,e&255,t>>8,t&255]}function $j(e){let t=o=>e.slice(0,o).every(r=>r===0);return t(5)&&e[5]===65535||t(6)?Ji(kd(e[6],e[7])):e[0]===100&&e[1]===65435?e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0&&Ji(kd(e[6],e[7])):(e[0]&57344)!==8192||e[0]===8193&&e[1]===3512||e[0]===8193&&e[1]===0?!1:e[0]===8194?Ji(kd(e[1],e[2])):!0}function Aj(e){return mb(e)!==void 0||mE(e)!==void 0}function Cj(e){let t=mb(e);if(t)return Ji(t);let o=mE(e);return o?$j(o):!1}function _d(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(uE(t.hostname))return"local";if(t.protocol!=="https:")return"insecure";if(t.username||t.password)return"credentials"}function xd(e){switch(e){case"local":return"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness, or a private or reserved address. A deployed game pointed at the harness 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.";case"insecure":return"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.";case"credentials":return"Must not carry a username or password. Name the key set's public URL.";case"unparseable":return"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."}}var Tj,Ej,Sd=_(()=>{"use strict";Tj=[".localhost",".local",".internal",".test",".localdomain"],Ej=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});function pE(e){return e.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").toUpperCase()}function Ij(e){return/^[A-Z0-9]$/.test(e)}function an(e){return pE(e).replace(/[^A-Z0-9]/g,"")}function hE(e){let t=[];for(let o of[...pE(e)])Ij(o)&&!t.includes(o)&&t.push(o);return t}var fE,Td=_(()=>{"use strict";fE=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ",..."0123456789"]});function gE(e){return an(e)}function yE(e){return/^[A-Z]+$/.test(e)}var pb,hb=_(()=>{"use strict";Td();pb=[4,5,6,7]});var Xi,Qi=_(()=>{"use strict";je();Xi=s.object({date:s.string(),plays:s.number(),players:s.number().nullable()})});var es,Ed=_(()=>{"use strict";je();es=s.discriminatedUnion("source",[s.object({source:s.literal("manifest")}),s.object({source:s.literal("studio"),element_id:s.string().min(1),edition_id:s.string().min(1)})])});var wE,Oj,vE,bE,kE,$d=_(()=>{"use strict";je();wE={notify_template_subject_won:"{score_line}. You called it",notify_template_subject_lost:"{score_line}. You scored {points}",notify_template_sms_won:"{score_line}. You called it: {pick}, {points} points.",notify_template_sms_lost:"{score_line}. You picked {pick}: {points} points.",notify_template_body:`{score_line}.
77
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let c=i[1];if(t===i[0]){a(i);continue}if(e.external){let l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(c.cycle){a(i);continue}if(c.count>1&&e.reused==="ref"){a(i);continue}}}function vo(e,t){let o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=c=>{let d=e.seen.get(c);if(d.ref===null)return;let l=d.def??d.schema,u={...l},p=d.ref;if(d.ref=null,p){r(p);let g=e.seen.get(p),b=g.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(b)):Object.assign(l,b),Object.assign(l,u),c._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in u||delete l[x];if(b.$ref&&g.def)for(let x in l)x==="$ref"||x==="allOf"||x in g.def&&JSON.stringify(l[x])===JSON.stringify(g.def[x])&&delete l[x]}let f=c._zod.parent;if(f&&f!==p){r(f);let g=e.seen.get(f);if(g?.schema.$ref&&(l.$ref=g.schema.$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]}e.override({zodSchema:c,jsonSchema:l,path:d.path??[]})};for(let c of[...e.seen.entries()].reverse())r(c[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 c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(c)}Object.assign(n,o.def??o.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&n.id===a&&delete n.id;let i=e.external?.defs??{};for(let c of e.seen.entries()){let d=c[1];d.def&&d.defId&&(d.def.id===d.defId&&delete d.def.id,i[d.defId]=d.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let c=JSON.parse(JSON.stringify(n));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:oa(t,"input",e.processors),output:oa(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function $t(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $t(r.element,o);if(r.type==="set")return $t(r.valueType,o);if(r.type==="lazy")return $t(r.getter(),o);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $t(r.innerType,o);if(r.type==="intersection")return $t(r.left,o)||$t(r.right,o);if(r.type==="record"||r.type==="map")return $t(r.keyType,o)||$t(r.valueType,o);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:$t(r.in,o)||$t(r.out,o);if(r.type==="object"){for(let n in r.shape)if($t(r.shape[n],o))return!0;return!1}if(r.type==="union"){for(let n of r.options)if($t(n,o))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if($t(n,o))return!0;return!!(r.rest&&$t(r.rest,o))}return!1}var ig,oa,Ii=_(()=>{$i();ig=(e,t={})=>o=>{let r=bo({...o,processors:t});return Be(e,r),wo(r,e),vo(r,e)},oa=(e,t,o={})=>r=>{let{libraryOptions:n,target:a}=r??{},i=bo({...n??{},target:a,io:t,processors:o});return Be(e,i),wo(i,e),vo(i,e)}});function Ol(e,t){if("_idmap"in e){let r=e,n=bo({...t,processors:Al}),a={};for(let d of r._idmap.entries()){let[l,u]=d;Be(u,n)}let i={},c={registry:r,uri:t?.uri,defs:a};n.external=c;for(let d of r._idmap.entries()){let[l,u]=d;wo(n,u),i[l]=vo(n,u)}if(Object.keys(a).length>0){let d=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[d]:a}}return{schemas:i}}let o=bo({...t,processors:Al});return Be(e,o),wo(o,e),vo(o,e)}var oj,sg,cg,lg,dg,ug,mg,pg,hg,fg,gg,yg,bg,wg,vg,kg,_g,xg,Sg,Tg,Eg,$g,Ag,Cg,Ig,Og,Cl,Pg,Rg,Ng,Lg,zg,jg,Dg,Mg,Fg,Ug,Gg,Il,Bg,Al,Oi=_(()=>{Ii();me();oj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sg=(e,t,o,r)=>{let n=o;n.type="string";let{minimum:a,maximum:i,format:c,patterns:d,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(n.minLength=a),typeof i=="number"&&(n.maxLength=i),c&&(n.format=oj[c]??c,n.format===""&&delete n.format,c==="time"&&delete n.format),l&&(n.contentEncoding=l),d&&d.size>0){let u=[...d];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},cg=(e,t,o,r)=>{let n=o,{minimum:a,maximum:i,format:c,multipleOf:d,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof c=="string"&&c.includes("int")?n.type="integer":n.type="number";let p=typeof u=="number"&&u>=(a??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";p?g?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:typeof a=="number"&&(n.minimum=a),f?g?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:typeof i=="number"&&(n.maximum=i),typeof d=="number"&&(n.multipleOf=d)},lg=(e,t,o,r)=>{o.type="boolean"},dg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ug=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},mg=(e,t,o,r)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},pg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},fg=(e,t,o,r)=>{o.not={}},gg=(e,t,o,r)=>{},yg=(e,t,o,r)=>{},bg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wg=(e,t,o,r)=>{let n=e._zod.def,a=ui(n.entries);a.every(i=>typeof i=="number")&&(o.type="number"),a.every(i=>typeof i=="string")&&(o.type="string"),o.enum=a},vg=(e,t,o,r)=>{let n=e._zod.def,a=[];for(let i of n.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){let i=a[0];o.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[i]:o.const=i}else a.every(i=>typeof i=="number")&&(o.type="number"),a.every(i=>typeof i=="string")&&(o.type="string"),a.every(i=>typeof i=="boolean")&&(o.type="boolean"),a.every(i=>i===null)&&(o.type="null"),o.enum=a},kg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},_g=(e,t,o,r)=>{let n=o,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=a.source},xg=(e,t,o,r)=>{let n=o,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:d}=e._zod.bag;i!==void 0&&(a.minLength=i),c!==void 0&&(a.maxLength=c),d?d.length===1?(a.contentMediaType=d[0],Object.assign(n,a)):(Object.assign(n,a),n.anyOf=d.map(l=>({contentMediaType:l}))):Object.assign(n,a)},Sg=(e,t,o,r)=>{o.type="boolean"},Tg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Eg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$g=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ag=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Cg=(e,t,o,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ig=(e,t,o,r)=>{let n=o,a=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof c=="number"&&(n.maxItems=c),n.type="array",n.items=Be(a.element,t,{...r,path:[...r.path,"items"]})},Og=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="object",n.properties={};let i=a.shape;for(let l in i)n.properties[l]=Be(i[l],t,{...r,path:[...r.path,"properties",l]});let c=new Set(Object.keys(i)),d=new Set([...c].filter(l=>{let u=a.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));d.size>0&&(n.required=Array.from(d)),a.catchall?._zod.def.type==="never"?n.additionalProperties=!1:a.catchall?a.catchall&&(n.additionalProperties=Be(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Cl=(e,t,o,r)=>{let n=e._zod.def,a=n.inclusive===!1,i=n.options.map((c,d)=>Be(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?o.oneOf=i:o.anyOf=i},Pg=(e,t,o,r)=>{let n=e._zod.def,a=Be(n.left,t,{...r,path:[...r.path,"allOf",0]}),i=Be(n.right,t,{...r,path:[...r.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,d=[...c(a)?a.allOf:[a],...c(i)?i.allOf:[i]];o.allOf=d},Rg=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=a.items.map((f,g)=>Be(f,t,{...r,path:[...r.path,i,g]})),l=a.rest?Be(a.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=d,l&&(n.items=l)):t.target==="openapi-3.0"?(n.items={anyOf:d},l&&n.items.anyOf.push(l),n.minItems=d.length,l||(n.maxItems=d.length)):(n.items=d,l&&(n.additionalItems=l));let{minimum:u,maximum:p}=e._zod.bag;typeof u=="number"&&(n.minItems=u),typeof p=="number"&&(n.maxItems=p)},Ng=(e,t,o,r)=>{let n=o,a=e._zod.def;n.type="object";let i=a.keyType,d=i._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){let u=Be(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let p of d)n.patternProperties[p.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Be(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=Be(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let l=i._zod.values;if(l){let u=[...l].filter(p=>typeof p=="string"||typeof p=="number");u.length>0&&(n.required=u)}},Lg=(e,t,o,r)=>{let n=e._zod.def,a=Be(n.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,o.nullable=!0):o.anyOf=[a,{type:"null"}]},zg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},jg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,o.default=JSON.parse(JSON.stringify(n.defaultValue))},Dg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},Mg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=i},Fg=(e,t,o,r)=>{let n=e._zod.def,a=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?n.out:n.in:n.out;Be(i,t,r);let c=t.seen.get(e);c.ref=i},Ug=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType,o.readOnly=!0},Gg=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},Il=(e,t,o,r)=>{let n=e._zod.def;Be(n.innerType,t,r);let a=t.seen.get(e);a.ref=n.innerType},Bg=(e,t,o,r)=>{let n=e._zod.innerType;Be(n,t,r);let a=t.seen.get(e);a.ref=n},Al={string:sg,number:cg,boolean:lg,bigint:dg,symbol:ug,null:mg,undefined:pg,void:hg,never:fg,any:gg,unknown:yg,date:bg,enum:wg,literal:vg,nan:kg,template_literal:_g,file:xg,success:Sg,custom:Tg,function:Eg,transform:$g,map:Ag,set:Cg,array:Ig,object:Og,union:Cl,intersection:Pg,tuple:Rg,record:Ng,nullable:Lg,nonoptional:zg,default:jg,prefault:Dg,catch:Mg,pipe:Fg,readonly:Ug,promise:Gg,optional:Il,lazy:Bg}});var Pl,I0=_(()=>{Oi();Ii();Pl=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 o=t?.target??"draft-2020-12";o==="draft-4"&&(o="draft-04"),o==="draft-7"&&(o="draft-07"),this.ctx=bo({processors:Al,target:o,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,o={path:[],schemaPath:[]}){return Be(t,this.ctx,o)}emit(t,o){o&&(o.cycles&&(this.ctx.cycles=o.cycles),o.reused&&(this.ctx.reused=o.reused),o.external&&(this.ctx.external=o.external)),wo(this.ctx,t);let r=vo(this.ctx,t),{"~standard":n,...a}=r;return a}}});var O0={};var P0=_(()=>{});var Wn={};_n(Wn,{$ZodAny:()=>Lh,$ZodArray:()=>Fh,$ZodAsyncError:()=>on,$ZodBase64:()=>Th,$ZodBase64URL:()=>Eh,$ZodBigInt:()=>Vc,$ZodBigIntFormat:()=>Oh,$ZodBoolean:()=>_i,$ZodCIDRv4:()=>_h,$ZodCIDRv6:()=>xh,$ZodCUID:()=>dh,$ZodCUID2:()=>uh,$ZodCatch:()=>rf,$ZodCheck:()=>Ze,$ZodCheckBigIntFormat:()=>Dp,$ZodCheckEndsWith:()=>Zp,$ZodCheckGreaterThan:()=>Uc,$ZodCheckIncludes:()=>Vp,$ZodCheckLengthEquals:()=>qp,$ZodCheckLessThan:()=>Fc,$ZodCheckLowerCase:()=>Hp,$ZodCheckMaxLength:()=>Gp,$ZodCheckMaxSize:()=>Mp,$ZodCheckMimeType:()=>Xp,$ZodCheckMinLength:()=>Bp,$ZodCheckMinSize:()=>Fp,$ZodCheckMultipleOf:()=>zp,$ZodCheckNumberFormat:()=>jp,$ZodCheckOverwrite:()=>Qp,$ZodCheckProperty:()=>Jp,$ZodCheckRegex:()=>Wp,$ZodCheckSizeEquals:()=>Up,$ZodCheckStartsWith:()=>Kp,$ZodCheckStringFormat:()=>Gr,$ZodCheckUpperCase:()=>Yp,$ZodCodec:()=>Si,$ZodCustom:()=>pf,$ZodCustomStringFormat:()=>Ch,$ZodDate:()=>Mh,$ZodDefault:()=>ef,$ZodDiscriminatedUnion:()=>Bh,$ZodE164:()=>$h,$ZodEmail:()=>ih,$ZodEmoji:()=>ch,$ZodEncodeError:()=>uo,$ZodEnum:()=>Vh,$ZodError:()=>gi,$ZodExactOptional:()=>Xh,$ZodFile:()=>Zh,$ZodFunction:()=>df,$ZodGUID:()=>rh,$ZodIPv4:()=>wh,$ZodIPv6:()=>vh,$ZodISODate:()=>gh,$ZodISODateTime:()=>fh,$ZodISODuration:()=>bh,$ZodISOTime:()=>yh,$ZodIntersection:()=>qh,$ZodJWT:()=>Ah,$ZodKSUID:()=>hh,$ZodLazy:()=>mf,$ZodLiteral:()=>Kh,$ZodMAC:()=>kh,$ZodMap:()=>Hh,$ZodNaN:()=>af,$ZodNanoID:()=>lh,$ZodNever:()=>jh,$ZodNonOptional:()=>nf,$ZodNull:()=>Nh,$ZodNullable:()=>Qh,$ZodNumber:()=>Yc,$ZodNumberFormat:()=>Ih,$ZodObject:()=>Px,$ZodObjectJIT:()=>Uh,$ZodOptional:()=>Zc,$ZodPipe:()=>Jc,$ZodPrefault:()=>tf,$ZodPreprocess:()=>sf,$ZodPromise:()=>uf,$ZodReadonly:()=>cf,$ZodRealError:()=>Pt,$ZodRecord:()=>Wh,$ZodRegistry:()=>tl,$ZodSet:()=>Yh,$ZodString:()=>Qo,$ZodStringFormat:()=>He,$ZodSuccess:()=>of,$ZodSymbol:()=>Ph,$ZodTemplateLiteral:()=>lf,$ZodTransform:()=>Jh,$ZodTuple:()=>Kc,$ZodType:()=>Ee,$ZodULID:()=>mh,$ZodURL:()=>sh,$ZodUUID:()=>ah,$ZodUndefined:()=>Rh,$ZodUnion:()=>xi,$ZodUnknown:()=>zh,$ZodVoid:()=>Dh,$ZodXID:()=>ph,$ZodXor:()=>Gh,$brand:()=>Bm,$constructor:()=>E,$input:()=>vf,$output:()=>wf,Doc:()=>ki,JSONSchema:()=>O0,JSONSchemaGenerator:()=>Pl,NEVER:()=>Gm,TimePrecision:()=>Sf,_any:()=>Wf,_array:()=>Xf,_base64:()=>wl,_base64url:()=>vl,_bigint:()=>Df,_boolean:()=>zf,_catch:()=>Jz,_check:()=>A0,_cidrv4:()=>yl,_cidrv6:()=>bl,_coercedBigint:()=>Mf,_coercedBoolean:()=>jf,_coercedDate:()=>Zf,_coercedNumber:()=>If,_coercedString:()=>_f,_cuid:()=>dl,_cuid2:()=>ul,_custom:()=>eg,_date:()=>Kf,_decode:()=>Ic,_decodeAsync:()=>Pc,_default:()=>Vz,_discriminatedUnion:()=>zz,_e164:()=>kl,_email:()=>ol,_emoji:()=>cl,_encode:()=>Cc,_encodeAsync:()=>Oc,_endsWith:()=>Kr,_enum:()=>Gz,_file:()=>Qf,_float32:()=>Pf,_float64:()=>Rf,_gt:()=>Sn,_gte:()=>Et,_guid:()=>Ai,_includes:()=>Yr,_int:()=>Of,_int32:()=>Nf,_int64:()=>Ff,_intersection:()=>jz,_ipv4:()=>fl,_ipv6:()=>gl,_isoDate:()=>Ef,_isoDateTime:()=>Tf,_isoDuration:()=>Af,_isoTime:()=>$f,_jwt:()=>_l,_ksuid:()=>hl,_lazy:()=>tj,_length:()=>nr,_literal:()=>qz,_lowercase:()=>Wr,_lt:()=>xn,_lte:()=>Mt,_mac:()=>xf,_map:()=>Fz,_max:()=>Mt,_maxLength:()=>tr,_maxSize:()=>yo,_mime:()=>Zr,_min:()=>Et,_minLength:()=>qn,_minSize:()=>Tn,_multipleOf:()=>go,_nan:()=>Jf,_nanoid:()=>ll,_nativeEnum:()=>Bz,_negative:()=>Sl,_never:()=>Yf,_nonnegative:()=>El,_nonoptional:()=>Kz,_nonpositive:()=>Tl,_normalize:()=>Jr,_null:()=>qf,_nullable:()=>Yz,_number:()=>Cf,_optional:()=>Hz,_overwrite:()=>rn,_parse:()=>Dr,_parseAsync:()=>Mr,_pipe:()=>Xz,_positive:()=>xl,_promise:()=>nj,_property:()=>$l,_readonly:()=>Qz,_record:()=>Mz,_refine:()=>tg,_regex:()=>qr,_safeDecode:()=>Nc,_safeDecodeAsync:()=>zc,_safeEncode:()=>Rc,_safeEncodeAsync:()=>Lc,_safeParse:()=>Fr,_safeParseAsync:()=>Ur,_set:()=>Uz,_size:()=>er,_slugify:()=>ta,_startsWith:()=>Vr,_string:()=>kf,_stringFormat:()=>na,_stringbool:()=>ag,_success:()=>Zz,_superRefine:()=>ng,_symbol:()=>Gf,_templateLiteral:()=>ej,_toLowerCase:()=>Qr,_toUpperCase:()=>ea,_transform:()=>Wz,_trim:()=>Xr,_tuple:()=>Dz,_uint32:()=>Lf,_uint64:()=>Uf,_ulid:()=>ml,_undefined:()=>Bf,_union:()=>Nz,_unknown:()=>Hf,_uppercase:()=>Hr,_url:()=>Ci,_uuid:()=>rl,_uuidv4:()=>al,_uuidv6:()=>il,_uuidv7:()=>sl,_void:()=>Vf,_xid:()=>pl,_xor:()=>Lz,clone:()=>St,config:()=>it,createStandardJSONSchemaMethod:()=>oa,createToJSONSchemaMethod:()=>ig,decode:()=>nL,decodeAsync:()=>rL,describe:()=>og,encode:()=>tL,encodeAsync:()=>oL,extractDefs:()=>wo,finalize:()=>vo,flattenError:()=>yi,formatError:()=>bi,globalConfig:()=>Ko,globalRegistry:()=>pt,initializeContext:()=>bo,isValidBase64:()=>Sh,isValidBase64URL:()=>Ax,isValidJWT:()=>Cx,locales:()=>Ei,meta:()=>rg,parse:()=>$c,parseAsync:()=>Ac,prettifyError:()=>np,process:()=>Be,regexes:()=>Dt,registry:()=>nl,safeDecode:()=>iL,safeDecodeAsync:()=>cL,safeEncode:()=>aL,safeEncodeAsync:()=>sL,safeParse:()=>rp,safeParseAsync:()=>ap,toDotPath:()=>sx,toJSONSchema:()=>Ol,treeifyError:()=>tp,util:()=>Q,version:()=>th});var Ft=_(()=>{Zo();ip();op();hf();Gc();nh();me();Mc();bf();$i();eh();C0();Ii();Oi();I0();P0()});var Rl={};_n(Rl,{endsWith:()=>Kr,gt:()=>Sn,gte:()=>Et,includes:()=>Yr,length:()=>nr,lowercase:()=>Wr,lt:()=>xn,lte:()=>Mt,maxLength:()=>tr,maxSize:()=>yo,mime:()=>Zr,minLength:()=>qn,minSize:()=>Tn,multipleOf:()=>go,negative:()=>Sl,nonnegative:()=>El,nonpositive:()=>Tl,normalize:()=>Jr,overwrite:()=>rn,positive:()=>xl,property:()=>$l,regex:()=>qr,size:()=>er,slugify:()=>ta,startsWith:()=>Vr,toLowerCase:()=>Qr,toUpperCase:()=>ea,trim:()=>Xr,uppercase:()=>Hr});var Nl=_(()=>{Ft()});var ra={};_n(ra,{ZodISODate:()=>zl,ZodISODateTime:()=>Ll,ZodISODuration:()=>Dl,ZodISOTime:()=>jl,date:()=>Wg,datetime:()=>qg,duration:()=>Yg,time:()=>Hg});function qg(e){return Tf(Ll,e)}function Wg(e){return Ef(zl,e)}function Hg(e){return $f(jl,e)}function Yg(e){return Af(Dl,e)}var Ll,zl,jl,Dl,Pi=_(()=>{Ft();Ni();Ll=E("ZodISODateTime",(e,t)=>{fh.init(e,t),Ye.init(e,t)});zl=E("ZodISODate",(e,t)=>{gh.init(e,t),Ye.init(e,t)});jl=E("ZodISOTime",(e,t)=>{yh.init(e,t),Ye.init(e,t)});Dl=E("ZodISODuration",(e,t)=>{bh.init(e,t),Ye.init(e,t)})});var R0,aj,Rt,Vg=_(()=>{Ft();Ft();me();R0=(e,t)=>{gi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>bi(e,o)},flatten:{value:o=>yi(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Lr,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Lr,2)}},isEmpty:{get(){return e.issues.length===0}}})},aj=E("ZodError",R0),Rt=E("ZodError",R0,{Parent:Error})});var Kg,Zg,Jg,Xg,Qg,ey,ty,ny,oy,ry,ay,iy,sy=_(()=>{Ft();Vg();Kg=Dr(Rt),Zg=Mr(Rt),Jg=Fr(Rt),Xg=Ur(Rt),Qg=Cc(Rt),ey=Ic(Rt),ty=Oc(Rt),ny=Pc(Rt),oy=Rc(Rt),ry=Nc(Rt),ay=Lc(Rt),iy=zc(Rt)});var Ri={};_n(Ri,{ZodAny:()=>fy,ZodArray:()=>wy,ZodBase64:()=>ed,ZodBase64URL:()=>td,ZodBigInt:()=>ua,ZodBigIntFormat:()=>rd,ZodBoolean:()=>da,ZodCIDRv4:()=>Xl,ZodCIDRv6:()=>Ql,ZodCUID:()=>Wl,ZodCUID2:()=>Hl,ZodCatch:()=>Uy,ZodCodec:()=>Hi,ZodCustom:()=>Yi,ZodCustomStringFormat:()=>ca,ZodDate:()=>Ui,ZodDefault:()=>Ly,ZodDiscriminatedUnion:()=>ky,ZodE164:()=>nd,ZodEmail:()=>Gl,ZodEmoji:()=>Bl,ZodEnum:()=>ia,ZodExactOptional:()=>Py,ZodFile:()=>Iy,ZodFunction:()=>Jy,ZodGUID:()=>zi,ZodIPv4:()=>Zl,ZodIPv6:()=>Jl,ZodIntersection:()=>_y,ZodJWT:()=>od,ZodKSUID:()=>Kl,ZodLazy:()=>Vy,ZodLiteral:()=>Cy,ZodMAC:()=>cy,ZodMap:()=>$y,ZodNaN:()=>By,ZodNanoID:()=>ql,ZodNever:()=>yy,ZodNonOptional:()=>dd,ZodNull:()=>py,ZodNullable:()=>Ny,ZodNumber:()=>la,ZodNumberFormat:()=>rr,ZodObject:()=>Bi,ZodOptional:()=>ld,ZodPipe:()=>Wi,ZodPrefault:()=>jy,ZodPreprocess:()=>qy,ZodPromise:()=>Zy,ZodReadonly:()=>Wy,ZodRecord:()=>aa,ZodSet:()=>Ay,ZodString:()=>sa,ZodStringFormat:()=>Ye,ZodSuccess:()=>Fy,ZodSymbol:()=>uy,ZodTemplateLiteral:()=>Yy,ZodTransform:()=>Oy,ZodTuple:()=>Sy,ZodType:()=>Ce,ZodULID:()=>Yl,ZodURL:()=>Fi,ZodUUID:()=>En,ZodUndefined:()=>my,ZodUnion:()=>qi,ZodUnknown:()=>gy,ZodVoid:()=>by,ZodXID:()=>Vl,ZodXor:()=>vy,_ZodString:()=>Ul,_default:()=>zy,_function:()=>UT,any:()=>bT,array:()=>Gi,base64:()=>tT,base64url:()=>nT,bigint:()=>pT,boolean:()=>dy,catch:()=>Gy,check:()=>GT,cidrv4:()=>Q0,cidrv6:()=>eT,codec:()=>jT,cuid:()=>W0,cuid2:()=>H0,custom:()=>BT,date:()=>vT,describe:()=>qT,discriminatedUnion:()=>ET,e164:()=>oT,email:()=>L0,emoji:()=>B0,enum:()=>sd,exactOptional:()=>Ry,file:()=>RT,float32:()=>lT,float64:()=>dT,function:()=>UT,guid:()=>z0,hash:()=>cT,hex:()=>sT,hostname:()=>iT,httpUrl:()=>G0,instanceof:()=>HT,int:()=>Ml,int32:()=>uT,int64:()=>hT,intersection:()=>xy,invertCodec:()=>DT,ipv4:()=>Z0,ipv6:()=>X0,json:()=>VT,jwt:()=>rT,keyof:()=>kT,ksuid:()=>K0,lazy:()=>Ky,literal:()=>PT,looseObject:()=>ST,looseRecord:()=>AT,mac:()=>J0,map:()=>CT,meta:()=>WT,nan:()=>zT,nanoid:()=>q0,nativeEnum:()=>OT,never:()=>ad,nonoptional:()=>My,null:()=>hy,nullable:()=>Di,nullish:()=>NT,number:()=>ly,object:()=>_T,optional:()=>ji,partialRecord:()=>$T,pipe:()=>Fl,prefault:()=>Dy,preprocess:()=>KT,promise:()=>FT,readonly:()=>Hy,record:()=>Ey,refine:()=>Xy,set:()=>IT,strictObject:()=>xT,string:()=>Li,stringFormat:()=>aT,stringbool:()=>YT,success:()=>LT,superRefine:()=>Qy,symbol:()=>gT,templateLiteral:()=>MT,transform:()=>cd,tuple:()=>Ty,uint32:()=>mT,uint64:()=>fT,ulid:()=>Y0,undefined:()=>yT,union:()=>id,unknown:()=>or,url:()=>U0,uuid:()=>j0,uuidv4:()=>D0,uuidv6:()=>M0,uuidv7:()=>F0,void:()=>wT,xid:()=>V0,xor:()=>TT});function Mi(e,t,o){let r=Object.getPrototypeOf(e),n=N0.get(r);if(n||(n=new Set,N0.set(r,n)),!n.has(t)){n.add(t);for(let a in o){let i=o[a];Object.defineProperty(r,a,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}function Li(e){return kf(sa,e)}function L0(e){return ol(Gl,e)}function z0(e){return Ai(zi,e)}function j0(e){return rl(En,e)}function D0(e){return al(En,e)}function M0(e){return il(En,e)}function F0(e){return sl(En,e)}function U0(e){return Ci(Fi,e)}function G0(e){return Ci(Fi,{protocol:Dt.httpProtocol,hostname:Dt.domain,...Q.normalizeParams(e)})}function B0(e){return cl(Bl,e)}function q0(e){return ll(ql,e)}function W0(e){return dl(Wl,e)}function H0(e){return ul(Hl,e)}function Y0(e){return ml(Yl,e)}function V0(e){return pl(Vl,e)}function K0(e){return hl(Kl,e)}function Z0(e){return fl(Zl,e)}function J0(e){return xf(cy,e)}function X0(e){return gl(Jl,e)}function Q0(e){return yl(Xl,e)}function eT(e){return bl(Ql,e)}function tT(e){return wl(ed,e)}function nT(e){return vl(td,e)}function oT(e){return kl(nd,e)}function rT(e){return _l(od,e)}function aT(e,t,o={}){return na(ca,e,t,o)}function iT(e){return na(ca,"hostname",Dt.hostname,e)}function sT(e){return na(ca,"hex",Dt.hex,e)}function cT(e,t){let o=t?.enc??"hex",r=`${e}_${o}`,n=Dt[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return na(ca,r,n,t)}function ly(e){return Cf(la,e)}function Ml(e){return Of(rr,e)}function lT(e){return Pf(rr,e)}function dT(e){return Rf(rr,e)}function uT(e){return Nf(rr,e)}function mT(e){return Lf(rr,e)}function dy(e){return zf(da,e)}function pT(e){return Df(ua,e)}function hT(e){return Ff(rd,e)}function fT(e){return Uf(rd,e)}function gT(e){return Gf(uy,e)}function yT(e){return Bf(my,e)}function hy(e){return qf(py,e)}function bT(){return Wf(fy)}function or(){return Hf(gy)}function ad(e){return Yf(yy,e)}function wT(e){return Vf(by,e)}function vT(e){return Kf(Ui,e)}function Gi(e,t){return Xf(wy,e,t)}function kT(e){let t=e._zod.def.shape;return sd(Object.keys(t))}function _T(e,t){let o={type:"object",shape:e??{},...Q.normalizeParams(t)};return new Bi(o)}function xT(e,t){return new Bi({type:"object",shape:e,catchall:ad(),...Q.normalizeParams(t)})}function ST(e,t){return new Bi({type:"object",shape:e,catchall:or(),...Q.normalizeParams(t)})}function id(e,t){return new qi({type:"union",options:e,...Q.normalizeParams(t)})}function TT(e,t){return new vy({type:"union",options:e,inclusive:!1,...Q.normalizeParams(t)})}function ET(e,t,o){return new ky({type:"union",options:t,discriminator:e,...Q.normalizeParams(o)})}function xy(e,t){return new _y({type:"intersection",left:e,right:t})}function Ty(e,t,o){let r=t instanceof Ee,n=r?o:t,a=r?t:null;return new Sy({type:"tuple",items:e,rest:a,...Q.normalizeParams(n)})}function Ey(e,t,o){return!t||!t._zod?new aa({type:"record",keyType:Li(),valueType:e,...Q.normalizeParams(t)}):new aa({type:"record",keyType:e,valueType:t,...Q.normalizeParams(o)})}function $T(e,t,o){let r=St(e);return r._zod.values=void 0,new aa({type:"record",keyType:r,valueType:t,...Q.normalizeParams(o)})}function AT(e,t,o){return new aa({type:"record",keyType:e,valueType:t,mode:"loose",...Q.normalizeParams(o)})}function CT(e,t,o){return new $y({type:"map",keyType:e,valueType:t,...Q.normalizeParams(o)})}function IT(e,t){return new Ay({type:"set",valueType:e,...Q.normalizeParams(t)})}function sd(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ia({type:"enum",entries:o,...Q.normalizeParams(t)})}function OT(e,t){return new ia({type:"enum",entries:e,...Q.normalizeParams(t)})}function PT(e,t){return new Cy({type:"literal",values:Array.isArray(e)?e:[e],...Q.normalizeParams(t)})}function RT(e){return Qf(Iy,e)}function cd(e){return new Oy({type:"transform",transform:e})}function ji(e){return new ld({type:"optional",innerType:e})}function Ry(e){return new Py({type:"optional",innerType:e})}function Di(e){return new Ny({type:"nullable",innerType:e})}function NT(e){return ji(Di(e))}function zy(e,t){return new Ly({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Q.shallowClone(t)}})}function Dy(e,t){return new jy({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Q.shallowClone(t)}})}function My(e,t){return new dd({type:"nonoptional",innerType:e,...Q.normalizeParams(t)})}function LT(e){return new Fy({type:"success",innerType:e})}function Gy(e,t){return new Uy({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function zT(e){return Jf(By,e)}function Fl(e,t){return new Wi({type:"pipe",in:e,out:t})}function jT(e,t,o){return new Hi({type:"pipe",in:e,out:t,transform:o.decode,reverseTransform:o.encode})}function DT(e){let t=e._zod.def;return new Hi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Hy(e){return new Wy({type:"readonly",innerType:e})}function MT(e,t){return new Yy({type:"template_literal",parts:e,...Q.normalizeParams(t)})}function Ky(e){return new Vy({type:"lazy",getter:e})}function FT(e){return new Zy({type:"promise",innerType:e})}function UT(e){return new Jy({type:"function",input:Array.isArray(e?.input)?Ty(e?.input):e?.input??Gi(or()),output:e?.output??or()})}function GT(e){let t=new Ze({check:"custom"});return t._zod.check=e,t}function BT(e,t){return eg(Yi,e??(()=>!0),t)}function Xy(e,t={}){return tg(Yi,e,t)}function Qy(e,t){return ng(e,t)}function HT(e,t={}){let o=new Yi({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Q.normalizeParams(t)});return o._zod.bag.Class=e,o._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:o,path:[...o._zod.def.path??[]]})},o}function VT(e){let t=Ky(()=>id([Li(e),ly(),dy(),hy(),Gi(t),Ey(Li(),t)]));return t}function KT(e,t){return new qy({type:"pipe",in:cd(e),out:t})}var N0,Ce,Ul,sa,Ye,Gl,zi,En,Fi,Bl,ql,Wl,Hl,Yl,Vl,Kl,Zl,cy,Jl,Xl,Ql,ed,td,nd,od,ca,la,rr,da,ua,rd,uy,my,py,fy,gy,yy,by,Ui,wy,Bi,qi,vy,ky,_y,Sy,aa,$y,Ay,ia,Cy,Iy,Oy,ld,Py,Ny,Ly,jy,dd,Fy,Uy,By,Wi,Hi,qy,Wy,Yy,Vy,Zy,Jy,Yi,qT,WT,YT,Ni=_(()=>{Ft();Ft();Oi();Ii();Nl();Pi();sy();N0=new WeakMap;Ce=E("ZodType",(e,t)=>(Ee.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oa(e,"input"),output:oa(e,"output")}}),e.toJSONSchema=ig(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,r)=>Kg(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>Jg(e,o,r),e.parseAsync=async(o,r)=>Zg(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Xg(e,o,r),e.spa=e.safeParseAsync,e.encode=(o,r)=>Qg(e,o,r),e.decode=(o,r)=>ey(e,o,r),e.encodeAsync=async(o,r)=>ty(e,o,r),e.decodeAsync=async(o,r)=>ny(e,o,r),e.safeEncode=(o,r)=>oy(e,o,r),e.safeDecode=(o,r)=>ry(e,o,r),e.safeEncodeAsync=async(o,r)=>ay(e,o,r),e.safeDecodeAsync=async(o,r)=>iy(e,o,r),Mi(e,"ZodType",{check(...o){let r=this.def;return this.clone(Q.mergeDefs(r,{checks:[...r.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,r){return St(this,o,r)},brand(){return this},register(o,r){return o.add(this,r),this},refine(o,r){return this.check(Xy(o,r))},superRefine(o,r){return this.check(Qy(o,r))},overwrite(o){return this.check(rn(o))},optional(){return ji(this)},exactOptional(){return Ry(this)},nullable(){return Di(this)},nullish(){return ji(Di(this))},nonoptional(o){return My(this,o)},array(){return Gi(this)},or(o){return id([this,o])},and(o){return xy(this,o)},transform(o){return Fl(this,cd(o))},default(o){return zy(this,o)},prefault(o){return Dy(this,o)},catch(o){return Gy(this,o)},pipe(o){return Fl(this,o)},readonly(){return Hy(this)},describe(o){let r=this.clone();return pt.add(r,{description:o}),r},meta(...o){if(o.length===0)return pt.get(this);let r=this.clone();return pt.add(r,o[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return pt.get(e)?.description},configurable:!0}),e)),Ul=E("_ZodString",(e,t)=>{Qo.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>sg(e,r,n,a);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Mi(e,"_ZodString",{regex(...r){return this.check(qr(...r))},includes(...r){return this.check(Yr(...r))},startsWith(...r){return this.check(Vr(...r))},endsWith(...r){return this.check(Kr(...r))},min(...r){return this.check(qn(...r))},max(...r){return this.check(tr(...r))},length(...r){return this.check(nr(...r))},nonempty(...r){return this.check(qn(1,...r))},lowercase(r){return this.check(Wr(r))},uppercase(r){return this.check(Hr(r))},trim(){return this.check(Xr())},normalize(...r){return this.check(Jr(...r))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check(ea())},slugify(){return this.check(ta())}})}),sa=E("ZodString",(e,t)=>{Qo.init(e,t),Ul.init(e,t),e.email=o=>e.check(ol(Gl,o)),e.url=o=>e.check(Ci(Fi,o)),e.jwt=o=>e.check(_l(od,o)),e.emoji=o=>e.check(cl(Bl,o)),e.guid=o=>e.check(Ai(zi,o)),e.uuid=o=>e.check(rl(En,o)),e.uuidv4=o=>e.check(al(En,o)),e.uuidv6=o=>e.check(il(En,o)),e.uuidv7=o=>e.check(sl(En,o)),e.nanoid=o=>e.check(ll(ql,o)),e.guid=o=>e.check(Ai(zi,o)),e.cuid=o=>e.check(dl(Wl,o)),e.cuid2=o=>e.check(ul(Hl,o)),e.ulid=o=>e.check(ml(Yl,o)),e.base64=o=>e.check(wl(ed,o)),e.base64url=o=>e.check(vl(td,o)),e.xid=o=>e.check(pl(Vl,o)),e.ksuid=o=>e.check(hl(Kl,o)),e.ipv4=o=>e.check(fl(Zl,o)),e.ipv6=o=>e.check(gl(Jl,o)),e.cidrv4=o=>e.check(yl(Xl,o)),e.cidrv6=o=>e.check(bl(Ql,o)),e.e164=o=>e.check(kl(nd,o)),e.datetime=o=>e.check(qg(o)),e.date=o=>e.check(Wg(o)),e.time=o=>e.check(Hg(o)),e.duration=o=>e.check(Yg(o))});Ye=E("ZodStringFormat",(e,t)=>{He.init(e,t),Ul.init(e,t)}),Gl=E("ZodEmail",(e,t)=>{ih.init(e,t),Ye.init(e,t)});zi=E("ZodGUID",(e,t)=>{rh.init(e,t),Ye.init(e,t)});En=E("ZodUUID",(e,t)=>{ah.init(e,t),Ye.init(e,t)});Fi=E("ZodURL",(e,t)=>{sh.init(e,t),Ye.init(e,t)});Bl=E("ZodEmoji",(e,t)=>{ch.init(e,t),Ye.init(e,t)});ql=E("ZodNanoID",(e,t)=>{lh.init(e,t),Ye.init(e,t)});Wl=E("ZodCUID",(e,t)=>{dh.init(e,t),Ye.init(e,t)});Hl=E("ZodCUID2",(e,t)=>{uh.init(e,t),Ye.init(e,t)});Yl=E("ZodULID",(e,t)=>{mh.init(e,t),Ye.init(e,t)});Vl=E("ZodXID",(e,t)=>{ph.init(e,t),Ye.init(e,t)});Kl=E("ZodKSUID",(e,t)=>{hh.init(e,t),Ye.init(e,t)});Zl=E("ZodIPv4",(e,t)=>{wh.init(e,t),Ye.init(e,t)});cy=E("ZodMAC",(e,t)=>{kh.init(e,t),Ye.init(e,t)});Jl=E("ZodIPv6",(e,t)=>{vh.init(e,t),Ye.init(e,t)});Xl=E("ZodCIDRv4",(e,t)=>{_h.init(e,t),Ye.init(e,t)});Ql=E("ZodCIDRv6",(e,t)=>{xh.init(e,t),Ye.init(e,t)});ed=E("ZodBase64",(e,t)=>{Th.init(e,t),Ye.init(e,t)});td=E("ZodBase64URL",(e,t)=>{Eh.init(e,t),Ye.init(e,t)});nd=E("ZodE164",(e,t)=>{$h.init(e,t),Ye.init(e,t)});od=E("ZodJWT",(e,t)=>{Ah.init(e,t),Ye.init(e,t)});ca=E("ZodCustomStringFormat",(e,t)=>{Ch.init(e,t),Ye.init(e,t)});la=E("ZodNumber",(e,t)=>{Yc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>cg(e,r,n,a),Mi(e,"ZodNumber",{gt(r,n){return this.check(Sn(r,n))},gte(r,n){return this.check(Et(r,n))},min(r,n){return this.check(Et(r,n))},lt(r,n){return this.check(xn(r,n))},lte(r,n){return this.check(Mt(r,n))},max(r,n){return this.check(Mt(r,n))},int(r){return this.check(Ml(r))},safe(r){return this.check(Ml(r))},positive(r){return this.check(Sn(0,r))},nonnegative(r){return this.check(Et(0,r))},negative(r){return this.check(xn(0,r))},nonpositive(r){return this.check(Mt(0,r))},multipleOf(r,n){return this.check(go(r,n))},step(r,n){return this.check(go(r,n))},finite(){return this}});let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});rr=E("ZodNumberFormat",(e,t)=>{Ih.init(e,t),la.init(e,t)});da=E("ZodBoolean",(e,t)=>{_i.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>lg(e,o,r,n)});ua=E("ZodBigInt",(e,t)=>{Vc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>dg(e,r,n,a),e.gte=(r,n)=>e.check(Et(r,n)),e.min=(r,n)=>e.check(Et(r,n)),e.gt=(r,n)=>e.check(Sn(r,n)),e.gte=(r,n)=>e.check(Et(r,n)),e.min=(r,n)=>e.check(Et(r,n)),e.lt=(r,n)=>e.check(xn(r,n)),e.lte=(r,n)=>e.check(Mt(r,n)),e.max=(r,n)=>e.check(Mt(r,n)),e.positive=r=>e.check(Sn(BigInt(0),r)),e.negative=r=>e.check(xn(BigInt(0),r)),e.nonpositive=r=>e.check(Mt(BigInt(0),r)),e.nonnegative=r=>e.check(Et(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(go(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});rd=E("ZodBigIntFormat",(e,t)=>{Oh.init(e,t),ua.init(e,t)});uy=E("ZodSymbol",(e,t)=>{Ph.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>ug(e,o,r,n)});my=E("ZodUndefined",(e,t)=>{Rh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>pg(e,o,r,n)});py=E("ZodNull",(e,t)=>{Nh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>mg(e,o,r,n)});fy=E("ZodAny",(e,t)=>{Lh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>gg(e,o,r,n)});gy=E("ZodUnknown",(e,t)=>{zh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>yg(e,o,r,n)});yy=E("ZodNever",(e,t)=>{jh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>fg(e,o,r,n)});by=E("ZodVoid",(e,t)=>{Dh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>hg(e,o,r,n)});Ui=E("ZodDate",(e,t)=>{Mh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>bg(e,r,n,a),e.min=(r,n)=>e.check(Et(r,n)),e.max=(r,n)=>e.check(Mt(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});wy=E("ZodArray",(e,t)=>{Fh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ig(e,o,r,n),e.element=t.element,Mi(e,"ZodArray",{min(o,r){return this.check(qn(o,r))},nonempty(o){return this.check(qn(1,o))},max(o,r){return this.check(tr(o,r))},length(o,r){return this.check(nr(o,r))},unwrap(){return this.element}})});Bi=E("ZodObject",(e,t)=>{Uh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Og(e,o,r,n),Q.defineLazy(e,"shape",()=>t.shape),Mi(e,"ZodObject",{keyof(){return sd(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:or()})},loose(){return this.clone({...this._zod.def,catchall:or()})},strict(){return this.clone({...this._zod.def,catchall:ad()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return Q.extend(this,o)},safeExtend(o){return Q.safeExtend(this,o)},merge(o){return Q.merge(this,o)},pick(o){return Q.pick(this,o)},omit(o){return Q.omit(this,o)},partial(...o){return Q.partial(ld,this,o[0])},required(...o){return Q.required(dd,this,o[0])}})});qi=E("ZodUnion",(e,t)=>{xi.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cl(e,o,r,n),e.options=t.options});vy=E("ZodXor",(e,t)=>{qi.init(e,t),Gh.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cl(e,o,r,n),e.options=t.options});ky=E("ZodDiscriminatedUnion",(e,t)=>{qi.init(e,t),Bh.init(e,t)});_y=E("ZodIntersection",(e,t)=>{qh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Pg(e,o,r,n)});Sy=E("ZodTuple",(e,t)=>{Kc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Rg(e,o,r,n),e.rest=o=>e.clone({...e._zod.def,rest:o})});aa=E("ZodRecord",(e,t)=>{Wh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ng(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType});$y=E("ZodMap",(e,t)=>{Hh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ag(e,o,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...o)=>e.check(Tn(...o)),e.nonempty=o=>e.check(Tn(1,o)),e.max=(...o)=>e.check(yo(...o)),e.size=(...o)=>e.check(er(...o))});Ay=E("ZodSet",(e,t)=>{Yh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Cg(e,o,r,n),e.min=(...o)=>e.check(Tn(...o)),e.nonempty=o=>e.check(Tn(1,o)),e.max=(...o)=>e.check(yo(...o)),e.size=(...o)=>e.check(er(...o))});ia=E("ZodEnum",(e,t)=>{Vh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(r,n,a)=>wg(e,r,n,a),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let a={};for(let i of r)if(o.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ia({...t,checks:[],...Q.normalizeParams(n),entries:a})},e.exclude=(r,n)=>{let a={...t.entries};for(let i of r)if(o.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new ia({...t,checks:[],...Q.normalizeParams(n),entries:a})}});Cy=E("ZodLiteral",(e,t)=>{Kh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>vg(e,o,r,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]}})});Iy=E("ZodFile",(e,t)=>{Zh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>xg(e,o,r,n),e.min=(o,r)=>e.check(Tn(o,r)),e.max=(o,r)=>e.check(yo(o,r)),e.mime=(o,r)=>e.check(Zr(Array.isArray(o)?o:[o],r))});Oy=E("ZodTransform",(e,t)=>{Jh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>$g(e,o,r,n),e._zod.parse=(o,r)=>{if(r.direction==="backward")throw new uo(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Q.issue(a,o.value,t));else{let i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),o.issues.push(Q.issue(i))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(a=>(o.value=a,o.fallback=!0,o)):(o.value=n,o.fallback=!0,o)}});ld=E("ZodOptional",(e,t)=>{Zc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Il(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Py=E("ZodExactOptional",(e,t)=>{Xh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Il(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Ny=E("ZodNullable",(e,t)=>{Qh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Lg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Ly=E("ZodDefault",(e,t)=>{ef.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>jg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});jy=E("ZodPrefault",(e,t)=>{tf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Dg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});dd=E("ZodNonOptional",(e,t)=>{nf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>zg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Fy=E("ZodSuccess",(e,t)=>{of.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Sg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Uy=E("ZodCatch",(e,t)=>{rf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Mg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});By=E("ZodNaN",(e,t)=>{af.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>kg(e,o,r,n)});Wi=E("ZodPipe",(e,t)=>{Jc.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Fg(e,o,r,n),e.in=t.in,e.out=t.out});Hi=E("ZodCodec",(e,t)=>{Wi.init(e,t),Si.init(e,t)});qy=E("ZodPreprocess",(e,t)=>{Wi.init(e,t),sf.init(e,t)}),Wy=E("ZodReadonly",(e,t)=>{cf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Ug(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Yy=E("ZodTemplateLiteral",(e,t)=>{lf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>_g(e,o,r,n)});Vy=E("ZodLazy",(e,t)=>{mf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Bg(e,o,r,n),e.unwrap=()=>e._zod.def.getter()});Zy=E("ZodPromise",(e,t)=>{uf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Gg(e,o,r,n),e.unwrap=()=>e._zod.def.innerType});Jy=E("ZodFunction",(e,t)=>{df.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Eg(e,o,r,n)});Yi=E("ZodCustom",(e,t)=>{pf.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,n)=>Tg(e,o,r,n)});qT=og,WT=rg;YT=(...e)=>ag({Codec:Hi,Boolean:da,String:sa},...e)});function cj(e){it({customError:e})}function lj(){return it().customError}var sj,eb,ZT=_(()=>{Ft();sj={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"};eb||(eb={})});function uj(e,t){let o=e.$schema;return o==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":o==="http://json-schema.org/draft-07/schema#"?"draft-7":o==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function mj(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let o=e.slice(1).split("/").filter(Boolean);if(o.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(o[0]===r){let n=o[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 JT(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return le.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 le.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let a=mj(n,t),i=vt(a,t);return t.refs.set(n,i),t.processing.delete(n),i}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 le.null();if(n.length===0)return le.never();if(n.length===1)return le.literal(n[0]);if(n.every(i=>typeof i=="string"))return le.enum(n);let a=n.map(i=>le.literal(i));return a.length<2?a[0]:le.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return le.literal(e.const);let o=e.type;if(Array.isArray(o)){let n=o.map(a=>{let i={...e,type:a};return JT(i,t)});return n.length===0?le.never():n.length===1?n[0]:le.union(n)}if(!o)return le.any();let r;switch(o){case"string":{let n=le.string();if(e.format){let a=e.format;a==="email"?n=n.check(le.email()):a==="uri"||a==="uri-reference"?n=n.check(le.url()):a==="uuid"||a==="guid"?n=n.check(le.uuid()):a==="date-time"?n=n.check(le.iso.datetime()):a==="date"?n=n.check(le.iso.date()):a==="time"?n=n.check(le.iso.time()):a==="duration"?n=n.check(le.iso.duration()):a==="ipv4"?n=n.check(le.ipv4()):a==="ipv6"?n=n.check(le.ipv6()):a==="mac"?n=n.check(le.mac()):a==="cidr"?n=n.check(le.cidrv4()):a==="cidr-v6"?n=n.check(le.cidrv6()):a==="base64"?n=n.check(le.base64()):a==="base64url"?n=n.check(le.base64url()):a==="e164"?n=n.check(le.e164()):a==="jwt"?n=n.check(le.jwt()):a==="emoji"?n=n.check(le.emoji()):a==="nanoid"?n=n.check(le.nanoid()):a==="cuid"?n=n.check(le.cuid()):a==="cuid2"?n=n.check(le.cuid2()):a==="ulid"?n=n.check(le.ulid()):a==="xid"?n=n.check(le.xid()):a==="ksuid"&&(n=n.check(le.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))),r=n;break}case"number":case"integer":{let n=o==="integer"?le.number().int():le.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)),r=n;break}case"boolean":{r=le.boolean();break}case"null":{r=le.null();break}case"object":{let n={},a=e.properties||{},i=new Set(e.required||[]);for(let[d,l]of Object.entries(a)){let u=vt(l,t);n[d]=i.has(d)?u:u.optional()}if(e.propertyNames){let d=vt(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?vt(e.additionalProperties,t):le.any();if(Object.keys(n).length===0){r=le.record(d,l);break}let u=le.object(n).passthrough(),p=le.looseRecord(d,l);r=le.intersection(u,p);break}if(e.patternProperties){let d=e.patternProperties,l=Object.keys(d),u=[];for(let f of l){let g=vt(d[f],t),b=le.string().regex(new RegExp(f));u.push(le.looseRecord(b,g))}let p=[];if(Object.keys(n).length>0&&p.push(le.object(n).passthrough()),p.push(...u),p.length===0)r=le.object({}).passthrough();else if(p.length===1)r=p[0];else{let f=le.intersection(p[0],p[1]);for(let g=2;g<p.length;g++)f=le.intersection(f,p[g]);r=f}break}let c=le.object(n);e.additionalProperties===!1?r=c.strict():typeof e.additionalProperties=="object"?r=c.catchall(vt(e.additionalProperties,t)):r=c.passthrough();break}case"array":{let n=e.prefixItems,a=e.items;if(n&&Array.isArray(n)){let i=n.map(d=>vt(d,t)),c=a&&typeof a=="object"&&!Array.isArray(a)?vt(a,t):void 0;c?r=le.tuple(i).rest(c):r=le.tuple(i),typeof e.minItems=="number"&&(r=r.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(le.maxLength(e.maxItems)))}else if(Array.isArray(a)){let i=a.map(d=>vt(d,t)),c=e.additionalItems&&typeof e.additionalItems=="object"?vt(e.additionalItems,t):void 0;c?r=le.tuple(i).rest(c):r=le.tuple(i),typeof e.minItems=="number"&&(r=r.check(le.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(le.maxLength(e.maxItems)))}else if(a!==void 0){let i=vt(a,t),c=le.array(i);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),r=c}else r=le.array(le.any());break}default:throw new Error(`Unsupported type: ${o}`)}return r}function vt(e,t){if(typeof e=="boolean")return e?le.any():le.never();let o=JT(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>vt(l,t)),d=le.union(c);o=r?le.intersection(o,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>vt(l,t)),d=le.xor(c);o=r?le.intersection(o,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)o=r?o:le.any();else{let c=r?o:vt(e.allOf[0],t),d=r?0:1;for(let l=d;l<e.allOf.length;l++)c=le.intersection(c,vt(e.allOf[l],t));o=c}e.nullable===!0&&t.version==="openapi-3.0"&&(o=le.nullable(o)),e.readOnly===!0&&(o=le.readonly(o)),e.default!==void 0&&(o=o.default(e.default));let n={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of a)c in e&&(n[c]=e[c]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let c of i)c in e&&(n[c]=e[c]);for(let c of Object.keys(e))dj.has(c)||(n[c]=e[c]);return Object.keys(n).length>0&&t.registry.add(o,n),e.description&&(o=o.describe(e.description)),o}function XT(e,t){if(typeof e=="boolean")return e?le.any():le.never();let o;try{o=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=uj(o,t?.defaultTarget),n=o.$defs||o.definitions||{},a={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:o,registry:t?.registry??pt};return vt(o,a)}var le,dj,QT=_(()=>{$i();Nl();Pi();Ni();le={...Ri,...Rl,iso:ra},dj=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 tb={};_n(tb,{bigint:()=>gj,boolean:()=>fj,date:()=>yj,number:()=>hj,string:()=>pj});function pj(e){return _f(sa,e)}function hj(e){return If(la,e)}function fj(e){return jf(da,e)}function gj(e){return Mf(ua,e)}function yj(e){return Zf(Ui,e)}var eE=_(()=>{Ft();Ni()});var s={};_n(s,{$brand:()=>Bm,$input:()=>vf,$output:()=>wf,NEVER:()=>Gm,TimePrecision:()=>Sf,ZodAny:()=>fy,ZodArray:()=>wy,ZodBase64:()=>ed,ZodBase64URL:()=>td,ZodBigInt:()=>ua,ZodBigIntFormat:()=>rd,ZodBoolean:()=>da,ZodCIDRv4:()=>Xl,ZodCIDRv6:()=>Ql,ZodCUID:()=>Wl,ZodCUID2:()=>Hl,ZodCatch:()=>Uy,ZodCodec:()=>Hi,ZodCustom:()=>Yi,ZodCustomStringFormat:()=>ca,ZodDate:()=>Ui,ZodDefault:()=>Ly,ZodDiscriminatedUnion:()=>ky,ZodE164:()=>nd,ZodEmail:()=>Gl,ZodEmoji:()=>Bl,ZodEnum:()=>ia,ZodError:()=>aj,ZodExactOptional:()=>Py,ZodFile:()=>Iy,ZodFirstPartyTypeKind:()=>eb,ZodFunction:()=>Jy,ZodGUID:()=>zi,ZodIPv4:()=>Zl,ZodIPv6:()=>Jl,ZodISODate:()=>zl,ZodISODateTime:()=>Ll,ZodISODuration:()=>Dl,ZodISOTime:()=>jl,ZodIntersection:()=>_y,ZodIssueCode:()=>sj,ZodJWT:()=>od,ZodKSUID:()=>Kl,ZodLazy:()=>Vy,ZodLiteral:()=>Cy,ZodMAC:()=>cy,ZodMap:()=>$y,ZodNaN:()=>By,ZodNanoID:()=>ql,ZodNever:()=>yy,ZodNonOptional:()=>dd,ZodNull:()=>py,ZodNullable:()=>Ny,ZodNumber:()=>la,ZodNumberFormat:()=>rr,ZodObject:()=>Bi,ZodOptional:()=>ld,ZodPipe:()=>Wi,ZodPrefault:()=>jy,ZodPreprocess:()=>qy,ZodPromise:()=>Zy,ZodReadonly:()=>Wy,ZodRealError:()=>Rt,ZodRecord:()=>aa,ZodSet:()=>Ay,ZodString:()=>sa,ZodStringFormat:()=>Ye,ZodSuccess:()=>Fy,ZodSymbol:()=>uy,ZodTemplateLiteral:()=>Yy,ZodTransform:()=>Oy,ZodTuple:()=>Sy,ZodType:()=>Ce,ZodULID:()=>Yl,ZodURL:()=>Fi,ZodUUID:()=>En,ZodUndefined:()=>my,ZodUnion:()=>qi,ZodUnknown:()=>gy,ZodVoid:()=>by,ZodXID:()=>Vl,ZodXor:()=>vy,_ZodString:()=>Ul,_default:()=>zy,_function:()=>UT,any:()=>bT,array:()=>Gi,base64:()=>tT,base64url:()=>nT,bigint:()=>pT,boolean:()=>dy,catch:()=>Gy,check:()=>GT,cidrv4:()=>Q0,cidrv6:()=>eT,clone:()=>St,codec:()=>jT,coerce:()=>tb,config:()=>it,core:()=>Wn,cuid:()=>W0,cuid2:()=>H0,custom:()=>BT,date:()=>vT,decode:()=>ey,decodeAsync:()=>ny,describe:()=>qT,discriminatedUnion:()=>ET,e164:()=>oT,email:()=>L0,emoji:()=>B0,encode:()=>Qg,encodeAsync:()=>ty,endsWith:()=>Kr,enum:()=>sd,exactOptional:()=>Ry,file:()=>RT,flattenError:()=>yi,float32:()=>lT,float64:()=>dT,formatError:()=>bi,fromJSONSchema:()=>XT,function:()=>UT,getErrorMap:()=>lj,globalRegistry:()=>pt,gt:()=>Sn,gte:()=>Et,guid:()=>z0,hash:()=>cT,hex:()=>sT,hostname:()=>iT,httpUrl:()=>G0,includes:()=>Yr,instanceof:()=>HT,int:()=>Ml,int32:()=>uT,int64:()=>hT,intersection:()=>xy,invertCodec:()=>DT,ipv4:()=>Z0,ipv6:()=>X0,iso:()=>ra,json:()=>VT,jwt:()=>rT,keyof:()=>kT,ksuid:()=>K0,lazy:()=>Ky,length:()=>nr,literal:()=>PT,locales:()=>Ei,looseObject:()=>ST,looseRecord:()=>AT,lowercase:()=>Wr,lt:()=>xn,lte:()=>Mt,mac:()=>J0,map:()=>CT,maxLength:()=>tr,maxSize:()=>yo,meta:()=>WT,mime:()=>Zr,minLength:()=>qn,minSize:()=>Tn,multipleOf:()=>go,nan:()=>zT,nanoid:()=>q0,nativeEnum:()=>OT,negative:()=>Sl,never:()=>ad,nonnegative:()=>El,nonoptional:()=>My,nonpositive:()=>Tl,normalize:()=>Jr,null:()=>hy,nullable:()=>Di,nullish:()=>NT,number:()=>ly,object:()=>_T,optional:()=>ji,overwrite:()=>rn,parse:()=>Kg,parseAsync:()=>Zg,partialRecord:()=>$T,pipe:()=>Fl,positive:()=>xl,prefault:()=>Dy,preprocess:()=>KT,prettifyError:()=>np,promise:()=>FT,property:()=>$l,readonly:()=>Hy,record:()=>Ey,refine:()=>Xy,regex:()=>qr,regexes:()=>Dt,registry:()=>nl,safeDecode:()=>ry,safeDecodeAsync:()=>iy,safeEncode:()=>oy,safeEncodeAsync:()=>ay,safeParse:()=>Jg,safeParseAsync:()=>Xg,set:()=>IT,setErrorMap:()=>cj,size:()=>er,slugify:()=>ta,startsWith:()=>Vr,strictObject:()=>xT,string:()=>Li,stringFormat:()=>aT,stringbool:()=>YT,success:()=>LT,superRefine:()=>Qy,symbol:()=>gT,templateLiteral:()=>MT,toJSONSchema:()=>Ol,toLowerCase:()=>Qr,toUpperCase:()=>ea,transform:()=>cd,treeifyError:()=>tp,trim:()=>Xr,tuple:()=>Ty,uint32:()=>mT,uint64:()=>fT,ulid:()=>Y0,undefined:()=>yT,union:()=>id,unknown:()=>or,uppercase:()=>Hr,url:()=>U0,util:()=>Q,uuid:()=>j0,uuidv4:()=>D0,uuidv6:()=>M0,uuidv7:()=>F0,void:()=>wT,xid:()=>V0,xor:()=>TT});var nb=_(()=>{Ft();Ni();Nl();Vg();sy();ZT();Ft();ff();Ft();Oi();QT();bf();Pi();Pi();eE();it(Xc())});var je=_(()=>{nb();nb()});var ob=_(()=>{"use strict";je();s.config(s.locales.en())});function pa(e,t={}){let o=e?.trim()||ma;return t.lower&&!/[A-Z]/.test(o.slice(1))&&(o=o.toLowerCase()),t.plural?bj(o):o}function bj(e){let t=/([A-Za-z]+)$/.exec(e);if(!t)return`${e}s`;let o=t[1],r=e.slice(0,e.length-o.length),n=o.length>1&&o===o.toUpperCase(),a=o.toLowerCase(),i=c=>n?c.toUpperCase():c;return/[^aeiou]y$/.test(a)?r+o.slice(0,-1)+i("ies"):/(^|[^aeiou]|qu)[aeiou]z$/.test(a)&&!/zz$/.test(a)?r+o+i("zes"):/(s|x|z|ch|sh)$/.test(a)?r+o+i("es"):r+o+i("s")}var ma,Vi=_(()=>{"use strict";ma="Round"});var ud=_(()=>{"use strict"});var md,Ki=_(()=>{"use strict";md=["consent_brand_name","privacy_policy_url"]});var tE=_(()=>{"use strict";Ki()});function fd(e){return e?!wj.includes(De(e)):!0}function De(e){return vj[e]??e}function nE(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if(typeof t.archetype!="string")return e;let o=De(t.archetype);return o===t.archetype?e:{...t,archetype:o}}var Yt,pd,hd,wj,vj,rb,Zi,oE,ko,Vt=_(()=>{"use strict";Yt=["hunt","push","group","predict","bingo","shoot","place","mystery","arcade"],pd={mystery:"@proxima/deduction-engine",arcade:"@proxima/arcade-engine"},hd=Object.keys(pd),wj=["arcade"];vj={target_selection:"hunt",target_total:"push",puzzle:"group",prediction:"predict",forecast:"predict"};rb={hunt:"gamestage-target-selection-element",push:"gamestage-target-total-element",group:"gamestage-puzzle-element",predict:"gamestage-prediction-element",bingo:"gamestage-bingo-element",shoot:"gamestage-shoot-element",place:"gamestage-place-element",mystery:"gamestage-mystery-element",arcade:"gamestage-arcade-element"},Zi={scoreline:{contentType:"gamestage-scoreline-element",name:"Scoreline"},number:{contentType:"gamestage-number-element",name:"Number question"}},oE={hunt:"Find the answer",push:"Under the limit",group:"Puzzle",predict:"Prediction",bingo:"Bingo",shoot:"Penalties",place:"Place the Face",mystery:"Mystery",arcade:"Arcade"},ko={hunt:{name:"Search",short:"Search",japanese:"\u63A2\u7D22"},push:{name:"Push Your Luck",short:"Push",japanese:"\u904B\u8A66\u3057"},group:{name:"Find the Groups",short:"Groups",japanese:"\u5171\u901A\u70B9\u63A2\u3057"},predict:{name:"Predict",short:"Predict",japanese:"\u4E88\u60F3"},bingo:{name:"Bingo",short:"Bingo",japanese:"\u30D3\u30F3\u30B4"},shoot:{name:"Kicker",short:"Kicker",japanese:"\u30AD\u30C3\u30AB\u30FC"},place:{name:"Place the Face",short:"Place",japanese:"Place the Face"},mystery:{name:"Mystery",short:"Mystery",japanese:"Mystery"},arcade:{name:"Arcade",short:"Arcade",japanese:"\u30A2\u30FC\u30B1\u30FC\u30C9"}}});function xj(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Sj(e){let{name:t,japanese:o}=ko[e];return o===t?"":o}var kj,_j,IH,rE=_(()=>{"use strict";Vt();kj="https://typesafe.ai/blog/introducing-system-one-models-and-jev",_j=[["predict",{when:"Before an event",group:"live",one:"Users predict what will happen and get points for correctness.",ideas:"Call the winners on awards night, locked when the event starts.",prompt:"Make a Prediction game with Gamestage. Call the winners on awards night, locked when the event starts.",game:"Answer one or more questions before the event. Scores arrive with the result.",settings:"The questions, options and points, and how close a number has to be. You enter the result in Monterosa Studio when it's known.",limits:"For now, scores are issued when all the questions have results. Calls can't be changed."}],["bingo",{when:"During an event",group:"live",one:"Your own card of moments, checked off as they happen.",ideas:"Buzzword bingo: a driver's favourite phrases during the race.",prompt:"Make a Bingo game with Gamestage. Buzzword bingo: a driver's favourite phrases during the race.",game:"Choose a board, lock it in, and watch it fill as the items happen.",settings:'The pool of "moments", board size, re-deals and points per line. Someone marks each moment in Monterosa Studio.',limits:"A board can't change once it's locked."}],["hunt",{when:"Any time",group:"know",one:"Find the right answers on a board.",ideas:"Find the five songs that hit #1 in 2000, from a board of twenty.",prompt:"Make a Search game with Gamestage. Find the five songs that reached number one in 2000, from a board of twenty.",game:"Pick from a board. Each pick is marked right or wrong, and wrong picks cost you an attempt.",settings:"The board, the right answers (kept hidden), how many to find and how many attempts.",limits:"For now, everyone gets the same board, and the answers can't change mid-game."}],["push",{when:"Any time",group:"know",one:"Get as close to a target as you dare, without going over.",ideas:"Box Office: pick films to reach $3bn in takings without going over.",game:"Pick one at a time and watch your total climb. Stop before you pass the target.",settings:"The target, the picks, and a hidden number on each pick.",limits:"For now, everyone gets the same picks, and it isn't built for live events."}],["group",{when:"Any time",group:"know",one:"Sort a board into hidden groupings.",ideas:"TV Show Characters: 16 characters from a show and the four things they have in common.",game:"Choose a set of items and submit it. You're given right, wrong or one away.",settings:"The board, the hidden groups and their names, and how many guesses.",limits:"For now, an item can only belong to one group."}],["place",{when:"Any time",group:"know",one:"Drop each card on a category it fits.",ideas:"Film Facts: drop each film on the right box, such as won an Oscar, over three hours or a sequel.",game:"Take each card and drop it on a category it fits. A wrong drop costs you a life.",settings:"The categories, the cards, which card fits where (kept hidden), lives and passes.",limits:"For now, there's no starter template."}],["mystery",{when:"Special order",group:"know",soon:!0,poweredBy:{name:"Jev",href:kj},one:"Find one hidden person by asking yes-or-no questions.",ideas:"Mystery Musician: guess the hidden artist from a list of 500.",game:"Ask yes-or-no questions in your own words until hundreds of people narrow to one.",settings:"The answer, two clues, the difficulty, and a dataset of people.",limits:"For now, the answer is always a person."}],["shoot",{when:"Any time",group:"play",one:"Shoot past a keeper, or kick at the posts.",ideas:"Shoot-out: five penalties past a keeper, or a rugby conversion challenge from further out each kick.",game:"Aim, pick a power and kick. A replay shows each kick go in, get saved, or go over or wide.",settings:"Keeper or posts, how many kicks, goals to win, and the keeper's difficulty or the distance and wind. No answers to write.",limits:"For now, only shots past a keeper are built, and kicks at the posts are coming soon. Timing and reflexes aren't scored."}],["arcade",{when:"Any time",group:"play",one:"A real-time phone game with a leaderboard of each player's best run.",ideas:"Endless Runner: dodge obstacles for as long as you can, themed to your brand.",game:"Play a fast game on your phone. Your best run goes on the leaderboard.",settings:"Your game, plus the fastest anyone could score and the longest a run can last.",limits:"For now, no prizes: impossible scores are stopped, but believable fakes are not."}]];IH=_j.map(([e,t])=>({format:e,slug:xj(ko[e].name),name:ko[e].name,japanese:Sj(e),...t}))});function iE(e,t){return e==="side"?`side:${t?.id}`:e}async function sE(e,t){let o=globalThis.crypto?.subtle;if(!o)throw new Error("liveChannel needs WebCrypto (a browser, or Node 18+)");let r=new Uint8Array(await o.digest("SHA-1",new TextEncoder().encode(`gamestage/live/${e}/${t}`)));r[6]=r[6]&15|80,r[8]=r[8]&63|128;let n=[...r.subarray(0,16)].map(a=>a.toString(16).padStart(2,"0")).join("");return`l-${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function cE(e){let t=new Set;for(let n of e)n.sides.forEach((a,i)=>Object.keys(a).forEach(c=>t.add(`${i}.${c}`)));let o=["elapsed",...[...t].sort()],r=e.map(n=>o.map(a=>{if(a==="elapsed")return n.elapsed;let i=a.indexOf(".");return n.sides[Number(a.slice(0,i))]?.[a.slice(i+1)]??0}));return{columns:o,rows:r}}var _o,aE,ab,ar=_(()=>{"use strict";_o=["sportmonks"],aE={state:21600,clock:21600,side:21600,moments:21600,moment:30,timeline:21600,health:120};ab="edition_live_contest"});var lE,ib=_(()=>{"use strict";je();lE=s.object({points_per_second:s.number().positive().max(1e6).optional(),max_run_seconds:s.number().int().min(5).max(3600),min_run_ms:s.number().int().min(0).max(36e5).optional(),score_max:s.number().int().positive().optional(),score_min:s.number().int().min(-Number.MAX_SAFE_INTEGER).optional(),ranking:s.enum(["highest","lowest"]).default("highest"),max_runs_per_day:s.number().int().positive().max(1e4).optional(),rank_by:s.enum(["best","total"]).optional(),signed_scores:s.boolean().optional()}).strict().superRefine((e,t)=>{e.ranking==="highest"&&e.points_per_second===void 0&&t.addIssue({code:"custom",path:["points_per_second"],message:"A game where the highest score wins needs points_per_second: the fastest a fair run can score."}),e.ranking==="lowest"&&e.score_min===void 0&&t.addIssue({code:"custom",path:["score_min"],message:"A game where the lowest score wins needs score_min: the best score a fair run can reach."}),e.score_min!==void 0&&e.score_min<0&&!e.signed_scores&&t.addIssue({code:"custom",path:["score_min"],message:"A score_min below 0 needs signed_scores: true, so a run may score below 0."}),e.ranking==="lowest"&&e.points_per_second!==void 0&&t.addIssue({code:"custom",path:["points_per_second"],message:"points_per_second bounds a high score and means nothing when the lowest score wins."})})});function wd(e,t){return t==="article-launch"||t==="article-embed"?t==="article-embed"?"card":"launch":e==="predict"?"page":"screen"}var gd,yd,ir,bd,sb,cb,lb,dE,db,ub,Hn,vd=_(()=>{"use strict";je();gd=s.enum(["screen","canvas","launch","card","page","sheet"]),yd=s.enum(["fullscreen","article-launch","article-embed","app-webview"]),ir={screen:{name:"Screen",summary:"fills the phone and nothing scrolls; the layout adapts to the phone's size"},canvas:{name:"Scaled canvas",summary:"drawn at one size and scaled to fit the phone, with bars where the shape differs"},launch:{name:"Card that opens to full screen",summary:"a preview in the host page; tapping it opens the game full screen over the page"},card:{name:"Card",summary:"a fixed box inside a page that scrolls, with no scrolling inside the box"},page:{name:"Page",summary:"scrolls like a web page; for long question lists and results tables"},sheet:{name:"Sheet",summary:"slides up over part of a host app for one quick question"}},bd={fullscreen:{name:"Full screen",summary:"opened full screen, from a carousel, a Hub or a link"},"article-launch":{name:"Article, opening full screen",summary:"a card in an article that opens the game full screen over it"},"article-embed":{name:"Article embed",summary:"a box inside an article, played where it sits"},"app-webview":{name:"Web view in a native app",summary:"inside a club's or publisher's own app, in a web view"}},sb="Players come back to a game they can play properly. Full screen, a game feels like an app and gets played; a widget in an article reads as throwaway and gets scrolled past. Choose full screen unless your host can't allow it.",cb="An article box is small, easy to scroll past, and the page's own scrolling fights swipes inside the game. Use it only where the host can't open the game full screen.",lb="Inside a native app, set the web view's own background to the game's background colour and create it before the player taps, so nothing flashes white while it loads.";dE=["screen","canvas","card","sheet"],db={screen:{jsKb:350,cssKb:60,fontKb:150,totalKb:900,firstRenderMs:1800,playableMs:3500},canvas:{jsKb:500,cssKb:60,fontKb:150,totalKb:1500,firstRenderMs:1800,playableMs:4500},launch:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},card:{jsKb:300,cssKb:50,fontKb:120,totalKb:700,firstRenderMs:1500,playableMs:3e3},page:{jsKb:400,cssKb:80,fontKb:150,totalKb:1100,firstRenderMs:1800,playableMs:4e3},sheet:{jsKb:250,cssKb:40,fontKb:100,totalKb:600,firstRenderMs:1200,playableMs:2500}},ub={name:"mid-range phone on 4G",cpuSlowdown:4,latencyMs:60,downloadKbps:9e3,uploadKbps:1500},Hn="gamestage:playable"});function uE(e){let t=e.trim().toLowerCase().replace(/\.$/,"");if(!t)return!1;if(Ej.has(t)||Tj.some(r=>t.endsWith(r))||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t))return!0;let o=/^\[::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(o){let r=Number.parseInt(o[1],16),n=Number.parseInt(o[2],16),a=`${r>>8}.${r&255}.${n>>8}.${n&255}`;if(a!==t)return uE(a)}return!!(/^169\.254\./.test(t)||/^\[?fe80:/.test(t)||/^\[?f[cd][0-9a-f]{2}:/.test(t)||Aj(t)&&!Cj(t))}function mb(e){let t=e.split(".");if(t.length!==4)return;let o=t.map(r=>/^(0|[1-9][0-9]{0,2})$/.test(r)?Number(r):NaN);return o.every(r=>r>=0&&r<=255)?o:void 0}function mE(e){let t=e.replace(/^\[/,"").replace(/\]$/,""),o=t.indexOf("%");if(o>=0&&(t=t.slice(0,o)),!t.includes(":")||!/^[0-9a-f:.]+$/i.test(t))return;let r;if(t.includes(".")){let l=t.lastIndexOf(":");if(r=mb(t.slice(l+1)),!r)return;t=`${t.slice(0,l+1)}0:0`}let n=t.split("::");if(n.length>2)return;let a=l=>l===""?[]:l.split(":").map(u=>/^[0-9a-f]{1,4}$/i.test(u)?Number.parseInt(u,16):NaN),i=a(n[0]),c=n.length===2?a(n[1]):[];if([...i,...c].some(Number.isNaN))return;let d;if(n.length===2){let l=8-i.length-c.length;if(l<1)return;d=[...i,...new Array(l).fill(0),...c]}else d=i;if(d.length===8)return r&&(d[6]=r[0]<<8|r[1],d[7]=r[2]<<8|r[3]),d}function Ji([e,t,o]){return!(e===0||e===10||e===127||e===100&&t>=64&&t<=127||e===169&&t===254||e===172&&t>=16&&t<=31||e===192&&t===168||e===192&&t===0&&(o===0||o===2)||e===192&&t===88&&o===99||e===198&&(t===18||t===19)||e===198&&t===51&&o===100||e===203&&t===0&&o===113||e>=224)}function kd(e,t){return[e>>8,e&255,t>>8,t&255]}function $j(e){let t=o=>e.slice(0,o).every(r=>r===0);return t(5)&&e[5]===65535||t(6)?Ji(kd(e[6],e[7])):e[0]===100&&e[1]===65435?e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0&&Ji(kd(e[6],e[7])):(e[0]&57344)!==8192||e[0]===8193&&e[1]===3512||e[0]===8193&&e[1]===0?!1:e[0]===8194?Ji(kd(e[1],e[2])):!0}function Aj(e){return mb(e)!==void 0||mE(e)!==void 0}function Cj(e){let t=mb(e);if(t)return Ji(t);let o=mE(e);return o?$j(o):!1}function _d(e){let t;try{t=new URL(e)}catch{return"unparseable"}if(uE(t.hostname))return"local";if(t.protocol!=="https:")return"insecure";if(t.username||t.password)return"credentials"}function xd(e){switch(e){case"local":return"Names a host only the machine running it can reach, which is the local `gamestage dev --as` harness, or a private or reserved address. A deployed game pointed at the harness 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.";case"insecure":return"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.";case"credentials":return"Must not carry a username or password. Name the key set's public URL.";case"unparseable":return"Not a URL. Name the full issuer and JWKS URI of the login system whose tokens this game accepts."}}var Tj,Ej,Sd=_(()=>{"use strict";Tj=[".localhost",".local",".internal",".test",".localdomain"],Ej=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0","[::]"])});function pE(e){return e.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").toUpperCase()}function Ij(e){return/^[A-Z0-9]$/.test(e)}function an(e){return pE(e).replace(/[^A-Z0-9]/g,"")}function hE(e){let t=[];for(let o of[...pE(e)])Ij(o)&&!t.includes(o)&&t.push(o);return t}var fE,Td=_(()=>{"use strict";fE=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ",..."0123456789"]});function gE(e){return an(e)}function yE(e){return/^[A-Z]+$/.test(e)}var pb,hb=_(()=>{"use strict";Td();pb=[4,5,6,7]});var Xi,Qi=_(()=>{"use strict";je();Xi=s.object({date:s.string(),plays:s.number(),players:s.number().nullable()})});var es,Ed=_(()=>{"use strict";je();es=s.discriminatedUnion("source",[s.object({source:s.literal("manifest")}),s.object({source:s.literal("studio"),element_id:s.string().min(1),edition_id:s.string().min(1)})])});var wE,Oj,vE,bE,kE,$d=_(()=>{"use strict";je();wE={notify_template_subject_won:"{score_line}. You called it",notify_template_subject_lost:"{score_line}. You scored {points}",notify_template_sms_won:"{score_line}. You called it: {pick}, {points} points.",notify_template_sms_lost:"{score_line}. You picked {pick}: {points} points.",notify_template_body:`{score_line}.
78
78
 
79
79
  You picked {pick}.
80
80
 
81
81
  You scored {points} points.`},Oj=Object.keys(wE),vE=s.object({notify_template_subject_won:s.string().trim().min(1).max(200).optional(),notify_template_subject_lost:s.string().trim().min(1).max(200).optional(),notify_template_sms_won:s.string().trim().min(1).max(300).optional(),notify_template_sms_lost:s.string().trim().min(1).max(300).optional(),notify_template_body:s.string().trim().min(1).max(4e3).optional()}),bE={notify_template_subject_won:{label:"Result subject, called it",description:"The email subject for a fan who called the result."},notify_template_subject_lost:{label:"Result subject, missed it",description:"The email subject for a fan who did not call the result."},notify_template_sms_won:{label:"Result text message, called it",description:"The text message for a fan who called the result. The link and your name are added after it. A locked phone shows about the first 40 characters."},notify_template_sms_lost:{label:"Result text message, missed it",description:"The text message for a fan who did not call the result. The link and your name are added after it."},notify_template_body:{label:"Result email",description:"The email for every fan. The link and an unsubscribe line are added after it."}},kE=Oj.map(e=>({key:e,label:bE[e].label,type:"freetext",description:`${bE[e].description} Write {score_line} for the score, {pick} for the fan's pick and {points} for their points. Empty means "${wE[e].replaceAll(`
82
82
 
83
- `," ")}".`,readBy:"The predict settler, which hands it to the Engine to word each fan's result message.",section:"Result notifications"}))});var ts,fb,gb,sr,_E,ns=_(()=>{"use strict";ts="penalty_v1",fb=["easy_v1","balanced_v1","hard_v1"],gb="balanced_v1",sr={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},_E="shoot"});function os(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.void===!0}function Fj(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let{home:t,away:o}=e;return typeof t=="number"&&typeof o=="number"&&Number.isInteger(t)&&Number.isInteger(o)&&t>=0&&o>=0}var cr,ha,Ad,rs,Pj,Rj,xE,Nj,Lj,Cd,zj,jj,yb,Dj,bb,SE,Mj,wb,TE,EE,vb,Uj,$E,Gj,Id,Bj,qj,Wj,Hj,Yj,Ve,t7,n7,o7,Kt=_(()=>{"use strict";je();Vt();Td();hb();Qi();Ed();$d();ns();cr={scoreOrder:s.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},ha=s.object({source:s.string().min(1),date:s.string().optional(),url:s.string().optional()}),Ad=s.object({text:s.string().min(1),sources:s.array(ha).default([])}),rs=s.enum(["highest","lowest","only_nonzero","only_zero"]),Pj=s.object({measure:s.string().min(1),label:s.string().default(""),rule:rs,scale:s.number().int().positive().default(1),values:s.record(s.string(),s.number().int().nonnegative()),perGuess:s.boolean().default(!0),sources:s.record(s.string(),ha).optional()}),Rj=s.enum(["grid","pitch","xi"]),xE=s.object({team:s.string().min(1),formation:s.string().optional(),places:s.array(s.object({row:s.number().int().positive(),column:s.number().int().positive(),label:s.string().min(1).optional()})).min(2).max(11)}).superRefine((e,t)=>{let o=e.places.filter(r=>!r.label).length;o!==1&&t.addIssue({code:"custom",path:["places"],message:`An eleven needs exactly one empty place to fill; this one has ${o}.`})}),Nj=s.object({solution:s.string().min(1).max(120).refine(e=>hE(e).length>0,"The phrase needs at least one letter or digit to draw."),drawOrder:s.enum(["seeded","random"]).default("seeded"),drawsAllowed:s.number().int().min(1).max(36).default(3),points:s.object({bySpins:s.array(s.number().int().nonnegative()).max(36).optional(),forPlaying:s.number().int().nonnegative().optional(),forCorrect:s.number().int().nonnegative().optional()}).strict().optional()}).strict(),Lj=s.object({kind:s.enum(["word","number"]),answer:s.union([s.string().min(1).max(40),s.number()]),length:s.number().int().min(1).max(40).optional(),guessesAllowed:s.number().int().min(1).max(20).default(6),feedback:s.enum(["letters","higher_lower","none"]).optional(),validWords:s.boolean().optional(),clues:s.array(s.string().trim().min(1).max(200)).max(20).optional(),picture:s.string().url().max(2e3).refine(e=>e.startsWith("https://"),"A picture must be an https address.").optional(),points:s.object({byGuesses:s.array(s.number().int().nonnegative()).max(20).optional(),forPlaying:s.number().int().nonnegative().optional(),forCorrect:s.number().int().nonnegative().optional()}).strict().optional()}).strict().superRefine((e,t)=>{let o=(n,a)=>t.addIssue({code:"custom",path:[n],message:a});if(e.kind==="number"){typeof e.answer!="number"&&o("answer","A number round's answer must be a number."),e.feedback==="letters"&&o("feedback","Letter colours need a word. A number round gives higher_lower or none."),e.validWords&&o("validWords","Real words only applies to a word round."),e.length!==void 0&&o("length","A number round has no length.");return}if(typeof e.answer!="string"){o("answer","A word round's answer must be text.");return}let r=gE(e.answer);if(!yE(r)){o("answer","A word answer is letters only, with no spaces, digits or punctuation.");return}e.length!==void 0&&e.length!==r.length&&o("length",`The answer has ${r.length} letters, not ${e.length}.`),e.feedback==="higher_lower"&&o("feedback","Higher or lower needs a number. A word round gives letters or none."),e.validWords&&!pb.includes(r.length)&&o("validWords",`Real words only works for words of ${pb.join(", ")} letters; this answer has ${r.length}.`)}),Cd=s.object({archetype:s.literal("hunt"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(s.string().min(1)).min(2).default([...fE]),layout:Rj.optional(),positions:s.record(s.string(),s.string().min(1)).optional(),names:s.record(s.string(),s.object({given:s.string().optional(),family:s.string().optional()})).optional(),teams:s.record(s.string(),s.string().min(1)).optional(),images:s.record(s.string(),s.string().url()).optional(),lineup:xE.optional(),productsAbout:s.enum(["parent","theme","none"]).optional(),targets:s.array(s.string().min(1)).default([]),solve:Nj.optional(),guess:Lj.optional(),required:s.number().int().positive().optional(),figures:Pj.optional(),facts:s.array(Ad).optional(),pointsPerTarget:s.number().int().nonnegative().default(10),completionBonus:s.number().int().nonnegative().default(0),mistakePenalty:s.number().int().nonnegative().optional(),attemptsAllowed:s.number().int().positive().default(10),mistakesAllowed:s.number().int().positive().default(4),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{if(e.solve&&e.guess){t.addIssue({code:"custom",path:["guess"],message:"A round is a solve round or a guess round, never both."});return}if(e.guess){e.targets.length>0&&t.addIssue({code:"custom",path:["targets"],message:"A guess round's answer is in its guess block. Leave targets out."});return}if(e.solve){e.targets.length>0&&t.addIssue({code:"custom",path:["targets"],message:"A solve round's targets are the letters of its phrase. Leave targets out."});return}if(e.targets.length===0){t.addIssue({code:"custom",path:["targets"],message:"At least one target is needed, or a solve or guess block."});return}let o=e.targets.filter(r=>!e.board.includes(r));o.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${o.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.`})}),zj=s.object({key:s.string().min(1),label:s.string().min(1),value:s.number().int().nonnegative(),source:ha.optional()}),jj=s.object({id:s.string().min(1),label:s.string().default(""),entries:s.array(zj).min(1)}),yb=s.object({within:s.number().min(0).max(1),label:s.string().min(1)}),Dj=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],bb=s.object({mode:s.literal("proximity"),pointsPer:s.number().int().positive().default(1e3),exactBonus:s.number().int().nonnegative().default(500)}),SE=s.object({archetype:s.literal("push"),scoring:bb.optional(),facts:s.array(Ad).optional(),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),target:s.number().int().positive(),targetLabel:s.string().default(""),unit:s.string().max(4).default(""),theme:s.string().default(""),slates:s.array(jj).min(1),line:s.array(s.object({slate:s.string(),key:s.string()})).optional(),tiers:s.array(yb).default(Dj),floorLabel:s.string().default("Rookie"),bustLabel:s.string().default("Busted"),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional(),compare:s.literal("each_at_least_last").optional(),locksAt:s.string().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 c=0,d=!1;for(let l of e.line){let p=e.slates.find(f=>f.id===l.slate)?.entries.find(f=>f.key===l.key);if(!p){d=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${l.key}" on slate "${l.slate}", which the round does not hold.`});break}c+=p.value}!d&&c!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${c}, not the target ${e.target}. A perfect line lands exactly.`})}let o=e.slates.map(c=>c.id);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let r=e.slates.flatMap(c=>c.entries.map(d=>d.key)),n=[...new Set(r.filter((c,d)=>r.indexOf(c)!==d))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let a=e.slates.reduce((c,d)=>c+Math.min(...d.entries.map(l=>l.value)),0);!e.compare&&a>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${a}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((c,d)=>d===0||c.within>e.tiers[d-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),Mj=s.object({key:s.string().min(1),label:s.string().min(1),members:s.array(s.string().min(1)).min(2)}),wb=s.object({archetype:s.literal("group"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(s.string().min(1)).min(4),groups:s.array(Mj).min(2),pointsPerGroup:s.number().int().nonnegative().default(10),completionBonus:s.number().int().nonnegative().default(0),attemptsAllowed:s.number().int().positive().default(10),mistakesAllowed:s.number().int().positive().default(4),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=new Map;for(let a of e.groups){let i=a.members.filter(c=>!e.board.includes(c));i.length&&t.addIssue({code:"custom",path:["groups"],message:`${a.key} has members that are not on the board: ${i.join(", ")}.`});for(let c of a.members){let d=o.get(c);d&&d!==a.key&&t.addIssue({code:"custom",path:["groups"],message:`${c} is in both ${d} and ${a.key}. Groups cannot overlap.`}),o.set(c,a.key)}}new Set(e.groups.map(a=>a.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 r=new Set(e.groups.flatMap(a=>a.members)),n=e.board.filter(a=>!r.has(a));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),TE=s.object({key:s.string().min(1),label:s.string().min(1),points:s.number().int().nonnegative().optional()}),EE=s.object({home:s.number().int().nonnegative(),away:s.number().int().nonnegative()}),vb=s.object({void:s.literal(!0)});Uj=s.object({id:s.string().min(1),kind:s.enum(["choice","number","scoreline"]).default("choice"),prompt:s.string().default(""),options:s.array(TE).optional(),min:s.number().optional(),max:s.number().optional(),step:s.number().positive().optional(),result:s.union([s.string().min(1),s.number(),EE,vb]).optional(),points:s.number().int().nonnegative().optional(),resultPoints:s.number().int().nonnegative().optional(),tolerance:s.number().positive().optional(),teams:s.object({home:s.string().min(1),away:s.string().min(1)}).optional()}).superRefine((e,t)=>{if(e.kind!=="scoreline"&&e.teams!==void 0&&t.addIssue({code:"custom",path:["teams"],message:"Only a scoreline has a home and an away side."}),e.kind!=="scoreline"&&e.resultPoints!==void 0&&t.addIssue({code:"custom",path:["resultPoints"],message:"Only a scoreline pays for the right result. Use points on this question."}),e.kind==="scoreline"){e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A scoreline has no options: a fan gives a score for each side."}),(e.min!==void 0||e.max!==void 0||e.tolerance!==void 0)&&t.addIssue({code:"custom",path:["min"],message:"A scoreline has no min, max or tolerance: it is marked exact, right result, or wrong."}),e.result!==void 0&&!os(e.result)&&!Fj(e.result)&&t.addIssue({code:"custom",path:["result"],message:"A scoreline settles to a home and an away score, each a whole number from 0."}),e.points!==void 0&&e.resultPoints!==void 0&&e.resultPoints>e.points&&t.addIssue({code:"custom",path:["resultPoints"],message:"The right result cannot be worth more than the exact score."});return}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(o=>o.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(o=>o.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),e.result!==void 0&&!os(e.result)&&typeof e.result!="string"&&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."}),e.result!==void 0&&!os(e.result)&&typeof e.result!="number"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),$E=s.object({archetype:s.literal("predict"),fixture:s.string().optional(),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),options:s.array(TE).min(2).optional(),questions:s.array(Uj).min(1).optional(),result:s.union([s.string().min(1),vb]).optional(),pointsForCorrect:s.number().int().nonnegative().default(10),exactPoints:s.number().int().nonnegative().optional(),resultPoints:s.number().int().nonnegative().optional(),tieBreaker:s.string().min(1).optional(),closesAt:s.string().datetime({offset:!0}).optional(),attemptsAllowed:s.number().int().positive().default(1),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=e.options!==void 0,r=e.questions!==void 0;if(o&&r&&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."}),!o&&!r&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),r&&e.questions){let n=e.questions.map(a=>a.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."})}if(e.tieBreaker!==void 0){let n=e.questions?.find(a=>a.id===e.tieBreaker);n?n.kind!=="number"?t.addIssue({code:"custom",path:["tieBreaker"],message:"A tie-breaker has to be a number question: the closest answer wins, which needs a distance."}):e.questions&&e.questions.length<2&&t.addIssue({code:"custom",path:["tieBreaker"],message:"A round whose only question is the tie-breaker has nothing to score."}):t.addIssue({code:"custom",path:["tieBreaker"],message:`${e.tieBreaker} is not one of this round's questions, so nothing would break a tie.`})}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&&!os(e.result)&&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.`})}),Gj=s.object({archetype:s.literal("bingo"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),rows:s.number().int().min(2),columns:s.number().int().min(2),centreMode:s.enum(["none","free","choice"]).default("none"),centreOptions:s.array(s.string().min(1)).optional(),allowCentreDuplicate:s.boolean().default(!1),lineTypes:s.array(s.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:s.array(s.object({key:s.string().min(1),label:s.string().min(1),note:s.string().optional(),result:s.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:s.number().int().nonnegative().default(10),pointsForFullBoard:s.number().int().nonnegative().default(0),shuffleAllowance:s.number().int().nonnegative().default(3),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),locksAt:s.string().optional()}).superRefine((e,t)=>{let o=e.cardPool.map(n=>n.key);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let r=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<r&&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 ${r}. 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(a=>!o.includes(a));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),Id=s.object({archetype:s.literal("shoot"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),model:s.literal(ts).default(ts),difficulty:s.enum(fb).default(gb),shotsAllowed:s.number().int().min(1).max(20).default(5),goalsToWin:s.number().int().min(1).default(3),pointsPerGoal:s.number().int().nonnegative().default(100),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.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.`})}),Bj=s.object({key:s.string().min(1),label:s.string().min(1),art:s.string().optional()}),qj=s.object({key:s.string().min(1),name:s.string().min(1),image:s.string().optional()}),Wj=s.object({item:s.string().min(1),cells:s.array(s.string().min(1))}),Hj=s.object({archetype:s.literal("place"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(Bj).min(1),deck:s.array(qj).min(1),qualifies:s.array(Wj).default([]),pointsPerPlacement:s.number().int().nonnegative().default(1),fullHouseBonus:s.number().int().nonnegative().default(0),mistakesAllowed:s.number().int().positive().default(4),skipsAllowed:s.number().int().nonnegative().default(3),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=new Set;for(let c of e.board)o.has(c.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${c.key}. Each one needs its own.`}),o.add(c.key);let r=new Set;for(let c of e.deck)r.has(c.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${c.key}. Each one needs its own.`}),r.add(c.key);let n=new Set,a=new Set;for(let c of e.qualifies){r.has(c.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} is not a card in the deck.`}),n.has(c.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} is listed twice. Give each card one row.`}),n.add(c.item);for(let d of c.cells)o.has(d)||t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} qualifies for ${d}, which is not on the board.`}),a.add(d)}let i=e.board.filter(c=>!a.has(c.key)).map(c=>c.key);i.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${i.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),Yj=s.discriminatedUnion("archetype",[Cd,SE,wb,$E,Gj,Id,Hj]),Ve=s.preprocess(nE,Yj),t7=s.object({resultWording:s.string().max(500).optional(),resultTemplates:vE.optional(),actor:s.string().min(1).optional(),settlementAction:s.enum(["auto_settle","approve","void","full_time","correction","correction_applied"]).optional(),action:s.literal("settle"),game:s.string().min(1),roundId:s.string().min(1),result:s.union([s.string().min(1),s.record(s.string().min(1),s.union([s.string().min(1),s.number(),EE,vb]))])}),n7=s.object({game:s.string().min(1),round:Ve,origin:es.optional(),snapshot:s.string().default(""),source:s.string().optional(),roundId:s.string().min(1).optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({project_id:s.string().optional(),strategy:s.string().optional(),provider:s.string().optional(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional(),gate:s.object({minimumAge:s.number().int().positive().optional(),territories:s.array(s.string()).optional(),key:s.string().min(1)}).optional()}).optional(),selection:s.object({mode:s.literal("rotation"),windowSeconds:s.number().int().positive(),rounds:s.array(s.object({id:s.string().min(1),round:Ve,origin:es.optional()})).min(1)}).optional()}),o7=s.object({roundId:s.string(),version:s.number().int().nonnegative(),changed:s.boolean(),current:s.boolean(),held:s.string().optional(),activity:s.array(Xi).optional(),monthlyPlayers:s.number().int().nonnegative().optional()})});var Od,kb=_(()=>{"use strict";Od={title:"Tell me my result",via:"Send my result by",email:"Email",sms:"Text message",email_address:"Email address",mobile_number:"Mobile number",country:"Country",consent:"{brand} will use these details to tell you your result. You can unsubscribe at any time.",privacy:"Privacy policy",button:"Notify Me",pending:"Saving\u2026",success:"Done. We'll tell you after full time.",error:"That did not work. Please try again.",invalid_email:"Enter an email address, such as name@example.com.",invalid_mobile:"Enter a complete mobile number for the country you picked.",code:"6-digit code",code_incomplete:"Enter all 6 digits.",confirm:"Confirm",resend_code:"Send a new code",resend_email:"Send the email again",resend_wait:"Send again in {seconds}s",resent:"Sent. Check again.",change_address:"Use a different number or email"}});function fa(e){let t=e?.age_gate?.required&&(e.age_gate.method??"self_declared")==="self_declared"?e.age_gate.minimum_age:void 0,o=e?.territory?.required&&e.territory.allowed?.length?e.territory.allowed:void 0;if(!(!t&&!o))return{...t?{minimumAge:t}:{},...o?{territories:o}:{},...e?.gate_note?.trim()?{note:e.gate_note.trim()}:{}}}var as=_(()=>{"use strict"});function is(){return ss.filter(e=>e.public!==!1&&e.type!=="collection"&&e.type!=="boolean"&&e.type!=="number"&&e.section!=="Who can play").map(e=>e.key)}function CE(e){if(e===null||typeof e!="object"||Array.isArray(e))return["gamestage.settings.json must be one JSON object of field keys to text."];let t=new Set(is()),o=[];for(let[r,n]of Object.entries(e)){let a=/^label_[a-z0-9_]+$/.test(r);!t.has(r)&&!a?o.push(`"${r}" is not a Studio field a game can fill. The fields are: ${[...t].join(", ")}, and any label_<key> the page reads.`):typeof n!="string"&&o.push(`"${r}" must be text, and is ${Array.isArray(n)?"a list":typeof n}.`)}return o}function lr(e,t,o,r){let n=e[0].toUpperCase()+e.slice(1),a=(d,l,u)=>({key:`css_variables_${d}`,label:l,type:"colour",description:u,readBy:`The game's own CSS, as the --gs-${d} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:o}),i=t.toLowerCase(),c=[a(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return r.variant&&c.push(a(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),c.push(a(`on${n}Colour`,`On ${i} colour`,"On: content sitting on the main and variant surfaces."),a(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),a(`on${n}ContainerColour`,`On ${i} container colour`,"On container: content sitting on the container surface.")),c}function ga(e,t,o){let r=(n,a,i)=>({key:`css_variables_font${e}${n}`,label:`${t} ${a}`,type:"freetext",description:i,readBy:`The game's own CSS, as the --gs-font${e}${n} custom property.`,section:"Typography",subsection:t,subsectionDescription:o});return[r("Family","font","The typeface: an uploaded font's name, or a curated family."),r("Weight","weight","The font weight, e.g. 400 or 700."),r("Size","size","The font size, as a CSS length, e.g. 2rem."),r("LineHeight","line height","The line height, as a CSS value."),r("Tracking","letter spacing","The letter spacing, as a CSS length, e.g. 0.02em."),r("Case","case","The text case, as a CSS text-transform, e.g. uppercase.")]}function NE(e,t){return[{key:"sponsor_name",label:"Sponsor",type:"freetext",description:`The sponsor's name, shown ${t}. Leave it empty and no sponsor is shown.`,readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e},{key:"sponsor_logo",label:"Sponsor logo",type:"image",description:"Optional. A small mark shown beside the name. A transparent PNG or an SVG reads best.",readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e},{key:"sponsor_link",label:"Sponsor link",type:"freetext",description:"Optional. Where a tap on the sponsor goes. Must start with https://. Taps are counted, with nothing stored on the fan's device.",readBy:"The sponsor reader (readSponsor), for the game's result card, and the control plane's counted tap route.",section:e},{key:"sponsor_intro",label:"Words before the sponsor",type:"freetext",description:`The words before the sponsor's name, such as "In association with". It marks the line as an advert, which the law requires, so it is never left blank: empty means "In association with".`,readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e}]}function Yn(e,t){let o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${o}\\b`,`\\bpresentation\\s*\\[\\s*["']${o}["']\\s*\\]`,`\\b${o}\\s*:`,`[A-Za-z_$][\\w$]*\\s*\\??\\.\\s*${o}\\b`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)||cD.has(t)&&/\broot\s*:/.test(e)||lD.has(t)&&/data-gs-first-paint/.test(e)||t.startsWith("recovery")&&/\bmountRecovery\s*\(/.test(e)||t.startsWith("signIn")?!0:t==="analyticsUrl"}function Rd(e){return[...Pd.filter(t=>Yn(e,Ob[t.key])).map(t=>t.key),...dr(e)]}function dr(e){let t=new Set;if(/\bmountNotify\s*\(/.test(e))for(let o of Object.keys(Od))t.add(`label_notify_${o}`);for(let o of e.matchAll(/["'`](label_[a-z0-9_]+)["'`]|\b(label_[a-z0-9_]+)\s*:/g)){let r=o[1]??o[2];r&&r!==xo&&t.add(r)}return[...t].filter(o=>!t.has(`${dD}${o.slice(xo.length)}`)).sort()}function ME(e){let t=e.slice(xo.length).replace(/_/g," ").trim();return{key:e,...e==="label_provisional_result"?{default:Zj}:{},...e.startsWith("label_notify_")&&e.slice(13)in Od?{default:Od[e.slice(13)]}:{},label:t.charAt(0).toUpperCase()+t.slice(1),type:"freetext",description:"A word this game's page shows. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page.",section:"Wording"}}function ls(e,t=Pb){return`${t}/fonts/${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}.css`}function Nd(e,t){if(!e)return;let o=Object.keys(AE).find(i=>i.toLowerCase()===e.trim().toLowerCase());if(!o)return;let r=AE[o],n=Number(t);if(!Number.isFinite(n))return{family:o,weight:r[r.length-1]};let a=[...r].sort((i,c)=>Math.abs(i-n)-Math.abs(c-n)||c-i)[0];return{family:o,weight:a}}function FE(e){if(e===void 0)return;let t=/^\s*(-?(?:\d+\.?\d*|\.\d+))(?:em)?\s*$/i.exec(e);if(!t)return;let o=Number(t[1]);if(Number.isFinite(o))return`${Math.min(.4,Math.max(-.1,o))}em`}function UE(e){let t=e?.trim().toLowerCase();if(t)return["upper","uppercase","capitals","caps"].includes(t)?"uppercase":["none","uppercase","lowercase","capitalize"].includes(t)?t:"none"}var Pd,_b,IE,OE,PE,RE,Zj,ss,xb,LE,Jj,So,Xj,Sb,zE,Qj,eD,tD,Tb,nD,oD,rD,jE,aD,DE,Eb,$b,Ab,Cb,iD,sD,cs,Ib,Ob,cD,lD,xo,dD,AE,Pb,Rb,GE,sn=_(()=>{"use strict";kb();as();Ki();Pd=[{key:"play_again_label",required:!0,label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",required:!0,label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",required:!0,label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:'What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:'What the result screen says when a fan finished under, e.g. "{n} away from the target". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:'The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:'The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:'The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"},{key:"splash_gradient_start",label:"Intro screen colour, top",type:"colour",description:"The colour at the top of the intro screen's gradient, also the colour the page paints before anything loads. Leave it empty to use the background colour.",readBy:"The game's intro screen, from its first frame.",section:"Brand"},{key:"splash_gradient_end",label:"Intro screen colour, bottom",type:"colour",description:"The colour at the bottom of the intro screen's gradient. Leave it empty to use the background container colour.",readBy:"The game's intro screen, from its first frame.",section:"Brand"},{key:"splash_play_label",label:"Intro screen button",type:"freetext",description:'What the big button on the intro screen says once the game has loaded. Tapping it starts the game and turns sound and vibration on. Empty says "Play".',readBy:"The game's intro screen.",section:"Wording"},{key:"splash_continue_label",label:"Intro screen button, part way through",type:"freetext",description:`What the intro screen button says when the fan has a round they haven't finished. Empty says "Continue".`,readBy:"The game's intro screen.",section:"Wording"},{key:"splash_error_text",label:"Intro screen, when loading fails",type:"freetext",description:`What the intro screen says if the game can't load. Empty says "The game didn't load. Check your connection and try again."`,readBy:"The game's intro screen.",section:"Wording"},{key:"splash_retry_label",label:"Intro screen, try again button",type:"freetext",description:`The button shown when the game can't load. Empty says "Try again".`,readBy:"The game's intro screen.",section:"Wording"},{key:"recovery_open_label",label:"Recovery button",type:"freetext",description:`The small button that opens a fan's recovery code. Empty says "Your progress".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_show_title",label:"Recovery code, heading",type:"freetext",description:`The heading above a fan's recovery code. Empty says "Keep your progress".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_show_detail",label:"Recovery code, explanation",type:"freetext",description:"The line under that heading. Empty explains that the code brings a fan's name, scores and achievements back on another device, and is shown once.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_private_note",label:"Recovery code, keep it private",type:"freetext",description:"The warning under the code. Empty says anyone with the code can play as the fan.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_replace_note",label:"Recovery code, replacing it",type:"freetext",description:"The warning that a new code stops the old one working.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_enter_title",label:"Restore, heading",type:"freetext",description:`The heading for a fan who has played before. Empty says "I've played before".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_enter_detail",label:"Restore, explanation",type:"freetext",description:"The line under that heading.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_submit_label",label:"Restore, button",type:"freetext",description:`The button that restores a fan's progress from their code. Empty says "Get my progress back".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_not_recognised",label:"Restore, code not recognised",type:"freetext",description:"What a fan reads when their code isn't recognised.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_restored",label:"Restore, done",type:"freetext",description:"What a fan reads once their progress is back.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_get_label",label:"Recovery code, get button",type:"freetext",description:`The button that issues a fan's recovery code. Empty says "Get a recovery code".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_issue_failed",label:"Recovery code, when it fails",type:"freetext",description:`What a fan reads if a code can't be issued. Empty says "That didn't work. Check your connection and try again."`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_copy_label",label:"Recovery code, copy button",type:"freetext",description:'The button that copies the code. Empty says "Copy".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_copied_label",label:"Recovery code, copied",type:"freetext",description:'What the page says once the code is copied. Empty says "Copied".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_share_label",label:"Recovery code, share button",type:"freetext",description:'The button that shares the code. Empty says "Share".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_close_label",label:"Recovery screens, close button",type:"freetext",description:'The button that closes the recovery screens. Empty says "Close".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"}];_b=Pd.map(e=>e.key);IE=[...lr("background","Background","The app and element background.",{variant:!1}),...lr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...lr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...lr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...lr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...lr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...lr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})];OE=[{key:"default_font_family",label:"Default font",type:"freetext",description:"The face the game uses where a role below sets none. A name from an uploaded font or the curated list. Leave it empty to keep the game's own base face.",readBy:"The typography client, as the game's fallback family.",section:"Typography"},{key:"uploaded_fonts",label:"Uploaded fonts",type:"collection",itemLabel:"{{name}}",description:"Font files to use by name in the roles below. Each is served to fans from the upload, never from Google, so a fan's address does not reach a third party before consent.",readBy:"The typography client turns each into an @font-face the roles can name.",section:"Typography",fieldset:[{key:"name",label:"Name",type:"freetext",description:`What to call this face in a role's family, e.g. "Knockout".`,readBy:"The typography client matches this against a role's family name.",section:"Typography"},{key:"file",label:"File",type:"file",description:"The font file. woff2 is smallest; woff, ttf and otf also work.",readBy:"The typography client uses this as the @font-face src.",section:"Typography"},{key:"weight",label:"Weight",type:"freetext",description:'The numeric weight this file is, e.g. "400" or "700".',readBy:"The typography client uses this as the @font-face font-weight.",section:"Typography"}]},...ga("Title","Title","The game's name and headline display type, such as the wordmark."),...ga("Body","Body","Straplines, prose and most running text."),...ga("Number","Number","Figures a player reads, such as a target or a running total."),...ga("CTA","CTA","The label on a button a fan presses."),...ga("Label","Label","Captions and small chrome."),...ga("Highlight","Highlight","An accent word or a score.")],PE=[{key:"mIdEnabled",label:"Enabled",type:"boolean",description:"Turn Monterosa ID sign-in on for this game. Off leaves the game anonymous.",readBy:"The sign-in client, to decide whether to sign a fan in.",section:"Identify"},{key:"mIdFrontendUrl",label:"Frontend URL",type:"freetext",description:"The Monterosa ID host the sign-in check runs against, e.g. https://identify.example.com.",readBy:"The sign-in client, for the Identify session check.",section:"Identify"},{key:"mIdApiUrl",label:"API URL",type:"freetext",description:"The Monterosa ID API host. Usually the same as the Frontend URL.",readBy:"The sign-in client, for the Identify session check.",section:"Identify"},{key:"xClientId",label:"X-Client-ID",type:"freetext",description:"This game's Identify client id, sent with the session check. Per project; not shared with another game.",readBy:"The sign-in client, as the client id for the Identify check.",section:"Identify"},{key:"userAccessTitle",label:"User access title",type:"freetext",description:"The overlay title shown when a signed-out fan tries to play.",readBy:"The sign-in client, as the sign-in overlay title.",section:"Identify"},{key:"userAccessSubtitle",label:"User access subtitle",type:"wysiwyg",description:"The overlay subtitle shown when a signed-out fan tries to play.",readBy:"The sign-in client, as the sign-in overlay subtitle.",section:"Identify"},{key:"userAccessSignInUrlWeb",label:"Primary button link (web)",type:"freetext",description:"Where the sign-in button sends a signed-out fan on web, e.g. https://www.example.com/account/sign-in.",readBy:"The sign-in client, as the sign-in button's web link.",section:"Identify"},{key:"userAccessSignInUrlNativeIOS",label:"Primary button link (native iOS)",type:"freetext",description:"Sign-in link for a webview on iOS.",readBy:"The sign-in client, as the sign-in button's link in an iOS webview.",section:"Identify"},{key:"userAccessSignInUrlNativeAndroid",label:"Primary button link (native Android)",type:"freetext",description:"Sign-in link for a webview on Android.",readBy:"The sign-in client, as the sign-in button's link in an Android webview.",section:"Identify"},{key:"userAccessSignUpUrlWeb",label:"Secondary button link (web)",type:"freetext",description:"Where the sign-up button sends a signed-out fan on web. Leave empty for no second button.",readBy:"The sign-in client, as the sign-up button's web link.",section:"Identify"},{key:"userAccessSignUpUrlNativeIOS",label:"Secondary button link (native iOS)",type:"freetext",description:"Sign-up link for a webview on iOS.",readBy:"The sign-in client, as the sign-up button's link in an iOS webview.",section:"Identify"},{key:"userAccessSignUpUrlNativeAndroid",label:"Secondary button link (native Android)",type:"freetext",description:"Sign-up link for a webview on Android.",readBy:"The sign-in client, as the sign-up button's link in an Android webview.",section:"Identify"}],RE=[{key:"analytics_tealiumUrl",label:"Tealium URL",type:"freetext",description:"The Tealium utag.js URL the host page injects, e.g. https://tags.example.com/prod/utag.js. Leave it empty for no Tealium.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"analytics_adobeUrl",label:"Adobe Launch URL",type:"freetext",description:"The Adobe Launch script URL the host page injects. Leave it empty for no Adobe.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"analytics_oneTrustId",label:"OneTrust id",type:"freetext",description:"The OneTrust domain id for the consent banner. Leave it empty for no OneTrust banner.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abPathTemplateIntex",label:"Index path",type:"freetext",description:"The path to this game's index.html on the origin, e.g. /games/<game id>/index.html. Filled in when the game deploys.",readBy:"The host's edge function, to fetch the page it injects into.",section:"Analytics"},{key:"abSeoTitleHomePage",label:"SEO title",type:"freetext",description:"The page title for search results and browser tabs.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoDescriptionHomePage",label:"SEO description",type:"freetext",description:"The meta description shown under the title in search results.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoOgTitleHomePage",label:"Share title",type:"freetext",description:"The title shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoOgDescriptionHomePage",label:"Share description",type:"freetext",description:"The description shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abCanonicalUrlHomePage",label:"Canonical URL",type:"freetext",description:"The canonical URL for this game, e.g. https://play.example.com/the-limit.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoImage",label:"Share image",type:"image",description:"The image shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoLogo",label:"Favicon",type:"image",description:"The icon shown in a browser tab.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"}];Zj="Provisional result. Final at {finalAt}.",ss=[{key:"notify_enabled",label:"Offer result notifications",type:"boolean",description:"Let fans ask for their result after a pick. Off unless switched on.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"notify_channels",label:"Notification channels",type:"freetext",description:"Comma-separated channels: email, sms, rcs. Empty means email. SMS and RCS are for a later version.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"notify_terms_version",label:"Notification terms version",type:"freetext",description:"The version recorded with result consent. Empty means 2. Change it when the consent terms change.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"gate_age_required",label:"Ask fans to confirm their age",type:"list",options:[{name:"Use the game's setting",value:"game"},{name:"On",value:"yes"},{name:"Off",value:"no"}],description:"Before they play, fans tick a box to say they are old enough. Gamestage does not check what they tick. Use the game's setting to follow what the developer built in.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_minimum_age",label:"Minimum age",type:"number",description:"The age fans confirm they are, such as 18. Leave it empty to use the age the game was built with, or 18 if it names none.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_territories",label:"Countries",type:"freetext",description:"Where fans confirm they are, as two-letter country codes separated by commas, such as GB,IE. Leave it empty to ask nothing about where fans are.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_note",label:"Note above the boxes",type:"freetext",description:'One line fans read above the boxes, such as "This game is for UK residents only." Leave it empty for no note.',readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Dataset",type:"freetext",description:"A dataset name that the control plane reads from a private bucket, shared by every round. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"title_font",label:"Title typeface",type:"freetext",description:`The Google Font the game's name is set in at the top of the page, such as "Bebas Neue". It must be one of the families Gamestage offers (Anton, Archivo Black, Bebas Neue, Bungee, Chakra Petch, Fraunces, Oswald, Playfair Display, Russo One and others); any other name is ignored and the game's own title face is used. Leave it empty to keep that face.`,readBy:"The game's own page, on its title, loaded from Google Fonts after the page has drawn.",section:"Brand"},{key:"title_font_weight",label:"Title weight",type:"freetext",description:"How heavy the title is, as a number from 100 to 900 (400 is regular, 700 bold). A weight the typeface does not have becomes the nearest one it does; empty uses its heaviest.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_letter_spacing",label:"Title letter spacing",type:"freetext",description:"Space between the title's letters, as a fraction of the type size: 0.08 spreads it out, -0.02 tightens it, empty leaves the typeface's own spacing. Kept between -0.1 and 0.4.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_case",label:"Title case",type:"freetext",description:`Type "upper" to show the game's name in capital letters whatever case it is typed in. Leave it empty to show it as typed.`,readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_colour",label:"Title colour",type:"colour",description:"The colour of the game's name. Leave it empty to use the page's own text colour.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"logo_text",label:"Logo text",type:"freetext",description:"How the game's name is drawn as a logo, if different from its name. Put the characters to pick out in square brackets: WAGE[$] draws WAGE$ with the $ in the accent colour. The browser tab, the share text and screen readers still use the game's name. Leave it empty to draw the name.",readBy:"The game's own page, on its title and its intro screen.",section:"Brand"},{key:"logo_accent_colour",label:"Logo accent colour",type:"colour",description:"The colour of the characters in square brackets in the logo text. Leave it empty to use the title colour.",readBy:"The game's own page, on its title and its intro screen.",section:"Brand"},{key:"play_button_label",required:!0,label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its submit button.",section:"Wording"},...Pd,{key:"consent_brand_name",label:"Consent, who runs the game",type:"freetext",description:'Your brand, named on the consent banner as the one asking, e.g. "Arsenal". Required: a game with no brand name cannot deploy.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_title",label:"Consent, heading",type:"freetext",description:`The consent card's name, read by a screen reader rather than shown. Empty says "Your privacy".`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_detail",label:"Consent, explanation",type:"freetext",description:"The consent message. {brand} is replaced with your brand name. Empty says: {brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_accept_label",label:"Consent, accept button",type:"freetext",description:'Empty says "Accept". The same size as the reject button, filled in your accent colour.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_reject_label",label:"Consent, reject button",type:"freetext",description:'Empty says "Reject". The same size as the accept button, beside it.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_choose_label",label:"Consent, choose button",type:"freetext",description:'Opens the list of categories. Empty says "Manage preferences".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_save_label",label:"Consent, save button",type:"freetext",description:'Saves the categories a fan ticked. Empty says "Save my choices".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_analytics_label",label:"Consent, measurement category",type:"freetext",description:'Empty says "Measure how the game is played".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_marketing_label",label:"Consent, marketing category",type:"freetext",description:`Empty says "Offers and news from the game's owner".`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_functional_label",label:"Consent, preferences category",type:"freetext",description:'Empty says "Remember my preferences".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_settings_label",label:"Consent, settings link",type:"freetext",description:'The link a fan uses to change their mind later. Empty says "Privacy settings".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_policy_version",label:"Privacy policy version",type:"freetext",description:'Change this when your privacy policy changes, and every fan is asked again. Empty is "1".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"privacy_policy_url",label:"Privacy policy link",type:"freetext",description:`Where the banner's "Privacy policy" link goes. Required: a game with no privacy policy link cannot deploy.`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"embed_origins",label:"Sites that can pass on consent",type:"freetext",description:"Only for a game shown inside another website that already asks fans about privacy. Enter that website's address, such as https://www.example.com, and it can tell the game what a fan agreed to. Separate several with commas. A fan's own choice in the game always comes first. Leave it empty and the game asks every fan itself.",readBy:"The consent origin reader (parseEmbedOrigins, through readPresentation's embedOrigins), for the client's consent state. GS-860.",section:"Wording"},{key:"signin_play_as_label",label:"Sign-in, play as button",type:"freetext",description:`The button a fan signed in to gamestage.ai taps so their plays count on their account, e.g. "Play as {name}". {name} is replaced with the fan's name; the game never sees it. Empty: the button is not offered.`,readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{key:"signin_detail",label:"Sign-in, explanation",type:"freetext",description:"One line above the Play as button saying what tapping does. Empty draws the button alone.",readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{key:"signin_dismiss_label",label:"Sign-in, not now button",type:"freetext",description:"The button that hides the offer and plays as a guest. Empty draws no such button.",readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{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},...IE,...PE,...RE,...OE,...NE("Sponsor","on the result card and in the Hub for every edition")],xb=[{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"},...NE("This edition's sponsor","for this edition only, in place of the game's sponsor")],LE=[{key:"edition_live_contest",label:"Live contest",type:"freetext",description:"The contest this edition follows live, by the provider's id for it (for SportMonks, the fixture id). Leave it empty and the game shows no live data.",readBy:"packages/gamestage/src/live.ts, which subscribes the page to that contest's live data.",section:"This edition"}],Jj=[{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"}],So=[{key:"title",label:"Round name",type:"freetext",description:"How this round is listed in Studio, so you can tell rounds apart. Gamestage fills it in when it creates the round; change it to anything. Fans do not see it.",readBy:"Studio's timeline label. Nothing a fan loads reads it.",section:"Content",public:!1},{key:"source_url",label:"Content source",type:"freetext",description:"A URL for this round's content. The deployed control plane does not fetch it yet, so setting it has no effect on a live game. Use the content fields in Studio instead.",readBy:"The control plane, in its in-memory form only. The deployed control plane does not fetch it yet.",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"}],Xj=[{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"}]}]}],Sb="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",zE={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"},{key:"board_given",label:"Given name",type:"freetext",description:'Optional. When the pick is a person, the first line of their name as a fan reads it, e.g. "Ole Gunnar". Leave empty to split the pick at its first space.',readBy:"The game's own page, which draws a person's name on two lines. The Engine never reads it.",section:"This round"},{key:"board_family",label:"Family name",type:"freetext",description:'Optional. When the pick is a person, the bold second line of their name, e.g. "Solskjaer". Leave empty to split the pick at its first space.',readBy:"The game's own page, which draws a person's name on two lines. The Engine never reads it.",section:"This round"}]},Qj=[{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. Lead with what the fan has to decide, not who the players are: say "a \xA3100m player", never "a goalkeeper", since naming the category gives the answer away. Put the famous name on the board as the trap, not in this line. One line, e.g. "Only one of these players has scored a penalty so far this season." or "Who is the player that's not yet scored?"`,readBy:"The game's own page, above the board.",section:"This round"},zE,{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". ${Sb}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1},{key:"round_guesses",label:"Guesses a fan gets",type:"number",description:"How many picks a fan may make at this round. Leave it empty for the game's default (10 picks, 4 of them wrong). Set 1 for a quiz question: one pick, then the answer is shown.",readBy:"The Engine, which ends a fan's round once these are used.",section:"This round"}],eD=[{key:"answer_measure",label:"Answer from data",type:"freetext",description:'Leave empty to type the answer yourself. Otherwise the dataset measure the answer is worked out from, e.g. "own_goals", and the board holds dataset keys rather than names.',readBy:"The relay, which works out the answer when the round is provisioned.",section:"This round",public:!1},{key:"answer_rule",label:"Which player is right",type:"freetext",description:'With "Answer from data": highest, lowest, only_nonzero (the one player above zero) or only_zero (the one player on zero). A round where the rule fits more than one player is refused, never guessed.',readBy:"The relay.",section:"This round",public:!1},{key:"reveal_each_guess",label:"Show a wrong guess's figure",type:"freetext",description:'With "Answer from data": "yes" to show a wrong guess its own figure straight away, "no" to show every figure only at the end. Empty means yes.',readBy:"The Engine, when it marks a guess.",section:"This round",public:!1},{key:"round_layout",label:"How the board is drawn",type:"freetext",description:`Empty for cards. "pitch" to draw each player on a football pitch at their position, from the dataset; works with "Answer from data", and a round whose players have no position in the dataset stays as cards. "xi" to draw a team's eleven with one place empty, from "The eleven", and ask who played there.`,readBy:"The relay, which adds each player's position; then the game's page.",section:"This round"},{key:"round_lineup",label:"The eleven",type:"freetext",description:'For "xi" rounds only, written by `gamestage round seed --layout xi`. The team and its starting places as JSON: {"team":"AFC Bournemouth","formation":"4-2-3-1","places":[{"row":1,"column":1,"label":"Djordje Petrovic"},...]}. Row 1 is the goalkeeper. Exactly one place has no "label": that is the gap a fan fills, and its player goes in "The right answers" and on the board.',readBy:"The game's page, which draws it.",section:"This round"},{key:"round_twist",label:"The twist",type:"freetext",description:`One surprising line shown after the round, e.g. "He has also completed more passes than any other defender." ${Sb}`,readBy:"The Engine, which sends it only with a finished result.",section:"This round",public:!1},{key:"round_twist_source",label:"Where the twist is from",type:"freetext",description:'The publication and date, e.g. "Fantasy Premier League, 27 Sep 2026".',readBy:"The Engine, with the twist.",section:"This round",public:!1},{key:"round_twist_url",label:"The twist's link",type:"freetext",description:"A link to where the twist was reported. Optional.",readBy:"The Engine, with the twist.",section:"This round",public:!1}],tD=[{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"},zE,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${Sb}`,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"}]}],Tb=[{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"}],nD=[{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}],oD=[{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"}],rD=[{key:"mystery_answer",label:"The answer",type:"freetext",description:`The player fans are looking for, written exactly as the dataset names him, e.g. "Erling Haaland", or his dataset key. Must be a player in the game's dataset.`,readBy:"The Deduction Engine, as the mystery's subject.",section:"This mystery",public:!1},{key:"mystery_first_clue",label:"Free clue",type:"freetext",description:'The clue every fan starts with, e.g. "He is a forward." Never his club: that gives too much away, so a free clue about the club is shown second instead. Required, 200 characters at most.',readBy:"The game's own page, as the first clue.",section:"This mystery",public:!0},{key:"mystery_first_clue_field",label:"Free clue is about",type:"freetext",description:"Which dataset field the free clue gives away, so the game narrows the field on it: position, nationality, age or any other field the dataset holds, except team. Leave it empty for position.",readBy:"The Deduction Engine, to narrow the field on the free clue.",section:"This mystery",public:!0},{key:"mystery_second_clue",label:"Second clue",type:"freetext",description:'The clue a fan gets when their coins run low, e.g. "He plays for Manchester City." Required, 200 characters at most.',readBy:"The game's own page, as the second clue.",section:"This mystery",public:!0},{key:"mystery_second_clue_field",label:"Second clue is about",type:"freetext",description:"Which dataset field the second clue gives away. Must differ from the free clue's. Leave it empty for team, or for position when the free clue is about team.",readBy:"The Deduction Engine, to narrow the field on the second clue.",section:"This mystery",public:!0},{key:"mystery_difficulty",label:"Difficulty",type:"number",description:"1 easy, 2 medium or 3 hard. Leave it empty for 1.",readBy:"The Deduction Engine, which scores a solve by it.",section:"This mystery",public:!0}],jE="arcade_ties_shared",aD="results_mode",DE=[{key:aD,label:"Results",type:"list",options:[{name:"Automatic: settle as soon as the match result is confirmed",value:"automatic"},{name:"Need approval: hold each result for a producer to approve",value:"approval"}],description:"How results from the match data reach fans. Automatic settles straight away and you can still correct it. Need approval shows the proposed result in Stage and waits for you.",readBy:"The control plane's settler.",section:"Predict results"}],Eb={predict:DE,arcade:[{key:jE,label:"Equal scores share a place",type:"boolean",description:"Arcade games only. On: two fans on the same score are both shown in the same place. Off: the fan who got there first is placed higher. On unless you turn it off.",readBy:"The Arcade Engine, when it ranks a board.",section:"Arcade leaderboard"}]},$b={key:"predict_void",label:"Void this question",type:"list",options:[{name:"No",value:"no"},{name:"Yes, return everyone's pick",value:"yes"}],default:"no",description:"Choose Yes to return everyone's pick for this question: fans score 0 and their picks are not marked wrong. Choose No to use the normal result again.",readBy:"The control plane, which settles the question as void regardless of its normal result.",section:"Result",public:!1},Ab=[{key:"scoreline_home",label:"Home team",type:"freetext",description:"The team playing at home, as fans know it. For example: Arsenal.",readBy:"The control plane, when it builds the round from this edition, and the game's page, which labels the home score with it.",section:"This match",required:!0},{key:"scoreline_away",label:"Away team",type:"freetext",description:"The team playing away, as fans know it. For example: Chelsea.",readBy:"The control plane, when it builds the round from this edition, and the game's page, which labels the away score with it.",section:"This match",required:!0},{key:"scoreline_points",label:"Points for the exact score",type:"number",description:"Points a fan earns for calling this match's exact score. Leave it empty to use the edition's setting, which is 5 unless you change it.",readBy:"The control plane, into the round the Engine marks.",section:"This match",public:!1},{key:"scoreline_result_points",label:"Points for the right result",type:"number",description:"Points a fan earns for the right result without the exact score: the right winner, or a draw when it was a draw. Leave it empty to use the edition's setting, which is 2 unless you change it.",readBy:"The control plane, into the round the Engine marks.",section:"This match",public:!1},{key:"scoreline_fixture",label:"Match to settle from",type:"freetext",description:"The match this question is about, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match. With a match set, the final score is filled in for you after full time.",readBy:"The control plane's settler, which reads the match result and writes the final score below.",section:"Result",public:!1},$b,{key:"scoreline_result_home",label:"Final score, home",type:"number",description:"Goals the home team scored by the end of normal time. Filled in for you when a match is set; type it yourself otherwise, or to correct it.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1},{key:"scoreline_result_away",label:"Final score, away",type:"number",description:"Goals the away team scored by the end of normal time.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1}],Cb=[{key:"number_prompt",label:"Question",type:"freetext",description:"What fans are asked. For example: In which minute is the first goal scored?",readBy:"The control plane, when it builds the round from this edition, and the game's page, which shows it.",section:"This question",required:!0},{key:"number_min",label:"Lowest answer",type:"number",description:"The smallest number a fan can give. For the minute of the first goal, 1.",readBy:"The control plane, into the round, and the game's page, which sets the control's range.",section:"This question",required:!0},{key:"number_max",label:"Highest answer",type:"number",description:"The largest number a fan can give. For the minute of the first goal, 90, or 120 if extra time is possible.",readBy:"The control plane, into the round, and the game's page, which sets the control's range.",section:"This question",required:!0},{key:"number_tie_breaker",label:"Use as the tie-breaker",type:"boolean",description:"Fans on equal points are ranked by who was closest to this answer. It earns no points of its own and does not count towards getting every question right. Only one question in an edition can be the tie-breaker.",readBy:"The control plane, which marks this question as the round's tie-breaker.",section:"This question",public:!1},{key:"number_settle_rule",label:"Settle automatically",type:"list",options:[{name:"No, I will type the answer",value:"manual"},{name:"Total goals in the match",value:"total"}],description:"Whether the answer is filled in for you from the match result after full time.",readBy:"The control plane's settler.",section:"Result",public:!1},$b,{key:"number_fixture",label:"Match to settle from",type:"freetext",description:"The match, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match.",readBy:"The control plane's settler.",section:"Result",public:!1},{key:"number_result",label:"Answer",type:"number",description:"What happened. Filled in for you when the question settles automatically; type it yourself otherwise, or to correct it.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1}],iD=[{key:"predict_exact_points",label:"Points for an exact score",type:"number",description:"Points a fan earns for each match where they call the exact score. Leave it empty for 5.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"predict_result_points",label:"Points for the right result",type:"number",description:"Points a fan earns for each match where they call the right result but not the exact score. Leave it empty for 2.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"settle_fixture",label:"Match",type:"freetext",description:"The match this edition is about, as provider:id, for example sportmonks:19722146. Every question uses it unless it names its own. With a match set, results are filled in for you after full time, and picks close at kick-off.",readBy:"The control plane's settler, and the close time below.",section:"Results and closing",public:!1},{key:"picks_close_minutes_before",label:"Close picks before kick-off (minutes)",type:"number",description:"How many minutes before the earliest kick-off picks close. Leave it empty to close at kick-off.",readBy:"The control plane, which sets the round's close time.",section:"Results and closing",public:!1},{key:"picks_close_at",label:"Close picks at",type:"freetext",description:"A fixed time picks close, UK time, for example 2026-10-18 15:00. Use it when the edition names no match, or to override kick-off.",readBy:"The control plane, which sets the round's close time.",section:"Results and closing",public:!1}],sD=[{key:"prediction_settle_rule",label:"Settle automatically",type:"list",options:[{name:"No, I will choose the answer",value:"manual"},{name:"Result (options: home win, draw, away win)",value:"result"},{name:"Both teams score (options: yes, no)",value:"both_score"},{name:"Home clean sheet (options: yes, no)",value:"clean_sheet_home"},{name:"Away clean sheet (options: yes, no)",value:"clean_sheet_away"}],description:"Whether the correct option is chosen for you from the match result after full time. Your options must be in the order shown.",readBy:"The control plane's settler.",section:"Result",public:!1},$b,{key:"prediction_fixture",label:"Match to settle from",type:"freetext",description:"The match, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match.",readBy:"The control plane's settler.",section:"Result",public:!1}],cs={hunt:[...Qj,...eD],push:Xj,group:tD,predict:sD,bingo:nD,shoot:oD,place:[],mystery:rD,arcade:[]},Ib={hunt:[],push:[],group:[],predict:iD,bingo:Jj,shoot:[],place:[],mystery:[],arcade:[]},Ob={display_name:"displayName",title_font:"titleFont",title_font_weight:"titleFontWeight",title_letter_spacing:"titleLetterSpacing",title_colour:"titleColour",title_case:"titleCase",logo_text:"logoText",logo_accent_colour:"logoAccentColour",splash_gradient_start:"splashGradientStart",splash_gradient_end:"splashGradientEnd",splash_play_label:"splashPlayLabel",splash_continue_label:"splashContinueLabel",splash_error_text:"splashErrorText",splash_retry_label:"splashRetryLabel",consent_brand_name:"consentBrandName",consent_title:"consentTitle",consent_detail:"consentDetail",consent_accept_label:"consentAcceptLabel",consent_reject_label:"consentRejectLabel",consent_choose_label:"consentChooseLabel",consent_save_label:"consentSaveLabel",consent_analytics_label:"consentAnalyticsLabel",consent_marketing_label:"consentMarketingLabel",consent_functional_label:"consentFunctionalLabel",consent_settings_label:"consentSettingsLabel",consent_policy_version:"consentPolicyVersion",privacy_policy_url:"privacyPolicyUrl",signin_play_as_label:"signInPlayAsLabel",signin_detail:"signInDetail",signin_dismiss_label:"signInDismissLabel",recovery_open_label:"recoveryOpenLabel",recovery_show_title:"recoveryShowTitle",recovery_show_detail:"recoveryShowDetail",recovery_private_note:"recoveryPrivateNote",recovery_replace_note:"recoveryReplaceNote",recovery_enter_title:"recoveryEnterTitle",recovery_enter_detail:"recoveryEnterDetail",recovery_submit_label:"recoverySubmitLabel",recovery_not_recognised:"recoveryNotRecognised",recovery_restored:"recoveryRestored",recovery_get_label:"recoveryGetLabel",recovery_issue_failed:"recoveryIssueFailed",recovery_copy_label:"recoveryCopyLabel",recovery_copied_label:"recoveryCopiedLabel",recovery_share_label:"recoveryShareLabel",recovery_close_label:"recoveryCloseLabel",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",edition_live_contest:"liveContest",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"},cD=new Set(["titleFont","titleFontWeight","titleLetterSpacing","titleColour","titleCase","logoText","logoAccentColour"]),lD=new Set(["splashGradientStart","splashGradientEnd","splashPlayLabel","splashContinueLabel","splashErrorText","splashRetryLabel","logoText","logoAccentColour"]);xo="label_",dD="label_taster_";AE={"Abril Fatface":[400],Anton:[400],"Archivo Black":[400],"Bebas Neue":[400],Bungee:[400],"Chakra Petch":[300,400,500,600,700],"DM Serif Display":[400],Fraunces:[400,600,700,900],Oswald:[400,500,600,700],"Playfair Display":[400,700,900],"Russo One":[400],"Space Grotesk":[400,500,700],Teko:[400,500,600,700],Unbounded:[400,700,900]},Pb="https://gamestage.ai";Rb=ss.filter(e=>e.required).map(e=>e.key),GE={signin_play_as_label:"Play as {name}",signin_detail:"Your scores in this game count on your Gamestage account.",signin_dismiss_label:"Not now"}});function fD(e){let t=De(e);return[...hd.includes(t)?So.filter(r=>r.key==="title"):So,...cs[t]??[]]}function Ld(e){return(e.fieldset??[]).flatMap(t=>[t.key,...Ld(t)])}function Nb(e,t,o,r=new Map){return{...e,section:o,...e.fieldset?{fieldset:e.fieldset.filter(n=>!t.has(n.key)).map(n=>{let a=Nb(n,t,o,r),i=r.get(n.key);return i?.label&&(a.label=i.label),i?.description&&(a.description=i.description),a})}:{}}}function zd(e,t){let o=fD(e),r=new Map(o.map(i=>[i.key,i])),n=new Set,a=[];for(let i of t.fields){let c=r.get(i.key);if(!c)return{ok:!1,reason:`round_fields.fields: "${i.key}" is not a round field of a ${De(e)} game. It offers ${o.map(f=>f.key).join(", ")}.`};if(n.has(i.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" is listed twice.`};n.add(i.key);let d=i.section??t.section??c.section,l=new Set(i.omit??[]);if(l.size>0){let f=new Set(Ld(c));if(f.size===0)return{ok:!1,reason:`round_fields.fields: "${i.key}" holds no list, so it has nothing to omit.`};for(let g of l)if(!f.has(g))return{ok:!1,reason:`round_fields.fields: "${i.key}" has no field "${g}" to omit. Inside it are ${[...f].join(", ")}.`}}let u=new Map;if(i.fields){let f=new Set(Ld(c));if(f.size===0)return{ok:!1,reason:`round_fields.fields: "${i.key}" holds no list, so it has no fields inside to word.`};let g=new Set(Ld(Nb(c,l,d)));for(let b of i.fields){if(f.has(b.key)&&!g.has(b.key)&&!l.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" words "${b.key}", but it sits inside a field this entry omits (${[...l].join(", ")}). Remove one.`};if(!f.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" has no field "${b.key}" inside it. Inside it are ${[...f].join(", ")}.`};if(l.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" both omits and words "${b.key}". Remove one.`};if(u.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" words "${b.key}" twice.`};u.set(b.key,b)}}if(i.options&&c.type!=="freetext")return{ok:!1,reason:`round_fields.fields: "${i.key}" is not free text, so it cannot become a fixed list of options.`};let p=Nb(c,l,d,u);i.label&&(p.label=i.label),i.description&&(p.description=i.description),i.options&&(p.type="list",p.options=i.options.map(f=>typeof f=="string"?{name:f,value:f}:f)),a.push(p)}return!hD.includes(De(e))&&!n.has("title")?{ok:!1,reason:'round_fields.fields: include "title". Studio lists each round by it and every deploy names new rounds through it; it is never shown to a fan.'}:{ok:!0,fields:a}}var uD,mD,pD,ds,hD,us=_(()=>{"use strict";je();sn();Vt();uD=s.union([s.string().min(1),s.object({name:s.string().min(1),value:s.string().min(1)}).strict()]),mD=s.object({key:s.string().min(1),label:s.string().min(1).optional(),description:s.string().min(1).optional()}).strict(),pD=s.object({key:s.string().min(1),label:s.string().min(1).optional(),description:s.string().min(1).optional(),section:s.string().min(1).optional(),omit:s.array(s.string().min(1)).min(1).optional(),fields:s.array(mD).min(1).optional(),options:s.array(uD).min(1).optional()}).strict(),ds=s.object({section:s.string().min(1).optional(),fields:s.array(pD).min(1)}).strict(),hD=["predict","bingo"]});function BE(e){if(e.includes("/"))return'id: a game id cannot contain "/", because no API can carry it in a URL. Choose an id of letters, digits and hyphens.'}var Lb=_(()=>{"use strict"});function WE(e){if(!gD.test(e))return`"${e}" is not a theme name. Use 3 to 40 lowercase letters and numbers, with single hyphens between them, such as acme or acme-dark.`;if(qE.includes(e))return`"${e}" is one of Gamestage UI's own themes. Choose a name of your own, such as your company's.`}function HE(e){return yD.test(e)?void 0:`"${e}" is not a version. Use three numbers, such as 1.0.0.`}function ya(e){let t=e.lastIndexOf("@");if(t<=0)return{ok:!1,reason:`"${e}" names no version. Pin one exactly, such as acme@1.0.0.`};let o=e.slice(0,t),r=e.slice(t+1),n=WE(o)??HE(r);return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}var qE,gD,yD,ms=_(()=>{"use strict";qE=["base","arcade","paper","stadium"],gD=/^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$/,yD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/});function zb(e){return bD.test(e)?void 0:`"${e}" is not a starter name. Use 3 to 40 lowercase letters and numbers, with single hyphens between them, such as web-embed or fan-app-react.`}function jb(e){return wD.test(e)?void 0:`"${e}" is not a version. Use three numbers, such as 1.0.0.`}function YE(e){let t=e.lastIndexOf("@");if(t<=0)return{ok:!1,reason:`"${e}" names no version. Pin one exactly, such as web-embed@1.0.0.`};let o=e.slice(0,t),r=e.slice(t+1),n=zb(o)??jb(r);return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}function VE(e){let t=e.lastIndexOf("@"),o=t>0?e.slice(0,t):e,r=t>0?e.slice(t+1):"latest",n=zb(o)??(r==="latest"?void 0:jb(r));return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}var bD,wD,jd=_(()=>{"use strict";bD=/^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$/,wD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/});function SD(e){return QE.includes(e)}function KE(e){return t$.includes(De(e))}function n$(e){let t=[],o=e.backend.archetype;if(e.round_fields&&o&&!KE(o)){let i=zd(o,e.round_fields);i.ok||t.push({path:"round_fields",message:i.reason})}o&&KE(o)&&t.push({path:"backend.archetype",message:`\`${o}\` is a classification, not a format the Engine marks. The formats it marks are ${Yt.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 r=e.backend.route;r&&SD(r)&&t.push({path:"backend.route",message:`\`${r}\` is a classification, not a route Gamestage implements. Set \`${Fb}\`: 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;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."}));let a=BE(e.app.id);if(a&&t.push({path:"app.id",message:a.replace(/^id: /,"")}),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.identify&&e.identity.provider&&e.identity.provider!=="identify"&&t.push({path:"identity.identify",message:"Present, but identity.provider is `"+e.identity.provider+"`. An `identify` block is read only when the provider is `identify`. Set the provider to `identify`, or remove the block."}),e.identity.jwt&&e.identity.provider==="identify"&&t.push({path:"identity.jwt",message:"Present, but identity.provider is `identify`. A `jwt` block is read only when the provider is `jwt`. Remove it, or set the provider to `jwt`."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let c=e.identity.jwt[i],d=_d(c);d&&t.push({path:`identity.jwt.${i}`,message:xd(d)})}return e.identity.territory.required&&e.identity.territory.allowed.length===0&&t.push({path:"identity.territory.allowed",message:"Name at least one country, as an ISO code such as GB, when identity.territory.required is true."}),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 ps,Db,Mb,ba,ZE,hs,To,Eo,JE,vD,cn,kD,_D,xD,XE,Fb,QE,e$,$o,t$,TD,ED,$D,AD,CD,ID,OD,PD,RD,ND,Ub,LD,zD,jD,DD,Gb,Dd,MD,FD,Ao,wa,$n=_(()=>{"use strict";ob();ar();je();ib();vd();Sd();Vi();Vt();Kt();us();Lb();ms();jd();ps="1.0",Db=s.enum(["missing","proposed","confirmed","verified","approved"]),Mb={missing:0,proposed:1,confirmed:2,verified:3,approved:4},ba=s.enum(["runtime","live","enterprise"]),ZE="Accounts must be approved before the first deploy.",hs={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},To=s.enum(["L0","L1","L2","L3","L4","L5"]),Eo={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},JE={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},vD=s.discriminatedUnion("kind",[s.object({kind:s.literal("human_decision"),owner:s.string(),date:s.string(),note:s.string().optional()}),s.object({kind:s.literal("generated_proposal"),tool:s.string(),model:s.string().optional(),source_context:s.string().optional()}),s.object({kind:s.literal("repository_evidence"),file:s.string(),commit:s.string().optional(),package:s.string().optional()}),s.object({kind:s.literal("platform_evidence"),system:s.string(),id:s.string()}),s.object({kind:s.literal("external_evidence"),supplier:s.string(),licence:s.string().optional(),dataset_version:s.string().optional()})]),cn={status:Db.default("missing"),provenance:s.array(vD).default([])},kD=s.object({schema_version:s.string(),revision:s.number().int().nonnegative().default(0),conformance:To.default("L0")}),_D=s.object({repository:s.string().url(),branch:s.string().default("main")}),xD=s.object({id:s.string().min(1),title:s.string().min(1),summary:s.string().optional(),source:_D.optional(),owners:s.object({ip:s.string().optional(),delivery:s.string().optional(),platform:s.string().optional()}).prefault({}),...cn}),XE=s.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Fb="managed_runtime",QE=XE.options.filter(e=>e!==Fb);e$=s.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place","mystery","arcade"]),$o=s.preprocess(e=>typeof e=="string"?De(e):e,e$),t$=e$.options.filter(e=>!Yt.includes(e));TD=s.object({route:XE.optional().describe(`Only ${Fb} is a route Gamestage implements: every game runs on our Engine. ${QE.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:$o.optional().describe(`The formats the Engine marks are ${Yt.join(", ")}. ${t$.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:s.string().optional(),version:s.string().optional(),variant:s.string().optional(),configuration:s.record(s.string(),s.unknown()).default({}),round:Ve.optional(),arcade:lE.optional(),...cn}),ED=s.object({surfaces:s.array(s.string()).default([]),container_label:s.string().min(1).default(ma),layout:gd.optional(),host:yd.optional(),screen_graph:s.string().optional(),design:s.object({figma_file:s.string().optional(),figma_version:s.string().optional(),tokens:s.string().optional(),fidelity:To.optional(),system:s.string().superRefine((e,t)=>{let o=ya(e);o.ok||t.addIssue({code:"custom",message:o.reason})}).optional()}).optional(),starter:s.string().superRefine((e,t)=>{let o=YE(e);o.ok||t.addIssue({code:"custom",message:o.reason})}).optional(),...cn}),$D=s.object({spec_url:s.string().optional(),version:s.string().optional(),...cn}),AD=s.object({family:s.string().optional(),version:s.string().optional(),configuration_schema:s.string().optional(),...cn}),CD=s.object({project_template:s.string().optional(),project_id:s.string().optional(),events:s.array(s.string()).default([]),elements:s.array(s.string()).default([]),...cn}),ID=s.object({required:s.boolean().default(!1),minimum_age:s.number().int().positive().max(120).optional(),method:s.enum(["self_declared","verified"]).default("self_declared"),verifier:s.string().optional()}),OD=s.object({required:s.boolean().default(!1),allowed:s.array(s.string().regex(/^[A-Z]{2}$/)).default([]),method:s.enum(["self_declared"]).default("self_declared")}),PD=s.object({issuer:s.string().url(),jwks_uri:s.string().url(),audience:s.string().optional(),player_id_claim:s.string().regex(/^[A-Za-z_][A-Za-z0-9_.:-]*$/,"A claim name, such as SubscriberId.").optional()}),RD=s.object({strategy:s.string().default("email"),provider:s.string(),assertion:s.boolean().optional()}),ND=s.object({provider:s.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:PD.optional(),identify:RD.optional(),require_authenticated_writes:s.boolean().default(!0),age_gate:ID.prefault({}),territory:OD.prefault({}),gate_note:s.string().max(200).optional(),consent:s.object({analytics_requires_consent:s.boolean().default(!0),provider:s.string().optional()}).prefault({}),...cn}),Ub=s.object({type:s.enum(["monterosa","posthog","ga4","webhook"]),enabled:s.boolean().default(!0),config:s.record(s.string(),s.string()).default({})}),LD=s.object({destinations:s.array(Ub).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:s.array(s.string()).default([]),signal:s.object({enabled:s.boolean().default(!1),application_id:s.string().optional(),write_key:s.string().optional(),monterosa:s.object({enabled:s.boolean().default(!1),organisation_id:s.string().optional(),project_id:s.string().optional()}).prefault({})}).prefault({}),...cn}),zD=s.object({hosting:s.string().optional(),space_spec:s.string().optional(),environments:s.array(s.enum(["local","playground","staging","production"])).default(["local"]),...cn}),jD=s.object({offers_prize:s.boolean().default(!1),free_entry_route:s.string().optional(),skill_based:s.boolean().default(!1),terms_url:s.string().optional(),jurisdictions:s.array(s.string()).default([])}),DD=s.object({support_tier:ba.optional(),runbook:s.string().optional(),promotion:jD.prefault({}),...cn}),Gb=s.object({tool:s.string().min(1),ran_at:s.string().regex(/^\d{4}-\d{2}-\d{2}$/,"ran_at is a date, YYYY-MM-DD"),result:s.enum(["passed","issues_fixed","issues_open"]),owner:s.string().optional(),evidence:s.string().optional(),note:s.string().optional()}),Dd=Gb.or(s.unknown()),MD=s.object({accessibility:Dd.optional(),security:Dd.optional(),secrets:Dd.optional(),privacy:Dd.optional(),...cn}),FD=s.object({provider:s.enum(_o).default("sportmonks").describe("Where the contest's live data comes from. SportMonks today; more providers follow.")}).describe("Live data: the game follows a real contest as it happens. Present means on. The edition names the contest in Studio, and game.live() hands the page what happens."),Ao=s.object({notify_enabled:s.boolean().default(!1),notify_channels:s.array(s.enum(["email","sms","rcs"])).min(1).default(["email"]),manifest:kD,app:xD,experience:ED.prefault({}),studio_app:$D.prefault({}),studio_surface:AD.prefault({}),backend:TD.prefault({}),interaction_cloud:CD.prefault({}),identity:ND.prefault({}),measurement:LD.prefault({}),deployment:zD.prefault({}),operations:DD.prefault({}),assurance:MD.prefault({}),live:FD.optional(),round_fields:ds.optional()});wa=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function UD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fs(){if(o$)return Co;o$=1;function e(i){return typeof i>"u"||i===null}function t(i){return typeof i=="object"&&i!==null}function o(i){return Array.isArray(i)?i:e(i)?[]:[i]}function r(i,c){if(c){let d=Object.keys(c);for(let l=0,u=d.length;l<u;l+=1){let p=d[l];i[p]=c[p]}}return i}function n(i,c){let d="";for(let l=0;l<c;l+=1)d+=i;return d}function a(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return Co.isNothing=e,Co.isObject=t,Co.toArray=o,Co.repeat=n,Co.isNegativeZero=a,Co.extend=r,Co}function gs(){if(r$)return Bb;r$=1;function e(o,r){let n="",a=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(n+='in "'+o.mark.name+'" '),n+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!r&&o.mark.snippet&&(n+=`
83
+ `," ")}".`,readBy:"The predict settler, which hands it to the Engine to word each fan's result message.",section:"Result notifications"}))});var ts,fb,gb,sr,_E,ns=_(()=>{"use strict";ts="penalty_v1",fb=["easy_v1","balanced_v1","hard_v1"],gb="balanced_v1",sr={aimX:{min:-1200,max:1200},aimY:{min:-200,max:1200},power:{min:0,max:1e3}},_E="shoot"});function os(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.void===!0}function Fj(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let{home:t,away:o}=e;return typeof t=="number"&&typeof o=="number"&&Number.isInteger(t)&&Number.isInteger(o)&&t>=0&&o>=0}var cr,ha,Ad,rs,Pj,Rj,xE,Nj,Lj,Cd,zj,jj,yb,Dj,bb,SE,Mj,wb,TE,EE,vb,Uj,$E,Gj,Id,Bj,qj,Wj,Hj,Yj,Ve,n7,o7,r7,Kt=_(()=>{"use strict";je();Vt();Td();hb();Qi();Ed();$d();ns();cr={scoreOrder:s.enum(["high_first","low_first"]).optional().describe("Which score wins: high_first for most points, low_first for a fastest time, fewest attempts or closest to a target. Absent means high_first.")},ha=s.object({source:s.string().min(1),date:s.string().optional(),url:s.string().optional()}),Ad=s.object({text:s.string().min(1),sources:s.array(ha).default([])}),rs=s.enum(["highest","lowest","only_nonzero","only_zero"]),Pj=s.object({measure:s.string().min(1),label:s.string().default(""),rule:rs,scale:s.number().int().positive().default(1),values:s.record(s.string(),s.number().int().nonnegative()),perGuess:s.boolean().default(!0),sources:s.record(s.string(),ha).optional()}),Rj=s.enum(["grid","pitch","xi"]),xE=s.object({team:s.string().min(1),formation:s.string().optional(),places:s.array(s.object({row:s.number().int().positive(),column:s.number().int().positive(),label:s.string().min(1).optional()})).min(2).max(11)}).superRefine((e,t)=>{let o=e.places.filter(r=>!r.label).length;o!==1&&t.addIssue({code:"custom",path:["places"],message:`An eleven needs exactly one empty place to fill; this one has ${o}.`})}),Nj=s.object({solution:s.string().min(1).max(120).refine(e=>hE(e).length>0,"The phrase needs at least one letter or digit to draw."),drawOrder:s.enum(["seeded","random"]).default("seeded"),drawsAllowed:s.number().int().min(1).max(36).default(3),points:s.object({bySpins:s.array(s.number().int().nonnegative()).max(36).optional(),forPlaying:s.number().int().nonnegative().optional(),forCorrect:s.number().int().nonnegative().optional()}).strict().optional()}).strict(),Lj=s.object({kind:s.enum(["word","number"]),answer:s.union([s.string().min(1).max(40),s.number()]),length:s.number().int().min(1).max(40).optional(),guessesAllowed:s.number().int().min(1).max(20).default(6),feedback:s.enum(["letters","higher_lower","none"]).optional(),validWords:s.boolean().optional(),clues:s.array(s.string().trim().min(1).max(200)).max(20).optional(),picture:s.string().url().max(2e3).refine(e=>e.startsWith("https://"),"A picture must be an https address.").optional(),points:s.object({byGuesses:s.array(s.number().int().nonnegative()).max(20).optional(),forPlaying:s.number().int().nonnegative().optional(),forCorrect:s.number().int().nonnegative().optional()}).strict().optional()}).strict().superRefine((e,t)=>{let o=(n,a)=>t.addIssue({code:"custom",path:[n],message:a});if(e.kind==="number"){typeof e.answer!="number"&&o("answer","A number round's answer must be a number."),e.feedback==="letters"&&o("feedback","Letter colours need a word. A number round gives higher_lower or none."),e.validWords&&o("validWords","Real words only applies to a word round."),e.length!==void 0&&o("length","A number round has no length.");return}if(typeof e.answer!="string"){o("answer","A word round's answer must be text.");return}let r=gE(e.answer);if(!yE(r)){o("answer","A word answer is letters only, with no spaces, digits or punctuation.");return}e.length!==void 0&&e.length!==r.length&&o("length",`The answer has ${r.length} letters, not ${e.length}.`),e.feedback==="higher_lower"&&o("feedback","Higher or lower needs a number. A word round gives letters or none."),e.validWords&&!pb.includes(r.length)&&o("validWords",`Real words only works for words of ${pb.join(", ")} letters; this answer has ${r.length}.`)}),Cd=s.object({archetype:s.literal("hunt"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(s.string().min(1)).min(2).default([...fE]),layout:Rj.optional(),positions:s.record(s.string(),s.string().min(1)).optional(),names:s.record(s.string(),s.object({given:s.string().optional(),family:s.string().optional()})).optional(),teams:s.record(s.string(),s.string().min(1)).optional(),images:s.record(s.string(),s.string().url()).optional(),lineup:xE.optional(),productsAbout:s.enum(["parent","theme","none"]).optional(),targets:s.array(s.string().min(1)).default([]),solve:Nj.optional(),guess:Lj.optional(),required:s.number().int().positive().optional(),figures:Pj.optional(),facts:s.array(Ad).optional(),pointsPerTarget:s.number().int().nonnegative().default(10),completionBonus:s.number().int().nonnegative().default(0),mistakePenalty:s.number().int().nonnegative().optional(),attemptsAllowed:s.number().int().positive().default(10),mistakesAllowed:s.number().int().positive().default(4),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{if(e.solve&&e.guess){t.addIssue({code:"custom",path:["guess"],message:"A round is a solve round or a guess round, never both."});return}if(e.guess){e.targets.length>0&&t.addIssue({code:"custom",path:["targets"],message:"A guess round's answer is in its guess block. Leave targets out."});return}if(e.solve){e.targets.length>0&&t.addIssue({code:"custom",path:["targets"],message:"A solve round's targets are the letters of its phrase. Leave targets out."});return}if(e.targets.length===0){t.addIssue({code:"custom",path:["targets"],message:"At least one target is needed, or a solve or guess block."});return}let o=e.targets.filter(r=>!e.board.includes(r));o.length&&t.addIssue({code:"custom",path:["targets"],message:`Not on the board: ${o.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.`})}),zj=s.object({key:s.string().min(1),label:s.string().min(1),value:s.number().int().nonnegative(),source:ha.optional()}),jj=s.object({id:s.string().min(1),label:s.string().default(""),entries:s.array(zj).min(1)}),yb=s.object({within:s.number().min(0).max(1),label:s.string().min(1)}),Dj=[{within:.02,label:"Hall of Fame"},{within:.05,label:"All-NBA"},{within:.1,label:"All-Star"},{within:.18,label:"Starter"},{within:.28,label:"Veteran"}],bb=s.object({mode:s.literal("proximity"),pointsPer:s.number().int().positive().default(1e3),exactBonus:s.number().int().nonnegative().default(500)}),SE=s.object({archetype:s.literal("push"),scoring:bb.optional(),facts:s.array(Ad).optional(),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),target:s.number().int().positive(),targetLabel:s.string().default(""),unit:s.string().max(4).default(""),theme:s.string().default(""),slates:s.array(jj).min(1),line:s.array(s.object({slate:s.string(),key:s.string()})).optional(),tiers:s.array(yb).default(Dj),floorLabel:s.string().default("Rookie"),bustLabel:s.string().default("Busted"),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional(),compare:s.literal("each_at_least_last").optional(),locksAt:s.string().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 c=0,d=!1;for(let l of e.line){let p=e.slates.find(f=>f.id===l.slate)?.entries.find(f=>f.key===l.key);if(!p){d=!0,t.addIssue({code:"custom",path:["line"],message:`The line names "${l.key}" on slate "${l.slate}", which the round does not hold.`});break}c+=p.value}!d&&c!==e.target&&t.addIssue({code:"custom",path:["line"],message:`The line sums to ${c}, not the target ${e.target}. A perfect line lands exactly.`})}let o=e.slates.map(c=>c.id);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["slates"],message:"Two slates share an id. A play names the slate it picked from."});let r=e.slates.flatMap(c=>c.entries.map(d=>d.key)),n=[...new Set(r.filter((c,d)=>r.indexOf(c)!==d))];n.length&&t.addIssue({code:"custom",path:["slates"],message:`The same key on more than one slate: ${n.join(", ")}. A play names a key, so each one must belong to exactly one slate.`});let a=e.slates.reduce((c,d)=>c+Math.min(...d.entries.map(l=>l.value)),0);!e.compare&&a>e.target&&t.addIssue({code:"custom",path:["target"],message:`The lowest possible total is ${a}, which is already over ${e.target}. Every player would bust.`}),e.tiers.every((c,d)=>d===0||c.within>e.tiers[d-1].within)||t.addIssue({code:"custom",path:["tiers"],message:"Tiers must be ordered from closest to furthest. Out of order, the first one that matches is the wrong one and every player is awarded it."})}),Mj=s.object({key:s.string().min(1),label:s.string().min(1),members:s.array(s.string().min(1)).min(2)}),wb=s.object({archetype:s.literal("group"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(s.string().min(1)).min(4),groups:s.array(Mj).min(2),pointsPerGroup:s.number().int().nonnegative().default(10),completionBonus:s.number().int().nonnegative().default(0),attemptsAllowed:s.number().int().positive().default(10),mistakesAllowed:s.number().int().positive().default(4),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=new Map;for(let a of e.groups){let i=a.members.filter(c=>!e.board.includes(c));i.length&&t.addIssue({code:"custom",path:["groups"],message:`${a.key} has members that are not on the board: ${i.join(", ")}.`});for(let c of a.members){let d=o.get(c);d&&d!==a.key&&t.addIssue({code:"custom",path:["groups"],message:`${c} is in both ${d} and ${a.key}. Groups cannot overlap.`}),o.set(c,a.key)}}new Set(e.groups.map(a=>a.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 r=new Set(e.groups.flatMap(a=>a.members)),n=e.board.filter(a=>!r.has(a));n.length&&t.addIssue({code:"custom",path:["board"],message:`On the board and in no group: ${n.join(", ")}. Every item needs a group.`})}),TE=s.object({key:s.string().min(1),label:s.string().min(1),points:s.number().int().nonnegative().optional()}),EE=s.object({home:s.number().int().nonnegative(),away:s.number().int().nonnegative()}),vb=s.object({void:s.literal(!0)});Uj=s.object({id:s.string().min(1),kind:s.enum(["choice","number","scoreline"]).default("choice"),prompt:s.string().default(""),options:s.array(TE).optional(),min:s.number().optional(),max:s.number().optional(),step:s.number().positive().optional(),result:s.union([s.string().min(1),s.number(),EE,vb]).optional(),points:s.number().int().nonnegative().optional(),resultPoints:s.number().int().nonnegative().optional(),tolerance:s.number().positive().optional(),teams:s.object({home:s.string().min(1),away:s.string().min(1)}).optional()}).superRefine((e,t)=>{if(e.kind!=="scoreline"&&e.teams!==void 0&&t.addIssue({code:"custom",path:["teams"],message:"Only a scoreline has a home and an away side."}),e.kind!=="scoreline"&&e.resultPoints!==void 0&&t.addIssue({code:"custom",path:["resultPoints"],message:"Only a scoreline pays for the right result. Use points on this question."}),e.kind==="scoreline"){e.options&&e.options.length>0&&t.addIssue({code:"custom",path:["options"],message:"A scoreline has no options: a fan gives a score for each side."}),(e.min!==void 0||e.max!==void 0||e.tolerance!==void 0)&&t.addIssue({code:"custom",path:["min"],message:"A scoreline has no min, max or tolerance: it is marked exact, right result, or wrong."}),e.result!==void 0&&!os(e.result)&&!Fj(e.result)&&t.addIssue({code:"custom",path:["result"],message:"A scoreline settles to a home and an away score, each a whole number from 0."}),e.points!==void 0&&e.resultPoints!==void 0&&e.resultPoints>e.points&&t.addIssue({code:"custom",path:["resultPoints"],message:"The right result cannot be worth more than the exact score."});return}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(o=>o.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(o=>o.key===e.result)&&t.addIssue({code:"custom",path:["result"],message:`${e.result} is not one of the options, so nobody could have predicted it.`}),e.result!==void 0&&!os(e.result)&&typeof e.result!="string"&&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."}),e.result!==void 0&&!os(e.result)&&typeof e.result!="number"&&t.addIssue({code:"custom",path:["result"],message:"A number settles to a number."})}),$E=s.object({archetype:s.literal("predict"),fixture:s.string().optional(),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),options:s.array(TE).min(2).optional(),questions:s.array(Uj).min(1).optional(),result:s.union([s.string().min(1),vb]).optional(),pointsForCorrect:s.number().int().nonnegative().default(10),exactPoints:s.number().int().nonnegative().optional(),resultPoints:s.number().int().nonnegative().optional(),tieBreaker:s.string().min(1).optional(),closesAt:s.string().datetime({offset:!0}).optional(),attemptsAllowed:s.number().int().positive().default(1),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=e.options!==void 0,r=e.questions!==void 0;if(o&&r&&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."}),!o&&!r&&t.addIssue({code:"custom",path:["questions"],message:"A prediction needs something to predict: options, or questions."}),r&&e.questions){let n=e.questions.map(a=>a.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."})}if(e.tieBreaker!==void 0){let n=e.questions?.find(a=>a.id===e.tieBreaker);n?n.kind!=="number"?t.addIssue({code:"custom",path:["tieBreaker"],message:"A tie-breaker has to be a number question: the closest answer wins, which needs a distance."}):e.questions&&e.questions.length<2&&t.addIssue({code:"custom",path:["tieBreaker"],message:"A round whose only question is the tie-breaker has nothing to score."}):t.addIssue({code:"custom",path:["tieBreaker"],message:`${e.tieBreaker} is not one of this round's questions, so nothing would break a tie.`})}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&&!os(e.result)&&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.`})}),Gj=s.object({archetype:s.literal("bingo"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),rows:s.number().int().min(2),columns:s.number().int().min(2),centreMode:s.enum(["none","free","choice"]).default("none"),centreOptions:s.array(s.string().min(1)).optional(),allowCentreDuplicate:s.boolean().default(!1),lineTypes:s.array(s.enum(["row","column","diagonal","full_board"])).min(1).default(["row","column"]),cardPool:s.array(s.object({key:s.string().min(1),label:s.string().min(1),note:s.string().optional(),result:s.enum(["correct","incorrect"]).optional()})).min(1),pointsPerLine:s.number().int().nonnegative().default(10),pointsForFullBoard:s.number().int().nonnegative().default(0),shuffleAllowance:s.number().int().nonnegative().default(3),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),locksAt:s.string().optional()}).superRefine((e,t)=>{let o=e.cardPool.map(n=>n.key);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["cardPool"],message:"Two cards share a key. A dealt board names a card by its key."});let r=e.rows*e.columns-(e.centreMode==="free"?1:0);if(e.cardPool.length<r&&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 ${r}. 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(a=>!o.includes(a));n.length&&t.addIssue({code:"custom",path:["centreOptions"],message:`Not in the pool: ${n.join(", ")}. A centre option must name a real card.`})}}),Id=s.object({archetype:s.literal("shoot"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),model:s.literal(ts).default(ts),difficulty:s.enum(fb).default(gb),shotsAllowed:s.number().int().min(1).max(20).default(5),goalsToWin:s.number().int().min(1).default(3),pointsPerGoal:s.number().int().nonnegative().default(100),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.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.`})}),Bj=s.object({key:s.string().min(1),label:s.string().min(1),art:s.string().optional()}),qj=s.object({key:s.string().min(1),name:s.string().min(1),image:s.string().optional()}),Wj=s.object({item:s.string().min(1),cells:s.array(s.string().min(1))}),Hj=s.object({archetype:s.literal("place"),...cr,number:s.number().int().positive().default(1),prompt:s.string().default(""),board:s.array(Bj).min(1),deck:s.array(qj).min(1),qualifies:s.array(Wj).default([]),pointsPerPlacement:s.number().int().nonnegative().default(1),fullHouseBonus:s.number().int().nonnegative().default(0),mistakesAllowed:s.number().int().positive().default(4),skipsAllowed:s.number().int().nonnegative().default(3),open:s.boolean().default(!0),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional(),timerSeconds:s.number().int().positive().optional()}).superRefine((e,t)=>{let o=new Set;for(let c of e.board)o.has(c.key)&&t.addIssue({code:"custom",path:["board"],message:`Two cells share the key ${c.key}. Each one needs its own.`}),o.add(c.key);let r=new Set;for(let c of e.deck)r.has(c.key)&&t.addIssue({code:"custom",path:["deck"],message:`Two cards share the key ${c.key}. Each one needs its own.`}),r.add(c.key);let n=new Set,a=new Set;for(let c of e.qualifies){r.has(c.item)||t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} is not a card in the deck.`}),n.has(c.item)&&t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} is listed twice. Give each card one row.`}),n.add(c.item);for(let d of c.cells)o.has(d)||t.addIssue({code:"custom",path:["qualifies"],message:`${c.item} qualifies for ${d}, which is not on the board.`}),a.add(d)}let i=e.board.filter(c=>!a.has(c.key)).map(c=>c.key);i.length&&t.addIssue({code:"custom",path:["board"],message:`No card can fill: ${i.join(", ")}. Every cell needs at least one qualifying card.`}),e.deck.length<e.board.length&&t.addIssue({code:"custom",path:["deck"],message:`${e.deck.length} cards cannot fill ${e.board.length} cells.`})}),Yj=s.discriminatedUnion("archetype",[Cd,SE,wb,$E,Gj,Id,Hj]),Ve=s.preprocess(nE,Yj),n7=s.object({resultWording:s.string().max(500).optional(),resultTemplates:vE.optional(),actor:s.string().min(1).optional(),settlementAction:s.enum(["auto_settle","approve","void","full_time","correction","correction_applied"]).optional(),action:s.literal("settle"),game:s.string().min(1),roundId:s.string().min(1),result:s.union([s.string().min(1),s.record(s.string().min(1),s.union([s.string().min(1),s.number(),EE,vb]))])}),o7=s.object({game:s.string().min(1),round:Ve,origin:es.optional(),snapshot:s.string().default(""),source:s.string().optional(),roundId:s.string().min(1).optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({project_id:s.string().optional(),strategy:s.string().optional(),provider:s.string().optional(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional(),gate:s.object({minimumAge:s.number().int().positive().optional(),territories:s.array(s.string()).optional(),key:s.string().min(1)}).optional()}).optional(),selection:s.object({mode:s.literal("rotation"),windowSeconds:s.number().int().positive(),rounds:s.array(s.object({id:s.string().min(1),round:Ve,origin:es.optional()})).min(1)}).optional()}),r7=s.object({roundId:s.string(),version:s.number().int().nonnegative(),changed:s.boolean(),current:s.boolean(),held:s.string().optional(),activity:s.array(Xi).optional(),monthlyPlayers:s.number().int().nonnegative().optional()})});var Od,kb=_(()=>{"use strict";Od={title:"Tell me my result",via:"Send my result by",email:"Email",sms:"Text message",email_address:"Email address",mobile_number:"Mobile number",country:"Country",consent:"{brand} will use these details to tell you your result. You can unsubscribe at any time.",privacy:"Privacy policy",button:"Notify Me",pending:"Saving\u2026",success:"Done. We'll tell you after full time.",error:"That did not work. Please try again.",invalid_email:"Enter an email address, such as name@example.com.",invalid_mobile:"Enter a complete mobile number for the country you picked.",code:"6-digit code",code_incomplete:"Enter all 6 digits.",confirm:"Confirm",resend_code:"Send a new code",resend_email:"Send the email again",resend_wait:"Send again in {seconds}s",resent:"Sent. Check again.",change_address:"Use a different number or email"}});function fa(e){let t=e?.age_gate?.required&&(e.age_gate.method??"self_declared")==="self_declared"?e.age_gate.minimum_age:void 0,o=e?.territory?.required&&e.territory.allowed?.length?e.territory.allowed:void 0;if(!(!t&&!o))return{...t?{minimumAge:t}:{},...o?{territories:o}:{},...e?.gate_note?.trim()?{note:e.gate_note.trim()}:{}}}var as=_(()=>{"use strict"});function is(){return ss.filter(e=>e.public!==!1&&e.type!=="collection"&&e.type!=="boolean"&&e.type!=="number"&&e.section!=="Who can play").map(e=>e.key)}function CE(e){if(e===null||typeof e!="object"||Array.isArray(e))return["gamestage.settings.json must be one JSON object of field keys to text."];let t=new Set(is()),o=[];for(let[r,n]of Object.entries(e)){let a=/^label_[a-z0-9_]+$/.test(r);!t.has(r)&&!a?o.push(`"${r}" is not a Studio field a game can fill. The fields are: ${[...t].join(", ")}, and any label_<key> the page reads.`):typeof n!="string"&&o.push(`"${r}" must be text, and is ${Array.isArray(n)?"a list":typeof n}.`)}return o}function lr(e,t,o,r){let n=e[0].toUpperCase()+e.slice(1),a=(d,l,u)=>({key:`css_variables_${d}`,label:l,type:"colour",description:u,readBy:`The game's own CSS, as the --gs-${d} custom property.`,section:"Colour Palette",subsection:t,subsectionDescription:o}),i=t.toLowerCase(),c=[a(`${e}MainColour`,`${t} main colour`,"Main: the primary surface.")];return r.variant&&c.push(a(`${e}VariantColour`,`${t} variant colour`,"Variant: overlays, borders and subtle accents.")),c.push(a(`on${n}Colour`,`On ${i} colour`,"On: content sitting on the main and variant surfaces."),a(`${e}ContainerColour`,`${t} container colour`,"Container: the wrapper surface."),a(`on${n}ContainerColour`,`On ${i} container colour`,"On container: content sitting on the container surface.")),c}function ga(e,t,o){let r=(n,a,i)=>({key:`css_variables_font${e}${n}`,label:`${t} ${a}`,type:"freetext",description:i,readBy:`The game's own CSS, as the --gs-font${e}${n} custom property.`,section:"Typography",subsection:t,subsectionDescription:o});return[r("Family","font","The typeface: an uploaded font's name, or a curated family."),r("Weight","weight","The font weight, e.g. 400 or 700."),r("Size","size","The font size, as a CSS length, e.g. 2rem."),r("LineHeight","line height","The line height, as a CSS value."),r("Tracking","letter spacing","The letter spacing, as a CSS length, e.g. 0.02em."),r("Case","case","The text case, as a CSS text-transform, e.g. uppercase.")]}function NE(e,t){return[{key:"sponsor_name",label:"Sponsor",type:"freetext",description:`The sponsor's name, shown ${t}. Leave it empty and no sponsor is shown.`,readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e},{key:"sponsor_logo",label:"Sponsor logo",type:"image",description:"Optional. A small mark shown beside the name. A transparent PNG or an SVG reads best.",readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e},{key:"sponsor_link",label:"Sponsor link",type:"freetext",description:"Optional. Where a tap on the sponsor goes. Must start with https://. Taps are counted, with nothing stored on the fan's device.",readBy:"The sponsor reader (readSponsor), for the game's result card, and the control plane's counted tap route.",section:e},{key:"sponsor_intro",label:"Words before the sponsor",type:"freetext",description:`The words before the sponsor's name, such as "In association with". It marks the line as an advert, which the law requires, so it is never left blank: empty means "In association with".`,readBy:"The sponsor reader (readSponsor), for the game's result card.",section:e}]}function Yn(e,t){let o=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp([`\\bpresentation\\s*\\.\\s*${o}\\b`,`\\bpresentation\\s*\\[\\s*["']${o}["']\\s*\\]`,`\\b${o}\\s*:`,`[A-Za-z_$][\\w$]*\\s*\\??\\.\\s*${o}\\b`].join("|")).test(e)||t==="primaryColour"&&/\broot\s*:/.test(e)||cD.has(t)&&/\broot\s*:/.test(e)||lD.has(t)&&/data-gs-first-paint/.test(e)||t.startsWith("recovery")&&/\bmountRecovery\s*\(/.test(e)||t.startsWith("signIn")?!0:t==="analyticsUrl"}function Rd(e){return[...Pd.filter(t=>Yn(e,Ob[t.key])).map(t=>t.key),...dr(e)]}function dr(e){let t=new Set;if(/\bmountNotify\s*\(/.test(e))for(let o of Object.keys(Od))t.add(`label_notify_${o}`);for(let o of e.matchAll(/["'`](label_[a-z0-9_]+)["'`]|\b(label_[a-z0-9_]+)\s*:/g)){let r=o[1]??o[2];r&&r!==xo&&t.add(r)}return[...t].filter(o=>!t.has(`${dD}${o.slice(xo.length)}`)).sort()}function ME(e){let t=e.slice(xo.length).replace(/_/g," ").trim();return{key:e,...e==="label_provisional_result"?{default:Zj}:{},...e.startsWith("label_notify_")&&e.slice(13)in Od?{default:Od[e.slice(13)]}:{},label:t.charAt(0).toUpperCase()+t.slice(1),type:"freetext",description:"A word this game's page shows. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page.",section:"Wording"}}function ls(e,t=Pb){return`${t}/fonts/${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}.css`}function Nd(e,t){if(!e)return;let o=Object.keys(AE).find(i=>i.toLowerCase()===e.trim().toLowerCase());if(!o)return;let r=AE[o],n=Number(t);if(!Number.isFinite(n))return{family:o,weight:r[r.length-1]};let a=[...r].sort((i,c)=>Math.abs(i-n)-Math.abs(c-n)||c-i)[0];return{family:o,weight:a}}function FE(e){if(e===void 0)return;let t=/^\s*(-?(?:\d+\.?\d*|\.\d+))(?:em)?\s*$/i.exec(e);if(!t)return;let o=Number(t[1]);if(Number.isFinite(o))return`${Math.min(.4,Math.max(-.1,o))}em`}function UE(e){let t=e?.trim().toLowerCase();if(t)return["upper","uppercase","capitals","caps"].includes(t)?"uppercase":["none","uppercase","lowercase","capitalize"].includes(t)?t:"none"}var Pd,_b,IE,OE,PE,RE,Zj,ss,xb,LE,Jj,So,Xj,Sb,zE,Qj,eD,tD,Tb,nD,oD,rD,jE,aD,DE,Eb,$b,Ab,Cb,iD,sD,cs,Ib,Ob,cD,lD,xo,dD,AE,Pb,Rb,GE,sn=_(()=>{"use strict";kb();as();Ki();Pd=[{key:"play_again_label",required:!0,label:"Play again button",type:"freetext",description:"What the button that starts the next round says, at the end of a finished one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its play-again button.",section:"Wording"},{key:"result_button_label",required:!0,label:"Result link",type:"freetext",description:"What the link back to a finished round says, for a fan who has already played today. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its see-your-result link.",section:"Wording"},{key:"share_button_label",required:!0,label:"Share button",type:"freetext",description:"What the share button says at the end of a round. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its share button.",section:"Wording"},{key:"margin_over",label:"Went over, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan went over, e.g. "over by {n}". {n} is how far out they were, and where you put it is up to you. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_exact",label:"Landed exactly, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan hit the target exactly, e.g. "exactly on the number". There is no amount to show, so no {n}. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"margin_under",label:"Stayed under, in the summary",type:"freetext",description:'What the splash and the share picture say when a fan finished under, e.g. "{n} short". {n} is how far under they were. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the returning splash and the share picture.",section:"Wording"},{key:"result_over",label:"Went over, on the result",type:"freetext",description:`What the result screen says when a fan went over, e.g. "Over the limit by {n}". **The game speaking to the fan, so write it in the second person.** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_exact",label:"Landed exactly, on the result",type:"freetext",description:'What the result screen says when a fan hit the target exactly, e.g. "Exactly on the number!". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"result_under",label:"Stayed under, on the result",type:"freetext",description:'What the result screen says when a fan finished under, e.g. "{n} away from the target". Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, on the result screen.",section:"Wording"},{key:"share_over",label:"Went over, in the shared text",type:"freetext",description:`The sentence a fan pastes when they went over, e.g. "over the limit by {n}." **The fan speaking to a friend, so write it in the first person: "my", never "your".** Use {n} for the amount, {target} for the target, {rank} for the rank, {player} for the player who took them over, {value} for what that player was worth, and {fact} for that player's note. Keep it to one line: the shared text is four lines and this is the first. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_exact",label:"Landed exactly, in the shared text",type:"freetext",description:'The sentence a fan pastes when they hit the target exactly, e.g. "Exactly on {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_under",label:"Stayed under, in the shared text",type:"freetext",description:'The sentence a fan pastes when they finished under, e.g. "{n} short of {target}. {rank}." Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_bust_note",label:"Went over: the line about the player",type:"freetext",description:`The line on the result screen naming the player who took a fan over, e.g. "{player} alone was worth {value} of your {target}." **The game speaking to the fan, so second person.** {fact} is that player's own note if the producer wrote one. Filled in from the game when it deploys; what you write here is what fans see.`,readBy:"The game's own page, under the result when a fan went over.",section:"Wording"},{key:"share_bust_note",label:"Went over: the line about the player, shared",type:"freetext",description:'The same line in the text a fan pastes, e.g. "{player} alone was {value} of my {target}." **The fan speaking to a friend, so first person: "my", never "your".** Surname alone reads better here; the full name is on the card. Filled in from the game when it deploys; what you write here is what fans see.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"share_dare",label:"The challenge in the shared text",type:"freetext",description:'The last line of the text a fan pastes, aimed at whoever reads it, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not sent.',readBy:"The game's own page, in the text the share button copies.",section:"Wording"},{key:"result_dare",label:"The challenge on the result",type:"freetext",description:'A closing line on the result screen, e.g. "Can you do better?" Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.',readBy:"The game's own page, under the result.",section:"Wording"},{key:"capped_today_note",label:"When today's plays are used up",type:"freetext",description:"What a fan reads when the game has taken all the plays it can take today, and opens again at midnight UTC. A Dev game has a daily limit; a Prod game does not, so this never shows on one. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, when the Engine refuses a play until tomorrow.",section:"Wording"},{key:"splash_gradient_start",label:"Intro screen colour, top",type:"colour",description:"The colour at the top of the intro screen's gradient, also the colour the page paints before anything loads. Leave it empty to use the background colour.",readBy:"The game's intro screen, from its first frame.",section:"Brand"},{key:"splash_gradient_end",label:"Intro screen colour, bottom",type:"colour",description:"The colour at the bottom of the intro screen's gradient. Leave it empty to use the background container colour.",readBy:"The game's intro screen, from its first frame.",section:"Brand"},{key:"splash_play_label",label:"Intro screen button",type:"freetext",description:'What the big button on the intro screen says once the game has loaded. Tapping it starts the game and turns sound and vibration on. Empty says "Play".',readBy:"The game's intro screen.",section:"Wording"},{key:"splash_continue_label",label:"Intro screen button, part way through",type:"freetext",description:`What the intro screen button says when the fan has a round they haven't finished. Empty says "Continue".`,readBy:"The game's intro screen.",section:"Wording"},{key:"splash_error_text",label:"Intro screen, when loading fails",type:"freetext",description:`What the intro screen says if the game can't load. Empty says "The game didn't load. Check your connection and try again."`,readBy:"The game's intro screen.",section:"Wording"},{key:"splash_retry_label",label:"Intro screen, try again button",type:"freetext",description:`The button shown when the game can't load. Empty says "Try again".`,readBy:"The game's intro screen.",section:"Wording"},{key:"recovery_open_label",label:"Recovery button",type:"freetext",description:`The small button that opens a fan's recovery code. Empty says "Your progress".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_show_title",label:"Recovery code, heading",type:"freetext",description:`The heading above a fan's recovery code. Empty says "Keep your progress".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_show_detail",label:"Recovery code, explanation",type:"freetext",description:"The line under that heading. Empty explains that the code brings a fan's name, scores and achievements back on another device, and is shown once.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_private_note",label:"Recovery code, keep it private",type:"freetext",description:"The warning under the code. Empty says anyone with the code can play as the fan.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_replace_note",label:"Recovery code, replacing it",type:"freetext",description:"The warning that a new code stops the old one working.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_enter_title",label:"Restore, heading",type:"freetext",description:`The heading for a fan who has played before. Empty says "I've played before".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_enter_detail",label:"Restore, explanation",type:"freetext",description:"The line under that heading.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_submit_label",label:"Restore, button",type:"freetext",description:`The button that restores a fan's progress from their code. Empty says "Get my progress back".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_not_recognised",label:"Restore, code not recognised",type:"freetext",description:"What a fan reads when their code isn't recognised.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_restored",label:"Restore, done",type:"freetext",description:"What a fan reads once their progress is back.",readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_get_label",label:"Recovery code, get button",type:"freetext",description:`The button that issues a fan's recovery code. Empty says "Get a recovery code".`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_issue_failed",label:"Recovery code, when it fails",type:"freetext",description:`What a fan reads if a code can't be issued. Empty says "That didn't work. Check your connection and try again."`,readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_copy_label",label:"Recovery code, copy button",type:"freetext",description:'The button that copies the code. Empty says "Copy".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_copied_label",label:"Recovery code, copied",type:"freetext",description:'What the page says once the code is copied. Empty says "Copied".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_share_label",label:"Recovery code, share button",type:"freetext",description:'The button that shares the code. Empty says "Share".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"},{key:"recovery_close_label",label:"Recovery screens, close button",type:"freetext",description:'The button that closes the recovery screens. Empty says "Close".',readBy:"The game's recovery screens, drawn by mountRecovery. GS-568.",section:"Wording"}];_b=Pd.map(e=>e.key);IE=[...lr("background","Background","The app and element background.",{variant:!1}),...lr("highlight","Highlight","The accent for primary buttons and selected states; a saturated, high-contrast hue.",{variant:!0}),...lr("positive","Positive","Positive states such as a correct answer or a successful submission; usually green.",{variant:!0}),...lr("negative","Negative","Negative states such as a wrong answer or an error; usually red.",{variant:!0}),...lr("primary","Primary","A high-contrast brand colour for the header, footer and some icons; less prominent than Highlight.",{variant:!0}),...lr("secondary","Secondary","A medium-contrast brand colour for secondary buttons and inactive states.",{variant:!0}),...lr("tertiary","Tertiary","A low-contrast colour for option buttons and most interactive UI.",{variant:!0})];OE=[{key:"default_font_family",label:"Default font",type:"freetext",description:"The face the game uses where a role below sets none. A name from an uploaded font or the curated list. Leave it empty to keep the game's own base face.",readBy:"The typography client, as the game's fallback family.",section:"Typography"},{key:"uploaded_fonts",label:"Uploaded fonts",type:"collection",itemLabel:"{{name}}",description:"Font files to use by name in the roles below. Each is served to fans from the upload, never from Google, so a fan's address does not reach a third party before consent.",readBy:"The typography client turns each into an @font-face the roles can name.",section:"Typography",fieldset:[{key:"name",label:"Name",type:"freetext",description:`What to call this face in a role's family, e.g. "Knockout".`,readBy:"The typography client matches this against a role's family name.",section:"Typography"},{key:"file",label:"File",type:"file",description:"The font file. woff2 is smallest; woff, ttf and otf also work.",readBy:"The typography client uses this as the @font-face src.",section:"Typography"},{key:"weight",label:"Weight",type:"freetext",description:'The numeric weight this file is, e.g. "400" or "700".',readBy:"The typography client uses this as the @font-face font-weight.",section:"Typography"}]},...ga("Title","Title","The game's name and headline display type, such as the wordmark."),...ga("Body","Body","Straplines, prose and most running text."),...ga("Number","Number","Figures a player reads, such as a target or a running total."),...ga("CTA","CTA","The label on a button a fan presses."),...ga("Label","Label","Captions and small chrome."),...ga("Highlight","Highlight","An accent word or a score.")],PE=[{key:"mIdEnabled",label:"Enabled",type:"boolean",description:"Turn Monterosa ID sign-in on for this game. Off leaves the game anonymous.",readBy:"The sign-in client, to decide whether to sign a fan in.",section:"Identify"},{key:"mIdFrontendUrl",label:"Frontend URL",type:"freetext",description:"The Monterosa ID host the sign-in check runs against, e.g. https://identify.example.com.",readBy:"The sign-in client, for the Identify session check.",section:"Identify"},{key:"mIdApiUrl",label:"API URL",type:"freetext",description:"The Monterosa ID API host. Usually the same as the Frontend URL.",readBy:"The sign-in client, for the Identify session check.",section:"Identify"},{key:"xClientId",label:"X-Client-ID",type:"freetext",description:"This game's Identify client id, sent with the session check. Per project; not shared with another game.",readBy:"The sign-in client, as the client id for the Identify check.",section:"Identify"},{key:"userAccessTitle",label:"User access title",type:"freetext",description:"The overlay title shown when a signed-out fan tries to play.",readBy:"The sign-in client, as the sign-in overlay title.",section:"Identify"},{key:"userAccessSubtitle",label:"User access subtitle",type:"wysiwyg",description:"The overlay subtitle shown when a signed-out fan tries to play.",readBy:"The sign-in client, as the sign-in overlay subtitle.",section:"Identify"},{key:"userAccessSignInUrlWeb",label:"Primary button link (web)",type:"freetext",description:"Where the sign-in button sends a signed-out fan on web, e.g. https://www.example.com/account/sign-in.",readBy:"The sign-in client, as the sign-in button's web link.",section:"Identify"},{key:"userAccessSignInUrlNativeIOS",label:"Primary button link (native iOS)",type:"freetext",description:"Sign-in link for a webview on iOS.",readBy:"The sign-in client, as the sign-in button's link in an iOS webview.",section:"Identify"},{key:"userAccessSignInUrlNativeAndroid",label:"Primary button link (native Android)",type:"freetext",description:"Sign-in link for a webview on Android.",readBy:"The sign-in client, as the sign-in button's link in an Android webview.",section:"Identify"},{key:"userAccessSignUpUrlWeb",label:"Secondary button link (web)",type:"freetext",description:"Where the sign-up button sends a signed-out fan on web. Leave empty for no second button.",readBy:"The sign-in client, as the sign-up button's web link.",section:"Identify"},{key:"userAccessSignUpUrlNativeIOS",label:"Secondary button link (native iOS)",type:"freetext",description:"Sign-up link for a webview on iOS.",readBy:"The sign-in client, as the sign-up button's link in an iOS webview.",section:"Identify"},{key:"userAccessSignUpUrlNativeAndroid",label:"Secondary button link (native Android)",type:"freetext",description:"Sign-up link for a webview on Android.",readBy:"The sign-in client, as the sign-up button's link in an Android webview.",section:"Identify"}],RE=[{key:"analytics_tealiumUrl",label:"Tealium URL",type:"freetext",description:"The Tealium utag.js URL the host page injects, e.g. https://tags.example.com/prod/utag.js. Leave it empty for no Tealium.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"analytics_adobeUrl",label:"Adobe Launch URL",type:"freetext",description:"The Adobe Launch script URL the host page injects. Leave it empty for no Adobe.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"analytics_oneTrustId",label:"OneTrust id",type:"freetext",description:"The OneTrust domain id for the consent banner. Leave it empty for no OneTrust banner.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abPathTemplateIntex",label:"Index path",type:"freetext",description:"The path to this game's index.html on the origin, e.g. /games/<game id>/index.html. Filled in when the game deploys.",readBy:"The host's edge function, to fetch the page it injects into.",section:"Analytics"},{key:"abSeoTitleHomePage",label:"SEO title",type:"freetext",description:"The page title for search results and browser tabs.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoDescriptionHomePage",label:"SEO description",type:"freetext",description:"The meta description shown under the title in search results.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoOgTitleHomePage",label:"Share title",type:"freetext",description:"The title shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoOgDescriptionHomePage",label:"Share description",type:"freetext",description:"The description shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abCanonicalUrlHomePage",label:"Canonical URL",type:"freetext",description:"The canonical URL for this game, e.g. https://play.example.com/the-limit.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoImage",label:"Share image",type:"image",description:"The image shown when the game is shared on social.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"},{key:"abSeoLogo",label:"Favicon",type:"image",description:"The icon shown in a browser tab.",readBy:"The host's edge function, injected into the page's HTML.",section:"Analytics"}];Zj="Provisional result. Final at {finalAt}.",ss=[{key:"notify_enabled",label:"Offer result notifications",type:"boolean",description:"Let fans ask for their result after a pick. Off unless switched on.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"notify_channels",label:"Notification channels",type:"freetext",description:"Comma-separated channels: email, sms, rcs. Empty means email. SMS and RCS are for a later version.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"notify_terms_version",label:"Notification terms version",type:"freetext",description:"The version recorded with result consent. Empty means 2. Change it when the consent terms change.",readBy:"The Notify reader, for the control API and the predict template.",section:"Result notifications"},{key:"gate_age_required",label:"Ask fans to confirm their age",type:"list",options:[{name:"Use the game's setting",value:"game"},{name:"On",value:"yes"},{name:"Off",value:"no"}],description:"Before they play, fans tick a box to say they are old enough. Gamestage does not check what they tick. Use the game's setting to follow what the developer built in.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_minimum_age",label:"Minimum age",type:"number",description:"The age fans confirm they are, such as 18. Leave it empty to use the age the game was built with, or 18 if it names none.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_territories",label:"Countries",type:"freetext",description:"Where fans confirm they are, as two-letter country codes separated by commas, such as GB,IE. Leave it empty to ask nothing about where fans are.",readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"gate_note",label:"Note above the boxes",type:"freetext",description:'One line fans read above the boxes, such as "This game is for UK residents only." Leave it empty for no note.',readBy:"The age and territory gate reader (readGateSettings), for the round the control plane provisions and the gate the page draws.",section:"Who can play"},{key:"display_name",label:"Game name",type:"freetext",description:"What a fan sees at the top of the game. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, as its heading and its browser title.",section:"Identity"},{key:"strapline",label:"Strapline",type:"freetext",description:"One line under the name. Filled in from the game when it deploys; what you write here is what fans see. Clear it and the line is not drawn.",readBy:"The game's own page, under the heading.",section:"Identity"},{key:"how_to_play",label:"How to play",type:"freetext",description:"The rules in a fan's words. Shown before they start, and reachable while they play.",readBy:"The game's own page, in its how-to-play panel.",section:"Identity"},{key:"reference_url",label:"Dataset",type:"freetext",description:"A dataset name that the control plane reads from a private bucket, shared by every round. Leave it empty if each round carries everything it needs.",readBy:"The control plane, when it provisions a round.",section:"Content",public:!1},{key:"analytics_url",label:"Analytics endpoint",type:"freetext",description:"Where a copy of what fans do in this game is sent. Leave it empty and nothing is collected. Monterosa will give you the address for your account.",readBy:"The game's own page, which loads the collector and posts to it once a fan has consented.",section:"Content"},{key:"primary_colour",label:"Primary colour",type:"colour",description:"Your brand colour. It is the button a fan presses, and the accent on any Live Graphics graphic this game puts on a screen.",readBy:"The game's own page, as the --gamestage-primary custom property, and the graphic, as its accent.",section:"Brand"},{key:"logo_url",label:"Logo",type:"image",description:"Your mark, shown in the top corner of a graphic on a screen. Leave it empty and the graphic carries no logo. A transparent PNG or an SVG reads best on a dark board.",readBy:"Live Graphics, in the top corner of every graphic for this game.",section:"Brand"},{key:"brand_font_url",label:"Typeface stylesheet",type:"freetext",description:"A stylesheet that loads your typeface, such as a Google Fonts address. Leave it empty to keep the graphic's own face.",readBy:"Live Graphics, which loads it before drawing a graphic.",section:"Brand"},{key:"brand_font_family",label:"Typeface name",type:"freetext",description:`The font-family the stylesheet above provides, such as "Archivo". Set both or neither: a name with no stylesheet falls back to the graphic's own face, and a stylesheet with no name is never used.`,readBy:"Live Graphics, as the face every word on a graphic is set in.",section:"Brand"},{key:"title_font",label:"Title typeface",type:"freetext",description:`The Google Font the game's name is set in at the top of the page, such as "Bebas Neue". It must be one of the families Gamestage offers (Anton, Archivo Black, Bebas Neue, Bungee, Chakra Petch, Fraunces, Oswald, Playfair Display, Russo One and others); any other name is ignored and the game's own title face is used. Leave it empty to keep that face.`,readBy:"The game's own page, on its title, loaded from Google Fonts after the page has drawn.",section:"Brand"},{key:"title_font_weight",label:"Title weight",type:"freetext",description:"How heavy the title is, as a number from 100 to 900 (400 is regular, 700 bold). A weight the typeface does not have becomes the nearest one it does; empty uses its heaviest.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_letter_spacing",label:"Title letter spacing",type:"freetext",description:"Space between the title's letters, as a fraction of the type size: 0.08 spreads it out, -0.02 tightens it, empty leaves the typeface's own spacing. Kept between -0.1 and 0.4.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_case",label:"Title case",type:"freetext",description:`Type "upper" to show the game's name in capital letters whatever case it is typed in. Leave it empty to show it as typed.`,readBy:"The game's own page, on its title.",section:"Brand"},{key:"title_colour",label:"Title colour",type:"colour",description:"The colour of the game's name. Leave it empty to use the page's own text colour.",readBy:"The game's own page, on its title.",section:"Brand"},{key:"logo_text",label:"Logo text",type:"freetext",description:"How the game's name is drawn as a logo, if different from its name. Put the characters to pick out in square brackets: WAGE[$] draws WAGE$ with the $ in the accent colour. The browser tab, the share text and screen readers still use the game's name. Leave it empty to draw the name.",readBy:"The game's own page, on its title and its intro screen.",section:"Brand"},{key:"logo_accent_colour",label:"Logo accent colour",type:"colour",description:"The colour of the characters in square brackets in the logo text. Leave it empty to use the title colour.",readBy:"The game's own page, on its title and its intro screen.",section:"Brand"},{key:"play_button_label",required:!0,label:"Main button",type:"freetext",description:"What the button that submits a fan's answer says. Filled in from the game when it deploys; what you write here is what fans see.",readBy:"The game's own page, on its submit button.",section:"Wording"},...Pd,{key:"consent_brand_name",label:"Consent, who runs the game",type:"freetext",description:'Your brand, named on the consent banner as the one asking, e.g. "Arsenal". Required: a game with no brand name cannot deploy.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_title",label:"Consent, heading",type:"freetext",description:`The consent card's name, read by a screen reader rather than shown. Empty says "Your privacy".`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_detail",label:"Consent, explanation",type:"freetext",description:"The consent message. {brand} is replaced with your brand name. Empty says: {brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_accept_label",label:"Consent, accept button",type:"freetext",description:'Empty says "Accept". The same size as the reject button, filled in your accent colour.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_reject_label",label:"Consent, reject button",type:"freetext",description:'Empty says "Reject". The same size as the accept button, beside it.',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_choose_label",label:"Consent, choose button",type:"freetext",description:'Opens the list of categories. Empty says "Manage preferences".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_save_label",label:"Consent, save button",type:"freetext",description:'Saves the categories a fan ticked. Empty says "Save my choices".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_analytics_label",label:"Consent, measurement category",type:"freetext",description:'Empty says "Measure how the game is played".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_marketing_label",label:"Consent, marketing category",type:"freetext",description:`Empty says "Offers and news from the game's owner".`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_functional_label",label:"Consent, preferences category",type:"freetext",description:'Empty says "Remember my preferences".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_settings_label",label:"Consent, settings link",type:"freetext",description:'The link a fan uses to change their mind later. Empty says "Privacy settings".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"consent_policy_version",label:"Privacy policy version",type:"freetext",description:'Change this when your privacy policy changes, and every fan is asked again. Empty is "1".',readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"privacy_policy_url",label:"Privacy policy link",type:"freetext",description:`Where the banner's "Privacy policy" link goes. Required: a game with no privacy policy link cannot deploy.`,readBy:"The game's consent banner, drawn by mountConsent or the Gamestage UI consent component. GS-575.",section:"Wording"},{key:"embed_origins",label:"Sites that can pass on consent",type:"freetext",description:"Only for a game shown inside another website that already asks fans about privacy. Enter that website's address, such as https://www.example.com, and it can tell the game what a fan agreed to. Separate several with commas. A fan's own choice in the game always comes first. Leave it empty and the game asks every fan itself.",readBy:"The consent origin reader (parseEmbedOrigins, through readPresentation's embedOrigins), for the client's consent state. GS-860.",section:"Wording"},{key:"signin_play_as_label",label:"Sign-in, play as button",type:"freetext",description:`The button a fan signed in to gamestage.ai taps so their plays count on their account, e.g. "Play as {name}". {name} is replaced with the fan's name; the game never sees it. Empty: the button is not offered.`,readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{key:"signin_detail",label:"Sign-in, explanation",type:"freetext",description:"One line above the Play as button saying what tapping does. Empty draws the button alone.",readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{key:"signin_dismiss_label",label:"Sign-in, not now button",type:"freetext",description:"The button that hides the offer and plays as a guest. Empty draws no such button.",readBy:"The client's Play as tap, drawn on gamestage.ai inside the game. GS-682.",section:"Wording"},{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},...IE,...PE,...RE,...OE,...NE("Sponsor","on the result card and in the Hub for every edition")],xb=[{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"},...NE("This edition's sponsor","for this edition only, in place of the game's sponsor")],LE=[{key:"edition_live_contest",label:"Live contest",type:"freetext",description:"The contest this edition follows live, by the provider's id for it (for SportMonks, the fixture id). Leave it empty and the game shows no live data.",readBy:"packages/gamestage/src/live.ts, which subscribes the page to that contest's live data.",section:"This edition"}],Jj=[{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"}],So=[{key:"title",label:"Round name",type:"freetext",description:"How this round is listed in Studio, so you can tell rounds apart. Gamestage fills it in when it creates the round; change it to anything. Fans do not see it.",readBy:"Studio's timeline label. Nothing a fan loads reads it.",section:"Content",public:!1},{key:"source_url",label:"Content source",type:"freetext",description:"A URL for this round's content. The deployed control plane does not fetch it yet, so setting it has no effect on a live game. Use the content fields in Studio instead.",readBy:"The control plane, in its in-memory form only. The deployed control plane does not fetch it yet.",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"}],Xj=[{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"}]}]}],Sb="Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.",zE={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"},{key:"board_given",label:"Given name",type:"freetext",description:'Optional. When the pick is a person, the first line of their name as a fan reads it, e.g. "Ole Gunnar". Leave empty to split the pick at its first space.',readBy:"The game's own page, which draws a person's name on two lines. The Engine never reads it.",section:"This round"},{key:"board_family",label:"Family name",type:"freetext",description:'Optional. When the pick is a person, the bold second line of their name, e.g. "Solskjaer". Leave empty to split the pick at its first space.',readBy:"The game's own page, which draws a person's name on two lines. The Engine never reads it.",section:"This round"}]},Qj=[{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. Lead with what the fan has to decide, not who the players are: say "a \xA3100m player", never "a goalkeeper", since naming the category gives the answer away. Put the famous name on the board as the trap, not in this line. One line, e.g. "Only one of these players has scored a penalty so far this season." or "Who is the player that's not yet scored?"`,readBy:"The game's own page, above the board.",section:"This round"},zE,{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". ${Sb}`,readBy:"The Engine, to mark a pick.",section:"This round",public:!1},{key:"round_guesses",label:"Guesses a fan gets",type:"number",description:"How many picks a fan may make at this round. Leave it empty for the game's default (10 picks, 4 of them wrong). Set 1 for a quiz question: one pick, then the answer is shown.",readBy:"The Engine, which ends a fan's round once these are used.",section:"This round"}],eD=[{key:"answer_measure",label:"Answer from data",type:"freetext",description:'Leave empty to type the answer yourself. Otherwise the dataset measure the answer is worked out from, e.g. "own_goals", and the board holds dataset keys rather than names.',readBy:"The relay, which works out the answer when the round is provisioned.",section:"This round",public:!1},{key:"answer_rule",label:"Which player is right",type:"freetext",description:'With "Answer from data": highest, lowest, only_nonzero (the one player above zero) or only_zero (the one player on zero). A round where the rule fits more than one player is refused, never guessed.',readBy:"The relay.",section:"This round",public:!1},{key:"reveal_each_guess",label:"Show a wrong guess's figure",type:"freetext",description:'With "Answer from data": "yes" to show a wrong guess its own figure straight away, "no" to show every figure only at the end. Empty means yes.',readBy:"The Engine, when it marks a guess.",section:"This round",public:!1},{key:"round_layout",label:"How the board is drawn",type:"freetext",description:`Empty for cards. "pitch" to draw each player on a football pitch at their position, from the dataset; works with "Answer from data", and a round whose players have no position in the dataset stays as cards. "xi" to draw a team's eleven with one place empty, from "The eleven", and ask who played there.`,readBy:"The relay, which adds each player's position; then the game's page.",section:"This round"},{key:"round_lineup",label:"The eleven",type:"freetext",description:'For "xi" rounds only, written by `gamestage round seed --layout xi`. The team and its starting places as JSON: {"team":"AFC Bournemouth","formation":"4-2-3-1","places":[{"row":1,"column":1,"label":"Djordje Petrovic"},...]}. Row 1 is the goalkeeper. Exactly one place has no "label": that is the gap a fan fills, and its player goes in "The right answers" and on the board.',readBy:"The game's page, which draws it.",section:"This round"},{key:"round_twist",label:"The twist",type:"freetext",description:`One surprising line shown after the round, e.g. "He has also completed more passes than any other defender." ${Sb}`,readBy:"The Engine, which sends it only with a finished result.",section:"This round",public:!1},{key:"round_twist_source",label:"Where the twist is from",type:"freetext",description:'The publication and date, e.g. "Fantasy Premier League, 27 Sep 2026".',readBy:"The Engine, with the twist.",section:"This round",public:!1},{key:"round_twist_url",label:"The twist's link",type:"freetext",description:"A link to where the twist was reported. Optional.",readBy:"The Engine, with the twist.",section:"This round",public:!1}],tD=[{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"},zE,{key:"round_groups",label:"The groups",type:"collection",itemLabel:"{{group_label}}",description:`One per hidden group. ${Sb}`,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"}]}],Tb=[{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"}],nD=[{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}],oD=[{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"}],rD=[{key:"mystery_answer",label:"The answer",type:"freetext",description:`The player fans are looking for, written exactly as the dataset names him, e.g. "Erling Haaland", or his dataset key. Must be a player in the game's dataset.`,readBy:"The Deduction Engine, as the mystery's subject.",section:"This mystery",public:!1},{key:"mystery_first_clue",label:"Free clue",type:"freetext",description:'The clue every fan starts with, e.g. "He is a forward." Never his club: that gives too much away, so a free clue about the club is shown second instead. Required, 200 characters at most.',readBy:"The game's own page, as the first clue.",section:"This mystery",public:!0},{key:"mystery_first_clue_field",label:"Free clue is about",type:"freetext",description:"Which dataset field the free clue gives away, so the game narrows the field on it: position, nationality, age or any other field the dataset holds, except team. Leave it empty for position.",readBy:"The Deduction Engine, to narrow the field on the free clue.",section:"This mystery",public:!0},{key:"mystery_second_clue",label:"Second clue",type:"freetext",description:'The clue a fan gets when their coins run low, e.g. "He plays for Manchester City." Required, 200 characters at most.',readBy:"The game's own page, as the second clue.",section:"This mystery",public:!0},{key:"mystery_second_clue_field",label:"Second clue is about",type:"freetext",description:"Which dataset field the second clue gives away. Must differ from the free clue's. Leave it empty for team, or for position when the free clue is about team.",readBy:"The Deduction Engine, to narrow the field on the second clue.",section:"This mystery",public:!0},{key:"mystery_difficulty",label:"Difficulty",type:"number",description:"1 easy, 2 medium or 3 hard. Leave it empty for 1.",readBy:"The Deduction Engine, which scores a solve by it.",section:"This mystery",public:!0}],jE="arcade_ties_shared",aD="results_mode",DE=[{key:aD,label:"Results",type:"list",options:[{name:"Automatic: settle as soon as the match result is confirmed",value:"automatic"},{name:"Need approval: hold each result for a producer to approve",value:"approval"}],description:"How results from the match data reach fans. Automatic settles straight away and you can still correct it. Need approval shows the proposed result in Stage and waits for you.",readBy:"The control plane's settler.",section:"Predict results"}],Eb={predict:DE,arcade:[{key:jE,label:"Equal scores share a place",type:"boolean",description:"Arcade games only. On: two fans on the same score are both shown in the same place. Off: the fan who got there first is placed higher. On unless you turn it off.",readBy:"The Arcade Engine, when it ranks a board.",section:"Arcade leaderboard"}]},$b={key:"predict_void",label:"Void this question",type:"list",options:[{name:"No",value:"no"},{name:"Yes, return everyone's pick",value:"yes"}],default:"no",description:"Choose Yes to return everyone's pick for this question: fans score 0 and their picks are not marked wrong. Choose No to use the normal result again.",readBy:"The control plane, which settles the question as void regardless of its normal result.",section:"Result",public:!1},Ab=[{key:"scoreline_home",label:"Home team",type:"freetext",description:"The team playing at home, as fans know it. For example: Arsenal.",readBy:"The control plane, when it builds the round from this edition, and the game's page, which labels the home score with it.",section:"This match",required:!0},{key:"scoreline_away",label:"Away team",type:"freetext",description:"The team playing away, as fans know it. For example: Chelsea.",readBy:"The control plane, when it builds the round from this edition, and the game's page, which labels the away score with it.",section:"This match",required:!0},{key:"scoreline_points",label:"Points for the exact score",type:"number",description:"Points a fan earns for calling this match's exact score. Leave it empty to use the edition's setting, which is 5 unless you change it.",readBy:"The control plane, into the round the Engine marks.",section:"This match",public:!1},{key:"scoreline_result_points",label:"Points for the right result",type:"number",description:"Points a fan earns for the right result without the exact score: the right winner, or a draw when it was a draw. Leave it empty to use the edition's setting, which is 2 unless you change it.",readBy:"The control plane, into the round the Engine marks.",section:"This match",public:!1},{key:"scoreline_fixture",label:"Match to settle from",type:"freetext",description:"The match this question is about, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match. With a match set, the final score is filled in for you after full time.",readBy:"The control plane's settler, which reads the match result and writes the final score below.",section:"Result",public:!1},$b,{key:"scoreline_result_home",label:"Final score, home",type:"number",description:"Goals the home team scored by the end of normal time. Filled in for you when a match is set; type it yourself otherwise, or to correct it.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1},{key:"scoreline_result_away",label:"Final score, away",type:"number",description:"Goals the away team scored by the end of normal time.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1}],Cb=[{key:"number_prompt",label:"Question",type:"freetext",description:"What fans are asked. For example: In which minute is the first goal scored?",readBy:"The control plane, when it builds the round from this edition, and the game's page, which shows it.",section:"This question",required:!0},{key:"number_min",label:"Lowest answer",type:"number",description:"The smallest number a fan can give. For the minute of the first goal, 1.",readBy:"The control plane, into the round, and the game's page, which sets the control's range.",section:"This question",required:!0},{key:"number_max",label:"Highest answer",type:"number",description:"The largest number a fan can give. For the minute of the first goal, 90, or 120 if extra time is possible.",readBy:"The control plane, into the round, and the game's page, which sets the control's range.",section:"This question",required:!0},{key:"number_tie_breaker",label:"Use as the tie-breaker",type:"boolean",description:"Fans on equal points are ranked by who was closest to this answer. It earns no points of its own and does not count towards getting every question right. Only one question in an edition can be the tie-breaker.",readBy:"The control plane, which marks this question as the round's tie-breaker.",section:"This question",public:!1},{key:"number_settle_rule",label:"Settle automatically",type:"list",options:[{name:"No, I will type the answer",value:"manual"},{name:"Total goals in the match",value:"total"}],description:"Whether the answer is filled in for you from the match result after full time.",readBy:"The control plane's settler.",section:"Result",public:!1},$b,{key:"number_fixture",label:"Match to settle from",type:"freetext",description:"The match, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match.",readBy:"The control plane's settler.",section:"Result",public:!1},{key:"number_result",label:"Answer",type:"number",description:"What happened. Filled in for you when the question settles automatically; type it yourself otherwise, or to correct it.",readBy:"The control plane, which settles the round with it.",section:"Result",public:!1}],iD=[{key:"predict_exact_points",label:"Points for an exact score",type:"number",description:"Points a fan earns for each match where they call the exact score. Leave it empty for 5.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"predict_result_points",label:"Points for the right result",type:"number",description:"Points a fan earns for each match where they call the right result but not the exact score. Leave it empty for 2.",readBy:"The control plane, when it builds the round from this edition.",section:"This edition",public:!1},{key:"settle_fixture",label:"Match",type:"freetext",description:"The match this edition is about, as provider:id, for example sportmonks:19722146. Every question uses it unless it names its own. With a match set, results are filled in for you after full time, and picks close at kick-off.",readBy:"The control plane's settler, and the close time below.",section:"Results and closing",public:!1},{key:"picks_close_minutes_before",label:"Close picks before kick-off (minutes)",type:"number",description:"How many minutes before the earliest kick-off picks close. Leave it empty to close at kick-off.",readBy:"The control plane, which sets the round's close time.",section:"Results and closing",public:!1},{key:"picks_close_at",label:"Close picks at",type:"freetext",description:"A fixed time picks close, UK time, for example 2026-10-18 15:00. Use it when the edition names no match, or to override kick-off.",readBy:"The control plane, which sets the round's close time.",section:"Results and closing",public:!1}],sD=[{key:"prediction_settle_rule",label:"Settle automatically",type:"list",options:[{name:"No, I will choose the answer",value:"manual"},{name:"Result (options: home win, draw, away win)",value:"result"},{name:"Both teams score (options: yes, no)",value:"both_score"},{name:"Home clean sheet (options: yes, no)",value:"clean_sheet_home"},{name:"Away clean sheet (options: yes, no)",value:"clean_sheet_away"}],description:"Whether the correct option is chosen for you from the match result after full time. Your options must be in the order shown.",readBy:"The control plane's settler.",section:"Result",public:!1},$b,{key:"prediction_fixture",label:"Match to settle from",type:"freetext",description:"The match, as provider:id, for example sportmonks:19722146. Leave it empty to use the edition's match.",readBy:"The control plane's settler.",section:"Result",public:!1}],cs={hunt:[...Qj,...eD],push:Xj,group:tD,predict:sD,bingo:nD,shoot:oD,place:[],mystery:rD,arcade:[]},Ib={hunt:[],push:[],group:[],predict:iD,bingo:Jj,shoot:[],place:[],mystery:[],arcade:[]},Ob={display_name:"displayName",title_font:"titleFont",title_font_weight:"titleFontWeight",title_letter_spacing:"titleLetterSpacing",title_colour:"titleColour",title_case:"titleCase",logo_text:"logoText",logo_accent_colour:"logoAccentColour",splash_gradient_start:"splashGradientStart",splash_gradient_end:"splashGradientEnd",splash_play_label:"splashPlayLabel",splash_continue_label:"splashContinueLabel",splash_error_text:"splashErrorText",splash_retry_label:"splashRetryLabel",consent_brand_name:"consentBrandName",consent_title:"consentTitle",consent_detail:"consentDetail",consent_accept_label:"consentAcceptLabel",consent_reject_label:"consentRejectLabel",consent_choose_label:"consentChooseLabel",consent_save_label:"consentSaveLabel",consent_analytics_label:"consentAnalyticsLabel",consent_marketing_label:"consentMarketingLabel",consent_functional_label:"consentFunctionalLabel",consent_settings_label:"consentSettingsLabel",consent_policy_version:"consentPolicyVersion",privacy_policy_url:"privacyPolicyUrl",signin_play_as_label:"signInPlayAsLabel",signin_detail:"signInDetail",signin_dismiss_label:"signInDismissLabel",recovery_open_label:"recoveryOpenLabel",recovery_show_title:"recoveryShowTitle",recovery_show_detail:"recoveryShowDetail",recovery_private_note:"recoveryPrivateNote",recovery_replace_note:"recoveryReplaceNote",recovery_enter_title:"recoveryEnterTitle",recovery_enter_detail:"recoveryEnterDetail",recovery_submit_label:"recoverySubmitLabel",recovery_not_recognised:"recoveryNotRecognised",recovery_restored:"recoveryRestored",recovery_get_label:"recoveryGetLabel",recovery_issue_failed:"recoveryIssueFailed",recovery_copy_label:"recoveryCopyLabel",recovery_copied_label:"recoveryCopiedLabel",recovery_share_label:"recoveryShareLabel",recovery_close_label:"recoveryCloseLabel",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",edition_live_contest:"liveContest",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"},cD=new Set(["titleFont","titleFontWeight","titleLetterSpacing","titleColour","titleCase","logoText","logoAccentColour"]),lD=new Set(["splashGradientStart","splashGradientEnd","splashPlayLabel","splashContinueLabel","splashErrorText","splashRetryLabel","logoText","logoAccentColour"]);xo="label_",dD="label_taster_";AE={"Abril Fatface":[400],Anton:[400],"Archivo Black":[400],"Bebas Neue":[400],Bungee:[400],"Chakra Petch":[300,400,500,600,700],"DM Serif Display":[400],Fraunces:[400,600,700,900],Oswald:[400,500,600,700],"Playfair Display":[400,700,900],"Russo One":[400],"Space Grotesk":[400,500,700],Teko:[400,500,600,700],Unbounded:[400,700,900]},Pb="https://gamestage.ai";Rb=ss.filter(e=>e.required).map(e=>e.key),GE={signin_play_as_label:"Play as {name}",signin_detail:"Your scores in this game count on your Gamestage account.",signin_dismiss_label:"Not now"}});function fD(e){let t=De(e);return[...hd.includes(t)?So.filter(r=>r.key==="title"):So,...cs[t]??[]]}function Ld(e){return(e.fieldset??[]).flatMap(t=>[t.key,...Ld(t)])}function Nb(e,t,o,r=new Map){return{...e,section:o,...e.fieldset?{fieldset:e.fieldset.filter(n=>!t.has(n.key)).map(n=>{let a=Nb(n,t,o,r),i=r.get(n.key);return i?.label&&(a.label=i.label),i?.description&&(a.description=i.description),a})}:{}}}function zd(e,t){let o=fD(e),r=new Map(o.map(i=>[i.key,i])),n=new Set,a=[];for(let i of t.fields){let c=r.get(i.key);if(!c)return{ok:!1,reason:`round_fields.fields: "${i.key}" is not a round field of a ${De(e)} game. It offers ${o.map(f=>f.key).join(", ")}.`};if(n.has(i.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" is listed twice.`};n.add(i.key);let d=i.section??t.section??c.section,l=new Set(i.omit??[]);if(l.size>0){let f=new Set(Ld(c));if(f.size===0)return{ok:!1,reason:`round_fields.fields: "${i.key}" holds no list, so it has nothing to omit.`};for(let g of l)if(!f.has(g))return{ok:!1,reason:`round_fields.fields: "${i.key}" has no field "${g}" to omit. Inside it are ${[...f].join(", ")}.`}}let u=new Map;if(i.fields){let f=new Set(Ld(c));if(f.size===0)return{ok:!1,reason:`round_fields.fields: "${i.key}" holds no list, so it has no fields inside to word.`};let g=new Set(Ld(Nb(c,l,d)));for(let b of i.fields){if(f.has(b.key)&&!g.has(b.key)&&!l.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" words "${b.key}", but it sits inside a field this entry omits (${[...l].join(", ")}). Remove one.`};if(!f.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" has no field "${b.key}" inside it. Inside it are ${[...f].join(", ")}.`};if(l.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" both omits and words "${b.key}". Remove one.`};if(u.has(b.key))return{ok:!1,reason:`round_fields.fields: "${i.key}" words "${b.key}" twice.`};u.set(b.key,b)}}if(i.options&&c.type!=="freetext")return{ok:!1,reason:`round_fields.fields: "${i.key}" is not free text, so it cannot become a fixed list of options.`};let p=Nb(c,l,d,u);i.label&&(p.label=i.label),i.description&&(p.description=i.description),i.options&&(p.type="list",p.options=i.options.map(f=>typeof f=="string"?{name:f,value:f}:f)),a.push(p)}return!hD.includes(De(e))&&!n.has("title")?{ok:!1,reason:'round_fields.fields: include "title". Studio lists each round by it and every deploy names new rounds through it; it is never shown to a fan.'}:{ok:!0,fields:a}}var uD,mD,pD,ds,hD,us=_(()=>{"use strict";je();sn();Vt();uD=s.union([s.string().min(1),s.object({name:s.string().min(1),value:s.string().min(1)}).strict()]),mD=s.object({key:s.string().min(1),label:s.string().min(1).optional(),description:s.string().min(1).optional()}).strict(),pD=s.object({key:s.string().min(1),label:s.string().min(1).optional(),description:s.string().min(1).optional(),section:s.string().min(1).optional(),omit:s.array(s.string().min(1)).min(1).optional(),fields:s.array(mD).min(1).optional(),options:s.array(uD).min(1).optional()}).strict(),ds=s.object({section:s.string().min(1).optional(),fields:s.array(pD).min(1)}).strict(),hD=["predict","bingo"]});function BE(e){if(e.includes("/"))return'id: a game id cannot contain "/", because no API can carry it in a URL. Choose an id of letters, digits and hyphens.'}var Lb=_(()=>{"use strict"});function WE(e){if(!gD.test(e))return`"${e}" is not a theme name. Use 3 to 40 lowercase letters and numbers, with single hyphens between them, such as acme or acme-dark.`;if(qE.includes(e))return`"${e}" is one of Gamestage UI's own themes. Choose a name of your own, such as your company's.`}function HE(e){return yD.test(e)?void 0:`"${e}" is not a version. Use three numbers, such as 1.0.0.`}function ya(e){let t=e.lastIndexOf("@");if(t<=0)return{ok:!1,reason:`"${e}" names no version. Pin one exactly, such as acme@1.0.0.`};let o=e.slice(0,t),r=e.slice(t+1),n=WE(o)??HE(r);return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}var qE,gD,yD,ms=_(()=>{"use strict";qE=["base","arcade","paper","stadium"],gD=/^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$/,yD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/});function zb(e){return bD.test(e)?void 0:`"${e}" is not a starter name. Use 3 to 40 lowercase letters and numbers, with single hyphens between them, such as web-embed or fan-app-react.`}function jb(e){return wD.test(e)?void 0:`"${e}" is not a version. Use three numbers, such as 1.0.0.`}function YE(e){let t=e.lastIndexOf("@");if(t<=0)return{ok:!1,reason:`"${e}" names no version. Pin one exactly, such as web-embed@1.0.0.`};let o=e.slice(0,t),r=e.slice(t+1),n=zb(o)??jb(r);return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}function VE(e){let t=e.lastIndexOf("@"),o=t>0?e.slice(0,t):e,r=t>0?e.slice(t+1):"latest",n=zb(o)??(r==="latest"?void 0:jb(r));return n?{ok:!1,reason:n}:{ok:!0,name:o,version:r}}var bD,wD,jd=_(()=>{"use strict";bD=/^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,39}$/,wD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/});function SD(e){return QE.includes(e)}function KE(e){return t$.includes(De(e))}function n$(e){let t=[],o=e.backend.archetype;if(e.round_fields&&o&&!KE(o)){let i=zd(o,e.round_fields);i.ok||t.push({path:"round_fields",message:i.reason})}o&&KE(o)&&t.push({path:"backend.archetype",message:`\`${o}\` is a classification, not a format the Engine marks. The formats it marks are ${Yt.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 r=e.backend.route;r&&SD(r)&&t.push({path:"backend.route",message:`\`${r}\` is a classification, not a route Gamestage implements. Set \`${Fb}\`: 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;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."}));let a=BE(e.app.id);if(a&&t.push({path:"app.id",message:a.replace(/^id: /,"")}),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.identify&&e.identity.provider&&e.identity.provider!=="identify"&&t.push({path:"identity.identify",message:"Present, but identity.provider is `"+e.identity.provider+"`. An `identify` block is read only when the provider is `identify`. Set the provider to `identify`, or remove the block."}),e.identity.jwt&&e.identity.provider==="identify"&&t.push({path:"identity.jwt",message:"Present, but identity.provider is `identify`. A `jwt` block is read only when the provider is `jwt`. Remove it, or set the provider to `jwt`."}),e.identity.jwt)for(let i of["issuer","jwks_uri"]){let c=e.identity.jwt[i],d=_d(c);d&&t.push({path:`identity.jwt.${i}`,message:xd(d)})}return e.identity.territory.required&&e.identity.territory.allowed.length===0&&t.push({path:"identity.territory.allowed",message:"Name at least one country, as an ISO code such as GB, when identity.territory.required is true."}),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 ps,Db,Mb,ba,ZE,hs,To,Eo,JE,vD,cn,kD,_D,xD,XE,Fb,QE,e$,$o,t$,TD,ED,$D,AD,CD,ID,OD,PD,RD,ND,Ub,LD,zD,jD,DD,Gb,Dd,MD,FD,Ao,wa,$n=_(()=>{"use strict";ob();ar();je();ib();vd();Sd();Vi();Vt();Kt();us();Lb();ms();jd();ps="1.0",Db=s.enum(["missing","proposed","confirmed","verified","approved"]),Mb={missing:0,proposed:1,confirmed:2,verified:3,approved:4},ba=s.enum(["runtime","live","enterprise"]),ZE="Accounts must be approved before the first deploy.",hs={runtime:"Starter",live:"Publisher",enterprise:"Enterprise"},To=s.enum(["L0","L1","L2","L3","L4","L5"]),Eo={L0:0,L1:1,L2:2,L3:3,L4:4,L5:5},JE={L0:"Concept",L1:"Experience",L2:"Integration",L3:"Deployable",L4:"Production",L5:"Operating"},vD=s.discriminatedUnion("kind",[s.object({kind:s.literal("human_decision"),owner:s.string(),date:s.string(),note:s.string().optional()}),s.object({kind:s.literal("generated_proposal"),tool:s.string(),model:s.string().optional(),source_context:s.string().optional()}),s.object({kind:s.literal("repository_evidence"),file:s.string(),commit:s.string().optional(),package:s.string().optional()}),s.object({kind:s.literal("platform_evidence"),system:s.string(),id:s.string()}),s.object({kind:s.literal("external_evidence"),supplier:s.string(),licence:s.string().optional(),dataset_version:s.string().optional()})]),cn={status:Db.default("missing"),provenance:s.array(vD).default([])},kD=s.object({schema_version:s.string(),revision:s.number().int().nonnegative().default(0),conformance:To.default("L0")}),_D=s.object({repository:s.string().url(),branch:s.string().default("main")}),xD=s.object({id:s.string().min(1),title:s.string().min(1),summary:s.string().optional(),source:_D.optional(),owners:s.object({ip:s.string().optional(),delivery:s.string().optional(),platform:s.string().optional()}).prefault({}),...cn}),XE=s.enum(["bring_your_own","managed_runtime","manifest_driven","dedicated_engine"]),Fb="managed_runtime",QE=XE.options.filter(e=>e!==Fb);e$=s.enum(["trivia","predict","group","timed_round","synchronous_event","collection_ranking","hunt","push","bingo","shoot","place","mystery","arcade"]),$o=s.preprocess(e=>typeof e=="string"?De(e):e,e$),t$=e$.options.filter(e=>!Yt.includes(e));TD=s.object({route:XE.optional().describe(`Only ${Fb} is a route Gamestage implements: every game runs on our Engine. ${QE.join(", ")} are classifications from the Integration Scenarios RFC that nothing implements, and a manifest naming one is refused.`),archetype:$o.optional().describe(`The formats the Engine marks are ${Yt.join(", ")}. ${t$.join(", ")} are classifications that inspect uses to describe a game it found; nothing marks them, and a manifest naming one is refused.`),component:s.string().optional(),version:s.string().optional(),variant:s.string().optional(),configuration:s.record(s.string(),s.unknown()).default({}),round:Ve.optional(),arcade:lE.optional(),...cn}),ED=s.object({surfaces:s.array(s.string()).default([]),container_label:s.string().min(1).default(ma),layout:gd.optional(),host:yd.optional(),screen_graph:s.string().optional(),design:s.object({figma_file:s.string().optional(),figma_version:s.string().optional(),tokens:s.string().optional(),fidelity:To.optional(),system:s.string().superRefine((e,t)=>{let o=ya(e);o.ok||t.addIssue({code:"custom",message:o.reason})}).optional()}).optional(),starter:s.string().superRefine((e,t)=>{let o=YE(e);o.ok||t.addIssue({code:"custom",message:o.reason})}).optional(),...cn}),$D=s.object({spec_url:s.string().optional(),version:s.string().optional(),...cn}),AD=s.object({family:s.string().optional(),version:s.string().optional(),configuration_schema:s.string().optional(),...cn}),CD=s.object({project_template:s.string().optional(),project_id:s.string().optional(),events:s.array(s.string()).default([]),elements:s.array(s.string()).default([]),...cn}),ID=s.object({required:s.boolean().default(!1),minimum_age:s.number().int().positive().max(120).optional(),method:s.enum(["self_declared","verified"]).default("self_declared"),verifier:s.string().optional()}),OD=s.object({required:s.boolean().default(!1),allowed:s.array(s.string().regex(/^[A-Z]{2}$/)).default([]),method:s.enum(["self_declared"]).default("self_declared")}),PD=s.object({issuer:s.string().url(),jwks_uri:s.string().url(),audience:s.string().optional(),player_id_claim:s.string().regex(/^[A-Za-z_][A-Za-z0-9_.:-]*$/,"A claim name, such as SubscriberId.").optional()}),RD=s.object({strategy:s.string().default("email"),provider:s.string(),assertion:s.boolean().optional()}),ND=s.object({provider:s.enum(["identify","anonymous","custom","jwt"]).optional(),jwt:PD.optional(),identify:RD.optional(),require_authenticated_writes:s.boolean().default(!0),age_gate:ID.prefault({}),territory:OD.prefault({}),gate_note:s.string().max(200).optional(),consent:s.object({analytics_requires_consent:s.boolean().default(!0),provider:s.string().optional()}).prefault({}),...cn}),Ub=s.object({type:s.enum(["monterosa","posthog","ga4","webhook"]),enabled:s.boolean().default(!0),config:s.record(s.string(),s.string()).default({})}),LD=s.object({destinations:s.array(Ub).default([{type:"monterosa",enabled:!0,config:{}}]),trusted_events:s.array(s.string()).default([]),signal:s.object({enabled:s.boolean().default(!1),application_id:s.string().optional(),write_key:s.string().optional(),monterosa:s.object({enabled:s.boolean().default(!1),organisation_id:s.string().optional(),project_id:s.string().optional()}).prefault({})}).prefault({}),...cn}),zD=s.object({hosting:s.string().optional(),space_spec:s.string().optional(),environments:s.array(s.enum(["local","playground","staging","production"])).default(["local"]),...cn}),jD=s.object({offers_prize:s.boolean().default(!1),free_entry_route:s.string().optional(),skill_based:s.boolean().default(!1),terms_url:s.string().optional(),jurisdictions:s.array(s.string()).default([])}),DD=s.object({support_tier:ba.optional(),runbook:s.string().optional(),promotion:jD.prefault({}),...cn}),Gb=s.object({tool:s.string().min(1),ran_at:s.string().regex(/^\d{4}-\d{2}-\d{2}$/,"ran_at is a date, YYYY-MM-DD"),result:s.enum(["passed","issues_fixed","issues_open"]),owner:s.string().optional(),evidence:s.string().optional(),note:s.string().optional()}),Dd=Gb.or(s.unknown()),MD=s.object({accessibility:Dd.optional(),security:Dd.optional(),secrets:Dd.optional(),privacy:Dd.optional(),...cn}),FD=s.object({provider:s.enum(_o).default("sportmonks").describe("Where the contest's live data comes from. SportMonks today; more providers follow.")}).describe("Live data: the game follows a real contest as it happens. Present means on. The edition names the contest in Studio, and game.live() hands the page what happens."),Ao=s.object({notify_enabled:s.boolean().default(!1),notify_channels:s.array(s.enum(["email","sms","rcs"])).min(1).default(["email"]),manifest:kD,app:xD,experience:ED.prefault({}),studio_app:$D.prefault({}),studio_surface:AD.prefault({}),backend:TD.prefault({}),interaction_cloud:CD.prefault({}),identity:ND.prefault({}),measurement:LD.prefault({}),deployment:zD.prefault({}),operations:DD.prefault({}),assurance:MD.prefault({}),live:FD.optional(),round_fields:ds.optional()});wa=["app","experience","studio_app","studio_surface","backend","interaction_cloud","identity","measurement","deployment","operations"]});function UD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function fs(){if(o$)return Co;o$=1;function e(i){return typeof i>"u"||i===null}function t(i){return typeof i=="object"&&i!==null}function o(i){return Array.isArray(i)?i:e(i)?[]:[i]}function r(i,c){if(c){let d=Object.keys(c);for(let l=0,u=d.length;l<u;l+=1){let p=d[l];i[p]=c[p]}}return i}function n(i,c){let d="";for(let l=0;l<c;l+=1)d+=i;return d}function a(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}return Co.isNothing=e,Co.isObject=t,Co.toArray=o,Co.repeat=n,Co.isNegativeZero=a,Co.extend=r,Co}function gs(){if(r$)return Bb;r$=1;function e(o,r){let n="",a=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(n+='in "'+o.mark.name+'" '),n+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!r&&o.mark.snippet&&(n+=`
84
84
 
85
85
  `+o.mark.snippet),a+" "+n):a}function t(o,r){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=r,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(r){return this.name+": "+e(this,r)},Bb=t,Bb}function GD(){if(a$)return qb;a$=1;let e=fs();function t(n,a,i,c,d){let l="",u="",p=Math.floor(d/2)-1;return c-a>p&&(l=" ... ",a=c-p+l.length),i-c>p&&(u=" ...",i=c+p-u.length),{str:l+n.slice(a,i).replace(/\t/g,"\u2192")+u,pos:c-a+l.length}}function o(n,a){return e.repeat(" ",a-n.length)+n}function r(n,a){if(a=Object.create(a||null),!n.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);let i=/\r?\n|\r|\0/g,c=[0],d=[],l,u=-1;for(;l=i.exec(n.buffer);)d.push(l.index),c.push(l.index+l[0].length),n.position<=l.index&&u<0&&(u=c.length-2);u<0&&(u=c.length-1);let p="",f=Math.min(n.line+a.linesAfter,d.length).toString().length,g=a.maxLength-(a.indent+f+3);for(let v=1;v<=a.linesBefore&&!(u-v<0);v++){let x=t(n.buffer,c[u-v],d[u-v],n.position-(c[u]-c[u-v]),g);p=e.repeat(" ",a.indent)+o((n.line-v+1).toString(),f)+" | "+x.str+`
86
86
  `+p}let b=t(n.buffer,c[u],d[u],n.position,g);p+=e.repeat(" ",a.indent)+o((n.line+1).toString(),f)+" | "+b.str+`
@@ -111,7 +111,7 @@ You scored {points} points.`},Oj=Object.keys(wE),vE=s.object({notify_template_su
111
111
  `+y.slice(V,Z),V=Z+1),D=ae;return de+=`
112
112
  `,y.length-V>O&&D>V?de+=y.slice(V,D)+`
113
113
  `+y.slice(D+1):de+=y.slice(V),de.slice(1)}function nn(y){let O="",z=0;for(let Y=0;Y<y.length;z>=65536?Y+=2:Y++){z=at(y,Y);let V=we[z];!V&&Me(z)?(O+=y[Y],z>=65536&&(O+=y[Y+1])):O+=V||Ne(z)}return O}function Sc(y,O,z){let Y="",V=y.tag;for(let Z=0,D=z.length;Z<D;Z+=1){let ae=z[Z];y.replacer&&(ae=y.replacer.call(z,String(Z),ae)),($(y,O,ae,!1,!1)||typeof ae>"u"&&$(y,O,null,!1,!1))&&(Y!==""&&(Y+=","+(y.condenseFlow?"":" ")),Y+=y.dump)}y.tag=V,y.dump="["+Y+"]"}function Gn(y,O,z,Y){let V="",Z=y.tag;for(let D=0,ae=z.length;D<ae;D+=1){let de=z[D];y.replacer&&(de=y.replacer.call(z,String(D),de)),($(y,O+1,de,!0,!0,!1,!0)||typeof de>"u"&&$(y,O+1,null,!0,!0,!1,!0))&&((!Y||V!=="")&&(V+=ye(y,O)),y.dump&&c===y.dump.charCodeAt(0)?V+="-":V+="- ",V+=y.dump)}y.tag=Z,y.dump=V||"[]"}function Rr(y,O,z){let Y="",V=y.tag,Z=Object.keys(z);for(let D=0,ae=Z.length;D<ae;D+=1){let de="";Y!==""&&(de+=", "),y.condenseFlow&&(de+='"');let ve=Z[D],_e=z[ve];y.replacer&&(_e=y.replacer.call(z,ve,_e)),$(y,O,ve,!1,!1)&&(y.dump.length>1024&&(de+="? "),de+=y.dump+(y.condenseFlow?'"':"")+":"+(y.condenseFlow?"":" "),$(y,O,_e,!1,!1)&&(de+=y.dump,Y+=de))}y.tag=V,y.dump="{"+Y+"}"}function Nr(y,O,z,Y){let V="",Z=y.tag,D=Object.keys(z);if(y.sortKeys===!0)D.sort();else if(typeof y.sortKeys=="function")D.sort(y.sortKeys);else if(y.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let ae=0,de=D.length;ae<de;ae+=1){let ve="";(!Y||V!=="")&&(ve+=ye(y,O));let _e=D[ae],Se=z[_e];if(y.replacer&&(Se=y.replacer.call(z,_e,Se)),!$(y,O+1,_e,!0,!0,!0))continue;let Ae=y.tag!==null&&y.tag!=="?"||y.dump&&y.dump.length>1024;Ae&&(y.dump&&c===y.dump.charCodeAt(0)?ve+="?":ve+="? "),ve+=y.dump,Ae&&(ve+=ye(y,O)),$(y,O+1,Se,!0,Ae)&&(y.dump&&c===y.dump.charCodeAt(0)?ve+=":":ve+=": ",ve+=y.dump,V+=ve)}y.tag=Z,y.dump=V||"{}"}function m(y,O,z){let Y=z?y.explicitTypes:y.implicitTypes;for(let V=0,Z=Y.length;V<Z;V+=1){let D=Y[V];if((D.instanceOf||D.predicate)&&(!D.instanceOf||typeof O=="object"&&O instanceof D.instanceOf)&&(!D.predicate||D.predicate(O))){if(z?D.multi&&D.representName?y.tag=D.representName(O):y.tag=D.tag:y.tag="?",D.represent){let ae=y.styleMap[D.tag]||D.defaultStyle,de;if(r.call(D.represent)==="[object Function]")de=D.represent(O,ae);else if(n.call(D.represent,ae))de=D.represent[ae](O,ae);else throw new t("!<"+D.tag+'> tag resolver accepts not "'+ae+'" style');y.dump=de}return!0}}return!1}function $(y,O,z,Y,V,Z,D){y.tag=null,y.dump=z,m(y,z,!1)||m(y,z,!0);let ae=r.call(y.dump),de=Y;Y&&(Y=y.flowLevel<0||y.flowLevel>O);let ve=ae==="[object Object]"||ae==="[object Array]",_e,Se;if(ve&&(_e=y.duplicates.indexOf(z),Se=_e!==-1),(y.tag!==null&&y.tag!=="?"||Se||y.indent!==2&&O>0)&&(V=!1),Se&&y.usedDuplicates[_e])y.dump="*ref_"+_e;else{if(ve&&Se&&!y.usedDuplicates[_e]&&(y.usedDuplicates[_e]=!0),ae==="[object Object]")Y&&Object.keys(y.dump).length!==0?(Nr(y,O,y.dump,V),Se&&(y.dump="&ref_"+_e+y.dump)):(Rr(y,O,y.dump),Se&&(y.dump="&ref_"+_e+" "+y.dump));else if(ae==="[object Array]")Y&&y.dump.length!==0?(y.noArrayIndent&&!D&&O>0?Gn(y,O-1,y.dump,V):Gn(y,O,y.dump,V),Se&&(y.dump="&ref_"+_e+y.dump)):(Sc(y,O,y.dump),Se&&(y.dump="&ref_"+_e+" "+y.dump));else if(ae==="[object String]")y.tag!=="?"&&co(y,y.dump,O,Z,de);else{if(ae==="[object Undefined]")return!1;if(y.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+ae)}if(y.tag!==null&&y.tag!=="?"){let Ae=encodeURI(y.tag[0]==="!"?y.tag.slice(1):y.tag).replace(/!/g,"%21");y.tag[0]==="!"?Ae="!"+Ae:Ae.slice(0,18)==="tag:yaml.org,2002:"?Ae="!!"+Ae.slice(18):Ae="!<"+Ae+">",y.dump=Ae+" "+y.dump}}return!0}function B(y,O){let z=[],Y=[];q(y,z,Y);let V=Y.length;for(let Z=0;Z<V;Z+=1)O.duplicates.push(z[Y[Z]]);O.usedDuplicates=new Array(V)}function q(y,O,z){if(y!==null&&typeof y=="object"){let Y=O.indexOf(y);if(Y!==-1)z.indexOf(Y)===-1&&z.push(Y);else if(O.push(y),Array.isArray(y))for(let V=0,Z=y.length;V<Z;V+=1)q(y[V],O,z);else{let V=Object.keys(y);for(let Z=0,D=V.length;Z<D;Z+=1)q(y[V[Z]],O,z)}}}function j(y,O){O=O||{};let z=new fe(O);z.noRefs||B(y,z);let Y=y;return z.replacer&&(Y=z.replacer.call({"":Y},"",Y)),$(z,0,Y,!0,!0)?z.dump+`
114
- `:""}return dw.dump=j,dw}function WD(){if($$)return kt;$$=1;let e=BD(),t=qD();function o(r,n){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return kt.Type=At(),kt.Schema=A$(),kt.FAILSAFE_SCHEMA=P$(),kt.JSON_SCHEMA=j$(),kt.CORE_SCHEMA=D$(),kt.DEFAULT_SCHEMA=uw(),kt.load=e.load,kt.loadAll=e.loadAll,kt.dump=t.dump,kt.YAMLException=gs(),kt.types={binary:U$(),float:z$(),map:O$(),null:R$(),pairs:B$(),set:q$(),timestamp:M$(),bool:N$(),int:L$(),merge:F$(),omap:G$(),seq:I$(),str:C$()},kt.safeLoad=o("safeLoad","load"),kt.safeLoadAll=o("safeLoadAll","loadAll"),kt.safeDump=o("safeDump","dump"),kt}var kt,Md,Co,o$,Bb,r$,qb,a$,Wb,i$,Hb,s$,Yb,c$,Vb,l$,Kb,d$,Zb,u$,Jb,m$,Xb,p$,Qb,h$,ew,f$,tw,g$,nw,y$,ow,b$,rw,w$,aw,v$,iw,k$,sw,_$,cw,x$,lw,S$,T$,dw,E$,$$,HD,ht,N7,L7,z7,j7,D7,M7,W$,F7,U7,G7,B7,q7,W7,H7,va=_(()=>{kt={},Md={},Co={};dw={};HD=WD(),ht=UD(HD),{Type:N7,Schema:L7,FAILSAFE_SCHEMA:z7,JSON_SCHEMA:j7,CORE_SCHEMA:D7,DEFAULT_SCHEMA:M7,load:W$,loadAll:F7,dump:U7,YAMLException:G7,types:B7,safeLoad:q7,safeLoadAll:W7,safeDump:H7}=ht});function Nt(e){let t;try{t=ht.load(e,{schema:VD})}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 o=Ao.safeParse(t);if(!o.success)return{ok:!1,issues:KD(o.error)};let r=n$(o.data);return r.length?{ok:!1,issues:r}:{ok:!0,manifest:o.data}}function KD(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function ys(e){return ht.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Fd(e,t){return Ao.parse({manifest:{schema_version:ps,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var YD,VD,Io=_(()=>{"use strict";va();$n();as();({merge:YD}=ht.types),VD=ht.CORE_SCHEMA.extend({implicit:[YD]})});function pw(e){return ZD.map(t=>{let o=e?.assurance?.[t.key];if(o===void 0)return{...t};let r=Gb.safeParse(o);if(r.success)return{...t,record:r.data};let n=r.error.issues.map(a=>`${["assurance",t.key,...a.path].join(".")}: ${a.message}`).join("; ");return{...t,problem:n}})}var ZD,mw,H$,Y$=_(()=>{"use strict";$n();Io();ZD=[{key:"accessibility",label:"Accessibility",command:"npx skills add addyosmani/web-quality-skills@accessibility",about:"A WCAG 2.2 audit skill: runs Lighthouse or axe on the page, then checks what automated tools miss."},{key:"security",label:"Security review",command:"npx skills add getsentry/skills@security-review",about:"Sentry's review skill, built on OWASP guidance. Reports only findings it can trace to input an attacker controls."},{key:"secrets",label:"Secrets",command:"gitleaks detect --source .",about:"The open-source gitleaks scanner: finds API keys and tokens committed to the game. Install it from github.com/gitleaks/gitleaks."},{key:"privacy",label:"Privacy",command:"npx skills add wshobson/agents@gdpr-data-handling",about:"A GDPR skill covering consent, legal basis, data requests and children's data."}],mw="Recorded by the creator, not checked or certified by Monterosa.";H$={passed:"Passed",issues_fixed:"Issues found and fixed",issues_open:"Issues still open"}});var rY,aY,V$=_(()=>{"use strict";rY=new TextEncoder,aY=new TextDecoder});var K$=_(()=>{"use strict"});function Lt(e,t={}){let o=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),r=hw.filter(f=>f.checkable).map(o),n=hw.filter(f=>!f.checkable).map(o),a="L0",i=!0;for(let f of fw){let g=r.filter(v=>v.level===f);g.length>0&&g.every(v=>v.passed)&&i?a=f:i=!1}let c=r.filter(f=>f.level==="L0").every(f=>f.passed),d=Eo[a]+1,l=fw[d],u=l?r.filter(f=>f.level===l&&!f.passed):[],p=e.manifest.conformance;return{computed:a,computedName:JE[a],claimed:p,overclaimed:!c||Math.min(Eo[p],Eo[Z$])>Eo[a],results:r,blockers:c?u:r.filter(f=>f.level==="L0"&&!f.passed),ceiling:Z$,advice:n}}function J$(e,t){let r=Lt(e).results.filter(n=>!n.passed&&Eo[n.level]<=Eo[t]);return{ok:r.length===0,missing:r}}var ur,ft,hw,fw,JD,lY,Z$,Ud=_(()=>{"use strict";$n();ur=(e,t,o)=>{let r=e[t];return Mb[r?.status??"missing"]>=Mb[o]},ft=e=>typeof e=="string"?e.trim().length>0:e!=null,hw=[{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=>ft(e.app.id)&&ft(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=>ur(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=>ft(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=>ft(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=>ur(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=>ft(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)=>ft(t.backendComponent)||ft(e.backend.component)&&ft(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=>ft(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(o=>o.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)=>ft(t.platformProject)||ft(e.studio_app.spec_url)||ft(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)=>ft(t.playgroundUrl)||ft(e.deployment.space_spec)&&e.deployment.environments.some(o=>o!=="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=>ft(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=>ur(e,"experience","confirmed")&&ur(e,"backend","confirmed")&&ur(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=>ur(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=>ft(e.operations.support_tier)&&ft(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=>ur(e,"operations","approved")&&e.deployment.environments.includes("production")}],fw=["L0","L1","L2","L3","L4","L5"],JD=[{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"}],lY=new Map(JD.map(e=>[e.level,e])),Z$=[...fw].reverse().find(e=>hw.some(t=>t.level===e&&t.checkable))??"L0"});var gw=_(()=>{"use strict";Io();$n();Ud()});var X$=_(()=>{"use strict"});function Q$(e,t){let o=e.backend.archetype;if(!o)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:Lt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:wa.map(r=>({section:r,status:e[r].status}))}}function eA(e,t){let o=[];return t&&e.app.id!==t&&o.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||o.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."),o}var tA=_(()=>{"use strict";Ud();Io();$n()});var nA=_(()=>{"use strict"});var oA,ln,QD,eM,tM,EY,aA,nM,oM,$Y,rM,AY,CY,IY,OY,aM,iM,PY,sM,cM,RY,rA,NY,LY,zY,jY,DY,MY,yw=_(()=>{"use strict";je();$n();Ed();nA();oA="2.0",ln=s.object({server_time:s.string(),snapshot:s.string()}),QD=s.enum(["at_commit","at_settlement"]),eM=s.enum(["shared","per_player","feed"]),tM=s.object({kind:s.enum(["fixed","local_midnight","feed","continuous","rotation","calendar","unscheduled","unknown"]),timezone:s.string().optional(),window_seconds:s.number().int().positive().optional(),next_change_at:s.string().optional()}),EY=ln.extend({game:s.string(),api_version:s.literal(oA).default(oA),archetype:$o,marking:QD,challenge_source:eM,schedule:tM,updates:s.object({transport:s.enum(["poll","socket"]),freshness_seconds:s.number().int().positive()}),display:s.record(s.string(),s.unknown()).default({}),identity:s.object({required:s.boolean(),provider:s.string(),anonymous_play:s.boolean().default(!1)}),archive:s.boolean().default(!1),capabilities:s.array(s.string()).default([])}),aA=s.object({accepting_plays:s.boolean(),results_available:s.boolean(),solution_revealed:s.boolean(),closed:s.boolean(),optimistic_play:s.boolean().default(!1)}),nM=ln.extend({id:s.string(),number:s.number().int().positive().optional(),origin:es.optional(),version:s.number().int().nonnegative(),settled_revision:s.number().int().nonnegative().optional(),provisional:s.boolean().optional(),finalAt:s.iso.datetime().optional(),awaits_settlement:s.boolean().optional(),can:aA,opens_at:s.string().optional(),locks_at:s.string().optional(),timer_seconds:s.number().int().positive().optional(),challenge_instance_id:s.string().nullable().default(null),challenge:s.record(s.string(),s.unknown()).default({}),solution:s.record(s.string(),s.unknown()).optional()}),oM=s.object({id:s.string(),number:s.number().int().positive().optional(),version:s.number().int().nonnegative(),can:aA,opens_at:s.string().optional(),locks_at:s.string().optional(),current:s.boolean().default(!1),theme:s.string().default("")}),$Y=ln.extend({rounds:s.array(oM)}),rM=s.object({round_id:s.string(),finished:s.boolean(),score:s.number(),last_played_at:s.string().optional(),outcome:s.enum(["won","lost","partial","incomplete","pending"]).optional()}),AY=ln.extend({player_id:s.string(),played:s.array(rM)}),CY=ln.extend({status:s.enum(["ready","exhausted"]),round:nM.optional()}),IY=ln.extend({token:s.string(),player_id:s.string(),kind:s.literal("anonymous")}),OY=s.object({idempotency_key:s.string().min(8),round_version:s.number().int().nonnegative(),challenge_instance_id:s.string().nullable().default(null),payload:s.record(s.string(),s.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"]})}),aM=s.enum(["accepted","rejected","duplicate","stale","busy"]),iM=s.object({key:s.string(),verdict:s.enum(["correct","close","wrong","higher","lower","unknown"]),void:s.literal(!0).optional(),label:s.string().optional()}),PY=ln.extend({play_id:s.string(),outcome:aM,reason:s.string().optional(),round_version:s.number().int().nonnegative(),retry_after_seconds:s.number().int().positive().optional(),marked:s.boolean().default(!0),feedback:s.array(iM).default([]),round_state:s.lazy(()=>cM).optional()}),sM=s.object({title:s.string(),grid:s.array(s.string()).default([]),text:s.string().optional()}),cM=ln.extend({player_id:s.string(),round_id:s.string(),started_at:s.string().optional(),attempts_used:s.number().int().nonnegative().default(0),attempts_allowed:s.number().int().nonnegative().optional(),mistakes_used:s.number().int().nonnegative().default(0),mistakes_allowed:s.number().int().nonnegative().optional(),progress:s.record(s.string(),s.unknown()).default({}),score:s.number().default(0),score_revision:s.number().int().nonnegative().default(0),finished:s.boolean().default(!1),outcome:s.enum(["won","lost","partial","incomplete","pending"]).optional(),perfect:s.boolean().optional(),share:sM.optional()}),RY=ln.extend({player_id:s.string(),display_name:s.string().optional(),avatar:s.string().optional(),avatar_url:s.string().optional(),name_chosen:s.boolean().optional(),played:s.number().int().nonnegative().default(0),won:s.number().int().nonnegative().default(0),current_streak:s.number().int().nonnegative().default(0),max_streak:s.number().int().nonnegative().default(0),exact:s.number().int().nonnegative().optional(),best_score:s.number().optional(),day_streak:s.number().int().nonnegative().optional(),last_played_day:s.string().optional(),distribution:s.record(s.string(),s.number()).default({}),constraints:s.record(s.string(),s.unknown()).default({})}),rA=s.object({rank:s.number().int().positive(),player_id:s.string(),display_name:s.string().optional(),avatar:s.string().optional(),avatar_url:s.string().optional(),exact:s.boolean().optional(),score:s.number()}),NY=ln.extend({round_id:s.string().optional(),scope:s.enum(["round","edition"]).optional(),edition_id:s.string().optional(),order:s.enum(["high_first","low_first"]).default("high_first"),tie_break:s.enum(["earliest_play","fewest_attempts","none"]).default("none"),tie_break_question:s.string().optional(),entries:s.array(rA).default([]),total:s.number().int().nonnegative().default(0),truncated:s.boolean().default(!1),me:rA.optional()}),LY=s.object({error:s.object({code:s.string(),message:s.string(),retryable:s.boolean()})}),zY=ln.extend({adjectives:s.array(s.string()),animals:s.array(s.string()),avatars:s.array(s.object({id:s.string(),url:s.string()}))}),jY=s.object({name:s.object({adjective:s.string().min(1),animal:s.string().min(1)}).optional(),avatar:s.string().min(1).optional()}).refine(e=>e.name!==void 0||e.avatar!==void 0,{message:"Send a name, an avatar, or both."}),DY=s.object({ticket:s.string(),expires_at:s.string()}),MY=s.object({gate:s.string().min(1).max(512),qualified:s.literal(!0)})});var lM,dM,uM,mM,pM,hM,fM,gM,WY,iA=_(()=>{"use strict";je();Vt();ns();lM=s.object({op:s.string().min(1),model:s.string().min(1).optional()}).passthrough(),dM=s.object({op:s.literal("draw")}).strict(),uM=s.object({op:s.literal("solve"),text:s.string().min(1).max(200)}).strict(),mM=s.object({op:s.literal("guess"),value:s.union([s.string().min(1).max(40),s.number()])}).strict(),pM=s.object({op:s.literal("pick"),picks:s.array(s.string())}).passthrough(),hM=s.object({op:s.literal("answer"),answers:s.record(s.string(),s.union([s.string(),s.number()])).optional(),picks:s.array(s.string()).optional()}).passthrough(),fM=s.object({op:s.enum(["deal","reshuffle","lock"]),centre:s.unknown().optional(),board:s.number().int().nonnegative().optional()}).passthrough(),gM=s.object({op:s.literal(_E),model:s.literal(ts).optional(),shotIndex:s.number().int().nonnegative(),aimX:s.number().int().min(sr.aimX.min).max(sr.aimX.max),aimY:s.number().int().min(sr.aimY.min).max(sr.aimY.max),power:s.number().int().min(sr.power.min).max(sr.power.max)}).strict(),WY=s.union([pM,dM,uM,mM,hM,fM,gM,lM])});var sA=_(()=>{"use strict"});var Gd=_(()=>{"use strict";sA()});var Ct=_(()=>{"use strict"});import{createHash as yM}from"node:crypto";function wM(e){return yM("sha256").update(e).digest("hex").slice(0,16)}function Bd(e){return wM(e)}var bM,Ut,_t=_(()=>{"use strict";je();Ct();Kt();bM=s.object({key:s.string().min(1),label:s.string().default(""),values:s.record(s.string(),s.number().int().nonnegative()),scale:s.number().int().positive().optional(),sources:s.record(s.string(),ha).optional(),scoring:bb.optional(),tiers:s.array(yb).min(1).optional()}),Ut=s.object({corpus:s.literal("1"),source:s.string().optional(),as_of:s.string().optional(),sources:s.record(s.string(),ha).optional(),facts:s.record(s.string(),s.array(Ad)).optional(),entries:s.record(s.string(),s.object({label:s.string().min(1),team:s.string().optional(),position:s.string().optional(),image:s.string().url().startsWith("https://").optional(),age:s.number().int().min(14).max(60).optional(),debut_year:s.number().int().min(1900).max(2100).optional(),facts:s.record(s.string(),s.union([s.string(),s.number(),s.boolean()])).optional()})).optional(),measures:s.array(bM).min(1)}).superRefine((e,t)=>{let o=e.measures.map(r=>r.key);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var bs,cA,gt,lA,dA,ka,uA,ws,qd=_(()=>{"use strict";_t();bs=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.round(e):null,cA=e=>{let t=Number(e);return Number.isFinite(t)&&t>=0?Math.round(t*100):null},gt=(e,t)=>({fields:[e],label:t,read:o=>bs(o[e])}),lA=270,dA=3,ka=(e,t)=>({fields:[e,"minutes"],label:`${t} per 90 minutes, in hundredths (at least ${lA} minutes played)`,partial:!0,scale:100,read:o=>{let r=bs(o[e]),n=bs(o.minutes);return r===null||n===null||n<lA?null:Math.round(r*90*100/n)}}),uA=(e,t)=>({fields:[e,"starts"],label:`${t} per start, in hundredths (at least ${dA} starts)`,partial:!0,scale:100,read:o=>{let r=bs(o[e]),n=bs(o.starts);return r===null||n===null||n<dA?null:Math.round(r*100/n)}}),ws={player_price:{...gt("now_cost","Price, in tenths of a million"),scale:10},season_points:gt("total_points","Points this season"),points_per_game:{fields:["points_per_game"],label:"Points per game, in tenths",scale:10,read:e=>{let t=Number(e.points_per_game);return Number.isFinite(t)&&t>=0?Math.round(t*10):null}},minutes:gt("minutes","Minutes played"),starts:gt("starts","Starts"),goals:gt("goals_scored","Goals"),assists:gt("assists","Assists"),own_goals:gt("own_goals","Own goals"),penalties_missed:gt("penalties_missed","Penalties missed"),penalties_saved:gt("penalties_saved","Penalties saved"),yellow_cards:gt("yellow_cards","Yellow cards"),red_cards:gt("red_cards","Red cards"),saves:gt("saves","Saves"),bonus:gt("bonus","Bonus points"),tackles:gt("tackles","Tackles"),recoveries:gt("recoveries","Ball recoveries"),clearances_blocks_interceptions:gt("clearances_blocks_interceptions","Clearances, blocks and interceptions"),defensive_contributions:gt("defensive_contribution","Defensive contribution points"),expected_goals:{fields:["expected_goals"],label:"Expected goals, in hundredths",scale:100,read:e=>cA(e.expected_goals)},expected_assists:{fields:["expected_assists"],label:"Expected assists, in hundredths",scale:100,read:e=>cA(e.expected_assists)},goals_per_90:ka("goals_scored","Goals"),assists_per_90:ka("assists","Assists"),yellow_cards_per_90:ka("yellow_cards","Yellow cards"),tackles_per_90:ka("tackles","Tackles"),recoveries_per_90:ka("recoveries","Ball recoveries"),saves_per_90:ka("saves","Saves"),bonus_per_start:uA("bonus","Bonus points"),defensive_contributions_per_start:uA("defensive_contribution","Defensive contribution points")}});function vM(e,t){if(/^[A-Z]+s?$/.test(t))return`${e}_${t.toLowerCase()}`;let o=t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").toLowerCase();return o.startsWith(`${e}_`)?o:`${e}_${o}`}function kM(e){let t=e.replace(/Pct$/,"Percent").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(" "),o=t[0]==="avg",r=(o?t.slice(1):t).map((n,a)=>/^[A-Z]{2,}$/.test(n)?n:a===0?n[0].toUpperCase()+n.slice(1):n.toLowerCase());return o?`${r.join(" ")} per game`:r.join(" ")}function Wd(e){let t=Vn[e];return t?Object.entries(t.categories).flatMap(([o,r])=>r.map(n=>({key:vM(o,n),label:kM(n),category:o,name:n}))):[]}var Vn,Hd=_(()=>{"use strict";_t();Vn={nba:{sport:"basketball",label:"NBA",categories:{general:["gamesPlayed","avgMinutes","avgFouls","flagrantFouls","technicalFouls","ejections","doubleDouble","tripleDouble","minutes","rebounds","fouls","avgRebounds"],offensive:["avgPoints","avgFieldGoalsMade","avgFieldGoalsAttempted","fieldGoalPct","avgThreePointFieldGoalsMade","avgThreePointFieldGoalsAttempted","threePointFieldGoalPct","avgFreeThrowsMade","avgFreeThrowsAttempted","freeThrowPct","avgAssists","avgTurnovers","points","fieldGoalsMade","fieldGoalsAttempted","threePointFieldGoalsMade","threePointFieldGoalsAttempted","freeThrowsMade","freeThrowsAttempted","assists","turnovers"],defensive:["avgSteals","avgBlocks","steals","blocks"]},defaults:["offensive_points","general_rebounds","offensive_assists","general_games_played"]},wnba:{sport:"basketball",label:"WNBA",categories:{general:["gamesPlayed","avgMinutes","doubleDouble","tripleDouble","PER","avgRebounds"],offensive:["points","avgPoints","avgFieldGoalsMade","avgFieldGoalsAttempted","fieldGoalPct","avgThreePointFieldGoalsMade","avgThreePointFieldGoalsAttempted","threePointFieldGoalPct","avgFreeThrowsMade","avgFreeThrowsAttempted","freeThrowPct","avgAssists","avgTurnovers"],defensive:["avgSteals","avgBlocks"]},defaults:["offensive_points","offensive_avg_points","general_avg_rebounds","general_games_played"]},nfl:{sport:"football",label:"NFL",categories:{general:["gamesPlayed","fumblesForced","fumblesRecovered","fumblesTouchdowns"],passing:["completions","passingAttempts","completionPct","passingYards","yardsPerPassAttempt","passingYardsPerGame","longPassing","passingTouchdowns","interceptions","sacks","sackYardsLost","QBR","QBRating","adjQBR"],rushing:["rushingAttempts","rushingYards","yardsPerRushAttempt","longRushing","rushingBigPlays","rushingTouchdowns","rushingYardsPerGame","rushingFumbles","rushingFumblesLost","rushingFirstDowns"],receiving:["receptions","receivingTargets","receivingYards","yardsPerReception","receivingTouchdowns","longReception","receivingBigPlays","receivingYardsPerGame","receivingFumbles","receivingFumblesLost","receivingYardsAfterCatch","receivingFirstDowns"],defensive:["soloTackles","assistTackles","totalTackles","sacks","sackYards","tacklesForLoss","passesDefended","longInterception"],defensiveinterceptions:["interceptions","interceptionYards","interceptionTouchdowns"],scoring:["rushingTouchdowns","receivingTouchdowns","returnTouchdowns","totalTouchdowns","fieldGoals","kickExtraPoints","totalTwoPointConvs","totalPoints","totalPointsPerGame"],returning:["kickReturns","kickReturnYards","yardsPerKickReturn","longKickReturn","kickReturnTouchdowns","puntReturns","puntReturnYards","yardsPerPuntReturn","longPuntReturn","puntReturnTouchdowns","puntReturnFairCatches"],kicking:["fieldGoalsMade","fieldGoalAttempts","fieldGoalPct","longFieldGoalMade","extraPointsMade","extraPointAttempts","extraPointPct"],punting:["punts","puntYards","longPunt","grossAvgPuntYards","netAvgPuntYards","puntsBlocked","puntsInside20","touchbacks","fairCatches"]},defaults:["passing_yards","rushing_yards","receiving_yards","scoring_total_touchdowns"]},mlb:{sport:"baseball",label:"MLB",categories:{batting:["gamesPlayed","atBats","runs","hits","avg","doubles","triples","homeRuns","RBIs","totalBases","walks","strikeouts","stolenBases","onBasePct","slugAvg","OPS"],pitching:["gamesPlayed","gamesStarted","qualityStarts","ERA","wins","losses","saves","holds","innings","hits","earnedRuns","homeRuns","walks","strikeouts","strikeoutsPerNineInnings","WHIP"],fielding:["gamesPlayed","gamesStarted","fullInningsPlayed","totalChances","putouts","assists","fieldingPct","errors","doublePlays"]},defaults:["batting_home_runs","batting_hits","batting_rbis","pitching_strikeouts"],tablePerCategory:!0},nhl:{sport:"hockey",label:"NHL",categories:{general:["games","plusMinus","shifts","production","wins","losses"],offensive:["goals","assists","points","powerPlayGoals","powerPlayAssists","shotsTotal","shootingPct","gameWinningGoals","faceoffsWon","faceoffsLost","faceoffPercent","shootoutAttempts","shootoutGoals"],defensive:["overtimeLosses","avgGoalsAgainst","shotsAgainst","goalsAgainst","saves","savePct","shutouts"],penalties:["penaltyMinutes"]},defaults:["offensive_goals","offensive_assists","offensive_points","general_games"]}}});var bw,mA,lV,ww=_(()=>{"use strict";_t();qd();bw={clean_sheets:{label:"Clean sheets"},premier_league_appearances:{label:"Premier League appearances, career"},premier_league_goals:{label:"Premier League goals, career"},premier_league_titles:{label:"Premier League titles won"},first_premier_league_season:{label:"First Premier League season, as its start year"}},mA=[...new Set([...Object.keys(ws),...Object.keys(bw)])],lV=[...new Set(["goals","assists","clean_sheets","minutes","starts","yellow_cards","red_cards","penalties_saved","expected_goals","player_price","season_points",...Object.keys(bw)])].filter(e=>e in ws||e in bw)});function vs(e){return e.standing==="unofficial"?vw:void 0}function pA(e){return An.find(t=>t.id===e)}var _M,xM,SM,fV,vw,An,Yd=_(()=>{"use strict";qd();Hd();ww();je();_M=s.discriminatedUnion("kind",[s.object({kind:s.literal("everyone")}),s.object({kind:s.literal("domains"),domains:s.array(s.string().min(1)).min(1)}),s.object({kind:s.literal("named")})]),xM=s.enum(["licensed","unofficial","creator"]),SM=s.enum(["ours","creator"]),fV=s.object({id:s.string().min(1),label:s.string().min(1),standing:xM,origin:SM,tiers:s.array(s.enum(["runtime","live","enterprise"])).min(1),produces:s.array(s.string()),note:s.string().min(1),catalogue:s.object({offers:s.string().min(1),competitions:s.array(s.string()).default([]),cost:s.string().min(1),needsKey:s.boolean().default(!1),signUp:s.string().url().optional(),licence:s.string().min(1),fetched:s.boolean().optional()}).optional(),audience:_M.optional()}),vw="Requests to this source are made on behalf of you, the game builder. You are responsible for the data you consume, and for securing the legal rights and licence to use it. We recommend using it for testing only, and not launching with it unless you have explicit permission from the data owner.";An=[{id:"nba",label:"NBA",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"named"},produces:["pts","reb","ast","stl","blk"],note:"The NBA's own data, licensed by the NBA for its own use only. Not available to anyone else. Career totals are the NBA's own figures, regular season only, not a sum we computed. Refreshed daily for players on this season's rosters; retired careers are carried forward.",catalogue:{offers:"NBA players' career totals, regular season: points, rebounds, assists, steals, blocks.",competitions:["NBA"],cost:"For the NBA's own account only.",needsKey:!1,licence:"The NBA's, for the NBA's own use only. Nobody else may use it.",fetched:!0}},{id:"push",label:"Your own data",standing:"creator",origin:"creator",tiers:["runtime","live","enterprise"],produces:[],note:"A file you push with `gamestage reference push`, from your machine or your CI.",catalogue:{offers:"Any values you hold, in a JSON file you push: your squad, your archive, your own licensed feed.",competitions:[],cost:"Free on every plan.",needsKey:!1,licence:"Yours. Your data, or a feed you license: your terms.",fetched:!0}},{id:"fpl",label:"Fantasy Premier League",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:Object.keys(ws),note:"Free, with no contract behind it, so a prize game wants a licensed source. Prices move weekly and a round in play keeps the ones it opened with.",catalogue:{offers:"Premier League players: FPL price and points, goals, assists, own goals, penalties missed and saved, cards, saves, bonus, tackles, recoveries, defensive contributions, minutes, starts and expected goals and assists, plus per-90 and per-start ratios, with each player's name, club and position. Refreshed daily.",competitions:["Premier League"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}},{id:"premier-league",label:"The Premier League",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"domains",domains:["monterosa.co.uk","premierleague.com"]},produces:mA,note:"The Premier League's own feeds, used with their permission, for Monterosa and the Premier League only. Every current player's season and career record with his photo. Refreshed nightly.",catalogue:{offers:"Every current Premier League player: this season's FPL numbers, career Premier League appearances, goals and titles, first season, previous clubs, nationality, height, preferred foot, set-piece duties and photo. Refreshed nightly.",competitions:["Premier League"],cost:"For Monterosa and the Premier League only.",needsKey:!1,licence:"The Premier League's permission, for their own games. Not ours to offer anyone else."}},{id:"sportmonks",label:"Sportmonks football",standing:"creator",origin:"ours",tiers:["runtime","live","enterprise"],produces:["goals","assists","appearances","minutes","yellow_cards","clean_sheets"],note:"Your own Sportmonks plan and key. We call it on a schedule with your key, and your plan decides which competitions you can use.",catalogue:{offers:"Football players' season statistics for any competition your plan covers: goals, assists, appearances, minutes, cards, clean sheets, with each player's name, team and position.",competitions:[],cost:"Your Sportmonks plan. A free plan covers a few smaller leagues; the Premier League needs a paid one.",needsKey:!0,signUp:"https://www.sportmonks.com/football-api/",licence:"Yours: your Sportmonks plan and its terms. Check they cover this use before a game with a prize."}},{id:"espn",label:"ESPN",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:[...new Set(Object.keys(Vn).flatMap(e=>Wd(e).map(t=>t.key)))],note:"ESPN's openly reachable player statistics, with no contract behind it, so for development and not for a public launch. Refreshed twice a day.",catalogue:{offers:"Season statistics for every player in the NBA, WNBA, NFL, MLB and NHL: points, yards, goals, home runs and dozens more, with each player's name, team and position. Refreshed twice a day.",competitions:["NBA","WNBA","NFL","MLB","NHL"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}}]});function EM(e,t){let o=e.trim().toLowerCase();return o?t.some(r=>{let n=r.trim().toLowerCase();return o===n||o.endsWith(`.${n}`)}):!1}function Vd(e){let t=e.ownerEmail?.lastIndexOf("@")??-1,o=t>=0?e.ownerEmail.slice(t+1).trim().toLowerCase():void 0;return{id:e.id,domain:o||void 0,grants:e.supplierGrants,...e.domainSuppliers?.length?{domainSuppliers:e.domainSuppliers}:{}}}function $M(e){return e.audience??TM}function AM(e,t,o=An){let r=o.find(a=>a.id===t);if(!r)return{allowed:!1,reason:`There is no supplier called "${t}".`};if(e.grants?.includes(t))return{allowed:!0,because:"grant"};if(e.domainSuppliers?.includes(t))return{allowed:!0,because:"audience"};let n=$M(r);switch(n.kind){case"everyone":return{allowed:!0,because:"audience"};case"domains":return e.domain&&EM(e.domain,n.domains)?{allowed:!0,because:"audience"}:{allowed:!1,reason:`${r.label} is available to ${n.domains.join(" and ")}. Ask us if you need it.`};case"named":return{allowed:!1,reason:`${r.label} is granted per account. Ask us if you need it.`}}}function hA(e,t=An){return t.map(o=>({supplier:o,entitlement:AM(e,o.id,t)}))}var TM,Kd=_(()=>{"use strict";Yd();TM={kind:"everyone"}});function vA(e,t){let o={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`},r=t.identity?.player;if(e.identity.status!=="confirmed"&&r?.kind==="oidc"&&r.publicConfig.issuer&&r.publicConfig.jwks_uri&&(e.identity.provider="jwt",e.identity.jwt={issuer:r.publicConfig.issuer,jwks_uri:r.publicConfig.jwks_uri,...r.publicConfig.audience?{audience:r.publicConfig.audience}:{}},e.identity.require_authenticated_writes=!1,e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,o]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let n=new Set(e.measurement.destinations.map(a=>a.type));for(let a of t.analytics)n.has(a.type)||(e.measurement.destinations.push({type:a.type,enabled:!0,config:a.config}),n.add(a.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,o]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,o])}var gA,Zd,yA,bA,fA,wA,_V,xV,SV,kw,ks=_(()=>{"use strict";je();Kd();$n();gA=s.object({kind:s.enum(["figma","tokens","guidelines"]),ref:s.string().min(1)}),Zd=s.object({system:s.string().min(1),kind:s.string().min(1),ref:s.string().optional(),publicConfig:s.record(s.string(),s.string()).default({})}),yA=s.object({provider:s.string().optional(),analytics_requires_consent:s.boolean().default(!0)}),bA=s.object({type:Ub.shape.type,config:s.record(s.string(),s.string()).default({})}),fA=s.object({kind:s.string().min(1),ref:s.string().min(1)}),wA=s.object({sink:fA.optional(),source:fA.optional()}),_V=s.object({id:s.string().min(1),displayName:s.string().min(1),domains:s.array(s.string()).default([]),version:s.number().int().nonnegative().default(1),brand:gA.optional(),identity:s.object({operator:Zd.optional(),player:Zd.optional()}).optional(),consent:yA.prefault({}),analytics:s.array(bA).default([]),data:wA.prefault({}),studioOrg:s.string().optional(),studioSpaces:s.array(s.string()).default([]),defaultStudioSpace:s.string().optional(),requiresExplicitSpace:s.boolean().default(!1)}),xV=s.object({id:s.string().min(1),displayName:s.string().min(1),version:s.number().int().nonnegative().default(1),brand:gA.optional(),identity:s.object({player:Zd.optional()}).optional(),consent:yA.prefault({}),analytics:s.array(bA).default([])}),SV=s.object({id:s.string().min(1),displayName:s.string().min(1),version:s.number().int().nonnegative().default(1),identity:s.object({operator:Zd.optional()}).optional(),data:wA.prefault({})}),kw="not_org_admin"});function _A(e,t=new Date){let o=typeof t=="string"?Date.parse(t):t.getTime(),r,n=Number.NEGATIVE_INFINITY;for(let a of e.rounds){let i=Date.parse(a.locksAt);Number.isNaN(i)||i>n&&(n=i,r=a)}return r?n>o?{state:"live",round:r}:{state:"stale",round:r,lockedForMs:o-n}:{state:"none"}}function xA(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),o=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 ${o} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function Sw(e,t=_s){return e.terms?.version===t}function EA(e,t=_s){return Sw(e,t)?null:{code:"terms_not_accepted",refused:`${e.terms?`The terms changed on ${t} and you accepted version ${e.terms.version}. `:""}Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} before you can continue with this workspace. You must accept them yourself in a browser; an agent cannot accept them for you.`}}function Xd(e){let t=$A.safeParse(e.access);return t.success?t.data:"pending"}function qM(e){let t=e??null;return!t||typeof t.version!="string"||typeof t.at!="string"?null:{version:t.version,at:t.at}}function WM(e){let t=e??null;return t&&typeof t.at=="string"?{at:t.at}:null}function AA(e){let t=n=>typeof n=="string"&&n.trim()?n:null,o=e.decision??null,r=o?t(o.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),contactConsent:qM(e.contactConsent),ageConfirmed:WM(e.ageConfirmed),personalEmail:e.personalEmail===!0,decision:r==="approved"||r==="refused"?{state:r,at:t(o.at)??t(e.registeredAt)??"",by:t(o.by)??"unknown",reason:t(o.reason)}:null}}function CA(e){return{waiting:e.filter(t=>!t.decision).sort((t,o)=>t.registeredAt.localeCompare(o.registeredAt)),decided:e.filter(t=>t.decision).sort((t,o)=>o.decision.at.localeCompare(t.decision.at))}}function Qd(e){return ZM.includes(e)}function Tw(e,t){return!e.prodApproval||Qd(t.tier)?"dev":"prod"}function RA(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function NA(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var OM,PM,kA,RM,NM,LM,xw,zM,jM,SA,DM,MV,TA,MM,_s,_a,Jd,FM,UM,$A,FV,UV,GM,BM,HM,YM,GV,BV,qV,WV,IA,HV,YV,VV,KV,ZV,VM,JV,OA,XV,KM,PA,ZM,xa=_(()=>{"use strict";us();ud();je();$n();Vi();Qi();Gd();Sd();Qi();Kt();ar();ks();OM=s.enum(["draft","live","sleeping","throttled","expired","archived"]),PM=s.enum(["scheduled","open","locked","settled"]),kA=s.object({id:s.string(),label:s.string(),used:s.number(),limit:s.number(),unit:s.string()}),RM=s.object({id:s.string(),label:s.string(),state:PM,opensAt:s.string(),locksAt:s.string(),settledAt:s.string().nullable(),plays:s.number(),edition:s.string().optional(),editionId:s.string().optional(),studioUrl:s.string().nullable().optional(),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional()}),NM=s.object({id:s.string(),name:s.string(),enabled:s.boolean(),consentRequired:s.boolean(),note:s.string()}),LM=s.object({number:s.number().int().positive(),title:s.string(),openedAt:s.string(),labels:s.array(s.string()).default([]),fromGame:s.boolean().default(!1)}),xw=s.object({pickup:s.object({id:s.string(),outcome:s.enum(["ready","empty","failed"])}).optional(),at:s.string(),level:s.enum(["info","warn","error"]),roundId:s.string().nullable(),message:s.string(),dataset:s.string().optional()}),zM=s.enum(["absent","pending","ready","failed"]),jM=s.object({state:zM.default("absent"),url:s.string().nullable().default(null),regenerations:s.number().int().nonnegative().default(0),updatedAt:s.string().nullable().default(null),onProject:s.string().nullable().default(null)});SA=s.object({section:s.string(),status:Db}),DM=s.object({instanceId:s.string(),embedSlug:s.string(),template:s.string(),type:s.enum(["leaderboard","qr"]),createdAt:s.string(),consentBy:s.string()}),MV=s.object({template:s.string().min(1),consent:s.literal(!0)}),TA=s.object({id:s.string(),name:s.string(),containerLabel:s.string().min(1).default(ma),repository:s.string().nullable(),openIssues:s.number().int().nonnegative(),issues:s.array(LM).default([]),archetype:$o,offersPrize:s.boolean().default(!1),liveProvider:s.enum(_o).nullable().optional(),state:OM,prodApproval:s.object({approvedAt:s.string(),approvedBy:s.string()}).nullable().default(null).optional(),archivePrefix:s.string().nullable().default(null),space:s.string().nullable().default(null).optional(),platformSpace:s.string().nullable().default(null).optional(),platformOrg:s.string().nullable().default(null).optional(),platformProject:s.string().nullable().default(null).optional(),platformEvent:s.string().nullable().default(null).optional(),platformElement:s.string().nullable().default(null).optional(),studioUrl:s.string().nullable().default(null).optional(),appSpec:s.object({version:s.string(),shape:s.string(),resource:s.string().nullable().default(null),specUrl:s.string().optional(),wording:s.array(s.string()).optional(),roundFields:ds.optional(),refusal:s.object({at:s.string(),reason:s.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:jM.prefault({}).optional(),graphics:s.array(DM).optional(),clientVersion:s.string().optional(),playgroundUrl:s.string().nullable(),playerEndpoint:s.string().nullable(),manifestRevision:s.string(),manifestSource:s.string().optional(),settingsDefaults:s.record(s.string(),s.string()).optional(),conformance:To,contentHash:s.string(),referenceDigest:s.string().optional(),referenceName:s.string().optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({strategy:s.string(),provider:s.string(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional()}).optional(),monthlyPlayers:s.number().int().nonnegative().optional(),sections:s.array(SA),meters:s.array(kA),history:s.array(Xi),rounds:s.array(RM),destinations:s.array(NM),logs:s.array(xw),updatedAt:s.string()}),MM=s.object({login:s.string(),linkedAt:s.string(),verification:s.literal("unverified").optional()}),_s="2026-10-01",_a="https://gamestage.ai/terms",Jd="https://gamestage.ai/stage",FM=s.object({version:s.string(),acceptedAt:s.string(),by:s.string()});UM=s.object({enabled:s.boolean().default(!1),applicationId:s.string().nullable().default(null),writeKey:s.string().nullable().default(null)}),$A=s.enum(["pending","approved","refused"]),FV=s.enum(["manual","automatic"]);UV=s.enum(["approved","refused"]),GM=s.object({company:s.string().trim().min(1,"Tell us your company.").max(120),role:s.string().trim().min(1,"Tell us your role.").max(120),intent:s.string().trim().min(1,"Tell us what you'd like to build.").max(500),contactConsent:s.literal(!0,{message:"Tick the box so we can contact you about your application."}),ageConfirmed:s.literal(!0,{message:`Confirm you are ${18} or older.`}),marketingConsent:s.boolean().optional()}),BM=s.object({company:s.string().nullish(),role:s.string().nullish(),intent:s.string().nullish(),contactConsent:s.object({version:s.string(),at:s.string()}).nullish(),ageConfirmed:s.object({at:s.string()}).nullish(),marketingConsent:s.object({at:s.string()}).nullish()});HM=s.object({id:s.string(),name:s.string(),tier:ba,ownerEmail:s.string(),access:$A.default("pending"),profile:BM.optional(),platformSpace:s.string().optional(),liveGameAllowance:s.number(),supplierGrants:s.array(s.string()).default([]),domainSuppliers:s.array(s.string()).optional(),github:MM.nullable().default(null),terms:FM.nullable().default(null),signal:UM.prefault({}),meters:s.array(kA),games:s.array(TA)}),YM=TA.extend({logs:s.array(xw).optional()}),GV=HM.extend({games:s.array(YM),gamesTotal:s.number().int().nonnegative(),archivedTotal:s.number().int().nonnegative().default(0)}),BV=s.object({player:s.string().nullable(),control:s.string().nullable(),playground:s.string().nullable()}),qV=s.object({id:s.string(),name:s.string(),archetype:$o,repository:s.string().nullable().default(null),manifestRevision:s.string(),contentHash:s.string(),conformance:To,offersPrize:s.boolean().default(!1),sections:s.array(SA).default([]),containerLabel:s.string().min(1).optional()}),WV=s.object({path:s.string(),size:s.number().int().nonnegative().optional()}),IA=s.string().regex(/^[a-z0-9][a-z0-9-]{7,63}$/,"a deploy id: lowercase letters, digits and dashes, 8 to 64 characters"),HV=s.object({uploadUrl:s.string(),publicUrl:s.string(),key:s.string(),deployId:s.string().optional(),stagedKey:s.string().optional(),expiresInSeconds:s.number().int().positive(),cacheControl:s.string().optional(),playerApiOrigin:s.string()}),YV=s.object({manifestRevision:s.string(),contentHash:s.string(),conformance:To,offersPrize:s.boolean().default(!1),live:s.object({provider:s.enum(_o)}).nullable().optional(),round:Ve.optional(),studioSeed:Ve.optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().superRefine((e,t)=>{let o=_d(e);o&&t.addIssue({code:"custom",message:xd(o)})}).optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({strategy:s.string(),provider:s.string(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional()}).optional(),wording:s.array(s.string()).optional(),roundFields:ds.nullable().optional(),manifestSource:s.string().optional(),settings:s.record(s.string(),s.string()).optional(),notes:s.string().max(500).optional(),studioSpace:s.string().optional(),studioSpaceOrg:s.string().optional(),clientVersion:s.string().optional(),staged:s.object({id:IA,replace:s.boolean()}).optional()}),VV=s.object({game:s.string().trim().min(1).max(64),round:Ve}),KV=s.object({round:Ve}),ZV=s.discriminatedUnion("ok",[s.object({ok:s.literal(!0),engineGame:s.string(),roundId:s.string(),version:s.number().int().nonnegative(),playerApiOrigin:s.string()}),s.object({ok:s.literal(!1),code:s.enum(["game_archived","no_engine","engine_refused"]),refused:s.string()})]),VM=s.object({limit:s.coerce.number().int().positive().max(1e3).default(100),since:s.string().nullable().default(null),level:xw.shape.level.nullable().default(null)}),JV=s.enum(["access_pending","terms_not_accepted","personal_email","profile_incomplete","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","live_not_enabled","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_source_unsupported","round_not_seeded","delete_refused","space_required","space_not_permitted","nothing_published"]),OA=s.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","workspace.member_invited","workspace.member_joined","workspace.member_removed","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.erasure_requested","game.data_erased","game.deleted","game.deleted","workspace.plan_changed","workspace.closed","workspace.datasets_erased","workspace.plan_refused","engine.integrity_violation","edition.repeated","edition.missing","game.quiet","destination.changed","signal.enabled","signal.disabled","source.key_attempt","domain.added","domain.removed","domain.live","domain.stopped","dataset.switched_on","dataset.switched_off","dataset.refresh_changed","ads.requested","ads.not_wanted","ads.request_moved"]),XV=s.object({id:s.string(),at:s.string(),action:OA,actor:s.object({kind:s.enum(["creator","operator","system"]),id:s.string(),email:s.string().nullable().default(null)}),gameId:s.string().nullable().default(null),correlationId:s.string(),detail:s.record(s.string(),s.unknown()).default({})}),KM=s.object({limit:s.coerce.number().int().positive().max(1e3).default(100),action:OA.nullable().default(null),actorId:s.string().nullable().default(null),gameId:s.string().nullable().default(null),from:s.string().nullable().default(null),to:s.string().nullable().default(null)}),PA={runtime:{liveGames:1,devGames:3,mau:1e3,storage:250},live:{liveGames:5,devGames:20,mau:1e4,storage:10240},enterprise:{liveGames:10,devGames:0,mau:0,storage:0}},ZM=["runtime"]});var LA,zA,oK,rK,aK,mr,JM,jA,eu=_(()=>{"use strict";je();Gd();LA="x-gamestage-workspace",zA=s.enum(["owner","member"]),oK=s.object({email:s.string(),role:zA,status:s.enum(["active","invited"]),invitedBy:s.string().nullable().default(null),at:s.string().nullable().default(null)}),rK=s.object({id:s.string(),role:zA,owner:s.string()}),aK=s.object({email:s.string().min(3).max(254)}),mr=5,JM=`This workspace already has ${mr} people besides you, counting invites not yet accepted. Remove someone or cancel an invite first.`,jA="While Gamestage is in preview, invite people at their work address: Gmail, Yahoo and other personal addresses cannot join."});var tu,Ew=_(()=>{"use strict";tu=/https?:\/\/(?:fonts\.googleapis\.com|fonts\.gstatic\.com|use\.typekit\.net|p\.typekit\.net|fonts\.bunny\.net|fonts\.cdnfonts\.com|[\w.-]*fontawesome\.com|cdn\.jsdelivr\.net\/[^\s"')]*\.(?:woff2?|ttf|otf)|unpkg\.com\/[^\s"')]*\.(?:woff2?|ttf|otf))/i});function tF(e){let t=e.toLowerCase().replace(/\.$/,"");return eF.some(o=>t===o||t.endsWith(`.${o}`))}function $w(e){let t;try{t=new URL(e)}catch{return`"${e}" is not a web address. Give the full https address of the font file on your own host.`}if(t.protocol!=="https:")return`"${e}" is not https. Games load fonts over https only.`;if(tF(t.hostname))return`"${e}" is on a Gamestage or Monterosa domain. Your games load your fonts from your own host, never from ours. Host the file yourself and give that address.`;if(tu.test(e))return`"${e}" is a font service (${t.hostname}), which sees every fan's address before any consent banner can ask, so games may not load fonts from it. Host the font file on your own domain and give that address.`}function nu(e,t,o){let r=ya(e);if(!r.ok)return[r.reason];let{name:n,version:a}=r,i=[];o&&(o.find(b=>b.name===n)?.versions.some(b=>b.version===a)||i.push(`${n}@${a} is not one of your org's themes. Publish it with gamestage theme publish, or pin a version gamestage theme list shows.`));let c=`[data-gs-theme="${n}"]`;t.filter(g=>/\.css$/i.test(g.relative)||/\.html?$/i.test(g.relative)).some(g=>g.text.includes(c))||i.push(`No stylesheet in the game has the ${c} block, so the theme is not installed. Run gamestage theme use ${n}@${a}.`);let l=t.filter(g=>!/\.css$/i.test(g.relative)),u=new RegExp([`data-gs-theme\\s*=\\s*["']${n}["']`,`setAttribute\\(\\s*["']data-gs-theme["']\\s*,\\s*["']${n}["']`,`gsTheme\\s*=\\s*["']${n}["']`].join("|"));l.some(g=>u.test(g.text))||i.push(`Nothing in the game sets data-gs-theme="${n}", so the theme styles nothing. Add it to <html> in index.html.`);let p=t.find(g=>g.relative.endsWith(`gamestage-theme-${n}.css`)),f=new Set;for(let g of nF(p?.text??"").matchAll(/url\(\s*["']?([^"')]+)["']?\s*\)/g)){if(g[1].startsWith("data:"))continue;let b=$w(g[1]);b?i.push(b):f.add(new URL(g[1]).origin)}if(f.size)for(let g of t.filter(b=>/\.html?$/i.test(b.relative))){let b=/<meta[^>]+http-equiv=["']content-security-policy["'][^>]*content=(["'])(.*?)\1/i.exec(g.text)?.[2];if(!b)continue;let v=/(?:^|;)\s*(font-src|default-src)\s+([^;]+)/i,x=/(?:^|;)\s*font-src\s+([^;]+)/i.exec(b)?.[1]??v.exec(b)?.[2];if(!x)continue;let R=x.split(/\s+/);for(let F of f)R.some(U=>U==="*"||U==="https:"||U===F||U===new URL(F).host)||i.push(`${g.relative} has a content security policy whose font-src does not allow ${F}, where the theme's fonts are. Add ${F} to font-src.`)}return i}var eF,nF,oF,rF,Aw,DA,Cw,mK,Iw=_(()=>{"use strict";je();Ew();ks();ms();ms();eF=["gamestage.ai","monterosa.cloud","monterosa.co","monterosa.co.uk","monterosa.tools"];nF=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),oF=s.object({declaredBy:s.string().min(3).max(200),declaredAt:s.string().min(10).max(40),statement:s.string().min(10).max(2e3)}),rF=s.object({family:s.string().min(1).max(100),weight:s.string().max(20).optional(),style:s.string().max(20).optional(),src:s.string().min(1).max(2e3),licence:oF}),Aw=s.object({name:s.string(),version:s.string(),base:s.string().max(100).optional(),fonts:s.array(rF).max(20).default([])}),DA=s.object({code:s.string().max(100),message:s.string().max(2e3),token:s.string().max(200).optional()}),Cw=s.object({ok:s.boolean(),errors:s.array(DA).max(500),warnings:s.array(DA).max(500)}),mK=s.object({version:s.string(),theme:Aw,tokens:s.record(s.string(),s.unknown()),overridesCss:s.string().max(2e5).optional(),css:s.string().min(1).max(5e5),check:Cw})});function iF(e){return new TextEncoder().encode(e).length}function MA(e){if(!e.trim())return"The file is empty. Write how a game should fit your organisation's app, then set it again.";let t=iF(e);if(t>aF)return`The file is ${Math.ceil(t/1024)} KB, and the limit is 50 KB. Cut it down to what an agent needs to build a game, and link to longer documents instead of pasting them.`;if(e.includes("\0")||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/.test(e))return"The file is not UTF-8 text. Save it as plain Markdown in UTF-8 and set it again."}function cF(e){let t=e.replace(/\bhttps?:\/\/\S+/gi," ").replace(/\bsha(?:256|384|512)-[A-Za-z0-9+/=]+/g," ");for(let o of t.matchAll(/[A-Za-z0-9+/_-]{40,}={0,2}/g)){let r=o[0];if(/[A-Z]/.test(r)&&/[a-z]/.test(r)&&/[0-9]/.test(r))return!0}return!1}function Ow(e){let t=[];return e.split(/\r?\n/).forEach((o,r)=>{let n=sF.find(a=>a.test.test(o));n?t.push({line:r+1,kind:n.kind}):cF(o)&&t.push({line:r+1,kind:"a long access token"})}),t}var pr,aF,gK,sF,ou=_(()=>{"use strict";je();pr="integration.md",aF=50*1024,gK=s.object({markdown:s.string()});sF=[{kind:"a private key",test:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY( BLOCK)?-----/},{kind:"an AWS access key",test:/\b(?:AKIA|ASIA|AGPA|AIDA|AROA)[0-9A-Z]{16}\b/},{kind:"an AWS secret access key",test:/aws_secret_access_key\s*[=:]/i},{kind:"an API secret key",test:/\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{8,}/},{kind:"a live API key",test:/\bpk_live_[A-Za-z0-9]{8,}/},{kind:"an API secret key",test:/\bsk-[A-Za-z0-9_-]{20,}/},{kind:"a GitHub or GitLab token",test:/\b(?:ghp|gho|ghu|ghs|ghr|github_pat|glpat)[-_][A-Za-z0-9_-]{16,}/},{kind:"a Slack token",test:/\bxox[abprs]-[A-Za-z0-9-]{10,}/},{kind:"a password",test:/\b(?:password|passwd|pwd)\s*[=:]\s*["']?[^\s"'<>`]{4,}/i}]});import{createRequire as lF}from"module";function TF(e,t){return SF(e,t||{},0,0)}function EF(e,t){return wF(e,{i:2},t&&t.out,t&&t.dictionary)}function qA(e,t){if(t){for(var o=new st(e.length),r=0;r<e.length;++r)o[r]=e.charCodeAt(r);return o}if(BA)return BA.encode(e);for(var n=e.length,a=new st(e.length+(e.length>>1)),i=0,c=function(u){a[i++]=u},r=0;r<n;++r){if(i+5>a.length){var d=new st(i+8+(n-r<<1));d.set(a),a=d}var l=e.charCodeAt(r);l<128||t?c(l):l<2048?(c(192|l>>6),c(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,c(240|l>>18),c(128|l>>12&63),c(128|l>>6&63),c(128|l&63)):(c(224|l>>12),c(128|l>>6&63),c(128|l&63))}return Es(a,0,i)}function CF(e,t){if(t){for(var o="",r=0;r<e.length;r+=16384)o+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return o}else{if(Fw)return Fw.decode(e);var n=AF(e),a=n.s,o=n.r;return o.length&&xt(8),a}}function QA(e,t){t||(t={});var o={},r=[];XA(e,"",o,t);var n=0,a=0;for(var i in o){var c=o[i],d=c[0],l=c[1],u=l.level==0?0:8,p=qA(i),f=p.length,g=l.comment,b=g&&qA(g),v=b&&b.length,x=Uw(l.extra);f>65535&&xt(11);var R=u?TF(d,l):d,F=R.length,U=xF();U.p(d),r.push(JA(l,{size:d.length,crc:U.d(),c:R,f:p,m:b,u:f!=i.length||b&&g.length!=v,o:n,compression:u})),n+=30+f+x+F,a+=76+2*(f+x)+(v||0)+F}for(var W=new st(a+22),T=n,H=a-n,G=0;G<r.length;++G){var p=r[G];WA(W,p.o,p,p.f,p.u,p.c.length);var oe=30+p.f.length+Uw(p.extra);W.set(p.c,p.o+oe),WA(W,n,p,p.f,p.u,p.c.length,p.o,p.m),n+=16+oe+(p.m?p.m.length:0)}return RF(W,n,r.length,H,T),W}function eC(e,t){for(var o={},r=e.length-22;Zt(e,r)!=101010256;--r)(!r||e.length-r>65558)&&xt(13);var n=Cn(e,r+8);if(!n)return{};var a=Zt(e,r+16),i=Zt(e,r-20)==117853008;if(i){var c=Zt(e,r-12);i=Zt(e,c)==101075792,i&&(n=Zt(e,c+32),a=Zt(e,c+48))}for(var d=t&&t.filter,l=0;l<n;++l){var u=OF(e,a,i),p=u[0],f=u[1],g=u[2],b=u[3],v=u[4],x=u[5],R=IF(e,x);a=v,(!d||d({name:b,size:f,originalSize:g,compression:p}))&&(p?p==8?o[b]=EF(e.subarray(R,R+f),{out:new st(g)}):xt(14,"unknown compression type "+p):o[b]=Es(e,R,R+f))}return o}var dF,Sa,uF,mF,st,Gt,Gw,ru,au,zw,HA,Sa,YA,jw,VA,pF,FA,Dw,Kn,Fe,In,Oo,Fe,Fe,Fe,Fe,Ts,Fe,hF,fF,gF,yF,Pw,un,Rw,Bw,Es,bF,xt,wF,Zn,xs,Nw,Mw,UA,Ss,KA,GA,vF,ZA,kF,_F,xF,SF,JA,Cn,Zt,Lw,yt,XA,BA,Fw,$F,AF,IF,OF,PF,Uw,WA,RF,qw=_(()=>{dF=lF("/");try{Sa=dF("worker_threads"),uF=Sa.Worker,mF=Sa.isMarkedAsUntransferable}catch{}st=Uint8Array,Gt=Uint16Array,Gw=Int32Array,ru=new st([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),au=new st([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),zw=new st([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HA=function(e,t){for(var o=new Gt(31),r=0;r<31;++r)o[r]=t+=1<<e[r-1];for(var n=new Gw(o[30]),r=1;r<30;++r)for(var a=o[r];a<o[r+1];++a)n[a]=a-o[r]<<5|r;return{b:o,r:n}},Sa=HA(ru,2),YA=Sa.b,jw=Sa.r;YA[28]=258,jw[258]=28;VA=HA(au,0),pF=VA.b,FA=VA.r,Dw=new Gt(32768);for(Fe=0;Fe<32768;++Fe)Kn=(Fe&43690)>>1|(Fe&21845)<<1,Kn=(Kn&52428)>>2|(Kn&13107)<<2,Kn=(Kn&61680)>>4|(Kn&3855)<<4,Dw[Fe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;In=(function(e,t,o){for(var r=e.length,n=0,a=new Gt(t);n<r;++n)e[n]&&++a[e[n]-1];var i=new Gt(t);for(n=1;n<t;++n)i[n]=i[n-1]+a[n-1]<<1;var c;if(o){c=new Gt(1<<t);var d=15-t;for(n=0;n<r;++n)if(e[n])for(var l=n<<4|e[n],u=t-e[n],p=i[e[n]-1]++<<u,f=p|(1<<u)-1;p<=f;++p)c[Dw[p]>>d]=l}else for(c=new Gt(r),n=0;n<r;++n)e[n]&&(c[n]=Dw[i[e[n]-1]++]>>15-e[n]);return c}),Oo=new st(288);for(Fe=0;Fe<144;++Fe)Oo[Fe]=8;for(Fe=144;Fe<256;++Fe)Oo[Fe]=9;for(Fe=256;Fe<280;++Fe)Oo[Fe]=7;for(Fe=280;Fe<288;++Fe)Oo[Fe]=8;Ts=new st(32);for(Fe=0;Fe<32;++Fe)Ts[Fe]=5;hF=In(Oo,9,0),fF=In(Oo,9,1),gF=In(Ts,5,0),yF=In(Ts,5,1),Pw=function(e){for(var t=e[0],o=1;o<e.length;++o)e[o]>t&&(t=e[o]);return t},un=function(e,t,o){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&o},Rw=function(e,t){var o=t/8|0;return(e[o]|e[o+1]<<8|e[o+2]<<16)>>(t&7)},Bw=function(e){return(e+7)/8|0},Es=function(e,t,o){return(t==null||t<0)&&(t=0),(o==null||o>e.length)&&(o=e.length),new st(e.subarray(t,o))},bF=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xt=function(e,t,o){var r=new Error(t||bF[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,xt),!o)throw r;return r},wF=function(e,t,o,r){var n=e.length,a=r?r.length:0;if(!n||t.f&&!t.l)return o||new st(0);var i=!o,c=i||t.i!=2,d=t.i;i&&(o=new st(n*3));var l=function(at){var dt=o.length;if(at>dt){var mt=new st(Math.max(dt*2,at));mt.set(o),o=mt}},u=t.f||0,p=t.p||0,f=t.b||0,g=t.l,b=t.d,v=t.m,x=t.n,R=n*8;do{if(!g){u=un(e,p,1);var F=un(e,p+1,3);if(p+=3,F)if(F==1)g=fF,b=yF,v=9,x=5;else if(F==2){var H=un(e,p,31)+257,G=un(e,p+10,15)+4,oe=H+un(e,p+5,31)+1;p+=14;for(var re=new st(oe),ie=new st(19),te=0;te<G;++te)ie[zw[te]]=un(e,p+te*3,7);p+=G*3;for(var se=Pw(ie),he=(1<<se)-1,we=In(ie,se,1),te=0;te<oe;){var ue=we[un(e,p,he)];p+=ue&15;var U=ue>>4;if(U<16)re[te++]=U;else{var M=0,ke=0;for(U==16?(ke=3+un(e,p,3),p+=2,M=re[te-1]):U==17?(ke=3+un(e,p,7),p+=3):U==18&&(ke=11+un(e,p,127),p+=7);ke--;)re[te++]=M}}var Ne=re.subarray(0,H),P=re.subarray(H);v=Pw(Ne),x=Pw(P),g=In(Ne,v,1),b=In(P,x,1)}else xt(1);else{var U=Bw(p)+4,W=e[U-4]|e[U-3]<<8,T=U+W;if(T>n){d&&xt(0);break}c&&l(f+W),o.set(e.subarray(U,T),f),t.b=f+=W,t.p=p=T*8,t.f=u;continue}if(p>R){d&&xt(0);break}}c&&l(f+131072);for(var ce=(1<<v)-1,fe=(1<<x)-1,ge=p;;ge=p){var M=g[Rw(e,p)&ce],ye=M>>4;if(p+=M&15,p>R){d&&xt(0);break}if(M||xt(2),ye<256)o[f++]=ye;else if(ye==256){ge=p,g=null;break}else{var ze=ye-254;if(ye>264){var te=ye-257,Te=ru[te];ze=un(e,p,(1<<Te)-1)+YA[te],p+=Te}var Me=b[Rw(e,p)&fe],lt=Me>>4;Me||xt(3),p+=Me&15;var P=pF[lt];if(lt>3){var Te=au[lt];P+=Rw(e,p)&(1<<Te)-1,p+=Te}if(p>R){d&&xt(0);break}c&&l(f+131072);var et=f+ze;if(f<P){var ut=a-P,Pe=Math.min(P,et);for(ut+f<0&&xt(3);f<Pe;++f)o[f]=r[ut+f]}for(;f<et;++f)o[f]=o[f-P]}}t.l=g,t.p=ge,t.b=f,t.f=u,g&&(u=1,t.m=v,t.d=b,t.n=x)}while(!u);return f!=o.length&&i?Es(o,0,f):o.subarray(0,f)},Zn=function(e,t,o){o<<=t&7;var r=t/8|0;e[r]|=o,e[r+1]|=o>>8},xs=function(e,t,o){o<<=t&7;var r=t/8|0;e[r]|=o,e[r+1]|=o>>8,e[r+2]|=o>>16},Nw=function(e,t){for(var o=[],r=0;r<e.length;++r)e[r]&&o.push({s:r,f:e[r]});var n=o.length,a=o.slice();if(!n)return{t:ZA,l:0};if(n==1){var i=new st(o[0].s+1);return i[o[0].s]=1,{t:i,l:1}}o.sort(function(T,H){return T.f-H.f}),o.push({s:-1,f:25001});var c=o[0],d=o[1],l=0,u=1,p=2;for(o[0]={s:-1,f:c.f+d.f,l:c,r:d};u!=n-1;)c=o[o[l].f<o[p].f?l++:p++],d=o[l!=u&&o[l].f<o[p].f?l++:p++],o[u++]={s:-1,f:c.f+d.f,l:c,r:d};for(var f=a[0].s,r=1;r<n;++r)a[r].s>f&&(f=a[r].s);var g=new Gt(f+1),b=Mw(o[u-1],g,0);if(b>t){var r=0,v=0,x=b-t,R=1<<x;for(a.sort(function(H,G){return g[G.s]-g[H.s]||H.f-G.f});r<n;++r){var F=a[r].s;if(g[F]>t)v+=R-(1<<b-g[F]),g[F]=t;else break}for(v>>=x;v>0;){var U=a[r].s;g[U]<t?v-=1<<t-g[U]++-1:++r}for(;r>=0&&v;--r){var W=a[r].s;g[W]==t&&(--g[W],++v)}b=t}return{t:new st(g),l:b}},Mw=function(e,t,o){return e.s==-1?Math.max(Mw(e.l,t,o+1),Mw(e.r,t,o+1)):t[e.s]=o},UA=function(e){for(var t=e.length;t&&!e[--t];);for(var o=new Gt(++t),r=0,n=e[0],a=1,i=function(d){o[r++]=d},c=1;c<=t;++c)if(e[c]==n&&c!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(n),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(n);a=1,n=e[c]}return{c:o.subarray(0,r),n:t}},Ss=function(e,t){for(var o=0,r=0;r<t.length;++r)o+=e[r]*t[r];return o},KA=function(e,t,o){var r=o.length,n=Bw(t+2);e[n]=r&255,e[n+1]=r>>8,e[n+2]=e[n]^255,e[n+3]=e[n+1]^255;for(var a=0;a<r;++a)e[n+a+4]=o[a];return(n+4+r)*8},GA=function(e,t,o,r,n,a,i,c,d,l,u){Zn(t,u++,o),++n[256];for(var p=Nw(n,15),f=p.t,g=p.l,b=Nw(a,15),v=b.t,x=b.l,R=UA(f),F=R.c,U=R.n,W=UA(v),T=W.c,H=W.n,G=new Gt(19),oe=0;oe<F.length;++oe)++G[F[oe]&31];for(var oe=0;oe<T.length;++oe)++G[T[oe]&31];for(var re=Nw(G,7),ie=re.t,te=re.l,se=19;se>4&&!ie[zw[se-1]];--se);var he=l+5<<3,we=Ss(n,Oo)+Ss(a,Ts)+i,ue=Ss(n,f)+Ss(a,v)+i+14+3*se+Ss(G,ie)+2*G[16]+3*G[17]+7*G[18];if(d>=0&&he<=we&&he<=ue)return KA(t,u,e.subarray(d,d+l));var M,ke,Ne,P;if(Zn(t,u,1+(ue<we)),u+=2,ue<we){M=In(f,g,0),ke=f,Ne=In(v,x,0),P=v;var ce=In(ie,te,0);Zn(t,u,U-257),Zn(t,u+5,H-1),Zn(t,u+10,se-4),u+=14;for(var oe=0;oe<se;++oe)Zn(t,u+3*oe,ie[zw[oe]]);u+=3*se;for(var fe=[F,T],ge=0;ge<2;++ge)for(var ye=fe[ge],oe=0;oe<ye.length;++oe){var ze=ye[oe]&31;Zn(t,u,ce[ze]),u+=ie[ze],ze>15&&(Zn(t,u,ye[oe]>>5&127),u+=ye[oe]>>12)}}else M=hF,ke=Oo,Ne=gF,P=Ts;for(var oe=0;oe<c;++oe){var Te=r[oe];if(Te>255){var ze=Te>>18&31;xs(t,u,M[ze+257]),u+=ke[ze+257],ze>7&&(Zn(t,u,Te>>23&31),u+=ru[ze]);var Me=Te&31;xs(t,u,Ne[Me]),u+=P[Me],Me>3&&(xs(t,u,Te>>5&8191),u+=au[Me])}else xs(t,u,M[Te]),u+=ke[Te]}return xs(t,u,M[256]),u+ke[256]},vF=new Gw([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ZA=new st(0),kF=function(e,t,o,r,n,a){var i=a.z||e.length,c=new st(r+i+5*(1+Math.ceil(i/7e3))+n),d=c.subarray(r,c.length-n),l=a.l,u=(a.r||0)&7;if(t){u&&(d[0]=a.r>>3);for(var p=vF[t-1],f=p>>13,g=p&8191,b=(1<<o)-1,v=a.p||new Gt(32768),x=a.h||new Gt(b+1),R=Math.ceil(o/3),F=2*R,U=function(Wt){return(e[Wt]^e[Wt+1]<<R^e[Wt+2]<<F)&b},W=new Gw(25e3),T=new Gt(288),H=new Gt(32),G=0,oe=0,re=a.i||0,ie=0,te=a.w||0,se=0;re+2<i;++re){var he=U(re),we=re&32767,ue=x[he];if(v[we]=ue,x[he]=we,te<=re){var M=i-re;if((G>7e3||ie>24576)&&(M>423||!l)){u=GA(e,d,0,W,T,H,oe,ie,se,re-se,u),ie=G=oe=0,se=re;for(var ke=0;ke<286;++ke)T[ke]=0;for(var ke=0;ke<30;++ke)H[ke]=0}var Ne=2,P=0,ce=g,fe=we-ue&32767;if(M>2&&he==U(re-fe))for(var ge=Math.min(f,M)-1,ye=Math.min(32767,re),ze=Math.min(258,M);fe<=ye&&--ce&&we!=ue;){if(e[re+Ne]==e[re+Ne-fe]){for(var Te=0;Te<ze&&e[re+Te]==e[re+Te-fe];++Te);if(Te>Ne){if(Ne=Te,P=fe,Te>ge)break;for(var Me=Math.min(fe,Te-2),lt=0,ke=0;ke<Me;++ke){var et=re-fe+ke&32767,ut=v[et],Pe=et-ut&32767;Pe>lt&&(lt=Pe,ue=et)}}}we=ue,ue=v[we],fe+=we-ue&32767}if(P){W[ie++]=268435456|jw[Ne]<<18|FA[P];var at=jw[Ne]&31,dt=FA[P]&31;oe+=ru[at]+au[dt],++T[257+at],++H[dt],te=re+Ne,++G}else W[ie++]=e[re],++T[e[re]]}}for(re=Math.max(re,te);re<i;++re)W[ie++]=e[re],++T[e[re]];u=GA(e,d,l,W,T,H,oe,ie,se,re-se,u),l||(a.r=u&7|d[u/8|0]<<3,u-=7,a.h=x,a.p=v,a.i=re,a.w=te)}else{for(var re=a.w||0;re<i+l;re+=65535){var mt=re+65535;mt>=i&&(d[u/8|0]=l,mt=i),u=KA(d,u+1,e.subarray(re,mt))}a.i=i}return Es(c,0,r+Bw(u)+n)},_F=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var o=t,r=9;--r;)o=(o&1&&-306674912)^o>>>1;e[t]=o}return e})(),xF=function(){var e=-1;return{p:function(t){for(var o=e,r=0;r<t.length;++r)o=_F[o&255^t[r]]^o>>>8;e=o},d:function(){return~e}}},SF=function(e,t,o,r,n){if(!n&&(n={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),i=new st(a.length+e.length);i.set(a),i.set(e,a.length),e=i,n.w=a.length}return kF(e,t.level==null?6:t.level,t.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,o,r,n)},JA=function(e,t){var o={};for(var r in e)o[r]=e[r];for(var r in t)o[r]=t[r];return o},Cn=function(e,t){return e[t]|e[t+1]<<8},Zt=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Lw=function(e,t){return Zt(e,t)+Zt(e,t+4)*4294967296},yt=function(e,t,o){for(;o;++t)e[t]=o,o>>>=8};XA=function(e,t,o,r){for(var n in e){var a=e[n],i=t+n,c=r;Array.isArray(a)&&(c=JA(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?o[i]=[a,c]:(o[i+="/"]=[new st(0),c],XA(a,i,o,r))}},BA=typeof TextEncoder<"u"&&new TextEncoder,Fw=typeof TextDecoder<"u"&&new TextDecoder,$F=0;try{Fw.decode(ZA,{stream:!0}),$F=1}catch{}AF=function(e){for(var t="",o=0;;){var r=e[o++],n=(r>127)+(r>223)+(r>239);if(o+n>e.length)return{s:t,r:Es(e,o-1)};n?n==3?(r=((r&15)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):n&1?t+=String.fromCharCode((r&31)<<6|e[o++]&63):t+=String.fromCharCode((r&15)<<12|(e[o++]&63)<<6|e[o++]&63):t+=String.fromCharCode(r)}};IF=function(e,t){return t+30+Cn(e,t+26)+Cn(e,t+28)},OF=function(e,t,o){var r=Cn(e,t+28),n=Cn(e,t+30),a=CF(e.subarray(t+46,t+46+r),!(Cn(e,t+8)&2048)),i=t+46+r,c=PF(e,i,n,o,Zt(e,t+20),Zt(e,t+24),Zt(e,t+42)),d=c[0],l=c[1],u=c[2];return[Cn(e,t+10),d,l,a,i+n+Cn(e,t+32),u]},PF=function(e,t,o,r,n,a,i){var c=n==4294967295,d=a==4294967295,l=i==4294967295,u=t+o,p=c+d+l;if(r&&p){for(;t+4<u;t+=4+Cn(e,t+2))if(Cn(e,t)==1)return[c?Lw(e,t+4+8*d):n,d?Lw(e,t+4):a,l?Lw(e,t+4+8*(d+c)):i,1];r<2&&xt(13)}return[n,a,i,0]},Uw=function(e){var t=0;if(e)for(var o in e){var r=e[o].length;r>65535&&xt(9),t+=r+4}return t},WA=function(e,t,o,r,n,a,i,c){var d=r.length,l=o.extra,u=c&&c.length,p=Uw(l);yt(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=o.os),e[t]=20,t+=2,e[t++]=o.flag<<1|(a<0&&8),e[t++]=n&&8,e[t++]=o.compression&255,e[t++]=o.compression>>8;var f=new Date(o.mtime==null?Date.now():o.mtime),g=f.getFullYear()-1980;if((g<0||g>119)&&xt(10),yt(e,t,g<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(yt(e,t,o.crc),yt(e,t+4,a<0?-a-2:a),yt(e,t+8,o.size)),yt(e,t+12,d),yt(e,t+14,p),t+=16,i!=null&&(yt(e,t,u),yt(e,t+6,o.attrs),yt(e,t+10,i),t+=14),e.set(r,t),t+=d,p)for(var b in l){var v=l[b],x=v.length;yt(e,t,+b),yt(e,t+2,x),e.set(v,t+4),t+=4+x}return u&&(e.set(c,t),t+=u),t},RF=function(e,t,o,r,n){yt(e,t,101010256),yt(e,t+8,o),yt(e,t+10,o),yt(e,t+12,r),yt(e,t+16,n)}});function iu(e){let o=(e.match(/<script\b[^>]*>/gi)??[]).map(r=>/\bsrc\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]).find(r=>r!==void 0&&/\.(tsx|jsx|ts|mts)(\?.*)?$/i.test(r));if(o)return[`The page loads ${o}, which is source code a browser cannot run, so the game never starts.`,"This is the game's source folder rather than its build. Build it, then deploy the","folder the build writes, for a Vite game: npm run build, then deploy --dir dist."]}function NF(e){return/gamestage(\.min)?\.js|@monterosa\/gamestage/.test(e)}function su(e,t){if(!t)return;let o=/consentBanner\s*:\s*false/.test(e),r=/data-gs-component=["']consent["']|<Consent\b|game\.consent\.decide\(/.test(e);if(!NF(e))return"The page does not load the Gamestage client, which draws the consent banner.";if(o&&!r)return"The page turns the consent banner off and draws no consent screen of its own."}function cu(e,t){if(!t)return;let o=md.filter(n=>!e?.[n]?.trim()),r=e?.privacy_policy_url?.trim()??"";if(!(o.length===0&&/^https:\/\/[^\s]+$/.test(r)))return[o.length?`${$s} has no ${o.join(" or ")}.`:`privacy_policy_url must be an https address, and is "${r}".`,"Add your brand as consent_brand_name and your privacy policy's address as","privacy_policy_url. A fan is told who is recording them before they answer."]}function LF(e){try{return/(^|\.)monterosa\.(co|co\.uk|com|cloud)$/i.test(new URL(e).hostname)}catch{return!1}}function Ww(e){let t=[];/\bmonterosa\b/i.test(e?.consent_brand_name??"")&&t.push("consent_brand_name names Monterosa"),LF(e?.privacy_policy_url?.trim()??"")&&t.push("privacy_policy_url is Monterosa's privacy policy");let o=Object.keys(e??{}).filter(r=>r.startsWith("label_taster_"));if(o.length&&t.push(`${o.length} setting${o.length===1?"":"s"} copied from a gamestage.ai taster (label_taster_*)`),!!t.length)return[`${$s}: ${t.join("; ")}.`,"The games on gamestage.ai are Monterosa's and are not templates. Name your own","brand and your own privacy policy, and remove the taster's settings. Start a new","game from `gamestage create`."]}var $s,Hw=_(()=>{"use strict";Ki();$s="gamestage.settings.json"});function MF(e){let t=e.replace(/[. ]+$/,"").toLowerCase();return t===".git"||t==="node_modules"}function tC(e){if(!e||e.includes("\0"))return"is empty or not text";if(e.includes("\\"))return"uses a backslash";if(e.startsWith("/")||/^[A-Za-z]:/.test(e))return"is an absolute path";if(e.split("/").some(t=>t===".."))return"climbs out of the folder with ..";if(e.split("/").some(MF))return"is inside .git or node_modules, which a starter must not carry"}function FF(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),o=-1;for(let d=e.length-22;d>=Math.max(0,e.length-22-65535);d--)if(t.getUint32(d,!0)===101010256){o=d;break}if(o<0||o>=20&&t.getUint32(o-20,!0)===117853008)return;let r=t.getUint16(o+8,!0),n=t.getUint16(o+10,!0);if(r!==n)return;let a=t.getUint32(o+16,!0);if(n===65535||a===4294967295)return;let i=new TextDecoder("utf-8"),c=[];for(let d=0;d<n;d++){if(a+46>e.length||t.getUint32(a,!0)!==33639248)return;let l=t.getUint16(a+4,!0)>>8,u=t.getUint32(a+24,!0),p=t.getUint16(a+28,!0),f=t.getUint16(a+30,!0),g=t.getUint16(a+32,!0),b=t.getUint32(a+38,!0),v=i.decode(e.subarray(a+46,a+46+p)),x=l===3||l===19?b>>>16:0;c.push({name:v,folder:v.endsWith("/"),symlink:(x&61440)===40960,size:u}),a+=46+p+f+g}return c}function nC(e){if(e.length>zF)return{ok:!1,problems:[{check:hr,problem:`the zip is ${(e.length/1024/1024).toFixed(1)} MB, and the limit is 25 MB. Leave out node_modules, build output and large media.`}]};let t=FF(e);if(!t)return{ok:!1,problems:[{check:hr,problem:"the upload is not a zip that can be read. Publish it with gamestage org starter publish <folder>."}]};let o=[],r=t.filter(d=>!d.folder);r.length>jF&&o.push({check:hr,problem:`it holds ${r.length.toLocaleString("en-GB")} files, and the limit is 2,000. Leave out node_modules and build output.`});let n=r.reduce((d,l)=>d+l.size,0);n>DF&&o.push({check:hr,problem:`it unpacks to ${Math.ceil(n/1024/1024)} MB, and the limit is 100 MB.`});let a=t.filter(d=>d.symlink).map(d=>d.name);a.length&&o.push({check:hr,problem:`it holds ${a.length===1?"a symbolic link":"symbolic links"} (${a.slice(0,5).join(", ")}). Replace each with the file it points to.`});let i=t.flatMap(d=>{let l=tC(d.name.replace(/\/$/,""));return l?[`${d.name} ${l}`]:[]});if(i.length&&o.push({check:hr,problem:`a path would land outside the folder: ${i.slice(0,5).join("; ")}.`}),o.length)return{ok:!1,problems:o};let c;try{c=eC(e,{filter:d=>!d.name.endsWith("/")})}catch{return{ok:!1,problems:[{check:hr,problem:"the zip is damaged and could not be unpacked. Publish it again."}]}}return{ok:!0,files:new Map(Object.entries(c))}}var Ta,zF,jF,DF,AK,CK,hr,IK,Yw=_(()=>{"use strict";je();qw();ou();ms();jd();Hw();Ta="gamestage-starter.json",zF=25*1024*1024,jF=2e3,DF=100*1024*1024,AK=s.object({name:s.string(),version:s.string(),description:s.string().min(1).max(280),framework:s.string().min(1).max(40),build:s.string().min(1).max(200).optional(),out:s.string().min(1).max(200).refine(e=>!tC(e),"must be a folder inside the starter, such as dist").optional()}),CK=s.object({version:s.string(),bytes:s.number().int().positive()});hr="size and paths";IK=2*1024*1024});function oC(e,t="USD"){let o=t==="USD"?"$":`${t} `;return e===0?`${o}0.00`:e<1e-4?`under ${o}0.0001`:e<.01?`${o}${e.toFixed(4)}`:`${o}${e.toFixed(2)}`}function rC(e){let t=e.currency==="USD"?"$":`${e.currency} `,o=`${t}${e.inputPerMTok} per million input tokens`,r=e.outputPerMTok?`${t}${e.outputPerMTok} per million output tokens`:"output free";return`${o}, ${r}`}var Vw=_(()=>{"use strict"});var Kw=_(()=>{"use strict"});function aC(e){return e==="requested"||e==="with_monterosa"||e==="with_partner"}function lu(e){if(!e||typeof e!="object")return null;let t=WF.safeParse(e);return t.success?t.data:null}function Zw(e){let t=e&&typeof e=="object"?e:{};return{request:lu(t.request),...typeof t.refused=="string"?{refused:t.refused}:{},...typeof t.code=="string"?{code:t.code}:{},...t.products==="on"||t.products==="off"||t.products==="not_set_up"?{products:t.products}:{}}}function du(e){if(!e)return{headline:"Not requested.",next:"You can ask for partner products on your result screen. Using them is subject to approval by Monterosa and the retail partner, and to commercial terms agreed with Monterosa."};switch(e.state){case"requested":return{headline:"Requested. Waiting for Monterosa to pick it up.",next:"Monterosa reads your answers, then takes the request to the retail partner. You can still change your answers until then."};case"with_monterosa":return{headline:"With Monterosa.",next:"Monterosa is checking your answers and may email you with questions before taking the request to the retail partner."};case"with_partner":return{headline:"With the retail partner.",next:"The retail partner decides where its products appear. Monterosa tells you when they answer, and agrees commercial terms with you before anything goes live."};case"approved":return{headline:"Approved. Products are switched on for this game.",next:"Fans who win or finish without losing see up to three partner products on the result screen. Use is subject to the commercial terms agreed with Monterosa."};case"declined":return{headline:`Declined.${e.reason?` ${e.reason.replace(/\.?$/,".")}`:""}`,next:"Products stay off for this game. If something has changed, you can ask again."};case"not_wanted":return{headline:"You said you do not want products in this game.",next:"Nobody will ask again. If you change your mind, request them from this page or with `gamestage ads request`."}}}function Jw(e){let t=e.filter(n=>n.state!=="not_wanted"),o=t.filter(n=>aC(n.state)).sort((n,a)=>n.requestedAt.localeCompare(a.requestedAt)),r=t.filter(n=>!aC(n.state)).sort((n,a)=>a.updatedAt.localeCompare(n.updatedAt));return[...o,...r]}var UF,iC,GF,LK,sC,BF,qF,WF,HF,uu=_(()=>{"use strict";je();UF=["requested","with_monterosa","with_partner","approved","declined","not_wanted"],iC=s.enum(UF),GF=["requested","with_monterosa","with_partner","approved","declined"],LK=s.enum(GF);sC=s.object({audience:s.string().trim().min(1,"Say who the game is for.").max(500),wherePlayed:s.string().trim().min(1,"Say where the game is played.").max(500),countries:s.string().trim().min(1,"Say which countries its fans are in.").max(300),prize:s.boolean(),note:s.string().trim().max(1e3).nullable().default(null)}),BF=s.object({kind:s.enum(["creator","operator"]),id:s.string(),email:s.string().nullable().default(null)}),qF=s.object({state:iC,at:s.string(),by:BF,reason:s.string().nullable().default(null)}),WF=s.object({gameId:s.string(),workspaceId:s.string(),gameName:s.string().nullable().default(null),ownerEmail:s.string().nullable().default(null),facts:sC.nullable().default(null),state:iC,reason:s.string().nullable().default(null),requestedAt:s.string(),updatedAt:s.string(),history:s.array(qF).default([])});HF=s.union([s.object({wanted:s.literal(!0).default(!0),facts:sC}),s.object({wanted:s.literal(!1)})])});var VF,cC,KF,mu,UK,pu=_(()=>{"use strict";je();_t();Hd();VF=12,cC=12,KF=["espn"],mu=e=>KF.includes(e),UK=s.object({workspace:s.string().min(1),name:s.string().min(1),supplier:s.string().min(1),request:s.object({league:s.string(),season:s.number().int().optional(),measures:s.array(s.string()).min(1)}),refreshHours:s.number().int().positive().default(VF),override:s.object({refreshHours:s.number().int().positive(),by:s.string(),at:s.string()}).optional(),disabled:s.boolean().default(!1),createdAt:s.string(),updatedAt:s.string(),by:s.string()})});var JF,KK,Xw=_(()=>{"use strict";je();xa();_t();pu();JF=s.enum(["game.deleted","operator.request","workspace.closed"]),KK=s.object({kind:s.enum(["engine","workspace"]),target:s.string(),workspaceId:s.string(),gameId:s.string().nullable(),reason:JF,requestedAt:s.string(),dueBy:s.string(),completedAt:s.string().nullable(),attempts:s.number().int(),lastError:s.string().nullable(),deleted:s.number().int(),engine:s.enum(["gamestage","arcade"]).optional()})});function e6(e){return`slate-${e+1}`}function fu(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,o)=>({id:e6(o),label:t.label??"",entries:t.entries.map(r=>({key:r.key,label:r.label??""}))}))}}var XF,QF,Qw,Jn=_(()=>{"use strict";je();Ct();XF=s.object({key:s.string().min(1),label:s.string().default(""),note:s.string().optional()}),QF=s.object({id:s.string().min(1),label:s.string().default(""),entries:s.array(XF).min(1)}),Qw=s.object({archetype:s.literal("push"),measure:s.string().min(1).optional(),theme:s.string().default(""),prompt:s.string().default(""),target:s.number().int().positive().optional(),targetLabel:s.string().default(""),unit:s.string().max(4).default(""),slates:s.array(QF).min(1)})});function Cs(e){return Yn(e,"draws_allowed")}var ev,tv=_(()=>{"use strict";sn();ev=[{key:"round_solution",label:"The phrase",type:"freetext",description:'The word or phrase a fan solves, e.g. "George Russell". A fan sees one tile per letter, grouped by word, with "What a fan is told" as the hint. Accents and punctuation are kept for the reveal and ignored when marking. Leave it empty for an ordinary board. Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which draws letters from it and marks a solve against it.",section:"This round",public:!1},{key:"round_draws",label:"Letters a fan draws",type:"number",description:'With "The phrase": how many letters a fan may draw before they must have solved it. Leave it empty for 3.',readBy:"The Engine.",section:"This round"},{key:"round_draw_order",label:"Order of the letters",type:"list",options:[{name:"The same for every fan",value:"seeded"},{name:"Different for each fan",value:"random"}],default:"seeded",description:'With "The phrase": the same order gives every fan the same letters in the same order, so results compare and can be shared without a spoiler. A different order per fan makes each play its own.',readBy:"The Engine.",section:"This round"}]});function Is(e){return Yn(e,"guesses_allowed")}var dC,uC,mC,pC,hC,fC,nv,gu=_(()=>{"use strict";sn();dC="round_guess_answer",uC="round_guess_count",mC="round_guess_feedback",pC="round_guess_words",hC="round_guess_clues",fC="round_guess_picture",nv=[{key:dC,label:"The answer",type:"freetext",description:'The word or number a fan guesses, e.g. "ALLOY" or "1966". A whole number makes it a number round, where a fan is told higher or lower; anything else is a word, where a fan sees one tile per letter. Case and accents are ignored when marking. Leave it empty for an ordinary board. Never shown to a fan before they finish. This is the answer, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which marks every guess against it.",section:"This round",public:!1},{key:uC,label:"Guesses a fan gets",type:"number",description:'With "The answer": how many guesses a fan gets, from 1 to 20. A skip spends one. Leave it empty for 6.',readBy:"The Engine.",section:"This round"},{key:mC,label:"What a fan is told after each guess",type:"list",options:[{name:"Each letter's colour (words)",value:"letters"},{name:"Higher or lower (numbers)",value:"higher_lower"},{name:"Only right or wrong",value:"none"}],description:'With "The answer": leave it empty for letter colours on a word and higher or lower on a number.',readBy:"The Engine.",section:"This round"},{key:pC,label:"Accept only real words",type:"list",options:[{name:"Any letters",value:"any"},{name:"Real words only",value:"words"}],default:"any",description:'With a word in "The answer": "Real words only" refuses a guess that is not an English word, without spending it. Works for answers of 4 to 7 letters.',readBy:"The Engine.",section:"This round"},{key:hC,label:"Clues",type:"freetext",description:'With "The answer": one clue per line, or separated by "|". A fan sees the next clue after each wrong guess or skip, in order. Never shown to a fan before they earn it, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which hands each clue to the fan who earned it.",section:"This round",public:!1},{key:fC,label:"Picture",type:"image",description:'With "The answer": a picture a fan guesses from, such as a photograph for guess the year. Shown to every fan from the start, so pick one that does not give the answer away on its own. Leave it empty for none.',readBy:"The game's page, which shows it above the guess.",section:"This round"}]});var t6,n6,o6,ov,yu=_(()=>{"use strict";Ct();t6="hunt_points_by_turn",n6="hunt_points_for_playing",o6="hunt_points_for_correct",ov=[{key:t6,label:"Points by turn",type:"freetext",description:'Points for a correct answer on the first turn, the second, and so on, separated by commas, e.g. "10, 6, 3". A turn is a letter drawn in a solve-the-phrase game, or a guess in a guess game. A correct answer after more turns than you list earns nothing from this box. Leave every points box empty to score the turns left plus one.',readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"},{key:n6,label:"Points for playing",type:"number",description:"Points every fan earns for finishing a round, won or lost. Leave it empty for none.",readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"},{key:o6,label:"Points for a correct answer",type:"number",description:'A flat amount for a correct answer, on top of "Points by turn". Use this alone to give every winner the same. Leave it empty for none.',readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"}]});function yC(e){return e.includes(gC)}var r6,gC,rv,bu=_(()=>{"use strict";Ct();r6="push_compare",gC="each_at_least_last",rv=[{key:r6,label:"How picks are judged",type:"list",options:[{name:"Add up: going over the target is out",value:"total"},{name:"Chain: each pick at least the last",value:gC}],default:"total",description:"Add up: a fan's picks are added together and going over the round's target ends the round. Chain: each pick must be worth at least as much as the one before it, the first lower pick ends the round, and the score is how many picks held. A chain round has no target, so leave each round's target empty.",readBy:"The control plane, which writes it onto each round for the Engine to mark.",section:"Rules"}]});function u6(e){let t=Cs(e),o=Is(e);return d6.filter(r=>c6.has(r)?t:l6.has(r)?o:Yn(e,r))}function m6(e){return[...Cs(e)||Is(e)?i6:[],...yC(e)?s6:[]]}function vC(e){return[...Rd(e),...u6(e),...m6(e)]}var bC,a6,av,wC,i6,s6,c6,l6,d6,wu=_(()=>{"use strict";sn();tv();gu();yu();bu();bC="products_about",a6={key:bC,label:"Products about",type:"list",options:[{name:"The answer",value:"answer"},{name:"What the answer belongs to",value:"parent"},{name:"The game's theme",value:"theme"},{name:"No products",value:"none"}],default:"answer",description:`What the shop products shown after a win are about. Usually the answer itself. If the question makes the answer look bad, so that selling it would be a dig, choose what it belongs to, the game's theme, or no products. For example, after "Who is the player that's not yet scored?" offer his club or the league rather than his shirt; after "Which character never wins an argument?" offer the film rather than that character. The theme is the game's "Shop theme" setting.`,readBy:"The game's own page, which asks the shop for products about it after a win or a neutral result.",section:"This round"},av={hunt:[a6,...ev,...nv]},wC={hunt:ov,push:rv},i6=new Set(ov.map(e=>e.key)),s6=rv.map(e=>e.key),c6=new Set(ev.map(e=>e.key)),l6=new Set(nv.map(e=>e.key)),d6=[...new Set(Object.values(av).flatMap(e=>(e??[]).map(t=>t.key)))]});var _C,p6,_Z,Os=_(()=>{"use strict";je();Kt();Jn();Ct();wu();gu();_C=Cd.safeExtend({answerMeasure:s.string().min(1).optional(),answerRule:rs.optional()}),p6=s.discriminatedUnion("archetype",[Qw,_C,wb,Id]),_Z=s.object({name:s.string().regex(/^\d{4}-\d{2}-\d{2}$/,"A day is named by its date, e.g. 2026-11-01."),dayStart:s.number().int(),dayEnd:s.number().int(),round:p6,overwrite:s.boolean().optional()}).refine(e=>e.dayEnd>e.dayStart,"A day must end after it starts.")});var iv,CZ,sv=_(()=>{"use strict";je();_t();Jn();Os();Kt();iv=s.object({count:s.number().int().min(1).max(80),measure:s.string().trim().min(1).optional(),position:s.string().trim().min(1).optional(),team:s.string().trim().min(1).optional(),layout:s.enum(["grid","pitch","xi"]).optional(),dataset:s.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9._\/-]*\.json$/,"A dataset name, e.g. sportmonks/premier-league-lineups.json").optional(),prompt:s.string().trim().min(1).max(200).optional()}),CZ=s.object({measure:s.string().min(1),rule:rs,prompt:s.string().trim().min(1)})});var vu=_(()=>{"use strict";Kt();Ct();ns()});var ku=_(()=>{"use strict"});var cv,lv=_(()=>{"use strict";Io();_t();sv();Vt();Jn();Os();vu();sn();ku();Ct();cv="Studio rounds:"});var g6,TC,y6,lJ,EC,dJ,uJ,mJ,dv=_(()=>{"use strict";je();_t();g6=s.enum(["push","pull"]),TC=s.object({workspaceId:s.string().min(1),name:s.string().min(1),key:s.string().min(1),digest:s.string().regex(/^[0-9a-f]{16}$/),measures:s.array(s.string()).default([]),counts:s.record(s.string(),s.number().int().nonnegative()).default({}),scored:s.array(s.string()).optional(),bytes:s.number().int().nonnegative().default(0),origin:g6.default("push"),supplier:s.string().optional(),publishedAt:s.string().nullable().default(null),checkedAt:s.string().nullable().default(null),failing:s.boolean().default(!1),counted:s.boolean().default(!1)}),y6=s.object({gameId:s.string().min(1),gameName:s.string().default(""),pinnedDigest:s.string().nullable().default(null),stale:s.boolean().default(!1),roundIds:s.array(s.string()).default([])}),lJ=s.object({dataset:TC,usedBy:s.array(y6).default([])}),EC=s.enum(["pushed","pulled","joined","refused","failed"]),dJ=s.object({at:s.string(),event:EC,dataset:s.string().min(1),digest:s.string().nullable().default(null),gameId:s.string().nullable().default(null),gameName:s.string().nullable().default(null),roundId:s.string().nullable().default(null),message:s.string().default(""),ok:s.boolean().default(!0)}),uJ=s.object({dataset:s.string().optional(),gameId:s.string().optional(),event:s.array(EC).optional(),since:s.string().optional(),search:s.string().optional(),before:s.string().optional(),limit:s.number().int().positive().max(500).default(100)}),mJ=s.object({datasets:s.array(TC).default([]),unavailable:s.string().nullable().default(null)})});var Ps=_(()=>{"use strict";Ct();Kt()});var uv=_(()=>{"use strict";Jn();Ct()});var mv=_(()=>{"use strict"});var _u=_(()=>{"use strict";Jn();Ct()});var pv=_(()=>{"use strict"});var xu=_(()=>{"use strict";Ps();_t();Jn();uv();vu();mv();Ct();as();_u();pv();Jn();Kt();Vt();ku();yu();bu();Os()});function hv(e){return AC+e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function IC(e){if(e.startsWith(AC)){for(let[t,o]of Object.entries(CC))if(o.some(r=>hv(r)===e))return t}}function fv(e){let o=Object.values(CC).flat().map(hv).indexOf(e);return o===-1?void 0:o}var AC,CC,Su,gv=_(()=>{"use strict";AC="label_taster_",CC={"Taster: ringers":["huntFoundLabel","huntFoundState","huntRuledOutState","huntSelectedState","huntChooseLabel","huntNameOne","huntNameMany","huntChecking","huntSelection","huntRules","huntLimits","huntMistakesLeft","huntFeedback","huntRetry","huntAnswers","huntWon","huntFinished","huntRecap","huntBoardPending","huntNextFailed","huntTimed","huntFinishedAction","huntReviewLabel"],"Taster: board and buttons":["playPrompt","attemptsLabel","mistakesLabel","pickedLabel","scoreLabel","timeLeftLabel","timeUpLabel","nextRoundLabel","oneAwayLabel","runningLabel","spentLabel","underNote","bustFallback","restartLabel","playAnotherLabel","playAnotherBusyLabel","questionCountLabel","yourCallLabel"],"Taster: result and leaderboard":["wonLabel","finishedLabel","pendingLabel","pendingNote","rankLabel","rankUnavailable","rewardLabel","anonymousLabel","derivedNameLabel","boardLabel","boardLoading","boardEmpty","rankedBy","closeLabel"],"Taster: when a play is refused":["refused","refusedClosed","refusedFinished","refusedNoTries","refusedTooManyWrong","refusedNoPicks","refusedIncomplete","refusedOneAtATime","refusedMoved","roundLockedLabel","roundLockedNextLabel","unavailable"],"Taster: loading":["loading","loadingTakingTooLong","loadingReload","loadingConnecting","loadingLookingUp","loadingKits","loadingOpening","loadingStarting","loadingSettings","loadingRound","loadingState","loadingFailedAt","loadingProgressLabel"],"Taster: navigation and page":["eyebrow","tabHome","tabPlay","tabHow","tabsLabel","moreLabel","homeTitle","homeHere","howToPlay","backLabel","footNote","footLink"],"Taster: proofs and the notify demo":["proofsHeading","proofsBlurb","lookLabel","changeLabel","duplicateLabel","busyLabel","payloadNote","needsPlay","notCapped","notifyTitle","notifyMockNote","notifyFieldLabel","notifySubmit","notifyDone"],"Taster: bingo":["bingoDealLabel","bingoDealingLabel","bingoWhichLabel","bingoFlipHint","bingoPreviousLabel","bingoNextLabel","bingoWatchingLabel","bingoOneAwayLabel","bingoLineLabel","bingoCalledLabel","bingoFreeLabel","bingoChooseNote","bingoWatchNote","bingoResultNote","bingoHitLabel","bingoMissLabel","bingoDetailsLabel"],"Taster: penalties":["shootOptionsLabel","shootReplayLabel","shootInstruction","shootPitchLabel","shootRetryLabel","shootGoalLabel","shootSavedLabel","shootWideLabel","shootOverLabel","shootFrameLabel","shootGoalsLabel","shootGoalsTally","shootAimLabel","shootPowerLabel","shootPlacedLabel","shootFirmLabel","shootFullLabel","shootZoneTopLeft","shootZoneTopCentre","shootZoneTopRight","shootZoneLowLeft","shootZoneLowCentre","shootZoneLowRight"],"Taster: shop":["shopHeading","shopBadge","shopDisclosure","shopButton","shopLinkDescription","shopCompetition"]};Su=["tabHow","boardLabel","closeLabel","playAnotherLabel","restartLabel","backLabel"].map(e=>hv(e))});function $6(e){let t=new Map,o=new Map,r=n=>{for(let a of n)if(a.type==="list"&&o.set(a.key,a),a.type==="collection"){let i=t.get(a.key);if(i&&(i.itemLabel!==a.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(a.fieldset??[])))throw new Error(`The collection "${a.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(a.key,a),r(a.fieldset??[])}};return r(e),[...S6,...Tb.map(E6),...[...t.values()].map(T6),...[...o.values()].map(x6)]}function Eu(e){let t=[];for(let o of e){let r=o.public===!1,n={label:o.label,key:o.key,field:RC(o),description:o.description,...o.type==="collection"?{}:{mandatory:o.required===!0},...r?{public:!1,cloneable:!1}:{},...o.default!==void 0?{default:o.default}:{}},a=t.find(i=>i.name===o.section);if(a||(a={name:o.section},t.push(a)),o.subsection){let i=a.subsections??=[],c=i.find(d=>d.name===o.subsection);c||(c={name:o.subsection,...o.subsectionDescription?{description:o.subsectionDescription}:{},properties:[]},i.push(c)),c.properties.push(n)}else(a.properties??=[]).push(n)}return t}function A6(e){let t=e.archetypes.map(De);for(let l of t)if(!OC[l])throw new Error(`No Studio element name for the ${l} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let o=l=>`${e.urls.baseAppsUrl}/${l}`,r=l=>{if(!e.roundFields)return;let u=zd(l,e.roundFields);return u.ok?u.fields:void 0},n=new Map((t.length===1?r(t[0])??[]:[]).map(l=>[l.key,l])),a=l=>n.get(l.key)??l,i=new Set(e.wording??_b),c=l=>(av[De(l)]??[]).filter(u=>e.wording===void 0||e.wording.includes(u.key)),d=[...ss.filter(l=>!_b.includes(l.key)||i.has(l.key)),...kE,...[...i].filter(l=>l.startsWith(xo)).sort(C6).map(I6),...[...new Set(t)].flatMap(l=>Eb[l]??[]),...[...new Set(t)].flatMap(l=>(wC[l]??[]).filter(u=>e.wording===void 0||e.wording.includes(u.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:o("elements.json"),fields:o("fields.json"),project_settings:o("project_settings.json"),event_settings:o("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1,services:{"lvis-id-custom-tab":{}}},"elements.json":[...t.map(l=>({name:OC[l],content_type:PC(l),derived_from:Tu[l]?.derivedFrom??"data",duration:Tu[l]?.duration??{mode:"instant"},label:Tu[l]?.derivedFrom==="prediction"?"{{question.text}}":"{{element.title}}",custom_fields:Eu(r(l)?[...r(l),...c(l)]:[...hd.includes(De(l))?So.filter(u=>u.key==="title"):So,...cs[De(l)]??[],...c(l)]),...Tu[l]?.derivedFrom==="prediction"?{label_question:l==="bingo"?"Card":"Question",label_option:l==="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"}]}:{}})),...t.some(l=>De(l)==="predict")?[{...Zi.scoreline,fields:Ab,titleHelp:"How this match is listed on the timeline, so you can tell the matches apart. For example: Arsenal v Chelsea. Fans do not see it."},{...Zi.number,fields:Cb,titleHelp:"How this question is listed on the timeline. For example: First goal minute. Fans do not see it."}].map(l=>({name:l.name,content_type:l.contentType,derived_from:"data",duration:{mode:"fixed",default:604800},label:"{{element.title}}",custom_fields:Eu([...So.filter(u=>u.key==="title").map(u=>({...u,label:"Name on the timeline",description:l.titleHelp})),...l.fields])})):[]],"fields.json":$6([...d,...xb,...So.map(a),...Object.values(cs).flat().map(a),...Object.values(Ib).flat(),...Tb,...Ab,...Cb,...t.flatMap(c)]),"project_settings.json":{sections:Eu(d)},"event_settings.json":{sections:Eu([...xb,...e.live?LE:[],...t.flatMap(l=>Ib[l]??[])])}}}function C6(e,t){let o=fv(e),r=fv(t);return o===void 0&&r===void 0?e<t?-1:e>t?1:0:o===void 0?-1:r===void 0?1:o-r}function I6(e){let t=ME(e),o=IC(e);if(!o)return t;let r=e.slice(13).replace(/_/g," ").trim();return{...t,label:r.charAt(0).toUpperCase()+r.slice(1),subsection:o,...Su.includes(e)?{required:!0}:{}}}function NC(e){return A6({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls,live:e.live??!1,...e.roundFields?{roundFields:e.roundFields}:{}})}var OC,PC,Tu,RC,x6,S6,T6,E6,yv=_(()=>{"use strict";sn();$d();us();wu();gv();Vt();OC=oE,PC=e=>{let t=De(e);return rb[t]??`gamestage-${t.replaceAll("_","-")}-element`},Tu={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},RC=e=>e.type==="collection"||e.type==="list"?e.key:e.type,x6=e=>({key:e.key,type:"list",data:(e.options??[]).map(t=>({name:t.name,value:t.value}))}),S6=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1},{key:"file",type:"file",localisable:!1}],T6=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:RC(t),...t.description?{description:t.description}:{}}))}),E6=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var bv=_(()=>{"use strict";Vt()});var O6,gX,yX,wv=_(()=>{"use strict";je();O6=s.enum(["waiting-for-dns","issuing-certificate","live","not-pointing","failed"]),gX=s.object({hostname:s.string(),gameId:s.string(),status:O6,statusSince:s.string(),createdAt:s.string(),waitingSince:s.string(),liveAt:s.string().nullable().default(null),lastCheckedAt:s.string().nullable().default(null),lastSeen:s.string().nullable().default(null),reason:s.string().nullable().default(null),tenantId:s.string().nullable().default(null),verificationToken:s.string().nullable().default(null)}),yX=72*36e5});var LC=_(()=>{"use strict";eu();Iw();ou();Yw();Io();Vw();Vi();xa();Kw();uu();Xw();lv();ks();Kd();_t();pu();dv();Ps();xu();yv();bv();wv();gw();yw();Kt();xa()});function P6(e){try{return JSON.parse(e)}catch{return{}}}function R6(e,t){if(e.status>=500)return;let o=(e.headers.get("server")??"").toLowerCase(),r=(e.headers.get("content-type")??"").toLowerCase(),n=t.trimStart().slice(0,200).toLowerCase();if(o.includes("amazons3")||n.startsWith("<?xml")&&n.includes("<error>"))return"S3";if(r.includes("text/html")||n.startsWith("<!doctype html")||n.startsWith("<html"))return"a website";if(t.trim()!=="")try{JSON.parse(t);return}catch{return o.includes("cloudfront")?"CloudFront":"something other than an API"}}function DC(e){let t=1e3*2**(e-1),o=t*.2*(Math.random()*2-1);return Math.round(t+o)}function FC(e){let t=e.fetch??globalThis.fetch,o=e.maxAttempts??4,r=e.baseUrl.replace(/\/+$/,"");return async function(a,i,c={}){let d=globalThis.location?.origin,l=new URL(`${r}${i}`,r.startsWith("/")?d:void 0);for(let[p,f]of Object.entries(c.query??{}))if(Array.isArray(f))for(let g of f)l.searchParams.append(p,String(g));else f!=null&&l.searchParams.set(p,String(f));let u;for(let p=1;p<=o;p++){c.signal?.throwIfAborted();let f=typeof e.token=="function"?await e.token():e.token,g;try{g=await t(l,{signal:c.signal,method:a,headers:{...e.headers,...e.workspace?{[LA]:e.workspace}:{},authorization:`Bearer ${f}`,...c.body===void 0?{}:{"content-type":"application/json"}},body:c.body===void 0?void 0:JSON.stringify(c.body)})}catch(F){c.signal?.throwIfAborted();let U=F instanceof Error?F.message:String(F);if(u=new qe(0,"unreachable",`Could not reach the control plane at ${r}: ${U}. Check your connection and run the command again.`,!0),p===o)break;await zC(DC(p));continue}let b=await g.text(),v=R6(g,b);if(v)throw new qe(g.status,$u,`${r} is not a Gamestage control plane (it answered like ${v}). Set GAMESTAGE_CONTROL_URL to the Space's API address.`,!1);if(g.ok)return b===""?void 0:JSON.parse(b);let x=P6(b);if(u=new qe(g.status,x.error?.code??"unknown",x.error?.message??g.statusText,x.error?.retryable??!1),!u.retryable||p===o)break;let R=Number(g.headers.get("retry-after"));await zC(Number.isFinite(R)&&R>0?R*1e3:DC(p))}throw u??new qe(0,"unknown","Request failed.",!1)}}function UC(e){let t=FC(e);return{listDomains:()=>t("GET","/v1/admin/domains").then(o=>o.domains??[]),checkDomain:o=>t("POST",`/v1/admin/domains/${encodeURIComponent(o)}/check`),setDatasetRefresh:(o,r,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/datasets/${encodeURIComponent(r)}/refresh`,{body:{hours:n}}),setWorkspaceAccess:(o,r,n,a)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/access`,{body:{access:r,reason:n??null,...a?.allowPersonalEmail?{allowPersonalEmail:!0}:{}}}),async listAccess(){let o=await t("GET","/v1/admin/access"),r=[...o.waiting??[],...o.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(AA);return CA(r)},getWorkspace:o=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(o)}`),setWorkspacePlan:(o,r,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/plan`,{body:{tier:r,...n===void 0?{}:{liveGameAllowance:n}}}),runCreatorSync:()=>t("POST","/v1/admin/creator-sync"),eraseGame:o=>t("POST",`/v1/admin/games/${encodeURIComponent(o)}/erasure`),closeWorkspace:o=>t("POST",`/v1/admin/workspaces/${encodeURIComponent(o)}/close`),listErasures:()=>t("GET","/v1/admin/erasures").then(o=>o.erasures??[]),getAds:()=>t("GET","/v1/admin/ads"),setAdsConfig:o=>t("PUT","/v1/admin/ads/config",{body:o}),setAdsGame:(o,r)=>t("PUT",`/v1/admin/ads/games/${encodeURIComponent(o)}`,{body:r}),addAdsBlock:(o,r)=>t("POST",`/v1/admin/ads/blocklists/${o}`,{body:r}),removeAdsBlock:(o,r)=>t("POST",`/v1/admin/ads/blocklists/${o}/remove`,{body:{value:r}}),previewAds:o=>t("GET","/v1/admin/ads/preview",{query:{country:o.country,moment:o.moment,club:o.club||void 0,subject:o.subjects?.length?o.subjects.map(r=>`${r.type}:${r.name}`):void 0,game:o.gameId||void 0}}),listAdsRequests:()=>t("GET","/v1/admin/ads/requests").then(o=>Jw((o?.requests??[]).map(lu).filter(r=>r!==null))),moveAdsRequest:(o,r,n)=>t("PUT",`/v1/admin/ads/requests/${encodeURIComponent(o)}`,{body:{state:r,reason:n}}).then(Zw),adsProducts:o=>t("GET","/v1/admin/ads/products",{query:{catalogue:o.catalogue,subject:`${o.subject.type}:${o.subject.name}`}}),adsCriteria:()=>t("GET","/v1/admin/ads/criteria"),sponsorUsage:o=>t("GET","/v1/admin/sponsors",o?{query:{month:o}}:void 0)}}function On(e){let t=FC(e),o=["meters","rounds","history","destinations","sections","issues"],r=i=>{let c={...i,containerLabel:i.containerLabel??"Round"};for(let d of o)Array.isArray(c[d])||(c[d]=[]);return c},n=i=>({...i,access:Xd(i),terms:i.terms??null,games:(i.games??[]).map(r),gamesTotal:i.gamesTotal??(i.games??[]).length,archivedTotal:i.archivedTotal??(i.games??[]).filter(c=>c.state==="archived").length}),a=i=>({...i,workspace:{...i.workspace,access:Xd(i.workspace??{}),games:(i.workspace?.games??[]).map(r)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(i){if(!(i instanceof qe)||i.status!==404)throw i;return jC||(jC=!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 i=>a(await t("PUT","/v1/workspace/github",{body:{login:i}})),acceptTerms:async i=>a(await t("PUT","/v1/workspace/terms",{body:{version:i}})),setPlan:async i=>a(await t("PUT","/v1/workspace/plan",{body:{tier:i}})),uploadTarget:(i,c,d)=>t("POST",`/v1/games/${encodeURIComponent(i)}/uploads`,{body:d?{filename:c,deployId:d}:{filename:c}}),setPresetArt:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/art/preset`,{body:{preset:c}}),artUploadTarget:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/art/uploads`,{body:{content_type:c}}),setUploadedArt:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/art`,{body:{url:c}}),getDomain:i=>t("GET",`/v1/games/${encodeURIComponent(i)}/domain`),addDomain:(i,c,d)=>t("POST",`/v1/games/${encodeURIComponent(i)}/domain`,{body:{hostname:c,move:d?.move??!1}}),checkDomain:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/domain/check`),removeDomain:i=>t("DELETE",`/v1/games/${encodeURIComponent(i)}/domain`),getAdsRequest:i=>t("GET",`/v1/games/${encodeURIComponent(i)}/ads-request`).then(c=>lu(c?.request)),requestAds:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/ads-request`,{body:c}).then(Zw),referenceUploadTarget:(i,c)=>t("POST","/v1/reference/uploads",{body:{name:i,digest:c}}),listMembers:async()=>(await t("GET","/v1/workspace/members")).members??[],inviteMember:async i=>(await t("POST","/v1/workspace/members",{body:{email:i}})).member,removeMember:i=>t("DELETE",`/v1/workspace/members/${encodeURIComponent(i)}`),listMyWorkspaces:async()=>(await t("GET","/v1/workspaces")).workspaces??[],listDesignSystems:async()=>(await t("GET","/v1/design-systems")).designSystems??[],publishDesignSystem:(i,c)=>t("POST",`/v1/design-systems/${encodeURIComponent(i)}/versions`,{body:c}),designSystemVersion:async(i,c)=>(await t("GET",`/v1/design-systems/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}`)).designSystem,async orgProfile(){try{return(await t("GET","/v1/org/profile")).profile}catch(i){if(i instanceof qe&&i.status===404&&i.code==="no_org")return null;throw i}},async orgContext(){try{return(await t("GET","/v1/org/context")).context}catch(i){if(i instanceof qe&&i.status===404&&i.code==="no_context")return null;throw i}},async orgProfileForOperator(){try{return(await t("GET","/v1/org/profile/operator")).profile}catch(i){if(i instanceof qe&&(i.status===403||i.status===404))return null;throw i}},orgContextHistory:async()=>(await t("GET","/v1/org/context/history")).revisions??[],setOrgContext:async i=>(await t("PUT","/v1/org/context",{body:{markdown:i}})).revision,orgStarters:async()=>(await t("GET","/v1/org/starters")).starters??[],startOrgStarterUpload:async(i,c)=>(await t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions`,{body:c})).upload,confirmOrgStarter:async(i,c)=>(await t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}/confirm`)).starter,scaffoldOrgStarter:(i,c)=>t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}/scaffold`),pruneBundle:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/bundle`,{body:{filenames:c}}),bundleFiles:async i=>(await t("GET",`/v1/games/${encodeURIComponent(i)}/files`)).files??[],async getGame(i){try{return r(await t("GET",`/v1/games/${encodeURIComponent(i)}`))}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},setAwake:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/state`,{body:{awake:c}}),setDestination:(i,c,d)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/destinations`,{body:{destination_id:c,enabled:d}}),registerGame:i=>t("POST","/v1/games",{body:i}),archiveGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/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:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/graphics`,{body:c}),removeGraphic:(i,c)=>t("DELETE",`/v1/games/${encodeURIComponent(i)}/graphics/${encodeURIComponent(c)}`),promoteGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/promote`),withdrawGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/withdraw`),deleteGame:i=>t("DELETE",`/v1/games/${encodeURIComponent(i)}`),deploy:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/deploy`,{body:c}),refreshRound:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/round/refresh`),async practiceRound(i,c){try{return await t("POST",`/v1/games/${encodeURIComponent(i)}/practice`,{body:{round:c}})}catch(d){throw d instanceof qe&&d.status===404&&!/no such game|no game with id/i.test(d.message)?new qe(404,"not_supported","This control plane cannot serve a practice round yet. It is running a build older than this CLI. Update the CLI's backend, or use an older CLI until it is.",!1):d}},async previewPracticeRound(i,c){try{return await t("POST","/v1/preview/practice",{body:{game:i,round:c}})}catch(d){throw d instanceof qe&&d.status===404&&/unknown resource/i.test(d.message)?new qe(404,"not_supported","This control plane cannot serve a preview round yet. It is running a build older than the connector.",!1):d}},roundSeedCandidates:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/round/candidates`,{body:c}),async seedSeasonDay(i,c){try{return await t("PUT",`/v1/games/${encodeURIComponent(i)}/season/${encodeURIComponent(c.name)}`,{body:{dayStart:c.dayStart,dayEnd:c.dayEnd,round:c.round,...c.overwrite?{overwrite:!0}:{}}})}catch(d){throw d instanceof qe&&d.status===404&&!/no such game|no game with id/i.test(d.message)?new qe(404,"not_supported","This control plane cannot take a season yet. It is running a build older than this CLI.",!1):d}},async seedRound(i,c,d){try{return await t("PUT",`/v1/games/${encodeURIComponent(i)}/round`,{body:{round:c,...d}})}catch(l){throw l instanceof qe&&l.status===404&&!/no such game|no game with id/i.test(l.message)?new qe(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):l}},setSignal:async i=>a(await t("PUT","/v1/workspace/signal",{body:{enabled:i}})),setWorkspaceProfile:i=>t("PUT","/v1/workspace/profile",{body:i}),async getEndpoints(i){try{return await t("GET",`/v1/games/${encodeURIComponent(i)}/endpoints`)}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async getGameUsage(i){try{return await t("GET",`/v1/games/${encodeURIComponent(i)}/usage`)}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async getLogs(i,c,d){let{lines:l}=await t("GET",`/v1/games/${encodeURIComponent(i)}/logs`,{query:c,signal:d});return l},async getAuditLog(i){let{records:c}=await t("GET","/v1/audit",{query:i});return c},listSourceDatasets:i=>t("GET",`/v1/sources/${encodeURIComponent(i)}/datasets`),switchOnSource:(i,c)=>t("POST",`/v1/sources/${encodeURIComponent(i)}/datasets`,{body:c}),switchOffSource:(i,c)=>t("DELETE",`/v1/sources/${encodeURIComponent(i)}/datasets/${encodeURIComponent(c)}`),async listDatasets(){try{let i=await t("GET","/v1/reference/datasets");return!i||!Array.isArray(i.datasets)?{datasets:[],unavailable:MC}:{datasets:i.datasets,unavailable:i.unavailable??null}}catch(i){if(i instanceof qe&&i.status===404)return{datasets:[],unavailable:MC};throw i}},async getDataset(i){try{let c=await t("GET",`/v1/reference/datasets/${encodeURIComponent(i)}`);return c?.dataset?c:void 0}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async previewDataset(i,c,d){try{let l=await t("GET",`/v1/reference/preview/${encodeURIComponent(i)}`,{query:{limit:c,by:d}});return l&&Array.isArray(l.rows)?l:void 0}catch(l){if(l instanceof qe&&l.status===404)return;throw l}},async getDataLog(i){try{let c=await t("GET","/v1/reference/log",{query:i});return Array.isArray(c?.lines)?c.lines:[]}catch(c){if(c instanceof qe&&c.status===404)return[];throw c}}}}var qe,$u,zC,jC,MC,GC=_(()=>{"use strict";eu();uu();xa();qe=class extends Error{status;code;retryable;constructor(t,o,r,n){super(r),this.status=t,this.code=o,this.retryable=n,this.name="ControlPlaneError"}},$u="not_a_control_plane";zC=e=>new Promise(t=>setTimeout(t,e)),jC=!1;MC="This control plane is running a build older than this screen, so it cannot list datasets yet."});function BC(e){return e?`npx gamestage@latest deploy ${e} --dir .`:"npx gamestage@latest deploy"}function Po(e,t){let o=vv.exec(e.trim()),r=vv.exec(t.trim());if(!o||!r)return null;for(let n=1;n<=3;n++){let a=Number(o[n])-Number(r[n]);if(a!==0)return a}return 0}function fr(e,t){if(!e)return{state:"unknown",current:t};let o=Po(e,t);return o===null?{state:"unknown",current:t}:o<0?{state:"behind",pinned:e,current:t}:o>0?{state:"ahead",pinned:e,current:t}:{state:"current",pinned:e,current:t}}function kv(e){let t=new Set;for(let o of e.matchAll(/\/client\/(\d+\.\d+\.\d+)\/gamestage\.js/g))t.add(o[1]);return[...t].sort((o,r)=>Po(o,r)??0)}function qC(e){let t=[...new Set(e)].filter(o=>vv.test(o));if(t.length!==0)return t.sort((o,r)=>Po(o,r)??0)[0]}function WC(e){return/^ \* Gamestage client (\d+\.\d+\.\d+)\.$/m.exec(e.slice(0,600))?.[1]}var vv,_v=_(()=>{"use strict";vv=/^(\d+)\.(\d+)\.(\d+)$/});var HC,Au,gr,YC=_(()=>{"use strict";_v();HC="x-gamestage-cli",Au="update_required",gr="npx gamestage@latest"});var VC=_(()=>{"use strict"});var KC=_(()=>{"use strict";Ps();_t();Ct()});function JC(e,t){let o=[];return e.points_per_second!==void 0&&o.push({kind:"rate_ceiling",pointsPerSecond:e.points_per_second}),e.score_max!==void 0&&o.push({kind:"score_max",max:e.score_max}),e.score_min!==void 0&&o.push({kind:"score_min",min:e.score_min}),e.min_run_ms!==void 0&&o.push({kind:"min_duration",ms:e.min_run_ms}),{checks:o,ranking:e.ranking,ties:t?"shared":"earlier_first",onBreach:"refuse",maxRunSeconds:e.max_run_seconds,maxRunsPerDay:e.max_runs_per_day??null,...e.rank_by==="total"?{rankBy:"total"}:{},...e.signed_scores?{signedScores:!0}:{}}}var yr,ZC,xv=_(()=>{"use strict";Io();sn();Ct();yr="The Arcade Engine is keeping this game's current rules until its live edition ends, because the rules a run is judged by change only between editions. The game plays on as before. The rules from your last deploy, and any edition added in Studio since, take effect once it ends.",ZC="The Arcade Engine holds this game"});var XC=_(()=>{"use strict";Vt();_u();xu();Kt()});function QC(e){if(typeof e!="string")return null;let t=/^([a-z][a-z0-9_-]*):([a-zA-Z0-9][a-zA-Z0-9._-]*)$/.exec(e);return t&&t[0]===e?{provider:t[1],id:t[2]}:null}var Cu=_(()=>{"use strict"});var e2=_(()=>{"use strict";Cu()});var t2,Gee,Sv,Bee,n2=_(()=>{"use strict";je();Cu();t2=s.string().regex(/^sportmonks:[1-9]\d*$/).refine(e=>{let t=QC(e);return t!==null&&Number.isSafeInteger(Number(t.id))}),Gee=s.array(s.object({fixture:t2,games:s.array(s.object({gameId:s.string().min(1),editionId:s.string().min(1)})),addedAt:s.iso.datetime({offset:!0})})),Sv=s.object({home:s.number().int().nonnegative(),away:s.number().int().nonnegative()}),Bee=s.object({fixture:t2,sport:s.literal("football"),status:s.enum(["scheduled","live","finished","void","postponed","unknown"]),statusName:s.string(),regulation:Sv.nullable(),currentScore:Sv.nullable().optional(),finalScore:Sv.nullable(),teams:s.object({home:s.string(),away:s.string()}).optional(),startingAt:s.string().nullable(),readAt:s.iso.datetime({offset:!0}),final:s.boolean(),finishedReads:s.number().int().min(0).max(2),finishedSince:s.iso.datetime({offset:!0}).nullable(),minute:s.number().nonnegative().nullable(),notifyPending:s.boolean()})});var Hee,o2=_(()=>{"use strict";je();Hee=s.object({org:s.string().min(1),game:s.string().min(1),player:s.string().min(1),alias:s.string().optional(),round:s.string().optional(),score:s.number(),outcome:s.string().optional(),at:s.string().min(1)})});function c2(e){return{type:"team",name:e.trim()}}function N6(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ø/gi,"o").toLowerCase().trim()}function d2(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{teams:t,leagues:o,...r}=e,n={...r};return t!==void 0&&n.scope===void 0&&(n.scope=Array.isArray(t)?t.map(a=>typeof a=="string"?c2(a):a):t),o!==void 0&&n.competitions===void 0&&(n.competitions=o),n}function G6(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{catalogueClubs:t,...o}=e,r={...o};return t!==void 0&&r.catalogueSubjects===void 0&&(r.catalogueSubjects=Array.isArray(t)?t.map(n=>typeof n=="string"?c2(n):n):t),r}function m2(e,t){return e.expiresAt===null||Date.parse(e.expiresAt)>t.getTime()}function w2(e){return e.getUTCMonth()>=6?e.getUTCFullYear():e.getUTCFullYear()-1}var Av,r2,i2,s2,Rs,Kee,L6,Zee,Iu,Cv,l2,Tv,z6,Jee,j6,Pn,D6,a2,u2,M6,F6,Ev,$v,Xee,U6,Qee,B6,ete,q6,W6,Iv,Ov,H6,Y6,V6,tte,nte,K6,Z6,ote,rte,p2,h2,f2,g2,y2,b2,Pv,ate,ite,v2,k2,Rv=_(()=>{"use strict";je();Av={GB:{catalogue:"8085",currency:"GBP",label:"United Kingdom"},US:{catalogue:"5042",currency:"USD",label:"United States"}},r2=s.enum(["GB","US"]),i2=["team","player","competition","event","brand"],s2=s.enum(i2),Rs=s.object({type:s2,name:s.string().trim().min(1).max(120)});Kee=new RegExp(`,(?=\\s*(?:${i2.join("|")})\\s*:)`,"i");L6={"Brighton & Hove Albion":["Brighton","Brighton & Hove Albion FC","Brighton and Hove Albion"]},Zee=new Map(Object.entries(L6).flatMap(([e,t])=>[e,...t].map(o=>[N6(o),e]))),Iu=["collectibles","shirts_kit","training_wear","headwear","accessories","gifts"],Cv=s.enum(Iu),l2={collectibles:"Collectibles: trading cards and signed memorabilia",shirts_kit:"Shirts and jerseys",training_wear:"Training and leisure wear",headwear:"Headwear",accessories:"Accessories",gifts:"Gifts"},Tv=s.object({value:s.string().trim().min(1).max(200),reason:s.string().trim().min(1).max(500),expiresAt:s.string().datetime().nullable(),addedBy:s.string(),addedAt:s.string()}),z6=["products","players","keywords"],Jee=s.enum(z6),j6=90,Pn={productTypes:s.array(Cv),scope:s.array(Rs).max(100),competitions:s.array(s.string().trim().min(1).max(80)).max(50),priceMin:s.number().min(0).nullable(),priceMax:s.number().min(0).nullable(),winPriceMax:s.number().min(0).nullable(),countries:s.array(r2).min(1),defaultCountry:r2,kids:s.boolean()};D6=s.preprocess(d2,s.object(Pn).partial().strict()),a2=s.preprocess(d2,s.object({productTypes:Pn.productTypes.default([...Iu]),scope:Pn.scope.default([]),competitions:Pn.competitions.default([]),priceMin:Pn.priceMin.default(null),priceMax:Pn.priceMax.default(null),winPriceMax:Pn.winPriceMax.default(j6),countries:Pn.countries.default(["GB"]),defaultCountry:Pn.defaultCountry.default("GB"),kids:Pn.kids.default(!1)})),u2=["products","video","betting","lead_generation"],M6=s.enum(u2),F6=s.object({enabled:s.boolean(),adTypes:s.array(M6).max(u2.length).default(["products"]),rules:D6.optional()}),Ev={impactRequests:60,jevCalls:1500,askedWithinDays:30},$v=s.object({impactRequests:s.number().int().min(1).max(1e3).default(Ev.impactRequests),jevCalls:s.number().int().min(1).max(2e4).default(Ev.jevCalls),askedWithinDays:s.number().int().min(1).max(90).default(Ev.askedWithinDays)}),Xee=$v.partial().strict(),U6=s.object({at:s.string(),by:s.string(),what:s.string()});Qee=s.preprocess(G6,s.object({killSwitch:s.boolean().default(!1),rules:a2.default(a2.parse({})),games:s.record(s.string(),F6).default({}),catalogueSubjects:s.array(Rs).max(200).default([]),pull:$v.default($v.parse({})),blocklists:s.object({products:s.array(Tv).default([]),players:s.array(Tv).default([]),keywords:s.array(Tv).default([])}).default({products:[],players:[],keywords:[]}),updatedAt:s.string().nullable().default(null),updatedBy:s.string().nullable().default(null),history:s.array(U6).default([])}));B6=s.object({id:s.string(),catalogue:s.string(),name:s.string(),club:s.string(),league:s.string(),imageUrl:s.string(),url:s.string(),price:s.number(),currency:s.string(),inStock:s.boolean(),ageGroup:s.string().nullable(),type:Cv.nullable()}),ete=s.enum(["win","neutral","loss"]),q6=s.object({model:s.string(),ownClub:s.number().nullable(),playerOutsideSquad:s.number(),forChildren:s.number(),aboutNewBaby:s.number(),tactless:s.object({win:s.number(),neutral:s.number()}),appeal:s.object({win:s.number(),neutral:s.number()})}),W6=B6.extend({judgments:q6.nullable()}),Iv=40,Ov=["incomplete","not_the_subject","out_of_stock","untyped"],H6=s.enum(Ov),Y6=s.object({name:s.string(),team:s.string(),why:H6}),V6=s.object({incomplete:s.number().optional(),not_the_subject:s.number().optional(),out_of_stock:s.number().optional(),untyped:s.number().optional()}),tte=s.object({catalogue:s.string(),query:s.string().optional(),club:s.string(),subject:Rs.optional(),pulledAt:s.string(),fetched:s.number(),candidates:s.array(W6),dropped:s.array(Y6).optional()}),nte=s.object({pulledAt:s.string().nullable(),impact:s.object({ok:s.boolean(),detail:s.string().nullable()}),jev:s.object({ok:s.boolean(),detail:s.string().nullable()}),catalogues:s.array(s.object({catalogue:s.string(),club:s.string(),fetched:s.number(),candidates:s.number(),judged:s.number(),subject:Rs.optional(),pulledAt:s.string().optional(),query:s.string().optional(),dropped:V6.optional()})),reporting:s.enum(["not_available","available"]).default("not_available"),waiting:s.number().optional()}),K6=s.object({gameId:s.string().min(1).max(120),workspaceId:s.string().min(1).max(120),lastAsked:s.string()}),Z6=s.object({subject:Rs,team:s.string().max(120).nullable().default(null),firstAsked:s.string(),lastAsked:s.string(),games:s.array(K6)}),ote=s.object({updatedAt:s.string().nullable().default(null),subjects:s.array(Z6).default([])}),rte=s.object({pulledAt:s.string().nullable().default(null),source:s.string().default(""),players:s.record(s.string(),s.string()).default({}),ambiguous:s.array(s.string()).default([])}),p2=.5,h2=.5,f2=.5,g2=.5,y2=.4,b2=1.5,Pv=3,ate=s.object({productId:s.string(),name:s.string(),imageUrl:s.string(),price:s.number(),currency:s.string(),link:s.string(),type:Cv,reasons:s.array(s.string())}),ite=s.object({type:s2,name:s.string(),of:s.string().optional()});v2=["other_catalogue","out_of_stock","untyped","type_off","outside_team_scope","outside_competition","below_price","above_price","above_win_price","for_children_named","past_season","wall_decor","blocked_product","blocked_player","blocked_keyword"],k2=["not_judged","not_own_club","tactless","player_outside_squad","about_new_baby","for_children","low_appeal"]});var fte,Ns,J6,Ls,mn,_2,gte,yte,x2=_(()=>{"use strict";Rv();fte={switches:{title:"Whether anything shows",lede:"Checked first, before any product is read."},nightly:{title:"Every night, before any fan",lede:"The nightly pull fetches each team's, player's or competition's products and drops these before Jev judges the rest."},finish:{title:"When a fan finishes",lede:"Applied to every judged product the moment a result screen asks. Counted here after a win, with the settings for every game."},order:{title:"What goes first",lede:`Among the products that pass, these decide the ${Pv} at most a fan sees.`},privacy:{title:"Privacy",lede:"What is recorded about a fan who sees the panel."}},Ns=e=>`${Math.round(e*100)}%`,J6={GBP:"\xA3",USD:"$"},Ls=(e,t)=>{let o=Av[e.defaultCountry].currency,r=J6[o];return r?`${r}${t}`:`${t} ${o}`},mn=()=>"Always",_2=e=>!e.kids,gte=[{id:"kill_switch",stage:"switches",name:"Stops every ad at once",protects:"If anything goes wrong, one switch takes every ad out of every game.",kind:"rule",setting:e=>e.killSwitch?"On":"Off",measure:"kill"},{id:"approved_games",stage:"switches",name:"Only games the retail partner has approved",protects:"A game shows nothing until Monterosa switches products on for it, after the retail partner approves.",kind:"rule",setting:e=>{let t=Object.values(e.games).filter(o=>o.enabled&&o.adTypes.includes("products")).length;return t===0?"No game on":`On in ${t} ${t===1?"game":"games"}`},measure:"games"},{id:"not_after_a_loss",stage:"switches",name:"Nothing after a loss",protects:"A fan who has just lost is never sold to.",kind:"rule",setting:mn,measure:"none",notCounted:"Not counted: after a loss the page does not ask."},{id:"what_the_game_is_about",stage:"switches",name:"Only what the game is about",protects:"Products are for the players, team or competition the game names, never a guess, and never outside a scope Monterosa set.",kind:"rule",setting:(e,t)=>{let o=[...t.scope.map(r=>r.name),...t.competitions];return o.length===0?"Any the game names":`Only ${o.join(", ")}`},measure:"finish",covers:{finish:["outside_team_scope","outside_competition"]}},{id:"own_country",stage:"switches",name:"The fan's own shop",protects:"Prices and stock come from one country's catalogue, never another country's currency.",kind:"rule",setting:(e,t)=>t.countries.map(o=>Av[o].label).join(", "),measure:"finish",covers:{finish:["other_catalogue"]}},{id:"complete_listing",stage:"nightly",name:"Drops broken listings",protects:"A product with no link, picture or price never reaches a fan.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["incomplete"]}},{id:"another_team",stage:"nightly",name:"Drops another team's stock",protects:`A search for Arsenal also finds an "Everton v Arsenal" scarf; only the shop's own Arsenal stock is kept.`,kind:"rule",setting:mn,measure:"pull",covers:{pull:["not_the_subject"]}},{id:"in_stock",stage:"nightly",name:"Drops what is out of stock",protects:"A fan is never sent to something they cannot buy.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["out_of_stock"],finish:["out_of_stock"]}},{id:"recognised_product",stage:"nightly",name:"Drops products we cannot name",protects:"Anything that is not recognisably a shirt, cap, collectible, gift or similar is left out, so nothing odd slips through.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["untyped"],finish:["untyped"]}},{id:"judged_per_subject",stage:"nightly",name:"Judges a mix, not the whole shop",protects:`Jev judges up to ${Iv} products per team, player or competition each night, one of each type in turn, so sixty shirts never crowd out a cap.`,kind:"rule",setting:()=>`${Iv} per team, player or competition`,measure:"unjudged"},{id:"judged_first",stage:"finish",name:"Nothing unjudged",protects:"A product Jev could not judge is never shown.",kind:"rule",setting:mn,measure:"finish",covers:{finish:["not_judged"]}},{id:"product_types",stage:"finish",name:"Only the product types switched on",protects:"Monterosa chooses which kinds of product a game may show.",kind:"rule",setting:(e,t)=>t.productTypes.length===Iu.length?"All six types":t.productTypes.length===0?"None":t.productTypes.map(o=>l2[o].split(":")[0]).join(", "),measure:"finish",covers:{finish:["type_off"]}},{id:"price",stage:"finish",name:"Keeps to a price range",protects:"Keeps expensive items off the screen of a fan who has just played a free game.",kind:"rule",setting:(e,t)=>t.priceMin===null&&t.priceMax===null?"No limit":t.priceMin===null?`Up to ${Ls(t,t.priceMax)}`:t.priceMax===null?`From ${Ls(t,t.priceMin)}`:`${Ls(t,t.priceMin)} to ${Ls(t,t.priceMax)}`,measure:"finish",covers:{finish:["below_price","above_price"]}},{id:"win_price",stage:"finish",name:"Caps the price on the result screen",protects:"A fan who has just played is offered what most fans buy, a replica shirt rather than a \xA3135 authentic one.",kind:"rule",setting:(e,t)=>t.winPriceMax===null?"No cap":`Up to ${Ls(t,t.winPriceMax)}`,measure:"finish",covers:{finish:["above_win_price"]}},{id:"children_named",stage:"finish",name:"Drops children's products by name",protects:"Anything labelled kids, baby, junior or youth stays off unless Monterosa allows children's products.",kind:"rule",setting:(e,t)=>_2(t)?"On: children's products kept off":"Off: children's products allowed",measure:"finish",covers:{finish:["for_children_named"]}},{id:"past_season",stage:"finish",name:"Drops last season's stock",protects:'A shirt, sticker or card set for a past season ("24-25", or "Topps 2026" in 2026-27) looks stale, though signed and framed collectibles are kept.',kind:"rule",setting:(e,t,o)=>{if(!o)return"Worked out from the date";let r=w2(o);return`Before ${r}-${String((r+1)%100).padStart(2,"0")}, from the date`},measure:"finish",covers:{finish:["past_season"]}},{id:"wall_stickers",stage:"finish",name:"Drops wall stickers",protects:"A fan at a result screen is not shopping for a wall.",kind:"rule",setting:mn,measure:"finish",covers:{finish:["wall_decor"]}},{id:"blocklists",stage:"finish",name:"Drops what Monterosa has blocked",protects:"Any product, player or word Monterosa blocks, each with a reason and an optional end date.",kind:"rule",setting:(e,t,o)=>{let r=d=>e.blocklists[d].filter(l=>!o||m2(l,o)).length,[n,a,i]=[r("products"),r("players"),r("keywords")];if(n+a+i===0)return"Nothing blocked";let c=(d,l,u)=>`${d} ${d===1?l:u}`;return[c(n,"product","products"),c(a,"player","players"),c(i,"word","words")].join(", ")},measure:"finish",covers:{finish:["blocked_product","blocked_player","blocked_keyword"]}},{id:"rival_club",stage:"finish",name:"Drops a rival club's shirt",protects:"Catches a product filed under the right team that is really for another club's fans.",kind:"judgment",setting:()=>`Below ${Ns(p2)} sure it is the club's`,measure:"finish",covers:{finish:["not_own_club"]}},{id:"tactless",stage:"finish",name:"Drops anything tactless",protects:"Gloating, a rival's celebration, a defeat or a sensitive event: anything that would embarrass the brand showing it.",kind:"judgment",setting:()=>`${Ns(h2)} sure or more`,measure:"finish",covers:{finish:["tactless"]}},{id:"player_left",stage:"finish",name:"Drops players who have left",protects:"A shirt printed for a player no longer in the club's squad is out of date, though signed memorabilia of a former player is kept.",kind:"judgment",setting:()=>`${Ns(f2)} sure or more`,measure:"finish",covers:{finish:["player_outside_squad"]}},{id:"new_baby",stage:"finish",name:"Drops new-baby gifts",protects:"A birth card or a newborn gift is never the right thing after a game.",kind:"judgment",setting:()=>`${Ns(y2)} sure or more`,measure:"finish",covers:{finish:["about_new_baby"]}},{id:"children_judged",stage:"finish",name:"Drops what is made for children",protects:"Catches children's products the name does not give away, while children's products are off.",kind:"judgment",setting:(e,t)=>_2(t)?`${Ns(g2)} sure or more`:"Off: children's products allowed",measure:"finish",covers:{finish:["for_children"]}},{id:"low_appeal",stage:"finish",name:"Drops what a fan would not want now",protects:"Jev scores how much a fan would want each product after that result, from 0 to 3, and anything lukewarm is left out.",kind:"judgment",setting:()=>`Below ${b2.toFixed(1)} of 3`,measure:"finish",covers:{finish:["low_appeal"]}},{id:"player_first",stage:"order",name:"The game's player first",protects:"A product naming the player the game is about leads, so a fan sees their player's shirt before a mug.",kind:"rule",setting:mn,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"player_club",stage:"order",name:"A player brings their club",protects:"When a game names only players, their current clubs' products can show too, taken from the Premier League squads and never guessed.",kind:"rule",setting:mn,measure:"players"},{id:"replica_first",stage:"order",name:"Replica before authentic",protects:"The shirt most fans buy comes before the dearer player-cut version of the same design.",kind:"rule",setting:mn,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"one_per_design",stage:"order",name:"One of each design",protects:"The same shirt with another name on the back, or in another cut, shows once.",kind:"rule",setting:mn,measure:"designs"},{id:"variety",stage:"order",name:"A mix on screen",protects:"One of each product type before a second of any, so three shirts never fill the panel when a cap would do, and no second at all when the round names a competition.",kind:"rule",setting:()=>`Up to ${Pv} products`,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"consent",stage:"privacy",name:"Counted only with consent",protects:"Showing the panel is recorded only when the fan agreed to marketing and analytics, and a link never carries who the fan is.",kind:"rule",setting:()=>"Marketing and analytics",measure:"none",notCounted:"Decided on the fan's page; nothing is counted here."}],yte={pull:Ov,finish:[...v2,...k2]}});var S2=_(()=>{"use strict";_t()});function T2(e){return e?zs.find(t=>t.formats.includes(e)):void 0}var zs,E2=_(()=>{"use strict";Yd();zs=[{id:"typesafe",label:"TypeSafe",signUp:"https://typesafe.ai",purpose:"Pays for Jev, the AI judge that answers fans' questions in your Mystery games. Each question costs a fraction of a cent, charged to your TypeSafe account.",formats:["mystery"]}]});var $2=_(()=>{"use strict";_t()});function Nv(e){let t;try{t=JSON.parse(e)}catch(r){return{ok:!1,reason:"That is not JSON.",detail:r instanceof Error?r.message:void 0}}let o=Ut.safeParse(t);if(!o.success){let r=o.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:r?`${r.path.join(".")||"document"}: ${r.message}`:void 0}}return{ok:!0,summary:{digest:Bd(e),measures:o.data.measures.map(r=>r.key),counts:Object.fromEntries(o.data.measures.map(r=>[r.key,Object.keys(r.values).length])),scored:o.data.measures.filter(r=>r.scoring).map(r=>r.key)}}}async function A2(e,t){let o=Nv(e);return o.ok&&(await t("copy",e),await t("pointer",e)),o}function C2(e,t){return e?e.filter(o=>!t.scored.includes(o)):[]}var I2=_(()=>{"use strict";_t()});var O2=_(()=>{"use strict"});var P2=_(()=>{"use strict"});var X6,Ote,Pte,Rte,Nte,Lte,R2=_(()=>{"use strict";je();ud();X6="We expect to let you in within one to two weeks.",Ote=`${X6} We'll email you when your place is ready.`,Pte=s.enum(["unconfirmed","waiting","invited","declined","joined"]),Rte=s.enum(["invited","declined"]),Nte=s.object({email:s.string().trim().toLowerCase().max(254).email("Enter your work email address."),name:s.string().trim().min(1,"Tell us your name.").max(80).regex(/^[^<>@:/\\]+$/,"Use just your name, with no links or symbols.").refine(e=>!/\.[a-z]{2,}\b/i.test(e),"Use just your name, with no links or symbols."),company:s.string().trim().min(1,"Tell us your company.").max(120),role:s.string().trim().min(1,"Tell us your role.").max(120),intent:s.string().trim().min(1,"Tell us what you'd like to build.").max(500),contactConsent:s.literal(!0,{message:"Tick the box so we can contact you about your place."}),ageConfirmed:s.literal(!0,{message:`Confirm you are ${18} or older.`}),marketingConsent:s.boolean().optional()}),Lte=s.object({token:s.string().trim().min(20).max(200)})});var Q6,e4,t4,jte,N2=_(()=>{"use strict";Q6="Monterosa",e4="04716325",t4="3B, The Plaza, floor 3, 100 Old Hall Street, Liverpool, L3 9QJ, United Kingdom",jte=`${Q6}, ${t4}. Company number ${e4}.`});function Ou(e){let t=[],o=/\[([^\]]*)\]/g,r=0;for(let n of e.matchAll(o))n.index>r&&t.push({text:e.slice(r,n.index),accent:!1}),n[1]&&t.push({text:n[1],accent:!0}),r=n.index+n[0].length;return r<e.length&&t.push({text:e.slice(r),accent:!1}),t.filter(n=>n.text.length>0)}function Lv(e){return Ou(e).map(t=>t.text).join("")}var zv=_(()=>{"use strict"});function Ro(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function i4(e){let t=e.length===4?`#${[...e.slice(1)].map(a=>a+a).join("")}`:e,[o,r,n]=[1,3,5].map(a=>{let i=parseInt(t.slice(a,a+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*o+.7152*r+.0722*n>.4}function Pu(e,t){return e&&L2.test(e.trim())?e.trim():t}function Mv(e){return Ou(e).map(t=>t.accent?`<span class="gs-boot__accent">${Ro(t.text)}</span>`:Ro(t.text)).join("")}function z2(e){let t=Pu(e.gradientStart,"#101820"),o=Pu(e.gradientEnd,t),r=i4(t),n=Pu(e.titleColour,r?"#101820":"#ffffff"),a=Pu(e.logoAccentColour,n),i=Nd(e.titleFont,e.titleFontWeight),c=FE(e.titleLetterSpacing)??"normal",d=UE(e.titleCase),l=e.logoText?.trim()||e.name;return{start:t,end:o,light:r,ink:n,accent:a,font:i,tracking:c,textTransform:d,logo:l,words:{play:e.playLabel?.trim()||pn.play,continue:e.continueLabel?.trim()||pn.continue,error:e.errorText?.trim()||pn.error,retry:e.retryLabel?.trim()||pn.retry}}}function s4(e){let t=Math.max(1,[...Lv(e)].length);return`min(clamp(56px, 19vw, 132px), calc((100vw - 48px) / ${Math.round(t*.86*100)/100}))`}function c4(e){let t=Fv(e);return t.metas+t.links+t.style+t.script}function D2(e){return Fv(e).metas}function M2(e){return Fv(e).style}function F2(e,t,o){if(!L2.test(o)||!e.includes(j2))return;let r=jv(t),n=Dv(t);if(!(e.split(r).length!==2||e.split(n).length!==2))return e.replace(r,jv(o)).replace(n,Dv(o))}function Fv(e){let t=z2(e),o=t.light?"rgba(16,24,32,.16)":"rgba(255,255,255,.2)",r=t.light?"rgba(16,24,32,.78)":"rgba(255,255,255,.9)",n=t.font&&e.logoFontData&&/^[A-Za-z0-9+/=]+$/.test(e.logoFontData)?e.logoFontData:void 0,a=t.font&&!n?ls(t.font.family):void 0,i=t.font?`"${t.font.family}", system-ui, sans-serif`:"system-ui, sans-serif",c={font:t.font?{family:t.font.family,weight:t.font.weight}:null,minMs:o4,fontTimeoutMs:r4,maxMs:a4,words:t.words,mark:Hn};return{metas:`<meta name="color-scheme" content="${t.light?"light":"dark"}" ${bt} />
114
+ `:""}return dw.dump=j,dw}function WD(){if($$)return kt;$$=1;let e=BD(),t=qD();function o(r,n){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return kt.Type=At(),kt.Schema=A$(),kt.FAILSAFE_SCHEMA=P$(),kt.JSON_SCHEMA=j$(),kt.CORE_SCHEMA=D$(),kt.DEFAULT_SCHEMA=uw(),kt.load=e.load,kt.loadAll=e.loadAll,kt.dump=t.dump,kt.YAMLException=gs(),kt.types={binary:U$(),float:z$(),map:O$(),null:R$(),pairs:B$(),set:q$(),timestamp:M$(),bool:N$(),int:L$(),merge:F$(),omap:G$(),seq:I$(),str:C$()},kt.safeLoad=o("safeLoad","load"),kt.safeLoadAll=o("safeLoadAll","loadAll"),kt.safeDump=o("safeDump","dump"),kt}var kt,Md,Co,o$,Bb,r$,qb,a$,Wb,i$,Hb,s$,Yb,c$,Vb,l$,Kb,d$,Zb,u$,Jb,m$,Xb,p$,Qb,h$,ew,f$,tw,g$,nw,y$,ow,b$,rw,w$,aw,v$,iw,k$,sw,_$,cw,x$,lw,S$,T$,dw,E$,$$,HD,ht,L7,z7,j7,D7,M7,F7,W$,U7,G7,B7,q7,W7,H7,Y7,va=_(()=>{kt={},Md={},Co={};dw={};HD=WD(),ht=UD(HD),{Type:L7,Schema:z7,FAILSAFE_SCHEMA:j7,JSON_SCHEMA:D7,CORE_SCHEMA:M7,DEFAULT_SCHEMA:F7,load:W$,loadAll:U7,dump:G7,YAMLException:B7,types:q7,safeLoad:W7,safeLoadAll:H7,safeDump:Y7}=ht});function Nt(e){let t;try{t=ht.load(e,{schema:VD})}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 o=Ao.safeParse(t);if(!o.success)return{ok:!1,issues:KD(o.error)};let r=n$(o.data);return r.length?{ok:!1,issues:r}:{ok:!0,manifest:o.data}}function KD(e){return e.issues.map(t=>({path:t.path.length?t.path.join("."):"(root)",message:t.message}))}function ys(e){return ht.dump(e,{indent:2,lineWidth:100,noRefs:!0,sortKeys:!1})}function Fd(e,t){return Ao.parse({manifest:{schema_version:ps,revision:0,conformance:"L0"},app:{id:e,title:t,status:"proposed"}})}var YD,VD,Io=_(()=>{"use strict";va();$n();as();({merge:YD}=ht.types),VD=ht.CORE_SCHEMA.extend({implicit:[YD]})});function pw(e){return ZD.map(t=>{let o=e?.assurance?.[t.key];if(o===void 0)return{...t};let r=Gb.safeParse(o);if(r.success)return{...t,record:r.data};let n=r.error.issues.map(a=>`${["assurance",t.key,...a.path].join(".")}: ${a.message}`).join("; ");return{...t,problem:n}})}var ZD,mw,H$,Y$=_(()=>{"use strict";$n();Io();ZD=[{key:"accessibility",label:"Accessibility",command:"npx skills add addyosmani/web-quality-skills@accessibility",about:"A WCAG 2.2 audit skill: runs Lighthouse or axe on the page, then checks what automated tools miss."},{key:"security",label:"Security review",command:"npx skills add getsentry/skills@security-review",about:"Sentry's review skill, built on OWASP guidance. Reports only findings it can trace to input an attacker controls."},{key:"secrets",label:"Secrets",command:"gitleaks detect --source .",about:"The open-source gitleaks scanner: finds API keys and tokens committed to the game. Install it from github.com/gitleaks/gitleaks."},{key:"privacy",label:"Privacy",command:"npx skills add wshobson/agents@gdpr-data-handling",about:"A GDPR skill covering consent, legal basis, data requests and children's data."}],mw="Recorded by the creator, not checked or certified by Monterosa.";H$={passed:"Passed",issues_fixed:"Issues found and fixed",issues_open:"Issues still open"}});var aY,iY,V$=_(()=>{"use strict";aY=new TextEncoder,iY=new TextDecoder});var K$=_(()=>{"use strict"});function Lt(e,t={}){let o=f=>({id:f.id,level:f.level,requirement:f.requirement,advice:f.advice,owner:f.owner,passed:f.check(e,t)}),r=hw.filter(f=>f.checkable).map(o),n=hw.filter(f=>!f.checkable).map(o),a="L0",i=!0;for(let f of fw){let g=r.filter(v=>v.level===f);g.length>0&&g.every(v=>v.passed)&&i?a=f:i=!1}let c=r.filter(f=>f.level==="L0").every(f=>f.passed),d=Eo[a]+1,l=fw[d],u=l?r.filter(f=>f.level===l&&!f.passed):[],p=e.manifest.conformance;return{computed:a,computedName:JE[a],claimed:p,overclaimed:!c||Math.min(Eo[p],Eo[Z$])>Eo[a],results:r,blockers:c?u:r.filter(f=>f.level==="L0"&&!f.passed),ceiling:Z$,advice:n}}function J$(e,t){let r=Lt(e).results.filter(n=>!n.passed&&Eo[n.level]<=Eo[t]);return{ok:r.length===0,missing:r}}var ur,ft,hw,fw,JD,dY,Z$,Ud=_(()=>{"use strict";$n();ur=(e,t,o)=>{let r=e[t];return Mb[r?.status??"missing"]>=Mb[o]},ft=e=>typeof e=="string"?e.trim().length>0:e!=null,hw=[{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=>ft(e.app.id)&&ft(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=>ur(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=>ft(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=>ft(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=>ur(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=>ft(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)=>ft(t.backendComponent)||ft(e.backend.component)&&ft(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=>ft(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(o=>o.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)=>ft(t.platformProject)||ft(e.studio_app.spec_url)||ft(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)=>ft(t.playgroundUrl)||ft(e.deployment.space_spec)&&e.deployment.environments.some(o=>o!=="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=>ft(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=>ur(e,"experience","confirmed")&&ur(e,"backend","confirmed")&&ur(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=>ur(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=>ft(e.operations.support_tier)&&ft(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=>ur(e,"operations","approved")&&e.deployment.environments.includes("production")}],fw=["L0","L1","L2","L3","L4","L5"],JD=[{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"}],dY=new Map(JD.map(e=>[e.level,e])),Z$=[...fw].reverse().find(e=>hw.some(t=>t.level===e&&t.checkable))??"L0"});var gw=_(()=>{"use strict";Io();$n();Ud()});var X$=_(()=>{"use strict"});function Q$(e,t){let o=e.backend.archetype;if(!o)throw new Error("registerInputFromManifest needs backend.archetype. Run registrationProblems first.");return{id:e.app.id,name:e.app.title,archetype:o,repository:e.app.source?.repository??null,manifestRevision:String(e.manifest.revision),contentHash:t,conformance:Lt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:wa.map(r=>({section:r,status:e[r].status}))}}function eA(e,t){let o=[];return t&&e.app.id!==t&&o.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||o.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."),o}var tA=_(()=>{"use strict";Ud();Io();$n()});var nA=_(()=>{"use strict"});var oA,ln,QD,eM,tM,$Y,aA,nM,oM,AY,rM,CY,IY,OY,PY,aM,iM,RY,sM,cM,NY,rA,LY,zY,jY,DY,MY,FY,yw=_(()=>{"use strict";je();$n();Ed();nA();oA="2.0",ln=s.object({server_time:s.string(),snapshot:s.string()}),QD=s.enum(["at_commit","at_settlement"]),eM=s.enum(["shared","per_player","feed"]),tM=s.object({kind:s.enum(["fixed","local_midnight","feed","continuous","rotation","calendar","unscheduled","unknown"]),timezone:s.string().optional(),window_seconds:s.number().int().positive().optional(),next_change_at:s.string().optional()}),$Y=ln.extend({game:s.string(),api_version:s.literal(oA).default(oA),archetype:$o,marking:QD,challenge_source:eM,schedule:tM,updates:s.object({transport:s.enum(["poll","socket"]),freshness_seconds:s.number().int().positive()}),display:s.record(s.string(),s.unknown()).default({}),identity:s.object({required:s.boolean(),provider:s.string(),anonymous_play:s.boolean().default(!1)}),archive:s.boolean().default(!1),capabilities:s.array(s.string()).default([])}),aA=s.object({accepting_plays:s.boolean(),results_available:s.boolean(),solution_revealed:s.boolean(),closed:s.boolean(),optimistic_play:s.boolean().default(!1)}),nM=ln.extend({id:s.string(),number:s.number().int().positive().optional(),origin:es.optional(),version:s.number().int().nonnegative(),settled_revision:s.number().int().nonnegative().optional(),provisional:s.boolean().optional(),finalAt:s.iso.datetime().optional(),awaits_settlement:s.boolean().optional(),can:aA,opens_at:s.string().optional(),locks_at:s.string().optional(),timer_seconds:s.number().int().positive().optional(),challenge_instance_id:s.string().nullable().default(null),challenge:s.record(s.string(),s.unknown()).default({}),solution:s.record(s.string(),s.unknown()).optional()}),oM=s.object({id:s.string(),number:s.number().int().positive().optional(),version:s.number().int().nonnegative(),can:aA,opens_at:s.string().optional(),locks_at:s.string().optional(),current:s.boolean().default(!1),theme:s.string().default("")}),AY=ln.extend({rounds:s.array(oM)}),rM=s.object({round_id:s.string(),finished:s.boolean(),score:s.number(),last_played_at:s.string().optional(),outcome:s.enum(["won","lost","partial","incomplete","pending"]).optional()}),CY=ln.extend({player_id:s.string(),played:s.array(rM)}),IY=ln.extend({status:s.enum(["ready","exhausted"]),round:nM.optional()}),OY=ln.extend({token:s.string(),player_id:s.string(),kind:s.literal("anonymous")}),PY=s.object({idempotency_key:s.string().min(8),round_version:s.number().int().nonnegative(),challenge_instance_id:s.string().nullable().default(null),payload:s.record(s.string(),s.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"]})}),aM=s.enum(["accepted","rejected","duplicate","stale","busy"]),iM=s.object({key:s.string(),verdict:s.enum(["correct","close","wrong","higher","lower","unknown"]),void:s.literal(!0).optional(),label:s.string().optional()}),RY=ln.extend({play_id:s.string(),outcome:aM,reason:s.string().optional(),round_version:s.number().int().nonnegative(),retry_after_seconds:s.number().int().positive().optional(),marked:s.boolean().default(!0),feedback:s.array(iM).default([]),round_state:s.lazy(()=>cM).optional()}),sM=s.object({title:s.string(),grid:s.array(s.string()).default([]),text:s.string().optional()}),cM=ln.extend({player_id:s.string(),round_id:s.string(),started_at:s.string().optional(),attempts_used:s.number().int().nonnegative().default(0),attempts_allowed:s.number().int().nonnegative().optional(),mistakes_used:s.number().int().nonnegative().default(0),mistakes_allowed:s.number().int().nonnegative().optional(),progress:s.record(s.string(),s.unknown()).default({}),score:s.number().default(0),score_revision:s.number().int().nonnegative().default(0),finished:s.boolean().default(!1),outcome:s.enum(["won","lost","partial","incomplete","pending"]).optional(),perfect:s.boolean().optional(),share:sM.optional()}),NY=ln.extend({player_id:s.string(),display_name:s.string().optional(),avatar:s.string().optional(),avatar_url:s.string().optional(),name_chosen:s.boolean().optional(),played:s.number().int().nonnegative().default(0),won:s.number().int().nonnegative().default(0),current_streak:s.number().int().nonnegative().default(0),max_streak:s.number().int().nonnegative().default(0),exact:s.number().int().nonnegative().optional(),best_score:s.number().optional(),day_streak:s.number().int().nonnegative().optional(),last_played_day:s.string().optional(),distribution:s.record(s.string(),s.number()).default({}),constraints:s.record(s.string(),s.unknown()).default({})}),rA=s.object({rank:s.number().int().positive(),player_id:s.string(),display_name:s.string().optional(),avatar:s.string().optional(),avatar_url:s.string().optional(),exact:s.boolean().optional(),score:s.number()}),LY=ln.extend({round_id:s.string().optional(),scope:s.enum(["round","edition"]).optional(),edition_id:s.string().optional(),order:s.enum(["high_first","low_first"]).default("high_first"),tie_break:s.enum(["earliest_play","fewest_attempts","none"]).default("none"),tie_break_question:s.string().optional(),entries:s.array(rA).default([]),total:s.number().int().nonnegative().default(0),truncated:s.boolean().default(!1),me:rA.optional()}),zY=s.object({error:s.object({code:s.string(),message:s.string(),retryable:s.boolean()})}),jY=ln.extend({adjectives:s.array(s.string()),animals:s.array(s.string()),avatars:s.array(s.object({id:s.string(),url:s.string()}))}),DY=s.object({name:s.object({adjective:s.string().min(1),animal:s.string().min(1)}).optional(),avatar:s.string().min(1).optional()}).refine(e=>e.name!==void 0||e.avatar!==void 0,{message:"Send a name, an avatar, or both."}),MY=s.object({ticket:s.string(),expires_at:s.string()}),FY=s.object({gate:s.string().min(1).max(512),qualified:s.literal(!0)})});var lM,dM,uM,mM,pM,hM,fM,gM,HY,iA=_(()=>{"use strict";je();Vt();ns();lM=s.object({op:s.string().min(1),model:s.string().min(1).optional()}).passthrough(),dM=s.object({op:s.literal("draw")}).strict(),uM=s.object({op:s.literal("solve"),text:s.string().min(1).max(200)}).strict(),mM=s.object({op:s.literal("guess"),value:s.union([s.string().min(1).max(40),s.number()])}).strict(),pM=s.object({op:s.literal("pick"),picks:s.array(s.string())}).passthrough(),hM=s.object({op:s.literal("answer"),answers:s.record(s.string(),s.union([s.string(),s.number()])).optional(),picks:s.array(s.string()).optional()}).passthrough(),fM=s.object({op:s.enum(["deal","reshuffle","lock"]),centre:s.unknown().optional(),board:s.number().int().nonnegative().optional()}).passthrough(),gM=s.object({op:s.literal(_E),model:s.literal(ts).optional(),shotIndex:s.number().int().nonnegative(),aimX:s.number().int().min(sr.aimX.min).max(sr.aimX.max),aimY:s.number().int().min(sr.aimY.min).max(sr.aimY.max),power:s.number().int().min(sr.power.min).max(sr.power.max)}).strict(),HY=s.union([pM,dM,uM,mM,hM,fM,gM,lM])});var sA=_(()=>{"use strict"});var Gd=_(()=>{"use strict";sA()});var Ct=_(()=>{"use strict"});import{createHash as yM}from"node:crypto";function wM(e){return yM("sha256").update(e).digest("hex").slice(0,16)}function Bd(e){return wM(e)}var bM,Ut,_t=_(()=>{"use strict";je();Ct();Kt();bM=s.object({key:s.string().min(1),label:s.string().default(""),values:s.record(s.string(),s.number().int().nonnegative()),scale:s.number().int().positive().optional(),sources:s.record(s.string(),ha).optional(),scoring:bb.optional(),tiers:s.array(yb).min(1).optional()}),Ut=s.object({corpus:s.literal("1"),source:s.string().optional(),as_of:s.string().optional(),sources:s.record(s.string(),ha).optional(),facts:s.record(s.string(),s.array(Ad)).optional(),entries:s.record(s.string(),s.object({label:s.string().min(1),team:s.string().optional(),position:s.string().optional(),image:s.string().url().startsWith("https://").optional(),age:s.number().int().min(14).max(60).optional(),debut_year:s.number().int().min(1900).max(2100).optional(),facts:s.record(s.string(),s.union([s.string(),s.number(),s.boolean()])).optional()})).optional(),measures:s.array(bM).min(1)}).superRefine((e,t)=>{let o=e.measures.map(r=>r.key);new Set(o).size!==o.length&&t.addIssue({code:"custom",path:["measures"],message:"Two measures share a key. A round names the measure it is counted on."})})});var bs,cA,gt,lA,dA,ka,uA,ws,qd=_(()=>{"use strict";_t();bs=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0?Math.round(e):null,cA=e=>{let t=Number(e);return Number.isFinite(t)&&t>=0?Math.round(t*100):null},gt=(e,t)=>({fields:[e],label:t,read:o=>bs(o[e])}),lA=270,dA=3,ka=(e,t)=>({fields:[e,"minutes"],label:`${t} per 90 minutes, in hundredths (at least ${lA} minutes played)`,partial:!0,scale:100,read:o=>{let r=bs(o[e]),n=bs(o.minutes);return r===null||n===null||n<lA?null:Math.round(r*90*100/n)}}),uA=(e,t)=>({fields:[e,"starts"],label:`${t} per start, in hundredths (at least ${dA} starts)`,partial:!0,scale:100,read:o=>{let r=bs(o[e]),n=bs(o.starts);return r===null||n===null||n<dA?null:Math.round(r*100/n)}}),ws={player_price:{...gt("now_cost","Price, in tenths of a million"),scale:10},season_points:gt("total_points","Points this season"),points_per_game:{fields:["points_per_game"],label:"Points per game, in tenths",scale:10,read:e=>{let t=Number(e.points_per_game);return Number.isFinite(t)&&t>=0?Math.round(t*10):null}},minutes:gt("minutes","Minutes played"),starts:gt("starts","Starts"),goals:gt("goals_scored","Goals"),assists:gt("assists","Assists"),own_goals:gt("own_goals","Own goals"),penalties_missed:gt("penalties_missed","Penalties missed"),penalties_saved:gt("penalties_saved","Penalties saved"),yellow_cards:gt("yellow_cards","Yellow cards"),red_cards:gt("red_cards","Red cards"),saves:gt("saves","Saves"),bonus:gt("bonus","Bonus points"),tackles:gt("tackles","Tackles"),recoveries:gt("recoveries","Ball recoveries"),clearances_blocks_interceptions:gt("clearances_blocks_interceptions","Clearances, blocks and interceptions"),defensive_contributions:gt("defensive_contribution","Defensive contribution points"),expected_goals:{fields:["expected_goals"],label:"Expected goals, in hundredths",scale:100,read:e=>cA(e.expected_goals)},expected_assists:{fields:["expected_assists"],label:"Expected assists, in hundredths",scale:100,read:e=>cA(e.expected_assists)},goals_per_90:ka("goals_scored","Goals"),assists_per_90:ka("assists","Assists"),yellow_cards_per_90:ka("yellow_cards","Yellow cards"),tackles_per_90:ka("tackles","Tackles"),recoveries_per_90:ka("recoveries","Ball recoveries"),saves_per_90:ka("saves","Saves"),bonus_per_start:uA("bonus","Bonus points"),defensive_contributions_per_start:uA("defensive_contribution","Defensive contribution points")}});function vM(e,t){if(/^[A-Z]+s?$/.test(t))return`${e}_${t.toLowerCase()}`;let o=t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").toLowerCase();return o.startsWith(`${e}_`)?o:`${e}_${o}`}function kM(e){let t=e.replace(/Pct$/,"Percent").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(" "),o=t[0]==="avg",r=(o?t.slice(1):t).map((n,a)=>/^[A-Z]{2,}$/.test(n)?n:a===0?n[0].toUpperCase()+n.slice(1):n.toLowerCase());return o?`${r.join(" ")} per game`:r.join(" ")}function Wd(e){let t=Vn[e];return t?Object.entries(t.categories).flatMap(([o,r])=>r.map(n=>({key:vM(o,n),label:kM(n),category:o,name:n}))):[]}var Vn,Hd=_(()=>{"use strict";_t();Vn={nba:{sport:"basketball",label:"NBA",categories:{general:["gamesPlayed","avgMinutes","avgFouls","flagrantFouls","technicalFouls","ejections","doubleDouble","tripleDouble","minutes","rebounds","fouls","avgRebounds"],offensive:["avgPoints","avgFieldGoalsMade","avgFieldGoalsAttempted","fieldGoalPct","avgThreePointFieldGoalsMade","avgThreePointFieldGoalsAttempted","threePointFieldGoalPct","avgFreeThrowsMade","avgFreeThrowsAttempted","freeThrowPct","avgAssists","avgTurnovers","points","fieldGoalsMade","fieldGoalsAttempted","threePointFieldGoalsMade","threePointFieldGoalsAttempted","freeThrowsMade","freeThrowsAttempted","assists","turnovers"],defensive:["avgSteals","avgBlocks","steals","blocks"]},defaults:["offensive_points","general_rebounds","offensive_assists","general_games_played"]},wnba:{sport:"basketball",label:"WNBA",categories:{general:["gamesPlayed","avgMinutes","doubleDouble","tripleDouble","PER","avgRebounds"],offensive:["points","avgPoints","avgFieldGoalsMade","avgFieldGoalsAttempted","fieldGoalPct","avgThreePointFieldGoalsMade","avgThreePointFieldGoalsAttempted","threePointFieldGoalPct","avgFreeThrowsMade","avgFreeThrowsAttempted","freeThrowPct","avgAssists","avgTurnovers"],defensive:["avgSteals","avgBlocks"]},defaults:["offensive_points","offensive_avg_points","general_avg_rebounds","general_games_played"]},nfl:{sport:"football",label:"NFL",categories:{general:["gamesPlayed","fumblesForced","fumblesRecovered","fumblesTouchdowns"],passing:["completions","passingAttempts","completionPct","passingYards","yardsPerPassAttempt","passingYardsPerGame","longPassing","passingTouchdowns","interceptions","sacks","sackYardsLost","QBR","QBRating","adjQBR"],rushing:["rushingAttempts","rushingYards","yardsPerRushAttempt","longRushing","rushingBigPlays","rushingTouchdowns","rushingYardsPerGame","rushingFumbles","rushingFumblesLost","rushingFirstDowns"],receiving:["receptions","receivingTargets","receivingYards","yardsPerReception","receivingTouchdowns","longReception","receivingBigPlays","receivingYardsPerGame","receivingFumbles","receivingFumblesLost","receivingYardsAfterCatch","receivingFirstDowns"],defensive:["soloTackles","assistTackles","totalTackles","sacks","sackYards","tacklesForLoss","passesDefended","longInterception"],defensiveinterceptions:["interceptions","interceptionYards","interceptionTouchdowns"],scoring:["rushingTouchdowns","receivingTouchdowns","returnTouchdowns","totalTouchdowns","fieldGoals","kickExtraPoints","totalTwoPointConvs","totalPoints","totalPointsPerGame"],returning:["kickReturns","kickReturnYards","yardsPerKickReturn","longKickReturn","kickReturnTouchdowns","puntReturns","puntReturnYards","yardsPerPuntReturn","longPuntReturn","puntReturnTouchdowns","puntReturnFairCatches"],kicking:["fieldGoalsMade","fieldGoalAttempts","fieldGoalPct","longFieldGoalMade","extraPointsMade","extraPointAttempts","extraPointPct"],punting:["punts","puntYards","longPunt","grossAvgPuntYards","netAvgPuntYards","puntsBlocked","puntsInside20","touchbacks","fairCatches"]},defaults:["passing_yards","rushing_yards","receiving_yards","scoring_total_touchdowns"]},mlb:{sport:"baseball",label:"MLB",categories:{batting:["gamesPlayed","atBats","runs","hits","avg","doubles","triples","homeRuns","RBIs","totalBases","walks","strikeouts","stolenBases","onBasePct","slugAvg","OPS"],pitching:["gamesPlayed","gamesStarted","qualityStarts","ERA","wins","losses","saves","holds","innings","hits","earnedRuns","homeRuns","walks","strikeouts","strikeoutsPerNineInnings","WHIP"],fielding:["gamesPlayed","gamesStarted","fullInningsPlayed","totalChances","putouts","assists","fieldingPct","errors","doublePlays"]},defaults:["batting_home_runs","batting_hits","batting_rbis","pitching_strikeouts"],tablePerCategory:!0},nhl:{sport:"hockey",label:"NHL",categories:{general:["games","plusMinus","shifts","production","wins","losses"],offensive:["goals","assists","points","powerPlayGoals","powerPlayAssists","shotsTotal","shootingPct","gameWinningGoals","faceoffsWon","faceoffsLost","faceoffPercent","shootoutAttempts","shootoutGoals"],defensive:["overtimeLosses","avgGoalsAgainst","shotsAgainst","goalsAgainst","saves","savePct","shutouts"],penalties:["penaltyMinutes"]},defaults:["offensive_goals","offensive_assists","offensive_points","general_games"]}}});var bw,mA,dV,ww=_(()=>{"use strict";_t();qd();bw={clean_sheets:{label:"Clean sheets"},premier_league_appearances:{label:"Premier League appearances, career"},premier_league_goals:{label:"Premier League goals, career"},premier_league_titles:{label:"Premier League titles won"},first_premier_league_season:{label:"First Premier League season, as its start year"}},mA=[...new Set([...Object.keys(ws),...Object.keys(bw)])],dV=[...new Set(["goals","assists","clean_sheets","minutes","starts","yellow_cards","red_cards","penalties_saved","expected_goals","player_price","season_points",...Object.keys(bw)])].filter(e=>e in ws||e in bw)});function vs(e){return e.standing==="unofficial"?vw:void 0}function pA(e){return An.find(t=>t.id===e)}var _M,xM,SM,gV,vw,An,Yd=_(()=>{"use strict";qd();Hd();ww();je();_M=s.discriminatedUnion("kind",[s.object({kind:s.literal("everyone")}),s.object({kind:s.literal("domains"),domains:s.array(s.string().min(1)).min(1)}),s.object({kind:s.literal("named")})]),xM=s.enum(["licensed","unofficial","creator"]),SM=s.enum(["ours","creator"]),gV=s.object({id:s.string().min(1),label:s.string().min(1),standing:xM,origin:SM,tiers:s.array(s.enum(["runtime","live","enterprise"])).min(1),produces:s.array(s.string()),note:s.string().min(1),catalogue:s.object({offers:s.string().min(1),competitions:s.array(s.string()).default([]),cost:s.string().min(1),needsKey:s.boolean().default(!1),signUp:s.string().url().optional(),licence:s.string().min(1),fetched:s.boolean().optional()}).optional(),audience:_M.optional()}),vw="Requests to this source are made on behalf of you, the game builder. You are responsible for the data you consume, and for securing the legal rights and licence to use it. We recommend using it for testing only, and not launching with it unless you have explicit permission from the data owner.";An=[{id:"nba",label:"NBA",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"named"},produces:["pts","reb","ast","stl","blk"],note:"The NBA's own data, licensed by the NBA for its own use only. Not available to anyone else. Career totals are the NBA's own figures, regular season only, not a sum we computed. Refreshed daily for players on this season's rosters; retired careers are carried forward.",catalogue:{offers:"NBA players' career totals, regular season: points, rebounds, assists, steals, blocks.",competitions:["NBA"],cost:"For the NBA's own account only.",needsKey:!1,licence:"The NBA's, for the NBA's own use only. Nobody else may use it.",fetched:!0}},{id:"push",label:"Your own data",standing:"creator",origin:"creator",tiers:["runtime","live","enterprise"],produces:[],note:"A file you push with `gamestage reference push`, from your machine or your CI.",catalogue:{offers:"Any values you hold, in a JSON file you push: your squad, your archive, your own licensed feed.",competitions:[],cost:"Free on every plan.",needsKey:!1,licence:"Yours. Your data, or a feed you license: your terms.",fetched:!0}},{id:"fpl",label:"Fantasy Premier League",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:Object.keys(ws),note:"Free, with no contract behind it, so a prize game wants a licensed source. Prices move weekly and a round in play keeps the ones it opened with.",catalogue:{offers:"Premier League players: FPL price and points, goals, assists, own goals, penalties missed and saved, cards, saves, bonus, tackles, recoveries, defensive contributions, minutes, starts and expected goals and assists, plus per-90 and per-start ratios, with each player's name, club and position. Refreshed daily.",competitions:["Premier League"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}},{id:"premier-league",label:"The Premier League",standing:"licensed",origin:"ours",tiers:["runtime","live","enterprise"],audience:{kind:"domains",domains:["monterosa.co.uk","premierleague.com"]},produces:mA,note:"The Premier League's own feeds, used with their permission, for Monterosa and the Premier League only. Every current player's season and career record with his photo. Refreshed nightly.",catalogue:{offers:"Every current Premier League player: this season's FPL numbers, career Premier League appearances, goals and titles, first season, previous clubs, nationality, height, preferred foot, set-piece duties and photo. Refreshed nightly.",competitions:["Premier League"],cost:"For Monterosa and the Premier League only.",needsKey:!1,licence:"The Premier League's permission, for their own games. Not ours to offer anyone else."}},{id:"sportmonks",label:"Sportmonks football",standing:"creator",origin:"ours",tiers:["runtime","live","enterprise"],produces:["goals","assists","appearances","minutes","yellow_cards","clean_sheets"],note:"Your own Sportmonks plan and key. We call it on a schedule with your key, and your plan decides which competitions you can use.",catalogue:{offers:"Football players' season statistics for any competition your plan covers: goals, assists, appearances, minutes, cards, clean sheets, with each player's name, team and position.",competitions:[],cost:"Your Sportmonks plan. A free plan covers a few smaller leagues; the Premier League needs a paid one.",needsKey:!0,signUp:"https://www.sportmonks.com/football-api/",licence:"Yours: your Sportmonks plan and its terms. Check they cover this use before a game with a prize."}},{id:"espn",label:"ESPN",standing:"unofficial",origin:"ours",tiers:["runtime","live","enterprise"],produces:[...new Set(Object.keys(Vn).flatMap(e=>Wd(e).map(t=>t.key)))],note:"ESPN's openly reachable player statistics, with no contract behind it, so for development and not for a public launch. Refreshed twice a day.",catalogue:{offers:"Season statistics for every player in the NBA, WNBA, NFL, MLB and NHL: points, yards, goals, home runs and dozens more, with each player's name, team and position. Refreshed twice a day.",competitions:["NBA","WNBA","NFL","MLB","NHL"],cost:"Free on every plan. We fetch it; no key needed.",needsKey:!1,licence:"Unofficial: no contract and no support.",fetched:!0}}]});function EM(e,t){let o=e.trim().toLowerCase();return o?t.some(r=>{let n=r.trim().toLowerCase();return o===n||o.endsWith(`.${n}`)}):!1}function Vd(e){let t=e.ownerEmail?.lastIndexOf("@")??-1,o=t>=0?e.ownerEmail.slice(t+1).trim().toLowerCase():void 0;return{id:e.id,domain:o||void 0,grants:e.supplierGrants,...e.domainSuppliers?.length?{domainSuppliers:e.domainSuppliers}:{}}}function $M(e){return e.audience??TM}function AM(e,t,o=An){let r=o.find(a=>a.id===t);if(!r)return{allowed:!1,reason:`There is no supplier called "${t}".`};if(e.grants?.includes(t))return{allowed:!0,because:"grant"};if(e.domainSuppliers?.includes(t))return{allowed:!0,because:"audience"};let n=$M(r);switch(n.kind){case"everyone":return{allowed:!0,because:"audience"};case"domains":return e.domain&&EM(e.domain,n.domains)?{allowed:!0,because:"audience"}:{allowed:!1,reason:`${r.label} is available to ${n.domains.join(" and ")}. Ask us if you need it.`};case"named":return{allowed:!1,reason:`${r.label} is granted per account. Ask us if you need it.`}}}function hA(e,t=An){return t.map(o=>({supplier:o,entitlement:AM(e,o.id,t)}))}var TM,Kd=_(()=>{"use strict";Yd();TM={kind:"everyone"}});function vA(e,t){let o={kind:"generated_proposal",tool:"org-profile",source_context:`org:${t.id} v${t.version}`},r=t.identity?.player;if(e.identity.status!=="confirmed"&&r?.kind==="oidc"&&r.publicConfig.issuer&&r.publicConfig.jwks_uri&&(e.identity.provider="jwt",e.identity.jwt={issuer:r.publicConfig.issuer,jwks_uri:r.publicConfig.jwks_uri,...r.publicConfig.audience?{audience:r.publicConfig.audience}:{}},e.identity.require_authenticated_writes=!1,e.identity.status="proposed",e.identity.provenance=[...e.identity.provenance,o]),e.identity.consent={analytics_requires_consent:t.consent.analytics_requires_consent,...t.consent.provider?{provider:t.consent.provider}:{}},t.analytics.length>0){let n=new Set(e.measurement.destinations.map(a=>a.type));for(let a of t.analytics)n.has(a.type)||(e.measurement.destinations.push({type:a.type,enabled:!0,config:a.config}),n.add(a.type));e.measurement.status="proposed",e.measurement.provenance=[...e.measurement.provenance,o]}t.brand&&(e.experience.design={...e.experience.design,...t.brand.kind==="figma"?{figma_file:t.brand.ref}:{tokens:t.brand.ref}},e.experience.status="proposed",e.experience.provenance=[...e.experience.provenance,o])}var gA,Zd,yA,bA,fA,wA,xV,SV,TV,kw,ks=_(()=>{"use strict";je();Kd();$n();gA=s.object({kind:s.enum(["figma","tokens","guidelines"]),ref:s.string().min(1)}),Zd=s.object({system:s.string().min(1),kind:s.string().min(1),ref:s.string().optional(),publicConfig:s.record(s.string(),s.string()).default({})}),yA=s.object({provider:s.string().optional(),analytics_requires_consent:s.boolean().default(!0)}),bA=s.object({type:Ub.shape.type,config:s.record(s.string(),s.string()).default({})}),fA=s.object({kind:s.string().min(1),ref:s.string().min(1)}),wA=s.object({sink:fA.optional(),source:fA.optional()}),xV=s.object({id:s.string().min(1),displayName:s.string().min(1),domains:s.array(s.string()).default([]),version:s.number().int().nonnegative().default(1),brand:gA.optional(),identity:s.object({operator:Zd.optional(),player:Zd.optional()}).optional(),consent:yA.prefault({}),analytics:s.array(bA).default([]),data:wA.prefault({}),studioOrg:s.string().optional(),studioSpaces:s.array(s.string()).default([]),defaultStudioSpace:s.string().optional(),requiresExplicitSpace:s.boolean().default(!1)}),SV=s.object({id:s.string().min(1),displayName:s.string().min(1),version:s.number().int().nonnegative().default(1),brand:gA.optional(),identity:s.object({player:Zd.optional()}).optional(),consent:yA.prefault({}),analytics:s.array(bA).default([])}),TV=s.object({id:s.string().min(1),displayName:s.string().min(1),version:s.number().int().nonnegative().default(1),identity:s.object({operator:Zd.optional()}).optional(),data:wA.prefault({})}),kw="not_org_admin"});function _A(e,t=new Date){let o=typeof t=="string"?Date.parse(t):t.getTime(),r,n=Number.NEGATIVE_INFINITY;for(let a of e.rounds){let i=Date.parse(a.locksAt);Number.isNaN(i)||i>n&&(n=i,r=a)}return r?n>o?{state:"live",round:r}:{state:"stale",round:r,lockedForMs:o-n}:{state:"none"}}function xA(e){if(e.state!=="stale")return null;let t=Math.floor(e.lockedForMs/36e5),o=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 ${o} ago and nothing has replaced it. Fans are playing a closed round. Run gamestage deploy, or refresh the round, to move it on.`}function Sw(e,t=_s){return e.terms?.version===t}function EA(e,t=_s){return Sw(e,t)?null:{code:"terms_not_accepted",refused:`${e.terms?`The terms changed on ${t} and you accepted version ${e.terms.version}. `:""}Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} before you can continue with this workspace. You must accept them yourself in a browser; an agent cannot accept them for you.`}}function Xd(e){let t=$A.safeParse(e.access);return t.success?t.data:"pending"}function qM(e){let t=e??null;return!t||typeof t.version!="string"||typeof t.at!="string"?null:{version:t.version,at:t.at}}function WM(e){let t=e??null;return t&&typeof t.at=="string"?{at:t.at}:null}function AA(e){let t=n=>typeof n=="string"&&n.trim()?n:null,o=e.decision??null,r=o?t(o.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),contactConsent:qM(e.contactConsent),ageConfirmed:WM(e.ageConfirmed),personalEmail:e.personalEmail===!0,decision:r==="approved"||r==="refused"?{state:r,at:t(o.at)??t(e.registeredAt)??"",by:t(o.by)??"unknown",reason:t(o.reason)}:null}}function CA(e){return{waiting:e.filter(t=>!t.decision).sort((t,o)=>t.registeredAt.localeCompare(o.registeredAt)),decided:e.filter(t=>t.decision).sort((t,o)=>o.decision.at.localeCompare(t.decision.at))}}function Qd(e){return ZM.includes(e)}function Tw(e,t){return!e.prodApproval||Qd(t.tier)?"dev":"prod"}function RA(e){return e.filter(t=>t.limit>0&&t.used>=t.limit)}function NA(e){return e.limit<=0?0:Math.min(1,e.used/e.limit)}var OM,PM,kA,RM,NM,LM,xw,zM,jM,SA,DM,FV,TA,MM,_s,_a,Jd,FM,UM,$A,UV,GV,GM,BM,HM,YM,BV,qV,WV,HV,IA,YV,VV,KV,ZV,JV,VM,XV,OA,QV,KM,PA,ZM,xa=_(()=>{"use strict";us();ud();je();$n();Vi();Qi();Gd();Sd();Qi();Kt();ar();ks();OM=s.enum(["draft","live","sleeping","throttled","expired","archived"]),PM=s.enum(["scheduled","open","locked","settled"]),kA=s.object({id:s.string(),label:s.string(),used:s.number(),limit:s.number(),unit:s.string()}),RM=s.object({id:s.string(),label:s.string(),state:PM,opensAt:s.string(),locksAt:s.string(),settledAt:s.string().nullable(),plays:s.number(),edition:s.string().optional(),editionId:s.string().optional(),studioUrl:s.string().nullable().optional(),playsPerSecond:s.number().int().positive().optional(),playsPerDay:s.number().int().positive().optional()}),NM=s.object({id:s.string(),name:s.string(),enabled:s.boolean(),consentRequired:s.boolean(),note:s.string()}),LM=s.object({number:s.number().int().positive(),title:s.string(),openedAt:s.string(),labels:s.array(s.string()).default([]),fromGame:s.boolean().default(!1)}),xw=s.object({pickup:s.object({id:s.string(),outcome:s.enum(["ready","empty","failed"])}).optional(),at:s.string(),level:s.enum(["info","warn","error"]),roundId:s.string().nullable(),message:s.string(),dataset:s.string().optional()}),zM=s.enum(["absent","pending","ready","failed"]),jM=s.object({state:zM.default("absent"),url:s.string().nullable().default(null),regenerations:s.number().int().nonnegative().default(0),updatedAt:s.string().nullable().default(null),onProject:s.string().nullable().default(null)});SA=s.object({section:s.string(),status:Db}),DM=s.object({instanceId:s.string(),embedSlug:s.string(),template:s.string(),type:s.enum(["leaderboard","qr"]),createdAt:s.string(),consentBy:s.string()}),FV=s.object({template:s.string().min(1),consent:s.literal(!0)}),TA=s.object({id:s.string(),name:s.string(),containerLabel:s.string().min(1).default(ma),repository:s.string().nullable(),openIssues:s.number().int().nonnegative(),issues:s.array(LM).default([]),archetype:$o,offersPrize:s.boolean().default(!1),liveProvider:s.enum(_o).nullable().optional(),state:OM,prodApproval:s.object({approvedAt:s.string(),approvedBy:s.string()}).nullable().default(null).optional(),archivePrefix:s.string().nullable().default(null),space:s.string().nullable().default(null).optional(),platformSpace:s.string().nullable().default(null).optional(),platformOrg:s.string().nullable().default(null).optional(),platformProject:s.string().nullable().default(null).optional(),platformEvent:s.string().nullable().default(null).optional(),platformElement:s.string().nullable().default(null).optional(),studioUrl:s.string().nullable().default(null).optional(),appSpec:s.object({version:s.string(),shape:s.string(),resource:s.string().nullable().default(null),specUrl:s.string().optional(),wording:s.array(s.string()).optional(),roundFields:ds.optional(),refusal:s.object({at:s.string(),reason:s.string()}).nullable().default(null).optional()}).nullable().default(null).optional(),art:jM.prefault({}).optional(),graphics:s.array(DM).optional(),clientVersion:s.string().optional(),playgroundUrl:s.string().nullable(),playerEndpoint:s.string().nullable(),manifestRevision:s.string(),manifestSource:s.string().optional(),settingsDefaults:s.record(s.string(),s.string()).optional(),conformance:To,contentHash:s.string(),referenceDigest:s.string().optional(),referenceName:s.string().optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({strategy:s.string(),provider:s.string(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional()}).optional(),monthlyPlayers:s.number().int().nonnegative().optional(),sections:s.array(SA),meters:s.array(kA),history:s.array(Xi),rounds:s.array(RM),destinations:s.array(NM),logs:s.array(xw),updatedAt:s.string()}),MM=s.object({login:s.string(),linkedAt:s.string(),verification:s.literal("unverified").optional()}),_s="2026-10-01",_a="https://gamestage.ai/terms",Jd="https://gamestage.ai/stage",FM=s.object({version:s.string(),acceptedAt:s.string(),by:s.string()});UM=s.object({enabled:s.boolean().default(!1),applicationId:s.string().nullable().default(null),writeKey:s.string().nullable().default(null)}),$A=s.enum(["pending","approved","refused"]),UV=s.enum(["manual","automatic"]);GV=s.enum(["approved","refused"]),GM=s.object({company:s.string().trim().min(1,"Tell us your company.").max(120),role:s.string().trim().min(1,"Tell us your role.").max(120),intent:s.string().trim().min(1,"Tell us what you'd like to build.").max(500),contactConsent:s.literal(!0,{message:"Tick the box so we can contact you about your application."}),ageConfirmed:s.literal(!0,{message:`Confirm you are ${18} or older.`}),marketingConsent:s.boolean().optional()}),BM=s.object({company:s.string().nullish(),role:s.string().nullish(),intent:s.string().nullish(),contactConsent:s.object({version:s.string(),at:s.string()}).nullish(),ageConfirmed:s.object({at:s.string()}).nullish(),marketingConsent:s.object({at:s.string()}).nullish()});HM=s.object({id:s.string(),name:s.string(),tier:ba,ownerEmail:s.string(),access:$A.default("pending"),profile:BM.optional(),platformSpace:s.string().optional(),liveGameAllowance:s.number(),supplierGrants:s.array(s.string()).default([]),domainSuppliers:s.array(s.string()).optional(),github:MM.nullable().default(null),terms:FM.nullable().default(null),signal:UM.prefault({}),meters:s.array(kA),games:s.array(TA)}),YM=TA.extend({logs:s.array(xw).optional()}),BV=HM.extend({games:s.array(YM),gamesTotal:s.number().int().nonnegative(),archivedTotal:s.number().int().nonnegative().default(0)}),qV=s.object({player:s.string().nullable(),control:s.string().nullable(),playground:s.string().nullable()}),WV=s.object({id:s.string(),name:s.string(),archetype:$o,repository:s.string().nullable().default(null),manifestRevision:s.string(),contentHash:s.string(),conformance:To,offersPrize:s.boolean().default(!1),sections:s.array(SA).default([]),containerLabel:s.string().min(1).optional()}),HV=s.object({path:s.string(),size:s.number().int().nonnegative().optional()}),IA=s.string().regex(/^[a-z0-9][a-z0-9-]{7,63}$/,"a deploy id: lowercase letters, digits and dashes, 8 to 64 characters"),YV=s.object({uploadUrl:s.string(),publicUrl:s.string(),key:s.string(),deployId:s.string().optional(),stagedKey:s.string().optional(),expiresInSeconds:s.number().int().positive(),cacheControl:s.string().optional(),playerApiOrigin:s.string()}),VV=s.object({manifestRevision:s.string(),contentHash:s.string(),conformance:To,offersPrize:s.boolean().default(!1),live:s.object({provider:s.enum(_o)}).nullable().optional(),round:Ve.optional(),studioSeed:Ve.optional(),identity:s.object({issuer:s.string().optional(),jwks_uri:s.string().superRefine((e,t)=>{let o=_d(e);o&&t.addIssue({code:"custom",message:xd(o)})}).optional(),audience:s.string().optional(),player_id_claim:s.string().optional(),identify:s.object({strategy:s.string(),provider:s.string(),assertion:s.boolean().optional()}).optional(),require_authenticated_writes:s.boolean().optional()}).optional(),wording:s.array(s.string()).optional(),roundFields:ds.nullable().optional(),manifestSource:s.string().optional(),settings:s.record(s.string(),s.string()).optional(),notes:s.string().max(500).optional(),studioSpace:s.string().optional(),studioSpaceOrg:s.string().optional(),clientVersion:s.string().optional(),staged:s.object({id:IA,replace:s.boolean()}).optional()}),KV=s.object({game:s.string().trim().min(1).max(64),round:Ve}),ZV=s.object({round:Ve}),JV=s.discriminatedUnion("ok",[s.object({ok:s.literal(!0),engineGame:s.string(),roundId:s.string(),version:s.number().int().nonnegative(),playerApiOrigin:s.string()}),s.object({ok:s.literal(!1),code:s.enum(["game_archived","no_engine","engine_refused"]),refused:s.string()})]),VM=s.object({limit:s.coerce.number().int().positive().max(1e3).default(100),since:s.string().nullable().default(null),level:xw.shape.level.nullable().default(null)}),XV=s.enum(["access_pending","terms_not_accepted","personal_email","profile_incomplete","github_not_linked","live_allowance_reached","meter_breached","nothing_to_do","tier_required","live_not_enabled","operator_required","game_archived","dev_allowance_reached","art_limit_reached","art_unavailable","round_source_unreadable","round_source_unsupported","round_not_seeded","delete_refused","space_required","space_not_permitted","nothing_published"]),OA=s.enum(["workspace.created","workspace.approved","workspace.refused","workspace.profile_updated","workspace.member_invited","workspace.member_joined","workspace.member_removed","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.erasure_requested","game.data_erased","game.deleted","game.deleted","workspace.plan_changed","workspace.closed","workspace.datasets_erased","workspace.plan_refused","engine.integrity_violation","edition.repeated","edition.missing","game.quiet","destination.changed","signal.enabled","signal.disabled","source.key_attempt","domain.added","domain.removed","domain.live","domain.stopped","dataset.switched_on","dataset.switched_off","dataset.refresh_changed","ads.requested","ads.not_wanted","ads.request_moved"]),QV=s.object({id:s.string(),at:s.string(),action:OA,actor:s.object({kind:s.enum(["creator","operator","system"]),id:s.string(),email:s.string().nullable().default(null)}),gameId:s.string().nullable().default(null),correlationId:s.string(),detail:s.record(s.string(),s.unknown()).default({})}),KM=s.object({limit:s.coerce.number().int().positive().max(1e3).default(100),action:OA.nullable().default(null),actorId:s.string().nullable().default(null),gameId:s.string().nullable().default(null),from:s.string().nullable().default(null),to:s.string().nullable().default(null)}),PA={runtime:{liveGames:1,devGames:3,mau:1e3,storage:250},live:{liveGames:5,devGames:20,mau:1e4,storage:10240},enterprise:{liveGames:10,devGames:0,mau:0,storage:0}},ZM=["runtime"]});var LA,zA,rK,aK,iK,mr,JM,jA,eu=_(()=>{"use strict";je();Gd();LA="x-gamestage-workspace",zA=s.enum(["owner","member"]),rK=s.object({email:s.string(),role:zA,status:s.enum(["active","invited"]),invitedBy:s.string().nullable().default(null),at:s.string().nullable().default(null)}),aK=s.object({id:s.string(),role:zA,owner:s.string()}),iK=s.object({email:s.string().min(3).max(254)}),mr=5,JM=`This workspace already has ${mr} people besides you, counting invites not yet accepted. Remove someone or cancel an invite first.`,jA="While Gamestage is in preview, invite people at their work address: Gmail, Yahoo and other personal addresses cannot join."});var tu,Ew=_(()=>{"use strict";tu=/https?:\/\/(?:fonts\.googleapis\.com|fonts\.gstatic\.com|use\.typekit\.net|p\.typekit\.net|fonts\.bunny\.net|fonts\.cdnfonts\.com|[\w.-]*fontawesome\.com|cdn\.jsdelivr\.net\/[^\s"')]*\.(?:woff2?|ttf|otf)|unpkg\.com\/[^\s"')]*\.(?:woff2?|ttf|otf))/i});function tF(e){let t=e.toLowerCase().replace(/\.$/,"");return eF.some(o=>t===o||t.endsWith(`.${o}`))}function $w(e){let t;try{t=new URL(e)}catch{return`"${e}" is not a web address. Give the full https address of the font file on your own host.`}if(t.protocol!=="https:")return`"${e}" is not https. Games load fonts over https only.`;if(tF(t.hostname))return`"${e}" is on a Gamestage or Monterosa domain. Your games load your fonts from your own host, never from ours. Host the file yourself and give that address.`;if(tu.test(e))return`"${e}" is a font service (${t.hostname}), which sees every fan's address before any consent banner can ask, so games may not load fonts from it. Host the font file on your own domain and give that address.`}function nu(e,t,o){let r=ya(e);if(!r.ok)return[r.reason];let{name:n,version:a}=r,i=[];o&&(o.find(b=>b.name===n)?.versions.some(b=>b.version===a)||i.push(`${n}@${a} is not one of your org's themes. Publish it with gamestage theme publish, or pin a version gamestage theme list shows.`));let c=`[data-gs-theme="${n}"]`;t.filter(g=>/\.css$/i.test(g.relative)||/\.html?$/i.test(g.relative)).some(g=>g.text.includes(c))||i.push(`No stylesheet in the game has the ${c} block, so the theme is not installed. Run gamestage theme use ${n}@${a}.`);let l=t.filter(g=>!/\.css$/i.test(g.relative)),u=new RegExp([`data-gs-theme\\s*=\\s*["']${n}["']`,`setAttribute\\(\\s*["']data-gs-theme["']\\s*,\\s*["']${n}["']`,`gsTheme\\s*=\\s*["']${n}["']`].join("|"));l.some(g=>u.test(g.text))||i.push(`Nothing in the game sets data-gs-theme="${n}", so the theme styles nothing. Add it to <html> in index.html.`);let p=t.find(g=>g.relative.endsWith(`gamestage-theme-${n}.css`)),f=new Set;for(let g of nF(p?.text??"").matchAll(/url\(\s*["']?([^"')]+)["']?\s*\)/g)){if(g[1].startsWith("data:"))continue;let b=$w(g[1]);b?i.push(b):f.add(new URL(g[1]).origin)}if(f.size)for(let g of t.filter(b=>/\.html?$/i.test(b.relative))){let b=/<meta[^>]+http-equiv=["']content-security-policy["'][^>]*content=(["'])(.*?)\1/i.exec(g.text)?.[2];if(!b)continue;let v=/(?:^|;)\s*(font-src|default-src)\s+([^;]+)/i,x=/(?:^|;)\s*font-src\s+([^;]+)/i.exec(b)?.[1]??v.exec(b)?.[2];if(!x)continue;let R=x.split(/\s+/);for(let F of f)R.some(U=>U==="*"||U==="https:"||U===F||U===new URL(F).host)||i.push(`${g.relative} has a content security policy whose font-src does not allow ${F}, where the theme's fonts are. Add ${F} to font-src.`)}return i}var eF,nF,oF,rF,Aw,DA,Cw,pK,Iw=_(()=>{"use strict";je();Ew();ks();ms();ms();eF=["gamestage.ai","monterosa.cloud","monterosa.co","monterosa.co.uk","monterosa.tools"];nF=e=>e.replace(/\/\*[\s\S]*?\*\//g,""),oF=s.object({declaredBy:s.string().min(3).max(200),declaredAt:s.string().min(10).max(40),statement:s.string().min(10).max(2e3)}),rF=s.object({family:s.string().min(1).max(100),weight:s.string().max(20).optional(),style:s.string().max(20).optional(),src:s.string().min(1).max(2e3),licence:oF}),Aw=s.object({name:s.string(),version:s.string(),base:s.string().max(100).optional(),fonts:s.array(rF).max(20).default([])}),DA=s.object({code:s.string().max(100),message:s.string().max(2e3),token:s.string().max(200).optional()}),Cw=s.object({ok:s.boolean(),errors:s.array(DA).max(500),warnings:s.array(DA).max(500)}),pK=s.object({version:s.string(),theme:Aw,tokens:s.record(s.string(),s.unknown()),overridesCss:s.string().max(2e5).optional(),css:s.string().min(1).max(5e5),check:Cw})});function iF(e){return new TextEncoder().encode(e).length}function MA(e){if(!e.trim())return"The file is empty. Write how a game should fit your organisation's app, then set it again.";let t=iF(e);if(t>aF)return`The file is ${Math.ceil(t/1024)} KB, and the limit is 50 KB. Cut it down to what an agent needs to build a game, and link to longer documents instead of pasting them.`;if(e.includes("\0")||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/.test(e))return"The file is not UTF-8 text. Save it as plain Markdown in UTF-8 and set it again."}function cF(e){let t=e.replace(/\bhttps?:\/\/\S+/gi," ").replace(/\bsha(?:256|384|512)-[A-Za-z0-9+/=]+/g," ");for(let o of t.matchAll(/[A-Za-z0-9+/_-]{40,}={0,2}/g)){let r=o[0];if(/[A-Z]/.test(r)&&/[a-z]/.test(r)&&/[0-9]/.test(r))return!0}return!1}function Ow(e){let t=[];return e.split(/\r?\n/).forEach((o,r)=>{let n=sF.find(a=>a.test.test(o));n?t.push({line:r+1,kind:n.kind}):cF(o)&&t.push({line:r+1,kind:"a long access token"})}),t}var pr,aF,yK,sF,ou=_(()=>{"use strict";je();pr="integration.md",aF=50*1024,yK=s.object({markdown:s.string()});sF=[{kind:"a private key",test:/-----BEGIN [A-Z0-9 ]*PRIVATE KEY( BLOCK)?-----/},{kind:"an AWS access key",test:/\b(?:AKIA|ASIA|AGPA|AIDA|AROA)[0-9A-Z]{16}\b/},{kind:"an AWS secret access key",test:/aws_secret_access_key\s*[=:]/i},{kind:"an API secret key",test:/\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{8,}/},{kind:"a live API key",test:/\bpk_live_[A-Za-z0-9]{8,}/},{kind:"an API secret key",test:/\bsk-[A-Za-z0-9_-]{20,}/},{kind:"a GitHub or GitLab token",test:/\b(?:ghp|gho|ghu|ghs|ghr|github_pat|glpat)[-_][A-Za-z0-9_-]{16,}/},{kind:"a Slack token",test:/\bxox[abprs]-[A-Za-z0-9-]{10,}/},{kind:"a password",test:/\b(?:password|passwd|pwd)\s*[=:]\s*["']?[^\s"'<>`]{4,}/i}]});import{createRequire as lF}from"module";function TF(e,t){return SF(e,t||{},0,0)}function EF(e,t){return wF(e,{i:2},t&&t.out,t&&t.dictionary)}function qA(e,t){if(t){for(var o=new st(e.length),r=0;r<e.length;++r)o[r]=e.charCodeAt(r);return o}if(BA)return BA.encode(e);for(var n=e.length,a=new st(e.length+(e.length>>1)),i=0,c=function(u){a[i++]=u},r=0;r<n;++r){if(i+5>a.length){var d=new st(i+8+(n-r<<1));d.set(a),a=d}var l=e.charCodeAt(r);l<128||t?c(l):l<2048?(c(192|l>>6),c(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++r)&1023,c(240|l>>18),c(128|l>>12&63),c(128|l>>6&63),c(128|l&63)):(c(224|l>>12),c(128|l>>6&63),c(128|l&63))}return Es(a,0,i)}function CF(e,t){if(t){for(var o="",r=0;r<e.length;r+=16384)o+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return o}else{if(Fw)return Fw.decode(e);var n=AF(e),a=n.s,o=n.r;return o.length&&xt(8),a}}function QA(e,t){t||(t={});var o={},r=[];XA(e,"",o,t);var n=0,a=0;for(var i in o){var c=o[i],d=c[0],l=c[1],u=l.level==0?0:8,p=qA(i),f=p.length,g=l.comment,b=g&&qA(g),v=b&&b.length,x=Uw(l.extra);f>65535&&xt(11);var R=u?TF(d,l):d,F=R.length,U=xF();U.p(d),r.push(JA(l,{size:d.length,crc:U.d(),c:R,f:p,m:b,u:f!=i.length||b&&g.length!=v,o:n,compression:u})),n+=30+f+x+F,a+=76+2*(f+x)+(v||0)+F}for(var W=new st(a+22),T=n,H=a-n,G=0;G<r.length;++G){var p=r[G];WA(W,p.o,p,p.f,p.u,p.c.length);var oe=30+p.f.length+Uw(p.extra);W.set(p.c,p.o+oe),WA(W,n,p,p.f,p.u,p.c.length,p.o,p.m),n+=16+oe+(p.m?p.m.length:0)}return RF(W,n,r.length,H,T),W}function eC(e,t){for(var o={},r=e.length-22;Zt(e,r)!=101010256;--r)(!r||e.length-r>65558)&&xt(13);var n=Cn(e,r+8);if(!n)return{};var a=Zt(e,r+16),i=Zt(e,r-20)==117853008;if(i){var c=Zt(e,r-12);i=Zt(e,c)==101075792,i&&(n=Zt(e,c+32),a=Zt(e,c+48))}for(var d=t&&t.filter,l=0;l<n;++l){var u=OF(e,a,i),p=u[0],f=u[1],g=u[2],b=u[3],v=u[4],x=u[5],R=IF(e,x);a=v,(!d||d({name:b,size:f,originalSize:g,compression:p}))&&(p?p==8?o[b]=EF(e.subarray(R,R+f),{out:new st(g)}):xt(14,"unknown compression type "+p):o[b]=Es(e,R,R+f))}return o}var dF,Sa,uF,mF,st,Gt,Gw,ru,au,zw,HA,Sa,YA,jw,VA,pF,FA,Dw,Kn,Fe,In,Oo,Fe,Fe,Fe,Fe,Ts,Fe,hF,fF,gF,yF,Pw,un,Rw,Bw,Es,bF,xt,wF,Zn,xs,Nw,Mw,UA,Ss,KA,GA,vF,ZA,kF,_F,xF,SF,JA,Cn,Zt,Lw,yt,XA,BA,Fw,$F,AF,IF,OF,PF,Uw,WA,RF,qw=_(()=>{dF=lF("/");try{Sa=dF("worker_threads"),uF=Sa.Worker,mF=Sa.isMarkedAsUntransferable}catch{}st=Uint8Array,Gt=Uint16Array,Gw=Int32Array,ru=new st([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),au=new st([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),zw=new st([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HA=function(e,t){for(var o=new Gt(31),r=0;r<31;++r)o[r]=t+=1<<e[r-1];for(var n=new Gw(o[30]),r=1;r<30;++r)for(var a=o[r];a<o[r+1];++a)n[a]=a-o[r]<<5|r;return{b:o,r:n}},Sa=HA(ru,2),YA=Sa.b,jw=Sa.r;YA[28]=258,jw[258]=28;VA=HA(au,0),pF=VA.b,FA=VA.r,Dw=new Gt(32768);for(Fe=0;Fe<32768;++Fe)Kn=(Fe&43690)>>1|(Fe&21845)<<1,Kn=(Kn&52428)>>2|(Kn&13107)<<2,Kn=(Kn&61680)>>4|(Kn&3855)<<4,Dw[Fe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;In=(function(e,t,o){for(var r=e.length,n=0,a=new Gt(t);n<r;++n)e[n]&&++a[e[n]-1];var i=new Gt(t);for(n=1;n<t;++n)i[n]=i[n-1]+a[n-1]<<1;var c;if(o){c=new Gt(1<<t);var d=15-t;for(n=0;n<r;++n)if(e[n])for(var l=n<<4|e[n],u=t-e[n],p=i[e[n]-1]++<<u,f=p|(1<<u)-1;p<=f;++p)c[Dw[p]>>d]=l}else for(c=new Gt(r),n=0;n<r;++n)e[n]&&(c[n]=Dw[i[e[n]-1]++]>>15-e[n]);return c}),Oo=new st(288);for(Fe=0;Fe<144;++Fe)Oo[Fe]=8;for(Fe=144;Fe<256;++Fe)Oo[Fe]=9;for(Fe=256;Fe<280;++Fe)Oo[Fe]=7;for(Fe=280;Fe<288;++Fe)Oo[Fe]=8;Ts=new st(32);for(Fe=0;Fe<32;++Fe)Ts[Fe]=5;hF=In(Oo,9,0),fF=In(Oo,9,1),gF=In(Ts,5,0),yF=In(Ts,5,1),Pw=function(e){for(var t=e[0],o=1;o<e.length;++o)e[o]>t&&(t=e[o]);return t},un=function(e,t,o){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&o},Rw=function(e,t){var o=t/8|0;return(e[o]|e[o+1]<<8|e[o+2]<<16)>>(t&7)},Bw=function(e){return(e+7)/8|0},Es=function(e,t,o){return(t==null||t<0)&&(t=0),(o==null||o>e.length)&&(o=e.length),new st(e.subarray(t,o))},bF=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],xt=function(e,t,o){var r=new Error(t||bF[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,xt),!o)throw r;return r},wF=function(e,t,o,r){var n=e.length,a=r?r.length:0;if(!n||t.f&&!t.l)return o||new st(0);var i=!o,c=i||t.i!=2,d=t.i;i&&(o=new st(n*3));var l=function(at){var dt=o.length;if(at>dt){var mt=new st(Math.max(dt*2,at));mt.set(o),o=mt}},u=t.f||0,p=t.p||0,f=t.b||0,g=t.l,b=t.d,v=t.m,x=t.n,R=n*8;do{if(!g){u=un(e,p,1);var F=un(e,p+1,3);if(p+=3,F)if(F==1)g=fF,b=yF,v=9,x=5;else if(F==2){var H=un(e,p,31)+257,G=un(e,p+10,15)+4,oe=H+un(e,p+5,31)+1;p+=14;for(var re=new st(oe),ie=new st(19),te=0;te<G;++te)ie[zw[te]]=un(e,p+te*3,7);p+=G*3;for(var se=Pw(ie),he=(1<<se)-1,we=In(ie,se,1),te=0;te<oe;){var ue=we[un(e,p,he)];p+=ue&15;var U=ue>>4;if(U<16)re[te++]=U;else{var M=0,ke=0;for(U==16?(ke=3+un(e,p,3),p+=2,M=re[te-1]):U==17?(ke=3+un(e,p,7),p+=3):U==18&&(ke=11+un(e,p,127),p+=7);ke--;)re[te++]=M}}var Ne=re.subarray(0,H),P=re.subarray(H);v=Pw(Ne),x=Pw(P),g=In(Ne,v,1),b=In(P,x,1)}else xt(1);else{var U=Bw(p)+4,W=e[U-4]|e[U-3]<<8,T=U+W;if(T>n){d&&xt(0);break}c&&l(f+W),o.set(e.subarray(U,T),f),t.b=f+=W,t.p=p=T*8,t.f=u;continue}if(p>R){d&&xt(0);break}}c&&l(f+131072);for(var ce=(1<<v)-1,fe=(1<<x)-1,ge=p;;ge=p){var M=g[Rw(e,p)&ce],ye=M>>4;if(p+=M&15,p>R){d&&xt(0);break}if(M||xt(2),ye<256)o[f++]=ye;else if(ye==256){ge=p,g=null;break}else{var ze=ye-254;if(ye>264){var te=ye-257,Te=ru[te];ze=un(e,p,(1<<Te)-1)+YA[te],p+=Te}var Me=b[Rw(e,p)&fe],lt=Me>>4;Me||xt(3),p+=Me&15;var P=pF[lt];if(lt>3){var Te=au[lt];P+=Rw(e,p)&(1<<Te)-1,p+=Te}if(p>R){d&&xt(0);break}c&&l(f+131072);var et=f+ze;if(f<P){var ut=a-P,Pe=Math.min(P,et);for(ut+f<0&&xt(3);f<Pe;++f)o[f]=r[ut+f]}for(;f<et;++f)o[f]=o[f-P]}}t.l=g,t.p=ge,t.b=f,t.f=u,g&&(u=1,t.m=v,t.d=b,t.n=x)}while(!u);return f!=o.length&&i?Es(o,0,f):o.subarray(0,f)},Zn=function(e,t,o){o<<=t&7;var r=t/8|0;e[r]|=o,e[r+1]|=o>>8},xs=function(e,t,o){o<<=t&7;var r=t/8|0;e[r]|=o,e[r+1]|=o>>8,e[r+2]|=o>>16},Nw=function(e,t){for(var o=[],r=0;r<e.length;++r)e[r]&&o.push({s:r,f:e[r]});var n=o.length,a=o.slice();if(!n)return{t:ZA,l:0};if(n==1){var i=new st(o[0].s+1);return i[o[0].s]=1,{t:i,l:1}}o.sort(function(T,H){return T.f-H.f}),o.push({s:-1,f:25001});var c=o[0],d=o[1],l=0,u=1,p=2;for(o[0]={s:-1,f:c.f+d.f,l:c,r:d};u!=n-1;)c=o[o[l].f<o[p].f?l++:p++],d=o[l!=u&&o[l].f<o[p].f?l++:p++],o[u++]={s:-1,f:c.f+d.f,l:c,r:d};for(var f=a[0].s,r=1;r<n;++r)a[r].s>f&&(f=a[r].s);var g=new Gt(f+1),b=Mw(o[u-1],g,0);if(b>t){var r=0,v=0,x=b-t,R=1<<x;for(a.sort(function(H,G){return g[G.s]-g[H.s]||H.f-G.f});r<n;++r){var F=a[r].s;if(g[F]>t)v+=R-(1<<b-g[F]),g[F]=t;else break}for(v>>=x;v>0;){var U=a[r].s;g[U]<t?v-=1<<t-g[U]++-1:++r}for(;r>=0&&v;--r){var W=a[r].s;g[W]==t&&(--g[W],++v)}b=t}return{t:new st(g),l:b}},Mw=function(e,t,o){return e.s==-1?Math.max(Mw(e.l,t,o+1),Mw(e.r,t,o+1)):t[e.s]=o},UA=function(e){for(var t=e.length;t&&!e[--t];);for(var o=new Gt(++t),r=0,n=e[0],a=1,i=function(d){o[r++]=d},c=1;c<=t;++c)if(e[c]==n&&c!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(n),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(n);a=1,n=e[c]}return{c:o.subarray(0,r),n:t}},Ss=function(e,t){for(var o=0,r=0;r<t.length;++r)o+=e[r]*t[r];return o},KA=function(e,t,o){var r=o.length,n=Bw(t+2);e[n]=r&255,e[n+1]=r>>8,e[n+2]=e[n]^255,e[n+3]=e[n+1]^255;for(var a=0;a<r;++a)e[n+a+4]=o[a];return(n+4+r)*8},GA=function(e,t,o,r,n,a,i,c,d,l,u){Zn(t,u++,o),++n[256];for(var p=Nw(n,15),f=p.t,g=p.l,b=Nw(a,15),v=b.t,x=b.l,R=UA(f),F=R.c,U=R.n,W=UA(v),T=W.c,H=W.n,G=new Gt(19),oe=0;oe<F.length;++oe)++G[F[oe]&31];for(var oe=0;oe<T.length;++oe)++G[T[oe]&31];for(var re=Nw(G,7),ie=re.t,te=re.l,se=19;se>4&&!ie[zw[se-1]];--se);var he=l+5<<3,we=Ss(n,Oo)+Ss(a,Ts)+i,ue=Ss(n,f)+Ss(a,v)+i+14+3*se+Ss(G,ie)+2*G[16]+3*G[17]+7*G[18];if(d>=0&&he<=we&&he<=ue)return KA(t,u,e.subarray(d,d+l));var M,ke,Ne,P;if(Zn(t,u,1+(ue<we)),u+=2,ue<we){M=In(f,g,0),ke=f,Ne=In(v,x,0),P=v;var ce=In(ie,te,0);Zn(t,u,U-257),Zn(t,u+5,H-1),Zn(t,u+10,se-4),u+=14;for(var oe=0;oe<se;++oe)Zn(t,u+3*oe,ie[zw[oe]]);u+=3*se;for(var fe=[F,T],ge=0;ge<2;++ge)for(var ye=fe[ge],oe=0;oe<ye.length;++oe){var ze=ye[oe]&31;Zn(t,u,ce[ze]),u+=ie[ze],ze>15&&(Zn(t,u,ye[oe]>>5&127),u+=ye[oe]>>12)}}else M=hF,ke=Oo,Ne=gF,P=Ts;for(var oe=0;oe<c;++oe){var Te=r[oe];if(Te>255){var ze=Te>>18&31;xs(t,u,M[ze+257]),u+=ke[ze+257],ze>7&&(Zn(t,u,Te>>23&31),u+=ru[ze]);var Me=Te&31;xs(t,u,Ne[Me]),u+=P[Me],Me>3&&(xs(t,u,Te>>5&8191),u+=au[Me])}else xs(t,u,M[Te]),u+=ke[Te]}return xs(t,u,M[256]),u+ke[256]},vF=new Gw([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ZA=new st(0),kF=function(e,t,o,r,n,a){var i=a.z||e.length,c=new st(r+i+5*(1+Math.ceil(i/7e3))+n),d=c.subarray(r,c.length-n),l=a.l,u=(a.r||0)&7;if(t){u&&(d[0]=a.r>>3);for(var p=vF[t-1],f=p>>13,g=p&8191,b=(1<<o)-1,v=a.p||new Gt(32768),x=a.h||new Gt(b+1),R=Math.ceil(o/3),F=2*R,U=function(Wt){return(e[Wt]^e[Wt+1]<<R^e[Wt+2]<<F)&b},W=new Gw(25e3),T=new Gt(288),H=new Gt(32),G=0,oe=0,re=a.i||0,ie=0,te=a.w||0,se=0;re+2<i;++re){var he=U(re),we=re&32767,ue=x[he];if(v[we]=ue,x[he]=we,te<=re){var M=i-re;if((G>7e3||ie>24576)&&(M>423||!l)){u=GA(e,d,0,W,T,H,oe,ie,se,re-se,u),ie=G=oe=0,se=re;for(var ke=0;ke<286;++ke)T[ke]=0;for(var ke=0;ke<30;++ke)H[ke]=0}var Ne=2,P=0,ce=g,fe=we-ue&32767;if(M>2&&he==U(re-fe))for(var ge=Math.min(f,M)-1,ye=Math.min(32767,re),ze=Math.min(258,M);fe<=ye&&--ce&&we!=ue;){if(e[re+Ne]==e[re+Ne-fe]){for(var Te=0;Te<ze&&e[re+Te]==e[re+Te-fe];++Te);if(Te>Ne){if(Ne=Te,P=fe,Te>ge)break;for(var Me=Math.min(fe,Te-2),lt=0,ke=0;ke<Me;++ke){var et=re-fe+ke&32767,ut=v[et],Pe=et-ut&32767;Pe>lt&&(lt=Pe,ue=et)}}}we=ue,ue=v[we],fe+=we-ue&32767}if(P){W[ie++]=268435456|jw[Ne]<<18|FA[P];var at=jw[Ne]&31,dt=FA[P]&31;oe+=ru[at]+au[dt],++T[257+at],++H[dt],te=re+Ne,++G}else W[ie++]=e[re],++T[e[re]]}}for(re=Math.max(re,te);re<i;++re)W[ie++]=e[re],++T[e[re]];u=GA(e,d,l,W,T,H,oe,ie,se,re-se,u),l||(a.r=u&7|d[u/8|0]<<3,u-=7,a.h=x,a.p=v,a.i=re,a.w=te)}else{for(var re=a.w||0;re<i+l;re+=65535){var mt=re+65535;mt>=i&&(d[u/8|0]=l,mt=i),u=KA(d,u+1,e.subarray(re,mt))}a.i=i}return Es(c,0,r+Bw(u)+n)},_F=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var o=t,r=9;--r;)o=(o&1&&-306674912)^o>>>1;e[t]=o}return e})(),xF=function(){var e=-1;return{p:function(t){for(var o=e,r=0;r<t.length;++r)o=_F[o&255^t[r]]^o>>>8;e=o},d:function(){return~e}}},SF=function(e,t,o,r,n){if(!n&&(n={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),i=new st(a.length+e.length);i.set(a),i.set(e,a.length),e=i,n.w=a.length}return kF(e,t.level==null?6:t.level,t.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,o,r,n)},JA=function(e,t){var o={};for(var r in e)o[r]=e[r];for(var r in t)o[r]=t[r];return o},Cn=function(e,t){return e[t]|e[t+1]<<8},Zt=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Lw=function(e,t){return Zt(e,t)+Zt(e,t+4)*4294967296},yt=function(e,t,o){for(;o;++t)e[t]=o,o>>>=8};XA=function(e,t,o,r){for(var n in e){var a=e[n],i=t+n,c=r;Array.isArray(a)&&(c=JA(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?o[i]=[a,c]:(o[i+="/"]=[new st(0),c],XA(a,i,o,r))}},BA=typeof TextEncoder<"u"&&new TextEncoder,Fw=typeof TextDecoder<"u"&&new TextDecoder,$F=0;try{Fw.decode(ZA,{stream:!0}),$F=1}catch{}AF=function(e){for(var t="",o=0;;){var r=e[o++],n=(r>127)+(r>223)+(r>239);if(o+n>e.length)return{s:t,r:Es(e,o-1)};n?n==3?(r=((r&15)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):n&1?t+=String.fromCharCode((r&31)<<6|e[o++]&63):t+=String.fromCharCode((r&15)<<12|(e[o++]&63)<<6|e[o++]&63):t+=String.fromCharCode(r)}};IF=function(e,t){return t+30+Cn(e,t+26)+Cn(e,t+28)},OF=function(e,t,o){var r=Cn(e,t+28),n=Cn(e,t+30),a=CF(e.subarray(t+46,t+46+r),!(Cn(e,t+8)&2048)),i=t+46+r,c=PF(e,i,n,o,Zt(e,t+20),Zt(e,t+24),Zt(e,t+42)),d=c[0],l=c[1],u=c[2];return[Cn(e,t+10),d,l,a,i+n+Cn(e,t+32),u]},PF=function(e,t,o,r,n,a,i){var c=n==4294967295,d=a==4294967295,l=i==4294967295,u=t+o,p=c+d+l;if(r&&p){for(;t+4<u;t+=4+Cn(e,t+2))if(Cn(e,t)==1)return[c?Lw(e,t+4+8*d):n,d?Lw(e,t+4):a,l?Lw(e,t+4+8*(d+c)):i,1];r<2&&xt(13)}return[n,a,i,0]},Uw=function(e){var t=0;if(e)for(var o in e){var r=e[o].length;r>65535&&xt(9),t+=r+4}return t},WA=function(e,t,o,r,n,a,i,c){var d=r.length,l=o.extra,u=c&&c.length,p=Uw(l);yt(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=o.os),e[t]=20,t+=2,e[t++]=o.flag<<1|(a<0&&8),e[t++]=n&&8,e[t++]=o.compression&255,e[t++]=o.compression>>8;var f=new Date(o.mtime==null?Date.now():o.mtime),g=f.getFullYear()-1980;if((g<0||g>119)&&xt(10),yt(e,t,g<<25|f.getMonth()+1<<21|f.getDate()<<16|f.getHours()<<11|f.getMinutes()<<5|f.getSeconds()>>1),t+=4,a!=-1&&(yt(e,t,o.crc),yt(e,t+4,a<0?-a-2:a),yt(e,t+8,o.size)),yt(e,t+12,d),yt(e,t+14,p),t+=16,i!=null&&(yt(e,t,u),yt(e,t+6,o.attrs),yt(e,t+10,i),t+=14),e.set(r,t),t+=d,p)for(var b in l){var v=l[b],x=v.length;yt(e,t,+b),yt(e,t+2,x),e.set(v,t+4),t+=4+x}return u&&(e.set(c,t),t+=u),t},RF=function(e,t,o,r,n){yt(e,t,101010256),yt(e,t+8,o),yt(e,t+10,o),yt(e,t+12,r),yt(e,t+16,n)}});function iu(e){let o=(e.match(/<script\b[^>]*>/gi)??[]).map(r=>/\bsrc\s*=\s*["']([^"']+)["']/i.exec(r)?.[1]).find(r=>r!==void 0&&/\.(tsx|jsx|ts|mts)(\?.*)?$/i.test(r));if(o)return[`The page loads ${o}, which is source code a browser cannot run, so the game never starts.`,"This is the game's source folder rather than its build. Build it, then deploy the","folder the build writes, for a Vite game: npm run build, then deploy --dir dist."]}function NF(e){return/gamestage(\.min)?\.js|@monterosa\/gamestage/.test(e)}function su(e,t){if(!t)return;let o=/consentBanner\s*:\s*false/.test(e),r=/data-gs-component=["']consent["']|<Consent\b|game\.consent\.decide\(/.test(e);if(!NF(e))return"The page does not load the Gamestage client, which draws the consent banner.";if(o&&!r)return"The page turns the consent banner off and draws no consent screen of its own."}function cu(e,t){if(!t)return;let o=md.filter(n=>!e?.[n]?.trim()),r=e?.privacy_policy_url?.trim()??"";if(!(o.length===0&&/^https:\/\/[^\s]+$/.test(r)))return[o.length?`${$s} has no ${o.join(" or ")}.`:`privacy_policy_url must be an https address, and is "${r}".`,"Add your brand as consent_brand_name and your privacy policy's address as","privacy_policy_url. A fan is told who is recording them before they answer."]}function LF(e){try{return/(^|\.)monterosa\.(co|co\.uk|com|cloud)$/i.test(new URL(e).hostname)}catch{return!1}}function Ww(e){let t=[];/\bmonterosa\b/i.test(e?.consent_brand_name??"")&&t.push("consent_brand_name names Monterosa"),LF(e?.privacy_policy_url?.trim()??"")&&t.push("privacy_policy_url is Monterosa's privacy policy");let o=Object.keys(e??{}).filter(r=>r.startsWith("label_taster_"));if(o.length&&t.push(`${o.length} setting${o.length===1?"":"s"} copied from a gamestage.ai taster (label_taster_*)`),!!t.length)return[`${$s}: ${t.join("; ")}.`,"The games on gamestage.ai are Monterosa's and are not templates. Name your own","brand and your own privacy policy, and remove the taster's settings. Start a new","game from `gamestage create`."]}var $s,Hw=_(()=>{"use strict";Ki();$s="gamestage.settings.json"});function MF(e){let t=e.replace(/[. ]+$/,"").toLowerCase();return t===".git"||t==="node_modules"}function tC(e){if(!e||e.includes("\0"))return"is empty or not text";if(e.includes("\\"))return"uses a backslash";if(e.startsWith("/")||/^[A-Za-z]:/.test(e))return"is an absolute path";if(e.split("/").some(t=>t===".."))return"climbs out of the folder with ..";if(e.split("/").some(MF))return"is inside .git or node_modules, which a starter must not carry"}function FF(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),o=-1;for(let d=e.length-22;d>=Math.max(0,e.length-22-65535);d--)if(t.getUint32(d,!0)===101010256){o=d;break}if(o<0||o>=20&&t.getUint32(o-20,!0)===117853008)return;let r=t.getUint16(o+8,!0),n=t.getUint16(o+10,!0);if(r!==n)return;let a=t.getUint32(o+16,!0);if(n===65535||a===4294967295)return;let i=new TextDecoder("utf-8"),c=[];for(let d=0;d<n;d++){if(a+46>e.length||t.getUint32(a,!0)!==33639248)return;let l=t.getUint16(a+4,!0)>>8,u=t.getUint32(a+24,!0),p=t.getUint16(a+28,!0),f=t.getUint16(a+30,!0),g=t.getUint16(a+32,!0),b=t.getUint32(a+38,!0),v=i.decode(e.subarray(a+46,a+46+p)),x=l===3||l===19?b>>>16:0;c.push({name:v,folder:v.endsWith("/"),symlink:(x&61440)===40960,size:u}),a+=46+p+f+g}return c}function nC(e){if(e.length>zF)return{ok:!1,problems:[{check:hr,problem:`the zip is ${(e.length/1024/1024).toFixed(1)} MB, and the limit is 25 MB. Leave out node_modules, build output and large media.`}]};let t=FF(e);if(!t)return{ok:!1,problems:[{check:hr,problem:"the upload is not a zip that can be read. Publish it with gamestage org starter publish <folder>."}]};let o=[],r=t.filter(d=>!d.folder);r.length>jF&&o.push({check:hr,problem:`it holds ${r.length.toLocaleString("en-GB")} files, and the limit is 2,000. Leave out node_modules and build output.`});let n=r.reduce((d,l)=>d+l.size,0);n>DF&&o.push({check:hr,problem:`it unpacks to ${Math.ceil(n/1024/1024)} MB, and the limit is 100 MB.`});let a=t.filter(d=>d.symlink).map(d=>d.name);a.length&&o.push({check:hr,problem:`it holds ${a.length===1?"a symbolic link":"symbolic links"} (${a.slice(0,5).join(", ")}). Replace each with the file it points to.`});let i=t.flatMap(d=>{let l=tC(d.name.replace(/\/$/,""));return l?[`${d.name} ${l}`]:[]});if(i.length&&o.push({check:hr,problem:`a path would land outside the folder: ${i.slice(0,5).join("; ")}.`}),o.length)return{ok:!1,problems:o};let c;try{c=eC(e,{filter:d=>!d.name.endsWith("/")})}catch{return{ok:!1,problems:[{check:hr,problem:"the zip is damaged and could not be unpacked. Publish it again."}]}}return{ok:!0,files:new Map(Object.entries(c))}}var Ta,zF,jF,DF,CK,IK,hr,OK,Yw=_(()=>{"use strict";je();qw();ou();ms();jd();Hw();Ta="gamestage-starter.json",zF=25*1024*1024,jF=2e3,DF=100*1024*1024,CK=s.object({name:s.string(),version:s.string(),description:s.string().min(1).max(280),framework:s.string().min(1).max(40),build:s.string().min(1).max(200).optional(),out:s.string().min(1).max(200).refine(e=>!tC(e),"must be a folder inside the starter, such as dist").optional()}),IK=s.object({version:s.string(),bytes:s.number().int().positive()});hr="size and paths";OK=2*1024*1024});function oC(e,t="USD"){let o=t==="USD"?"$":`${t} `;return e===0?`${o}0.00`:e<1e-4?`under ${o}0.0001`:e<.01?`${o}${e.toFixed(4)}`:`${o}${e.toFixed(2)}`}function rC(e){let t=e.currency==="USD"?"$":`${e.currency} `,o=`${t}${e.inputPerMTok} per million input tokens`,r=e.outputPerMTok?`${t}${e.outputPerMTok} per million output tokens`:"output free";return`${o}, ${r}`}var Vw=_(()=>{"use strict"});var Kw=_(()=>{"use strict"});function aC(e){return e==="requested"||e==="with_monterosa"||e==="with_partner"}function lu(e){if(!e||typeof e!="object")return null;let t=WF.safeParse(e);return t.success?t.data:null}function Zw(e){let t=e&&typeof e=="object"?e:{};return{request:lu(t.request),...typeof t.refused=="string"?{refused:t.refused}:{},...typeof t.code=="string"?{code:t.code}:{},...t.products==="on"||t.products==="off"||t.products==="not_set_up"?{products:t.products}:{}}}function du(e){if(!e)return{headline:"Not requested.",next:"You can ask for partner products on your result screen. Using them is subject to approval by Monterosa and the retail partner, and to commercial terms agreed with Monterosa."};switch(e.state){case"requested":return{headline:"Requested. Waiting for Monterosa to pick it up.",next:"Monterosa reads your answers, then takes the request to the retail partner. You can still change your answers until then."};case"with_monterosa":return{headline:"With Monterosa.",next:"Monterosa is checking your answers and may email you with questions before taking the request to the retail partner."};case"with_partner":return{headline:"With the retail partner.",next:"The retail partner decides where its products appear. Monterosa tells you when they answer, and agrees commercial terms with you before anything goes live."};case"approved":return{headline:"Approved. Products are switched on for this game.",next:"Fans who win or finish without losing see up to three partner products on the result screen. Use is subject to the commercial terms agreed with Monterosa."};case"declined":return{headline:`Declined.${e.reason?` ${e.reason.replace(/\.?$/,".")}`:""}`,next:"Products stay off for this game. If something has changed, you can ask again."};case"not_wanted":return{headline:"You said you do not want products in this game.",next:"Nobody will ask again. If you change your mind, request them from this page or with `gamestage ads request`."}}}function Jw(e){let t=e.filter(n=>n.state!=="not_wanted"),o=t.filter(n=>aC(n.state)).sort((n,a)=>n.requestedAt.localeCompare(a.requestedAt)),r=t.filter(n=>!aC(n.state)).sort((n,a)=>a.updatedAt.localeCompare(n.updatedAt));return[...o,...r]}var UF,iC,GF,zK,sC,BF,qF,WF,HF,uu=_(()=>{"use strict";je();UF=["requested","with_monterosa","with_partner","approved","declined","not_wanted"],iC=s.enum(UF),GF=["requested","with_monterosa","with_partner","approved","declined"],zK=s.enum(GF);sC=s.object({audience:s.string().trim().min(1,"Say who the game is for.").max(500),wherePlayed:s.string().trim().min(1,"Say where the game is played.").max(500),countries:s.string().trim().min(1,"Say which countries its fans are in.").max(300),prize:s.boolean(),note:s.string().trim().max(1e3).nullable().default(null)}),BF=s.object({kind:s.enum(["creator","operator"]),id:s.string(),email:s.string().nullable().default(null)}),qF=s.object({state:iC,at:s.string(),by:BF,reason:s.string().nullable().default(null)}),WF=s.object({gameId:s.string(),workspaceId:s.string(),gameName:s.string().nullable().default(null),ownerEmail:s.string().nullable().default(null),facts:sC.nullable().default(null),state:iC,reason:s.string().nullable().default(null),requestedAt:s.string(),updatedAt:s.string(),history:s.array(qF).default([])});HF=s.union([s.object({wanted:s.literal(!0).default(!0),facts:sC}),s.object({wanted:s.literal(!1)})])});var VF,cC,KF,mu,GK,pu=_(()=>{"use strict";je();_t();Hd();VF=12,cC=12,KF=["espn"],mu=e=>KF.includes(e),GK=s.object({workspace:s.string().min(1),name:s.string().min(1),supplier:s.string().min(1),request:s.object({league:s.string(),season:s.number().int().optional(),measures:s.array(s.string()).min(1)}),refreshHours:s.number().int().positive().default(VF),override:s.object({refreshHours:s.number().int().positive(),by:s.string(),at:s.string()}).optional(),disabled:s.boolean().default(!1),createdAt:s.string(),updatedAt:s.string(),by:s.string()})});var JF,ZK,Xw=_(()=>{"use strict";je();xa();_t();pu();JF=s.enum(["game.deleted","operator.request","workspace.closed"]),ZK=s.object({kind:s.enum(["engine","workspace"]),target:s.string(),workspaceId:s.string(),gameId:s.string().nullable(),reason:JF,requestedAt:s.string(),dueBy:s.string(),completedAt:s.string().nullable(),attempts:s.number().int(),lastError:s.string().nullable(),deleted:s.number().int(),engine:s.enum(["gamestage","arcade"]).optional()})});function e6(e){return`slate-${e+1}`}function fu(e){return{archetype:"push",theme:e.theme??"",prompt:e.prompt??"",target:e.target,targetLabel:e.targetLabel??"",unit:e.unit??"",slates:e.slates.map((t,o)=>({id:e6(o),label:t.label??"",entries:t.entries.map(r=>({key:r.key,label:r.label??""}))}))}}var XF,QF,Qw,Jn=_(()=>{"use strict";je();Ct();XF=s.object({key:s.string().min(1),label:s.string().default(""),note:s.string().optional()}),QF=s.object({id:s.string().min(1),label:s.string().default(""),entries:s.array(XF).min(1)}),Qw=s.object({archetype:s.literal("push"),measure:s.string().min(1).optional(),theme:s.string().default(""),prompt:s.string().default(""),target:s.number().int().positive().optional(),targetLabel:s.string().default(""),unit:s.string().max(4).default(""),slates:s.array(QF).min(1)})});function Cs(e){return Yn(e,"draws_allowed")}var ev,tv=_(()=>{"use strict";sn();ev=[{key:"round_solution",label:"The phrase",type:"freetext",description:'The word or phrase a fan solves, e.g. "George Russell". A fan sees one tile per letter, grouped by word, with "What a fan is told" as the hint. Accents and punctuation are kept for the reveal and ignored when marking. Leave it empty for an ordinary board. Never shown to a fan. This is the answer, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which draws letters from it and marks a solve against it.",section:"This round",public:!1},{key:"round_draws",label:"Letters a fan draws",type:"number",description:'With "The phrase": how many letters a fan may draw before they must have solved it. Leave it empty for 3.',readBy:"The Engine.",section:"This round"},{key:"round_draw_order",label:"Order of the letters",type:"list",options:[{name:"The same for every fan",value:"seeded"},{name:"Different for each fan",value:"random"}],default:"seeded",description:'With "The phrase": the same order gives every fan the same letters in the same order, so results compare and can be shared without a spoiler. A different order per fan makes each play its own.',readBy:"The Engine.",section:"This round"}]});function Is(e){return Yn(e,"guesses_allowed")}var dC,uC,mC,pC,hC,fC,nv,gu=_(()=>{"use strict";sn();dC="round_guess_answer",uC="round_guess_count",mC="round_guess_feedback",pC="round_guess_words",hC="round_guess_clues",fC="round_guess_picture",nv=[{key:dC,label:"The answer",type:"freetext",description:'The word or number a fan guesses, e.g. "ALLOY" or "1966". A whole number makes it a number round, where a fan is told higher or lower; anything else is a word, where a fan sees one tile per letter. Case and accents are ignored when marking. Leave it empty for an ordinary board. Never shown to a fan before they finish. This is the answer, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which marks every guess against it.",section:"This round",public:!1},{key:uC,label:"Guesses a fan gets",type:"number",description:'With "The answer": how many guesses a fan gets, from 1 to 20. A skip spends one. Leave it empty for 6.',readBy:"The Engine.",section:"This round"},{key:mC,label:"What a fan is told after each guess",type:"list",options:[{name:"Each letter's colour (words)",value:"letters"},{name:"Higher or lower (numbers)",value:"higher_lower"},{name:"Only right or wrong",value:"none"}],description:'With "The answer": leave it empty for letter colours on a word and higher or lower on a number.',readBy:"The Engine.",section:"This round"},{key:pC,label:"Accept only real words",type:"list",options:[{name:"Any letters",value:"any"},{name:"Real words only",value:"words"}],default:"any",description:'With a word in "The answer": "Real words only" refuses a guess that is not an English word, without spending it. Works for answers of 4 to 7 letters.',readBy:"The Engine.",section:"This round"},{key:hC,label:"Clues",type:"freetext",description:'With "The answer": one clue per line, or separated by "|". A fan sees the next clue after each wrong guess or skip, in order. Never shown to a fan before they earn it, so it is withheld from the feeds a browser reads.',readBy:"The Engine, which hands each clue to the fan who earned it.",section:"This round",public:!1},{key:fC,label:"Picture",type:"image",description:'With "The answer": a picture a fan guesses from, such as a photograph for guess the year. Shown to every fan from the start, so pick one that does not give the answer away on its own. Leave it empty for none.',readBy:"The game's page, which shows it above the guess.",section:"This round"}]});var t6,n6,o6,ov,yu=_(()=>{"use strict";Ct();t6="hunt_points_by_turn",n6="hunt_points_for_playing",o6="hunt_points_for_correct",ov=[{key:t6,label:"Points by turn",type:"freetext",description:'Points for a correct answer on the first turn, the second, and so on, separated by commas, e.g. "10, 6, 3". A turn is a letter drawn in a solve-the-phrase game, or a guess in a guess game. A correct answer after more turns than you list earns nothing from this box. Leave every points box empty to score the turns left plus one.',readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"},{key:n6,label:"Points for playing",type:"number",description:"Points every fan earns for finishing a round, won or lost. Leave it empty for none.",readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"},{key:o6,label:"Points for a correct answer",type:"number",description:'A flat amount for a correct answer, on top of "Points by turn". Use this alone to give every winner the same. Leave it empty for none.',readBy:"The control plane, which writes it onto each round for the Engine to score.",section:"Points"}]});function yC(e){return e.includes(gC)}var r6,gC,rv,bu=_(()=>{"use strict";Ct();r6="push_compare",gC="each_at_least_last",rv=[{key:r6,label:"How picks are judged",type:"list",options:[{name:"Add up: going over the target is out",value:"total"},{name:"Chain: each pick at least the last",value:gC}],default:"total",description:"Add up: a fan's picks are added together and going over the round's target ends the round. Chain: each pick must be worth at least as much as the one before it, the first lower pick ends the round, and the score is how many picks held. A chain round has no target, so leave each round's target empty.",readBy:"The control plane, which writes it onto each round for the Engine to mark.",section:"Rules"}]});function u6(e){let t=Cs(e),o=Is(e);return d6.filter(r=>c6.has(r)?t:l6.has(r)?o:Yn(e,r))}function m6(e){return[...Cs(e)||Is(e)?i6:[],...yC(e)?s6:[]]}function vC(e){return[...Rd(e),...u6(e),...m6(e)]}var bC,a6,av,wC,i6,s6,c6,l6,d6,wu=_(()=>{"use strict";sn();tv();gu();yu();bu();bC="products_about",a6={key:bC,label:"Products about",type:"list",options:[{name:"The answer",value:"answer"},{name:"What the answer belongs to",value:"parent"},{name:"The game's theme",value:"theme"},{name:"No products",value:"none"}],default:"answer",description:`What the shop products shown after a win are about. Usually the answer itself. If the question makes the answer look bad, so that selling it would be a dig, choose what it belongs to, the game's theme, or no products. For example, after "Who is the player that's not yet scored?" offer his club or the league rather than his shirt; after "Which character never wins an argument?" offer the film rather than that character. The theme is the game's "Shop theme" setting.`,readBy:"The game's own page, which asks the shop for products about it after a win or a neutral result.",section:"This round"},av={hunt:[a6,...ev,...nv]},wC={hunt:ov,push:rv},i6=new Set(ov.map(e=>e.key)),s6=rv.map(e=>e.key),c6=new Set(ev.map(e=>e.key)),l6=new Set(nv.map(e=>e.key)),d6=[...new Set(Object.values(av).flatMap(e=>(e??[]).map(t=>t.key)))]});var _C,p6,xZ,Os=_(()=>{"use strict";je();Kt();Jn();Ct();wu();gu();_C=Cd.safeExtend({answerMeasure:s.string().min(1).optional(),answerRule:rs.optional()}),p6=s.discriminatedUnion("archetype",[Qw,_C,wb,Id]),xZ=s.object({name:s.string().regex(/^\d{4}-\d{2}-\d{2}$/,"A day is named by its date, e.g. 2026-11-01."),dayStart:s.number().int(),dayEnd:s.number().int(),round:p6,overwrite:s.boolean().optional()}).refine(e=>e.dayEnd>e.dayStart,"A day must end after it starts.")});var iv,IZ,sv=_(()=>{"use strict";je();_t();Jn();Os();Kt();iv=s.object({count:s.number().int().min(1).max(80),measure:s.string().trim().min(1).optional(),position:s.string().trim().min(1).optional(),team:s.string().trim().min(1).optional(),layout:s.enum(["grid","pitch","xi"]).optional(),dataset:s.string().trim().regex(/^[A-Za-z0-9][A-Za-z0-9._\/-]*\.json$/,"A dataset name, e.g. sportmonks/premier-league-lineups.json").optional(),prompt:s.string().trim().min(1).max(200).optional()}),IZ=s.object({measure:s.string().min(1),rule:rs,prompt:s.string().trim().min(1)})});var vu=_(()=>{"use strict";Kt();Ct();ns()});var ku=_(()=>{"use strict"});var cv,lv=_(()=>{"use strict";Io();_t();sv();Vt();Jn();Os();vu();sn();ku();Ct();cv="Studio rounds:"});var g6,TC,y6,dJ,EC,uJ,mJ,pJ,dv=_(()=>{"use strict";je();_t();g6=s.enum(["push","pull"]),TC=s.object({workspaceId:s.string().min(1),name:s.string().min(1),key:s.string().min(1),digest:s.string().regex(/^[0-9a-f]{16}$/),measures:s.array(s.string()).default([]),counts:s.record(s.string(),s.number().int().nonnegative()).default({}),scored:s.array(s.string()).optional(),bytes:s.number().int().nonnegative().default(0),origin:g6.default("push"),supplier:s.string().optional(),publishedAt:s.string().nullable().default(null),checkedAt:s.string().nullable().default(null),failing:s.boolean().default(!1),counted:s.boolean().default(!1)}),y6=s.object({gameId:s.string().min(1),gameName:s.string().default(""),pinnedDigest:s.string().nullable().default(null),stale:s.boolean().default(!1),roundIds:s.array(s.string()).default([])}),dJ=s.object({dataset:TC,usedBy:s.array(y6).default([])}),EC=s.enum(["pushed","pulled","joined","refused","failed"]),uJ=s.object({at:s.string(),event:EC,dataset:s.string().min(1),digest:s.string().nullable().default(null),gameId:s.string().nullable().default(null),gameName:s.string().nullable().default(null),roundId:s.string().nullable().default(null),message:s.string().default(""),ok:s.boolean().default(!0)}),mJ=s.object({dataset:s.string().optional(),gameId:s.string().optional(),event:s.array(EC).optional(),since:s.string().optional(),search:s.string().optional(),before:s.string().optional(),limit:s.number().int().positive().max(500).default(100)}),pJ=s.object({datasets:s.array(TC).default([]),unavailable:s.string().nullable().default(null)})});var Ps=_(()=>{"use strict";Ct();Kt()});var uv=_(()=>{"use strict";Jn();Ct()});var mv=_(()=>{"use strict"});var _u=_(()=>{"use strict";Jn();Ct()});var pv=_(()=>{"use strict"});var xu=_(()=>{"use strict";Ps();_t();Jn();uv();vu();mv();Ct();as();_u();pv();Jn();Kt();Vt();ku();yu();bu();Os()});function hv(e){return AC+e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function IC(e){if(e.startsWith(AC)){for(let[t,o]of Object.entries(CC))if(o.some(r=>hv(r)===e))return t}}function fv(e){let o=Object.values(CC).flat().map(hv).indexOf(e);return o===-1?void 0:o}var AC,CC,Su,gv=_(()=>{"use strict";AC="label_taster_",CC={"Taster: ringers":["huntFoundLabel","huntFoundState","huntRuledOutState","huntSelectedState","huntChooseLabel","huntNameOne","huntNameMany","huntChecking","huntSelection","huntRules","huntLimits","huntMistakesLeft","huntFeedback","huntRetry","huntAnswers","huntWon","huntFinished","huntRecap","huntBoardPending","huntNextFailed","huntTimed","huntFinishedAction","huntReviewLabel"],"Taster: board and buttons":["playPrompt","attemptsLabel","mistakesLabel","pickedLabel","scoreLabel","timeLeftLabel","timeUpLabel","nextRoundLabel","oneAwayLabel","runningLabel","spentLabel","underNote","bustFallback","restartLabel","playAnotherLabel","playAnotherBusyLabel","questionCountLabel","yourCallLabel"],"Taster: result and leaderboard":["wonLabel","finishedLabel","pendingLabel","pendingNote","rankLabel","rankUnavailable","rewardLabel","anonymousLabel","derivedNameLabel","boardLabel","boardLoading","boardEmpty","rankedBy","closeLabel"],"Taster: when a play is refused":["refused","refusedClosed","refusedFinished","refusedNoTries","refusedTooManyWrong","refusedNoPicks","refusedIncomplete","refusedOneAtATime","refusedMoved","roundLockedLabel","roundLockedNextLabel","unavailable"],"Taster: loading":["loading","loadingTakingTooLong","loadingReload","loadingConnecting","loadingLookingUp","loadingKits","loadingOpening","loadingStarting","loadingSettings","loadingRound","loadingState","loadingFailedAt","loadingProgressLabel"],"Taster: navigation and page":["eyebrow","tabHome","tabPlay","tabHow","tabsLabel","moreLabel","homeTitle","homeHere","howToPlay","backLabel","footNote","footLink"],"Taster: proofs and the notify demo":["proofsHeading","proofsBlurb","lookLabel","changeLabel","duplicateLabel","busyLabel","payloadNote","needsPlay","notCapped","notifyTitle","notifyMockNote","notifyFieldLabel","notifySubmit","notifyDone"],"Taster: bingo":["bingoDealLabel","bingoDealingLabel","bingoWhichLabel","bingoFlipHint","bingoPreviousLabel","bingoNextLabel","bingoWatchingLabel","bingoOneAwayLabel","bingoLineLabel","bingoCalledLabel","bingoFreeLabel","bingoChooseNote","bingoWatchNote","bingoResultNote","bingoHitLabel","bingoMissLabel","bingoDetailsLabel"],"Taster: penalties":["shootOptionsLabel","shootReplayLabel","shootInstruction","shootPitchLabel","shootRetryLabel","shootGoalLabel","shootSavedLabel","shootWideLabel","shootOverLabel","shootFrameLabel","shootGoalsLabel","shootGoalsTally","shootAimLabel","shootPowerLabel","shootPlacedLabel","shootFirmLabel","shootFullLabel","shootZoneTopLeft","shootZoneTopCentre","shootZoneTopRight","shootZoneLowLeft","shootZoneLowCentre","shootZoneLowRight"],"Taster: shop":["shopHeading","shopBadge","shopDisclosure","shopButton","shopLinkDescription","shopCompetition"]};Su=["tabHow","boardLabel","closeLabel","playAnotherLabel","restartLabel","backLabel"].map(e=>hv(e))});function $6(e){let t=new Map,o=new Map,r=n=>{for(let a of n)if(a.type==="list"&&o.set(a.key,a),a.type==="collection"){let i=t.get(a.key);if(i&&(i.itemLabel!==a.itemLabel||JSON.stringify(i.fieldset??[])!==JSON.stringify(a.fieldset??[])))throw new Error(`The collection "${a.key}" is declared with two different shapes. One key is one declaration; its fieldset and item label must match wherever it appears.`);t.set(a.key,a),r(a.fieldset??[])}};return r(e),[...S6,...Tb.map(E6),...[...t.values()].map(T6),...[...o.values()].map(x6)]}function Eu(e){let t=[];for(let o of e){let r=o.public===!1,n={label:o.label,key:o.key,field:RC(o),description:o.description,...o.type==="collection"?{}:{mandatory:o.required===!0},...r?{public:!1,cloneable:!1}:{},...o.default!==void 0?{default:o.default}:{}},a=t.find(i=>i.name===o.section);if(a||(a={name:o.section},t.push(a)),o.subsection){let i=a.subsections??=[],c=i.find(d=>d.name===o.subsection);c||(c={name:o.subsection,...o.subsectionDescription?{description:o.subsectionDescription}:{},properties:[]},i.push(c)),c.properties.push(n)}else(a.properties??=[]).push(n)}return t}function A6(e){let t=e.archetypes.map(De);for(let l of t)if(!OC[l])throw new Error(`No Studio element name for the ${l} archetype. Add one to ARCHETYPE_ELEMENT_NAMES rather than letting Studio show a blank type.`);let o=l=>`${e.urls.baseAppsUrl}/${l}`,r=l=>{if(!e.roundFields)return;let u=zd(l,e.roundFields);return u.ok?u.fields:void 0},n=new Map((t.length===1?r(t[0])??[]:[]).map(l=>[l.key,l])),a=l=>n.get(l.key)??l,i=new Set(e.wording??_b),c=l=>(av[De(l)]??[]).filter(u=>e.wording===void 0||e.wording.includes(u.key)),d=[...ss.filter(l=>!_b.includes(l.key)||i.has(l.key)),...kE,...[...i].filter(l=>l.startsWith(xo)).sort(C6).map(I6),...[...new Set(t)].flatMap(l=>Eb[l]??[]),...[...new Set(t)].flatMap(l=>(wC[l]??[]).filter(u=>e.wording===void 0||e.wording.includes(u.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:o("elements.json"),fields:o("fields.json"),project_settings:o("project_settings.json"),event_settings:o("event_settings.json"),schedule:!0,analytics:!0,live_activity:!0,localisation:!1,services:{"lvis-id-custom-tab":{}}},"elements.json":[...t.map(l=>({name:OC[l],content_type:PC(l),derived_from:Tu[l]?.derivedFrom??"data",duration:Tu[l]?.duration??{mode:"instant"},label:Tu[l]?.derivedFrom==="prediction"?"{{question.text}}":"{{element.title}}",custom_fields:Eu(r(l)?[...r(l),...c(l)]:[...hd.includes(De(l))?So.filter(u=>u.key==="title"):So,...cs[De(l)]??[],...c(l)]),...Tu[l]?.derivedFrom==="prediction"?{label_question:l==="bingo"?"Card":"Question",label_option:l==="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"}]}:{}})),...t.some(l=>De(l)==="predict")?[{...Zi.scoreline,fields:Ab,titleHelp:"How this match is listed on the timeline, so you can tell the matches apart. For example: Arsenal v Chelsea. Fans do not see it."},{...Zi.number,fields:Cb,titleHelp:"How this question is listed on the timeline. For example: First goal minute. Fans do not see it."}].map(l=>({name:l.name,content_type:l.contentType,derived_from:"data",duration:{mode:"fixed",default:604800},label:"{{element.title}}",custom_fields:Eu([...So.filter(u=>u.key==="title").map(u=>({...u,label:"Name on the timeline",description:l.titleHelp})),...l.fields])})):[]],"fields.json":$6([...d,...xb,...So.map(a),...Object.values(cs).flat().map(a),...Object.values(Ib).flat(),...Tb,...Ab,...Cb,...t.flatMap(c)]),"project_settings.json":{sections:Eu(d)},"event_settings.json":{sections:Eu([...xb,...e.live?LE:[],...t.flatMap(l=>Ib[l]??[])])}}}function C6(e,t){let o=fv(e),r=fv(t);return o===void 0&&r===void 0?e<t?-1:e>t?1:0:o===void 0?-1:r===void 0?1:o-r}function I6(e){let t=ME(e),o=IC(e);if(!o)return t;let r=e.slice(13).replace(/_/g," ").trim();return{...t,label:r.charAt(0).toUpperCase()+r.slice(1),subsection:o,...Su.includes(e)?{required:!0}:{}}}function NC(e){return A6({name:e.gameName,id:e.gameId,wording:e.wording??[],version:`0.0.${e.manifestRevision}`,archetypes:[e.archetype],urls:e.urls,live:e.live??!1,...e.roundFields?{roundFields:e.roundFields}:{}})}var OC,PC,Tu,RC,x6,S6,T6,E6,yv=_(()=>{"use strict";sn();$d();us();wu();gv();Vt();OC=oE,PC=e=>{let t=De(e);return rb[t]??`gamestage-${t.replaceAll("_","-")}-element`},Tu={hunt:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},push:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},group:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},place:{derivedFrom:"data",duration:{mode:"fixed",default:86400}},predict:{derivedFrom:"prediction",duration:{mode:"flexible"}},bingo:{derivedFrom:"prediction",duration:{mode:"flexible"}},shoot:{derivedFrom:"data",duration:{mode:"fixed",default:86400}}},RC=e=>e.type==="collection"||e.type==="list"?e.key:e.type,x6=e=>({key:e.key,type:"list",data:(e.options??[]).map(t=>({name:t.name,value:t.value}))}),S6=[{key:"colour",type:"colour"},{key:"freetext",type:"freetext",localisable:!1},{key:"number",type:"number"},{key:"image",type:"image",width:[1,2e3],height:[1,2e3],file_size:500,localisable:!1},{key:"boolean",type:"boolean"},{key:"wysiwyg",type:"wysiwyg",localisable:!1},{key:"file",type:"file",localisable:!1}],T6=e=>({key:e.key,type:"collection",...e.itemLabel?{item_label:e.itemLabel}:{},fieldset:(e.fieldset??[]).map(t=>({label:t.label,key:t.key,field:RC(t),...t.description?{description:t.description}:{}}))}),E6=e=>({key:e.key,type:e.type,...e.type==="freetext"||e.type==="wysiwyg"||e.type==="image"?{localisable:!1}:{}})});var bv=_(()=>{"use strict";Vt()});var O6,yX,bX,wv=_(()=>{"use strict";je();O6=s.enum(["waiting-for-dns","issuing-certificate","live","not-pointing","failed"]),yX=s.object({hostname:s.string(),gameId:s.string(),status:O6,statusSince:s.string(),createdAt:s.string(),waitingSince:s.string(),liveAt:s.string().nullable().default(null),lastCheckedAt:s.string().nullable().default(null),lastSeen:s.string().nullable().default(null),reason:s.string().nullable().default(null),tenantId:s.string().nullable().default(null),verificationToken:s.string().nullable().default(null)}),bX=72*36e5});var LC=_(()=>{"use strict";eu();Iw();ou();Yw();Io();Vw();Vi();xa();Kw();uu();Xw();lv();ks();Kd();_t();pu();dv();Ps();xu();yv();bv();wv();gw();yw();Kt();xa()});function P6(e){try{return JSON.parse(e)}catch{return{}}}function R6(e,t){if(e.status>=500)return;let o=(e.headers.get("server")??"").toLowerCase(),r=(e.headers.get("content-type")??"").toLowerCase(),n=t.trimStart().slice(0,200).toLowerCase();if(o.includes("amazons3")||n.startsWith("<?xml")&&n.includes("<error>"))return"S3";if(r.includes("text/html")||n.startsWith("<!doctype html")||n.startsWith("<html"))return"a website";if(t.trim()!=="")try{JSON.parse(t);return}catch{return o.includes("cloudfront")?"CloudFront":"something other than an API"}}function DC(e){let t=1e3*2**(e-1),o=t*.2*(Math.random()*2-1);return Math.round(t+o)}function FC(e){let t=e.fetch??globalThis.fetch,o=e.maxAttempts??4,r=e.baseUrl.replace(/\/+$/,"");return async function(a,i,c={}){let d=globalThis.location?.origin,l=new URL(`${r}${i}`,r.startsWith("/")?d:void 0);for(let[p,f]of Object.entries(c.query??{}))if(Array.isArray(f))for(let g of f)l.searchParams.append(p,String(g));else f!=null&&l.searchParams.set(p,String(f));let u;for(let p=1;p<=o;p++){c.signal?.throwIfAborted();let f=typeof e.token=="function"?await e.token():e.token,g;try{g=await t(l,{signal:c.signal,method:a,headers:{...e.headers,...e.workspace?{[LA]:e.workspace}:{},authorization:`Bearer ${f}`,...c.body===void 0?{}:{"content-type":"application/json"}},body:c.body===void 0?void 0:JSON.stringify(c.body)})}catch(F){c.signal?.throwIfAborted();let U=F instanceof Error?F.message:String(F);if(u=new qe(0,"unreachable",`Could not reach the control plane at ${r}: ${U}. Check your connection and run the command again.`,!0),p===o)break;await zC(DC(p));continue}let b=await g.text(),v=R6(g,b);if(v)throw new qe(g.status,$u,`${r} is not a Gamestage control plane (it answered like ${v}). Set GAMESTAGE_CONTROL_URL to the Space's API address.`,!1);if(g.ok)return b===""?void 0:JSON.parse(b);let x=P6(b);if(u=new qe(g.status,x.error?.code??"unknown",x.error?.message??g.statusText,x.error?.retryable??!1),!u.retryable||p===o)break;let R=Number(g.headers.get("retry-after"));await zC(Number.isFinite(R)&&R>0?R*1e3:DC(p))}throw u??new qe(0,"unknown","Request failed.",!1)}}function UC(e){let t=FC(e);return{listDomains:()=>t("GET","/v1/admin/domains").then(o=>o.domains??[]),checkDomain:o=>t("POST",`/v1/admin/domains/${encodeURIComponent(o)}/check`),setDatasetRefresh:(o,r,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/datasets/${encodeURIComponent(r)}/refresh`,{body:{hours:n}}),setWorkspaceAccess:(o,r,n,a)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/access`,{body:{access:r,reason:n??null,...a?.allowPersonalEmail?{allowPersonalEmail:!0}:{}}}),async listAccess(){let o=await t("GET","/v1/admin/access"),r=[...o.waiting??[],...o.decided??[]].filter(n=>typeof n=="object"&&n!==null).map(AA);return CA(r)},getWorkspace:o=>t("GET",`/v1/admin/workspaces/${encodeURIComponent(o)}`),setWorkspacePlan:(o,r,n)=>t("PUT",`/v1/admin/workspaces/${encodeURIComponent(o)}/plan`,{body:{tier:r,...n===void 0?{}:{liveGameAllowance:n}}}),runCreatorSync:()=>t("POST","/v1/admin/creator-sync"),eraseGame:o=>t("POST",`/v1/admin/games/${encodeURIComponent(o)}/erasure`),closeWorkspace:o=>t("POST",`/v1/admin/workspaces/${encodeURIComponent(o)}/close`),listErasures:()=>t("GET","/v1/admin/erasures").then(o=>o.erasures??[]),getAds:()=>t("GET","/v1/admin/ads"),setAdsConfig:o=>t("PUT","/v1/admin/ads/config",{body:o}),setAdsGame:(o,r)=>t("PUT",`/v1/admin/ads/games/${encodeURIComponent(o)}`,{body:r}),addAdsBlock:(o,r)=>t("POST",`/v1/admin/ads/blocklists/${o}`,{body:r}),removeAdsBlock:(o,r)=>t("POST",`/v1/admin/ads/blocklists/${o}/remove`,{body:{value:r}}),previewAds:o=>t("GET","/v1/admin/ads/preview",{query:{country:o.country,moment:o.moment,club:o.club||void 0,subject:o.subjects?.length?o.subjects.map(r=>`${r.type}:${r.name}`):void 0,game:o.gameId||void 0}}),listAdsRequests:()=>t("GET","/v1/admin/ads/requests").then(o=>Jw((o?.requests??[]).map(lu).filter(r=>r!==null))),moveAdsRequest:(o,r,n)=>t("PUT",`/v1/admin/ads/requests/${encodeURIComponent(o)}`,{body:{state:r,reason:n}}).then(Zw),adsProducts:o=>t("GET","/v1/admin/ads/products",{query:{catalogue:o.catalogue,subject:`${o.subject.type}:${o.subject.name}`}}),adsCriteria:()=>t("GET","/v1/admin/ads/criteria"),sponsorUsage:o=>t("GET","/v1/admin/sponsors",o?{query:{month:o}}:void 0)}}function On(e){let t=FC(e),o=["meters","rounds","history","destinations","sections","issues"],r=i=>{let c={...i,containerLabel:i.containerLabel??"Round"};for(let d of o)Array.isArray(c[d])||(c[d]=[]);return c},n=i=>({...i,access:Xd(i),terms:i.terms??null,games:(i.games??[]).map(r),gamesTotal:i.gamesTotal??(i.games??[]).length,archivedTotal:i.archivedTotal??(i.games??[]).filter(c=>c.state==="archived").length}),a=i=>({...i,workspace:{...i.workspace,access:Xd(i.workspace??{}),games:(i.workspace?.games??[]).map(r)}});return{getWorkspace:async()=>n(await t("GET","/v1/workspace")),getWorkspaceSummary:async()=>{try{return n(await t("GET","/v1/workspace/summary"))}catch(i){if(!(i instanceof qe)||i.status!==404)throw i;return jC||(jC=!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 i=>a(await t("PUT","/v1/workspace/github",{body:{login:i}})),acceptTerms:async i=>a(await t("PUT","/v1/workspace/terms",{body:{version:i}})),setPlan:async i=>a(await t("PUT","/v1/workspace/plan",{body:{tier:i}})),uploadTarget:(i,c,d)=>t("POST",`/v1/games/${encodeURIComponent(i)}/uploads`,{body:d?{filename:c,deployId:d}:{filename:c}}),setPresetArt:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/art/preset`,{body:{preset:c}}),artUploadTarget:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/art/uploads`,{body:{content_type:c}}),setUploadedArt:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/art`,{body:{url:c}}),getDomain:i=>t("GET",`/v1/games/${encodeURIComponent(i)}/domain`),addDomain:(i,c,d)=>t("POST",`/v1/games/${encodeURIComponent(i)}/domain`,{body:{hostname:c,move:d?.move??!1}}),checkDomain:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/domain/check`),removeDomain:i=>t("DELETE",`/v1/games/${encodeURIComponent(i)}/domain`),getAdsRequest:i=>t("GET",`/v1/games/${encodeURIComponent(i)}/ads-request`).then(c=>lu(c?.request)),requestAds:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/ads-request`,{body:c}).then(Zw),referenceUploadTarget:(i,c)=>t("POST","/v1/reference/uploads",{body:{name:i,digest:c}}),listMembers:async()=>(await t("GET","/v1/workspace/members")).members??[],inviteMember:async i=>(await t("POST","/v1/workspace/members",{body:{email:i}})).member,removeMember:i=>t("DELETE",`/v1/workspace/members/${encodeURIComponent(i)}`),listMyWorkspaces:async()=>(await t("GET","/v1/workspaces")).workspaces??[],listDesignSystems:async()=>(await t("GET","/v1/design-systems")).designSystems??[],publishDesignSystem:(i,c)=>t("POST",`/v1/design-systems/${encodeURIComponent(i)}/versions`,{body:c}),designSystemVersion:async(i,c)=>(await t("GET",`/v1/design-systems/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}`)).designSystem,async orgProfile(){try{return(await t("GET","/v1/org/profile")).profile}catch(i){if(i instanceof qe&&i.status===404&&i.code==="no_org")return null;throw i}},async orgContext(){try{return(await t("GET","/v1/org/context")).context}catch(i){if(i instanceof qe&&i.status===404&&i.code==="no_context")return null;throw i}},async orgProfileForOperator(){try{return(await t("GET","/v1/org/profile/operator")).profile}catch(i){if(i instanceof qe&&(i.status===403||i.status===404))return null;throw i}},orgContextHistory:async()=>(await t("GET","/v1/org/context/history")).revisions??[],setOrgContext:async i=>(await t("PUT","/v1/org/context",{body:{markdown:i}})).revision,orgStarters:async()=>(await t("GET","/v1/org/starters")).starters??[],startOrgStarterUpload:async(i,c)=>(await t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions`,{body:c})).upload,confirmOrgStarter:async(i,c)=>(await t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}/confirm`)).starter,scaffoldOrgStarter:(i,c)=>t("POST",`/v1/org/starters/${encodeURIComponent(i)}/versions/${encodeURIComponent(c)}/scaffold`),pruneBundle:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/bundle`,{body:{filenames:c}}),bundleFiles:async i=>(await t("GET",`/v1/games/${encodeURIComponent(i)}/files`)).files??[],async getGame(i){try{return r(await t("GET",`/v1/games/${encodeURIComponent(i)}`))}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},setAwake:(i,c)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/state`,{body:{awake:c}}),setDestination:(i,c,d)=>t("PUT",`/v1/games/${encodeURIComponent(i)}/destinations`,{body:{destination_id:c,enabled:d}}),registerGame:i=>t("POST","/v1/games",{body:i}),archiveGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/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:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/graphics`,{body:c}),removeGraphic:(i,c)=>t("DELETE",`/v1/games/${encodeURIComponent(i)}/graphics/${encodeURIComponent(c)}`),promoteGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/promote`),withdrawGame:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/withdraw`),deleteGame:i=>t("DELETE",`/v1/games/${encodeURIComponent(i)}`),deploy:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/deploy`,{body:c}),refreshRound:i=>t("POST",`/v1/games/${encodeURIComponent(i)}/round/refresh`),async practiceRound(i,c){try{return await t("POST",`/v1/games/${encodeURIComponent(i)}/practice`,{body:{round:c}})}catch(d){throw d instanceof qe&&d.status===404&&!/no such game|no game with id/i.test(d.message)?new qe(404,"not_supported","This control plane cannot serve a practice round yet. It is running a build older than this CLI. Update the CLI's backend, or use an older CLI until it is.",!1):d}},async previewPracticeRound(i,c){try{return await t("POST","/v1/preview/practice",{body:{game:i,round:c}})}catch(d){throw d instanceof qe&&d.status===404&&/unknown resource/i.test(d.message)?new qe(404,"not_supported","This control plane cannot serve a preview round yet. It is running a build older than the connector.",!1):d}},roundSeedCandidates:(i,c)=>t("POST",`/v1/games/${encodeURIComponent(i)}/round/candidates`,{body:c}),async seedSeasonDay(i,c){try{return await t("PUT",`/v1/games/${encodeURIComponent(i)}/season/${encodeURIComponent(c.name)}`,{body:{dayStart:c.dayStart,dayEnd:c.dayEnd,round:c.round,...c.overwrite?{overwrite:!0}:{}}})}catch(d){throw d instanceof qe&&d.status===404&&!/no such game|no game with id/i.test(d.message)?new qe(404,"not_supported","This control plane cannot take a season yet. It is running a build older than this CLI.",!1):d}},async seedRound(i,c,d){try{return await t("PUT",`/v1/games/${encodeURIComponent(i)}/round`,{body:{round:c,...d}})}catch(l){throw l instanceof qe&&l.status===404&&!/no such game|no game with id/i.test(l.message)?new qe(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):l}},setSignal:async i=>a(await t("PUT","/v1/workspace/signal",{body:{enabled:i}})),setWorkspaceProfile:i=>t("PUT","/v1/workspace/profile",{body:i}),async getEndpoints(i){try{return await t("GET",`/v1/games/${encodeURIComponent(i)}/endpoints`)}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async getGameUsage(i){try{return await t("GET",`/v1/games/${encodeURIComponent(i)}/usage`)}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async getLogs(i,c,d){let{lines:l}=await t("GET",`/v1/games/${encodeURIComponent(i)}/logs`,{query:c,signal:d});return l},async getAuditLog(i){let{records:c}=await t("GET","/v1/audit",{query:i});return c},listSourceDatasets:i=>t("GET",`/v1/sources/${encodeURIComponent(i)}/datasets`),switchOnSource:(i,c)=>t("POST",`/v1/sources/${encodeURIComponent(i)}/datasets`,{body:c}),switchOffSource:(i,c)=>t("DELETE",`/v1/sources/${encodeURIComponent(i)}/datasets/${encodeURIComponent(c)}`),async listDatasets(){try{let i=await t("GET","/v1/reference/datasets");return!i||!Array.isArray(i.datasets)?{datasets:[],unavailable:MC}:{datasets:i.datasets,unavailable:i.unavailable??null}}catch(i){if(i instanceof qe&&i.status===404)return{datasets:[],unavailable:MC};throw i}},async getDataset(i){try{let c=await t("GET",`/v1/reference/datasets/${encodeURIComponent(i)}`);return c?.dataset?c:void 0}catch(c){if(c instanceof qe&&c.status===404)return;throw c}},async previewDataset(i,c,d){try{let l=await t("GET",`/v1/reference/preview/${encodeURIComponent(i)}`,{query:{limit:c,by:d}});return l&&Array.isArray(l.rows)?l:void 0}catch(l){if(l instanceof qe&&l.status===404)return;throw l}},async getDataLog(i){try{let c=await t("GET","/v1/reference/log",{query:i});return Array.isArray(c?.lines)?c.lines:[]}catch(c){if(c instanceof qe&&c.status===404)return[];throw c}}}}var qe,$u,zC,jC,MC,GC=_(()=>{"use strict";eu();uu();xa();qe=class extends Error{status;code;retryable;constructor(t,o,r,n){super(r),this.status=t,this.code=o,this.retryable=n,this.name="ControlPlaneError"}},$u="not_a_control_plane";zC=e=>new Promise(t=>setTimeout(t,e)),jC=!1;MC="This control plane is running a build older than this screen, so it cannot list datasets yet."});function BC(e){return e?`npx gamestage@latest deploy ${e} --dir .`:"npx gamestage@latest deploy"}function Po(e,t){let o=vv.exec(e.trim()),r=vv.exec(t.trim());if(!o||!r)return null;for(let n=1;n<=3;n++){let a=Number(o[n])-Number(r[n]);if(a!==0)return a}return 0}function fr(e,t){if(!e)return{state:"unknown",current:t};let o=Po(e,t);return o===null?{state:"unknown",current:t}:o<0?{state:"behind",pinned:e,current:t}:o>0?{state:"ahead",pinned:e,current:t}:{state:"current",pinned:e,current:t}}function kv(e){let t=new Set;for(let o of e.matchAll(/\/client\/(\d+\.\d+\.\d+)\/gamestage\.js/g))t.add(o[1]);return[...t].sort((o,r)=>Po(o,r)??0)}function qC(e){let t=[...new Set(e)].filter(o=>vv.test(o));if(t.length!==0)return t.sort((o,r)=>Po(o,r)??0)[0]}function WC(e){return/^ \* Gamestage client (\d+\.\d+\.\d+)\.$/m.exec(e.slice(0,600))?.[1]}var vv,_v=_(()=>{"use strict";vv=/^(\d+)\.(\d+)\.(\d+)$/});var HC,Au,gr,YC=_(()=>{"use strict";_v();HC="x-gamestage-cli",Au="update_required",gr="npx gamestage@latest"});var VC=_(()=>{"use strict"});var KC=_(()=>{"use strict";Ps();_t();Ct()});function JC(e,t){let o=[];return e.points_per_second!==void 0&&o.push({kind:"rate_ceiling",pointsPerSecond:e.points_per_second}),e.score_max!==void 0&&o.push({kind:"score_max",max:e.score_max}),e.score_min!==void 0&&o.push({kind:"score_min",min:e.score_min}),e.min_run_ms!==void 0&&o.push({kind:"min_duration",ms:e.min_run_ms}),{checks:o,ranking:e.ranking,ties:t?"shared":"earlier_first",onBreach:"refuse",maxRunSeconds:e.max_run_seconds,maxRunsPerDay:e.max_runs_per_day??null,...e.rank_by==="total"?{rankBy:"total"}:{},...e.signed_scores?{signedScores:!0}:{}}}var yr,ZC,xv=_(()=>{"use strict";Io();sn();Ct();yr="The Arcade Engine is keeping this game's current rules until its live edition ends, because the rules a run is judged by change only between editions. The game plays on as before. The rules from your last deploy, and any edition added in Studio since, take effect once it ends.",ZC="The Arcade Engine holds this game"});var XC=_(()=>{"use strict";Vt();_u();xu();Kt()});function QC(e){if(typeof e!="string")return null;let t=/^([a-z][a-z0-9_-]*):([a-zA-Z0-9][a-zA-Z0-9._-]*)$/.exec(e);return t&&t[0]===e?{provider:t[1],id:t[2]}:null}var Cu=_(()=>{"use strict"});var e2=_(()=>{"use strict";Cu()});var t2,Bee,Sv,qee,n2=_(()=>{"use strict";je();Cu();t2=s.string().regex(/^sportmonks:[1-9]\d*$/).refine(e=>{let t=QC(e);return t!==null&&Number.isSafeInteger(Number(t.id))}),Bee=s.array(s.object({fixture:t2,games:s.array(s.object({gameId:s.string().min(1),editionId:s.string().min(1)})),addedAt:s.iso.datetime({offset:!0})})),Sv=s.object({home:s.number().int().nonnegative(),away:s.number().int().nonnegative()}),qee=s.object({fixture:t2,sport:s.literal("football"),status:s.enum(["scheduled","live","finished","void","postponed","unknown"]),statusName:s.string(),regulation:Sv.nullable(),currentScore:Sv.nullable().optional(),finalScore:Sv.nullable(),teams:s.object({home:s.string(),away:s.string()}).optional(),startingAt:s.string().nullable(),readAt:s.iso.datetime({offset:!0}),final:s.boolean(),finishedReads:s.number().int().min(0).max(2),finishedSince:s.iso.datetime({offset:!0}).nullable(),minute:s.number().nonnegative().nullable(),notifyPending:s.boolean()})});var Yee,o2=_(()=>{"use strict";je();Yee=s.object({org:s.string().min(1),game:s.string().min(1),player:s.string().min(1),alias:s.string().optional(),round:s.string().optional(),score:s.number(),outcome:s.string().optional(),at:s.string().min(1)})});function c2(e){return{type:"team",name:e.trim()}}function N6(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ø/gi,"o").toLowerCase().trim()}function d2(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{teams:t,leagues:o,...r}=e,n={...r};return t!==void 0&&n.scope===void 0&&(n.scope=Array.isArray(t)?t.map(a=>typeof a=="string"?c2(a):a):t),o!==void 0&&n.competitions===void 0&&(n.competitions=o),n}function G6(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let{catalogueClubs:t,...o}=e,r={...o};return t!==void 0&&r.catalogueSubjects===void 0&&(r.catalogueSubjects=Array.isArray(t)?t.map(n=>typeof n=="string"?c2(n):n):t),r}function m2(e,t){return e.expiresAt===null||Date.parse(e.expiresAt)>t.getTime()}function w2(e){return e.getUTCMonth()>=6?e.getUTCFullYear():e.getUTCFullYear()-1}var Av,r2,i2,s2,Rs,Zee,L6,Jee,Iu,Cv,l2,Tv,z6,Xee,j6,Pn,D6,a2,u2,M6,F6,Ev,$v,Qee,U6,ete,B6,tte,q6,W6,Iv,Ov,H6,Y6,V6,nte,ote,K6,Z6,rte,ate,p2,h2,f2,g2,y2,b2,Pv,ite,ste,v2,k2,Rv=_(()=>{"use strict";je();Av={GB:{catalogue:"8085",currency:"GBP",label:"United Kingdom"},US:{catalogue:"5042",currency:"USD",label:"United States"}},r2=s.enum(["GB","US"]),i2=["team","player","competition","event","brand"],s2=s.enum(i2),Rs=s.object({type:s2,name:s.string().trim().min(1).max(120)});Zee=new RegExp(`,(?=\\s*(?:${i2.join("|")})\\s*:)`,"i");L6={"Brighton & Hove Albion":["Brighton","Brighton & Hove Albion FC","Brighton and Hove Albion"]},Jee=new Map(Object.entries(L6).flatMap(([e,t])=>[e,...t].map(o=>[N6(o),e]))),Iu=["collectibles","shirts_kit","training_wear","headwear","accessories","gifts"],Cv=s.enum(Iu),l2={collectibles:"Collectibles: trading cards and signed memorabilia",shirts_kit:"Shirts and jerseys",training_wear:"Training and leisure wear",headwear:"Headwear",accessories:"Accessories",gifts:"Gifts"},Tv=s.object({value:s.string().trim().min(1).max(200),reason:s.string().trim().min(1).max(500),expiresAt:s.string().datetime().nullable(),addedBy:s.string(),addedAt:s.string()}),z6=["products","players","keywords"],Xee=s.enum(z6),j6=90,Pn={productTypes:s.array(Cv),scope:s.array(Rs).max(100),competitions:s.array(s.string().trim().min(1).max(80)).max(50),priceMin:s.number().min(0).nullable(),priceMax:s.number().min(0).nullable(),winPriceMax:s.number().min(0).nullable(),countries:s.array(r2).min(1),defaultCountry:r2,kids:s.boolean()};D6=s.preprocess(d2,s.object(Pn).partial().strict()),a2=s.preprocess(d2,s.object({productTypes:Pn.productTypes.default([...Iu]),scope:Pn.scope.default([]),competitions:Pn.competitions.default([]),priceMin:Pn.priceMin.default(null),priceMax:Pn.priceMax.default(null),winPriceMax:Pn.winPriceMax.default(j6),countries:Pn.countries.default(["GB"]),defaultCountry:Pn.defaultCountry.default("GB"),kids:Pn.kids.default(!1)})),u2=["products","video","betting","lead_generation"],M6=s.enum(u2),F6=s.object({enabled:s.boolean(),adTypes:s.array(M6).max(u2.length).default(["products"]),rules:D6.optional()}),Ev={impactRequests:60,jevCalls:1500,askedWithinDays:30},$v=s.object({impactRequests:s.number().int().min(1).max(1e3).default(Ev.impactRequests),jevCalls:s.number().int().min(1).max(2e4).default(Ev.jevCalls),askedWithinDays:s.number().int().min(1).max(90).default(Ev.askedWithinDays)}),Qee=$v.partial().strict(),U6=s.object({at:s.string(),by:s.string(),what:s.string()});ete=s.preprocess(G6,s.object({killSwitch:s.boolean().default(!1),rules:a2.default(a2.parse({})),games:s.record(s.string(),F6).default({}),catalogueSubjects:s.array(Rs).max(200).default([]),pull:$v.default($v.parse({})),blocklists:s.object({products:s.array(Tv).default([]),players:s.array(Tv).default([]),keywords:s.array(Tv).default([])}).default({products:[],players:[],keywords:[]}),updatedAt:s.string().nullable().default(null),updatedBy:s.string().nullable().default(null),history:s.array(U6).default([])}));B6=s.object({id:s.string(),catalogue:s.string(),name:s.string(),club:s.string(),league:s.string(),imageUrl:s.string(),url:s.string(),price:s.number(),currency:s.string(),inStock:s.boolean(),ageGroup:s.string().nullable(),type:Cv.nullable()}),tte=s.enum(["win","neutral","loss"]),q6=s.object({model:s.string(),ownClub:s.number().nullable(),playerOutsideSquad:s.number(),forChildren:s.number(),aboutNewBaby:s.number(),tactless:s.object({win:s.number(),neutral:s.number()}),appeal:s.object({win:s.number(),neutral:s.number()})}),W6=B6.extend({judgments:q6.nullable()}),Iv=40,Ov=["incomplete","not_the_subject","out_of_stock","untyped"],H6=s.enum(Ov),Y6=s.object({name:s.string(),team:s.string(),why:H6}),V6=s.object({incomplete:s.number().optional(),not_the_subject:s.number().optional(),out_of_stock:s.number().optional(),untyped:s.number().optional()}),nte=s.object({catalogue:s.string(),query:s.string().optional(),club:s.string(),subject:Rs.optional(),pulledAt:s.string(),fetched:s.number(),candidates:s.array(W6),dropped:s.array(Y6).optional()}),ote=s.object({pulledAt:s.string().nullable(),impact:s.object({ok:s.boolean(),detail:s.string().nullable()}),jev:s.object({ok:s.boolean(),detail:s.string().nullable()}),catalogues:s.array(s.object({catalogue:s.string(),club:s.string(),fetched:s.number(),candidates:s.number(),judged:s.number(),subject:Rs.optional(),pulledAt:s.string().optional(),query:s.string().optional(),dropped:V6.optional()})),reporting:s.enum(["not_available","available"]).default("not_available"),waiting:s.number().optional()}),K6=s.object({gameId:s.string().min(1).max(120),workspaceId:s.string().min(1).max(120),lastAsked:s.string()}),Z6=s.object({subject:Rs,team:s.string().max(120).nullable().default(null),firstAsked:s.string(),lastAsked:s.string(),games:s.array(K6)}),rte=s.object({updatedAt:s.string().nullable().default(null),subjects:s.array(Z6).default([])}),ate=s.object({pulledAt:s.string().nullable().default(null),source:s.string().default(""),players:s.record(s.string(),s.string()).default({}),ambiguous:s.array(s.string()).default([])}),p2=.5,h2=.5,f2=.5,g2=.5,y2=.4,b2=1.5,Pv=3,ite=s.object({productId:s.string(),name:s.string(),imageUrl:s.string(),price:s.number(),currency:s.string(),link:s.string(),type:Cv,reasons:s.array(s.string())}),ste=s.object({type:s2,name:s.string(),of:s.string().optional()});v2=["other_catalogue","out_of_stock","untyped","type_off","outside_team_scope","outside_competition","below_price","above_price","above_win_price","for_children_named","past_season","wall_decor","blocked_product","blocked_player","blocked_keyword"],k2=["not_judged","not_own_club","tactless","player_outside_squad","about_new_baby","for_children","low_appeal"]});var gte,Ns,J6,Ls,mn,_2,yte,bte,x2=_(()=>{"use strict";Rv();gte={switches:{title:"Whether anything shows",lede:"Checked first, before any product is read."},nightly:{title:"Every night, before any fan",lede:"The nightly pull fetches each team's, player's or competition's products and drops these before Jev judges the rest."},finish:{title:"When a fan finishes",lede:"Applied to every judged product the moment a result screen asks. Counted here after a win, with the settings for every game."},order:{title:"What goes first",lede:`Among the products that pass, these decide the ${Pv} at most a fan sees.`},privacy:{title:"Privacy",lede:"What is recorded about a fan who sees the panel."}},Ns=e=>`${Math.round(e*100)}%`,J6={GBP:"\xA3",USD:"$"},Ls=(e,t)=>{let o=Av[e.defaultCountry].currency,r=J6[o];return r?`${r}${t}`:`${t} ${o}`},mn=()=>"Always",_2=e=>!e.kids,yte=[{id:"kill_switch",stage:"switches",name:"Stops every ad at once",protects:"If anything goes wrong, one switch takes every ad out of every game.",kind:"rule",setting:e=>e.killSwitch?"On":"Off",measure:"kill"},{id:"approved_games",stage:"switches",name:"Only games the retail partner has approved",protects:"A game shows nothing until Monterosa switches products on for it, after the retail partner approves.",kind:"rule",setting:e=>{let t=Object.values(e.games).filter(o=>o.enabled&&o.adTypes.includes("products")).length;return t===0?"No game on":`On in ${t} ${t===1?"game":"games"}`},measure:"games"},{id:"not_after_a_loss",stage:"switches",name:"Nothing after a loss",protects:"A fan who has just lost is never sold to.",kind:"rule",setting:mn,measure:"none",notCounted:"Not counted: after a loss the page does not ask."},{id:"what_the_game_is_about",stage:"switches",name:"Only what the game is about",protects:"Products are for the players, team or competition the game names, never a guess, and never outside a scope Monterosa set.",kind:"rule",setting:(e,t)=>{let o=[...t.scope.map(r=>r.name),...t.competitions];return o.length===0?"Any the game names":`Only ${o.join(", ")}`},measure:"finish",covers:{finish:["outside_team_scope","outside_competition"]}},{id:"own_country",stage:"switches",name:"The fan's own shop",protects:"Prices and stock come from one country's catalogue, never another country's currency.",kind:"rule",setting:(e,t)=>t.countries.map(o=>Av[o].label).join(", "),measure:"finish",covers:{finish:["other_catalogue"]}},{id:"complete_listing",stage:"nightly",name:"Drops broken listings",protects:"A product with no link, picture or price never reaches a fan.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["incomplete"]}},{id:"another_team",stage:"nightly",name:"Drops another team's stock",protects:`A search for Arsenal also finds an "Everton v Arsenal" scarf; only the shop's own Arsenal stock is kept.`,kind:"rule",setting:mn,measure:"pull",covers:{pull:["not_the_subject"]}},{id:"in_stock",stage:"nightly",name:"Drops what is out of stock",protects:"A fan is never sent to something they cannot buy.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["out_of_stock"],finish:["out_of_stock"]}},{id:"recognised_product",stage:"nightly",name:"Drops products we cannot name",protects:"Anything that is not recognisably a shirt, cap, collectible, gift or similar is left out, so nothing odd slips through.",kind:"rule",setting:mn,measure:"pull",covers:{pull:["untyped"],finish:["untyped"]}},{id:"judged_per_subject",stage:"nightly",name:"Judges a mix, not the whole shop",protects:`Jev judges up to ${Iv} products per team, player or competition each night, one of each type in turn, so sixty shirts never crowd out a cap.`,kind:"rule",setting:()=>`${Iv} per team, player or competition`,measure:"unjudged"},{id:"judged_first",stage:"finish",name:"Nothing unjudged",protects:"A product Jev could not judge is never shown.",kind:"rule",setting:mn,measure:"finish",covers:{finish:["not_judged"]}},{id:"product_types",stage:"finish",name:"Only the product types switched on",protects:"Monterosa chooses which kinds of product a game may show.",kind:"rule",setting:(e,t)=>t.productTypes.length===Iu.length?"All six types":t.productTypes.length===0?"None":t.productTypes.map(o=>l2[o].split(":")[0]).join(", "),measure:"finish",covers:{finish:["type_off"]}},{id:"price",stage:"finish",name:"Keeps to a price range",protects:"Keeps expensive items off the screen of a fan who has just played a free game.",kind:"rule",setting:(e,t)=>t.priceMin===null&&t.priceMax===null?"No limit":t.priceMin===null?`Up to ${Ls(t,t.priceMax)}`:t.priceMax===null?`From ${Ls(t,t.priceMin)}`:`${Ls(t,t.priceMin)} to ${Ls(t,t.priceMax)}`,measure:"finish",covers:{finish:["below_price","above_price"]}},{id:"win_price",stage:"finish",name:"Caps the price on the result screen",protects:"A fan who has just played is offered what most fans buy, a replica shirt rather than a \xA3135 authentic one.",kind:"rule",setting:(e,t)=>t.winPriceMax===null?"No cap":`Up to ${Ls(t,t.winPriceMax)}`,measure:"finish",covers:{finish:["above_win_price"]}},{id:"children_named",stage:"finish",name:"Drops children's products by name",protects:"Anything labelled kids, baby, junior or youth stays off unless Monterosa allows children's products.",kind:"rule",setting:(e,t)=>_2(t)?"On: children's products kept off":"Off: children's products allowed",measure:"finish",covers:{finish:["for_children_named"]}},{id:"past_season",stage:"finish",name:"Drops last season's stock",protects:'A shirt, sticker or card set for a past season ("24-25", or "Topps 2026" in 2026-27) looks stale, though signed and framed collectibles are kept.',kind:"rule",setting:(e,t,o)=>{if(!o)return"Worked out from the date";let r=w2(o);return`Before ${r}-${String((r+1)%100).padStart(2,"0")}, from the date`},measure:"finish",covers:{finish:["past_season"]}},{id:"wall_stickers",stage:"finish",name:"Drops wall stickers",protects:"A fan at a result screen is not shopping for a wall.",kind:"rule",setting:mn,measure:"finish",covers:{finish:["wall_decor"]}},{id:"blocklists",stage:"finish",name:"Drops what Monterosa has blocked",protects:"Any product, player or word Monterosa blocks, each with a reason and an optional end date.",kind:"rule",setting:(e,t,o)=>{let r=d=>e.blocklists[d].filter(l=>!o||m2(l,o)).length,[n,a,i]=[r("products"),r("players"),r("keywords")];if(n+a+i===0)return"Nothing blocked";let c=(d,l,u)=>`${d} ${d===1?l:u}`;return[c(n,"product","products"),c(a,"player","players"),c(i,"word","words")].join(", ")},measure:"finish",covers:{finish:["blocked_product","blocked_player","blocked_keyword"]}},{id:"rival_club",stage:"finish",name:"Drops a rival club's shirt",protects:"Catches a product filed under the right team that is really for another club's fans.",kind:"judgment",setting:()=>`Below ${Ns(p2)} sure it is the club's`,measure:"finish",covers:{finish:["not_own_club"]}},{id:"tactless",stage:"finish",name:"Drops anything tactless",protects:"Gloating, a rival's celebration, a defeat or a sensitive event: anything that would embarrass the brand showing it.",kind:"judgment",setting:()=>`${Ns(h2)} sure or more`,measure:"finish",covers:{finish:["tactless"]}},{id:"player_left",stage:"finish",name:"Drops players who have left",protects:"A shirt printed for a player no longer in the club's squad is out of date, though signed memorabilia of a former player is kept.",kind:"judgment",setting:()=>`${Ns(f2)} sure or more`,measure:"finish",covers:{finish:["player_outside_squad"]}},{id:"new_baby",stage:"finish",name:"Drops new-baby gifts",protects:"A birth card or a newborn gift is never the right thing after a game.",kind:"judgment",setting:()=>`${Ns(y2)} sure or more`,measure:"finish",covers:{finish:["about_new_baby"]}},{id:"children_judged",stage:"finish",name:"Drops what is made for children",protects:"Catches children's products the name does not give away, while children's products are off.",kind:"judgment",setting:(e,t)=>_2(t)?`${Ns(g2)} sure or more`:"Off: children's products allowed",measure:"finish",covers:{finish:["for_children"]}},{id:"low_appeal",stage:"finish",name:"Drops what a fan would not want now",protects:"Jev scores how much a fan would want each product after that result, from 0 to 3, and anything lukewarm is left out.",kind:"judgment",setting:()=>`Below ${b2.toFixed(1)} of 3`,measure:"finish",covers:{finish:["low_appeal"]}},{id:"player_first",stage:"order",name:"The game's player first",protects:"A product naming the player the game is about leads, so a fan sees their player's shirt before a mug.",kind:"rule",setting:mn,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"player_club",stage:"order",name:"A player brings their club",protects:"When a game names only players, their current clubs' products can show too, taken from the Premier League squads and never guessed.",kind:"rule",setting:mn,measure:"players"},{id:"replica_first",stage:"order",name:"Replica before authentic",protects:"The shirt most fans buy comes before the dearer player-cut version of the same design.",kind:"rule",setting:mn,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"one_per_design",stage:"order",name:"One of each design",protects:"The same shirt with another name on the back, or in another cut, shows once.",kind:"rule",setting:mn,measure:"designs"},{id:"variety",stage:"order",name:"A mix on screen",protects:"One of each product type before a second of any, so three shirts never fill the panel when a cap would do, and no second at all when the round names a competition.",kind:"rule",setting:()=>`Up to ${Pv} products`,measure:"none",notCounted:"Decides the order; drops nothing."},{id:"consent",stage:"privacy",name:"Counted only with consent",protects:"Showing the panel is recorded only when the fan agreed to marketing and analytics, and a link never carries who the fan is.",kind:"rule",setting:()=>"Marketing and analytics",measure:"none",notCounted:"Decided on the fan's page; nothing is counted here."}],bte={pull:Ov,finish:[...v2,...k2]}});var S2=_(()=>{"use strict";_t()});function T2(e){return e?zs.find(t=>t.formats.includes(e)):void 0}var zs,E2=_(()=>{"use strict";Yd();zs=[{id:"typesafe",label:"TypeSafe",signUp:"https://typesafe.ai",purpose:"Pays for Jev, the AI judge that answers fans' questions in your Mystery games. Each question costs a fraction of a cent, charged to your TypeSafe account.",formats:["mystery"]}]});var $2=_(()=>{"use strict";_t()});function Nv(e){let t;try{t=JSON.parse(e)}catch(r){return{ok:!1,reason:"That is not JSON.",detail:r instanceof Error?r.message:void 0}}let o=Ut.safeParse(t);if(!o.success){let r=o.error.issues[0];return{ok:!1,reason:"That is not valid reference data.",detail:r?`${r.path.join(".")||"document"}: ${r.message}`:void 0}}return{ok:!0,summary:{digest:Bd(e),measures:o.data.measures.map(r=>r.key),counts:Object.fromEntries(o.data.measures.map(r=>[r.key,Object.keys(r.values).length])),scored:o.data.measures.filter(r=>r.scoring).map(r=>r.key)}}}async function A2(e,t){let o=Nv(e);return o.ok&&(await t("copy",e),await t("pointer",e)),o}function C2(e,t){return e?e.filter(o=>!t.scored.includes(o)):[]}var I2=_(()=>{"use strict";_t()});var O2=_(()=>{"use strict"});var P2=_(()=>{"use strict"});var X6,Pte,Rte,Nte,Lte,zte,R2=_(()=>{"use strict";je();ud();X6="We expect to let you in within one to two weeks.",Pte=`${X6} We'll email you when your place is ready.`,Rte=s.enum(["unconfirmed","waiting","invited","declined","joined"]),Nte=s.enum(["invited","declined"]),Lte=s.object({email:s.string().trim().toLowerCase().max(254).email("Enter your work email address."),name:s.string().trim().min(1,"Tell us your name.").max(80).regex(/^[^<>@:/\\]+$/,"Use just your name, with no links or symbols.").refine(e=>!/\.[a-z]{2,}\b/i.test(e),"Use just your name, with no links or symbols."),company:s.string().trim().min(1,"Tell us your company.").max(120),role:s.string().trim().min(1,"Tell us your role.").max(120),intent:s.string().trim().min(1,"Tell us what you'd like to build.").max(500),contactConsent:s.literal(!0,{message:"Tick the box so we can contact you about your place."}),ageConfirmed:s.literal(!0,{message:`Confirm you are ${18} or older.`}),marketingConsent:s.boolean().optional()}),zte=s.object({token:s.string().trim().min(20).max(200)})});var Q6,e4,t4,Dte,N2=_(()=>{"use strict";Q6="Monterosa",e4="04716325",t4="3B, The Plaza, floor 3, 100 Old Hall Street, Liverpool, L3 9QJ, United Kingdom",Dte=`${Q6}, ${t4}. Company number ${e4}.`});function Ou(e){let t=[],o=/\[([^\]]*)\]/g,r=0;for(let n of e.matchAll(o))n.index>r&&t.push({text:e.slice(r,n.index),accent:!1}),n[1]&&t.push({text:n[1],accent:!0}),r=n.index+n[0].length;return r<e.length&&t.push({text:e.slice(r),accent:!1}),t.filter(n=>n.text.length>0)}function Lv(e){return Ou(e).map(t=>t.text).join("")}var zv=_(()=>{"use strict"});function Ro(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function i4(e){let t=e.length===4?`#${[...e.slice(1)].map(a=>a+a).join("")}`:e,[o,r,n]=[1,3,5].map(a=>{let i=parseInt(t.slice(a,a+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*o+.7152*r+.0722*n>.4}function Pu(e,t){return e&&L2.test(e.trim())?e.trim():t}function Mv(e){return Ou(e).map(t=>t.accent?`<span class="gs-boot__accent">${Ro(t.text)}</span>`:Ro(t.text)).join("")}function z2(e){let t=Pu(e.gradientStart,"#101820"),o=Pu(e.gradientEnd,t),r=i4(t),n=Pu(e.titleColour,r?"#101820":"#ffffff"),a=Pu(e.logoAccentColour,n),i=Nd(e.titleFont,e.titleFontWeight),c=FE(e.titleLetterSpacing)??"normal",d=UE(e.titleCase),l=e.logoText?.trim()||e.name;return{start:t,end:o,light:r,ink:n,accent:a,font:i,tracking:c,textTransform:d,logo:l,words:{play:e.playLabel?.trim()||pn.play,continue:e.continueLabel?.trim()||pn.continue,error:e.errorText?.trim()||pn.error,retry:e.retryLabel?.trim()||pn.retry}}}function s4(e){let t=Math.max(1,[...Lv(e)].length);return`min(clamp(56px, 19vw, 132px), calc((100vw - 48px) / ${Math.round(t*.86*100)/100}))`}function c4(e){let t=Fv(e);return t.metas+t.links+t.style+t.script}function D2(e){return Fv(e).metas}function M2(e){return Fv(e).style}function F2(e,t,o){if(!L2.test(o)||!e.includes(j2))return;let r=jv(t),n=Dv(t);if(!(e.split(r).length!==2||e.split(n).length!==2))return e.replace(r,jv(o)).replace(n,Dv(o))}function Fv(e){let t=z2(e),o=t.light?"rgba(16,24,32,.16)":"rgba(255,255,255,.2)",r=t.light?"rgba(16,24,32,.78)":"rgba(255,255,255,.9)",n=t.font&&e.logoFontData&&/^[A-Za-z0-9+/=]+$/.test(e.logoFontData)?e.logoFontData:void 0,a=t.font&&!n?ls(t.font.family):void 0,i=t.font?`"${t.font.family}", system-ui, sans-serif`:"system-ui, sans-serif",c={font:t.font?{family:t.font.family,weight:t.font.weight}:null,minMs:o4,fontTimeoutMs:r4,maxMs:a4,words:t.words,mark:Hn};return{metas:`<meta name="color-scheme" content="${t.light?"light":"dark"}" ${bt} />
115
115
  <meta name="theme-color" content="${t.start}" ${bt} />
116
116
  `,links:a?`<link rel="preconnect" href="${Pb}" crossorigin ${bt} />
117
117
  <link rel="stylesheet" href="${a}" media="print" onload="this.media='all'" id="gs-boot-font" ${bt} />
@@ -246,7 +246,7 @@ You scored {points} points.`},Oj=Object.keys(wE),vE=s.object({notify_template_su
246
246
  `+c4(t)+o.slice(c),l=/<body[^>]*>/i.exec(d),u=l.index+l[0].length;return d.slice(0,u)+`
247
247
  `+l4(t)+d.slice(u)}function br(e,t){let o=n=>{let a=e[n];return typeof a=="string"&&a.trim()?a.trim():void 0},r=o("splash_gradient_start")??o("css_variables_backgroundMainColour")??"#101820";return{name:o("display_name")??t,logoText:o("logo_text"),gradientStart:r,gradientEnd:o("splash_gradient_end")??o("css_variables_backgroundContainerColour")??r,titleFont:o("css_variables_fontTitleFamily")??o("title_font"),titleFontWeight:o("css_variables_fontTitleWeight")??o("title_font_weight"),titleLetterSpacing:o("css_variables_fontTitleTracking")??o("title_letter_spacing"),titleCase:o("css_variables_fontTitleCase")??o("title_case"),titleColour:o("title_colour"),logoAccentColour:o("logo_accent_colour"),playLabel:o("splash_play_label"),continueLabel:o("splash_continue_label"),errorText:o("splash_error_text"),retryLabel:o("splash_retry_label")}}var bt,n4,o4,r4,a4,pn,L2,j2,jv,Dv,U2,Uv=_(()=>{"use strict";sn();vd();zv();zv();bt="data-gs-first-paint",n4=32,o4=600,r4=800,a4=15e3,pn={play:"Play",continue:"Continue",error:"The game didn't load. Check your connection and try again.",retry:"Try again"},L2=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;j2=` /* The game's intro screen, painted before any script. GS-564. */
248
248
  `,jv=e=>` html, body { background: ${e}; margin: 0; }
249
- `,Dv=e=>`var(--gs-boot-start, ${e})`;U2=new RegExp(`\\s*<(meta|link)\\b[^>]*\\b${bt}\\b[^>]*>|\\s*<(style|script)\\b[^>]*\\b${bt}\\b[^>]*>[\\s\\S]*?<\\/\\2>|\\s*<div class="gs-boot"[^>]*\\b${bt}\\b[^>]*>[\\s\\S]*?<span class="gs-boot__label">[^<]*<\\/span><\\/div>|\\s*<div class="gs-boot"[^>]*\\b${bt}\\b[^>]*>(?:<span[^>]*><\\/span>)?<span class="gs-boot__label">[^<]*<\\/span><\\/div>`,"g")});var d4,B2,Gv,q2,W2,Wte,Hte,Yte,Vte,H2=_(()=>{"use strict";d4=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},B2=e=>typeof process>"u"?void 0:d4(process.env?.[e]),Gv=(e,t,o)=>({burst:B2(t)??e.burst,perMinute:B2(o)??e.perMinute}),q2={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},W2={player:Gv(q2.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Gv(q2.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},Wte=Gv({burst:120,perMinute:120},"GAMESTAGE_RATE_RECOVERY_GAME_PER_MINUTE","GAMESTAGE_RATE_RECOVERY_GAME_PER_MINUTE"),Hte=W2.player,Yte=W2.publicRoutes,Vte=600*1e3});var Y2=_(()=>{"use strict"});var Bv=_(()=>{"use strict"});var tne,nne,one,rne,V2=_(()=>{"use strict";je();Bv();tne=s.object({has_code:s.boolean(),issued_at:s.string().nullable()}),nne=s.object({code:s.string(),issued_at:s.string(),replaced:s.boolean()}),one=s.object({code:s.string().max(120)}),rne=s.object({token:s.string(),player_id:s.string(),kind:s.literal("anonymous"),previous_player:s.literal("kept")})});var K2,Z2,J2=_(()=>{"use strict";K2={open:"Your progress",showTitle:"Keep your progress",showDetail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",private:"Keep it private. Anyone with this code can play as you.",replace:"Getting a new code stops the old one working.",get:"Get a recovery code",issueFailed:"That didn't work. Check your connection and try again.",copy:"Copy",copied:"Copied",share:"Share",enterTitle:"I've played before",enterDetail:"Type the recovery code you saved to get your progress back.",submit:"Get my progress back",notRecognised:"That code isn't one we know. Check it against the one you saved.",restored:"Welcome back. Your progress is on this device now.",close:"Close"},Z2={recovery_open_label:"open",recovery_show_title:"showTitle",recovery_show_detail:"showDetail",recovery_private_note:"private",recovery_replace_note:"replace",recovery_enter_title:"enterTitle",recovery_enter_detail:"enterDetail",recovery_submit_label:"submit",recovery_not_recognised:"notRecognised",recovery_restored:"restored",recovery_get_label:"get",recovery_issue_failed:"issueFailed",recovery_copy_label:"copy",recovery_copied_label:"copied",recovery_share_label:"share",recovery_close_label:"close"}});var X2=_(()=>{"use strict"});function u4(e){let t=e.length===4?`#${[...e.slice(1)].map(a=>a+a).join("")}`:e,[o,r,n]=[1,3,5].map(a=>{let i=parseInt(t.slice(a,a+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*o+.7152*r+.0722*n>.4}function Nu(e){let t=u4(e);return`<meta name="color-scheme" content="${t?"light":"dark"}" ${Bt} />
249
+ `,Dv=e=>`var(--gs-boot-start, ${e})`;U2=new RegExp(`\\s*<(meta|link)\\b[^>]*\\b${bt}\\b[^>]*>|\\s*<(style|script)\\b[^>]*\\b${bt}\\b[^>]*>[\\s\\S]*?<\\/\\2>|\\s*<div class="gs-boot"[^>]*\\b${bt}\\b[^>]*>[\\s\\S]*?<span class="gs-boot__label">[^<]*<\\/span><\\/div>|\\s*<div class="gs-boot"[^>]*\\b${bt}\\b[^>]*>(?:<span[^>]*><\\/span>)?<span class="gs-boot__label">[^<]*<\\/span><\\/div>`,"g")});var d4,B2,Gv,q2,W2,Hte,Yte,Vte,Kte,H2=_(()=>{"use strict";d4=e=>{if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0},B2=e=>typeof process>"u"?void 0:d4(process.env?.[e]),Gv=(e,t,o)=>({burst:B2(t)??e.burst,perMinute:B2(o)??e.perMinute}),q2={player:{burst:300,perMinute:600},publicRoutes:{burst:100,perMinute:300}},W2={player:Gv(q2.player,"GAMESTAGE_RATE_PLAYER_BURST","GAMESTAGE_RATE_PLAYER_PER_MINUTE"),publicRoutes:Gv(q2.publicRoutes,"GAMESTAGE_RATE_PUBLIC_BURST","GAMESTAGE_RATE_PUBLIC_PER_MINUTE")},Hte=Gv({burst:120,perMinute:120},"GAMESTAGE_RATE_RECOVERY_GAME_PER_MINUTE","GAMESTAGE_RATE_RECOVERY_GAME_PER_MINUTE"),Yte=W2.player,Vte=W2.publicRoutes,Kte=600*1e3});var Y2=_(()=>{"use strict"});var Bv=_(()=>{"use strict"});var nne,one,rne,ane,V2=_(()=>{"use strict";je();Bv();nne=s.object({has_code:s.boolean(),issued_at:s.string().nullable()}),one=s.object({code:s.string(),issued_at:s.string(),replaced:s.boolean()}),rne=s.object({code:s.string().max(120)}),ane=s.object({token:s.string(),player_id:s.string(),kind:s.literal("anonymous"),previous_player:s.literal("kept")})});var K2,Z2,J2=_(()=>{"use strict";K2={open:"Your progress",showTitle:"Keep your progress",showDetail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",private:"Keep it private. Anyone with this code can play as you.",replace:"Getting a new code stops the old one working.",get:"Get a recovery code",issueFailed:"That didn't work. Check your connection and try again.",copy:"Copy",copied:"Copied",share:"Share",enterTitle:"I've played before",enterDetail:"Type the recovery code you saved to get your progress back.",submit:"Get my progress back",notRecognised:"That code isn't one we know. Check it against the one you saved.",restored:"Welcome back. Your progress is on this device now.",close:"Close"},Z2={recovery_open_label:"open",recovery_show_title:"showTitle",recovery_show_detail:"showDetail",recovery_private_note:"private",recovery_replace_note:"replace",recovery_enter_title:"enterTitle",recovery_enter_detail:"enterDetail",recovery_submit_label:"submit",recovery_not_recognised:"notRecognised",recovery_restored:"restored",recovery_get_label:"get",recovery_issue_failed:"issueFailed",recovery_copy_label:"copy",recovery_copied_label:"copied",recovery_share_label:"share",recovery_close_label:"close"}});var X2=_(()=>{"use strict"});function u4(e){let t=e.length===4?`#${[...e.slice(1)].map(a=>a+a).join("")}`:e,[o,r,n]=[1,3,5].map(a=>{let i=parseInt(t.slice(a,a+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return .2126*o+.7152*r+.0722*n>.4}function Nu(e){let t=u4(e);return`<meta name="color-scheme" content="${t?"light":"dark"}" ${Bt} />
250
250
  <meta name="theme-color" content="${e}" ${Bt} />
251
251
  <style ${Bt}>
252
252
  /* The game's colour from the first frame, before any script. GS-537. */
@@ -271,7 +271,7 @@ You scored {points} points.`},Oj=Object.keys(wE),vE=s.object({notify_template_su
271
271
  `)}async function pk(e){let t=process.stdout;typeof t.writableLength=="number"&&t.writableLength>0&&await new Promise(o=>{let r=()=>o();t.once("drain",r),t.once("error",r),t.once("close",r)}),process.exit(e)}function S(e,t){if(Ra)process.stderr.write(JSON.stringify(C1({ok:!1,error:e,detail:t??[]}),null,2)+`
272
272
  `);else{process.stderr.write(`${w.red("Error")} ${dk(e)}
273
273
  `);for(let o of t??[])process.stderr.write(` ${dk(o)}
274
- `)}process.exit(1)}var Ra,R4,Pa,w,N4,L4,uk,Ie=_(()=>{"use strict";Ra=!1;R4=()=>!Ra&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Pa=(e,t)=>R4()?`\x1B[${e}m${t}\x1B[0m`:t,w={bold:e=>Pa("1",e),dim:e=>Pa("2",e),red:e=>Pa("31",e),green:e=>Pa("32",e),yellow:e=>Pa("33",e),cyan:e=>Pa("36",e)};N4=["admin","adopt","ads","archive","client","create","deploy","dev","doctor","docs","domain","endpoint","formats","graphic","help","inspect","issue","link","list","live","login","logout","logs","look","manifest","open","org","plan","promote","prune","reference","review","round","sources","start","status","suggest","suspend","theme","usage","verify","wake","whoami","workspace"],L4=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function z4(e=zu){let[t,o]=e.replace(/^[^\d]*/,"").split(".").map(Number);return[t,o||0]}function I1(e,t=zu){let[o,r]=z4(t),[n,a]=e.split(".").map(Number);return n>o||n===o&&a>=r}var ot,Xn,zu,No=_(()=>{"use strict";ot="0.57.0",Xn="2026-10-21-4",zu=">=22.13.0"});function ct(){return{[HC]:ot}}function j4(e){let t=e;return t?.code===Au||t?.status===426}function D4(e){let t=e?.trim()||`Update required: this is gamestage ${ot}, and a newer version is needed. Run ${gr}.`;C()?process.stderr.write(JSON.stringify({ok:!1,code:Au,error:t,update:{current:ot,command:gr},detail:[]},null,2)+`
274
+ `)}process.exit(1)}var Ra,R4,Pa,w,N4,L4,uk,Ie=_(()=>{"use strict";Ra=!1;R4=()=>!Ra&&process.stdout.isTTY===!0&&!process.env.NO_COLOR,Pa=(e,t)=>R4()?`\x1B[${e}m${t}\x1B[0m`:t,w={bold:e=>Pa("1",e),dim:e=>Pa("2",e),red:e=>Pa("31",e),green:e=>Pa("32",e),yellow:e=>Pa("33",e),cyan:e=>Pa("36",e)};N4=["admin","adopt","ads","archive","client","create","deploy","dev","doctor","docs","domain","endpoint","formats","graphic","help","inspect","issue","link","list","live","login","logout","logs","look","manifest","open","org","plan","promote","prune","reference","review","round","sources","start","status","suggest","suspend","theme","usage","verify","wake","whoami","workspace"],L4=/`gamestage ([a-z][a-z-]*)((?: [^`]*)?)`/g});function z4(e=zu){let[t,o]=e.replace(/^[^\d]*/,"").split(".").map(Number);return[t,o||0]}function I1(e,t=zu){let[o,r]=z4(t),[n,a]=e.split(".").map(Number);return n>o||n===o&&a>=r}var ot,Xn,zu,No=_(()=>{"use strict";ot="0.58.0",Xn="2026-10-21-4",zu=">=22.13.0"});function ct(){return{[HC]:ot}}function j4(e){let t=e;return t?.code===Au||t?.status===426}function D4(e){let t=e?.trim()||`Update required: this is gamestage ${ot}, and a newer version is needed. Run ${gr}.`;C()?process.stderr.write(JSON.stringify({ok:!1,code:Au,error:t,update:{current:ot,command:gr},detail:[]},null,2)+`
275
275
  `):process.stderr.write(`${t}
276
276
  `),process.exit(1)}function Jt(e){if(!j4(e))return;let t=e.code===Au,o=e.message;D4(t&&typeof o=="string"?o:void 0)}var Nn=_(()=>{"use strict";xe();Ie();No()});function M4(e){try{let t=new URL(e).hostname.toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t==="::1"||t.startsWith("127.")}catch{return!1}}function O1(e){return e.GAMESTAGE_TEST_RUN==="1"||e.NODE_TEST_CONTEXT!==void 0}function Ln(e=process.env){return O1(e)?1:void 0}function ju(e=Re,t=process.env){if(O1(t)&&!M4(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 La(e=Re){let t=ju(e);t&&S(t)}async function Qn(){let e=await Ke();return e||S("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 be(){let e=await Qn();return{client:On({baseUrl:Re,headers:ct(),maxAttempts:Ln(),workspace:Xv(),token:async()=>(await Ke())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function zn(){let e=await Ke().catch(()=>null);if(e)return On({baseUrl:Re,headers:ct(),maxAttempts:Ln(),workspace:Xv(),token:async()=>(await Ke())?.accessToken??e.accessToken})}async function Lo(){await Qn();let e=await zn();if(!e)throw new Error("Signed in, but the session could not be read. Run `gamestage login` again.");return e}async function Xt(){let e=await Ke();return e||S("You are not signed in.",["Run `gamestage login`. An operator's command needs an operator's own session."]),{admin:UC({baseUrl:Re,headers:ct(),maxAttempts:Ln(),token:async()=>(await Ke())?.accessToken??e.accessToken}),email:e.email??e.userId??"unknown"}}async function Fs(e){try{let t=await e.getWorkspace(),o=t?.access;return o==="approved"||o==="pending"||o==="refused"?{access:o,workspace:t}:{access:"unreported",workspace:t}}catch(t){Jt(t);let o=t.status,r=t.code;return r===fk?{access:"pending"}:r===$u?{access:"unknown",problem:"not_a_control_plane",reason:t.message??`${Re} is not a Gamestage control plane.`,detail:["You are signed in, and your token was never checked: the address is wrong, not the token.","The main Space's API is https://api.gamestage.ai, which is the default when GAMESTAGE_CONTROL_URL is unset."]}:o===404||r==="not_found"?{access:"unknown",problem:"no_control_plane",reason:`Nothing is serving a control plane at ${Re}.`,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."]}:o===401||o===403?{access:"unknown",problem:"token_refused",reason:"The control plane refused this account's token.",detail:[`It is at ${Re}.`,"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 ${Re}.`,detail:[String(t.message??t),"You are signed in. Deploying will fail until this answers."]}}}function Us(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:fk,heading:"On the waitlist",message:"You are registered and your account is on the waitlist. That is the normal path for an account created without an invitation, and a person decides it.",next:["Finish your application at https://gamestage.ai/stage: three questions and the terms. Nobody can approve the account until both are in.","We email you when the account is approved, usually within one to two weeks.","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: ${Je}.`]};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"||e.problem==="not_a_control_plane"?e.problem: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 P1(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:[e.code==="profile_incomplete"?"Nothing was written. When they have finished their application in Stage, run this again.":e.code==="personal_email"?"Nothing was written. Ask them to sign in with their work email, or approve the exception in Stage > Approvals.":"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 za(e){if(I(e.heading),h(` ${e.message}`),e.next.length){h();for(let t of e.next)k(t)}h()}function R1(e,t,o){let r=i=>{let c=i.trim().toLowerCase();return ba.options.find(d=>d===c||hs[d].toLowerCase()===c)},n=ba.options.map(i=>`${i} (${hs[i]})`).join(", "),a=r(t);return a?o===void 0?{request:{workspaceId:e,tier:a}}:!/^\d+$/.test(o)||Number(o)>1e4?{problem:`"${o}" is not a live-game allowance.`,detail:["Give a whole number from 0 to 10000, where 0 means no ceiling.","Nothing has been changed."]}:{request:{workspaceId:e,tier:a,allowance:Number(o)}}:r(e)?{problem:"The workspace comes first and the plan second.",detail:[`Try: ${ee(`admin plan ${t} ${e}`)}`,"Nothing has been changed."]}:{problem:`"${t}" is not a plan.`,detail:[`Use one of: ${n}.`,"Nothing has been changed."]}}function Na(e){let t=hs[e.tier];if(e.liveGameAllowance===void 0)return t;let o=e.liveGameAllowance===0?"no live-game ceiling":`${e.liveGameAllowance} live game${e.liveGameAllowance===1?"":"s"}`;return`${t}, ${o}`}function N1(e){let{request:t,previous:o,result:r,stored:n}=e,a=Na({tier:t.tier,liveGameAllowance:t.allowance}),i={previous:o,stored:n};return r.refused?{...i,status:"refused_by_store",exitCode:1,heading:"Not changed",message:r.refused,next:["Nothing was written."]}:n?n.tier===t.tier&&(t.allowance===void 0||n.liveGameAllowance===t.allowance)?o!==null&&o.tier===n.tier&&o.liveGameAllowance===n.liveGameAllowance?{...i,status:"unchanged",exitCode:0,heading:"No change",message:`${t.workspaceId} was already on ${Na(n)}, and still is.`,next:[hk]}:{...i,status:"set",exitCode:0,heading:"Plan set",message:`${t.workspaceId} is on ${Na(n)}, read back from the control plane after the write.`,next:[hk]}:{...i,status:"not_what_was_asked",exitCode:1,heading:"Not what was asked",message:`${t.workspaceId} was sent ${a} and holds ${Na(n)}. The write reported success, and the stored workspace disagrees with it.`,next:["Run it again to see whether the second read agrees. If it still disagrees, that is a control-plane defect to raise, not an operator mistake."]}:{...i,status:"unconfirmed",exitCode:2,heading:"Sent, and not confirmed",message:`The control plane accepted ${t.workspaceId} moving to ${a}, and could not then be asked what it kept: ${e.unreadable??"no reason given"}.`,next:["Treat the plan as unknown rather than set. Run this again once the control plane answers reads; repeating the same plan is safe.",hk]}}function L1(e){if(I(e.heading),h(` ${e.message}`),h(),A("Before",e.previous?Na(e.previous):"could not be read"),A("Stored now",e.stored?Na(e.stored):"could not be read"),e.next.length){h();for(let t of e.next)k(t)}h()}function F4(e){let t=e.status,o=e instanceof Error?e.message:"";if(!(t!==404||!/^No game with id\b/.test(o)))return"This workspace has no game by that id: it was never registered, or `create` could not register it. Run `gamestage manifest register gamestage.yaml` in the game's folder, then run this again."}async function pe(e){let t=[],o=e.status,r=e.code;if(Jt(e),r===fk){let{client:a}=await be(),i=Us(await Fs(a));i.access==="approved"&&i.next.push("The original command was not completed. Run it again."),C()?L({ok:!1,status:i.status,access:i.access,code:i.code,message:i.message,next:i.next}):za(i),process.exit(1)}r===$u&&S(e instanceof Error?e.message:`${Re} is not a Gamestage control plane.`,["Your session was never checked: the address is wrong, not the token.","Unset GAMESTAGE_CONTROL_URL to use https://api.gamestage.ai, or set it to a Space's API address.",`Code: ${r}`]);let n=F4(e);n&&t.push(n),o===401?t.push("Your session has expired. Run `gamestage login` again."):o===403&&r===kw||(o===403?t.push("Either your session expired or that is not something this workspace is allowed to do. `gamestage login` rules out the first."):o===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.")),r&&t.push(`Code: ${r}`),t.push(`Control plane: ${Re}`),S(e instanceof Error?e.message:"The control plane call failed.",t)}var Re,fk,hk,rt=_(()=>{"use strict";ek();xe();hn();Ie();Rn();Nn();Re=process.env.GAMESTAGE_CONTROL_URL??"https://api.gamestage.ai";fk="access_pending";hk="This does not re-provision. A live round keeps the caps it was provisioned with, including its day cap, until the game is deployed again, so a creator refused before this is refused the same way until they redeploy with `gamestage deploy`. That is not this change failing."});var Da,vr,wt,to,jn,tt,Dn,H4,Y4,V4,K4,Z4,J4,X4,Q4,eU,tU,Ma,wk,gn=_(()=>{"use strict";Da=`/**
277
277
  * @monterosa/gamestage-player, bundled for a browser.
@@ -19621,7 +19621,7 @@ main()
19621
19621
  <script>/* gs-press-rules: iOS Safari applies :active only once the page listens for touches. */document.addEventListener('touchstart', function () {}, { passive: true });</script>
19622
19622
  </body>
19623
19623
  </html>
19624
- `,Ma={hunt:H4,push:Y4,group:V4,predict:K4,bingo:Z4,shoot:J4,arcade:X4,word_guess:Q4,number_guess:eU,phrase_solve:tU},wk={hunt:{background:"#FCFBFB",settings:{play_button_label:"Submit picks",how_to_play:"Find the right ones on the board. A wrong pick costs a try.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",label_attempts:"Attempts",label_mistakes:"Mistakes",label_score:"Score",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},push:{background:"#FCFBFB",settings:{play_button_label:"Take it",how_to_play:"Pick one from each line. Get as close to the limit as you dare without going over.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},group:{background:"#FCFBFB",settings:{play_button_label:"Submit group",how_to_play:"Sort the board into its groups. A wrong group costs a life.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},predict:{background:"#FCFBFB",settings:{play_button_label:"Lock it in",how_to_play:"Call what will happen before it does. You score when you are right.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}.",label_results_full_time:"Results after full time",label_results_pending:"Results when the answer is in",label_called_it:"Called it.",label_wrong_call:"Wrong call.",label_call_saved:"Your call is in.",label_partly_right:"Partly right.",label_your_score:"You scored {score}.",label_your_call_tag:"Your call",label_result_tag:"Result",label_refused_identity:"Sign in to make your call.",label_sign_in:"Sign in",label_refused_closed:"Calls are closed for this round. Check back for the result.",label_refused_attempts:"Your call is already in. Check back for the result.",label_refused_incomplete:"Choose an answer for every question, then lock in your call.",label_refused_changed:"The choices have changed. Reload the game and make your call again.",label_refused_busy:"Calls are busy just now. Wait a moment and try again.",label_refused_retry:"Your call did not go through. Try again.",label_refused_connection:"Your call could not be confirmed. Check your connection and try again.",label_refused_expired:"Your sign-in has expired. Sign in again to make your call.",label_refused_session:"Your sign-in could not be checked. Sign in again and retry your call.",label_notify_title:"Tell me my result",label_notify_via:"Send my result by",label_notify_email:"Email",label_notify_sms:"Text message",label_notify_email_address:"Email address",label_notify_mobile_number:"Mobile number",label_notify_country:"Country",label_notify_consent:"{brand} will use these details to tell you your result. You can unsubscribe at any time.",label_notify_privacy:"Privacy policy",label_notify_button:"Tell me",label_notify_pending:"Saving\u2026",label_notify_success:"Done. We'll tell you after full time.",label_notify_error:"That did not work. Please try again.",label_notify_invalid_email:"Enter an email address, such as name@example.com.",label_notify_invalid_mobile:"Enter a complete mobile number for the country you picked.",label_notify_code:"6-digit code",label_notify_code_incomplete:"Enter all 6 digits.",label_notify_confirm:"Confirm",label_notify_resend_code:"Send a new code",label_notify_resend_email:"Send the email again",label_notify_resend_wait:"Send again in {seconds}s",label_notify_resent:"Sent. Check again.",label_notify_change_address:"Use a different number or email"}},bingo:{background:"#FCFBFB",settings:{play_button_label:"Back this board",how_to_play:"Choose a board before the round locks. Cards mark themselves as things happen. Complete a row, column or diagonal to score.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_highlightMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_onHighlightColour:"#FFF",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_secondaryContainerColour:"#F4F2F2",css_variables_secondaryMainColour:"#D6D5D5",css_variables_onSecondaryContainerColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}.",label_tab_how:"How to play",label_bingo_deal_label:"Deal my boards",label_bingo_which_label:"Board {n} of {of}",label_bingo_previous_label:"The board before this one",label_bingo_next_label:"The next board",label_bingo_flip_hint:"Tap to see what this means",label_bingo_choose_note:"Compare your boards, then lock your favourite. You cannot swap after locking.",label_bingo_watch_note:"Your board is locked. Cards mark themselves as things happen.",label_bingo_watching_label:"Your board is live",label_bingo_one_away_label:"One to go",label_bingo_line_label:"You have a line",label_bingo_called_label:"{n} of {of} called",label_bingo_free_label:"Free",label_bingo_hit_label:"Happened",label_bingo_miss_label:"Did not happen",label_bingo_result_note:"Round over \xB7 lines completed: {n}",label_won_label:"Bingo!",label_finished_label:"Round over",label_score_label:"Score",label_round_locked_label:"This round has locked.",label_refused:"That did not go through. Try again.",label_refused_moved:"The round changed while you were playing. Here it is again."}},shoot:{background:"#FCFBFB",settings:{play_button_label:"Shoot",how_to_play:"Pick a spot and a power, then shoot. The keeper decides the rest.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveColour:"#FFF",css_variables_onNegativeColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},arcade:{background:"#FCFBFB",settings:{play_button_label:"Play",how_to_play:"Steer left and right to dodge the blocks. The longer you last, the more you score. Your best run goes on the board.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_onNegativeColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name and scores back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back soon.",share_button_label:"Share result",label_share_text:"I scored {score} in {game}.",label_score:"Score",label_best:"Your best",label_board_title:"Leaderboard",label_you:"You",label_run_counted:"Run saved. Your best is {best}, {rank} of {of}.",label_run_saved_unranked:"Run saved. You scored {score}. It isn't on the board.",label_run_not_counted:"That run didn't count.",label_sign_in:"Sign in to keep your score.",label_try_later:"Too many runs just now. Try again in a minute.",label_board_empty:"No scores yet. Be the first.",label_checked_note:"Scores are checked against how long each run lasted.",label_choose_name:"Choose your name",label_name_prompt:"Pick two words. This is the name other players see on the board.",label_name_save:"Save name",label_name_saved:"Saved. Other players will see you as {name}.",label_name_failed:"Your name didn't save. Check your connection and try again."}},word_guess:{background:"#FCFBFB",settings:{play_button_label:"Enter",how_to_play:"Type a word and press Enter. Green: right letter, right place. Amber: in the word, wrong place. Grey: not in the word.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",label_board:"Your guesses, {length} letters each",label_delete:"Delete",label_mark_correct:"right place",label_mark_present:"in the word, wrong place",label_mark_absent:"not in the word",label_too_short:"Not enough letters",label_not_in_word_list:"Not in the word list",label_letters_only:"Letters only",label_already_guessed:"You have tried that word",label_answer:"The word was {answer}.",label_share_text:"{game} {score}",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_copied:"Copied",label_better_than:"Better than {percent}% of players",label_won:"You got it in {used} of {allowed}.",label_lost:"Out of guesses.",label_picture:"The picture for this round",label_round_moved:"This round has moved on. Your guess was not used.",label_guess_failed:"Your guess did not reach the game. Check your connection and try again.",label_guess_refused:"That guess was not accepted. Try another.",label_points:"{points} points",label_one_point:"1 point",label_how_to_play:"How to play"}},number_guess:{background:"#FCFBFB",settings:{play_button_label:"Guess",how_to_play:"Type a year and press Guess. You are told whether the answer is higher or lower, and each miss earns a clue.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",label_your_guess:"Your guess",label_skip:"Skip for a clue",label_guesses_left:"{left} of {allowed} guesses left",label_higher:"Higher",label_lower:"Lower",label_correct:"Correct",label_wrong:"Not it",label_skipped:"Skipped",label_clues:"Clues",label_clues_waiting:"Each wrong guess or skip earns the next clue.",label_not_a_number:"Type a number",label_already_guessed:"You have tried that one",label_answer:"The answer was {answer}.",label_share_text:"{game} {score}",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_copied:"Copied",label_better_than:"Better than {percent}% of players",label_won:"You got it in {used} of {allowed}.",label_lost:"Out of guesses.",label_picture:"The picture for this round",label_round_moved:"This round has moved on. Your guess was not used.",label_guess_failed:"Your guess did not reach the game. Check your connection and try again.",label_guess_refused:"That guess was not accepted. Try another.",label_points:"{points} points",label_one_point:"1 point"}},phrase_solve:{background:"#FCFBFB",settings:{play_button_label:"Spin",how_to_play:"Press Spin to reveal a letter of the phrase. After each letter, type your answer and press Solve, or spin again. One wrong answer ends the round, so be sure.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",share_button_label:"Share result",label_how_to_play:"How to play",label_board:"The phrase, {words} words",label_blank:"blank",label_draws_left:"{left} of {allowed} letters left to draw",label_last_draw:"No letters left to draw. Solve it, or give up.",label_drawn_one:"There is one {letter}.",label_drawn_many:"There are {count} {letter}s.",label_drawn_none:"Every letter is showing. Solve it.",label_letters_drawn:"Letters drawn",label_your_answer:"Your answer",label_solve:"Solve",label_skip:"Spin again",label_give_up:"Give up",label_answer_missing:"Type your answer first.",label_spin_first:"Spin for a letter first.",label_one_guess_per_letter:"You have had your answer for this letter. Spin again.",label_answer_refused:"That answer was not accepted. Try again.",label_round_moved:"This round has moved on. Your answer was not used.",label_play_failed:"That did not reach the game. Check your connection and try again.",label_won:"Solved with {used} of {allowed} letters.",label_lost_wrong:"Not this time.",label_lost_out:"Out of letters.",label_answer:"The phrase was {answer}.",label_points:"{points} points",label_one_point:"1 point",label_share_text:"I solved {game} with {used} of {allowed} letters.",label_share_lost:"{game} beat me today.",label_copied:"Copied",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",label_offline:"You are offline. Your letters are safe; this will pick up when the connection is back.",label_reconnecting:"Reconnecting\u2026",label_still_offline:"Still cannot reach the game. Check your connection.",label_stored_copy:"Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again."}}}});import{readFile as W1}from"node:fs/promises";import{dirname as dU,join as uU,relative as Nae,resolve as mU,sep as Lae}from"node:path";function We(e){let t=Nt(e);return t.ok&&t.manifest.backend.round!==void 0?{ok:!1,issues:[{path:"backend.round",message:Ua}]}:t}function Uu(e){let t=e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"");return t===Fa||t.startsWith(`${Fa}/`)}async function kr(e){let t=uU(dU(mU(e)),Le),o;try{o=await W1(t,"utf8")}catch{return{ok:!1,missing:!0,path:t}}let r;try{r=ht.load(o,{schema:ht.CORE_SCHEMA})}catch(a){return{ok:!1,missing:!1,path:t,problems:[a instanceof Error?a.message:"It is not valid YAML."]}}let n=Ve.safeParse(r);return n.success?{ok:!0,round:n.data,path:t}:{ok:!1,missing:!1,path:t,problems:n.error.issues.map(a=>`${a.path.length?a.path.join("."):"(round)"} ${a.message}`)}}function Gu(e){if(e.archetype!=="hunt"||!e.guess&&!e.solve)return e;let t=new Set(["board","targets","attemptsAllowed","mistakesAllowed","pointsPerTarget","completionBonus"]);return Object.fromEntries(Object.entries(e).filter(([o])=>!t.has(o)))}function H1(e){return`# A practice round, for this laptop only. Fans never see it.
19624
+ `,Ma={hunt:H4,push:Y4,group:V4,predict:K4,bingo:Z4,shoot:J4,arcade:X4,word_guess:Q4,number_guess:eU,phrase_solve:tU},wk={hunt:{background:"#FCFBFB",settings:{play_button_label:"Submit picks",how_to_play:"Find the right ones on the board. A wrong pick costs a try.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",label_attempts:"Attempts",label_mistakes:"Mistakes",label_score:"Score",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},push:{background:"#FCFBFB",settings:{play_button_label:"Take it",how_to_play:"Pick one from each line. Get as close to the limit as you dare without going over.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},group:{background:"#FCFBFB",settings:{play_button_label:"Submit group",how_to_play:"Sort the board into its groups. A wrong group costs a life.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},predict:{background:"#FCFBFB",settings:{play_button_label:"Lock it in",how_to_play:"Call what will happen before it does. You score when you are right.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}.",label_results_full_time:"Results after full time",label_results_pending:"Results when the answer is in",label_called_it:"Called it.",label_wrong_call:"Wrong call.",label_call_saved:"Your call is in.",label_partly_right:"Partly right.",label_your_score:"You scored {score}.",label_your_call_tag:"Your call",label_result_tag:"Result",label_refused_identity:"Sign in to make your call.",label_sign_in:"Sign in",label_refused_closed:"Calls are closed for this round. Check back for the result.",label_refused_attempts:"Your call is already in. Check back for the result.",label_refused_incomplete:"Choose an answer for every question, then lock in your call.",label_refused_changed:"The choices have changed. Reload the game and make your call again.",label_refused_busy:"Calls are busy just now. Wait a moment and try again.",label_refused_retry:"Your call did not go through. Try again.",label_refused_connection:"Your call could not be confirmed. Check your connection and try again.",label_refused_expired:"Your sign-in has expired. Sign in again to make your call.",label_refused_session:"Your sign-in could not be checked. Sign in again and retry your call.",label_notify_title:"Tell me my result",label_notify_via:"Send my result by",label_notify_email:"Email",label_notify_sms:"Text message",label_notify_email_address:"Email address",label_notify_mobile_number:"Mobile number",label_notify_country:"Country",label_notify_consent:"{brand} will use these details to tell you your result. You can unsubscribe at any time.",label_notify_privacy:"Privacy policy",label_notify_button:"Tell me",label_notify_pending:"Saving\u2026",label_notify_success:"Done. We'll tell you after full time.",label_notify_error:"That did not work. Please try again.",label_notify_invalid_email:"Enter an email address, such as name@example.com.",label_notify_invalid_mobile:"Enter a complete mobile number for the country you picked.",label_notify_code:"6-digit code",label_notify_code_incomplete:"Enter all 6 digits.",label_notify_confirm:"Confirm",label_notify_resend_code:"Send a new code",label_notify_resend_email:"Send the email again",label_notify_resend_wait:"Send again in {seconds}s",label_notify_resent:"Sent. Check again.",label_notify_change_address:"Use a different number or email"}},bingo:{background:"#FCFBFB",settings:{play_button_label:"Back this board",how_to_play:"Choose a board before the round locks. Cards mark themselves as things happen. Complete a row, column or diagonal to score.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_highlightMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_onHighlightColour:"#FFF",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_secondaryContainerColour:"#F4F2F2",css_variables_secondaryMainColour:"#D6D5D5",css_variables_onSecondaryContainerColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}.",label_tab_how:"How to play",label_bingo_deal_label:"Deal my boards",label_bingo_which_label:"Board {n} of {of}",label_bingo_previous_label:"The board before this one",label_bingo_next_label:"The next board",label_bingo_flip_hint:"Tap to see what this means",label_bingo_choose_note:"Compare your boards, then lock your favourite. You cannot swap after locking.",label_bingo_watch_note:"Your board is locked. Cards mark themselves as things happen.",label_bingo_watching_label:"Your board is live",label_bingo_one_away_label:"One to go",label_bingo_line_label:"You have a line",label_bingo_called_label:"{n} of {of} called",label_bingo_free_label:"Free",label_bingo_hit_label:"Happened",label_bingo_miss_label:"Did not happen",label_bingo_result_note:"Round over \xB7 lines completed: {n}",label_won_label:"Bingo!",label_finished_label:"Round over",label_score_label:"Score",label_round_locked_label:"This round has locked.",label_refused:"That did not go through. Try again.",label_refused_moved:"The round changed while you were playing. Here it is again."}},shoot:{background:"#FCFBFB",settings:{play_button_label:"Shoot",how_to_play:"Pick a spot and a power, then shoot. The keeper decides the rest.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_positiveContainerColour:"#F4F2F2",css_variables_onPositiveColour:"#FFF",css_variables_onNegativeColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_share_text:"I scored {score} on {game}."}},arcade:{background:"#FCFBFB",settings:{play_button_label:"Play",how_to_play:"Steer left and right to dodge the blocks. The longer you last, the more you score. Your best run goes on the board.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_positiveMainColour:"#2E7D51",css_variables_tertiaryContainerColour:"#F4F2F2",css_variables_onTertiaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",css_variables_onPositiveContainerColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_onNegativeColour:"#FFF",css_variables_onNegativeContainerColour:"#232020",css_variables_negativeContainerColour:"#F4F2F2",primary_colour:"#D82F20",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name and scores back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",label_come_back:"Come back soon.",share_button_label:"Share result",label_share_text:"I scored {score} in {game}.",label_score:"Score",label_best:"Your best",label_board_title:"Leaderboard",label_you:"You",label_run_counted:"Run saved. Your best is {best}, {rank} of {of}.",label_run_saved_unranked:"Run saved. You scored {score}. It isn't on the board.",label_run_not_counted:"That run didn't count.",label_sign_in:"Sign in to keep your score.",label_try_later:"Too many runs just now. Try again in a minute.",label_board_empty:"No scores yet. Be the first.",label_checked_note:"Scores are checked against how long each run lasted.",label_choose_name:"Choose your name",label_name_prompt:"Pick two words. This is the name other players see on the board.",label_name_save:"Save name",label_name_saved:"Saved. Other players will see you as {name}.",label_name_failed:"Your name didn't save. Check your connection and try again."}},word_guess:{background:"#FCFBFB",settings:{play_button_label:"Enter",how_to_play:"Type a word and press Enter. Green: right letter, right place. Amber: in the word, wrong place. Grey: not in the word.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",label_board:"Your guesses, {length} letters each",label_delete:"Delete",label_mark_correct:"right place",label_mark_present:"in the word, wrong place",label_mark_absent:"not in the word",label_too_short:"Not enough letters",label_not_in_word_list:"Not in the word list",label_letters_only:"Letters only",label_already_guessed:"You have tried that word",label_answer:"The word was {answer}.",label_share_text:"{game} {score}",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_copied:"Copied",label_better_than:"Better than {percent}% of players",label_won:"You got it in {used} of {allowed}.",label_lost:"Out of guesses.",label_picture:"The picture for this round",label_round_moved:"This round has moved on. Your guess was not used.",label_guess_failed:"Your guess did not reach the game. Check your connection and try again.",label_guess_refused:"That guess was not accepted. Try another.",label_points:"{points} points",label_one_point:"1 point",label_how_to_play:"How to play"}},number_guess:{background:"#FCFBFB",settings:{play_button_label:"Guess",how_to_play:"Type a year and press Guess. You are told whether the answer is higher or lower, and each miss earns a clue.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",label_your_guess:"Your guess",label_skip:"Skip for a clue",label_guesses_left:"{left} of {allowed} guesses left",label_higher:"Higher",label_lower:"Lower",label_correct:"Correct",label_wrong:"Not it",label_skipped:"Skipped",label_clues:"Clues",label_clues_waiting:"Each wrong guess or skip earns the next clue.",label_not_a_number:"Type a number",label_already_guessed:"You have tried that one",label_answer:"The answer was {answer}.",label_share_text:"{game} {score}",play_again_label:"Play next",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",share_button_label:"Share result",label_copied:"Copied",label_better_than:"Better than {percent}% of players",label_won:"You got it in {used} of {allowed}.",label_lost:"Out of guesses.",label_picture:"The picture for this round",label_round_moved:"This round has moved on. Your guess was not used.",label_guess_failed:"Your guess did not reach the game. Check your connection and try again.",label_guess_refused:"That guess was not accepted. Try another.",label_points:"{points} points",label_one_point:"1 point"}},phrase_solve:{background:"#FCFBFB",settings:{play_button_label:"Spin",how_to_play:"Press Spin to reveal a letter of the phrase. After each letter, type your answer and press Solve, or spin again. One wrong answer ends the round, so be sure.",css_variables_backgroundContainerColour:"#FCFBFB",css_variables_backgroundMainColour:"#F4F2F2",css_variables_onBackgroundColour:"#232020",css_variables_negativeMainColour:"#D82F20",css_variables_negativeContainerColour:"#F4F2F2",css_variables_onNegativeContainerColour:"#232020",css_variables_positiveMainColour:"#2E7D51",css_variables_onPositiveColour:"#FFF",css_variables_tertiaryMainColour:"#9A6200",css_variables_onTertiaryColour:"#FFF",css_variables_secondaryMainColour:"#6B6868",css_variables_onSecondaryColour:"#FFF",css_variables_secondaryContainerColour:"#E6E3E3",css_variables_onSecondaryContainerColour:"#232020",css_variables_highlightMainColour:"#232020",css_variables_onHighlightColour:"#FFF",primary_colour:"#232020",splash_play_label:"Play",splash_continue_label:"Continue",splash_error_text:"The game didn't load. Check your connection and try again.",splash_retry_label:"Try again",recovery_open_label:"Your progress",recovery_show_title:"Keep your progress",recovery_show_detail:"Save this code. It brings your name, scores and achievements back on another phone or browser. You only see it once.",recovery_private_note:"Keep it private. Anyone with this code can play as you.",recovery_replace_note:"Getting a new code stops the old one working.",recovery_enter_title:"I've played before",recovery_enter_detail:"Type the recovery code you saved to get your progress back.",recovery_submit_label:"Get my progress back",recovery_not_recognised:"That code isn't one we know. Check it against the one you saved.",recovery_restored:"Welcome back. Your progress is on this device now.",recovery_get_label:"Get a recovery code",recovery_issue_failed:"That didn't work. Check your connection and try again.",recovery_copy_label:"Copy",recovery_copied_label:"Copied",recovery_share_label:"Share",recovery_close_label:"Close",consent_title:"Your privacy",consent_detail:"{brand} would like to record analytics on how you play, so we can improve the game. We only do this if you agree. Data needed to run the game, such as your scores, is processed on the basis of legitimate interests.",consent_accept_label:"Accept all",consent_reject_label:"Reject all",consent_choose_label:"Manage preferences",consent_save_label:"Save my choices",consent_analytics_label:"Measure how the game is played",consent_marketing_label:"Offers and news from the game's owner",consent_functional_label:"Remember my preferences",consent_settings_label:"Privacy settings",play_again_label:"Play next",share_button_label:"Share result",label_how_to_play:"How to play",label_board:"The phrase, {words} words",label_blank:"blank",label_draws_left:"{left} of {allowed} letters left to draw",label_last_draw:"No letters left to draw. Solve it, or give up.",label_drawn_one:"There is one {letter}.",label_drawn_many:"There are {count} {letter}s.",label_drawn_none:"Every letter is showing. Solve it.",label_letters_drawn:"Letters drawn",label_your_answer:"Your answer",label_solve:"Solve",label_skip:"Spin again",label_give_up:"Give up",label_answer_missing:"Type your answer first.",label_spin_first:"Spin for a letter first.",label_one_guess_per_letter:"You have had your answer for this letter. Spin again.",label_answer_refused:"That answer was not accepted. Try again.",label_round_moved:"This round has moved on. Your answer was not used.",label_play_failed:"That did not reach the game. Check your connection and try again.",label_won:"Solved with {used} of {allowed} letters.",label_lost_wrong:"Not this time.",label_lost_out:"Out of letters.",label_answer:"The phrase was {answer}.",label_points:"{points} points",label_one_point:"1 point",label_share_text:"I solved {game} with {used} of {allowed} letters.",label_share_lost:"{game} beat me today.",label_copied:"Copied",label_come_back:"Come back tomorrow",label_streak_days:"{days} days in a row",label_offline:"You are offline. Your letters are safe; this will pick up when the connection is back.",label_reconnecting:"Reconnecting\u2026",label_still_offline:"Still cannot reach the game. Check your connection.",label_stored_copy:"Playing a stored copy of this round. Live updates are not reaching this page, so anything changed recently will not show. Reload to try again."}}}});import{readFile as W1}from"node:fs/promises";import{dirname as dU,join as uU,relative as Lae,resolve as mU,sep as zae}from"node:path";function We(e){let t=Nt(e);return t.ok&&t.manifest.backend.round!==void 0?{ok:!1,issues:[{path:"backend.round",message:Ua}]}:t}function Uu(e){let t=e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"");return t===Fa||t.startsWith(`${Fa}/`)}async function kr(e){let t=uU(dU(mU(e)),Le),o;try{o=await W1(t,"utf8")}catch{return{ok:!1,missing:!0,path:t}}let r;try{r=ht.load(o,{schema:ht.CORE_SCHEMA})}catch(a){return{ok:!1,missing:!1,path:t,problems:[a instanceof Error?a.message:"It is not valid YAML."]}}let n=Ve.safeParse(r);return n.success?{ok:!0,round:n.data,path:t}:{ok:!1,missing:!1,path:t,problems:n.error.issues.map(a=>`${a.path.length?a.path.join("."):"(round)"} ${a.message}`)}}function Gu(e){if(e.archetype!=="hunt"||!e.guess&&!e.solve)return e;let t=new Set(["board","targets","attemptsAllowed","mistakesAllowed","pointsPerTarget","completionBonus"]);return Object.fromEntries(Object.entries(e).filter(([o])=>!t.has(o)))}function H1(e){return`# A practice round, for this laptop only. Fans never see it.
19625
19625
  #
19626
19626
  # gamestage dev, verify and review play it. gamestage deploy never uploads
19627
19627
  # this folder. Real rounds are written in Monterosa Studio;
@@ -19824,7 +19824,7 @@ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
19824
19824
  `),this.outputHelp({error:!0}));let r=o||{},n=r.exitCode||1,a=r.code||"commander.error";this._exit(n,a,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in Ue.env){let o=t.attributeName();(this.getOptionValue(o)===void 0||["default","config","env"].includes(this.getOptionValueSource(o)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,Ue.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Mu(this.options),o=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&o(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(n=>!o(n)).forEach(n=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(t){let o=`error: missing required argument '${t}'`;this.error(o,{code:"commander.missingArgument"})}optionMissingArgument(t){let o=`error: option '${t.flags}' argument missing`;this.error(o,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let o=`error: required option '${t.flags}' not specified`;this.error(o,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,o){let r=i=>{let c=i.attributeName(),d=this.getOptionValue(c),l=this.options.find(p=>p.negate&&c===p.attributeName()),u=this.options.find(p=>!p.negate&&c===p.attributeName());return l&&(l.presetArg===void 0&&d===!1||l.presetArg!==void 0&&d===l.presetArg)?l:u||i},n=i=>{let c=r(i),d=c.attributeName();return this.getOptionValueSource(d)==="env"?`environment variable '${c.envVar}'`:`option '${c.flags}'`},a=`error: ${n(t)} cannot be used with ${n(o)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let o="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],a=this;do{let i=a.createHelp().visibleOptions(a).filter(c=>c.long).map(c=>c.long);n=n.concat(i),a=a.parent}while(a&&!a._enablePositionalOptions);o=yk(t,n)}let r=`error: unknown option '${t}'${o}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let o=this.registeredArguments.length,r=o===1?"":"s",n=t.length,a=this.parent?` for '${this.name()}'`:"",i=t.join(", "),c=`error: too many arguments${a}. Expected ${o} argument${r} but got ${n}: ${i}.`;this.error(c,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],o="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(a=>{n.push(a.name()),a.alias()&&n.push(a.alias())}),o=yk(t,n)}let r=`error: unknown command '${t}'${o}`;this.error(r,{code:"commander.unknownCommand"})}version(t,o,r){if(t===void 0)return this._version;this._version=t,o=o||"-V, --version",r=r||"output the version number";let n=this.createOption(o,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
19825
19825
  `),this._exit(0,"commander.version",t)}),this}description(t,o){return t===void 0&&o===void 0?this._description:(this._description=t,o&&(this._argsDescription=o),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let o=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(o=this.commands[this.commands.length-1]),t===o._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(t);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return o._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(o=>this.alias(o)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let o=this.registeredArguments.map(r=>Du(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?o:[]).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=eo.basename(t,eo.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let o=this.createHelp(),r=this._getOutputContext(t);o.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=o.formatHelp(this,o);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let o=!!t.error,r,n,a;return o?(r=c=>this._outputConfiguration.writeErr(c),n=this._outputConfiguration.getErrHasColors(),a=this._outputConfiguration.getErrHelpWidth()):(r=c=>this._outputConfiguration.writeOut(c),n=this._outputConfiguration.getOutHasColors(),a=this._outputConfiguration.getOutHelpWidth()),{error:o,write:c=>(n||(c=this._outputConfiguration.stripColor(c)),r(c)),hasColors:n,helpWidth:a}}outputHelp(t){let o;typeof t=="function"&&(o=t,t=void 0);let r=this._getOutputContext(t),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let a=this.helpInformation({error:r.error});if(o&&(a=o(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(a),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(t,o){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",o??"display help for command"),(t||o)&&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 o=Number(Ue.exitCode??0);o===0&&t&&typeof t!="function"&&t.error&&(o=1),this._exit(o,"commander.help","(outputHelp)")}addHelpText(t,o){let r=["beforeAll","before","after","afterAll"];if(!r.includes(t))throw new Error(`Unexpected value for position to addHelpText.
19826
19826
  Expecting one of '${r.join("', '")}'`);let n=`${t}Help`;return this.on(n,a=>{let i;typeof o=="function"?i=o({error:a.error,command:a.command}):i=o,i&&a.write(`${i}
19827
- `)}),this}_outputHelpIfRequested(t){let o=this._getHelpOption();o&&t.find(n=>o.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function U1(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let o,r="127.0.0.1",n="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?o=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(o=a[1],/^\d+$/.test(a[3])?n=a[3]:r=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(o=a[1],r=a[3],n=a[4]),o&&n!=="0"?`${o}=${r}:${parseInt(n)+1}`:t})}function G1(){if(Ue.env.NO_COLOR||Ue.env.FORCE_COLOR==="0"||Ue.env.FORCE_COLOR==="false")return!1;if(Ue.env.FORCE_COLOR||Ue.env.CLICOLOR_FORCE!==void 0)return!0}var Sae=new ja;xe();gn();Ie();import{mkdir as nU,readFile as oU,writeFile as rU}from"node:fs/promises";import{dirname as aU,join as iU,relative as sU,resolve as cU}from"node:path";async function lU(e,t){let o;try{o=await oU(e,"utf8")}catch{return"absent"}return o===t?"same":"different"}async function B1(e,t,o){let r=iU(e,t),n=await lU(r,o);try{await nU(aU(r),{recursive:!0}),await rU(r,o,"utf8")}catch{throw S(`Cannot write ${r}.`),new Error("unreachable")}return{where:sU(process.cwd(),r)||t,state:n}}async function q1(e){let t=cU(e.out??"."),o=await B1(t,tt,to),r=await B1(t,wt,Da),n=`import { start } from "./${tt}";`,a=`import { createPlayerClient, newIdempotencyKey } from "./${wt}";`,i=o.state==="same"&&r.state==="same";if(C())return L({ok:!0,status:i?"unchanged":"written",files:[{path:o.where,digest:jn,import:n},{path:r.where,digest:vr,import:a}],path:o.where,digest:jn,import:n});I(i?"Already current":"Wrote the Gamestage client"),A("Library",`${o.where} (${jn})`),A("Player client",`${r.where} (${vr})`),h(),k(`Import it: ${w.cyan(n)}`),k(`The player API on its own: ${w.cyan(a)}`),(o.state==="different"||r.state==="different")&&k("An earlier copy was replaced. It is generated, so nothing of yours was in it."),h()}zt();Wo();xe();gn();hn();No();import{mkdir as h_,readdir as hO,readFile as PB,stat as RB,writeFile as mc}from"node:fs/promises";import{basename as NB,dirname as pc,join as LB}from"node:path";import{createInterface as zB}from"node:readline/promises";import{createHash as fO}from"node:crypto";import{randomUUID as SB}from"node:crypto";var TB=/-[0-9a-f]{4}$/;function um(e){return`${e}-${SB().replace(/-/g,"").slice(0,4)}`}function lO(e){return TB.test(e)}rt();Nn();var ro="favicon.svg",dc=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
19827
+ `)}),this}_outputHelpIfRequested(t){let o=this._getHelpOption();o&&t.find(n=>o.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function U1(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let o,r="127.0.0.1",n="9229",a;return(a=t.match(/^(--inspect(-brk)?)$/))!==null?o=a[1]:(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(o=a[1],/^\d+$/.test(a[3])?n=a[3]:r=a[3]):(a=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(o=a[1],r=a[3],n=a[4]),o&&n!=="0"?`${o}=${r}:${parseInt(n)+1}`:t})}function G1(){if(Ue.env.NO_COLOR||Ue.env.FORCE_COLOR==="0"||Ue.env.FORCE_COLOR==="false")return!1;if(Ue.env.FORCE_COLOR||Ue.env.CLICOLOR_FORCE!==void 0)return!0}var Tae=new ja;xe();gn();Ie();import{mkdir as nU,readFile as oU,writeFile as rU}from"node:fs/promises";import{dirname as aU,join as iU,relative as sU,resolve as cU}from"node:path";async function lU(e,t){let o;try{o=await oU(e,"utf8")}catch{return"absent"}return o===t?"same":"different"}async function B1(e,t,o){let r=iU(e,t),n=await lU(r,o);try{await nU(aU(r),{recursive:!0}),await rU(r,o,"utf8")}catch{throw S(`Cannot write ${r}.`),new Error("unreachable")}return{where:sU(process.cwd(),r)||t,state:n}}async function q1(e){let t=cU(e.out??"."),o=await B1(t,tt,to),r=await B1(t,wt,Da),n=`import { start } from "./${tt}";`,a=`import { createPlayerClient, newIdempotencyKey } from "./${wt}";`,i=o.state==="same"&&r.state==="same";if(C())return L({ok:!0,status:i?"unchanged":"written",files:[{path:o.where,digest:jn,import:n},{path:r.where,digest:vr,import:a}],path:o.where,digest:jn,import:n});I(i?"Already current":"Wrote the Gamestage client"),A("Library",`${o.where} (${jn})`),A("Player client",`${r.where} (${vr})`),h(),k(`Import it: ${w.cyan(n)}`),k(`The player API on its own: ${w.cyan(a)}`),(o.state==="different"||r.state==="different")&&k("An earlier copy was replaced. It is generated, so nothing of yours was in it."),h()}zt();Wo();xe();gn();hn();No();import{mkdir as h_,readdir as hO,readFile as PB,stat as RB,writeFile as mc}from"node:fs/promises";import{basename as NB,dirname as pc,join as LB}from"node:path";import{createInterface as zB}from"node:readline/promises";import{createHash as fO}from"node:crypto";import{randomUUID as SB}from"node:crypto";var TB=/-[0-9a-f]{4}$/;function um(e){return`${e}-${SB().replace(/-/g,"").slice(0,4)}`}function lO(e){return TB.test(e)}rt();Nn();var ro="favicon.svg",dc=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
19828
19828
  <rect width="32" height="32" rx="7" fill="#1b1c1f"/>
19829
19829
  <path d="m12 8 12 8-12 8Z" fill="#fff"/>
19830
19830
  </svg>
@@ -19886,19 +19886,19 @@ let size=160;
19886
19886
  while(logo.scrollWidth>600&&size>40){size-=4;logo.style.fontSize=size+"px";}
19887
19887
  document.fonts.ready.then(()=>{while(logo.scrollWidth>600&&size>40){size-=4;logo.style.fontSize=size+"px";}document.body.dataset.ready="1";});
19888
19888
  </script></body></html>`}async function vO(e,t,o=()=>Qt()){let r;try{r=await o()}catch(a){return{png:null,reason:a instanceof Error?a.message:String(a)}}if(r.status!=="available")return{png:null,reason:r.detail};let n=r.browser;try{return await n.navigate(`data:text/html;base64,${Buffer.from(ZB(e,t)).toString("base64")}`),await n.waitForSelector("body[data-ready]",1e4).catch(()=>{}),{png:await n.screenshot(1200,630)}}catch(a){return{png:null,reason:a instanceof Error?a.message:String(a)}}finally{await n.close()}}qk();Za();zt();Ka();Ie();Rn();Sk();Wk();xe();zt();import{readFile as ei}from"node:fs/promises";import{createHash as JB}from"node:crypto";var gc="Replace this in Studio";function kO(e){return e==="predict"?{studioSeed:Ve.parse({archetype:e,number:1,prompt:`${gc}: the question`,options:[1,2].map(t=>({key:`option-${t}`,label:`${gc}: option ${t}`})),open:!1})}:e==="bingo"?{studioSeed:Ve.parse({archetype:e,number:1,prompt:gc,rows:3,columns:3,centreMode:"free",lineTypes:["row","column","diagonal"],cardPool:Array.from({length:9},(t,o)=>({key:`card-${o+1}`,label:`${gc}: card ${o+1}`})),open:!1})}:{}}async function _O(e){try{let t=await ei(e,"utf8");return`c${JB("sha256").update(t).digest("hex").slice(0,8)}`}catch{return"local"}}async function xO(e){try{return await ei(e,"utf8")}catch{return}}async function SO(e){try{let t=We(await ei(e,"utf8"));return t.ok?Lt(t.manifest).computed:"L0"}catch{return"L0"}}async function TO(e){try{let t=We(await ei(e,"utf8"));return t.ok?t.manifest.live?{provider:t.manifest.live.provider}:null:void 0}catch{return}}async function EO(e){try{let t=We(await ei(e,"utf8"));return t.ok?t.manifest.round_fields??null:void 0}catch{return}}async function $O(e){try{let t=We(await ei(e,"utf8"));if(!t.ok)return;let{provider:o,jwt:r,identify:n,require_authenticated_writes:a}=t.manifest.identity,i=a!==void 0?{require_authenticated_writes:a}:{};return o==="identify"?n?{identify:{strategy:n.strategy,provider:n.provider,...n.assertion?{assertion:!0}:{}},...i}:void 0:r?{issuer:r.issuer,jwks_uri:r.jwks_uri,...r.audience?{audience:r.audience}:{},...r.player_id_claim?{player_id_claim:r.player_id_claim}:{},...i}:void 0}catch{return}}No();xe();function AO(e){let{before:t,pinned:o,uploaded:r,stored:n,current:a}=e;if(!r){let c=fr(n??t,a);return c.state!=="behind"?[]:[`No files were uploaded, so this game's pages still load Gamestage client ${c.pinned} and the current one is ${c.current}. To move them, deploy again with --dir.`]}if(!o)return[];let i=fr(o,a);if(i.state==="behind")return[`A page imports Gamestage client ${i.pinned} by its full URL, which a deploy does not rewrite, so it still loads ${i.pinned} rather than ${i.current}. Change that import to ./gamestage.js and deploy again.`];if(i.state==="current"&&t){let c=Po(t,i.pinned);if(c!==null&&c<0)return[`This game was on Gamestage client ${t}. This deploy moved it to ${i.pinned}, the current one.`]}return[]}function CO(e,t){if(!e.playgroundUrl)return;let o=fr(e.clientVersion,t);switch(o.state){case"current":return`${o.pinned}, the current one`;case"behind":return`${o.pinned}, older than ${o.current}. To move it, redeploy from the game's folder with ${BC(e.id)}`;case"ahead":return`${o.pinned}, newer than this CLI's ${o.current}. Update with npx gamestage@latest`;case"unknown":return"unknown until the next deploy"}}import{randomUUID as XB}from"node:crypto";function IO(e,t=XB()){let o=0,r=0,n=()=>o>0&&r===0;return{client:Object.assign(Object.create(e),{async uploadTarget(i,c){let d=await e.uploadTarget(i,c,t);if(d.deployId===t?o+=1:r+=1,o>0&&r>0)throw new Error("The control plane changed version during this deploy, so some files were staged and some went straight to the live folder. Deploy again to publish the whole game.");return d},async pruneBundle(i,c){n()||await e.pruneBundle(i,c)}}),deployId:t,staged:i=>n()?{id:t,replace:i}:void 0}}function yc(e,t){if(!e.refused)return!1;if(e.code==="nothing_to_do")return C()?(L({ok:!0,status:"nothing_to_do",action:t,reason:e.refused,game:e.game}),!0):(I("Nothing to do"),h(` ${e.refused}`),!0);if(process.exitCode=1,C())return L({ok:!1,status:"refused",action:t,code:e.code,reason:e.refused,...e.candidateSpaces?{candidateSpaces:e.candidateSpaces}:{},game:e.game}),!0;if(I("Not done"),h(` ${e.refused}`),e.candidateSpaces&&e.candidateSpaces.length>0){h(),h(" Spaces you can deploy into:");for(let o of e.candidateSpaces)h(` --space ${o.spaceId} (${o.org})`)}return h(),!0}function k_(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 o=Tw(e,{tier:t});if(o==="prod")return{stage:o};let r=!!e.prodApproval,n=!Qd(t);return!r&&!n?{stage:o,reason:"waiting on your approval, run `gamestage promote`, and on your workspace's plan, which only Monterosa can move"}:r?{stage:o,reason:"approved, but your workspace's plan does not carry prod yet, which only Monterosa can move"}:{stage:o,reason:"waiting on your approval, run `gamestage promote`"}}async function NO(e){if(!e)return!1;try{let t=await fetch(e,{method:"HEAD",signal:AbortSignal.timeout(5e3)});return t.status===403||t.status===404}catch{return!1}}function LO(e,t=e.playgroundUrl,o,r,n=!1){if(A("Game",`${e.name} (${e.id})`),A("State",r?`${e.state}, ${r}`:e.state),n)A("Serving",`page not uploaded: redeploy from the game's folder with \`gamestage deploy ${e.id} --dir .\``);else if(o!==void 0){let{stage:a,reason:i}=k_(e,o);A("Serving",a==="prod"?"prod":`dev: ${i}`)}A("Build stage",e.conformance),A("Revision",`${e.manifestRevision} (${e.contentHash})`),t&&A("Playground",t),e.playerEndpoint&&A("Player API",e.playerEndpoint),A("Manage",Aa(e.id)),e.studioUrl&&A("Studio",e.studioUrl),A("Docs",h1(e.archetype))}function n5(e){let t=e?.games;if(Array.isArray(t))return t.filter(o=>o&&o.state!=="archived").map(o=>({id:o.id,name:o.name??o.id,state:o.state??"unknown"}))}async function zO(e){let t=await Qn(),o=t.email??t.userId??"unknown",r=await Lo(),n=await Fs(r),a=Us(n);if(a.ok||S(a.message,a.next),a.access==="pending"||a.access==="refused"){let i=a.access==="pending"&&"workspace"in n?n5(n.workspace):void 0,c=PA.runtime.devGames;if(C())return L({ok:!0,status:a.status,access:a.access,...a.code?{code:a.code}:{},message:a.message,next:a.next,email:o,...i?{games:i,gameLimit:{used:i.length,allowed:c}}:{}});if(I("Your account"),A("Signed in as",o),A("Access",a.access),za(a),i){I(`Your games (${i.length} of ${c} before approval)`),i.length||h(" None yet. Run `gamestage manifest register` in a game's folder to register one.");for(let d of i)A(d.id,`${d.name}, ${d.state}`);i.length>=c&&(h(),h(` That is all ${c}. Run \`gamestage archive <game>\` to make room for another.`)),h()}return}try{if(e){let u=await r.getGame(e);u||S(...HO(e));let p=await r.getWorkspaceSummary().then(U=>U.tier).catch(()=>{}),{stage:f,reason:g}=k_(u,p),b=u.state!=="archived"&&await NO(u.playgroundUrl),v=$a(await r.getLogs(e)),x=Sr(u);if(C())return L({ok:!0,stage:f,...g?{stageReason:g}:{},...b?{pageUploaded:!1}:{},lastProblem:v??null,roundLine:__(u)[0],...x?{arcade:{limits:x.deployed,state:x.state}}:{},...u.playgroundUrl?{client:fr(u.clientVersion,Dn)}:{},game:u});I(u.name),v&&A("Last pickup error",v),LO(u,void 0,p,void 0,b);let R=CO(u,Dn);R&&A("Client",R),p===void 0&&A("Serving",`unchecked: ${g}`),h();for(let U of __(u))h(U);let F=Ck(u.id,x);if(F.values.length){h();for(let[U,W]of F.values)A(U,W);for(let U of F.notes)k(U)}if(u.meters.length){h();for(let U of u.meters){let W=Math.round(NA(U)*100);A(U.label,`${U.used} of ${U.limit}${U.unit} (${W}%)`)}}h();return}let i="workspace"in n&&n.workspace?n.workspace:await r.getWorkspace(),c=i.games.length,d=typeof i.gamesTotal=="number"?i.gamesTotal:void 0;if(C())return L({ok:!0,status:a.status,access:a.access,games_total:d??null,games_shown:c,workspace:{...i,games:i.games.map(u=>{let{stage:p,reason:f}=k_(u,i.tier);return{...u,stage:p,...f?{stageReason:f}:{}}})}});if(I(i.name),A("Signed in as",o),A("Access",a.access??"not reported by this control plane"),A("Tier",i.tier),A("Games",d===void 0?`${c} listed, and this control plane does not report a total`:`${d} ${d===1?"game":"games"}`),h(),d===0){k("No games yet. `gamestage create` or `gamestage inspect .` starts one."),h();return}for(let u of i.games)A(u.name,`${u.state}${u.playgroundUrl?"":" (never deployed)"}`);d!==void 0&&c<d&&(h(),k(`Showing ${c} of ${d} games.`));let l=RA(i.meters);if(l.length){h(),I("At a cap");for(let u of l)k(`${u.label}: ${u.used} of ${u.limit}${u.unit}`)}h()}catch(i){await pe(i)}}async function o5(e,t){let o;try{o=await Ho(e,"utf8")}catch{t&&S(`Cannot read ${e}.`);return}let r=We(o);if(!r.ok){S(yn(e,r.issues),r.issues.map(a=>`${a.path} ${a.message}`));return}let n=await kr(e);return{...n.ok?{round:n.round}:{},...r.ok&&r.manifest.backend.archetype?{archetype:r.manifest.backend.archetype}:{}}}var r5="Playable: each play is a run on the Arcade Engine, with no rounds to write";function __(e){let t=e.studioUrl??Aa(e.id);if(!fd(e.archetype))return[r5,` ${t}`];let o=e.rounds??[],r=o.find(a=>a.state==="open")??o[o.length-1];if(!r)return["No round yet: add one in Studio",` ${t}`];let n=typeof r.edition=="string"&&r.edition.trim()?r.edition.trim():void 0;return n?[`Round: Studio, edition ${n}`,` ${t}`]:[`Round: Studio, round "${r.label}"`,` ${t}`]}async function a5(e){try{let t=await no(oc(e));return vC(t.map(o=>o.text).join(`
19889
- `))}catch{return}}async function i5(e){try{let t=We(await Ho(e,"utf8"));return t.ok?t.manifest.experience?.design?.system:void 0}catch{return}}async function PO(e){try{let t=We(await Ho(e,"utf8"));return t.ok?t.manifest.app.title:void 0}catch{return}}async function s5(e){let t=Nd(e.titleFont,e.titleFontWeight);if(!t)return;let o=[...new Set([..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 $&!?.,'-:+#@",...e.logoText??"",...e.name??""])].filter(a=>a!=="["&&a!=="]").join(""),r=`https://fonts.googleapis.com/css2?family=${t.family.replace(/ /g,"+")}:wght@${t.weight}&text=${encodeURIComponent(o)}`,n="Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36";try{let a=await fetch(r,{headers:{"user-agent":n},signal:AbortSignal.timeout(8e3)});if(!a.ok)return;let i=/url\((https:[^)]+)\)\s*format\(['"]woff2['"]\)/.exec(await a.text())?.[1];if(!i)return;let c=await fetch(i,{signal:AbortSignal.timeout(8e3)});if(!c.ok)return;let d=Buffer.from(await c.arrayBuffer());return d.length>0&&d.length<6e4?d.toString("base64"):void 0}catch{return}}function c5(e){if(e.manifest)return e.manifest;let t=e.dir??(e.file?fm(e.file):void 0);return t&&(OO(b_(t,"gamestage.yaml"))||OO(b_(t,It)))?b_(t,"gamestage.yaml"):"gamestage.yaml"}async function jO(e,t){t.file&&t.dir&&S("Choose either --file or --dir for a deploy, not both.");let{client:o}=await be(),r=c5(t);if(t.file||t.dir){let u=await o.getWorkspaceSummary().catch(()=>{}),p=u?EA(u):null;p&&S("Nothing was uploaded.",[p.refused])}let n=await o5(r,!!t.manifest),a=n?.round,i=await bn(r);if(i.problems.length>0&&S(`${It} cannot be used as it is.`,i.problems),t.file||t.dir){let u=gm(t.dir??fm(t.file)),p=await no(oc(u)),f=Bu(i.settings,p);f.length>0&&S("This game's page keeps its own copy of settings that live in Studio.",[qu(f)]);let{unnamed:g}=Ba(i.settings,p);g.length>0&&S("Some of this game's words would never reach Studio, so nothing was published.",[qa(g)])}if((t.file||t.dir)&&await b5(i.settings,r,e,await om(o)),t.file||t.dir){let u=gm(t.dir??fm(t.file)),p=em(await no(oc(u)));p.length>0&&S("This game loads a font from a third party.",[tm(p)])}let c=await i5(r);if(c&&(t.file||t.dir)){let u=gm(t.dir??fm(t.file)),p;try{p=await o.listDesignSystems?.()}catch{p=void 0}p||S(`Cannot confirm the theme this game pins, ${c}.`,["Your org's themes could not be read, so the deploy stops rather than publish a game whose look nobody checked. Run it again; if it keeps failing, run gamestage theme list."]);let f=nu(c,await no(oc(u)),p);f.length>0&&S(`This game cannot wear its pinned theme, ${c}.`,f)}let d=br(i.settings??{},await PO(r)??e);d.logoFontData=await s5(d);let l={settings:i.settings??{},fallbackTitle:await PO(r)??e};try{let u,p=M=>y5(e,M,r,t.check!==!1),f=n?.archetype?De(n.archetype):void 0,g=pm(r),b={...a?{round:a}:{},...t.allow?.length?{allow:t.allow}:{}},v=await o.getGame(e).then(M=>M?.clientVersion).catch(()=>{}),x=new Set,R=IO(o);t.file?u=await l5(R.client,e,t.file,b,d,p,l,f,x,g):t.dir&&(u=await g5(R.client,e,t.dir,b,d,p,l,f,x,g));let F=R.staged(!!t.dir),U=qC(x);!t.file&&!t.dir&&!C()&&h(w.dim(` No --dir or --file, so no files are uploaded: the page already live, if any, stays as it is. To publish this folder, run \`gamestage deploy ${e} --dir .\`.`));let W=t.revision??await _O(r),T=await o.deploy(e,{manifestRevision:W,contentHash:t.hash??`sha256:${W}`,conformance:t.level??await SO(r),...await xO(r).then(M=>M===void 0?{}:{manifestSource:M}),...i.settings?{settings:i.settings}:{},offersPrize:!!t.prize,...await TO(r).then(M=>M===void 0?{}:{live:M}),...await EO(r).then(M=>M===void 0?{}:{roundFields:M}),...kO(n?.archetype),...await $O(r).then(M=>M===void 0?{}:{identity:M}),...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.space?.trim()?{studioSpace:t.space.trim()}:{},...t.spaceOrg?.trim()?{studioSpaceOrg:t.spaceOrg.trim()}:{},...t.dir?{wording:await a5(t.dir)}:{},...U?{clientVersion:U}:{},...F?{staged:F}:{}});if(T.refused&&T.code==="round_source_unreadable"&&(T.refused=Hv(T.game,{ok:!1,status:"failed",reason:T.refused})),yc(T,"deploy"))return;let H=await r1(o,T.game,T.roundPickupId?{pickupId:T.roundPickupId}:{});if(!H.ok){process.exitCode=1;let M=Hv(T.game,H);if(C())return L({ok:!1,status:`pickup_${H.status}`,playable:!1,reason:M,game:u?{...T.game,playgroundUrl:u}:T.game});I("Not done"),h(` ${M}`),(u??T.game.playgroundUrl)&&A("Page",u??T.game.playgroundUrl);return}let G=AO({current:Dn,before:v,pinned:U,uploaded:!!(t.file||t.dir),stored:T.game.clientVersion}),oe=H.playable&&(T.game.rounds?.length??0)===0?["The Engine pickup finished; the game is ready to play."]:__(T.game),re=await Ks(o,T.game),ie=await g_(T.game);if(C()){let M=RO(T.game.logs);return M?(process.exitCode=1,L({ok:!1,status:"refused",reason:M,game:T.game})):L({ok:!0,status:"deployed",...T.game.appSpec?.refusal?{app_spec:"refused"}:{},playable:H.playable,...re?{sourceWarning:re}:{},...ie?{keyWarning:ie}:{},roundProvisioned:H.playable,roundSource:fd(T.game.archetype)?H.playable?"studio":"none":"engine",roundLine:oe[0],...H.note?{pickupNote:H.note}:{},client:{...fr(U??T.game.clientVersion??v,Dn),...G.length?{note:G.join(" ")}:{}},game:u?{...T.game,playgroundUrl:u}:T.game})}let te=pa(T.game.containerLabel),se=pa(T.game.containerLabel,{lower:!0}),he=!H.playable&&fd(T.game.archetype);if(I("Deployed"),LO(T.game,u,void 0,he?`with no ${se} yet`:void 0,await NO(u??T.game.playgroundUrl)),h(),H.note&&(k(H.note),h()),Zs(re),y_(ie),G.length){for(let M of G)k(M);h()}if(T.game.appSpec?.refusal&&(I("But Studio would not take the game's settings"),h(` ${T.game.appSpec.refusal.reason}`),h(),k("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."),k("Deploy again once it is fixed; nothing else needs doing."),h()),u5(T.game.logs)){I("Your arcade rules take effect when the live edition ends"),h(` ${yr}`),h();let M=Ck(e,Sr(T.game));for(let[ke,Ne]of M.values)A(ke,Ne);for(let ke of M.notes.slice(1))k(ke);M.values.length&&h()}let we=m5(T.game.logs);if(we.length){I("Studio rounds updated");for(let M of we)k(M);h()}let ue=RO(T.game.logs);if(ue&&(I("Studio did not take the game"),h(` ${ue}`),h(),k("The game's files are online, but it has no Studio project, so there is nowhere to write a round yet."),k(`Deploy again once it is fixed. \`${ee(`logs ${e}`)}\` shows it again.`),h(),process.exitCode=1,he))return;if(he){for(let M of p5(T.game,se,te))h(M);h();return}await d5(u??T.game.playgroundUrl,T.game.playerEndpoint,e,t.check===!1,T.game.archetype);for(let M of oe)h(M);h(),k("Share the playground URL. It sleeps when idle and wakes on a request."),h()}catch(u){await pe(u)}}async function DO(e){let t=await Lo();try{let o=await t.archiveGame(e);if(yc(o,"archive"))return;if(C()){L({ok:!0,status:"archived",game:o.game});return}I("Archived"),A("Game",`${o.game.name} (${o.game.id})`),h(),k("Taken off the air. Its record and files are retained outside the served bundle."),h()}catch(o){await pe(o)}}async function MO(e){let{client:t}=await be();try{let o=await t.promoteGame(e);if(yc(o,"promote"))return;let r=await t.getWorkspace(),n=Tw(o.game,r),a=await Ks(t,o.game),i=await g_(o.game);if(C()){L({ok:!0,status:"promoted",stage:n,...a?{sourceWarning:a}:{},...i?{keyWarning:i}:{},game:o.game});return}I("Approved"),A("Game",`${o.game.name} (${o.game.id})`),h(),n==="prod"?k("Live. Your workspace's plan already carries prod."):k("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."),h(),Zs(a),y_(i)}catch(o){let r=o.status,n=o instanceof Error?o.message:"";if(r===404&&/unknown action/i.test(n)){if(C()){L({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}I("Not yet"),h(" This control plane does not have promotion yet."),h(),k("Your game is untouched and still serving dev."),k("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),h();return}await pe(o)}}async function FO(e){let{client:t}=await be();try{let r=(await t.getWorkspace()).games.filter(i=>i.state==="archived"&&!i.playgroundUrl&&!i.playerEndpoint&&!i.space);if(r.length===0){h("Nothing to remove. Every archived game here was deployed at some point.");return}if(!C()){I(`${r.length} archived games that never deployed`);let i=new Map;for(let c of r)i.set(c.name,(i.get(c.name)??0)+1);for(let[c,d]of[...i].sort((l,u)=>u[1]-l[1]))k(d>1?`${c} x${d}`:c);h(),k("A live game, or one that ever deployed, is refused by the server."),h()}if(!e.yes){process.stdin.isTTY||S("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let i=QB({input:process.stdin,output:process.stdout});try{if((await i.question(`Delete ${r.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){h("Nothing was deleted.");return}}finally{i.close()}}let n=0,a=[];for(let i of r){let c=await t.deleteGame(i.id);c.refused?a.push(`${i.name}: ${c.refused}`):n+=1}if(a.length>0&&(process.exitCode=1),L({ok:a.length===0,removed:n,refused:a.length}),!C()){I("Removed"),k(`${n} records gone.`);for(let i of a)k(i);h()}}catch(o){await pe(o)}}async function UO(e){let{client:t}=await be();try{let{workspace:o,refused:r,code:n}=await t.setPlan(e);if(r){if(process.exitCode=1,C()){L({ok:!1,status:"refused",action:"plan",code:n,reason:r,workspace:o});return}I("Not done"),h(` ${r}`),h();return}if(C())return L({ok:!0,workspace:o});I("Plan changed"),A("Plan",o.tier),A("Live games",String(o.liveGameAllowance||"Contracted")),h()}catch(o){await pe(o)}}async function x_(e,t){let{admin:o,email:r}=await Xt();try{let n=await o.setWorkspaceAccess(e,t),a=P1(n);if(C())return L({ok:!0,status:a.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:a.message});za(a),n.changed&&(A("Decided by",r),h())}catch(n){await pe(n)}}async function GO(){let{admin:e}=await Xt();try{let t=await e.runCreatorSync();if(C())return L({ok:!0,counts:t});I("Creator sync");for(let[o,r]of Object.entries(t??{}))A(o,String(r))}catch(t){let o=t instanceof Error?t.message:String(t);S(`The creator sync did not run: ${o}`,["It needs the Resend key in the control plane and an operator account."])}}async function BO(e,t,o){let r=R1(e,t,o.liveGames);"problem"in r&&S(r.problem,r.detail);let{request:n}=r,{admin:a,email:i}=await Xt(),c=async()=>{try{let d=await a.getWorkspace(n.workspaceId);return{reading:{tier:d.tier,liveGameAllowance:d.liveGameAllowance}}}catch(d){let l=d.status,u=d instanceof Error?d.message:String(d);return l===404&&/unknown resource/i.test(u)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:l?`${l}, ${u}`:u}}};try{let d=await c(),l=await a.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),u=await c(),p=N1({request:n,previous:d.reading,result:{refused:l?.refused,code:l?.code},stored:u.reading,unreadable:u.why});if(p.exitCode!==0&&(process.exitCode=p.exitCode),C())return L({ok:p.exitCode!==1,status:p.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:p.previous,stored:p.stored,reprovisioned:!1,code:l?.code??null,message:p.message,next:p.next});L1(p),p.status==="set"&&(A("Decided by",i),h())}catch(d){await pe(d)}}async function qO(e){let t;try{t=await Ho(e,"utf8")}catch{return S(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let o=We(t);if(!o.ok)return S(yn(e,o.issues),[...o.issues.map(i=>`${w.cyan(i.path)} ${i.message}`),"",`${w.cyan(ee(`manifest validate ${e}`))} the full report`]);let r=o.manifest,n=eA(r);if(n.length)return S(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let a=await Lo();La();try{let i=await a.registerGame(Q$(r,`sha256:${t5("sha256").update(t).digest("hex")}`));if(yc(i,"register"))return;if(C()){L({ok:!0,status:"registered",game:i.game});return}I("Registered"),A("Game",`${i.game.name} (${i.game.id})`),A("State",i.game.state),A("Conformance",i.game.conformance),h(),k(`${w.cyan(ee(`deploy ${i.game.id} --dir .`))} publish it`),h()}catch(i){await pe(i)}}async function S_(e,t){let{client:o}=await be();try{let r=await o.setAwake(e,t);if(yc(r,t?"wake":"suspend"))return;if(C()){L({ok:!0,status:r.game.state,game:r.game});return}I(t?"Awake":"Suspended"),A("Game",`${r.game.name} (${r.game.id})`),A("State",r.game.state),h(),k(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),h()}catch(r){await pe(r)}}async function WO(e,t){let{client:o}=await be();try{let r=await o.getEndpoints(e);if(r||S(...HO(e)),C())return L({ok:!0,endpoints:r});if(t==="player"||t==="control"||t==="playground"){let n=r[t];n||S(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),h(n);return}I("Endpoints"),A("Player",r.player??"not deployed"),A("Control",r.control??"not deployed"),A("Playground",r.playground??"not deployed"),h()}catch(r){await pe(r)}}function HO(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 YO(e,t){let{client:o}=await be();try{let r=await o.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await o.getGame(e).catch(()=>{}),a=n?_A(n):{state:"none"},i=xA(a);if(C())return L({ok:!0,lines:r,freshness:a});if(i&&(I("This game is serving a closed round"),h(),k(i),h()),r.length===0){I("No log lines"),h(),k("Nothing yet, or everything is older than the tier's retention."),h();return}for(let c of r){let d=c.roundId?` [${c.roundId}]`:"";h(`${c.at} ${c.level.padEnd(5)}${d} ${c.message}`)}}catch(r){await pe(r)}}async function VO(e){let{client:t}=await be();try{t.getGameUsage||S("This version of the control plane does not report usage yet.",["Try again after the next Gamestage release."]);let o=await t.getGameUsage(e);if(o||S(`${e} makes no paid AI calls, so it has no usage to report.`,["Usage is reported for Mystery games, which ask Jev."]),C())return L({ok:!0,...o});let r=n=>oC(n,o.prices.currency);I(`${e}: Jev usage`),o.note&&k(o.note),o.keyConnected===!1&&k("No TypeSafe key is connected, so this game cannot answer questions. `gamestage sources connect typesafe` gives you the link to add one."),A("Questions answered",String(o.total.questions)),A("Fans' games",String(o.total.fans)),A("Total",r(o.total.cost)),A("Per fan's game",o.perFanGame===null?"nobody has asked yet":r(o.perFanGame)),A("Priced at",rC(o.prices)),o.total.answeredWithoutJev&&k(`${o.total.answeredWithoutJev} question${o.total.answeredWithoutJev===1?" was":"s were"} answered by the fallback when Jev could not, at no cost to you.`),h();for(let n of o.rounds){let a=n.opensAt?n.opensAt.slice(0,10):n.round;h(`${a} ${String(n.questions).padStart(5)} questions ${String(n.fans).padStart(4)} fans ${r(n.cost)}`)}h()}catch(o){await pe(o)}}function w_(e=Dn,t=ot){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&S("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",`${Je}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${w.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${w.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}async function Ir(e,t,o,r){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":o,...r?{"cache-control":r}:{}}});n.ok||S(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}async function KO(e,t,o,r,n,a){let i=rm(a.settings,a.fallbackTitle),c=i.description??i.title,d=Mo(o),l=await e.uploadTarget(t,Do),u=l.publicUrl.replace(/[^/]+$/,"index.html"),p=u;if(!d.has("og:url")){let b=await(a.canonical??(x=>NI(x,{controlUrl:Re})))(t),v=Vk(a.settings[Yk]);p=b.url??v??u,k(b.url?`Link preview: points at ${p} (${b.reason}).`:v?`Link preview: points at ${p} (Canonical URL in ${It}; ${b.reason}).`:`Link preview: points at the playground, ${p} (${b.reason}). Set Canonical URL in Studio if the game is served elsewhere.`)}let f=null,g=d.get("og:image")||void 0;if(!g&&r&&(g=l.publicUrl),!g){let b=await(a.draw??vO)(n??br(a.settings,i.title),i.description);b.png?(f=b.png,g=l.publicUrl,k(`Link preview: drew ${Do} (${1200}x${630}) from the game's name and strapline.`)):k(`Link preview: no ${Do} drawn (${b.reason}). The link will unfurl without a picture; add ${Do} at ${1200}x${630} to the game folder, or install Chrome and deploy again.`)}return{tags:{title:i.title,description:c,siteName:i.siteName,url:p,image:g,imageAlt:i.description?`${i.title}: ${i.description}`:i.title,imageWidth:1200,imageHeight:630},card:f}}async function ZO(e,t,o){if(!o)return;let r=await e.uploadTarget(t,Do);await Ir(r.uploadUrl,o,"image/png",r.cacheControl)}async function l5(e,t,o,r={},n,a,i,c,d,l){let u=gm(o),p;try{p=v_(u)}catch{throw S(`Cannot read ${o}.`),new Error("unreachable")}let f=await Fk({path:u,relativePath:o},r.round);f&&S(`${o} ${f.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."]),nc(e5(o))&&S(`${o} is never published, so nothing was uploaded.`,["Source maps, round files, README files and package.json stay with your project.","Point --file at the game's HTML page, or use --dir and let the gate withhold them."]),await a?.(u);let g=await e.uploadTarget(t,"index.html"),b=i?await KO(e,t,p.toString("utf8"),!1,n,i):null,v=b?ec(p.toString("utf8"),b.tags):p.toString("utf8");await ZO(e,t,b?.card??null);let x=xk(Ws(uc(v),n),`${g.playerApiOrigin}`,t,c,l);await Ir(g.uploadUrl,x,"text/html; charset=utf-8",g.cacheControl);for(let W of kv(x))d?.add(W);/(["'])\.?\/?gamestage\.js\1/.test(x)&&d?.add(Dn);let R=await e.uploadTarget(t,wt);await Ir(R.uploadUrl,Da,"text/javascript; charset=utf-8",R.cacheControl);let F=await e.uploadTarget(t,tt);await Ir(F.uploadUrl,to,"text/javascript; charset=utf-8",F.cacheControl);let U=await e.uploadTarget(t,ro);return await Ir(U.uploadUrl,dc,"image/svg+xml",U.cacheControl),C()||(h(),k(`Uploaded ${o} to ${Hs(g)}`),k(`Wired it to ${g.playerApiOrigin} as "${t}"`),k(`Shipped @monterosa/gamestage beside it (${jn})`),k(`Shipped the player client beside it (${vr})`)),Hs(g)}async function d5(e,t,o,r,n){if(r||!e||!t)return;let{browserCheck:a}=await Promise.resolve().then(()=>(Wo(),l_));h5(await a(e,t,o,n))}function u5(e){let t=e??[],o=-1;return t.forEach((n,a)=>{/^Deployed /.test(n.message)&&(o=a)}),(o>=0?t.slice(o):t.slice(-8)).some(n=>n.message===yr)}function m5(e){let t=e??[],o=-1;return t.forEach((n,a)=>{/^Deployed /.test(n.message)&&(o=a)}),(o>=0?t.slice(o):t.slice(-8)).filter(n=>n.message.startsWith(cv)).map(n=>{let a=n.message.slice(cv.length).trim();return a.charAt(0).toUpperCase()+a.slice(1)})}function RO(e){let t=e??[],o=-1;return t.forEach((a,i)=>{/^Deployed /.test(a.message)&&(o=i)}),[...o>=0?t.slice(o):t.slice(-8)].reverse().find(a=>a.level==="error"&&/not on Interaction Cloud/.test(a.message))?.message.replace(/^The game is not on Interaction Cloud: /,"Studio answered: ")}function p5(e,t,o){let r=e.studioUrl??Aa(e.id);return[`${w.bold(`No ${t} yet: add one in Studio.`)}`,` ${w.cyan(r)}`,"",e.studioUrl?" The game is online and its Studio project exists, so a fan opening it now":" The game is online, and Stage links to its Studio project once it has one, so a fan opening it now",` finds nothing to play. Write the first ${t} in Studio and it appears`,` without another deploy. Share the game once a ${t} is on.`,"",` ${w.cyan(ee("dev --serve"))} try the game on this machine meanwhile, with practice/round.yaml or a stand-in ${o.toLowerCase()}`]}function h5(e){if(e.status==="verified"){A("Checked","the page loads and plays in a browser"),h();return}if(e.status==="skipped"||e.status==="n/a"){k(w.dim(`Not checked in a browser: ${e.detail??""}`.trim())),h();return}I("The published page did not start"),h(` ${e.detail??""}`),h(),k("The files are published, so the game is live and broken rather than unpublished."),k(`${w.cyan(ee("verify"))} the same check, with the rest of them`),h(),process.exitCode=1}function f5(e){for(let t of e.walkedPast)k(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)k(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)k(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse?.whole&&S(e.refuse.whole),e.refuse&&S(`${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 g5(e,t,o,r={},n,a,i,c,d,l){let u,p=[],f=[];try{let te=oo(o,{symlinks:"throw"});u=te.files,p=te.withheld,f=te.tooling}catch(te){throw S(te instanceof Error?te.message:`Cannot read ${o}.`),new Error("unreachable")}let g=await $I(u,{...r,exempt:[tt,wt]});for(let te of f)k(`Walked past ${te}: it belongs to your editor or agent, not your game.`);f5(g);let b=g.publish,v=b.find(te=>te.relativePath==="index.html");v||S(`Directory ${o} must contain an index.html file.`),await a?.(v.path);let x=zI(b,p);I(`Publishing ${b.length} ${b.length===1?"file":"files"} to the playground`);for(let te of x.lines)k(te);x.named.length&&(h(),k("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),h();let R=v_(v.path,"utf8"),F=i?await KO(e,t,R,b.some(te=>te.relativePath===Do),n,i):null,U=d_(R),W=b.some(te=>te.relativePath==="favicon.ico"),T=b.some(te=>te.relativePath===ro),H=!U&&!W,G=H&&!T,oe=w_();if(oe!=="0.0.0-test"){let te=`${Je}/client/${oe}/${tt}`,se=!1;try{se=(await fetch(te,{method:"HEAD"})).ok}catch{se=!0}se||S(`The client this deploy would pin, ${oe}, is not published yet.`,[`Every page uploaded here will import ${te},`,"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>/.","",`${w.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let re;for(let te of b){if(te.relativePath===tt||te.relativePath===wt)continue;let se;try{se=await e.uploadTarget(t,te.relativePath)}catch(ke){throw new Error(`${te.relativePath} cannot be published: ${ke instanceof Error?ke.message:String(ke)}`,{cause:ke})}te.relativePath==="index.html"&&(re=se);let he=v_(te.path),we=/\.(m?js)$/i.test(te.relativePath),M=/\.html$/i.test(te.relativePath)?xk(_k(te.relativePath==="index.html"?Ws((()=>{let ke=F?ec(he.toString("utf8"),F.tags):he.toString("utf8");return H?uc(ke):ke})(),n):he.toString("utf8"),w_()),se.playerApiOrigin,t,c,l):we?_k(he.toString("utf8"),w_()):he;if(typeof M=="string")for(let ke of kv(M))d?.add(ke);await Ir(se.uploadUrl,M,J1(te.relativePath),se.cacheControl)}if(await ZO(e,t,F?.card??null),G){let te=await e.uploadTarget(t,ro);await Ir(te.uploadUrl,dc,"image/svg+xml",te.cacheControl)}let ie=[...b.map(te=>te.relativePath),...G?[ro]:[],...F?.card?[Do]:[]];try{await e.pruneBundle(t,ie);for(let te of g.withheld)k(`${te.path} will not be served: once this deploy is live, any earlier copy is gone from the playground.`)}catch(te){let se=te instanceof Error?te.message:String(te),he=g.withheld.map(we=>we.path);I("The playground still holds files this deploy did not publish"),h(` ${se}`),h(),he.length?(k(`Could not remove ${he.join(", ")} from the playground: ${se}`),k("Anything an earlier deploy put there is still being served.")):k("Anything an earlier deploy put there is still being served."),h(),process.exitCode=1}if(!C()&&re&&(h(),k(`Uploaded ${b.length} files from ${o}`),k(`Playground: ${Hs(re)}`),k(`Wired it to ${re.playerApiOrigin} as "${t}"`),G&&k("Added a replaceable starter favicon")),!re)throw new Error("The directory index was not uploaded.");return Hs(re)}async function y5(e,t,o,r){let n=!0;try{let u=We(await Ho(o,"utf8"));u.ok&&(n=u.manifest.identity?.consent?.analytics_requires_consent!==!1)}catch{}let a=iu(await Ho(t,"utf8").catch(()=>""));a&&S("This folder is the game's source, not its build, so nothing was published.",a);let{consentGate:i}=await Promise.resolve().then(()=>(Wo(),l_)),c=r?await i(t,e,n):{status:"skipped",detail:"asked not to open a browser (--no-check)."};if(c.status==="verified"){A("Consent","a fan is asked before anything is recorded");return}c.status==="open"&&S("This game would record fans without asking them first, so nothing was published.",[c.detail??"","",`${w.cyan(ee("verify"))} the same check, with the rest of them`]);let d="";try{d=await Ho(t,"utf8")}catch{return}let l=su(d,n);l&&S("This game does not ask fans for consent, so nothing was published.",[l,`${w.cyan(ee("client"))} add the client, then deploy again`]),k(w.dim(`Consent checked by reading the page, not in a browser: ${c.detail??""}`.trim()))}async function b5(e,t,o,r){let n=!0;try{let c=We(await Ho(t,"utf8"));c.ok&&(n=c.manifest.identity?.consent?.analytics_requires_consent!==!1)}catch{}let a=cu(e,n);a&&S("The consent banner would not say who is asking, so nothing was published.",a);let i=nm(e,o,r);i&&S("This game carries Monterosa's own settings, so nothing was published.",i)}_r();ar();import{readFileSync as v5,writeFileSync as k5}from"node:fs";var $_="state;periods;scores;participants;events.type;statistics.type",JO=["ATTACKS","DANGEROUS_ATTACKS","SHOTS_TOTAL","SHOTS_ON_TARGET","CORNERS","FOULS","BALL_POSSESSION","YELLOWCARDS"],w5={NS:"scheduled",TBA:"scheduled",POSTPONED:"scheduled",INPLAY_1ST_HALF:"running",INPLAY_2ND_HALF:"running",INPLAY_ET:"running",INPLAY_ET_2ND_HALF:"running",INPLAY_PENALTIES:"running",HT:"paused",BREAK:"paused",EXTRA_TIME_BREAK:"paused",PEN_BREAK:"paused",FT:"finished",AET:"finished",FT_PEN:"finished",CANCELLED:"finished",ABANDONED:"finished",AWARDED:"finished"},T_={Arsenal:["#EF0107","#FFFFFF"],"Aston Villa":["#670E36","#95BFE5"],"AFC Bournemouth":["#DA291C","#000000"],Brentford:["#E30613","#FFFFFF"],"Brighton & Hove Albion":["#0057B8","#FFFFFF"],Burnley:["#6C1D45","#99D6EA"],Chelsea:["#034694","#FFFFFF"],"Crystal Palace":["#1B458F","#C4122E"],Everton:["#003399","#FFFFFF"],Fulham:["#FFFFFF","#000000"],"Ipswich Town":["#0044A9","#FFFFFF"],"Leeds United":["#FFFFFF","#1D428A"],"Leicester City":["#003090","#FDBE11"],Liverpool:["#C8102E","#00B2A9"],"Manchester City":["#6CABDD","#1C2C5B"],"Manchester United":["#DA291C","#FBE122"],"Newcastle United":["#241F20","#FFFFFF"],"Nottingham Forest":["#DD0000","#FFFFFF"],Southampton:["#D71920","#FFFFFF"],Sunderland:["#EB172B","#FFFFFF"],"Tottenham Hotspur":["#FFFFFF","#132257"],"West Ham United":["#7A263A","#1BB1E7"],"Wolverhampton Wanderers":["#FDB913","#231F20"],Celtic:["#018749","#FFFFFF"],Rangers:["#1B458F","#FFFFFF"],"FC Bayern M\xFCnchen":["#DC052D","#FFFFFF"],"Borussia Dortmund":["#FDE100","#000000"],"Bayer 04 Leverkusen":["#E32221","#000000"],"Real Madrid":["#FFFFFF","#FEBE10"],"FC Barcelona":["#A50044","#004D98"],"Atl\xE9tico Madrid":["#CB3524","#FFFFFF"],Juventus:["#FFFFFF","#000000"],Inter:["#0068A8","#000000"],"AC Milan":["#FB090B","#000000"],"Paris Saint Germain":["#004170","#DA291C"]},ym=["#2D6CDF","#E8473B"];function E_(e,t){let o=a=>[1,3,5].map(i=>parseInt(a.slice(i,i+2),16)),[r,n]=[o(e),o(t)];return Math.hypot(r[0]-n[0],r[1]-n[1],r[2]-n[2])<90}function XO(e,t,o=[]){let r=o[0]??T_[e]?.[0]??ym[0],n=o[1]??T_[t]?.[0]??ym[1];if(!o[1]&&E_(r,n)){let a=T_[t]?.[1];n=a&&!E_(r,a)?a:ym[E_(r,ym[1])?0:1]}return[r,n]}function A_(e,t=Date.now()){let o=e?.data??{},r=o.participants??[],n=["home","away"].map(T=>r.find(H=>H.meta?.location===T)).filter(Boolean),a=o._synth?.colours??{},i=XO(n[0]?.name??"",n[1]?.name??"",[a[n[0]?.id],a[n[1]?.id]]),c=T=>Number((o.scores??[]).find(H=>H.participant_id===T&&H.description==="CURRENT")?.score?.goals??0),d=o.state?.developer_name??"NS",l=w5[d]??"running",u=(o.periods??[]).find(T=>T.ticking),p=(o.periods??[]).at(-1),f=u?.minutes??(l==="finished"?p?.minutes??90:l==="paused"?p?.minutes??45:0),g=u?.seconds??0,b=Math.max(0,(f-(u?1:0))*60+g),v=T=>T?.description?String(T.description).replace(/-/g," "):null,x=n.map((T,H)=>({id:String(T.id),name:String(T.name??""),short:String(T.short_code??String(T.name??"").slice(0,3).toUpperCase()),colour:i[H],score:c(T.id),position:String(T.meta?.location??H)})),R=T=>{let H={};for(let G of o.statistics??[]){let oe=G.type?.developer_name;G.participant_id===T&&JO.includes(oe)&&(H[oe]=Number(G.data?.value??0))}return H},F=n.map(T=>({id:String(T.id),position:String(T.meta?.location??""),numbers:R(T.id)})),U=(o.events??[]).slice().sort((T,H)=>T.minute+(T.extra_minute??0)/100-(H.minute+(H.extra_minute??0)/100)||T.sort_order-H.sort_order).map(T=>{let H=typeof T.result=="string"&&/^\d+-\d+$/.test(T.result)?T.result.split("-").map(Number):null;return{id:String(T.id),kind:String(T.type?.developer_name??T.type_id??"MOMENT"),elapsed:((T.minute??0)+(T.extra_minute??0))*60,display:`${T.minute??0}${T.extra_minute?`+${T.extra_minute}`:""}'`,side:T.participant_id!==void 0&&T.participant_id!==null?String(T.participant_id):null,actor:T.player_name??null,related:T.related_player_name??null,score:H}}),W=l==="scheduled"?"KO":l==="paused"?d==="HT"?"HT":"Break":l==="finished"?"FT":`${f}'`;return{state:{provider:"sportmonks",contest:String(o.id??""),name:String(o.name??x.map(T=>T.name).join(" vs ")),status:l,period:v(u??p),startsAt:o.starting_at_timestamp?Number(o.starting_at_timestamp)*1e3:null,sides:x,result:o.result_info??null},clock:{elapsed:b,display:W,running:!!u,period:v(u??p),sampledAt:t},sides:F,moments:U,point:l==="scheduled"?null:{elapsed:f*60,sides:F.map(T=>T.numbers)}}}var C_=class extends Error{retryAfter;constructor(t,o){super(t),this.retryAfter=o}};function bm(e){let t=e.every??15,o=e.log??(()=>{}),r="sportmonks",n=[],a=new Set,i=!0,c=0,d=!1,l=null,u=null;if(e.stateFile)try{let g=JSON.parse(v5(e.stateFile,"utf8"));g.contest===e.contest&&Array.isArray(g.timeline)&&(n=g.timeline,o(`live feed: ${e.contest} resumed ${n.length} timeline points`))}catch{}let p=e.fetchFixture??(async()=>{let g=(e.sportmonksBase??"https://api.sportmonks.com/v3").replace(/\/$/,""),b=new URL(`${g}/football/fixtures/${e.contest}`);b.searchParams.set("include",$_);let v=await fetch(b,{headers:e.sportmonksToken?{Authorization:e.sportmonksToken}:{}});if(!v.ok)throw new C_(`SportMonks answered ${v.status}`,Number(v.headers.get("retry-after"))||null);return v.json()});return{done:(async()=>{let g=await sE(r,e.contest),b=(v,x,R=!1)=>e.sink.publish({channel:g,klass:v,key:iE(v,x),body:x,ttl:aE[v],urgent:R});for(o(`live feed: following ${r} ${e.contest} on ${g}, every ${t}s`);!d;){let v=t;try{let x=A_(await p());if(c=0,x.point){let R=n.findIndex(F=>F.elapsed===x.point.elapsed);R===-1?n.push(x.point):n[R]=x.point,n.sort((F,U)=>F.elapsed-U.elapsed)}b("state",x.state,!0),b("clock",x.clock);for(let R of x.sides)b("side",R);b("moments",x.moments),b("timeline",cE(n)),b("health",{ok:!0,at:Date.now()});for(let R of x.moments)a.has(R.id)||(a.add(R.id),i||(b("moment",R,!0),o(`live feed: ${e.contest} ${R.display} ${R.kind} ${R.actor??""}`)));if(i=!1,e.stateFile)try{k5(e.stateFile,JSON.stringify({contest:e.contest,timeline:n}))}catch(R){o(`live feed: could not save state: ${R.message}`)}if(x.state.status==="finished"){o(`live feed: ${e.contest} finished`);break}}catch(x){c++,v=x.retryAfter??null??Math.min(300,t*2**c)*(.85+Math.random()*.3),o(`live feed: ${e.contest} ${x.message}; next try in ${Math.round(v)}s`),b("health",{ok:!1,at:Date.now(),error:x.message,retryIn:Math.round(v)},!0)}await new Promise(x=>{u=x,l=setTimeout(x,v*1e3)})}})(),stop(){d=!0,l&&clearTimeout(l),u?.()}}}function I_(e=Date.now){let t=new Map,o=r=>{let n=t.get(r);return n||t.set(r,n={slots:new Map,subs:new Set}),n};return{publish(r){let n=o(r.channel);n.slots.set(r.key,{klass:r.klass,body:r.body,expires:e()+r.ttl*1e3,at:e()});for(let a of n.subs)a({kind:"message",klass:r.klass,body:r.body})},subscribe(r,n){let a=o(r),i=[...a.slots.entries()].filter(([,c])=>c.expires>e()).sort((c,d)=>c[1].at-d[1].at);for(let[,c]of i)n({kind:"message",klass:c.klass,body:c.body});return n({kind:"synced"}),a.subs.add(n),()=>a.subs.delete(n)}}}var bc="990001",Ge={id:7001,name:"Harbour City",short_code:"HBC",colour:"#2D6CDF"},Qe={id:7002,name:"Northgate Rovers",short_code:"NGR",colour:"#E8473B"},_5={[Ge.id]:["T. Okafor","L. Brandt","M. Sato","D. Ferreira","J. Holm","A. Mensah","R. Castell","E. Varga","K. Lindqvist","S. Adeyemi-Cole","P. Navarro"],[Qe.id]:["G. Whitlock","F. Duarte","N. Kovac","B. Asante","C. Moreau","H. Ibsen","O. Tanaka","V. Rossi","I. Petrov","Z. Kamara","W. Delacroix"]},x5={[Ge.id]:["Y. Achterberg","Q. Lomax","U. Sorensen","X. Iwobi-Hart"],[Qe.id]:["D. Rahimi","M. Okonjo","L. Fairweather","S. Quist"]},O_={ATTACKS:43,DANGEROUS_ATTACKS:44,SHOTS_TOTAL:42,SHOTS_ON_TARGET:86,CORNERS:34,FOULS:56,BALL_POSSESSION:45,YELLOWCARDS:84,GOALS:52},QO={GOAL:{id:14,name:"Goal",developer_name:"GOAL"},YELLOWCARD:{id:19,name:"Yellowcard",developer_name:"YELLOWCARD"},SUBSTITUTION:{id:18,name:"Substitution",developer_name:"SUBSTITUTION"}};function S5(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let o=t;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function eP(e=6){let t=S5(e),o=structuredClone(_5),r=structuredClone(x5),n=[],a=[],i={[Ge.id]:{},[Qe.id]:{}};for(let b of[Ge.id,Qe.id])for(let v of Object.keys(O_))i[b][v]=0;let c={[Ge.id]:0,[Qe.id]:0},d={[Ge.id]:0,[Qe.id]:0},l=new Set,u={1:45+Math.floor(t()*4),2:47+Math.floor(t()*5)},p=0,f=1,g=(b,v,x,R,F,U,W=null)=>{let T=U===1?45:90;a.push({id:5e7+f++,participant_id:v,type_id:QO[b].id,player_name:x,related_player_name:R,minute:Math.min(F,T),extra_minute:F>T?F-T:null,result:W,sort_order:f,type:QO[b],at:n.length})};for(let b of[1,2])for(let v=1;v<=u[b];v++){let x=b===1?v:45+v;p=Math.max(-1,Math.min(1,p*.86+(t()-.5)*.7));let R=p>0?Ge.id:Qe.id,F=R===Ge.id?Qe.id:Ge.id,U=Math.abs(p),W=.5+p*.22+(t()-.5)*.08;d[Ge.id]+=W,d[Qe.id]+=1-W;let T=(G,oe,re=1)=>i[G][oe]+=re;if(T(R,"ATTACKS",1+Math.round(t()*2*(.5+U))),T(F,"ATTACKS",Math.round(t()*1.4)),t()<.25+U*.6&&T(R,"DANGEROUS_ATTACKS",1+Math.round(t()*U*2)),t()<.12&&T(F,"DANGEROUS_ATTACKS"),t()<.25&&T(t()<.5?Ge.id:Qe.id,"FOULS"),t()<.06+U*.22&&(T(R,"SHOTS_TOTAL"),t()<.38?(T(R,"SHOTS_ON_TARGET"),t()<.3?(c[R]++,T(R,"GOALS"),g("GOAL",R,o[R][6+Math.floor(t()*5)],o[R][3+Math.floor(t()*6)],x,b,`${c[Ge.id]}-${c[Qe.id]}`),p=R===Ge.id?-.3:.3):t()<.5&&T(R,"CORNERS")):t()<.25&&T(R,"CORNERS")),t()<.035){let G=t()<.5?Ge.id:Qe.id,oe=o[G][1+Math.floor(t()*9)];l.has(oe)||(l.add(oe),T(G,"YELLOWCARDS"),g("YELLOWCARD",G,oe,null,x,b))}if(b===2&&[60,68,75,82].includes(x)&&t()<.8){let G=t()<.5?Ge.id:Qe.id,oe=r[G].shift();if(oe){let re=o[G].splice(6+Math.floor(t()*(o[G].length-6)),1,oe)[0];g("SUBSTITUTION",G,oe,re,x,b)}}let H=n.length+1;i[Ge.id].BALL_POSSESSION=Math.round(d[Ge.id]/H*100),i[Qe.id].BALL_POSSESSION=100-i[Ge.id].BALL_POSSESSION,n.push({minute:x,period:b,totals:structuredClone(i),score:{...c}})}return{seed:e,minutes:n,events:a,length:u}}function tP(e,t){let r=60+e.length[1]*60,n=r+300,a=n+e.length[2]*60;return t<60?{state:"NS",played:0,period:null,seconds:0}:t<r?{state:"INPLAY_1ST_HALF",played:Math.floor((t-60)/60),period:1,seconds:(t-60)%60}:t<n?{state:"HT",played:e.length[1],period:1,seconds:0}:t<a?{state:"INPLAY_2ND_HALF",played:e.length[1]+Math.floor((t-n)/60),period:2,seconds:(t-n)%60}:{state:"FT",played:e.minutes.length,period:2,seconds:0}}var T5={NS:"Not Started",INPLAY_1ST_HALF:"1st Half",HT:"Half-Time",INPLAY_2ND_HALF:"2nd Half",FT:"Full Time"};function nP(e,t,o){let r=e.minutes.slice(0,t.played),n=()=>Object.fromEntries(Object.keys(O_).map(l=>[l,0])),a=r.at(-1)??{totals:{[Ge.id]:n(),[Qe.id]:n()},score:{[Ge.id]:0,[Qe.id]:0},minute:0},i=t.state.startsWith("INPLAY"),c=[];for(let[l,u]of[[Ge.id,"home"],[Qe.id,"away"]])for(let[p,f]of Object.entries(O_))p!=="GOALS"&&c.push({type_id:f,participant_id:l,data:{value:a.totals[l][p]},location:u,type:{id:f,developer_name:p}});let d=l=>{let u=l===Ge.id?Qe.id:Ge.id;return a.score[l]===a.score[u]?null:a.score[l]>a.score[u]};return{data:{id:Number(bc),name:`${Ge.name} vs ${Qe.name}`,starting_at_timestamp:Math.floor(o/1e3),result_info:t.state==="FT"?a.score[Ge.id]===a.score[Qe.id]?"Game ended in draw.":`${a.score[Ge.id]>a.score[Qe.id]?Ge.name:Qe.name} won after full-time.`:null,state:{state:t.state,name:T5[t.state],developer_name:t.state},participants:[Ge,Qe].map((l,u)=>({id:l.id,name:l.name,short_code:l.short_code,meta:{location:u===0?"home":"away",winner:t.state==="FT"?d(l.id):null}})),scores:[Ge,Qe].map((l,u)=>({participant_id:l.id,score:{goals:a.score[l.id],participant:u===0?"home":"away"},description:"CURRENT"})),periods:[1,2].filter(l=>t.period&&l<=t.period).map(l=>{let u=i&&l===t.period,p=l===1?Math.min(a.minute,54):Math.max(46,a.minute);return{type_id:l,ticking:u,minutes:u?p+1:p,seconds:u?Math.floor(t.seconds):0,description:l===1?"1st-half":"2nd-half"}}),events:e.events.filter(l=>l.at<t.played).map(({at:l,...u})=>u),statistics:c,_synth:{colours:{[Ge.id]:Ge.colour,[Qe.id]:Qe.colour},seed:e.seed}}}}function P_({seed:e=6,speed:t=30,from:o=0,now:r=()=>Date.now()}={}){let n=eP(e),a=r(),i=()=>o+(r()-a)/1e3*t,c=a+(60-o)*(1e3/t);return{contest:bc,fetchFixture:async()=>nP(n,tP(n,i()),c)}}ar();hn();xe();Ek();gn();rt();Zu();Wo();Ie();zt();Wu();import{readFile as R_,stat as E5}from"node:fs/promises";import{createServer as $5}from"node:http";import{extname as A5,join as rP,normalize as C5,resolve as ti,sep as I5}from"node:path";async function O5(e){let t;try{t=await R_(e,"utf8")}catch{return}let o=We(t);if(!o.ok){S(yn(e,o.issues),o.issues.map(r=>`${w.cyan(r.path)} ${r.message}`));return}return o.manifest}function P5(e){(e.fixture||e.scenario)&&S("`gamestage dev --fixture` is retired.",["dev now plays your own round through the deployed Engine. The contract fixture marked every pick",`correct, so it could never show your game. Put a practice round in ${Le} instead.`]),e.as&&S("`gamestage dev --as` is retired.",["It signed a player in with keys served from this laptop, and the deployed Engine cannot fetch","keys from a laptop. Practice is played as an anonymous test player. To prove sign-in, deploy","the game with its own identity.jwt issuer and play the deployed page."])}async function R5(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");P5(e);let o=e.manifest??"gamestage.yaml",r=await O5(o);if(!r)throw S(`No ${o} here.`,["`gamestage create` scaffolds a game, and `gamestage inspect . --write` writes a manifest for one you have."]),new Error("unreachable");let n=r.backend.archetype;if(n==="arcade"){let l=r.backend.arcade;if(!l)throw S("An arcade game needs backend.arcade in gamestage.yaml.",["points_per_second is the fastest a fair run can score, and max_run_seconds the longest a run lasts.","`gamestage create --format arcade` writes both with starting values."]),new Error("unreachable");return{kind:"arcade",game:r.app.id,live:!!r.live,title:r.app.title,config:l}}let a=await R_(rP(ti(o,".."),"index.html"),"utf8").catch(()=>""),i=n?Mn(n,qo(a)):void 0,c=await Ga(o,i);if(c.source==="invalid")throw S(jo(c.path),c.problems),new Error("unreachable");if(c.source==="none")throw S(`No round to play for ${r.app.title??r.app.id}.`,[`Put a practice round in ${Le} to play it here. It never reaches Studio or a fan.`,"A game's real rounds are written in Studio, and the deployed game plays them."]),new Error("unreachable");let d=c.round;return n&&n!==d.archetype&&S(`The manifest declares the ${n} format and a ${d.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),{kind:"round",game:r.app.id,live:!!r.live,round:d,title:r.app.title,containerLabel:r.experience.container_label,...c.source==="stand-in"?{sample:!0}:{},...c.source==="practice"?{practice:!0}:{},roundLine:c.line}}var N5={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"},L5="Practice round, not live",z5="Local practice, not live: runs stay on this laptop";function oP(e=L5){return`<div data-gamestage-practice-bar role="status" style="position:fixed;top:0;left:0;right:0;z-index:2147483647;padding:4px 12px;font:600 13px/1.4 system-ui,sans-serif;text-align:center;background:#111;color:#fff;letter-spacing:0.02em;pointer-events:none">${e}</div>
19890
- `}function j5(e,t){let o=(a,i)=>`if (!window.${a}) window.${a} = ${JSON.stringify(i)};
19889
+ `))}catch{return}}async function i5(e){try{let t=We(await Ho(e,"utf8"));return t.ok?t.manifest.experience?.design?.system:void 0}catch{return}}async function PO(e){try{let t=We(await Ho(e,"utf8"));return t.ok?t.manifest.app.title:void 0}catch{return}}async function s5(e){let t=Nd(e.titleFont,e.titleFontWeight);if(!t)return;let o=[...new Set([..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 $&!?.,'-:+#@",...e.logoText??"",...e.name??""])].filter(a=>a!=="["&&a!=="]").join(""),r=`https://fonts.googleapis.com/css2?family=${t.family.replace(/ /g,"+")}:wght@${t.weight}&text=${encodeURIComponent(o)}`,n="Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0 Safari/537.36";try{let a=await fetch(r,{headers:{"user-agent":n},signal:AbortSignal.timeout(8e3)});if(!a.ok)return;let i=/url\((https:[^)]+)\)\s*format\(['"]woff2['"]\)/.exec(await a.text())?.[1];if(!i)return;let c=await fetch(i,{signal:AbortSignal.timeout(8e3)});if(!c.ok)return;let d=Buffer.from(await c.arrayBuffer());return d.length>0&&d.length<6e4?d.toString("base64"):void 0}catch{return}}function c5(e){if(e.manifest)return e.manifest;let t=e.dir??(e.file?fm(e.file):void 0);return t&&(OO(b_(t,"gamestage.yaml"))||OO(b_(t,It)))?b_(t,"gamestage.yaml"):"gamestage.yaml"}async function jO(e,t){t.file&&t.dir&&S("Choose either --file or --dir for a deploy, not both.");let{client:o}=await be(),r=c5(t);if(t.file||t.dir){let u=await o.getWorkspaceSummary().catch(()=>{}),p=u?EA(u):null;p&&S("Nothing was uploaded.",[p.refused])}let n=await o5(r,!!t.manifest),a=n?.round,i=await bn(r);if(i.problems.length>0&&S(`${It} cannot be used as it is.`,i.problems),t.file||t.dir){let u=gm(t.dir??fm(t.file)),p=await no(oc(u)),f=Bu(i.settings,p);f.length>0&&S("This game's page keeps its own copy of settings that live in Studio.",[qu(f)]);let{unnamed:g}=Ba(i.settings,p);g.length>0&&S("Some of this game's words would never reach Studio, so nothing was published.",[qa(g)])}if((t.file||t.dir)&&await w5(i.settings,r,e,await om(o)),t.file||t.dir){let u=gm(t.dir??fm(t.file)),p=em(await no(oc(u)));p.length>0&&S("This game loads a font from a third party.",[tm(p)])}let c=await i5(r);if(c&&(t.file||t.dir)){let u=gm(t.dir??fm(t.file)),p;try{p=await o.listDesignSystems?.()}catch{p=void 0}p||S(`Cannot confirm the theme this game pins, ${c}.`,["Your org's themes could not be read, so the deploy stops rather than publish a game whose look nobody checked. Run it again; if it keeps failing, run gamestage theme list."]);let f=nu(c,await no(oc(u)),p);f.length>0&&S(`This game cannot wear its pinned theme, ${c}.`,f)}let d=br(i.settings??{},await PO(r)??e);d.logoFontData=await s5(d);let l={settings:i.settings??{},fallbackTitle:await PO(r)??e};try{let u,p=M=>b5(e,M,r,t.check!==!1),f=n?.archetype?De(n.archetype):void 0,g=pm(r),b={...a?{round:a}:{},...t.allow?.length?{allow:t.allow}:{}},v=await o.getGame(e).then(M=>M?.clientVersion).catch(()=>{}),x=new Set,R=IO(o);t.file?u=await d5(R.client,e,t.file,b,d,p,l,f,x,g):t.dir&&(u=await y5(R.client,e,t.dir,b,d,p,l,f,x,g));let F=R.staged(!!t.dir),U=qC(x);!t.file&&!t.dir&&!C()&&h(w.dim(` No --dir or --file, so no files are uploaded: the page already live, if any, stays as it is. To publish this folder, run \`gamestage deploy ${e} --dir .\`.`));let W=t.revision??await _O(r),T=await o.deploy(e,{manifestRevision:W,contentHash:t.hash??`sha256:${W}`,conformance:t.level??await SO(r),...await xO(r).then(M=>M===void 0?{}:{manifestSource:M}),...i.settings?{settings:i.settings}:{},offersPrize:!!t.prize,...await TO(r).then(M=>M===void 0?{}:{live:M}),...await EO(r).then(M=>M===void 0?{}:{roundFields:M}),...kO(n?.archetype),...await $O(r).then(M=>M===void 0?{}:{identity:M}),...t.notes?.trim()?{notes:t.notes.trim()}:{},...t.space?.trim()?{studioSpace:t.space.trim()}:{},...t.spaceOrg?.trim()?{studioSpaceOrg:t.spaceOrg.trim()}:{},...t.dir?{wording:await a5(t.dir)}:{},...U?{clientVersion:U}:{},...F?{staged:F}:{}});if(T.refused&&T.code==="round_source_unreadable"&&(T.refused=Hv(T.game,{ok:!1,status:"failed",reason:T.refused})),yc(T,"deploy"))return;let H=await r1(o,T.game,T.roundPickupId?{pickupId:T.roundPickupId,budgetMs:l5}:{});if(!H.ok){process.exitCode=1;let M=Hv(T.game,H);if(C())return L({ok:!1,status:`pickup_${H.status}`,playable:!1,reason:M,game:u?{...T.game,playgroundUrl:u}:T.game});I("Not done"),h(` ${M}`),(u??T.game.playgroundUrl)&&A("Page",u??T.game.playgroundUrl);return}if(T.roundPickupId){let M=await o.getGame(e).catch(()=>{});M&&(T.game=M)}let G=AO({current:Dn,before:v,pinned:U,uploaded:!!(t.file||t.dir),stored:T.game.clientVersion}),oe=H.playable&&(T.game.rounds?.length??0)===0?["The Engine pickup finished; the game is ready to play."]:__(T.game),re=await Ks(o,T.game),ie=await g_(T.game);if(C()){let M=RO(T.game.logs);return M?(process.exitCode=1,L({ok:!1,status:"refused",reason:M,game:T.game})):L({ok:!0,status:"deployed",...T.game.appSpec?.refusal?{app_spec:"refused"}:{},playable:H.playable,...re?{sourceWarning:re}:{},...ie?{keyWarning:ie}:{},roundProvisioned:H.playable,roundSource:fd(T.game.archetype)?H.playable?"studio":"none":"engine",roundLine:oe[0],...H.note?{pickupNote:H.note}:{},client:{...fr(U??T.game.clientVersion??v,Dn),...G.length?{note:G.join(" ")}:{}},game:u?{...T.game,playgroundUrl:u}:T.game})}let te=pa(T.game.containerLabel),se=pa(T.game.containerLabel,{lower:!0}),he=!H.playable&&fd(T.game.archetype);if(I("Deployed"),LO(T.game,u,void 0,he?`with no ${se} yet`:void 0,await NO(u??T.game.playgroundUrl)),h(),H.note&&(k(H.note),h()),Zs(re),y_(ie),G.length){for(let M of G)k(M);h()}if(T.game.appSpec?.refusal&&(I("But Studio would not take the game's settings"),h(` ${T.game.appSpec.refusal.reason}`),h(),k("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."),k("Deploy again once it is fixed; nothing else needs doing."),h()),m5(T.game.logs)){I("Your arcade rules take effect when the live edition ends"),h(` ${yr}`),h();let M=Ck(e,Sr(T.game));for(let[ke,Ne]of M.values)A(ke,Ne);for(let ke of M.notes.slice(1))k(ke);M.values.length&&h()}let we=p5(T.game.logs);if(we.length){I("Studio rounds updated");for(let M of we)k(M);h()}let ue=RO(T.game.logs);if(ue&&(I("Studio did not take the game"),h(` ${ue}`),h(),k("The game's files are online, but it has no Studio project, so there is nowhere to write a round yet."),k(`Deploy again once it is fixed. \`${ee(`logs ${e}`)}\` shows it again.`),h(),process.exitCode=1,he))return;if(he){for(let M of h5(T.game,se,te))h(M);h();return}await u5(u??T.game.playgroundUrl,T.game.playerEndpoint,e,t.check===!1,T.game.archetype);for(let M of oe)h(M);h(),k("Share the playground URL. It sleeps when idle and wakes on a request."),h()}catch(u){await pe(u)}}async function DO(e){let t=await Lo();try{let o=await t.archiveGame(e);if(yc(o,"archive"))return;if(C()){L({ok:!0,status:"archived",game:o.game});return}I("Archived"),A("Game",`${o.game.name} (${o.game.id})`),h(),k("Taken off the air. Its record and files are retained outside the served bundle."),h()}catch(o){await pe(o)}}async function MO(e){let{client:t}=await be();try{let o=await t.promoteGame(e);if(yc(o,"promote"))return;let r=await t.getWorkspace(),n=Tw(o.game,r),a=await Ks(t,o.game),i=await g_(o.game);if(C()){L({ok:!0,status:"promoted",stage:n,...a?{sourceWarning:a}:{},...i?{keyWarning:i}:{},game:o.game});return}I("Approved"),A("Game",`${o.game.name} (${o.game.id})`),h(),n==="prod"?k("Live. Your workspace's plan already carries prod."):k("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."),h(),Zs(a),y_(i)}catch(o){let r=o.status,n=o instanceof Error?o.message:"";if(r===404&&/unknown action/i.test(n)){if(C()){L({ok:!1,status:"unavailable",code:"not_deployed",reason:"This control plane does not have promotion yet."});return}I("Not yet"),h(" This control plane does not have promotion yet."),h(),k("Your game is untouched and still serving dev."),k("Your `gamestage` is ahead of the deployed service. Try again once it catches up."),h();return}await pe(o)}}async function FO(e){let{client:t}=await be();try{let r=(await t.getWorkspace()).games.filter(i=>i.state==="archived"&&!i.playgroundUrl&&!i.playerEndpoint&&!i.space);if(r.length===0){h("Nothing to remove. Every archived game here was deployed at some point.");return}if(!C()){I(`${r.length} archived games that never deployed`);let i=new Map;for(let c of r)i.set(c.name,(i.get(c.name)??0)+1);for(let[c,d]of[...i].sort((l,u)=>u[1]-l[1]))k(d>1?`${c} x${d}`:c);h(),k("A live game, or one that ever deployed, is refused by the server."),h()}if(!e.yes){process.stdin.isTTY||S("Refusing to delete without being asked.",["Nothing has changed. Re-run with `--yes` if you mean it."]);let i=QB({input:process.stdin,output:process.stdout});try{if((await i.question(`Delete ${r.length} records permanently? Type yes to go ahead: `)).trim().toLowerCase()!=="yes"){h("Nothing was deleted.");return}}finally{i.close()}}let n=0,a=[];for(let i of r){let c=await t.deleteGame(i.id);c.refused?a.push(`${i.name}: ${c.refused}`):n+=1}if(a.length>0&&(process.exitCode=1),L({ok:a.length===0,removed:n,refused:a.length}),!C()){I("Removed"),k(`${n} records gone.`);for(let i of a)k(i);h()}}catch(o){await pe(o)}}async function UO(e){let{client:t}=await be();try{let{workspace:o,refused:r,code:n}=await t.setPlan(e);if(r){if(process.exitCode=1,C()){L({ok:!1,status:"refused",action:"plan",code:n,reason:r,workspace:o});return}I("Not done"),h(` ${r}`),h();return}if(C())return L({ok:!0,workspace:o});I("Plan changed"),A("Plan",o.tier),A("Live games",String(o.liveGameAllowance||"Contracted")),h()}catch(o){await pe(o)}}async function x_(e,t){let{admin:o,email:r}=await Xt();try{let n=await o.setWorkspaceAccess(e,t),a=P1(n);if(C())return L({ok:!0,status:a.status,changed:n.changed,workspace_id:n.workspaceId,access:n.access,previous:n.previous,message:a.message});za(a),n.changed&&(A("Decided by",r),h())}catch(n){await pe(n)}}async function GO(){let{admin:e}=await Xt();try{let t=await e.runCreatorSync();if(C())return L({ok:!0,counts:t});I("Creator sync");for(let[o,r]of Object.entries(t??{}))A(o,String(r))}catch(t){let o=t instanceof Error?t.message:String(t);S(`The creator sync did not run: ${o}`,["It needs the Resend key in the control plane and an operator account."])}}async function BO(e,t,o){let r=R1(e,t,o.liveGames);"problem"in r&&S(r.problem,r.detail);let{request:n}=r,{admin:a,email:i}=await Xt(),c=async()=>{try{let d=await a.getWorkspace(n.workspaceId);return{reading:{tier:d.tier,liveGameAllowance:d.liveGameAllowance}}}catch(d){let l=d.status,u=d instanceof Error?d.message:String(d);return l===404&&/unknown resource/i.test(u)?{reading:null,why:"this control plane has no operator read route, so it was deployed before GS-509 and needs a Space deploy"}:{reading:null,why:l?`${l}, ${u}`:u}}};try{let d=await c(),l=await a.setWorkspacePlan(n.workspaceId,n.tier,n.allowance),u=await c(),p=N1({request:n,previous:d.reading,result:{refused:l?.refused,code:l?.code},stored:u.reading,unreadable:u.why});if(p.exitCode!==0&&(process.exitCode=p.exitCode),C())return L({ok:p.exitCode!==1,status:p.status,workspace_id:n.workspaceId,asked:{tier:n.tier,live_game_allowance:n.allowance??null},previous:p.previous,stored:p.stored,reprovisioned:!1,code:l?.code??null,message:p.message,next:p.next});L1(p),p.status==="set"&&(A("Decided by",i),h())}catch(d){await pe(d)}}async function qO(e){let t;try{t=await Ho(e,"utf8")}catch{return S(`Cannot read ${e}`,["`gamestage inspect . --write` or `gamestage create` writes one."])}let o=We(t);if(!o.ok)return S(yn(e,o.issues),[...o.issues.map(i=>`${w.cyan(i.path)} ${i.message}`),"",`${w.cyan(ee(`manifest validate ${e}`))} the full report`]);let r=o.manifest,n=eA(r);if(n.length)return S(`${e} cannot be registered.`,[...n,"","Add `backend.archetype`, and the round that goes with it."]);let a=await Lo();La();try{let i=await a.registerGame(Q$(r,`sha256:${t5("sha256").update(t).digest("hex")}`));if(yc(i,"register"))return;if(C()){L({ok:!0,status:"registered",game:i.game});return}I("Registered"),A("Game",`${i.game.name} (${i.game.id})`),A("State",i.game.state),A("Conformance",i.game.conformance),h(),k(`${w.cyan(ee(`deploy ${i.game.id} --dir .`))} publish it`),h()}catch(i){await pe(i)}}async function S_(e,t){let{client:o}=await be();try{let r=await o.setAwake(e,t);if(yc(r,t?"wake":"suspend"))return;if(C()){L({ok:!0,status:r.game.state,game:r.game});return}I(t?"Awake":"Suspended"),A("Game",`${r.game.name} (${r.game.id})`),A("State",r.game.state),h(),k(t?"It is taking plays again.":"It is off the air and its live slot is free. `gamestage wake` puts it back."),h()}catch(r){await pe(r)}}async function WO(e,t){let{client:o}=await be();try{let r=await o.getEndpoints(e);if(r||S(...HO(e)),C())return L({ok:!0,endpoints:r});if(t==="player"||t==="control"||t==="playground"){let n=r[t];n||S(`No ${t} endpoint yet.`,["Deploy the game first: `gamestage deploy "+e+"`."]),h(n);return}I("Endpoints"),A("Player",r.player??"not deployed"),A("Control",r.control??"not deployed"),A("Playground",r.playground??"not deployed"),h()}catch(r){await pe(r)}}function HO(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 YO(e,t){let{client:o}=await be();try{let r=await o.getLogs(e,{limit:t.limit?Number(t.limit):100,since:t.since??null,level:t.level??null}),n=await o.getGame(e).catch(()=>{}),a=n?_A(n):{state:"none"},i=xA(a);if(C())return L({ok:!0,lines:r,freshness:a});if(i&&(I("This game is serving a closed round"),h(),k(i),h()),r.length===0){I("No log lines"),h(),k("Nothing yet, or everything is older than the tier's retention."),h();return}for(let c of r){let d=c.roundId?` [${c.roundId}]`:"";h(`${c.at} ${c.level.padEnd(5)}${d} ${c.message}`)}}catch(r){await pe(r)}}async function VO(e){let{client:t}=await be();try{t.getGameUsage||S("This version of the control plane does not report usage yet.",["Try again after the next Gamestage release."]);let o=await t.getGameUsage(e);if(o||S(`${e} makes no paid AI calls, so it has no usage to report.`,["Usage is reported for Mystery games, which ask Jev."]),C())return L({ok:!0,...o});let r=n=>oC(n,o.prices.currency);I(`${e}: Jev usage`),o.note&&k(o.note),o.keyConnected===!1&&k("No TypeSafe key is connected, so this game cannot answer questions. `gamestage sources connect typesafe` gives you the link to add one."),A("Questions answered",String(o.total.questions)),A("Fans' games",String(o.total.fans)),A("Total",r(o.total.cost)),A("Per fan's game",o.perFanGame===null?"nobody has asked yet":r(o.perFanGame)),A("Priced at",rC(o.prices)),o.total.answeredWithoutJev&&k(`${o.total.answeredWithoutJev} question${o.total.answeredWithoutJev===1?" was":"s were"} answered by the fallback when Jev could not, at no cost to you.`),h();for(let n of o.rounds){let a=n.opensAt?n.opensAt.slice(0,10):n.round;h(`${a} ${String(n.questions).padStart(5)} questions ${String(n.fans).padStart(4)} fans ${r(n.cost)}`)}h()}catch(o){await pe(o)}}function w_(e=Dn,t=ot){return t==="0.0.0-dev"&&process.env.GAMESTAGE_TEST_RUN?"0.0.0-test":(t==="0.0.0-dev"&&S("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",`${Je}/client/0.0.0-dev/gamestage.js, which does not exist.`,"",`${w.cyan("npm run build:cli")} build the bundle, then deploy with public/cli.mjs`,`${w.cyan("npx gamestage@latest deploy ...")} or use the published CLI`]),e)}async function Ir(e,t,o,r){let n=await fetch(e,{method:"PUT",body:typeof t=="string"?new Uint8Array(Buffer.from(t,"utf8")):t,headers:{"content-type":o,...r?{"cache-control":r}:{}}});n.ok||S(`Upload refused with ${n.status}. Ask for a fresh URL and retry.`)}var l5=1e5;async function KO(e,t,o,r,n,a){let i=rm(a.settings,a.fallbackTitle),c=i.description??i.title,d=Mo(o),l=await e.uploadTarget(t,Do),u=l.publicUrl.replace(/[^/]+$/,"index.html"),p=u;if(!d.has("og:url")){let b=await(a.canonical??(x=>NI(x,{controlUrl:Re})))(t),v=Vk(a.settings[Yk]);p=b.url??v??u,k(b.url?`Link preview: points at ${p} (${b.reason}).`:v?`Link preview: points at ${p} (Canonical URL in ${It}; ${b.reason}).`:`Link preview: points at the playground, ${p} (${b.reason}). Set Canonical URL in Studio if the game is served elsewhere.`)}let f=null,g=d.get("og:image")||void 0;if(!g&&r&&(g=l.publicUrl),!g){let b=await(a.draw??vO)(n??br(a.settings,i.title),i.description);b.png?(f=b.png,g=l.publicUrl,k(`Link preview: drew ${Do} (${1200}x${630}) from the game's name and strapline.`)):k(`Link preview: no ${Do} drawn (${b.reason}). The link will unfurl without a picture; add ${Do} at ${1200}x${630} to the game folder, or install Chrome and deploy again.`)}return{tags:{title:i.title,description:c,siteName:i.siteName,url:p,image:g,imageAlt:i.description?`${i.title}: ${i.description}`:i.title,imageWidth:1200,imageHeight:630},card:f}}async function ZO(e,t,o){if(!o)return;let r=await e.uploadTarget(t,Do);await Ir(r.uploadUrl,o,"image/png",r.cacheControl)}async function d5(e,t,o,r={},n,a,i,c,d,l){let u=gm(o),p;try{p=v_(u)}catch{throw S(`Cannot read ${o}.`),new Error("unreachable")}let f=await Fk({path:u,relativePath:o},r.round);f&&S(`${o} ${f.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."]),nc(e5(o))&&S(`${o} is never published, so nothing was uploaded.`,["Source maps, round files, README files and package.json stay with your project.","Point --file at the game's HTML page, or use --dir and let the gate withhold them."]),await a?.(u);let g=await e.uploadTarget(t,"index.html"),b=i?await KO(e,t,p.toString("utf8"),!1,n,i):null,v=b?ec(p.toString("utf8"),b.tags):p.toString("utf8");await ZO(e,t,b?.card??null);let x=xk(Ws(uc(v),n),`${g.playerApiOrigin}`,t,c,l);await Ir(g.uploadUrl,x,"text/html; charset=utf-8",g.cacheControl);for(let W of kv(x))d?.add(W);/(["'])\.?\/?gamestage\.js\1/.test(x)&&d?.add(Dn);let R=await e.uploadTarget(t,wt);await Ir(R.uploadUrl,Da,"text/javascript; charset=utf-8",R.cacheControl);let F=await e.uploadTarget(t,tt);await Ir(F.uploadUrl,to,"text/javascript; charset=utf-8",F.cacheControl);let U=await e.uploadTarget(t,ro);return await Ir(U.uploadUrl,dc,"image/svg+xml",U.cacheControl),C()||(h(),k(`Uploaded ${o} to ${Hs(g)}`),k(`Wired it to ${g.playerApiOrigin} as "${t}"`),k(`Shipped @monterosa/gamestage beside it (${jn})`),k(`Shipped the player client beside it (${vr})`)),Hs(g)}async function u5(e,t,o,r,n){if(r||!e||!t)return;let{browserCheck:a}=await Promise.resolve().then(()=>(Wo(),l_));f5(await a(e,t,o,n))}function m5(e){let t=e??[],o=-1;return t.forEach((n,a)=>{/^Deployed /.test(n.message)&&(o=a)}),(o>=0?t.slice(o):t.slice(-8)).some(n=>n.message===yr)}function p5(e){let t=e??[],o=-1;return t.forEach((n,a)=>{/^Deployed /.test(n.message)&&(o=a)}),(o>=0?t.slice(o):t.slice(-8)).filter(n=>n.message.startsWith(cv)).map(n=>{let a=n.message.slice(cv.length).trim();return a.charAt(0).toUpperCase()+a.slice(1)})}function RO(e){let t=e??[],o=-1;return t.forEach((a,i)=>{/^Deployed /.test(a.message)&&(o=i)}),[...o>=0?t.slice(o):t.slice(-8)].reverse().find(a=>a.level==="error"&&/not on Interaction Cloud/.test(a.message))?.message.replace(/^The game is not on Interaction Cloud: /,"Studio answered: ")}function h5(e,t,o){let r=e.studioUrl??Aa(e.id);return[`${w.bold(`No ${t} yet: add one in Studio.`)}`,` ${w.cyan(r)}`,"",e.studioUrl?" The game is online and its Studio project exists, so a fan opening it now":" The game is online, and Stage links to its Studio project once it has one, so a fan opening it now",` finds nothing to play. Write the first ${t} in Studio and it appears`,` without another deploy. Share the game once a ${t} is on.`,"",` ${w.cyan(ee("dev --serve"))} try the game on this machine meanwhile, with practice/round.yaml or a stand-in ${o.toLowerCase()}`]}function f5(e){if(e.status==="verified"){A("Checked","the page loads and plays in a browser"),h();return}if(e.status==="skipped"||e.status==="n/a"){k(w.dim(`Not checked in a browser: ${e.detail??""}`.trim())),h();return}I("The published page did not start"),h(` ${e.detail??""}`),h(),k("The files are published, so the game is live and broken rather than unpublished."),k(`${w.cyan(ee("verify"))} the same check, with the rest of them`),h(),process.exitCode=1}function g5(e){for(let t of e.walkedPast)k(`Walked past ${t}: it is a toolchain directory, not your game.`);for(let t of e.allowed)k(`Published ${t.path} because you allowed it.`);for(let t of e.withheld)k(`Withheld ${t.path} from the upload: it ${t.why}`);e.refuse?.whole&&S(e.refuse.whole),e.refuse&&S(`${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 y5(e,t,o,r={},n,a,i,c,d,l){let u,p=[],f=[];try{let te=oo(o,{symlinks:"throw"});u=te.files,p=te.withheld,f=te.tooling}catch(te){throw S(te instanceof Error?te.message:`Cannot read ${o}.`),new Error("unreachable")}let g=await $I(u,{...r,exempt:[tt,wt]});for(let te of f)k(`Walked past ${te}: it belongs to your editor or agent, not your game.`);g5(g);let b=g.publish,v=b.find(te=>te.relativePath==="index.html");v||S(`Directory ${o} must contain an index.html file.`),await a?.(v.path);let x=zI(b,p);I(`Publishing ${b.length} ${b.length===1?"file":"files"} to the playground`);for(let te of x.lines)k(te);x.named.length&&(h(),k("The lines above are named because they are not ordinary web assets. Anything there you did not mean to publish, stop and remove it: a deploy puts every one of these at a public URL beside your game.")),h();let R=v_(v.path,"utf8"),F=i?await KO(e,t,R,b.some(te=>te.relativePath===Do),n,i):null,U=d_(R),W=b.some(te=>te.relativePath==="favicon.ico"),T=b.some(te=>te.relativePath===ro),H=!U&&!W,G=H&&!T,oe=w_();if(oe!=="0.0.0-test"){let te=`${Je}/client/${oe}/${tt}`,se=!1;try{se=(await fetch(te,{method:"HEAD"})).ok}catch{se=!0}se||S(`The client this deploy would pin, ${oe}, is not published yet.`,[`Every page uploaded here will import ${te},`,"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>/.","",`${w.cyan("node scripts/deploy.mjs site")} then run this deploy again`])}let re;for(let te of b){if(te.relativePath===tt||te.relativePath===wt)continue;let se;try{se=await e.uploadTarget(t,te.relativePath)}catch(ke){throw new Error(`${te.relativePath} cannot be published: ${ke instanceof Error?ke.message:String(ke)}`,{cause:ke})}te.relativePath==="index.html"&&(re=se);let he=v_(te.path),we=/\.(m?js)$/i.test(te.relativePath),M=/\.html$/i.test(te.relativePath)?xk(_k(te.relativePath==="index.html"?Ws((()=>{let ke=F?ec(he.toString("utf8"),F.tags):he.toString("utf8");return H?uc(ke):ke})(),n):he.toString("utf8"),w_()),se.playerApiOrigin,t,c,l):we?_k(he.toString("utf8"),w_()):he;if(typeof M=="string")for(let ke of kv(M))d?.add(ke);await Ir(se.uploadUrl,M,J1(te.relativePath),se.cacheControl)}if(await ZO(e,t,F?.card??null),G){let te=await e.uploadTarget(t,ro);await Ir(te.uploadUrl,dc,"image/svg+xml",te.cacheControl)}let ie=[...b.map(te=>te.relativePath),...G?[ro]:[],...F?.card?[Do]:[]];try{await e.pruneBundle(t,ie);for(let te of g.withheld)k(`${te.path} will not be served: once this deploy is live, any earlier copy is gone from the playground.`)}catch(te){let se=te instanceof Error?te.message:String(te),he=g.withheld.map(we=>we.path);I("The playground still holds files this deploy did not publish"),h(` ${se}`),h(),he.length?(k(`Could not remove ${he.join(", ")} from the playground: ${se}`),k("Anything an earlier deploy put there is still being served.")):k("Anything an earlier deploy put there is still being served."),h(),process.exitCode=1}if(!C()&&re&&(h(),k(`Uploaded ${b.length} files from ${o}`),k(`Playground: ${Hs(re)}`),k(`Wired it to ${re.playerApiOrigin} as "${t}"`),G&&k("Added a replaceable starter favicon")),!re)throw new Error("The directory index was not uploaded.");return Hs(re)}async function b5(e,t,o,r){let n=!0;try{let u=We(await Ho(o,"utf8"));u.ok&&(n=u.manifest.identity?.consent?.analytics_requires_consent!==!1)}catch{}let a=iu(await Ho(t,"utf8").catch(()=>""));a&&S("This folder is the game's source, not its build, so nothing was published.",a);let{consentGate:i}=await Promise.resolve().then(()=>(Wo(),l_)),c=r?await i(t,e,n):{status:"skipped",detail:"asked not to open a browser (--no-check)."};if(c.status==="verified"){A("Consent","a fan is asked before anything is recorded");return}c.status==="open"&&S("This game would record fans without asking them first, so nothing was published.",[c.detail??"","",`${w.cyan(ee("verify"))} the same check, with the rest of them`]);let d="";try{d=await Ho(t,"utf8")}catch{return}let l=su(d,n);l&&S("This game does not ask fans for consent, so nothing was published.",[l,`${w.cyan(ee("client"))} add the client, then deploy again`]),k(w.dim(`Consent checked by reading the page, not in a browser: ${c.detail??""}`.trim()))}async function w5(e,t,o,r){let n=!0;try{let c=We(await Ho(t,"utf8"));c.ok&&(n=c.manifest.identity?.consent?.analytics_requires_consent!==!1)}catch{}let a=cu(e,n);a&&S("The consent banner would not say who is asking, so nothing was published.",a);let i=nm(e,o,r);i&&S("This game carries Monterosa's own settings, so nothing was published.",i)}_r();ar();import{readFileSync as k5,writeFileSync as _5}from"node:fs";var $_="state;periods;scores;participants;events.type;statistics.type",JO=["ATTACKS","DANGEROUS_ATTACKS","SHOTS_TOTAL","SHOTS_ON_TARGET","CORNERS","FOULS","BALL_POSSESSION","YELLOWCARDS"],v5={NS:"scheduled",TBA:"scheduled",POSTPONED:"scheduled",INPLAY_1ST_HALF:"running",INPLAY_2ND_HALF:"running",INPLAY_ET:"running",INPLAY_ET_2ND_HALF:"running",INPLAY_PENALTIES:"running",HT:"paused",BREAK:"paused",EXTRA_TIME_BREAK:"paused",PEN_BREAK:"paused",FT:"finished",AET:"finished",FT_PEN:"finished",CANCELLED:"finished",ABANDONED:"finished",AWARDED:"finished"},T_={Arsenal:["#EF0107","#FFFFFF"],"Aston Villa":["#670E36","#95BFE5"],"AFC Bournemouth":["#DA291C","#000000"],Brentford:["#E30613","#FFFFFF"],"Brighton & Hove Albion":["#0057B8","#FFFFFF"],Burnley:["#6C1D45","#99D6EA"],Chelsea:["#034694","#FFFFFF"],"Crystal Palace":["#1B458F","#C4122E"],Everton:["#003399","#FFFFFF"],Fulham:["#FFFFFF","#000000"],"Ipswich Town":["#0044A9","#FFFFFF"],"Leeds United":["#FFFFFF","#1D428A"],"Leicester City":["#003090","#FDBE11"],Liverpool:["#C8102E","#00B2A9"],"Manchester City":["#6CABDD","#1C2C5B"],"Manchester United":["#DA291C","#FBE122"],"Newcastle United":["#241F20","#FFFFFF"],"Nottingham Forest":["#DD0000","#FFFFFF"],Southampton:["#D71920","#FFFFFF"],Sunderland:["#EB172B","#FFFFFF"],"Tottenham Hotspur":["#FFFFFF","#132257"],"West Ham United":["#7A263A","#1BB1E7"],"Wolverhampton Wanderers":["#FDB913","#231F20"],Celtic:["#018749","#FFFFFF"],Rangers:["#1B458F","#FFFFFF"],"FC Bayern M\xFCnchen":["#DC052D","#FFFFFF"],"Borussia Dortmund":["#FDE100","#000000"],"Bayer 04 Leverkusen":["#E32221","#000000"],"Real Madrid":["#FFFFFF","#FEBE10"],"FC Barcelona":["#A50044","#004D98"],"Atl\xE9tico Madrid":["#CB3524","#FFFFFF"],Juventus:["#FFFFFF","#000000"],Inter:["#0068A8","#000000"],"AC Milan":["#FB090B","#000000"],"Paris Saint Germain":["#004170","#DA291C"]},ym=["#2D6CDF","#E8473B"];function E_(e,t){let o=a=>[1,3,5].map(i=>parseInt(a.slice(i,i+2),16)),[r,n]=[o(e),o(t)];return Math.hypot(r[0]-n[0],r[1]-n[1],r[2]-n[2])<90}function XO(e,t,o=[]){let r=o[0]??T_[e]?.[0]??ym[0],n=o[1]??T_[t]?.[0]??ym[1];if(!o[1]&&E_(r,n)){let a=T_[t]?.[1];n=a&&!E_(r,a)?a:ym[E_(r,ym[1])?0:1]}return[r,n]}function A_(e,t=Date.now()){let o=e?.data??{},r=o.participants??[],n=["home","away"].map(T=>r.find(H=>H.meta?.location===T)).filter(Boolean),a=o._synth?.colours??{},i=XO(n[0]?.name??"",n[1]?.name??"",[a[n[0]?.id],a[n[1]?.id]]),c=T=>Number((o.scores??[]).find(H=>H.participant_id===T&&H.description==="CURRENT")?.score?.goals??0),d=o.state?.developer_name??"NS",l=v5[d]??"running",u=(o.periods??[]).find(T=>T.ticking),p=(o.periods??[]).at(-1),f=u?.minutes??(l==="finished"?p?.minutes??90:l==="paused"?p?.minutes??45:0),g=u?.seconds??0,b=Math.max(0,(f-(u?1:0))*60+g),v=T=>T?.description?String(T.description).replace(/-/g," "):null,x=n.map((T,H)=>({id:String(T.id),name:String(T.name??""),short:String(T.short_code??String(T.name??"").slice(0,3).toUpperCase()),colour:i[H],score:c(T.id),position:String(T.meta?.location??H)})),R=T=>{let H={};for(let G of o.statistics??[]){let oe=G.type?.developer_name;G.participant_id===T&&JO.includes(oe)&&(H[oe]=Number(G.data?.value??0))}return H},F=n.map(T=>({id:String(T.id),position:String(T.meta?.location??""),numbers:R(T.id)})),U=(o.events??[]).slice().sort((T,H)=>T.minute+(T.extra_minute??0)/100-(H.minute+(H.extra_minute??0)/100)||T.sort_order-H.sort_order).map(T=>{let H=typeof T.result=="string"&&/^\d+-\d+$/.test(T.result)?T.result.split("-").map(Number):null;return{id:String(T.id),kind:String(T.type?.developer_name??T.type_id??"MOMENT"),elapsed:((T.minute??0)+(T.extra_minute??0))*60,display:`${T.minute??0}${T.extra_minute?`+${T.extra_minute}`:""}'`,side:T.participant_id!==void 0&&T.participant_id!==null?String(T.participant_id):null,actor:T.player_name??null,related:T.related_player_name??null,score:H}}),W=l==="scheduled"?"KO":l==="paused"?d==="HT"?"HT":"Break":l==="finished"?"FT":`${f}'`;return{state:{provider:"sportmonks",contest:String(o.id??""),name:String(o.name??x.map(T=>T.name).join(" vs ")),status:l,period:v(u??p),startsAt:o.starting_at_timestamp?Number(o.starting_at_timestamp)*1e3:null,sides:x,result:o.result_info??null},clock:{elapsed:b,display:W,running:!!u,period:v(u??p),sampledAt:t},sides:F,moments:U,point:l==="scheduled"?null:{elapsed:f*60,sides:F.map(T=>T.numbers)}}}var C_=class extends Error{retryAfter;constructor(t,o){super(t),this.retryAfter=o}};function bm(e){let t=e.every??15,o=e.log??(()=>{}),r="sportmonks",n=[],a=new Set,i=!0,c=0,d=!1,l=null,u=null;if(e.stateFile)try{let g=JSON.parse(k5(e.stateFile,"utf8"));g.contest===e.contest&&Array.isArray(g.timeline)&&(n=g.timeline,o(`live feed: ${e.contest} resumed ${n.length} timeline points`))}catch{}let p=e.fetchFixture??(async()=>{let g=(e.sportmonksBase??"https://api.sportmonks.com/v3").replace(/\/$/,""),b=new URL(`${g}/football/fixtures/${e.contest}`);b.searchParams.set("include",$_);let v=await fetch(b,{headers:e.sportmonksToken?{Authorization:e.sportmonksToken}:{}});if(!v.ok)throw new C_(`SportMonks answered ${v.status}`,Number(v.headers.get("retry-after"))||null);return v.json()});return{done:(async()=>{let g=await sE(r,e.contest),b=(v,x,R=!1)=>e.sink.publish({channel:g,klass:v,key:iE(v,x),body:x,ttl:aE[v],urgent:R});for(o(`live feed: following ${r} ${e.contest} on ${g}, every ${t}s`);!d;){let v=t;try{let x=A_(await p());if(c=0,x.point){let R=n.findIndex(F=>F.elapsed===x.point.elapsed);R===-1?n.push(x.point):n[R]=x.point,n.sort((F,U)=>F.elapsed-U.elapsed)}b("state",x.state,!0),b("clock",x.clock);for(let R of x.sides)b("side",R);b("moments",x.moments),b("timeline",cE(n)),b("health",{ok:!0,at:Date.now()});for(let R of x.moments)a.has(R.id)||(a.add(R.id),i||(b("moment",R,!0),o(`live feed: ${e.contest} ${R.display} ${R.kind} ${R.actor??""}`)));if(i=!1,e.stateFile)try{_5(e.stateFile,JSON.stringify({contest:e.contest,timeline:n}))}catch(R){o(`live feed: could not save state: ${R.message}`)}if(x.state.status==="finished"){o(`live feed: ${e.contest} finished`);break}}catch(x){c++,v=x.retryAfter??null??Math.min(300,t*2**c)*(.85+Math.random()*.3),o(`live feed: ${e.contest} ${x.message}; next try in ${Math.round(v)}s`),b("health",{ok:!1,at:Date.now(),error:x.message,retryIn:Math.round(v)},!0)}await new Promise(x=>{u=x,l=setTimeout(x,v*1e3)})}})(),stop(){d=!0,l&&clearTimeout(l),u?.()}}}function I_(e=Date.now){let t=new Map,o=r=>{let n=t.get(r);return n||t.set(r,n={slots:new Map,subs:new Set}),n};return{publish(r){let n=o(r.channel);n.slots.set(r.key,{klass:r.klass,body:r.body,expires:e()+r.ttl*1e3,at:e()});for(let a of n.subs)a({kind:"message",klass:r.klass,body:r.body})},subscribe(r,n){let a=o(r),i=[...a.slots.entries()].filter(([,c])=>c.expires>e()).sort((c,d)=>c[1].at-d[1].at);for(let[,c]of i)n({kind:"message",klass:c.klass,body:c.body});return n({kind:"synced"}),a.subs.add(n),()=>a.subs.delete(n)}}}var bc="990001",Ge={id:7001,name:"Harbour City",short_code:"HBC",colour:"#2D6CDF"},Qe={id:7002,name:"Northgate Rovers",short_code:"NGR",colour:"#E8473B"},x5={[Ge.id]:["T. Okafor","L. Brandt","M. Sato","D. Ferreira","J. Holm","A. Mensah","R. Castell","E. Varga","K. Lindqvist","S. Adeyemi-Cole","P. Navarro"],[Qe.id]:["G. Whitlock","F. Duarte","N. Kovac","B. Asante","C. Moreau","H. Ibsen","O. Tanaka","V. Rossi","I. Petrov","Z. Kamara","W. Delacroix"]},S5={[Ge.id]:["Y. Achterberg","Q. Lomax","U. Sorensen","X. Iwobi-Hart"],[Qe.id]:["D. Rahimi","M. Okonjo","L. Fairweather","S. Quist"]},O_={ATTACKS:43,DANGEROUS_ATTACKS:44,SHOTS_TOTAL:42,SHOTS_ON_TARGET:86,CORNERS:34,FOULS:56,BALL_POSSESSION:45,YELLOWCARDS:84,GOALS:52},QO={GOAL:{id:14,name:"Goal",developer_name:"GOAL"},YELLOWCARD:{id:19,name:"Yellowcard",developer_name:"YELLOWCARD"},SUBSTITUTION:{id:18,name:"Substitution",developer_name:"SUBSTITUTION"}};function T5(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let o=t;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}function eP(e=6){let t=T5(e),o=structuredClone(x5),r=structuredClone(S5),n=[],a=[],i={[Ge.id]:{},[Qe.id]:{}};for(let b of[Ge.id,Qe.id])for(let v of Object.keys(O_))i[b][v]=0;let c={[Ge.id]:0,[Qe.id]:0},d={[Ge.id]:0,[Qe.id]:0},l=new Set,u={1:45+Math.floor(t()*4),2:47+Math.floor(t()*5)},p=0,f=1,g=(b,v,x,R,F,U,W=null)=>{let T=U===1?45:90;a.push({id:5e7+f++,participant_id:v,type_id:QO[b].id,player_name:x,related_player_name:R,minute:Math.min(F,T),extra_minute:F>T?F-T:null,result:W,sort_order:f,type:QO[b],at:n.length})};for(let b of[1,2])for(let v=1;v<=u[b];v++){let x=b===1?v:45+v;p=Math.max(-1,Math.min(1,p*.86+(t()-.5)*.7));let R=p>0?Ge.id:Qe.id,F=R===Ge.id?Qe.id:Ge.id,U=Math.abs(p),W=.5+p*.22+(t()-.5)*.08;d[Ge.id]+=W,d[Qe.id]+=1-W;let T=(G,oe,re=1)=>i[G][oe]+=re;if(T(R,"ATTACKS",1+Math.round(t()*2*(.5+U))),T(F,"ATTACKS",Math.round(t()*1.4)),t()<.25+U*.6&&T(R,"DANGEROUS_ATTACKS",1+Math.round(t()*U*2)),t()<.12&&T(F,"DANGEROUS_ATTACKS"),t()<.25&&T(t()<.5?Ge.id:Qe.id,"FOULS"),t()<.06+U*.22&&(T(R,"SHOTS_TOTAL"),t()<.38?(T(R,"SHOTS_ON_TARGET"),t()<.3?(c[R]++,T(R,"GOALS"),g("GOAL",R,o[R][6+Math.floor(t()*5)],o[R][3+Math.floor(t()*6)],x,b,`${c[Ge.id]}-${c[Qe.id]}`),p=R===Ge.id?-.3:.3):t()<.5&&T(R,"CORNERS")):t()<.25&&T(R,"CORNERS")),t()<.035){let G=t()<.5?Ge.id:Qe.id,oe=o[G][1+Math.floor(t()*9)];l.has(oe)||(l.add(oe),T(G,"YELLOWCARDS"),g("YELLOWCARD",G,oe,null,x,b))}if(b===2&&[60,68,75,82].includes(x)&&t()<.8){let G=t()<.5?Ge.id:Qe.id,oe=r[G].shift();if(oe){let re=o[G].splice(6+Math.floor(t()*(o[G].length-6)),1,oe)[0];g("SUBSTITUTION",G,oe,re,x,b)}}let H=n.length+1;i[Ge.id].BALL_POSSESSION=Math.round(d[Ge.id]/H*100),i[Qe.id].BALL_POSSESSION=100-i[Ge.id].BALL_POSSESSION,n.push({minute:x,period:b,totals:structuredClone(i),score:{...c}})}return{seed:e,minutes:n,events:a,length:u}}function tP(e,t){let r=60+e.length[1]*60,n=r+300,a=n+e.length[2]*60;return t<60?{state:"NS",played:0,period:null,seconds:0}:t<r?{state:"INPLAY_1ST_HALF",played:Math.floor((t-60)/60),period:1,seconds:(t-60)%60}:t<n?{state:"HT",played:e.length[1],period:1,seconds:0}:t<a?{state:"INPLAY_2ND_HALF",played:e.length[1]+Math.floor((t-n)/60),period:2,seconds:(t-n)%60}:{state:"FT",played:e.minutes.length,period:2,seconds:0}}var E5={NS:"Not Started",INPLAY_1ST_HALF:"1st Half",HT:"Half-Time",INPLAY_2ND_HALF:"2nd Half",FT:"Full Time"};function nP(e,t,o){let r=e.minutes.slice(0,t.played),n=()=>Object.fromEntries(Object.keys(O_).map(l=>[l,0])),a=r.at(-1)??{totals:{[Ge.id]:n(),[Qe.id]:n()},score:{[Ge.id]:0,[Qe.id]:0},minute:0},i=t.state.startsWith("INPLAY"),c=[];for(let[l,u]of[[Ge.id,"home"],[Qe.id,"away"]])for(let[p,f]of Object.entries(O_))p!=="GOALS"&&c.push({type_id:f,participant_id:l,data:{value:a.totals[l][p]},location:u,type:{id:f,developer_name:p}});let d=l=>{let u=l===Ge.id?Qe.id:Ge.id;return a.score[l]===a.score[u]?null:a.score[l]>a.score[u]};return{data:{id:Number(bc),name:`${Ge.name} vs ${Qe.name}`,starting_at_timestamp:Math.floor(o/1e3),result_info:t.state==="FT"?a.score[Ge.id]===a.score[Qe.id]?"Game ended in draw.":`${a.score[Ge.id]>a.score[Qe.id]?Ge.name:Qe.name} won after full-time.`:null,state:{state:t.state,name:E5[t.state],developer_name:t.state},participants:[Ge,Qe].map((l,u)=>({id:l.id,name:l.name,short_code:l.short_code,meta:{location:u===0?"home":"away",winner:t.state==="FT"?d(l.id):null}})),scores:[Ge,Qe].map((l,u)=>({participant_id:l.id,score:{goals:a.score[l.id],participant:u===0?"home":"away"},description:"CURRENT"})),periods:[1,2].filter(l=>t.period&&l<=t.period).map(l=>{let u=i&&l===t.period,p=l===1?Math.min(a.minute,54):Math.max(46,a.minute);return{type_id:l,ticking:u,minutes:u?p+1:p,seconds:u?Math.floor(t.seconds):0,description:l===1?"1st-half":"2nd-half"}}),events:e.events.filter(l=>l.at<t.played).map(({at:l,...u})=>u),statistics:c,_synth:{colours:{[Ge.id]:Ge.colour,[Qe.id]:Qe.colour},seed:e.seed}}}}function P_({seed:e=6,speed:t=30,from:o=0,now:r=()=>Date.now()}={}){let n=eP(e),a=r(),i=()=>o+(r()-a)/1e3*t,c=a+(60-o)*(1e3/t);return{contest:bc,fetchFixture:async()=>nP(n,tP(n,i()),c)}}ar();hn();xe();Ek();gn();rt();Zu();Wo();Ie();zt();Wu();import{readFile as R_,stat as $5}from"node:fs/promises";import{createServer as A5}from"node:http";import{extname as C5,join as rP,normalize as I5,resolve as ti,sep as O5}from"node:path";async function P5(e){let t;try{t=await R_(e,"utf8")}catch{return}let o=We(t);if(!o.ok){S(yn(e,o.issues),o.issues.map(r=>`${w.cyan(r.path)} ${r.message}`));return}return o.manifest}function R5(e){(e.fixture||e.scenario)&&S("`gamestage dev --fixture` is retired.",["dev now plays your own round through the deployed Engine. The contract fixture marked every pick",`correct, so it could never show your game. Put a practice round in ${Le} instead.`]),e.as&&S("`gamestage dev --as` is retired.",["It signed a player in with keys served from this laptop, and the deployed Engine cannot fetch","keys from a laptop. Practice is played as an anonymous test player. To prove sign-in, deploy","the game with its own identity.jwt issuer and play the deployed page."])}async function N5(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");R5(e);let o=e.manifest??"gamestage.yaml",r=await P5(o);if(!r)throw S(`No ${o} here.`,["`gamestage create` scaffolds a game, and `gamestage inspect . --write` writes a manifest for one you have."]),new Error("unreachable");let n=r.backend.archetype;if(n==="arcade"){let l=r.backend.arcade;if(!l)throw S("An arcade game needs backend.arcade in gamestage.yaml.",["points_per_second is the fastest a fair run can score, and max_run_seconds the longest a run lasts.","`gamestage create --format arcade` writes both with starting values."]),new Error("unreachable");return{kind:"arcade",game:r.app.id,live:!!r.live,title:r.app.title,config:l}}let a=await R_(rP(ti(o,".."),"index.html"),"utf8").catch(()=>""),i=n?Mn(n,qo(a)):void 0,c=await Ga(o,i);if(c.source==="invalid")throw S(jo(c.path),c.problems),new Error("unreachable");if(c.source==="none")throw S(`No round to play for ${r.app.title??r.app.id}.`,[`Put a practice round in ${Le} to play it here. It never reaches Studio or a fan.`,"A game's real rounds are written in Studio, and the deployed game plays them."]),new Error("unreachable");let d=c.round;return n&&n!==d.archetype&&S(`The manifest declares the ${n} format and a ${d.archetype} round.`,["One of the two is wrong. The round decides what the Engine marks."]),{kind:"round",game:r.app.id,live:!!r.live,round:d,title:r.app.title,containerLabel:r.experience.container_label,...c.source==="stand-in"?{sample:!0}:{},...c.source==="practice"?{practice:!0}:{},roundLine:c.line}}var L5={".html":"text/html; charset=utf-8",".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".ico":"image/x-icon",".woff2":"font/woff2"},z5="Practice round, not live",j5="Local practice, not live: runs stay on this laptop";function oP(e=z5){return`<div data-gamestage-practice-bar role="status" style="position:fixed;top:0;left:0;right:0;z-index:2147483647;padding:4px 12px;font:600 13px/1.4 system-ui,sans-serif;text-align:center;background:#111;color:#fff;letter-spacing:0.02em;pointer-events:none">${e}</div>
19890
+ `}function D5(e,t){let o=(a,i)=>`if (!window.${a}) window.${a} = ${JSON.stringify(i)};
19891
19891
  `,r="<script>\n// Added by `gamestage dev --serve` as it served this page. Not in your file.\n"+o("GAMESTAGE_API",t.api)+o("GAMESTAGE_GAME",t.game)+(t.format?o("GAMESTAGE_FORMAT",t.format):"")+(t.gate?`if (!window.GAMESTAGE_GATE) window.GAMESTAGE_GATE = ${JSON.stringify(t.gate)};
19892
- `:"")+(t.token?o("GAMESTAGE_TOKEN",t.token):"")+(t.live?o("GAMESTAGE_LIVE_SOURCE",aP):"")+(t.presentation||t.live?`if (!window.GAMESTAGE_PRESENTATION) window.GAMESTAGE_PRESENTATION = ${JSON.stringify(D5(t))};
19892
+ `:"")+(t.token?o("GAMESTAGE_TOKEN",t.token):"")+(t.live?o("GAMESTAGE_LIVE_SOURCE",aP):"")+(t.presentation||t.live?`if (!window.GAMESTAGE_PRESENTATION) window.GAMESTAGE_PRESENTATION = ${JSON.stringify(M5(t))};
19893
19893
  `:"")+`</script>
19894
19894
  `,n=/<head[^>]*>/i.test(e)?e.replace(/<head[^>]*>/i,a=>`${a}
19895
19895
  ${r}`):r+e;return t.practice&&(n=/<body[^>]*>/i.test(n)?n.replace(/<body[^>]*>/i,a=>`${a}
19896
- ${oP(t.practiceText)}`):n+oP(t.practiceText)),n}var aP="/__gamestage/live";function D5(e){let t=e.presentation??{};return e.live&&!t[ab]?{...t,[ab]:bc}:t}function M5(){let e=I_(),t=P_({speed:Number(process.env.GAMESTAGE_LIVE_SPEED??30)}),o=bm({contest:t.contest,fetchFixture:t.fetchFixture,sink:e,every:2});return{sink:e,stop:()=>o.stop()}}function iP(e,t){t&&!t.gate&&(t={...t,gate:pm(ti(e,"gamestage.yaml"))});let o=t?.live?M5():null,r=$5(async(n,a)=>{let i=new URL(n.url??"/","http://localhost");if(o&&i.pathname===aP){let p=i.searchParams.get("channel")??"";a.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"});let f=o.sink.subscribe(p,g=>a.write(g.kind==="synced"?`event: synced
19896
+ ${oP(t.practiceText)}`):n+oP(t.practiceText)),n}var aP="/__gamestage/live";function M5(e){let t=e.presentation??{};return e.live&&!t[ab]?{...t,[ab]:bc}:t}function F5(){let e=I_(),t=P_({speed:Number(process.env.GAMESTAGE_LIVE_SPEED??30)}),o=bm({contest:t.contest,fetchFixture:t.fetchFixture,sink:e,every:2});return{sink:e,stop:()=>o.stop()}}function iP(e,t){t&&!t.gate&&(t={...t,gate:pm(ti(e,"gamestage.yaml"))});let o=t?.live?F5():null,r=A5(async(n,a)=>{let i=new URL(n.url??"/","http://localhost");if(o&&i.pathname===aP){let p=i.searchParams.get("channel")??"";a.writeHead(200,{"content-type":"text/event-stream","cache-control":"no-store",connection:"keep-alive"});let f=o.sink.subscribe(p,g=>a.write(g.kind==="synced"?`event: synced
19897
19897
  data: {}
19898
19898
 
19899
19899
  `:`data: ${JSON.stringify({class:g.klass,body:g.body})}
19900
19900
 
19901
- `));n.on("close",f);return}let c=decodeURIComponent(i.pathname),d=ti(e,`.${C5(c)}`);if(!(d===e||d.startsWith(e+I5))){a.writeHead(403).end("Outside the served directory");return}let u=d;try{(await E5(u)).isDirectory()&&(u=rP(u,"index.html"))}catch{a.writeHead(404).end("Not found");return}try{let p=await R_(u),f=/\.html?$/i.test(u),g=t&&f&&t.readPresentation?{...t,presentation:await t.readPresentation()}:t,b=g&&f?j5(p.toString("utf8"),g):p;a.writeHead(200,{"content-type":N5[A5(u).toLowerCase()]??"application/octet-stream","cache-control":"no-store, must-revalidate"}),a.end(b)}catch{a.writeHead(404).end("Not found")}});return o&&r.on("close",()=>o.stop()),r}function F5(e,t,o){I("Your game runs in three places"),k(`The Engine, at ${o}. It holds the answers and marks every play.`),t&&e?(A("Open",e),k("Your page is served from this directory, with caching off so an edit shows.")):k("Your page is yours to serve: this command does not, and the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),k("The round a fan plays comes from Studio, not from here. A producer changes it without a deploy and without you."),h(),k("A change to the manifest or the practice round needs a restart: this reads them once, at startup."),h()}function U5(e){throw e instanceof qt&&S(e.message,e.lines),e}async function wm(e,t,o,r){await new Promise((n,a)=>{e.once("error",i=>a(G5(i,t,o,r))),e.listen(t,"127.0.0.1",()=>n())})}function G5(e,t,o,r){let n=t===0?"a free port":`port ${t}`,a=e.code==="EADDRINUSE"?`${n} on 127.0.0.1 is already in use, often by another \`gamestage dev\` still running`:e.code==="EPERM"||e.code==="EACCES"?`this machine refused to open ${n} on 127.0.0.1 (${e.code}). A sandboxed agent or terminal often may not open ports at all`:`${n} on 127.0.0.1 could not be opened (${e.code??e.message})`,i=e.code==="EPERM"||e.code==="EACCES";return new Error(`The ${o} did not start: ${a}. Nothing is running. `+(i?"Run it outside the sandbox, or ask for permission to open a local port.":`Pass ${r} with another port, or ${r} 0 for any free one.`))}async function B5(e,t,o){let r=()=>new Promise((i,c)=>{for(let d of o())d?.close();e.close(d=>d?c(d):i())}),n=new Promise(i=>{let c=async()=>{process.off("SIGINT",c),process.off("SIGTERM",c),await r(),i()};process.once("SIGINT",c),process.once("SIGTERM",c)});await wm(e,t,"local Arcade Engine stand-in","--port");let a=e.address();if(!a||typeof a=="string")throw new Error("The local server did not report its listening address");return{base:`http://127.0.0.1:${a.port}`,stopped:n}}async function sP(e){return(await bn(ti(e,"gamestage.yaml")).catch(()=>{}))?.settings}async function q5(e,t){let o=ti(process.cwd()),r=iP(o,{...t,readPresentation:()=>sP(o)});await wm(r,Number(e.servePort??4001),"page server","--serve-port");let n=r.address();return{pages:r,pagesUrl:n&&typeof n!="string"?`http://127.0.0.1:${n.port}`:void 0}}function W5(e){if(e.kind==="started")return;let t=`${(e.elapsedMs/1e3).toFixed(1)}s`;if(e.refusedBy){h(` Run ${e.number}: ${e.score} points in ${t}. ${w.yellow(`Refused (${e.refusedBy})`)}: it did not count.`);for(let o of e.breaches)h(` Broke ${o}`);return}h(` Run ${e.number}: ${e.score} points in ${t}. Best ${e.best}, ${H5(e.rank??0)} of ${e.of}.`)}function H5(e){let t=e%100;return t>=11&&t<=13?`${e}th`:`${e}${["th","st","nd","rd"][e%10]??"th"}`}async function Y5(e){let t=await zn().catch(()=>{});if(!t)return;let o,r=new Promise(n=>{o=setTimeout(()=>n(void 0),3e3)});try{let n=await Promise.race([t.getGame(e).catch(()=>{}),r]);return Sr(n)}finally{clearTimeout(o)}}async function V5(e,t){let o=Number(e.port),r=Yu({game:t.game,config:t.config,clientBundle:to,onEvent:C()?void 0:W5}),n,{base:a,stopped:i}=await B5(r.server,o,()=>[n]),c;e.serve&&({pages:n,pagesUrl:c}=await q5(e,{api:a,game:t.game,live:t.live,format:"arcade",practice:!0,practiceText:z5}));let d=t.config,l=Vu(t.game,d,await Y5(t.game));C()?L({ok:!0,status:"listening",serving:"arcade-stand-in",baseUrl:a,game:t.game,round:null,round_source:"none",arcade:{engine:"local stand-in",checks:r.policy.checks,ranking:r.policy.ranking,rank_by:r.policy.rankBy??"best",max_run_seconds:r.policy.maxRunSeconds,max_runs_per_day:r.policy.maxRunsPerDay,on_breach:r.policy.onBreach},...l.length?{arcadeLimits:l}:{},...c?{pageUrl:c}:{}}):(I(t.title??t.game),h("An arcade game has no rounds: each play is a run, timed and checked by the Arcade Engine."),A("Serving","a stand-in for the Arcade Engine, on this laptop"),A("Your limits",Ak(d)),A("API",a),A("Game id",t.game),c&&A("Open",c),h(),k("Each run is checked against your limits in gamestage.yaml, the same checks the live Arcade Engine makes. A run that breaks one is refused and does not count, as it is live, and the limit it broke is named below."),k("Runs and the board stay in this process and go when it stops. Nothing reaches the cloud, Studio or a fan."),k(`The board ranks each player's ${r.policy.rankBy==="total"?"total across their runs":"best"}. Open the page in a private window to play as a second player.`),c||k("Your page is yours to serve: the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),k("A change to gamestage.yaml needs a restart: this reads it once, at startup. gamestage.settings.json is read on every page load, so a reload shows an edit to it."),h(),Ku(l),I("Runs")),await i}async function cP(e){let t=await R5(e);if(t.kind==="arcade")return V5(e,t);let o=t,r=await Lo(),n=await Ha({client:r,controlUrl:Re,game:o.game,round:o.round,clientBundle:to}).catch(U5),{server:a}=n,i=()=>new Promise((g,b)=>{p?.close(),a.close(v=>v?b(v):g())}),c=new Promise(g=>{let b=async()=>{process.off("SIGINT",b),process.off("SIGTERM",b),await i(),g()};process.once("SIGINT",b),process.once("SIGTERM",b)});await wm(a,Number(e.port),"local Engine proxy","--port");let d=a.address();if(!d||typeof d=="string")throw new Error("The local server did not report its listening address");let l=`http://127.0.0.1:${d.port}`,u=(await Ke().catch(()=>null))?.email,p,f;if(e.serve){let g=ti(process.cwd());p=iP(g,{readPresentation:()=>sP(g),api:l,game:o.game,live:o.live,...o.practice?{practice:!0}:{}}),await wm(p,Number(e.servePort??4001),"page server","--serve-port");let b=p.address();b&&typeof b!="string"&&(f=`http://127.0.0.1:${b.port}`)}if(C())L({ok:!0,status:"listening",serving:"engine",baseUrl:l,game:o.game,round:{number:o.round.number,id:n.roundId},round_source:o.practice?"practice":"stand-in",round_line:o.roundLine,engine:{url:n.upstream,tenant:n.engineGame,provision_ms:n.provisionMs,test_sessions:!0},...f?{pageUrl:f}:{}});else{I(o.title??o.game);let g=pa(o.containerLabel),b=pa(o.containerLabel,{lower:!0});h(o.roundLine),A("Serving",o.practice?`your ${b}, through the deployed Engine`:`a stand-in ${b}, through the deployed Engine`),A(g,`${o.round.number} (${n.roundId})`),A("Engine",`${n.upstream} (ready in ${n.provisionMs}ms)`),A("API",l),A("Game id",o.game),u&&A("Signed in",u),h(),k(`<script src="${l}/gamestage.js"></script>`),k(`window.GAMESTAGE_API = "${l}"`),k(`window.GAMESTAGE_GAME = "${o.game}"`),h(),k("Every play here is a test play: marked by the real Engine, and on no leaderboard. Your live game's round is never touched."),o.practice?k(`Edit ${Le} and restart to see it change. A deploy never uploads it.`):k(`This is a stand-in ${b}. Put your own practice ${b} in ${Le} to play it here.`),k(`Your game's real ${b}s are written in Studio, where a producer changes them without a deploy. ${w.cyan(ee("round push <game>"))} copies ${Le} there.`),h(),F5(f,!!e.serve,n.upstream)}await c}Wo();vk();xe();rt();Nn();Wu();Xs();tc();_r();Ie();Wo();zt();import{readFile as km}from"node:fs/promises";import{gzipSync as K5}from"node:zlib";import{basename as Z5,dirname as J5,resolve as z_}from"node:path";var N_=30,vm=3,L_=3,X5=6,Q5=13,wc=/\b(play (next|again|another|on)|next round|another round|come back)\b/i,lP=`(() => {
19901
+ `));n.on("close",f);return}let c=decodeURIComponent(i.pathname),d=ti(e,`.${I5(c)}`);if(!(d===e||d.startsWith(e+O5))){a.writeHead(403).end("Outside the served directory");return}let u=d;try{(await $5(u)).isDirectory()&&(u=rP(u,"index.html"))}catch{a.writeHead(404).end("Not found");return}try{let p=await R_(u),f=/\.html?$/i.test(u),g=t&&f&&t.readPresentation?{...t,presentation:await t.readPresentation()}:t,b=g&&f?D5(p.toString("utf8"),g):p;a.writeHead(200,{"content-type":L5[C5(u).toLowerCase()]??"application/octet-stream","cache-control":"no-store, must-revalidate"}),a.end(b)}catch{a.writeHead(404).end("Not found")}});return o&&r.on("close",()=>o.stop()),r}function U5(e,t,o){I("Your game runs in three places"),k(`The Engine, at ${o}. It holds the answers and marks every play.`),t&&e?(A("Open",e),k("Your page is served from this directory, with caching off so an edit shows.")):k("Your page is yours to serve: this command does not, and the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),k("The round a fan plays comes from Studio, not from here. A producer changes it without a deploy and without you."),h(),k("A change to the manifest or the practice round needs a restart: this reads them once, at startup."),h()}function G5(e){throw e instanceof qt&&S(e.message,e.lines),e}async function wm(e,t,o,r){await new Promise((n,a)=>{e.once("error",i=>a(B5(i,t,o,r))),e.listen(t,"127.0.0.1",()=>n())})}function B5(e,t,o,r){let n=t===0?"a free port":`port ${t}`,a=e.code==="EADDRINUSE"?`${n} on 127.0.0.1 is already in use, often by another \`gamestage dev\` still running`:e.code==="EPERM"||e.code==="EACCES"?`this machine refused to open ${n} on 127.0.0.1 (${e.code}). A sandboxed agent or terminal often may not open ports at all`:`${n} on 127.0.0.1 could not be opened (${e.code??e.message})`,i=e.code==="EPERM"||e.code==="EACCES";return new Error(`The ${o} did not start: ${a}. Nothing is running. `+(i?"Run it outside the sandbox, or ask for permission to open a local port.":`Pass ${r} with another port, or ${r} 0 for any free one.`))}async function q5(e,t,o){let r=()=>new Promise((i,c)=>{for(let d of o())d?.close();e.close(d=>d?c(d):i())}),n=new Promise(i=>{let c=async()=>{process.off("SIGINT",c),process.off("SIGTERM",c),await r(),i()};process.once("SIGINT",c),process.once("SIGTERM",c)});await wm(e,t,"local Arcade Engine stand-in","--port");let a=e.address();if(!a||typeof a=="string")throw new Error("The local server did not report its listening address");return{base:`http://127.0.0.1:${a.port}`,stopped:n}}async function sP(e){return(await bn(ti(e,"gamestage.yaml")).catch(()=>{}))?.settings}async function W5(e,t){let o=ti(process.cwd()),r=iP(o,{...t,readPresentation:()=>sP(o)});await wm(r,Number(e.servePort??4001),"page server","--serve-port");let n=r.address();return{pages:r,pagesUrl:n&&typeof n!="string"?`http://127.0.0.1:${n.port}`:void 0}}function H5(e){if(e.kind==="started")return;let t=`${(e.elapsedMs/1e3).toFixed(1)}s`;if(e.refusedBy){h(` Run ${e.number}: ${e.score} points in ${t}. ${w.yellow(`Refused (${e.refusedBy})`)}: it did not count.`);for(let o of e.breaches)h(` Broke ${o}`);return}h(` Run ${e.number}: ${e.score} points in ${t}. Best ${e.best}, ${Y5(e.rank??0)} of ${e.of}.`)}function Y5(e){let t=e%100;return t>=11&&t<=13?`${e}th`:`${e}${["th","st","nd","rd"][e%10]??"th"}`}async function V5(e){let t=await zn().catch(()=>{});if(!t)return;let o,r=new Promise(n=>{o=setTimeout(()=>n(void 0),3e3)});try{let n=await Promise.race([t.getGame(e).catch(()=>{}),r]);return Sr(n)}finally{clearTimeout(o)}}async function K5(e,t){let o=Number(e.port),r=Yu({game:t.game,config:t.config,clientBundle:to,onEvent:C()?void 0:H5}),n,{base:a,stopped:i}=await q5(r.server,o,()=>[n]),c;e.serve&&({pages:n,pagesUrl:c}=await W5(e,{api:a,game:t.game,live:t.live,format:"arcade",practice:!0,practiceText:j5}));let d=t.config,l=Vu(t.game,d,await V5(t.game));C()?L({ok:!0,status:"listening",serving:"arcade-stand-in",baseUrl:a,game:t.game,round:null,round_source:"none",arcade:{engine:"local stand-in",checks:r.policy.checks,ranking:r.policy.ranking,rank_by:r.policy.rankBy??"best",max_run_seconds:r.policy.maxRunSeconds,max_runs_per_day:r.policy.maxRunsPerDay,on_breach:r.policy.onBreach},...l.length?{arcadeLimits:l}:{},...c?{pageUrl:c}:{}}):(I(t.title??t.game),h("An arcade game has no rounds: each play is a run, timed and checked by the Arcade Engine."),A("Serving","a stand-in for the Arcade Engine, on this laptop"),A("Your limits",Ak(d)),A("API",a),A("Game id",t.game),c&&A("Open",c),h(),k("Each run is checked against your limits in gamestage.yaml, the same checks the live Arcade Engine makes. A run that breaks one is refused and does not count, as it is live, and the limit it broke is named below."),k("Runs and the board stay in this process and go when it stops. Nothing reaches the cloud, Studio or a fan."),k(`The board ranks each player's ${r.policy.rankBy==="total"?"total across their runs":"best"}. Open the page in a private window to play as a second player.`),c||k("Your page is yours to serve: the API URL above is not a page. `gamestage dev --serve` serves this directory if you want one."),k("A change to gamestage.yaml needs a restart: this reads it once, at startup. gamestage.settings.json is read on every page load, so a reload shows an edit to it."),h(),Ku(l),I("Runs")),await i}async function cP(e){let t=await N5(e);if(t.kind==="arcade")return K5(e,t);let o=t,r=await Lo(),n=await Ha({client:r,controlUrl:Re,game:o.game,round:o.round,clientBundle:to}).catch(G5),{server:a}=n,i=()=>new Promise((g,b)=>{p?.close(),a.close(v=>v?b(v):g())}),c=new Promise(g=>{let b=async()=>{process.off("SIGINT",b),process.off("SIGTERM",b),await i(),g()};process.once("SIGINT",b),process.once("SIGTERM",b)});await wm(a,Number(e.port),"local Engine proxy","--port");let d=a.address();if(!d||typeof d=="string")throw new Error("The local server did not report its listening address");let l=`http://127.0.0.1:${d.port}`,u=(await Ke().catch(()=>null))?.email,p,f;if(e.serve){let g=ti(process.cwd());p=iP(g,{readPresentation:()=>sP(g),api:l,game:o.game,live:o.live,...o.practice?{practice:!0}:{}}),await wm(p,Number(e.servePort??4001),"page server","--serve-port");let b=p.address();b&&typeof b!="string"&&(f=`http://127.0.0.1:${b.port}`)}if(C())L({ok:!0,status:"listening",serving:"engine",baseUrl:l,game:o.game,round:{number:o.round.number,id:n.roundId},round_source:o.practice?"practice":"stand-in",round_line:o.roundLine,engine:{url:n.upstream,tenant:n.engineGame,provision_ms:n.provisionMs,test_sessions:!0},...f?{pageUrl:f}:{}});else{I(o.title??o.game);let g=pa(o.containerLabel),b=pa(o.containerLabel,{lower:!0});h(o.roundLine),A("Serving",o.practice?`your ${b}, through the deployed Engine`:`a stand-in ${b}, through the deployed Engine`),A(g,`${o.round.number} (${n.roundId})`),A("Engine",`${n.upstream} (ready in ${n.provisionMs}ms)`),A("API",l),A("Game id",o.game),u&&A("Signed in",u),h(),k(`<script src="${l}/gamestage.js"></script>`),k(`window.GAMESTAGE_API = "${l}"`),k(`window.GAMESTAGE_GAME = "${o.game}"`),h(),k("Every play here is a test play: marked by the real Engine, and on no leaderboard. Your live game's round is never touched."),o.practice?k(`Edit ${Le} and restart to see it change. A deploy never uploads it.`):k(`This is a stand-in ${b}. Put your own practice ${b} in ${Le} to play it here.`),k(`Your game's real ${b}s are written in Studio, where a producer changes them without a deploy. ${w.cyan(ee("round push <game>"))} copies ${Le} there.`),h(),U5(f,!!e.serve,n.upstream)}await c}Wo();vk();xe();rt();Nn();Wu();Xs();tc();_r();Ie();Wo();zt();import{readFile as km}from"node:fs/promises";import{gzipSync as Z5}from"node:zlib";import{basename as J5,dirname as X5,resolve as z_}from"node:path";var N_=30,vm=3,L_=3,Q5=6,e3=13,wc=/\b(play (next|again|another|on)|next round|another round|come back)\b/i,lP=`(() => {
19902
19902
  const vw = innerWidth, vh = innerHeight;
19903
19903
  const visible = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== "hidden" && s.display !== "none" && Number(s.opacity) > 0.05; };
19904
19904
  const segments = (root) => {
@@ -19928,7 +19928,7 @@ data: {}
19928
19928
  if (control) control.click();
19929
19929
  else document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true }));
19930
19930
  return Boolean(control);
19931
- })()`;function e3(e){let t=e;switch(De(t.archetype)){case"hunt":{let o=Array.isArray(t.targets)?t.targets.length:1,r=typeof t.required=="number"?t.required:o,n=typeof t.mistakePenalty=="number"&&t.mistakePenalty>0,a=typeof t.mistakesAllowed=="number"?t.mistakesAllowed:4;return(r+1)*(n?a+1:1)}case"group":return(Array.isArray(t.groups)?t.groups.length:4)+1;case"predict":{let o=Array.isArray(t.questions)?t.questions:[];return o.some(r=>r.tolerance!==void 0)?"many":o.length+1}case"push":return"many";case"bingo":return 9;default:return}}function t3(e){let t=e3(e),o="Design the scoring so ties are rare.";return t===void 0?{id:"ties",status:"skipped",summary:`Cannot estimate ties for the ${e.archetype} format yet.`}:t==="many"?{id:"ties",status:"ok",summary:"Scores vary continuously, so ties will be rare."}:t<X5?{id:"ties",status:"advice",summary:`About ${t} distinct scores a round: ties will be common.`,rule:o,fix:"Rank the week's total rather than one round, and score by something that varies: fewer guesses scoring more (mistakePenalty), speed, or how close a fan came."}:t<Q5?{id:"ties",status:"advice",summary:`About ${t} distinct scores a round: regular players will tie.`,rule:o,fix:"Rank the week's total rather than one round; the Engine breaks equal totals by who got there first."}:{id:"ties",status:"ok",summary:`About ${t} distinct scores a round: ties will be uncommon.`}}function uP(e){let t=e;if(De(t.archetype)!=="hunt")return;let o=Array.isArray(t.board)?t.board.length:0;if((Array.isArray(t.targets)?t.targets.length:0)===1)return o>=6?{id:"options",status:"ok",summary:`${o} options for a one-answer pick.`}:{id:"options",status:"advice",summary:`Only ${o} options for a one-answer pick.`,rule:"Give a pick-one quiz six options, not four.",fix:"Add plausible wrong options until there are six, including one deliberate trap."}}function n3(e,t){let r=Mo(e).get("og:image");return t?{id:"share",status:"ok",summary:r?"A share card is declared and a Share button is on the result screen.":"A Share button is on the result screen; `gamestage deploy` writes the share card."}:{id:"share",status:"advice",summary:r?"A share card is declared, but there is no Share button on the result screen.":"No share card is declared on the page yet.",rule:"Share without spoiling: the score and how the fan got there, never the answer.",fix:"Add a Share result button under Play next, sharing the score and the path to it, never the answer."}}var o3=`(() => {
19931
+ })()`;function t3(e){let t=e;switch(De(t.archetype)){case"hunt":{let o=Array.isArray(t.targets)?t.targets.length:1,r=typeof t.required=="number"?t.required:o,n=typeof t.mistakePenalty=="number"&&t.mistakePenalty>0,a=typeof t.mistakesAllowed=="number"?t.mistakesAllowed:4;return(r+1)*(n?a+1:1)}case"group":return(Array.isArray(t.groups)?t.groups.length:4)+1;case"predict":{let o=Array.isArray(t.questions)?t.questions:[];return o.some(r=>r.tolerance!==void 0)?"many":o.length+1}case"push":return"many";case"bingo":return 9;default:return}}function n3(e){let t=t3(e),o="Design the scoring so ties are rare.";return t===void 0?{id:"ties",status:"skipped",summary:`Cannot estimate ties for the ${e.archetype} format yet.`}:t==="many"?{id:"ties",status:"ok",summary:"Scores vary continuously, so ties will be rare."}:t<Q5?{id:"ties",status:"advice",summary:`About ${t} distinct scores a round: ties will be common.`,rule:o,fix:"Rank the week's total rather than one round, and score by something that varies: fewer guesses scoring more (mistakePenalty), speed, or how close a fan came."}:t<e3?{id:"ties",status:"advice",summary:`About ${t} distinct scores a round: regular players will tie.`,rule:o,fix:"Rank the week's total rather than one round; the Engine breaks equal totals by who got there first."}:{id:"ties",status:"ok",summary:`About ${t} distinct scores a round: ties will be uncommon.`}}function uP(e){let t=e;if(De(t.archetype)!=="hunt")return;let o=Array.isArray(t.board)?t.board.length:0;if((Array.isArray(t.targets)?t.targets.length:0)===1)return o>=6?{id:"options",status:"ok",summary:`${o} options for a one-answer pick.`}:{id:"options",status:"advice",summary:`Only ${o} options for a one-answer pick.`,rule:"Give a pick-one quiz six options, not four.",fix:"Add plausible wrong options until there are six, including one deliberate trap."}}function o3(e,t){let r=Mo(e).get("og:image");return t?{id:"share",status:"ok",summary:r?"A share card is declared and a Share button is on the result screen.":"A Share button is on the result screen; `gamestage deploy` writes the share card."}:{id:"share",status:"advice",summary:r?"A share card is declared, but there is no Share button on the result screen.":"No share card is declared on the page yet.",rule:"Share without spoiling: the score and how the fan got there, never the answer.",fix:"Add a Share result button under Play next, sharing the score and the path to it, never the answer."}}var r3=`(() => {
19932
19932
  const visible = (el) => {
19933
19933
  const r = el.getBoundingClientRect();
19934
19934
  const s = getComputedStyle(el);
@@ -19948,7 +19948,7 @@ data: {}
19948
19948
  storyOpen: false,
19949
19949
  streakCue: Boolean(document.querySelector('[data-gs-component="streak"]')) || /\\b(streak|come back|tomorrow|next round)\\b/i.test(text),
19950
19950
  };
19951
- })()`,r3=`(() => {
19951
+ })()`,a3=`(() => {
19952
19952
  const visible = (el) => { const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0 && getComputedStyle(el).visibility !== "hidden"; };
19953
19953
  const all = [...document.querySelectorAll('button, [role="button"]')].filter(visible);
19954
19954
  if (all.some((b) => ${wc.toString()}.test(b.innerText || ""))) return "ended";
@@ -19982,12 +19982,12 @@ data: {}
19982
19982
  if (commit) commit.click();
19983
19983
  }, 200);
19984
19984
  return "played";
19985
- })()`;function a3(e){let t=[],o=[...e.buttons].sort((r,n)=>n.area-r.area)[0];if(!o)t.push({id:"play-next",status:"advice",summary:"No button is on the result screen.",rule:"Play next is the loudest button after a round.",fix:"Show Play next (or a greyed Come back tomorrow when the pool is empty) as the main button."});else if(wc.test(o.text))t.push({id:"play-next",status:"ok",summary:`The main button after a round is "${o.text}".`});else if(e.buttons.some(r=>wc.test(r.text)&&r.area*1.25>=o.area)){let r=e.buttons.find(n=>wc.test(n.text));t.push({id:"play-next",status:"ok",summary:`The main button after a round is "${r.text}".`})}else{let r=e.buttons.some(n=>wc.test(n.text));t.push({id:"play-next",status:"advice",summary:r?`Play next is on the result screen, but the largest button is "${o.text}".`:`There is no Play next on the result screen; the largest button is "${o.text}".`,rule:"Play next is the loudest button after a round.",fix:r?`Give Play next the primary, full-width style and put "${o.text}" beneath it.`:"Add Play next as the main button, reading the Engine's next round, with Come back tomorrow greyed when none is left."})}return t.push(e.streakCue?{id:"come-back",status:"ok",summary:"A streak or come-back cue is on the result screen."}:{id:"come-back",status:"advice",summary:"Nothing on the result screen gives a reason to come back.",rule:"Give fans a reason to come back.",fix:"Show the fan's streak once it reaches two, and when the next round opens."}),t}function i3(e,t){let o=`The story is 1 to ${L_} slides and opens only when the fan taps it.`;return e?{id:"story",status:"advice",summary:`The story opened on its own after the round${t?`, with ${t} slides`:""}.`,rule:o,fix:"Land on the result screen and let See the story open it."}:t===void 0?{id:"story",status:"ok",summary:"No story opened on its own after the round."}:t>L_?{id:"story",status:"advice",summary:`The story waits to be opened, but has ${t} slides.`,rule:o,fix:`Keep the answer, the closest miss and one fact: ${L_} slides at most.`}:{id:"story",status:"ok",summary:`The story waits to be opened, and has ${t} slide${t===1?"":"s"}.`}}function s3(e,t,o){if(o===0)return{id:"first-answer",status:"advice",summary:`No answer could be reached from the first screen within ${Math.round(e)}s.`,rule:`A fan reaches their first answer within ${N_} seconds, in ${vm} taps or fewer.`,fix:"Put the round on the first screen, and make the intro screen's Play go straight to the board."};let r=`First answer in ${e.toFixed(1)}s, ${t} tap${t===1?"":"s"}.`;return e<=N_&&t<=vm?{id:"first-answer",status:"ok",summary:r}:{id:"first-answer",status:"advice",summary:r,rule:`A fan reaches their first answer within ${N_} seconds, in ${vm} taps or fewer.`,fix:t>vm?"Remove a screen between arriving and answering: How to play is a button, never a gate.":"Load less before the board: see `gamestage verify`'s load report."}}async function c3(e){let t=await zn().catch(()=>{});if(!t)return{finding:{id:"rounds",status:"skipped",summary:"Not signed in, so the rounds in the live pool could not be counted."}};let r=(await t.getGame(e).catch(()=>{}))?.playerEndpoint?.replace(/\/$/,"");if(!r)return{finding:{id:"rounds",status:"skipped",summary:"This game has not been deployed yet, so it has no live pool to count."}};try{let n=await(await fetch(`${r}/rounds`,{headers:ct()})).json(),a=await(await fetch(`${r}/rounds/current`,{headers:ct()})).json().catch(()=>({})),i=Array.isArray(n.rounds)?n.rounds.length:0,c=Array.isArray(a.challenge?.board)?a.challenge.board.length:void 0,d=typeof a.challenge?.pick=="number"?a.challenge.pick:void 0;return{finding:i>=7?{id:"rounds",status:"ok",summary:`${i} rounds ready in the live pool.`}:{id:"rounds",status:"advice",summary:`${i} round${i===1?"":"s"} ready in the live pool.`,rule:"A daily rhythm, with a clear end.",fix:"Keep at least a week of rounds ready (`gamestage round seed` can draft them from a dataset), and show Come back tomorrow when they run out."},board:c,pick:d}}catch{return{finding:{id:"rounds",status:"skipped",summary:"The live pool did not answer, so its rounds could not be counted."}}}}async function mP(e){let t=e.manifest??"gamestage.yaml",o;try{let x=We(await km(t,"utf8"));if(!x.ok)return S(yn(t,x.issues));o=x.manifest}catch{return S(`Cannot read ${t}.`,["Run `gamestage review` from the game's folder, or pass --manifest."])}let r=await km(z_(e.file??"index.html"),"utf8").catch(()=>""),n=await Ga(t,Mn(o.backend.archetype,qo(r)));if(n.source==="invalid")return S(jo(n.path),n.problems);if(n.source==="none")return S(`No round to review with: ${o.backend.archetype} has no stand-in round yet.`,[`Put a practice round in ${Le}.`]);let a=n.round,i=z_(e.file??"index.html"),c;try{c=await km(i,"utf8")}catch{return S(`Cannot read ${e.file??"index.html"}.`,["Build the game first, then pass its page with --file."])}let d=[],l=De(a.archetype),u=await zn();if(!u)d.push({id:"play",status:"skipped",summary:"The game was not played: playing it needs the deployed Engine, which needs `gamestage login`."});else{let x=await l3(i,t,o,a,u);d.push(...x.findings),d.push(n3(c,x.shareButton))}let p=n.source!=="practice",f=t3(a);p&&f.status!=="skipped"&&(f.status="skipped",f.summary=`This game's rounds live in Studio, so its scoring cannot be read here. For reference, a representative ${l} round: ${f.summary.charAt(0).toLowerCase()}${f.summary.slice(1)}`),d.push(f);let g=await c3(o.app.id),b=p&&g.board!==void 0?uP({...a,board:Array.from({length:g.board},(x,R)=>`option ${R}`),targets:g.pick===1?["option 0"]:["option 0","option 1"]}):uP(a);if(b&&d.push(b),d.push(g.finding),C()){L({game:o.app.id,format:l,round_line:n.line,findings:d});return}I(`Review of ${o.app.title} (${l}), played locally against a real Engine`),h(n.line);for(let x of d){let R=x.status==="ok"?w.green("ok "):x.status==="advice"?w.yellow("advice "):w.dim("skipped ");h(` ${R} ${x.summary}`),x.rule&&h(` ${w.dim("Rule:")} ${x.rule}`),x.fix&&h(` ${w.dim("Fix:")} ${x.fix}`)}h();let v=d.filter(x=>x.status==="advice").length;h(v===0?"Nothing to advise. The rules and the evidence behind them: https://gamestage.ai/docs/game-design":`${v} piece${v===1?"":"s"} of advice. None of it blocks a deploy. The rules and the evidence behind them: https://gamestage.ai/docs/game-design`)}async function l3(e,t,o,r,n){let a;try{({server:a}=await Ha({client:n,controlUrl:Re,game:o.app.id,round:r}))}catch(v){if(!(v instanceof qt))throw v;return{findings:[{id:"play",status:"skipped",summary:`The game was not played: ${v.message} ${v.lines.join(" ")}`.trim()}],shareButton:!1}}await new Promise(v=>a.listen(0,"127.0.0.1",()=>v()));let i=a.address(),c=i&&typeof i!="string"?`http://127.0.0.1:${i.port}`:"",d=(await bn(z_(t)).catch(()=>{}))?.settings,l=br(d??{},o.app.title),{createServer:u}=await import("node:http"),p=u(async(v,x)=>{let R=qs(J5(e),v.url??"/",Z5(e));if(!R){x.writeHead(403).end();return}try{let F=await km(R);if(R===e){let W=F.toString("utf8");W.includes(bt)&&(F=Buffer.from(Ea(W,l)))}let U=/\bgzip\b/.test(String(v.headers["accept-encoding"]??""));x.writeHead(200,{"content-type":lc(R),...U?{"content-encoding":"gzip"}:{}}),x.end(U?K5(F):F)}catch{x.writeHead(404).end()}});await new Promise(v=>p.listen(0,"127.0.0.1",()=>v()));let f=p.address(),g=f&&typeof f!="string"?`http://127.0.0.1:${f.port}/`:"",b;try{let v=await Qt();if(v.status==="skipped")return{findings:[{id:"play",status:"skipped",summary:`The game was not played: ${v.detail}`}],shareButton:!1};b=v.browser;let x=`window.GAMESTAGE_API = ${JSON.stringify(c)};window.GAMESTAGE_GAME = ${JSON.stringify(o.app.id)};`+(d?`window.GAMESTAGE_PRESENTATION = ${JSON.stringify(d)};`:"");await b.setViewport(390,844),await b.addScriptToEvaluateOnNewDocument(x);let R=Date.now();await b.navigate(g,2e4);let F=await r_(b,r.archetype),U=[s3((Date.now()-R)/1e3,F.taps,F.picks)];await b.close().catch(()=>{});let W=await Qt();if(W.status==="skipped")return U.push({id:"play",status:"skipped",summary:`The round was not played: ${W.detail}`}),{findings:U,shareButton:!1};b=W.browser,await b.addScriptToEvaluateOnNewDocument(x);let T=await cc(b,g,c,o.app.id,r.archetype);if(T.status!=="verified")return U.push({id:"play",status:"skipped",summary:`The round could not be finished here, so the result screen was not reviewed. ${T.detail??""}`.trim()}),{findings:U,shareButton:!1};for(let ie=0;ie<12&&await b.run(r3).catch(()=>"stuck")==="played";ie++)await new Promise(se=>setTimeout(se,De(r.archetype)==="shoot"?2500:900));await new Promise(ie=>setTimeout(ie,1500)),await b.run(`(() => { const k = [...document.querySelectorAll('button')].find((b) => /^keep\\b/i.test((b.innerText || "").trim())); if (k) k.click(); return Boolean(k); })()`).catch(()=>!1),await new Promise(ie=>setTimeout(ie,800));let H=await b.run(lP).catch(()=>({open:!1,slides:0})),G=H.open?H.slides:void 0;H.open&&(await b.run(dP).catch(()=>!1),await new Promise(ie=>setTimeout(ie,800)));let oe=await b.run(o3);if(oe.storyOpen=H.open,process.env.GAMESTAGE_REVIEW_SCREENSHOT){let{writeFile:ie}=await import("node:fs/promises");await ie(process.env.GAMESTAGE_REVIEW_SCREENSHOT,await b.screenshot(390,844)).catch(()=>{})}let re=!1;if(!H.open&&oe.buttons.some(ie=>/\bstory\b/i.test(ie.text))){await b.run(`(() => { const shown = (el) => { const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0; }; const b = [...document.querySelectorAll('button, [role="button"]')].find((el) => shown(el) && /\\bstory\\b/i.test(el.innerText || "")); if (b) { b.scrollIntoView({ block: "center" }); b.click(); } return Boolean(b); })()`).catch(()=>!1),await new Promise(te=>setTimeout(te,1500));let ie=await b.run(lP).catch(()=>({open:!1,slides:0}));if(ie.open?G=ie.slides:re=!0,process.env.GAMESTAGE_REVIEW_STORY_SCREENSHOT){let{writeFile:te}=await import("node:fs/promises");await te(process.env.GAMESTAGE_REVIEW_STORY_SCREENSHOT,await b.screenshot(390,844)).catch(()=>{})}await b.run(dP).catch(()=>!1)}return U.push(re?{id:"story",status:"advice",summary:"A story button is on the result screen, and pressing it opened nothing.",rule:"Reveal the answer after every round.",fix:"Show the story button only when there is a story to open, or give every round at least the answer's slide."}:i3(oe.storyOpen,G)),U.push(...a3(oe)),{findings:U,shareButton:oe.buttons.some(ie=>/\bshare\b/i.test(ie.text))}}catch(v){return{findings:[{id:"play",status:"skipped",summary:`The game could not be played here: ${v instanceof Error?v.message:String(v)}`}],shareButton:!1}}finally{await b?.close().catch(()=>{}),a.close(),p.close()}}hn();xe();Ie();No();import{stat as d3}from"node:fs/promises";No();async function _m(e=process.env){if(Xn&&!(e.CI||e.GAMESTAGE_TEST_RUN||e.GAMESTAGE_NO_UPDATE_CHECK))try{let t=await fetch("https://gamestage.ai/agent.md",{signal:AbortSignal.timeout(1500)});if(!t.ok)return;let o=(await t.text()).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1];if(!o)return;let r=o.split("-").map(Number),n=Xn.split("-").map(Number),a=Array.from({length:Math.max(r.length,n.length)},(i,c)=>(r[c]??0)-(n[c]??0)).find(i=>i!==0);return a===void 0||a<0?void 0:`This tool is from ${Xn}; the current one is ${o}. Run npx gamestage@latest start to use the latest CLI.`}catch{return}}function u3(e){let t=I1(e);return{id:"node",label:"Node.js",ok:t,detail:t?`v${e}`:`v${e} - Gamestage needs Node ${zu} or newer`,blocking:!0}}async function pP(){let e=_m(),t=[];t.push(u3(process.versions.node)),t.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${ps} bundled`,blocking:!1});let o=!1;try{await d3("gamestage.yaml"),o=!0}catch{}t.push({id:"manifest",label:"App Manifest",ok:o,detail:o?"gamestage.yaml found":"none here yet: `gamestage inspect .` or `gamestage create` makes one",blocking:!1});let r=await Ke().catch(()=>null);t.push({id:"auth",label:"Signed in",ok:!!r,detail:r?`as ${r.email}`:"not signed in: `gamestage login` before dev, verify or deploy",blocking:!1});let n=t.filter(i=>!i.ok&&i.blocking),a=await e;C()&&(L({ok:n.length===0,checks:t,...a?{pack_update:a}:{}}),process.exit(n.length===0?0:1)),a&&h(a),I("Environment");for(let i of t){let c=i.ok?w.green("ok"):i.blocking?w.red("blocked"):w.dim("--");h(` ${c.padEnd(18)} ${i.label.padEnd(16)} ${w.dim(i.detail)}`)}h(),n.length&&(h(` ${w.red("Fix the blocked items above before continuing.")}`),h(),process.exit(1)),h(` ${w.green("Ready.")}`),h()}va();xe();hn();import{readFile as R3,stat as N3,writeFile as L3}from"node:fs/promises";import{createHash as z3}from"node:crypto";import{basename as j3}from"node:path";rt();Nn();Bk();import{readdir as h3,readFile as vc,stat as xm}from"node:fs/promises";import{createHash as f3}from"node:crypto";import{basename as gP,dirname as g3,extname as y3,join as Sm,relative as b3}from"node:path";var m3={canvas:/<canvas\b|getContext\(\s*["'](?:2d|webgl2?)["']/i,scaled:/transform\s*[:=]\s*[`"']?\s*scale\(|\.scale\(\s*(?:window\.)?devicePixelRatio|\bDESIGN_(?:WIDTH|HEIGHT)\b|\bdesignWidth\b/i,fullHeight:/height\s*:\s*100(?:d|s|l)?vh|inset\s*:\s*0\b[^;]*;[^}]*position\s*:\s*fixed|position\s*:\s*fixed[^}]*inset\s*:\s*0\b/i,noScroll:/(?:html|body)[^{]*\{[^}]*overflow\s*:\s*hidden|overscroll-behavior\s*:\s*none|document\.body\.style\.overflow\s*=\s*["']hidden/i,aspect:/aspect-ratio\s*:\s*\d+\s*\/\s*\d+|padding-(?:bottom|top)\s*:\s*\d{2,3}(?:\.\d+)?%/i};function p3(e,t){for(let o of e){let r=o.text.split(`
19986
- `);for(let n=0;n<r.length;n++)if(t.test(r[n]))return{file:o.relative,line:n+1,text:r[n].trim().slice(0,120)};if(t.test(o.text))return{file:o.relative,line:1,text:"(matched across lines)"}}return null}function hP(e){if(!e.some(a=>/<(?:div|section|main|canvas|body)\b/i.test(a.text)))return null;let o=Object.fromEntries(Object.entries(m3).map(([a,i])=>[a,p3(e,i)])),r=(a,i)=>{let c=i.filter(([,d])=>o[d]);return{layout:a,confidence:c.length>=2?"likely":"possible",because:c.map(([d])=>d),evidence:c.map(([,d])=>o[d])}},n=!!(o.fullHeight&&o.noScroll);return o.canvas&&o.scaled?r("canvas",[["draws on a canvas","canvas"],["scales a fixed design size to the viewport","scaled"],["holds the page still","noScroll"]]):n||o.canvas&&(o.fullHeight||o.noScroll)?r("screen",[["fills the viewport's height","fullHeight"],["stops the page scrolling","noScroll"],["draws on a canvas","canvas"]]):o.aspect?r("card",[["sizes its box to a fixed proportion","aspect"]]):{layout:"page",confidence:"possible",because:["nothing holds the page still or fixes its proportions, so the document scrolls"],evidence:[]}}Za();gn();var w3=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),v3=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function k3(e){return f3("sha256").update(e).digest("hex").slice(0,16)}var _3={[wt]:vr,[tt]:jn};function x3(e){let t=gP(e.relative);if(nc(e.relative))return`${t} is never published by \`gamestage deploy\`, so nothing in it reaches a browser.`;let o=_3[t];return!o||k3(e.text)!==o?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 S3(e,t=200){let o=await xm(e),r=[],n=[],a=c=>{let d=x3(c);d?n.push({file:c.relative,reason:d}):r.push(c)};if(o.isFile())return a({path:e,relative:gP(e),text:await vc(e,"utf8")}),{files:r,skipped:n};let i=async c=>{if(r.length>=t)return;let d=await h3(c,{withFileTypes:!0});for(let l of d){if(r.length>=t)return;if(l.name.startsWith(".")&&l.name!==".openai")continue;let u=Sm(c,l.name);if(l.isDirectory()){if(w3.has(l.name))continue;await i(u)}else if(v3.has(y3(l.name)))try{a({path:u,relative:b3(e,u),text:await vc(u,"utf8")})}catch{}}};return await i(e),{files:r,skipped:n}}function T3(e,t){let o=e.text.split(`
19987
- `);for(let r=0;r<o.length;r++)if(t.test(o[r]))return{file:e.relative,line:r+1,excerpt:o[r].trim().slice(0,120)};return null}async function E3(e,t){if(!(await xm(e)).isFile())try{let r=JSON.parse(await vc(Sm(e,"package.json"),"utf8"));if(r.name)return r.name.replace(/^@[^/]+\//,"")}catch{}for(let r of t){if(!/\.html?$/.test(r.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(r.text);if(n){let i=fP(n[1]);if(i)return i}let a=/<title[^>]*>([^<]+)<\/title>/i.exec(r.text);if(a){let i=fP(a[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(i)return i}}return null}function fP(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var $3=[{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. How to tell a false one: this is about the player's own score. A computer opponent that scores its candidate moves is not one.",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 the round's `targets`: written in Studio for the live game, or in practice/round.yaml to test on this laptop",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 the game's dataset, which only the Engine reads, and the ceiling into the round's `target`, written in Studio or in practice/round.yaml to test locally",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 the round's `tiers`, as fractions of the target, in Studio or in practice/round.yaml",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 the round's `targets`, written in Studio, or in practice/round.yaml to test on this laptop. 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 the game's dataset, which only the Engine reads, or into practice/round.yaml to test on this laptop. 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 the round's `attemptsAllowed` and `mistakesAllowed`, in Studio or in practice/round.yaml",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 the round's `slates`, one slate per pick, in Studio or in practice/round.yaml",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. How to tell a false one: if two players on the same day should face the same thing, it is a challenge. Randomness that only shapes play or decoration, such as terrain, an opponent's moves or confetti, is not.",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 the round's `slates`, one per pick, in Studio or in practice/round.yaml",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"}}],A3=[{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, and Monterosa Analytics collects on paid plans with no code in the game.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],C3=[{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 I3(e){let t=e.map(c=>c.text).join(`
19988
- `),o=C3.map(c=>{let d=c.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:c.archetype,hits:d.length,because:d}}).filter(c=>c.hits>0).sort((c,d)=>d.hits-c.hits),r=o[0];if(!r)return null;let n=o[1]?.hits??0,a=r.hits-n,i=r.hits>=3&&a>=2?"high":r.hits>=2?"medium":"low";return{archetype:r.archetype,confidence:i,because:r.because}}async function O3(e,t){let r=(await xm(e)).isFile()?null:e;if(r)try{let a=await vc(Sm(r,"package.json"),"utf8"),i=JSON.parse(a),c={...i.dependencies,...i.devDependencies},d=c.next?"Next.js":c.react?"React":c.vue?"Vue":c.svelte?"Svelte":void 0,l=c.vite?"Vite":c.webpack?"webpack":void 0;return{kind:"node_project",framework:d,build:l}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(a=>/\.html?$/.test(a.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function P3(e){try{let t=await xm(e),o=await vc(Sm(t.isFile()?g3(e):e,"gamestage.yaml"),"utf8");return/^\s*archetype:\s*["']?arcade["']?\s*$/m.test(o)}catch{return!1}}async function yP(e){let{files:t,skipped:o}=await S3(e);if(t.length===0)throw new Error(o.length>0?`No inspectable source found at ${e}. Everything found there is a generated Gamestage client bundle (${o.map(b=>b.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 r=await O3(e,t),n=I3(t),a=await P3(e),i=new Set(["client-scoring","client-randomness"]),c=[];for(let b of $3){if(a&&i.has(b.id))continue;let v=[];for(let x of t){for(let R of b.patterns){let F=T3(x,R);if(F){v.push(F);break}}if(v.length>=3)break}if(v.length>0){let x=n?b.remedies?.[n.archetype]??b.remedy:b.remedy;c.push({...x?{remedy:x}:{},id:b.id,title:b.title,detail:b.detail,evidence:v})}}let d=t.map(b=>b.text).join(`
19989
- `),l=A3.filter(b=>!b.present.test(d)).map(b=>({id:b.id,title:b.title,detail:b.detail,evidence:[]})),u=[];t.some(b=>/<(div|section|main|canvas)/i.test(b.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(b=>({file:b.relative}))}),a&&u.push({id:"arcade-scoring",title:"The run's score and its randomness stay in the browser",detail:"An arcade game scores its own run. The Arcade Engine checks each finished run against how long it lasted and the limits in gamestage.yaml, so scoring and gameplay randomness (terrain, an opponent's moves) are not findings here.",evidence:[{file:"gamestage.yaml"}]});let f=Qu(t),g=[];return r.kind==="standalone_html"&&g.push("Where is this deployed today, and who owns that hosting?"),g.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),c.some(b=>b.id==="client-play-limit")?g.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&g.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: a round's `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:r,keep:u,move_behind_authority:c,missing_integrations:l,copy_to_studio:f,unknowns:g,archetype:n,name:await E3(e,t),skipped:o,layout:hP(t)}}Ie();var D3={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},M3=new Set(["players make picks","selects from a roster","players guess"]);function F3(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,o=Yt.includes(t),r=e.because.filter(n=>!M3.has(n));return o&&r.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:o?D3[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var U3=e=>j3(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",G3=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function B3(e,t){let o=U3(e.name??e.target),r=t&&lO(t)?t:um(o),n=e.name??G3(o),a=Fd(r,n);return a.manifest.conformance="L0",a.app.status="proposed",a.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],a.experience.status="proposed",a.experience.surfaces=["web-embed"],a.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.layout&&(a.experience.layout=e.layout.layout),e.archetype&&(a.backend.status="proposed",a.backend.route="managed_runtime",a.backend.archetype=e.archetype.archetype,a.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(c=>c.id==="client-play-limit"||c.id==="client-scoring")&&(a.identity.status="proposed",a.identity.provider="identify",a.identity.require_authenticated_writes=!0),Ao.parse(a)}async function q3(e,t){let o=await Ke();if(!o)return!1;La();let r=e.backend.archetype;if(!r)return!1;let a=await On({baseUrl:Re,headers:ct(),maxAttempts:Ln(),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:${z3("sha256").update(t).digest("hex")}`,conformance:Lt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:wa.map(i=>({section:i,status:e[i].status}))});if(a.refused)throw new Error(a.refused);return!0}async function W3(e){try{let t=ht.load(await R3(e,"utf8"));if(!t||typeof t!="object")return;let o=t.app;return typeof o?.id=="string"&&o.id.trim()?o.id:void 0}catch{return}}async function H3(e){try{return await N3(e),!0}catch{return!1}}async function bP(e,t){let o;try{o=await yP(e)}catch(u){return S(u instanceof Error?u.message:"Inspection failed")}let r=B3(o,await W3(typeof t.write=="string"?t.write:"gamestage.yaml")),n=F3(o.archetype),a=Lt(r);r.manifest.conformance=a.computed;let i=ys(r),c=!1,d,l=null;if(t.write){if(l=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await H3(l))return S(`${l} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${w.cyan(ee(`manifest validate ${l}`))} check what you have`,`${w.cyan(ee("inspect . --force"))} replace it anyway`]);await L3(l,i,"utf8");try{c=await q3(r,i)}catch(u){d=u instanceof Error?u.message:"The control plane did not answer."}}if(C()){L({ok:!0,report:o,format_match:n,manifest:r,conformance:{computed:a.computed,blockers:a.blockers},manifest_yaml:i,written_to:l,registered:c,...d?{registration_failed:d}:{}});return}if(I(`Inspection report ${w.dim(o.target)}`),A("Files inspected",String(o.scanned_files)),A("Stack",o.stack.framework?`${o.stack.kind} (${o.stack.framework})`:o.stack.kind),n.matched&&o.archetype?(A("Format",o.archetype.archetype),h(` ${" ".repeat(18)} ${w.dim(o.archetype.because.join("; "))}`)):n.nearest?(A("Format",w.yellow("none of the served formats marks this game")),h(),h(` The formats are ${Yt.join(", ")}. Each is one rule an`),h(" Engine marks plays against, and this game's rule is not among them."),h(),h(` Nearest: ${w.cyan(n.nearest)}, which ${n.differs}.`),h(" Building on it would judge fans by a rule their game never had."),h()):(A("Format",w.yellow("not recognised from this code")),h(),h(" Nothing in what was read says which of the served formats this is, and"),h(" that is a reading of the code rather than a verdict on the game."),h(` They are ${Yt.join(", ")}.`),h()),o.layout){let u=o.layout;A("Layout",`${u.layout}${u.confidence==="possible"?w.dim(" (possible)"):""}`),h(` ${" ".repeat(18)} ${w.dim(u.because.join("; "))}`);for(let p of u.evidence.slice(0,3))h(` ${" ".repeat(18)} ${w.dim(`${p.file}:${p.line} ${p.text}`)}`)}if(n.matched||(h(" Tell us the rule we do not have. It needs no account and sends"),h(" nothing until you add --send:"),h(` ${w.cyan(ee(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),o.skipped.length){I("Skipped");for(let u of o.skipped)k(`${w.dim(u.file)} \u2014 not scanned`),h(` ${w.dim(u.reason)}`)}if(o.keep.length){I("Keep as yours");for(let u of o.keep)k(w.green(u.title)),h(` ${w.dim(u.detail)}`)}if(o.move_behind_authority.length){I("Must move behind an authoritative boundary");for(let u of o.move_behind_authority){k(w.yellow(u.title)),h(` ${w.dim(u.detail)}`);for(let p of u.evidence.slice(0,2)){let f=p.line?`${p.file}:${p.line}`:p.file;h(` ${w.dim("\u2192")} ${w.cyan(f)}${p.excerpt?w.dim(" "+p.excerpt):""}`)}u.remedy&&(h(` ${w.dim("delete")} ${u.remedy.delete}`),h(` ${w.dim("call")} ${w.cyan(u.remedy.call)}`),u.remedy.render&&h(` ${w.dim("render")} ${u.remedy.render}`),u.remedy.move&&h(` ${w.dim("move")} ${u.remedy.move}`),h(` ${w.dim("keep")} ${u.remedy.keep}`))}}if(o.missing_integrations.length){I("Platform integrations not present yet");for(let u of o.missing_integrations)k(u.title),h(` ${w.dim(u.detail)}`)}if(o.unknowns.length){I("Needs a human answer");for(let u of o.unknowns)k(u,"?")}if(I("App Manifest"),A("Conformance",`${a.computed} ${a.computedName}`),a.blockers.length){h(),h(w.dim(" To reach the next level:"));for(let u of a.blockers)h(` ${w.dim("\xB7")} ${u.requirement}`)}h(),l?(h(` Written to ${w.cyan(l)}`),!n.matched&&n.nearest&&h(w.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),h(c?" Registered in Studio as a draft.":d?` Not registered in Studio: ${d} (${Re})`:" No account found, so registration was skipped.")):(h(w.dim(" Nothing written and nothing registered. Re-run with --write to save")),h(w.dim(" this manifest and register the game."))),h()}var wP="https://github.com",Y3="https://api.github.com",Tm=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function vP(){let e=await fetch(`${wP}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Tm,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function kP(e){let o=await(await fetch(`${wP}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Tm,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(o.access_token)return{status:"linked",login:await V3(o.access_token)};switch(o.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:o.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${o.error}).`)}}async function V3(e){let t=await fetch(`${Y3}/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 o=await t.json();if(!o.login)throw new Error("GitHub returned an account with no login.");return o.login}rt();Ie();var K3=e=>new Promise(t=>setTimeout(t,e));async function _P(){let{client:e}=await be();try{let t=await vP();C()?L({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Tm}):(I("Link GitHub"),h(),k("We read your GitHub login and nothing else. Gamestage records it as unverified because the server does not check ownership."),k("No access to your code is requested, and none is stored."),k("It is optional: a deploy does not require it."),h(),A("Code",t.user_code),A("Open",t.verification_uri),h(),k("Enter the code on that page. This waits until you do."),h());let o=Date.now()+t.expires_in*1e3,r=Math.max(t.interval,5);for(;Date.now()<o;){await K3(r*1e3);let n=await kP(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){r=n.interval;continue}if(n.status==="denied")return S("You declined the request on GitHub.");if(n.status==="expired")return S("The code expired. Run `gamestage link github` again.");let{workspace:a}=await e.linkGitHub(n.login);if(C())return L({ok:!0,status:"linked",github:{...a.github,verification:"unverified"}});I("Linked (unverified)"),A("Account",n.login),h(),k("This records an unverified account claim. Run `gamestage deploy` when your game is ready."),h();return}S("The code expired before it was entered.")}catch(t){await pe(t)}}hn();rt();Ie();xe();var Z3=e=>new Promise(t=>setTimeout(t,e));function J3(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)+`
19990
- `)}async function xP(e,t,o){let{client:r}=await be(),n=await Fs(r),a=Us(n),i=n.access==="approved"||n.access==="pending"?n.workspace:void 0,c=i!==void 0&&!Sw(i),d;if(o&&(d=await r.getWorkspace().then(l=>l.id).catch(()=>{})),C()){L({ok:a.ok,status:a.status,access:a.access,...a.code?{code:a.code}:{},message:a.message,next:a.next,email:e.email,...t?{stored_in:t}:{},control_plane:Re,...c?{terms:{accepted:!1,url:_a,version:_s}}:{}}),a.ok||process.exit(1);return}h(),I("Signed in"),A("Account",e.email??e.userId??"unknown"),t&&A("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),h(),k("Never written into the project, and never passed to your agent."),k("`gamestage logout` removes it."),o&&d&&d!==o?(h(),I("Not the workspace you asked for"),A("You asked for",o),A("You are in",d),h(),k("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):o&&d&&A("Workspace",d),za(a),c&&(I("Terms of Service"),h(` ${a.access==="approved"?Q3:X3}`),h()),a.ok||process.exit(1)}var X3=`Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} 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.`,Q3=`Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} before you deploy a game. You must accept them yourself in a browser; an agent cannot accept them for you.`;async function SP(e){let t=await Ke();if(t){await xP(t,void 0,e);return}let o;try{o=await x1()}catch(c){S("Could not reach the sign-in service.",[String(c)])}if(C())J3(o);else{I("Sign in to Gamestage"),h(" This also creates your account if you do not have one. Google or email."),h(" A new account is approved by a person, so this may end in a wait."),h(" Taking a while? Email support@monterosa.co."),h(),A("Open",o.verification_uri_complete),A("Or enter",`${o.user_code} at ${o.verification_uri}`);let c=!!process.env.GAMESTAGE_CREDENTIALS;c&&(h(),h(" Signing in to a second credential file, so this does NOT open a browser."),k("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."),k("Copy the address above into a private window and approve it there."),k("Signing out at auth.gamestage.ai first works too.")),h(),h(" Waiting for you to confirm in the browser..."),c||T1(o.verification_uri_complete)}let r=Date.now()+o.expires_in*1e3,n=o.interval*1e3,a=null;for(;Date.now()<r;){await Z3(n);let c=await S1(o.device_code);if(c.status==="ok"){a=c.session;break}if(c.status==="slow_down"){n+=5e3;continue}c.status!=="pending"&&(c.status==="expired"&&S("That code expired.",["Run `gamestage login` again."]),S("Sign-in was refused.",[c.reason]))}a||S("Timed out waiting for approval.",["Run `gamestage login` again."]);let i=await lk(a);await xP(a,i,e)}async function TP(){let e=await Ke();if(await $1(),C()){L({ok:!0,status:e?"signed_out":"not_signed_in"});return}I(e?"Signed out":"Not signed in"),e&&A("Removed",e.email??"session"),h()}async function EP(){let e=await Ke();if(C()){L(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){I("Not signed in"),h(),k("Inspecting, scaffolding and local rounds need no account."),k("Run `gamestage login` when you want to deploy a playground."),h();return}I("Signed in"),A("Account",e.email??"unknown"),e.userId&&A("User",e.userId),h(),k("`gamestage status` says whether this account is approved."),h()}xe();hn();import{readdir as e8,readFile as $P,stat as t8}from"node:fs/promises";Ie();No();import{homedir as n8}from"node:os";import{join as o8}from"node:path";zt();async function r8(e){let t=[];try{t=await e8(e)}catch{}let o=t.filter(c=>!c.startsWith(".")),r=[];for(let c of o)/\.html?$/.test(c)&&r.push(c);let n=!1,a,i=!1;for(let c of["gamestage.yaml","gamestage.yml"])try{await t8(`${e}/${c}`),n=!0;try{let d=await $P(`${e}/${c}`,"utf8"),l=We(d);l.ok?a=(await kr(`${e}/${c}`)).ok:l.issues.some(u=>u.path==="backend.round")&&(i=!0)}catch{}break}catch{}return{has_manifest:n,has_package_json:o.includes("package.json"),html_files:r,is_empty:o.length===0,has_round:a,...i?{round_in_manifest:!0}:{}}}function a8(e,t){let o=[],r="";for(let n of e.split(" "))r&&r.length+1+n.length>t?(o.push(r),r=n):r=r?`${r} ${n}`:n;return r&&o.push(r),o}async function i8(){try{return(await $P(o8(n8(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function AP(){let e=_m(),t=process.cwd(),o=await r8(t),r=o.has_manifest?o.round_in_manifest?"move-round":o.has_round===!1?"round":o.has_round===!0?"play":"continue":o.has_package_json||o.html_files.length>0?"inspect":"create",n={continue:{command:ee("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."},"move-round":{command:`move the round from gamestage.yaml to ${Le}`,why:Ua,prompt:`This Gamestage manifest still carries a round under \`backend.round\`, which every command now refuses. Move that block into ${Le}, at the top level of the file, and delete it from gamestage.yaml. The practice round stays on this laptop: the real rounds are written in Studio.`},round:{command:ee("dev --serve"),why:`The manifest names a format, and there is no practice round yet, so \`${ee("dev")}\` plays a stand-in of that format. To play your own, write one to ${Le}: it stays on this laptop. A deployed game plays the rounds written in Studio. \`${ee("dev")}\` needs an account, so \`${ee("login")}\` comes first.`,prompt:`This project has a Gamestage manifest and no practice round yet. Write one to ${Le} from the game's own content so \`gamestage dev\` plays it locally, and keep every answer out of the page and out of anything the browser downloads. A deploy never uploads practice/. A deployed game takes its rounds from Studio, where a producer changes them without a deploy.`},play:{command:ee("dev"),why:`There is a practice round in ${Le}. Serve it locally, through the real Engine. Needs an account, so \`${ee("login")}\` first if you have not.`,prompt:"Serve this Gamestage game locally with `npx gamestage dev`, open it, and make a play. Then tell me whether the Engine decided the outcome or the page did."},inspect:{command:ee("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:ee("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."}},a=await Ke().catch(()=>null),i=await e;if(C()){L({ok:!0,cwd:t,version:ot,...i?{pack_update:i}:{},detected:o,route:r,next:n[r],prompt:n[r].prompt,docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:Lu(),account:{signed_in:!!a?.email,email:a?.email??null,sign_in:ee("login")},first_reply:{tell:a?.email?`You're signed in to Gamestage as ${a.email}.`:`You're not signed in to Gamestage. Run \`${ee("login")}\`: it opens your browser, and creates your account if you don't have one.`,ask:"Do you have a game already, or do you want to make a new one?",offer:`Want to see the sports data you can build a game on? Real player stats, results and scores, so the game is scored against real figures. \`${ee("sources")}\` lists what your workspace can use`+(a?.email?".":" once you have signed in; until then, https://gamestage.ai/docs/data-sources."),then:"Wait for the answer before reading or changing anything else in this folder."},authentication:a?.email?`Signed in as ${a.email}. \`${ee("deploy")}\` also needs the account approved; \`${ee("status")}\` says whether it is.`:`Not signed in. \`${ee("inspect")}\`, \`${ee("create")}\` and \`${ee("manifest validate")}\` work without an account, so do that work now. \`${ee("dev")}\`, \`${ee("verify")}\` and \`${ee("deploy")}\` refuse until \`${ee("login")}\`, which creates the account too. Say so in your first reply (first_reply.tell), carry on without it, and remind them once at the first command that needs it.`});return}i&&h(i),I(`Gamestage ${ot}`);let c=Xn?await i8():null;if(c&&Xn&&c<Xn&&(h(w.dim(` Your installed Gamestage skill is ${c}; the current one is ${Xn}.
19985
+ })()`;function i3(e){let t=[],o=[...e.buttons].sort((r,n)=>n.area-r.area)[0];if(!o)t.push({id:"play-next",status:"advice",summary:"No button is on the result screen.",rule:"Play next is the loudest button after a round.",fix:"Show Play next (or a greyed Come back tomorrow when the pool is empty) as the main button."});else if(wc.test(o.text))t.push({id:"play-next",status:"ok",summary:`The main button after a round is "${o.text}".`});else if(e.buttons.some(r=>wc.test(r.text)&&r.area*1.25>=o.area)){let r=e.buttons.find(n=>wc.test(n.text));t.push({id:"play-next",status:"ok",summary:`The main button after a round is "${r.text}".`})}else{let r=e.buttons.some(n=>wc.test(n.text));t.push({id:"play-next",status:"advice",summary:r?`Play next is on the result screen, but the largest button is "${o.text}".`:`There is no Play next on the result screen; the largest button is "${o.text}".`,rule:"Play next is the loudest button after a round.",fix:r?`Give Play next the primary, full-width style and put "${o.text}" beneath it.`:"Add Play next as the main button, reading the Engine's next round, with Come back tomorrow greyed when none is left."})}return t.push(e.streakCue?{id:"come-back",status:"ok",summary:"A streak or come-back cue is on the result screen."}:{id:"come-back",status:"advice",summary:"Nothing on the result screen gives a reason to come back.",rule:"Give fans a reason to come back.",fix:"Show the fan's streak once it reaches two, and when the next round opens."}),t}function s3(e,t){let o=`The story is 1 to ${L_} slides and opens only when the fan taps it.`;return e?{id:"story",status:"advice",summary:`The story opened on its own after the round${t?`, with ${t} slides`:""}.`,rule:o,fix:"Land on the result screen and let See the story open it."}:t===void 0?{id:"story",status:"ok",summary:"No story opened on its own after the round."}:t>L_?{id:"story",status:"advice",summary:`The story waits to be opened, but has ${t} slides.`,rule:o,fix:`Keep the answer, the closest miss and one fact: ${L_} slides at most.`}:{id:"story",status:"ok",summary:`The story waits to be opened, and has ${t} slide${t===1?"":"s"}.`}}function c3(e,t,o){if(o===0)return{id:"first-answer",status:"advice",summary:`No answer could be reached from the first screen within ${Math.round(e)}s.`,rule:`A fan reaches their first answer within ${N_} seconds, in ${vm} taps or fewer.`,fix:"Put the round on the first screen, and make the intro screen's Play go straight to the board."};let r=`First answer in ${e.toFixed(1)}s, ${t} tap${t===1?"":"s"}.`;return e<=N_&&t<=vm?{id:"first-answer",status:"ok",summary:r}:{id:"first-answer",status:"advice",summary:r,rule:`A fan reaches their first answer within ${N_} seconds, in ${vm} taps or fewer.`,fix:t>vm?"Remove a screen between arriving and answering: How to play is a button, never a gate.":"Load less before the board: see `gamestage verify`'s load report."}}async function l3(e){let t=await zn().catch(()=>{});if(!t)return{finding:{id:"rounds",status:"skipped",summary:"Not signed in, so the rounds in the live pool could not be counted."}};let r=(await t.getGame(e).catch(()=>{}))?.playerEndpoint?.replace(/\/$/,"");if(!r)return{finding:{id:"rounds",status:"skipped",summary:"This game has not been deployed yet, so it has no live pool to count."}};try{let n=await(await fetch(`${r}/rounds`,{headers:ct()})).json(),a=await(await fetch(`${r}/rounds/current`,{headers:ct()})).json().catch(()=>({})),i=Array.isArray(n.rounds)?n.rounds.length:0,c=Array.isArray(a.challenge?.board)?a.challenge.board.length:void 0,d=typeof a.challenge?.pick=="number"?a.challenge.pick:void 0;return{finding:i>=7?{id:"rounds",status:"ok",summary:`${i} rounds ready in the live pool.`}:{id:"rounds",status:"advice",summary:`${i} round${i===1?"":"s"} ready in the live pool.`,rule:"A daily rhythm, with a clear end.",fix:"Keep at least a week of rounds ready (`gamestage round seed` can draft them from a dataset), and show Come back tomorrow when they run out."},board:c,pick:d}}catch{return{finding:{id:"rounds",status:"skipped",summary:"The live pool did not answer, so its rounds could not be counted."}}}}async function mP(e){let t=e.manifest??"gamestage.yaml",o;try{let x=We(await km(t,"utf8"));if(!x.ok)return S(yn(t,x.issues));o=x.manifest}catch{return S(`Cannot read ${t}.`,["Run `gamestage review` from the game's folder, or pass --manifest."])}let r=await km(z_(e.file??"index.html"),"utf8").catch(()=>""),n=await Ga(t,Mn(o.backend.archetype,qo(r)));if(n.source==="invalid")return S(jo(n.path),n.problems);if(n.source==="none")return S(`No round to review with: ${o.backend.archetype} has no stand-in round yet.`,[`Put a practice round in ${Le}.`]);let a=n.round,i=z_(e.file??"index.html"),c;try{c=await km(i,"utf8")}catch{return S(`Cannot read ${e.file??"index.html"}.`,["Build the game first, then pass its page with --file."])}let d=[],l=De(a.archetype),u=await zn();if(!u)d.push({id:"play",status:"skipped",summary:"The game was not played: playing it needs the deployed Engine, which needs `gamestage login`."});else{let x=await d3(i,t,o,a,u);d.push(...x.findings),d.push(o3(c,x.shareButton))}let p=n.source!=="practice",f=n3(a);p&&f.status!=="skipped"&&(f.status="skipped",f.summary=`This game's rounds live in Studio, so its scoring cannot be read here. For reference, a representative ${l} round: ${f.summary.charAt(0).toLowerCase()}${f.summary.slice(1)}`),d.push(f);let g=await l3(o.app.id),b=p&&g.board!==void 0?uP({...a,board:Array.from({length:g.board},(x,R)=>`option ${R}`),targets:g.pick===1?["option 0"]:["option 0","option 1"]}):uP(a);if(b&&d.push(b),d.push(g.finding),C()){L({game:o.app.id,format:l,round_line:n.line,findings:d});return}I(`Review of ${o.app.title} (${l}), played locally against a real Engine`),h(n.line);for(let x of d){let R=x.status==="ok"?w.green("ok "):x.status==="advice"?w.yellow("advice "):w.dim("skipped ");h(` ${R} ${x.summary}`),x.rule&&h(` ${w.dim("Rule:")} ${x.rule}`),x.fix&&h(` ${w.dim("Fix:")} ${x.fix}`)}h();let v=d.filter(x=>x.status==="advice").length;h(v===0?"Nothing to advise. The rules and the evidence behind them: https://gamestage.ai/docs/game-design":`${v} piece${v===1?"":"s"} of advice. None of it blocks a deploy. The rules and the evidence behind them: https://gamestage.ai/docs/game-design`)}async function d3(e,t,o,r,n){let a;try{({server:a}=await Ha({client:n,controlUrl:Re,game:o.app.id,round:r}))}catch(v){if(!(v instanceof qt))throw v;return{findings:[{id:"play",status:"skipped",summary:`The game was not played: ${v.message} ${v.lines.join(" ")}`.trim()}],shareButton:!1}}await new Promise(v=>a.listen(0,"127.0.0.1",()=>v()));let i=a.address(),c=i&&typeof i!="string"?`http://127.0.0.1:${i.port}`:"",d=(await bn(z_(t)).catch(()=>{}))?.settings,l=br(d??{},o.app.title),{createServer:u}=await import("node:http"),p=u(async(v,x)=>{let R=qs(X5(e),v.url??"/",J5(e));if(!R){x.writeHead(403).end();return}try{let F=await km(R);if(R===e){let W=F.toString("utf8");W.includes(bt)&&(F=Buffer.from(Ea(W,l)))}let U=/\bgzip\b/.test(String(v.headers["accept-encoding"]??""));x.writeHead(200,{"content-type":lc(R),...U?{"content-encoding":"gzip"}:{}}),x.end(U?Z5(F):F)}catch{x.writeHead(404).end()}});await new Promise(v=>p.listen(0,"127.0.0.1",()=>v()));let f=p.address(),g=f&&typeof f!="string"?`http://127.0.0.1:${f.port}/`:"",b;try{let v=await Qt();if(v.status==="skipped")return{findings:[{id:"play",status:"skipped",summary:`The game was not played: ${v.detail}`}],shareButton:!1};b=v.browser;let x=`window.GAMESTAGE_API = ${JSON.stringify(c)};window.GAMESTAGE_GAME = ${JSON.stringify(o.app.id)};`+(d?`window.GAMESTAGE_PRESENTATION = ${JSON.stringify(d)};`:"");await b.setViewport(390,844),await b.addScriptToEvaluateOnNewDocument(x);let R=Date.now();await b.navigate(g,2e4);let F=await r_(b,r.archetype),U=[c3((Date.now()-R)/1e3,F.taps,F.picks)];await b.close().catch(()=>{});let W=await Qt();if(W.status==="skipped")return U.push({id:"play",status:"skipped",summary:`The round was not played: ${W.detail}`}),{findings:U,shareButton:!1};b=W.browser,await b.addScriptToEvaluateOnNewDocument(x);let T=await cc(b,g,c,o.app.id,r.archetype);if(T.status!=="verified")return U.push({id:"play",status:"skipped",summary:`The round could not be finished here, so the result screen was not reviewed. ${T.detail??""}`.trim()}),{findings:U,shareButton:!1};for(let ie=0;ie<12&&await b.run(a3).catch(()=>"stuck")==="played";ie++)await new Promise(se=>setTimeout(se,De(r.archetype)==="shoot"?2500:900));await new Promise(ie=>setTimeout(ie,1500)),await b.run(`(() => { const k = [...document.querySelectorAll('button')].find((b) => /^keep\\b/i.test((b.innerText || "").trim())); if (k) k.click(); return Boolean(k); })()`).catch(()=>!1),await new Promise(ie=>setTimeout(ie,800));let H=await b.run(lP).catch(()=>({open:!1,slides:0})),G=H.open?H.slides:void 0;H.open&&(await b.run(dP).catch(()=>!1),await new Promise(ie=>setTimeout(ie,800)));let oe=await b.run(r3);if(oe.storyOpen=H.open,process.env.GAMESTAGE_REVIEW_SCREENSHOT){let{writeFile:ie}=await import("node:fs/promises");await ie(process.env.GAMESTAGE_REVIEW_SCREENSHOT,await b.screenshot(390,844)).catch(()=>{})}let re=!1;if(!H.open&&oe.buttons.some(ie=>/\bstory\b/i.test(ie.text))){await b.run(`(() => { const shown = (el) => { const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0; }; const b = [...document.querySelectorAll('button, [role="button"]')].find((el) => shown(el) && /\\bstory\\b/i.test(el.innerText || "")); if (b) { b.scrollIntoView({ block: "center" }); b.click(); } return Boolean(b); })()`).catch(()=>!1),await new Promise(te=>setTimeout(te,1500));let ie=await b.run(lP).catch(()=>({open:!1,slides:0}));if(ie.open?G=ie.slides:re=!0,process.env.GAMESTAGE_REVIEW_STORY_SCREENSHOT){let{writeFile:te}=await import("node:fs/promises");await te(process.env.GAMESTAGE_REVIEW_STORY_SCREENSHOT,await b.screenshot(390,844)).catch(()=>{})}await b.run(dP).catch(()=>!1)}return U.push(re?{id:"story",status:"advice",summary:"A story button is on the result screen, and pressing it opened nothing.",rule:"Reveal the answer after every round.",fix:"Show the story button only when there is a story to open, or give every round at least the answer's slide."}:s3(oe.storyOpen,G)),U.push(...i3(oe)),{findings:U,shareButton:oe.buttons.some(ie=>/\bshare\b/i.test(ie.text))}}catch(v){return{findings:[{id:"play",status:"skipped",summary:`The game could not be played here: ${v instanceof Error?v.message:String(v)}`}],shareButton:!1}}finally{await b?.close().catch(()=>{}),a.close(),p.close()}}hn();xe();Ie();No();import{stat as u3}from"node:fs/promises";No();async function _m(e=process.env){if(Xn&&!(e.CI||e.GAMESTAGE_TEST_RUN||e.GAMESTAGE_NO_UPDATE_CHECK))try{let t=await fetch("https://gamestage.ai/agent.md",{signal:AbortSignal.timeout(1500)});if(!t.ok)return;let o=(await t.text()).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1];if(!o)return;let r=o.split("-").map(Number),n=Xn.split("-").map(Number),a=Array.from({length:Math.max(r.length,n.length)},(i,c)=>(r[c]??0)-(n[c]??0)).find(i=>i!==0);return a===void 0||a<0?void 0:`This tool is from ${Xn}; the current one is ${o}. Run npx gamestage@latest start to use the latest CLI.`}catch{return}}function m3(e){let t=I1(e);return{id:"node",label:"Node.js",ok:t,detail:t?`v${e}`:`v${e} - Gamestage needs Node ${zu} or newer`,blocking:!0}}async function pP(){let e=_m(),t=[];t.push(m3(process.versions.node)),t.push({id:"schema",label:"Manifest schema",ok:!0,detail:`v${ps} bundled`,blocking:!1});let o=!1;try{await u3("gamestage.yaml"),o=!0}catch{}t.push({id:"manifest",label:"App Manifest",ok:o,detail:o?"gamestage.yaml found":"none here yet: `gamestage inspect .` or `gamestage create` makes one",blocking:!1});let r=await Ke().catch(()=>null);t.push({id:"auth",label:"Signed in",ok:!!r,detail:r?`as ${r.email}`:"not signed in: `gamestage login` before dev, verify or deploy",blocking:!1});let n=t.filter(i=>!i.ok&&i.blocking),a=await e;C()&&(L({ok:n.length===0,checks:t,...a?{pack_update:a}:{}}),process.exit(n.length===0?0:1)),a&&h(a),I("Environment");for(let i of t){let c=i.ok?w.green("ok"):i.blocking?w.red("blocked"):w.dim("--");h(` ${c.padEnd(18)} ${i.label.padEnd(16)} ${w.dim(i.detail)}`)}h(),n.length&&(h(` ${w.red("Fix the blocked items above before continuing.")}`),h(),process.exit(1)),h(` ${w.green("Ready.")}`),h()}va();xe();hn();import{readFile as N3,stat as L3,writeFile as z3}from"node:fs/promises";import{createHash as j3}from"node:crypto";import{basename as D3}from"node:path";rt();Nn();Bk();import{readdir as f3,readFile as vc,stat as xm}from"node:fs/promises";import{createHash as g3}from"node:crypto";import{basename as gP,dirname as y3,extname as b3,join as Sm,relative as w3}from"node:path";var p3={canvas:/<canvas\b|getContext\(\s*["'](?:2d|webgl2?)["']/i,scaled:/transform\s*[:=]\s*[`"']?\s*scale\(|\.scale\(\s*(?:window\.)?devicePixelRatio|\bDESIGN_(?:WIDTH|HEIGHT)\b|\bdesignWidth\b/i,fullHeight:/height\s*:\s*100(?:d|s|l)?vh|inset\s*:\s*0\b[^;]*;[^}]*position\s*:\s*fixed|position\s*:\s*fixed[^}]*inset\s*:\s*0\b/i,noScroll:/(?:html|body)[^{]*\{[^}]*overflow\s*:\s*hidden|overscroll-behavior\s*:\s*none|document\.body\.style\.overflow\s*=\s*["']hidden/i,aspect:/aspect-ratio\s*:\s*\d+\s*\/\s*\d+|padding-(?:bottom|top)\s*:\s*\d{2,3}(?:\.\d+)?%/i};function h3(e,t){for(let o of e){let r=o.text.split(`
19986
+ `);for(let n=0;n<r.length;n++)if(t.test(r[n]))return{file:o.relative,line:n+1,text:r[n].trim().slice(0,120)};if(t.test(o.text))return{file:o.relative,line:1,text:"(matched across lines)"}}return null}function hP(e){if(!e.some(a=>/<(?:div|section|main|canvas|body)\b/i.test(a.text)))return null;let o=Object.fromEntries(Object.entries(p3).map(([a,i])=>[a,h3(e,i)])),r=(a,i)=>{let c=i.filter(([,d])=>o[d]);return{layout:a,confidence:c.length>=2?"likely":"possible",because:c.map(([d])=>d),evidence:c.map(([,d])=>o[d])}},n=!!(o.fullHeight&&o.noScroll);return o.canvas&&o.scaled?r("canvas",[["draws on a canvas","canvas"],["scales a fixed design size to the viewport","scaled"],["holds the page still","noScroll"]]):n||o.canvas&&(o.fullHeight||o.noScroll)?r("screen",[["fills the viewport's height","fullHeight"],["stops the page scrolling","noScroll"],["draws on a canvas","canvas"]]):o.aspect?r("card",[["sizes its box to a fixed proportion","aspect"]]):{layout:"page",confidence:"possible",because:["nothing holds the page still or fixes its proportions, so the document scrolls"],evidence:[]}}Za();gn();var v3=new Set(["node_modules",".git","dist","build",".next",".wrangler","coverage"]),k3=new Set([".html",".htm",".js",".mjs",".cjs",".jsx",".ts",".tsx",".vue",".svelte"]);function _3(e){return g3("sha256").update(e).digest("hex").slice(0,16)}var x3={[wt]:vr,[tt]:jn};function S3(e){let t=gP(e.relative);if(nc(e.relative))return`${t} is never published by \`gamestage deploy\`, so nothing in it reaches a browser.`;let o=x3[t];return!o||_3(e.text)!==o?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 T3(e,t=200){let o=await xm(e),r=[],n=[],a=c=>{let d=S3(c);d?n.push({file:c.relative,reason:d}):r.push(c)};if(o.isFile())return a({path:e,relative:gP(e),text:await vc(e,"utf8")}),{files:r,skipped:n};let i=async c=>{if(r.length>=t)return;let d=await f3(c,{withFileTypes:!0});for(let l of d){if(r.length>=t)return;if(l.name.startsWith(".")&&l.name!==".openai")continue;let u=Sm(c,l.name);if(l.isDirectory()){if(v3.has(l.name))continue;await i(u)}else if(k3.has(b3(l.name)))try{a({path:u,relative:w3(e,u),text:await vc(u,"utf8")})}catch{}}};return await i(e),{files:r,skipped:n}}function E3(e,t){let o=e.text.split(`
19987
+ `);for(let r=0;r<o.length;r++)if(t.test(o[r]))return{file:e.relative,line:r+1,excerpt:o[r].trim().slice(0,120)};return null}async function $3(e,t){if(!(await xm(e)).isFile())try{let r=JSON.parse(await vc(Sm(e,"package.json"),"utf8"));if(r.name)return r.name.replace(/^@[^/]+\//,"")}catch{}for(let r of t){if(!/\.html?$/.test(r.relative))continue;let n=/<h1[^>]*>([^<]+)<\/h1>/i.exec(r.text);if(n){let i=fP(n[1]);if(i)return i}let a=/<title[^>]*>([^<]+)<\/title>/i.exec(r.text);if(a){let i=fP(a[1].split(/\s+[|\u2013\u2014-]\s+/)[0]);if(i)return i}}return null}function fP(e){let t=e.replace(/\s+/g," ").trim();return/[a-z0-9]/i.test(t)?t.slice(0,60):null}var A3=[{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. How to tell a false one: this is about the player's own score. A computer opponent that scores its candidate moves is not one.",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 the round's `targets`: written in Studio for the live game, or in practice/round.yaml to test on this laptop",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 the game's dataset, which only the Engine reads, and the ceiling into the round's `target`, written in Studio or in practice/round.yaml to test locally",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 the round's `tiers`, as fractions of the target, in Studio or in practice/round.yaml",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 the round's `targets`, written in Studio, or in practice/round.yaml to test on this laptop. 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 the game's dataset, which only the Engine reads, or into practice/round.yaml to test on this laptop. 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 the round's `attemptsAllowed` and `mistakesAllowed`, in Studio or in practice/round.yaml",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 the round's `slates`, one slate per pick, in Studio or in practice/round.yaml",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. How to tell a false one: if two players on the same day should face the same thing, it is a challenge. Randomness that only shapes play or decoration, such as terrain, an opponent's moves or confetti, is not.",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 the round's `slates`, one per pick, in Studio or in practice/round.yaml",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"}}],C3=[{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, and Monterosa Analytics collects on paid plans with no code in the game.",present:/analytics-kit|gtag\(|posthog|analytics\.track/i}],I3=[{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 O3(e){let t=e.map(c=>c.text).join(`
19988
+ `),o=I3.map(c=>{let d=c.signals.filter(l=>l.pattern.test(t)).map(l=>l.because);return{archetype:c.archetype,hits:d.length,because:d}}).filter(c=>c.hits>0).sort((c,d)=>d.hits-c.hits),r=o[0];if(!r)return null;let n=o[1]?.hits??0,a=r.hits-n,i=r.hits>=3&&a>=2?"high":r.hits>=2?"medium":"low";return{archetype:r.archetype,confidence:i,because:r.because}}async function P3(e,t){let r=(await xm(e)).isFile()?null:e;if(r)try{let a=await vc(Sm(r,"package.json"),"utf8"),i=JSON.parse(a),c={...i.dependencies,...i.devDependencies},d=c.next?"Next.js":c.react?"React":c.vue?"Vue":c.svelte?"Svelte":void 0,l=c.vite?"Vite":c.webpack?"webpack":void 0;return{kind:"node_project",framework:d,build:l}}catch{}return t.length===1&&/\.html?$/.test(t[0].relative)||t.every(a=>/\.html?$/.test(a.relative))?{kind:"standalone_html"}:{kind:"unknown"}}async function R3(e){try{let t=await xm(e),o=await vc(Sm(t.isFile()?y3(e):e,"gamestage.yaml"),"utf8");return/^\s*archetype:\s*["']?arcade["']?\s*$/m.test(o)}catch{return!1}}async function yP(e){let{files:t,skipped:o}=await T3(e);if(t.length===0)throw new Error(o.length>0?`No inspectable source found at ${e}. Everything found there is a generated Gamestage client bundle (${o.map(b=>b.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 r=await P3(e,t),n=O3(t),a=await R3(e),i=new Set(["client-scoring","client-randomness"]),c=[];for(let b of A3){if(a&&i.has(b.id))continue;let v=[];for(let x of t){for(let R of b.patterns){let F=E3(x,R);if(F){v.push(F);break}}if(v.length>=3)break}if(v.length>0){let x=n?b.remedies?.[n.archetype]??b.remedy:b.remedy;c.push({...x?{remedy:x}:{},id:b.id,title:b.title,detail:b.detail,evidence:v})}}let d=t.map(b=>b.text).join(`
19989
+ `),l=C3.filter(b=>!b.present.test(d)).map(b=>({id:b.id,title:b.title,detail:b.detail,evidence:[]})),u=[];t.some(b=>/<(div|section|main|canvas)/i.test(b.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(b=>({file:b.relative}))}),a&&u.push({id:"arcade-scoring",title:"The run's score and its randomness stay in the browser",detail:"An arcade game scores its own run. The Arcade Engine checks each finished run against how long it lasted and the limits in gamestage.yaml, so scoring and gameplay randomness (terrain, an opponent's moves) are not findings here.",evidence:[{file:"gamestage.yaml"}]});let f=Qu(t),g=[];return r.kind==="standalone_html"&&g.push("Where is this deployed today, and who owns that hosting?"),g.push("Which of the embedded datasets are licensed for production use, and at what refresh cadence?"),c.some(b=>b.id==="client-play-limit")?g.push("Is the play limit per device or per person? That decides whether identity is required at launch."):(n?.archetype==="hunt"||n?.archetype==="group")&&g.push("No attempt limit inspect recognises. The Engine will not serve a hunt or group round without one: a round's `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:r,keep:u,move_behind_authority:c,missing_integrations:l,copy_to_studio:f,unknowns:g,archetype:n,name:await $3(e,t),skipped:o,layout:hP(t)}}Ie();var M3={hunt:"marks each pick against an answer set the producer holds, with no total and no order",push:"adds each pick to a running total, and busts the play when the total passes a ceiling",group:"judges a whole board at once, on whether the hidden sets were formed",predict:"settles a call once the world decides it, against an answer set after the fact",bingo:"deals a grid from a producer's pool and settles its cards as outcomes land",shoot:"resolves one shot, aim and power, against a keeper the Engine controls"},F3=new Set(["players make picks","selects from a roster","players guess"]);function U3(e){if(!e)return{matched:!1,nearest:null,differs:null};let t=e.archetype,o=Yt.includes(t),r=e.because.filter(n=>!F3.has(n));return o&&r.length>0?{matched:!0,nearest:t,differs:null}:{matched:!1,nearest:t,differs:o?M3[t]:"is a classification this report can reach, not a format any Engine of ours serves"}}var G3=e=>D3(e).replace(/\.[^.]+$/,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"inspected-game",B3=e=>e.split("-").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ");function q3(e,t){let o=G3(e.name??e.target),r=t&&lO(t)?t:um(o),n=e.name??B3(o),a=Fd(r,n);return a.manifest.conformance="L0",a.app.status="proposed",a.app.provenance=[{kind:"repository_evidence",file:e.target},{kind:"generated_proposal",tool:"gamestage inspect",source_context:`${e.scanned_files} file(s) inspected`}],a.experience.status="proposed",a.experience.surfaces=["web-embed"],a.experience.provenance=[{kind:"repository_evidence",file:e.target}],e.layout&&(a.experience.layout=e.layout.layout),e.archetype&&(a.backend.status="proposed",a.backend.route="managed_runtime",a.backend.archetype=e.archetype.archetype,a.backend.provenance=[{kind:"generated_proposal",tool:"gamestage inspect",source_context:e.archetype.because.join("; ")}]),e.move_behind_authority.some(c=>c.id==="client-play-limit"||c.id==="client-scoring")&&(a.identity.status="proposed",a.identity.provider="identify",a.identity.require_authenticated_writes=!0),Ao.parse(a)}async function W3(e,t){let o=await Ke();if(!o)return!1;La();let r=e.backend.archetype;if(!r)return!1;let a=await On({baseUrl:Re,headers:ct(),maxAttempts:Ln(),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:${j3("sha256").update(t).digest("hex")}`,conformance:Lt(e).computed,offersPrize:e.operations.promotion.offers_prize,containerLabel:e.experience.container_label,sections:wa.map(i=>({section:i,status:e[i].status}))});if(a.refused)throw new Error(a.refused);return!0}async function H3(e){try{let t=ht.load(await N3(e,"utf8"));if(!t||typeof t!="object")return;let o=t.app;return typeof o?.id=="string"&&o.id.trim()?o.id:void 0}catch{return}}async function Y3(e){try{return await L3(e),!0}catch{return!1}}async function bP(e,t){let o;try{o=await yP(e)}catch(u){return S(u instanceof Error?u.message:"Inspection failed")}let r=q3(o,await H3(typeof t.write=="string"?t.write:"gamestage.yaml")),n=U3(o.archetype),a=Lt(r);r.manifest.conformance=a.computed;let i=ys(r),c=!1,d,l=null;if(t.write){if(l=typeof t.write=="string"?t.write:"gamestage.yaml",!t.force&&await Y3(l))return S(`${l} already exists, and inspect would replace it.`,["A manifest that has been worked on holds a round; this report cannot,","because a round is not visible in the code it read.","",`${w.cyan(ee(`manifest validate ${l}`))} check what you have`,`${w.cyan(ee("inspect . --force"))} replace it anyway`]);await z3(l,i,"utf8");try{c=await W3(r,i)}catch(u){d=u instanceof Error?u.message:"The control plane did not answer."}}if(C()){L({ok:!0,report:o,format_match:n,manifest:r,conformance:{computed:a.computed,blockers:a.blockers},manifest_yaml:i,written_to:l,registered:c,...d?{registration_failed:d}:{}});return}if(I(`Inspection report ${w.dim(o.target)}`),A("Files inspected",String(o.scanned_files)),A("Stack",o.stack.framework?`${o.stack.kind} (${o.stack.framework})`:o.stack.kind),n.matched&&o.archetype?(A("Format",o.archetype.archetype),h(` ${" ".repeat(18)} ${w.dim(o.archetype.because.join("; "))}`)):n.nearest?(A("Format",w.yellow("none of the served formats marks this game")),h(),h(` The formats are ${Yt.join(", ")}. Each is one rule an`),h(" Engine marks plays against, and this game's rule is not among them."),h(),h(` Nearest: ${w.cyan(n.nearest)}, which ${n.differs}.`),h(" Building on it would judge fans by a rule their game never had."),h()):(A("Format",w.yellow("not recognised from this code")),h(),h(" Nothing in what was read says which of the served formats this is, and"),h(" that is a reading of the code rather than a verdict on the game."),h(` They are ${Yt.join(", ")}.`),h()),o.layout){let u=o.layout;A("Layout",`${u.layout}${u.confidence==="possible"?w.dim(" (possible)"):""}`),h(` ${" ".repeat(18)} ${w.dim(u.because.join("; "))}`);for(let p of u.evidence.slice(0,3))h(` ${" ".repeat(18)} ${w.dim(`${p.file}:${p.line} ${p.text}`)}`)}if(n.matched||(h(" Tell us the rule we do not have. It needs no account and sends"),h(" nothing until you add --send:"),h(` ${w.cyan(ee(`suggest "<your rule in one sentence>"${n.nearest?` --closest ${n.nearest}`:""}`))}`)),o.skipped.length){I("Skipped");for(let u of o.skipped)k(`${w.dim(u.file)} \u2014 not scanned`),h(` ${w.dim(u.reason)}`)}if(o.keep.length){I("Keep as yours");for(let u of o.keep)k(w.green(u.title)),h(` ${w.dim(u.detail)}`)}if(o.move_behind_authority.length){I("Must move behind an authoritative boundary");for(let u of o.move_behind_authority){k(w.yellow(u.title)),h(` ${w.dim(u.detail)}`);for(let p of u.evidence.slice(0,2)){let f=p.line?`${p.file}:${p.line}`:p.file;h(` ${w.dim("\u2192")} ${w.cyan(f)}${p.excerpt?w.dim(" "+p.excerpt):""}`)}u.remedy&&(h(` ${w.dim("delete")} ${u.remedy.delete}`),h(` ${w.dim("call")} ${w.cyan(u.remedy.call)}`),u.remedy.render&&h(` ${w.dim("render")} ${u.remedy.render}`),u.remedy.move&&h(` ${w.dim("move")} ${u.remedy.move}`),h(` ${w.dim("keep")} ${u.remedy.keep}`))}}if(o.missing_integrations.length){I("Platform integrations not present yet");for(let u of o.missing_integrations)k(u.title),h(` ${w.dim(u.detail)}`)}if(o.unknowns.length){I("Needs a human answer");for(let u of o.unknowns)k(u,"?")}if(I("App Manifest"),A("Conformance",`${a.computed} ${a.computedName}`),a.blockers.length){h(),h(w.dim(" To reach the next level:"));for(let u of a.blockers)h(` ${w.dim("\xB7")} ${u.requirement}`)}h(),l?(h(` Written to ${w.cyan(l)}`),!n.matched&&n.nearest&&h(w.dim(` It proposes ${n.nearest} as a starting point. That rule will not mark this game.`)),h(c?" Registered in Studio as a draft.":d?` Not registered in Studio: ${d} (${Re})`:" No account found, so registration was skipped.")):(h(w.dim(" Nothing written and nothing registered. Re-run with --write to save")),h(w.dim(" this manifest and register the game."))),h()}var wP="https://github.com",V3="https://api.github.com",Tm=process.env.GAMESTAGE_GITHUB_CLIENT_ID??"Ov23livKf8DOgOm2a383";async function vP(){let e=await fetch(`${wP}/login/device/code`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Tm,scope:""})});if(!e.ok)throw new Error(`GitHub refused the device request (${e.status}).`);return await e.json()}async function kP(e){let o=await(await fetch(`${wP}/login/oauth/access_token`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({client_id:Tm,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"})})).json();if(o.access_token)return{status:"linked",login:await K3(o.access_token)};switch(o.error){case"authorization_pending":return{status:"pending"};case"slow_down":return{status:"slow_down",interval:o.interval??10};case"expired_token":return{status:"expired"};case"access_denied":return{status:"denied"};default:throw new Error(`GitHub returned an unexpected error (${o.error}).`)}}async function K3(e){let t=await fetch(`${V3}/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 o=await t.json();if(!o.login)throw new Error("GitHub returned an account with no login.");return o.login}rt();Ie();var Z3=e=>new Promise(t=>setTimeout(t,e));async function _P(){let{client:e}=await be();try{let t=await vP();C()?L({ok:!0,status:"awaiting_authorisation",userCode:t.user_code,verificationUri:t.verification_uri,clientId:Tm}):(I("Link GitHub"),h(),k("We read your GitHub login and nothing else. Gamestage records it as unverified because the server does not check ownership."),k("No access to your code is requested, and none is stored."),k("It is optional: a deploy does not require it."),h(),A("Code",t.user_code),A("Open",t.verification_uri),h(),k("Enter the code on that page. This waits until you do."),h());let o=Date.now()+t.expires_in*1e3,r=Math.max(t.interval,5);for(;Date.now()<o;){await Z3(r*1e3);let n=await kP(t.device_code);if(n.status==="pending")continue;if(n.status==="slow_down"){r=n.interval;continue}if(n.status==="denied")return S("You declined the request on GitHub.");if(n.status==="expired")return S("The code expired. Run `gamestage link github` again.");let{workspace:a}=await e.linkGitHub(n.login);if(C())return L({ok:!0,status:"linked",github:{...a.github,verification:"unverified"}});I("Linked (unverified)"),A("Account",n.login),h(),k("This records an unverified account claim. Run `gamestage deploy` when your game is ready."),h();return}S("The code expired before it was entered.")}catch(t){await pe(t)}}hn();rt();Ie();xe();var J3=e=>new Promise(t=>setTimeout(t,e));function X3(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)+`
19990
+ `)}async function xP(e,t,o){let{client:r}=await be(),n=await Fs(r),a=Us(n),i=n.access==="approved"||n.access==="pending"?n.workspace:void 0,c=i!==void 0&&!Sw(i),d;if(o&&(d=await r.getWorkspace().then(l=>l.id).catch(()=>{})),C()){L({ok:a.ok,status:a.status,access:a.access,...a.code?{code:a.code}:{},message:a.message,next:a.next,email:e.email,...t?{stored_in:t}:{},control_plane:Re,...c?{terms:{accepted:!1,url:_a,version:_s}}:{}}),a.ok||process.exit(1);return}h(),I("Signed in"),A("Account",e.email??e.userId??"unknown"),t&&A("Token stored in",t==="keychain"?"your macOS keychain":"~/.gamestage (owner only)"),h(),k("Never written into the project, and never passed to your agent."),k("`gamestage logout` removes it."),o&&d&&d!==o?(h(),I("Not the workspace you asked for"),A("You asked for",o),A("You are in",d),h(),k("This usually means the browser signed you in as a different account. `gamestage logout` and run this again to pick another.")):o&&d&&A("Workspace",d),za(a),c&&(I("Terms of Service"),h(` ${a.access==="approved"?e8:Q3}`),h()),a.ok||process.exit(1)}var Q3=`Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} 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.`,e8=`Read the Gamestage Terms of Service at ${_a} and accept them at ${Jd} before you deploy a game. You must accept them yourself in a browser; an agent cannot accept them for you.`;async function SP(e){let t=await Ke();if(t){await xP(t,void 0,e);return}let o;try{o=await x1()}catch(c){S("Could not reach the sign-in service.",[String(c)])}if(C())X3(o);else{I("Sign in to Gamestage"),h(" This also creates your account if you do not have one. Google or email."),h(" A new account is approved by a person, so this may end in a wait."),h(" Taking a while? Email support@monterosa.co."),h(),A("Open",o.verification_uri_complete),A("Or enter",`${o.user_code} at ${o.verification_uri}`);let c=!!process.env.GAMESTAGE_CREDENTIALS;c&&(h(),h(" Signing in to a second credential file, so this does NOT open a browser."),k("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."),k("Copy the address above into a private window and approve it there."),k("Signing out at auth.gamestage.ai first works too.")),h(),h(" Waiting for you to confirm in the browser..."),c||T1(o.verification_uri_complete)}let r=Date.now()+o.expires_in*1e3,n=o.interval*1e3,a=null;for(;Date.now()<r;){await J3(n);let c=await S1(o.device_code);if(c.status==="ok"){a=c.session;break}if(c.status==="slow_down"){n+=5e3;continue}c.status!=="pending"&&(c.status==="expired"&&S("That code expired.",["Run `gamestage login` again."]),S("Sign-in was refused.",[c.reason]))}a||S("Timed out waiting for approval.",["Run `gamestage login` again."]);let i=await lk(a);await xP(a,i,e)}async function TP(){let e=await Ke();if(await $1(),C()){L({ok:!0,status:e?"signed_out":"not_signed_in"});return}I(e?"Signed out":"Not signed in"),e&&A("Removed",e.email??"session"),h()}async function EP(){let e=await Ke();if(C()){L(e?{ok:!0,signed_in:!0,email:e.email,user_id:e.userId}:{ok:!0,signed_in:!1});return}if(!e){I("Not signed in"),h(),k("Inspecting, scaffolding and local rounds need no account."),k("Run `gamestage login` when you want to deploy a playground."),h();return}I("Signed in"),A("Account",e.email??"unknown"),e.userId&&A("User",e.userId),h(),k("`gamestage status` says whether this account is approved."),h()}xe();hn();import{readdir as t8,readFile as $P,stat as n8}from"node:fs/promises";Ie();No();import{homedir as o8}from"node:os";import{join as r8}from"node:path";zt();async function a8(e){let t=[];try{t=await t8(e)}catch{}let o=t.filter(c=>!c.startsWith(".")),r=[];for(let c of o)/\.html?$/.test(c)&&r.push(c);let n=!1,a,i=!1;for(let c of["gamestage.yaml","gamestage.yml"])try{await n8(`${e}/${c}`),n=!0;try{let d=await $P(`${e}/${c}`,"utf8"),l=We(d);l.ok?a=(await kr(`${e}/${c}`)).ok:l.issues.some(u=>u.path==="backend.round")&&(i=!0)}catch{}break}catch{}return{has_manifest:n,has_package_json:o.includes("package.json"),html_files:r,is_empty:o.length===0,has_round:a,...i?{round_in_manifest:!0}:{}}}function i8(e,t){let o=[],r="";for(let n of e.split(" "))r&&r.length+1+n.length>t?(o.push(r),r=n):r=r?`${r} ${n}`:n;return r&&o.push(r),o}async function s8(){try{return(await $P(r8(o8(),".claude","skills","gamestage","SKILL.md"),"utf8")).match(/^Pack version ([0-9][0-9-]*)\.$/m)?.[1]??null}catch{return null}}async function AP(){let e=_m(),t=process.cwd(),o=await a8(t),r=o.has_manifest?o.round_in_manifest?"move-round":o.has_round===!1?"round":o.has_round===!0?"play":"continue":o.has_package_json||o.html_files.length>0?"inspect":"create",n={continue:{command:ee("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."},"move-round":{command:`move the round from gamestage.yaml to ${Le}`,why:Ua,prompt:`This Gamestage manifest still carries a round under \`backend.round\`, which every command now refuses. Move that block into ${Le}, at the top level of the file, and delete it from gamestage.yaml. The practice round stays on this laptop: the real rounds are written in Studio.`},round:{command:ee("dev --serve"),why:`The manifest names a format, and there is no practice round yet, so \`${ee("dev")}\` plays a stand-in of that format. To play your own, write one to ${Le}: it stays on this laptop. A deployed game plays the rounds written in Studio. \`${ee("dev")}\` needs an account, so \`${ee("login")}\` comes first.`,prompt:`This project has a Gamestage manifest and no practice round yet. Write one to ${Le} from the game's own content so \`gamestage dev\` plays it locally, and keep every answer out of the page and out of anything the browser downloads. A deploy never uploads practice/. A deployed game takes its rounds from Studio, where a producer changes them without a deploy.`},play:{command:ee("dev"),why:`There is a practice round in ${Le}. Serve it locally, through the real Engine. Needs an account, so \`${ee("login")}\` first if you have not.`,prompt:"Serve this Gamestage game locally with `npx gamestage dev`, open it, and make a play. Then tell me whether the Engine decided the outcome or the page did."},inspect:{command:ee("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:ee("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."}},a=await Ke().catch(()=>null),i=await e;if(C()){L({ok:!0,cwd:t,version:ot,...i?{pack_update:i}:{},detected:o,route:r,next:n[r],prompt:n[r].prompt,docs:{start:"https://gamestage.ai/start.md",schema:"https://gamestage.ai/schemas/app-manifest/1.0"},invocation:Lu(),account:{signed_in:!!a?.email,email:a?.email??null,sign_in:ee("login")},first_reply:{tell:a?.email?`You're signed in to Gamestage as ${a.email}.`:`You're not signed in to Gamestage. Run \`${ee("login")}\`: it opens your browser, and creates your account if you don't have one.`,ask:"Do you have a game already, or do you want to make a new one?",offer:`Want to see the sports data you can build a game on? Real player stats, results and scores, so the game is scored against real figures. \`${ee("sources")}\` lists what your workspace can use`+(a?.email?".":" once you have signed in; until then, https://gamestage.ai/docs/data-sources."),then:"Wait for the answer before reading or changing anything else in this folder."},authentication:a?.email?`Signed in as ${a.email}. \`${ee("deploy")}\` also needs the account approved; \`${ee("status")}\` says whether it is.`:`Not signed in. \`${ee("inspect")}\`, \`${ee("create")}\` and \`${ee("manifest validate")}\` work without an account, so do that work now. \`${ee("dev")}\`, \`${ee("verify")}\` and \`${ee("deploy")}\` refuse until \`${ee("login")}\`, which creates the account too. Say so in your first reply (first_reply.tell), carry on without it, and remind them once at the first command that needs it.`});return}i&&h(i),I(`Gamestage ${ot}`);let c=Xn?await s8():null;if(c&&Xn&&c<Xn&&(h(w.dim(` Your installed Gamestage skill is ${c}; the current one is ${Xn}.
19991
19991
  Refresh it: `)+w.cyan("npx skills add https://gamestage.ai/skill")),h(w.dim(" Every way to set up and update: ")+w.cyan("https://gamestage.ai/docs/setup"))),h(w.dim(" Take an agent-built game to production, on the platform behind the")),h(w.dim(" world's biggest fan experiences.")),I("What this does"),h(w.dim(` Your game keeps its interface. For games with a correct answer, the
19992
19992
  answer and marking sit on the server, not in the page. This is designed
19993
19993
  to stop a player reading the answer from the page or editing their score.
@@ -19995,19 +19995,19 @@ data: {}
19995
19995
  against limits. Use checked Arcade boards without prizes until replay ships.
19996
19996
  Monterosa makes reasonable efforts to prevent common forms of cheating,
19997
19997
  gives no guarantee, and the terms at https://gamestage.ai/terms apply.`)),h(),h(` ${w.dim("A")} ${w.cyan("round")} ${w.dim("is one playable thing: a board, a question, a slate.")}`),h(` ${w.dim("Your")} ${w.cyan("manifest")} ${w.dim("is gamestage.yaml, which describes the game.")}`),h(` ${w.dim("The")} ${w.cyan("Engine")} ${w.dim("applies the game\u2019s rules and records accepted scores.")}`),I("Who you are"),a?.email?(A("Signed in",a.email),h(w.dim(` ${ee("status")} names your workspace and whether it is approved.`)),h(w.dim(` If that is not the account you signed up with, ${ee("login")} rebinds
19998
- this machine. Stage shows the command with your workspace in it.`))):(h(` Not signed in. ${w.cyan(ee("login"))} binds this machine to your account,`),h(" and creates the account if you do not have one."),h(w.dim(" Inspect, create and validate need no account, so start there.")),h(w.dim(` ${ee("dev")}, ${ee("verify")} and ${ee("deploy")} ask you to sign in first.`))),I("Where you are"),o.round_in_manifest)h(` An App Manifest is present, and it still carries a round. ${Ua}`);else if(o.has_manifest&&o.has_round===!1)h(` An App Manifest is present, and there is no practice round in ${Le} yet.`);else if(o.has_manifest&&o.has_round===!0)h(` An App Manifest is present, with a practice round in ${Le}.`);else if(o.has_manifest)h(" An App Manifest is already present.");else if(o.has_package_json||o.html_files.length){let d=[o.has_package_json?"a Node project":null,o.html_files.length?`${o.html_files.length} HTML file(s)`:null].filter(Boolean);h(` Found ${d.join(" and ")}. This looks like a game to inspect.`)}else h(" Nothing here yet. This looks like a fresh start.");if(I("Do this next"),h(` ${w.cyan(n[r].command)}`),h(` ${w.dim(n[r].why)}`),r==="create"||r==="inspect"){h(),h(` ${w.dim("The formats you can build today:")}`);let d=new Set(yO.map(({format:l})=>l));for(let l of Yt){let u=`${ko[l].name} (${l})`;d.has(l)?h(` ${w.cyan(u)} ${w.dim(Cr[l])}`):h(` ${w.cyan(u)} ${w.dim("No starter page yet: bring your own page.")}`)}}h(),h(` ${w.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let d of a8(n[r].prompt,74))h(` ${w.cyan(d)}`);I("Good to know"),h(w.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
19998
+ this machine. Stage shows the command with your workspace in it.`))):(h(` Not signed in. ${w.cyan(ee("login"))} binds this machine to your account,`),h(" and creates the account if you do not have one."),h(w.dim(" Inspect, create and validate need no account, so start there.")),h(w.dim(` ${ee("dev")}, ${ee("verify")} and ${ee("deploy")} ask you to sign in first.`))),I("Where you are"),o.round_in_manifest)h(` An App Manifest is present, and it still carries a round. ${Ua}`);else if(o.has_manifest&&o.has_round===!1)h(` An App Manifest is present, and there is no practice round in ${Le} yet.`);else if(o.has_manifest&&o.has_round===!0)h(` An App Manifest is present, with a practice round in ${Le}.`);else if(o.has_manifest)h(" An App Manifest is already present.");else if(o.has_package_json||o.html_files.length){let d=[o.has_package_json?"a Node project":null,o.html_files.length?`${o.html_files.length} HTML file(s)`:null].filter(Boolean);h(` Found ${d.join(" and ")}. This looks like a game to inspect.`)}else h(" Nothing here yet. This looks like a fresh start.");if(I("Do this next"),h(` ${w.cyan(n[r].command)}`),h(` ${w.dim(n[r].why)}`),r==="create"||r==="inspect"){h(),h(` ${w.dim("The formats you can build today:")}`);let d=new Set(yO.map(({format:l})=>l));for(let l of Yt){let u=`${ko[l].name} (${l})`;d.has(l)?h(` ${w.cyan(u)} ${w.dim(Cr[l])}`):h(` ${w.cyan(u)} ${w.dim("No starter page yet: bring your own page.")}`)}}h(),h(` ${w.dim("Or paste this into Claude Code, Codex, Gemini or Cursor:")}`);for(let d of i8(n[r].prompt,74))h(` ${w.cyan(d)}`);I("Good to know"),h(w.dim(` Inspect, create and validate run anonymously. \`dev\` and \`verify\`
19999
19999
  need you signed in, because they run your round through a real
20000
20000
  Engine. \`gamestage login\` creates the account if you do not have
20001
- one yet. ${ZE}`)),h()}var ni=class extends Error{};function CP(e){let t=e.what.trim();if(!t)throw new ni("Say what you were trying to build.");if(t.length>2e3)throw new ni(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let o=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:o||"none",cli_version:e.cliVersion}}function IP(e){return JSON.stringify(e,null,2)}async function Em(e,t,o=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let r=t[Symbol.asyncIterator](),n,a=Symbol("nothing came"),i=await Promise.race([r.next(),new Promise(l=>{n=setTimeout(()=>l(a),o)})]);if(clearTimeout(n),i===a||i.done)return r.return?.().catch(()=>{}),e??"";let c=[OP(i.value)];for(let l=await r.next();!l.done;l=await r.next())c.push(OP(l.value));let d=c.join("");return d.trim()?d:e??""}function OP(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Ie();var s8=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function PP(e,t,o,r=process.stdin){let n=await Em(e,r),a;try{a=CP({what:n,closest:t.closest,cliVersion:o})}catch(d){throw d instanceof ni&&S(d.message),d}if(!t.send){if(C()){L({sent:!1,would_send:a});return}I("This is everything that would be sent"),h(),h(IP(a)),h(),k("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),k(n===e?`Send it with ${ee('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ee("suggest --send")}.`);return}let i;try{i=await fetch(s8,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)})}catch(d){S("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let c=await i.json().catch(()=>({}));if(i.ok||S(`Gamestage refused that suggestion (${i.status}).`,[c.error?.message??"It said nothing more."]),C()){L({sent:!0,reference:c.reference??null});return}I("Sent"),c.reference&&k(`Reference ${c.reference}. Quote it if you follow up.`),k("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var oi=class extends Error{};function RP(e){let t=e.what.trim();if(!t)throw new oi("Say what went wrong.");if(t.length>2e3)throw new oi(`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 o=(e.game??"").trim();return{kind:"issue",what:t,game:o||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function NP(e){return JSON.stringify(e,null,2)}Ie();var c8=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function LP(e,t,o,r=process.stdin){let n=await Em(e,r),a;try{a=RP({what:n,game:t.game,cliVersion:o,nodeVersion:process.version,platform:process.platform})}catch(d){throw d instanceof oi&&S(d.message),d}if(!t.send){if(C()){L({sent:!1,would_send:a});return}I("This is everything that would be sent"),h(),h(NP(a)),h(),k("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),k(n===e?`Send it with ${ee('issue "..." --send')}.`:`Send it by piping the same text again, with ${ee("issue --send")}.`);return}let i;try{i=await fetch(c8,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)})}catch(d){S("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let c=await i.json().catch(()=>({}));if(i.ok||S(`Gamestage refused that report (${i.status}).`,[c.error?.message??"It said nothing more."]),C()){L({sent:!0,reference:c.reference??null});return}I("Reported"),c.reference&&k(`Reference ${c.reference}. Quote it if you follow up.`),k("It is in the backlog now. Somebody at Monterosa reads these.")}xe();rt();Ie();import{readFile as l8}from"node:fs/promises";import{resolve as d8}from"node:path";async function zP(e){let t=d8(e),o;try{o=await l8(t,"utf8")}catch{S(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let r;try{r=JSON.parse(o)}catch(a){S(`${e} is not JSON.`,[a instanceof Error?a.message:"Could not parse it."])}let n=Ut.safeParse(r);if(!n.success){let a=n.error.issues[0];S(`${e} is not valid reference data.`,[a?`${a.path.join(".")||"document"}: ${a.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:o,measures:n.data.measures.map(a=>a.key)}}function u8(e){let t=Ut.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(o=>[o.key,Object.keys(o.values).length]))}var m8={copy:"immutable copy",pointer:"reference data"};async function p8(e,t,o){let r=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});r.ok||S(`The ${o} upload was refused with ${r.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function jP(e,t,o={}){let{client:r}=await be(),{body:n}=await zP(t),a=Bd(n),i=Nv(n),c=await r.getDataset(e).catch(()=>{}),d=i.ok?C2(c?.dataset?.scored,i.summary):[];d.length&&!o.dropScoring&&S(`This push would stop ${d.join(", ")} scoring rounds.`,[`The live ${e} gives ${d.join(", ")} a scoring block and ${t} does not.`,"Add the block back, or pass --drop-scoring if removing it is the point."]);let l=await r.referenceUploadTarget(e,a),u=await A2(n,async(g,b)=>{await p8(g==="copy"?l.copy:l.pointer,b,m8[g])});u.ok||S(`${t} is not valid reference data.`,[u.detail??"No detail."]);let{measures:p,counts:f}=u.summary;if(C())return L({ok:!0,name:e,digest:a,measures:p,counts:f,key:l.pointer.key});I("Pushed"),k(`${e} is now the reference data for this workspace`);for(let g of p)k(`${g}: ${f[g].toLocaleString("en-GB")} values`);k(`Digest ${a}, kept so a round can say what it was scored on`),h(),k("A round provisioned from now on uses this. One already in play keeps"),k("the numbers it opened with, which is deliberate.")}async function DP(e,t){let{body:o,measures:r}=await zP(e),n=u8(o),a=Ut.parse(JSON.parse(o)),i={};for(let c of a.measures){let d=t.filter(l=>typeof c.values[l]!="number");d.length&&(i[c.key]=d)}if(C())return L({ok:Object.keys(i).length===0,measures:r,counts:n,missing:i});I("Reference data");for(let c of r)k(`${c}: ${n[c].toLocaleString("en-GB")} values`);if(!t.length){h(),k("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(h(),!Object.keys(i).length){k(`All ${t.length} key(s) are present in every measure.`);return}for(let[c,d]of Object.entries(i))k(`${c} has no value for ${d.map(l=>`"${l}"`).join(", ")}`);S("A round using those keys would be refused rather than scoring them as nothing.")}xe();rt();Ie();function h8(e,t){let o=[];for(let{supplier:r,entitlement:n}of e){let a=t.filter(l=>(l.supplier??(l.origin==="push"?"push":void 0))===r.id).map(l=>l.name),i=r.catalogue;if(i?.fetched===!1&&a.length===0)continue;let c=i?.needsKey??!1,d=n.allowed?a.length>0?"connected":c?"available, needs a key":"available":"not available to you";o.push({id:r.id,label:r.label,state:d,...n.allowed?{}:{reason:n.reason??""},offers:i?.offers??r.note,competitions:i?.competitions??[],cost:i?.cost??"",needsKey:c,...i?.signUp?{signUp:i.signUp}:{},licence:i?.licence??r.note,...vs(r)?{caveat:vs(r)}:{},datasets:a})}return o}async function MP(){let{client:e}=await be(),[t,o]=await Promise.all([e.getWorkspace(),e.listDatasets()]),r=h8(hA(Vd(t),An),o.datasets);if(C())return L({ok:!0,sources:r});I("Where a game's real-world values can come from");for(let n of r)h(),A(n.label,n.state),k(n.offers),n.competitions.length&&k(`Covers: ${n.competitions.join(", ")}`),n.cost&&k(`Cost: ${n.cost}`),k(`Licence: ${n.licence}`),n.caveat&&k(n.caveat),n.datasets.length&&k(`In this workspace: ${n.datasets.join(", ")}`),n.state==="available, needs a key"&&(n.signUp&&k(`Sign up: ${n.signUp}`),k(`Then: \`gamestage sources connect ${n.id}\`, which opens a page for your key. Never paste a key into a chat.`)),n.reason&&k(n.reason);h(),k("Values stay on the server. A fan's browser only ever receives names and results.")}ar();zt();Ie();import{readFile as f8,writeFile as g8}from"node:fs/promises";var y8=/^live:[^\n]*\n(?:[ \t]+[^\n]*\n|[ \t]*\n(?=[ \t]))*/m;function FP(e,t){let r=(e.endsWith(`
20001
+ one yet. ${ZE}`)),h()}var ni=class extends Error{};function CP(e){let t=e.what.trim();if(!t)throw new ni("Say what you were trying to build.");if(t.length>2e3)throw new ni(`That is ${t.length} characters and the limit is 2000. Send the shape of the problem; we will ask for the rest.`);let o=(e.closest??"").trim();return{kind:"suggestion",what:t,closest:o||"none",cli_version:e.cliVersion}}function IP(e){return JSON.stringify(e,null,2)}async function Em(e,t,o=2e3){if(e!==void 0&&e.trim())return e;if(t.isTTY)return e??"";let r=t[Symbol.asyncIterator](),n,a=Symbol("nothing came"),i=await Promise.race([r.next(),new Promise(l=>{n=setTimeout(()=>l(a),o)})]);if(clearTimeout(n),i===a||i.done)return r.return?.().catch(()=>{}),e??"";let c=[OP(i.value)];for(let l=await r.next();!l.done;l=await r.next())c.push(OP(l.value));let d=c.join("");return d.trim()?d:e??""}function OP(e){return typeof e=="string"?e:Buffer.from(e).toString("utf8")}Ie();var c8=process.env.GAMESTAGE_SUGGEST_URL??"https://gamestage.ai/api/suggest";async function PP(e,t,o,r=process.stdin){let n=await Em(e,r),a;try{a=CP({what:n,closest:t.closest,cliVersion:o})}catch(d){throw d instanceof ni&&S(d.message),d}if(!t.send){if(C()){L({sent:!1,would_send:a});return}I("This is everything that would be sent"),h(),h(IP(a)),h(),k("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),k(n===e?`Send it with ${ee('suggest "..." --send')}.`:`Send it by piping the same text again, with ${ee("suggest --send")}.`);return}let i;try{i=await fetch(c8,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)})}catch(d){S("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let c=await i.json().catch(()=>({}));if(i.ok||S(`Gamestage refused that suggestion (${i.status}).`,[c.error?.message??"It said nothing more."]),C()){L({sent:!0,reference:c.reference??null});return}I("Sent"),c.reference&&k(`Reference ${c.reference}. Quote it if you follow up.`),k("Somebody at Monterosa reads these. A format that keeps arriving gets built.")}var oi=class extends Error{};function RP(e){let t=e.what.trim();if(!t)throw new oi("Say what went wrong.");if(t.length>2e3)throw new oi(`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 o=(e.game??"").trim();return{kind:"issue",what:t,game:o||"none",cli_version:e.cliVersion,node_version:e.nodeVersion,platform:e.platform}}function NP(e){return JSON.stringify(e,null,2)}Ie();var l8=process.env.GAMESTAGE_ISSUE_URL??"https://gamestage.ai/api/issue";async function LP(e,t,o,r=process.stdin){let n=await Em(e,r),a;try{a=RP({what:n,game:t.game,cliVersion:o,nodeVersion:process.version,platform:process.platform})}catch(d){throw d instanceof oi&&S(d.message),d}if(!t.send){if(C()){L({sent:!1,would_send:a});return}I("This is everything that would be sent"),h(),h(NP(a)),h(),k("No manifest, no round, no answers and no source. There is nowhere in that shape to put one."),k(n===e?`Send it with ${ee('issue "..." --send')}.`:`Send it by piping the same text again, with ${ee("issue --send")}.`);return}let i;try{i=await fetch(l8,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(a)})}catch(d){S("Could not reach Gamestage to send that.",[d instanceof Error?d.message:String(d)])}let c=await i.json().catch(()=>({}));if(i.ok||S(`Gamestage refused that report (${i.status}).`,[c.error?.message??"It said nothing more."]),C()){L({sent:!0,reference:c.reference??null});return}I("Reported"),c.reference&&k(`Reference ${c.reference}. Quote it if you follow up.`),k("It is in the backlog now. Somebody at Monterosa reads these.")}xe();rt();Ie();import{readFile as d8}from"node:fs/promises";import{resolve as u8}from"node:path";async function zP(e){let t=u8(e),o;try{o=await d8(t,"utf8")}catch{S(`No such file: ${e}`,["Give the path to a JSON file holding the reference data."])}let r;try{r=JSON.parse(o)}catch(a){S(`${e} is not JSON.`,[a instanceof Error?a.message:"Could not parse it."])}let n=Ut.safeParse(r);if(!n.success){let a=n.error.issues[0];S(`${e} is not valid reference data.`,[a?`${a.path.join(".")||"document"}: ${a.message}`:"No detail.",'It needs `{ "corpus": "1", "measures": [{ "key", "label", "values" }] }`.'])}return{body:o,measures:n.data.measures.map(a=>a.key)}}function m8(e){let t=Ut.parse(JSON.parse(e));return Object.fromEntries(t.measures.map(o=>[o.key,Object.keys(o.values).length]))}var p8={copy:"immutable copy",pointer:"reference data"};async function h8(e,t,o){let r=await fetch(e.uploadUrl,{method:"PUT",body:new Uint8Array(Buffer.from(t,"utf8")),headers:{"content-type":"application/json"}});r.ok||S(`The ${o} upload was refused with ${r.status}.`,["A signed URL lasts fifteen minutes. Run the push again for a fresh one."])}async function jP(e,t,o={}){let{client:r}=await be(),{body:n}=await zP(t),a=Bd(n),i=Nv(n),c=await r.getDataset(e).catch(()=>{}),d=i.ok?C2(c?.dataset?.scored,i.summary):[];d.length&&!o.dropScoring&&S(`This push would stop ${d.join(", ")} scoring rounds.`,[`The live ${e} gives ${d.join(", ")} a scoring block and ${t} does not.`,"Add the block back, or pass --drop-scoring if removing it is the point."]);let l=await r.referenceUploadTarget(e,a),u=await A2(n,async(g,b)=>{await h8(g==="copy"?l.copy:l.pointer,b,p8[g])});u.ok||S(`${t} is not valid reference data.`,[u.detail??"No detail."]);let{measures:p,counts:f}=u.summary;if(C())return L({ok:!0,name:e,digest:a,measures:p,counts:f,key:l.pointer.key});I("Pushed"),k(`${e} is now the reference data for this workspace`);for(let g of p)k(`${g}: ${f[g].toLocaleString("en-GB")} values`);k(`Digest ${a}, kept so a round can say what it was scored on`),h(),k("A round provisioned from now on uses this. One already in play keeps"),k("the numbers it opened with, which is deliberate.")}async function DP(e,t){let{body:o,measures:r}=await zP(e),n=m8(o),a=Ut.parse(JSON.parse(o)),i={};for(let c of a.measures){let d=t.filter(l=>typeof c.values[l]!="number");d.length&&(i[c.key]=d)}if(C())return L({ok:Object.keys(i).length===0,measures:r,counts:n,missing:i});I("Reference data");for(let c of r)k(`${c}: ${n[c].toLocaleString("en-GB")} values`);if(!t.length){h(),k("Pass the keys a round uses to check them: `reference check <file> <key>...`");return}if(h(),!Object.keys(i).length){k(`All ${t.length} key(s) are present in every measure.`);return}for(let[c,d]of Object.entries(i))k(`${c} has no value for ${d.map(l=>`"${l}"`).join(", ")}`);S("A round using those keys would be refused rather than scoring them as nothing.")}xe();rt();Ie();function f8(e,t){let o=[];for(let{supplier:r,entitlement:n}of e){let a=t.filter(l=>(l.supplier??(l.origin==="push"?"push":void 0))===r.id).map(l=>l.name),i=r.catalogue;if(i?.fetched===!1&&a.length===0)continue;let c=i?.needsKey??!1,d=n.allowed?a.length>0?"connected":c?"available, needs a key":"available":"not available to you";o.push({id:r.id,label:r.label,state:d,...n.allowed?{}:{reason:n.reason??""},offers:i?.offers??r.note,competitions:i?.competitions??[],cost:i?.cost??"",needsKey:c,...i?.signUp?{signUp:i.signUp}:{},licence:i?.licence??r.note,...vs(r)?{caveat:vs(r)}:{},datasets:a})}return o}async function MP(){let{client:e}=await be(),[t,o]=await Promise.all([e.getWorkspace(),e.listDatasets()]),r=f8(hA(Vd(t),An),o.datasets);if(C())return L({ok:!0,sources:r});I("Where a game's real-world values can come from");for(let n of r)h(),A(n.label,n.state),k(n.offers),n.competitions.length&&k(`Covers: ${n.competitions.join(", ")}`),n.cost&&k(`Cost: ${n.cost}`),k(`Licence: ${n.licence}`),n.caveat&&k(n.caveat),n.datasets.length&&k(`In this workspace: ${n.datasets.join(", ")}`),n.state==="available, needs a key"&&(n.signUp&&k(`Sign up: ${n.signUp}`),k(`Then: \`gamestage sources connect ${n.id}\`, which opens a page for your key. Never paste a key into a chat.`)),n.reason&&k(n.reason);h(),k("Values stay on the server. A fan's browser only ever receives names and results.")}ar();zt();Ie();import{readFile as g8,writeFile as y8}from"node:fs/promises";var b8=/^live:[^\n]*\n(?:[ \t]+[^\n]*\n|[ \t]*\n(?=[ \t]))*/m;function FP(e,t){let r=(e.endsWith(`
20002
20002
  `)?e:`${e}
20003
- `).replace(y8,"");if(t===null)return r;let n=r.endsWith(`
20003
+ `).replace(b8,"");if(t===null)return r;let n=r.endsWith(`
20004
20004
 
20005
20005
  `)?"":`
20006
20006
  `;return`${r}${n}# Live data: this game follows a real contest as it happens. The edition
20007
20007
  # names the contest in Studio ("Live contest"); game.live() hands it over.
20008
20008
  live:
20009
20009
  provider: ${t}
20010
- `}async function j_(e){try{return await f8(e,"utf8")}catch{throw S(`No ${e} here.`,["Run this in the game's folder, or name the manifest with --manifest."]),new Error("unreachable")}}async function UP(e,t,o){let r=We(t);if(r.ok||S(`${e} would not be a valid manifest after that change, so it was left as it was.`,r.issues.map(n=>`${n.path}: ${n.message}`)),await g8(e,t),C())return L({ok:!0,live:o?{provider:o}:null,manifest:e});h(o?`Live data is on in ${e}, from ${o}.`:`Live data is off in ${e}.`),o?(k(`Deploy to apply it with ${ee("deploy <game> --dir .")}; each edition then has a "Live contest" setting in Studio.`),k(`In the page, game.live() hands over the contest; ${ee("dev --serve")} plays a made-up one locally.`)):k(`Deploy to apply it with ${ee("deploy <game> --dir .")}`)}async function GP(e){let t=e.manifest??"gamestage.yaml",o=e.provider??"sportmonks";_o.includes(o)||S(`${o} is not a live-data provider Gamestage reads.`,[`Providers today: ${_o.join(", ")}.`]),await UP(t,FP(await j_(t),o),o)}async function BP(e){let t=e.manifest??"gamestage.yaml";await UP(t,FP(await j_(t),null),null)}async function qP(e){let t=e.manifest??"gamestage.yaml",o=We(await j_(t)),r=o.ok?o.manifest.live:void 0;if(C())return L({ok:o.ok,live:r?{provider:r.provider}:null,manifest:t});h(r?`Live data is on in ${t}, from ${r.provider}.`:`Live data is off in ${t}.`),k(r?`${ee("live off")} switches it off.`:`${ee("live on")} switches it on.`)}xe();import{spawn as w8}from"node:child_process";xe();rt();Ie();Nn();var WP=()=>Object.keys(Vn).join(", ");async function $m(e,t){try{return await e()}catch(o){Jt(o);let r=o instanceof Error?o.message:String(o),n=o instanceof qe?` (${o.status})`:"";return S(`${t} was refused${n}: ${r}`,[])}}function HP(e,t){A("Dataset",e.name),A("League",Vn[e.request.league]?.label??e.request.league),A("Measures",e.request.measures.join(", ")),A("Fetched",`every ${e.everyHours} hours${e.override?" (set by Monterosa)":""}`),t!==null&&A("Data",b8(t))}function b8(e,t=Date.now()){if(!e)return"waiting for the first fetch, which comes within the hour";let o=e.checkedAt??e.publishedAt,r=o?Math.max(0,Math.round((t-new Date(o).getTime())/36e5)):void 0,n=r===void 0?"":r<1?" under an hour ago":` ${r} ${r===1?"hour":"hours"} ago`;if(e.failing)return`the last fetch failed${n}; it is tried again on the next hourly run`;let a=e.counted?Math.max(0,...Object.values(e.counts)):0;return`fetched${n}${a?`, ${a.toLocaleString("en-GB")} players`:""}`}async function YP(e,t){t.league||S(`Say which league: --league ${Object.keys(Vn)[0]}.`,[`${e.toUpperCase()} covers ${WP()}.`,`Then pick measures with --measures, or leave it out for a starting set. \`gamestage sources status ${e} --league nba\` lists them.`]);let{client:o}=await be();o.switchOnSource||S("This CLI's control plane cannot switch sources on.",[]);let r=await $m(()=>o.switchOnSource(e,{league:t.league,...t.measures?{measures:t.measures.split(",").map(n=>n.trim()).filter(Boolean)}:{},...t.season?{season:Number(t.season)}:{},...t.name?{name:t.name}:{}}),"Switching a source on");if(C())return L(r);I(`${e.toUpperCase()} is switched on`),HP(r),h(),k(`The first fetch comes on the loader's next hourly run. A game uses it by naming "${r.name}" as its dataset in Studio.`),k(vw),h()}async function VP(e,t){if(t.league){let i=Wd(t.league);if(i.length===0&&S(`${t.league} is not a league ${e.toUpperCase()} covers.`,[`It covers ${WP()}.`]),C())return L({league:t.league,measures:i});I(`${Vn[t.league].label} measures`);for(let c of i)k(`${c.key} ${c.label}`);h();return}let{client:o}=await be();o.listSourceDatasets||S("This CLI's control plane cannot list sources.",[]);let r=await $m(()=>o.listSourceDatasets(e),"Listing switched-on sources"),n=await o.listDatasets().catch(()=>{}),a=n&&!n.unavailable?new Map(n.datasets.map(i=>[i.name,i])):void 0;if(C())return L({source:e,datasets:r});if(I(`${e.toUpperCase()} in your workspace`),r.length===0)k(`Not switched on. \`gamestage sources connect ${e} --league nba\` starts it.`);else for(let i of r)HP(i,a?a.get(i.name):null),h();h()}async function KP(e,t){t.name||S("Say which dataset: --name espn-nba.",[`\`gamestage sources status ${e}\` lists yours.`]);let{client:o}=await be();o.switchOffSource||S("This CLI's control plane cannot switch sources off.",[]);let r=await $m(()=>o.switchOffSource(e,t.name),"Switching a source off");if(C())return L(r);I(`${r.name} is switched off`),k("No more fetches. The data already fetched stays, so a game playing on it keeps working."),h()}async function ZP(e,t,o){let r=o==="default"?null:Number(o);r!==null&&(!Number.isInteger(r)||r<1||r>168)&&S("Give a whole number of hours from 1 to 168, or `default` to go back to the creator's own.",[`A creator may ask for every ${cC} hours or longer; this goes below that.`]);let{admin:n}=await Xt(),a=await $m(()=>n.setDatasetRefresh(e,t,r),"Setting a refresh override");if(C())return L(a);I(`${a.name} in ${e}`),A("Fetched",`every ${a.everyHours} hours${a.override?" (Monterosa's override)":""}`),h()}rt();Nn();Ie();Rn();function Am(e){let t=An.find(n=>n.id===e);if(t?.catalogue?.needsKey)return{label:t.label,signUp:t.catalogue.signUp};let o=zs.find(n=>n.id===e);if(o)return{label:o.label,signUp:o.signUp,service:o};let r=[...An.filter(n=>n.catalogue?.needsKey).map(n=>n.id),...zs.map(n=>n.id)];return S(`${e} is not a source you connect with a key.`,[r.length?`Sources and services that take your own key: ${r.join(", ")}.`:"No source takes a key yet.","`gamestage sources` lists them all."])}function v8(e){return`${Je}/stage/data/sources/${encodeURIComponent(e)}`}var k8=/^op:\/\/[^\s/]+\/[^\s/]+(\/[^\s/]+)?\/[^\s/]+$/;function _8(e,t=w8){return new Promise(o=>{let r="",n=!1,a=c=>{n||(n=!0,o(c))},i;try{i=t("op",["read","--no-newline",e],{shell:!1,stdio:["ignore","pipe","ignore"]})}catch{a({ok:!1,reason:"The 1Password CLI (op) is not installed or not on your PATH."});return}i.stdout?.on("data",c=>{r+=c.toString("utf8")}),i.on("error",c=>a({ok:!1,reason:c.code==="ENOENT"?"The 1Password CLI (op) is not installed or not on your PATH.":"The 1Password CLI could not be started."})),i.on("close",c=>{let d=r.trim();a(c===0&&d?{ok:!0,value:d}:{ok:!1,reason:"1Password did not return that secret. Check the reference, and that you are signed in to op and approved the read."})})})}async function JP(e,t={}){if(mu(e))return YP(e,t);if(t.fromOp!==void 0)return x8(e,t.fromOp);let o=Am(e),r=v8(e);if(C()){L({ok:!0,source:e,connect_url:r,sign_up:o.signUp??null});return}I(`Connect ${o.label}`),A("Open",r),k("Paste your API key on that page, in your own browser. It goes straight to Gamestage and is stored in AWS Secrets Manager."),k("This command never asks for the key, so the coding agent running it never sees it. Do not paste a key into a chat."),o.service&&k(o.service.purpose),o.signUp&&k(`No key yet? Sign up at ${o.signUp}`),k(o.service?`When it says Connected, \`gamestage sources status ${e}\` confirms it.`:`When it says Connected, \`gamestage sources status ${e}\` shows what your plan covers.`),h()}async function XP(e,t){let o=await Qn(),r=await fetch(`${Re}/v1/sources/${encodeURIComponent(e)}/key`,{method:t,headers:{...ct(),authorization:`Bearer ${o.accessToken}`,accept:"application/json"}}).catch(()=>{});r||S("Could not reach Gamestage.",["Check your connection and try again."]);let n=await r.json().catch(()=>({}));return Jt({status:r.status,code:n.error?.code,message:n.error?.message}),r.ok||S(n.error?.message??`Gamestage answered ${r.status}.`,[]),n}function QP(e,t){if(C()){L({ok:!0,source:e,...t});return}if(I(e),A("State",t.state==="connected"?"connected":"not connected"),t.message&&k(t.message),t.coverage?.length){let o=t.coverage.slice(0,12);k(`Your plan covers: ${o.join(", ")}${t.coverage.length>o.length?`, and ${t.coverage.length-o.length} more`:""}.`)}t.state!=="connected"&&k(`\`gamestage sources connect ${e}\` gives you the link to add a key.`),h()}async function eR(e,t={}){if(mu(e))return VP(e,t);Am(e),QP(e,await XP(e,"GET"))}async function tR(e,t={}){if(mu(e))return KP(e,t);Am(e),QP(e,await XP(e,"DELETE"))}async function x8(e,t,o=_8){Am(e),k8.test(t)||S("--from-op takes a 1Password reference, such as op://Vault/Item/field.",["It never takes a key itself. To paste a key instead, open the page `gamestage sources connect "+e+"` prints."]);let r=await Qn(),n=await o(t);n.ok||S(n.reason,[]);let a;try{a=await fetch(`${Re}/v1/sources/${encodeURIComponent(e)}/key`,{method:"PUT",headers:{...ct(),authorization:`Bearer ${r.accessToken}`,"content-type":"application/json",accept:"application/json","x-gamestage-via":"cli"},body:JSON.stringify({key:n.value})})}catch{a=void 0}a||S("Could not reach Gamestage.",["Check your connection and try again."]);let i=await a.json().catch(()=>({})),c=u=>u.split(n.value).join("[key]");Jt({status:a.status,code:i.error?.code,message:i.error?.message&&c(i.error.message)}),(a.status===422||i.state==="rejected")&&S(`${e} refused that key. Check the 1Password item holds the whole API token, then try again.`,[]),a.status===429&&S("Too many attempts to connect a key in the last hour. Wait an hour, then try again.",[]),(a.status===401||a.status===403)&&S("Gamestage did not accept your session.",["Run `gamestage login`, then try again."]),a.ok||S(`Gamestage could not connect the key (HTTP ${a.status}). Try again in a minute.`,[]);let d=(i.coverage??[]).map(c),l=/^[A-Za-z0-9]{4}$/.test(i.keyEnding??"")?i.keyEnding:n.value.slice(-4);if(C()){L({ok:!0,source:e,state:"connected",key_ending:l,coverage:d});return}I("Connected"),A("Key ending",l),zs.some(u=>u.id===e)?k(c(i.message??"Connected.")):d.length?k(`Your plan covers: ${d.join(", ")}.`):k("Your plan covers no competitions yet."),h()}xe();rt();Wo();import{readFile as nR}from"node:fs/promises";import{dirname as S8,join as T8,resolve as D_}from"node:path";import{createInterface as oR}from"node:readline/promises";Ie();zt();async function E8(e){let t=await Y1(D_(e));t&&S(t);let o=await kr(e);if(!o.ok&&!o.missing&&S(jo(o.path),o.problems),!o.ok){let n;try{let c=We(await nR(D_(e),"utf8"));c.ok&&(n=c.manifest.backend.archetype)}catch{}let a=await nR(T8(S8(D_(e)),"index.html"),"utf8").catch(()=>""),i=n?C8(n,qo(a)):[];S(`There is no ${Le} to push.`,["Most games write their rounds in Studio directly, and","`gamestage status <game>` prints the link to the game's Studio project.",...i.length?["",`To start from a round on this machine, write one to ${Le}, then push it.`,"This is one for this game's format:","",...i.map(c=>` ${c}`),"",`Every field is described at ${p_(n??"")?.docs??"https://gamestage.ai/docs/game-formats"}`]:[]])}let r=o.round;return r.archetype==="predict"&&S("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."]),r}function rR(e){if(I("What goes into Studio"),k(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){k(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)k(`${t.label||t.id}: ${t.entries.map(o=>o.label||o.key).join(", ")}`);h(),h("No point values go with it. They stay in your reference data, where only"),h("the Engine reads them.")}else if(e.archetype==="shoot")k(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),k(`Keeper: ${e.difficulty}`),h(),h("Nothing here is an answer. The keeper is decided by the Engine at play time,"),h("from entropy it minted when the round was provisioned.");else if(e.archetype==="hunt"&&e.guess)k(`The answer: ${e.guess.answer}`),k(`Guesses a fan gets: ${e.guess.guessesAllowed}`),e.guess.clues?.length&&k(`Clues: ${e.guess.clues.length}, earned one per wrong guess or skip`),h(),h("The answer and the clues go into fields Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read them.");else if(e.archetype==="hunt"&&e.solve)k(`The phrase: ${e.solve.solution}`),k(`Letters a fan draws: ${e.solve.drawsAllowed}`),h(),h("The phrase goes into a field Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read it.");else{if(k(`Board: ${e.board.join(", ")}`),e.archetype==="hunt"){if(k(`The answer: ${e.targets.join(", ")}`),e.lineup){let t=[...new Set(e.lineup.places.map(o=>o.row))].sort((o,r)=>r-o);k(`${e.lineup.team}${e.lineup.formation?`, ${e.lineup.formation}`:""}:`);for(let o of t){let r=e.lineup.places.filter(n=>n.row===o).sort((n,a)=>n.column-a.column).map(n=>n.label??"?");h(` ${r.join(" ")}`)}}}else for(let t of e.groups)k(`${t.label}: ${t.members.join(", ")}`);h(),h("The answer goes with it, into a field Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read it.")}h()}async function $8(e,t){if(t)return!0;process.stdin.isTTY||S("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 o=oR({input:process.stdin,output:process.stdout});try{return(await o.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{o.close()}}async function aR(e,t){let o=t.manifest??"gamestage.yaml",r=await E8(o),n=r.archetype==="push"?fu(r):r;if(C()||rR(n),!await $8(e,!!t.yes)){h("Nothing was written.");return}try{let{client:a}=await be(),i=await a.seedRound(e,n);i.refused&&S("The round was not written into Studio.",[i.refused]);let c=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:n.archetype==="hunt"&&(n.guess||n.solve)?{count:1,noun:n.guess?"answer to guess":"phrase to solve"}:{count:n.board.length,noun:"picks on the board"};L({game:e,seeded:!0,archetype:n.archetype,parts:c.count,studioUrl:i.game.studioUrl??null}),C()||(I("Written"),k(`${c.count} ${c.noun} are now on ${e}'s round in Studio.`),k("A producer can change every word of it without another deploy."),i.game.studioUrl?A("Studio",i.game.studioUrl):k(`\`gamestage open ${e} studio\` opens it.`),k(`${Le} is unchanged, and stays on this laptop.`),h())}catch(a){await pe(a)}}async function iR(e){try{let{client:t}=await be(),o=await t.refreshRound(e);o.refused&&S("The round was not refreshed.",[o.refused]);let r=(o.game.logs??[]).slice(-3);if(L({game:e,refreshed:!0,logs:r}),!C()){I("Refreshed");for(let n of r)k(n.message);h()}}catch(t){await pe(t)}}async function A8(e,t,o,r){let n=iv.parse({...t,count:Number(t.count)}),a=await o.roundSeedCandidates(e,n);if(a.ok||S("Could not seed rounds.",[a.reason]),!a.ok)return;if(t.dryRun){console.log(JSON.stringify({game:e,dryRun:!0,...a},null,2));return}if(!C())for(let c of a.rounds)rR(c);if(!await r()){h("Nothing was written.");return}let i=0;for(let[c,d]of a.rounds.entries())try{let l=c===a.rounds.length-1,u=await o.seedRound(e,d,{create:!0,name:l});if(u.refused)throw new Error(u.refused);i++}catch(l){S(`Seeding stopped after ${i} of ${a.rounds.length} rounds were written.`,[l instanceof Error?l.message:String(l),"Inspect Studio before retrying: another seed creates additional elements."])}L({game:e,seeded:i,dataset:a.dataset,digest:a.digest}),C()||h(`Created ${i} rounds in Studio. A producer can review and publish them there.`)}async function sR(e,t){let o=iv.safeParse({...t,count:Number(t.count)});o.success||S("Invalid round seed options.",o.error.issues.map(r=>r.message));try{let{client:r}=await be();await A8(e,t,r,async()=>{if(t.yes)return!0;process.stdin.isTTY||S("Refusing to create Studio rounds without consent.",["Use --dry-run to preview, or --yes to create the rounds."]);let n=oR({input:process.stdin,output:process.stdout});try{return(await n.question(`Create ${t.count} new rounds on ${e}? Type yes: `)).trim().toLowerCase()==="yes"}finally{n.close()}})}catch(r){await pe(r)}}function C8(e,t){let o;try{o=Gu(Mn(e,t))}catch{return[]}let r=[],n=i=>typeof i=="string"?JSON.stringify(i):String(i),a=(i,c)=>{if(Array.isArray(i)){for(let d of i)d&&typeof d=="object"?Object.entries(d).forEach(([u,p],f)=>{let g=f===0?`${c}- `:`${c} `;p&&typeof p=="object"?(r.push(`${g}${u}:`),a(p,`${c} `)):r.push(`${g}${u}: ${n(p)}`)}):r.push(`${c}- ${n(d)}`);return}for(let[d,l]of Object.entries(i))l!==void 0&&(l&&typeof l=="object"?(r.push(`${c}${d}:`),a(l,`${c} `)):r.push(`${c}${d}: ${n(l)}`))};return a(o,""),r}va();xe();rt();Ie();import{readFile as cR}from"node:fs/promises";import{resolve as lR}from"node:path";import{createInterface as I8}from"node:readline/promises";var F_="practice/season.yaml";function O8(e,t){let o;try{o=ht.load(e,{schema:ht.CORE_SCHEMA})}catch(d){return{ok:!1,problems:[d instanceof Error?d.message:"It is not valid YAML."]}}let r=o??{},n=typeof r.timezone=="string"?r.timezone:"Europe/London";try{new Intl.DateTimeFormat("en-GB",{timeZone:n})}catch{return{ok:!1,problems:[`timezone "${n}" is not a time zone, e.g. Europe/London.`]}}if(!Array.isArray(r.days)||r.days.length===0)return{ok:!1,problems:["days The file needs a list of days, each with a date and its round."]};let a=[],i=new Set,c=[];return r.days.forEach((d,l)=>{let{date:u,...p}=d??{},f=`days.${l+1}`;if(typeof u!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(u)||Number.isNaN(Date.parse(`${u}T00:00:00Z`))){a.push(`${f}.date Write the date as 2026-11-01.`);return}i.has(u)&&a.push(`${f}.date ${u} is in the file twice.`),i.add(u);let g=Ve.safeParse({archetype:t,...p});if(!g.success){for(let x of g.error.issues)a.push(`${u} ${x.path.join(".")||"(round)"} ${x.message}`);return}let b=g.data;if(b.archetype==="predict"||b.archetype==="bingo"){a.push(`${u} A ${b.archetype} round is authored in Studio itself.`);return}let v=b.archetype==="push"?fu(b):b;c.push({date:u,round:v})}),a.length?{ok:!1,problems:a}:(c.sort((d,l)=>d.date.localeCompare(l.date)),{ok:!0,season:{timeZone:n,days:c}})}function M_(e,t){let[o,r,n]=e.split("-").map(Number),a=Date.UTC(o,r-1,n),i=d=>{let l=Object.fromEntries(new Intl.DateTimeFormat("en-GB",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(d)).map(p=>[p.type,p.value]));return Date.UTC(+l.year,+l.month-1,+l.day,+l.hour,+l.minute,+l.second)-d},c=a-i(a);return c=a-i(c),Math.floor(c/1e3)}function P8(e){let[t,o,r]=e.split("-").map(Number);return new Date(Date.UTC(t,o-1,r+1)).toISOString().slice(0,10)}async function R8(e,t,o,r){o.seedSeasonDay||S("This control plane cannot take a season yet.",["It is running a build older than this CLI. Push one round at a time with `gamestage round push` until it is updated."]);let n=[];for(let a of t.days){let i=await o.seedSeasonDay(e,{name:a.date,dayStart:M_(a.date,t.timeZone),dayEnd:M_(P8(a.date),t.timeZone),round:a.round,...r?{overwrite:!0}:{}});n.push({date:a.date,status:i.status,..."reason"in i?{reason:i.reason}:{},...i.status==="seeded"?{startsAt:i.startsAt}:{}})}return n}async function N8(e){try{let t=ht.load(await cR(lR(e),"utf8"),{schema:ht.CORE_SCHEMA});if(typeof t?.backend?.archetype=="string")return t.backend.archetype}catch{}S(`Could not read the game's format from ${e}.`,["Run this beside the game's gamestage.yaml, or pass --manifest."])}async function dR(e,t){let o=t.file??F_,r;try{r=await cR(lR(o),"utf8")}catch{S(`There is no ${o} to read.`,["Write one day per entry, each a round plus its date:",""," timezone: Europe/London"," days:"," - date: 2026-11-01"," prompt: Team nickname"," solve:"," solution: Silver Arrows"])}let n=O8(r,await N8(t.manifest??"gamestage.yaml"));n.ok||S(`${o} has problems, so nothing was written.`,n.problems);let{season:a}=n,i=a.days[0].date,c=a.days.at(-1).date;if(C()||(I("Season"),k(`${a.days.length} days, ${i} to ${c}, each starting at midnight ${a.timeZone}.`),k(t.overwrite?"Days that already have a round in Studio are written over.":"Days that already have a round in Studio are kept as they are."),h()),t.dryRun){L({game:e,days:a.days.length,first:i,last:c,written:!1});return}if(!t.yes){process.stdin.isTTY||S("Refusing to write a season without being asked.",["Re-run with --yes, or --dry-run to check the file."]);let d=I8({input:process.stdin,output:process.stdout});try{let l=t.overwrite?`This replaces any day a producer has edited on ${e}. Type yes to go ahead: `:`Write ${a.days.length} days to ${e} in Studio? Type yes: `;if((await d.question(l)).trim().toLowerCase()!=="yes"){h("Nothing was written.");return}}finally{d.close()}}try{let{client:d}=await be(),l=await R8(e,a,d,!!t.overwrite),u=p=>l.filter(f=>f.status===p).length;if(L({game:e,days:l}),!C()){I("Written"),k(`${u("seeded")} days written, ${u("kept")} kept as a producer left them.`);for(let p of l)p.status==="unsupported"||p.status==="failed"?k(`${p.date}: not written. ${p.reason}`):p.status==="seeded"&&p.startsAt!==void 0&&p.startsAt!==M_(p.date,a.timeZone)&&k(`${p.date}: starts at ${new Date(p.startsAt*1e3).toISOString().slice(11,16)} UTC, when the edition before it ends.`);k("A producer can change any day in Studio without another deploy."),h()}u("unsupported")+u("failed")>0&&(process.exitCode=1)}catch(d){await pe(d)}}sn();var Cm={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},Im=`
20010
+ `}async function j_(e){try{return await g8(e,"utf8")}catch{throw S(`No ${e} here.`,["Run this in the game's folder, or name the manifest with --manifest."]),new Error("unreachable")}}async function UP(e,t,o){let r=We(t);if(r.ok||S(`${e} would not be a valid manifest after that change, so it was left as it was.`,r.issues.map(n=>`${n.path}: ${n.message}`)),await y8(e,t),C())return L({ok:!0,live:o?{provider:o}:null,manifest:e});h(o?`Live data is on in ${e}, from ${o}.`:`Live data is off in ${e}.`),o?(k(`Deploy to apply it with ${ee("deploy <game> --dir .")}; each edition then has a "Live contest" setting in Studio.`),k(`In the page, game.live() hands over the contest; ${ee("dev --serve")} plays a made-up one locally.`)):k(`Deploy to apply it with ${ee("deploy <game> --dir .")}`)}async function GP(e){let t=e.manifest??"gamestage.yaml",o=e.provider??"sportmonks";_o.includes(o)||S(`${o} is not a live-data provider Gamestage reads.`,[`Providers today: ${_o.join(", ")}.`]),await UP(t,FP(await j_(t),o),o)}async function BP(e){let t=e.manifest??"gamestage.yaml";await UP(t,FP(await j_(t),null),null)}async function qP(e){let t=e.manifest??"gamestage.yaml",o=We(await j_(t)),r=o.ok?o.manifest.live:void 0;if(C())return L({ok:o.ok,live:r?{provider:r.provider}:null,manifest:t});h(r?`Live data is on in ${t}, from ${r.provider}.`:`Live data is off in ${t}.`),k(r?`${ee("live off")} switches it off.`:`${ee("live on")} switches it on.`)}xe();import{spawn as v8}from"node:child_process";xe();rt();Ie();Nn();var WP=()=>Object.keys(Vn).join(", ");async function $m(e,t){try{return await e()}catch(o){Jt(o);let r=o instanceof Error?o.message:String(o),n=o instanceof qe?` (${o.status})`:"";return S(`${t} was refused${n}: ${r}`,[])}}function HP(e,t){A("Dataset",e.name),A("League",Vn[e.request.league]?.label??e.request.league),A("Measures",e.request.measures.join(", ")),A("Fetched",`every ${e.everyHours} hours${e.override?" (set by Monterosa)":""}`),t!==null&&A("Data",w8(t))}function w8(e,t=Date.now()){if(!e)return"waiting for the first fetch, which comes within the hour";let o=e.checkedAt??e.publishedAt,r=o?Math.max(0,Math.round((t-new Date(o).getTime())/36e5)):void 0,n=r===void 0?"":r<1?" under an hour ago":` ${r} ${r===1?"hour":"hours"} ago`;if(e.failing)return`the last fetch failed${n}; it is tried again on the next hourly run`;let a=e.counted?Math.max(0,...Object.values(e.counts)):0;return`fetched${n}${a?`, ${a.toLocaleString("en-GB")} players`:""}`}async function YP(e,t){t.league||S(`Say which league: --league ${Object.keys(Vn)[0]}.`,[`${e.toUpperCase()} covers ${WP()}.`,`Then pick measures with --measures, or leave it out for a starting set. \`gamestage sources status ${e} --league nba\` lists them.`]);let{client:o}=await be();o.switchOnSource||S("This CLI's control plane cannot switch sources on.",[]);let r=await $m(()=>o.switchOnSource(e,{league:t.league,...t.measures?{measures:t.measures.split(",").map(n=>n.trim()).filter(Boolean)}:{},...t.season?{season:Number(t.season)}:{},...t.name?{name:t.name}:{}}),"Switching a source on");if(C())return L(r);I(`${e.toUpperCase()} is switched on`),HP(r),h(),k(`The first fetch comes on the loader's next hourly run. A game uses it by naming "${r.name}" as its dataset in Studio.`),k(vw),h()}async function VP(e,t){if(t.league){let i=Wd(t.league);if(i.length===0&&S(`${t.league} is not a league ${e.toUpperCase()} covers.`,[`It covers ${WP()}.`]),C())return L({league:t.league,measures:i});I(`${Vn[t.league].label} measures`);for(let c of i)k(`${c.key} ${c.label}`);h();return}let{client:o}=await be();o.listSourceDatasets||S("This CLI's control plane cannot list sources.",[]);let r=await $m(()=>o.listSourceDatasets(e),"Listing switched-on sources"),n=await o.listDatasets().catch(()=>{}),a=n&&!n.unavailable?new Map(n.datasets.map(i=>[i.name,i])):void 0;if(C())return L({source:e,datasets:r});if(I(`${e.toUpperCase()} in your workspace`),r.length===0)k(`Not switched on. \`gamestage sources connect ${e} --league nba\` starts it.`);else for(let i of r)HP(i,a?a.get(i.name):null),h();h()}async function KP(e,t){t.name||S("Say which dataset: --name espn-nba.",[`\`gamestage sources status ${e}\` lists yours.`]);let{client:o}=await be();o.switchOffSource||S("This CLI's control plane cannot switch sources off.",[]);let r=await $m(()=>o.switchOffSource(e,t.name),"Switching a source off");if(C())return L(r);I(`${r.name} is switched off`),k("No more fetches. The data already fetched stays, so a game playing on it keeps working."),h()}async function ZP(e,t,o){let r=o==="default"?null:Number(o);r!==null&&(!Number.isInteger(r)||r<1||r>168)&&S("Give a whole number of hours from 1 to 168, or `default` to go back to the creator's own.",[`A creator may ask for every ${cC} hours or longer; this goes below that.`]);let{admin:n}=await Xt(),a=await $m(()=>n.setDatasetRefresh(e,t,r),"Setting a refresh override");if(C())return L(a);I(`${a.name} in ${e}`),A("Fetched",`every ${a.everyHours} hours${a.override?" (Monterosa's override)":""}`),h()}rt();Nn();Ie();Rn();function Am(e){let t=An.find(n=>n.id===e);if(t?.catalogue?.needsKey)return{label:t.label,signUp:t.catalogue.signUp};let o=zs.find(n=>n.id===e);if(o)return{label:o.label,signUp:o.signUp,service:o};let r=[...An.filter(n=>n.catalogue?.needsKey).map(n=>n.id),...zs.map(n=>n.id)];return S(`${e} is not a source you connect with a key.`,[r.length?`Sources and services that take your own key: ${r.join(", ")}.`:"No source takes a key yet.","`gamestage sources` lists them all."])}function k8(e){return`${Je}/stage/data/sources/${encodeURIComponent(e)}`}var _8=/^op:\/\/[^\s/]+\/[^\s/]+(\/[^\s/]+)?\/[^\s/]+$/;function x8(e,t=v8){return new Promise(o=>{let r="",n=!1,a=c=>{n||(n=!0,o(c))},i;try{i=t("op",["read","--no-newline",e],{shell:!1,stdio:["ignore","pipe","ignore"]})}catch{a({ok:!1,reason:"The 1Password CLI (op) is not installed or not on your PATH."});return}i.stdout?.on("data",c=>{r+=c.toString("utf8")}),i.on("error",c=>a({ok:!1,reason:c.code==="ENOENT"?"The 1Password CLI (op) is not installed or not on your PATH.":"The 1Password CLI could not be started."})),i.on("close",c=>{let d=r.trim();a(c===0&&d?{ok:!0,value:d}:{ok:!1,reason:"1Password did not return that secret. Check the reference, and that you are signed in to op and approved the read."})})})}async function JP(e,t={}){if(mu(e))return YP(e,t);if(t.fromOp!==void 0)return S8(e,t.fromOp);let o=Am(e),r=k8(e);if(C()){L({ok:!0,source:e,connect_url:r,sign_up:o.signUp??null});return}I(`Connect ${o.label}`),A("Open",r),k("Paste your API key on that page, in your own browser. It goes straight to Gamestage and is stored in AWS Secrets Manager."),k("This command never asks for the key, so the coding agent running it never sees it. Do not paste a key into a chat."),o.service&&k(o.service.purpose),o.signUp&&k(`No key yet? Sign up at ${o.signUp}`),k(o.service?`When it says Connected, \`gamestage sources status ${e}\` confirms it.`:`When it says Connected, \`gamestage sources status ${e}\` shows what your plan covers.`),h()}async function XP(e,t){let o=await Qn(),r=await fetch(`${Re}/v1/sources/${encodeURIComponent(e)}/key`,{method:t,headers:{...ct(),authorization:`Bearer ${o.accessToken}`,accept:"application/json"}}).catch(()=>{});r||S("Could not reach Gamestage.",["Check your connection and try again."]);let n=await r.json().catch(()=>({}));return Jt({status:r.status,code:n.error?.code,message:n.error?.message}),r.ok||S(n.error?.message??`Gamestage answered ${r.status}.`,[]),n}function QP(e,t){if(C()){L({ok:!0,source:e,...t});return}if(I(e),A("State",t.state==="connected"?"connected":"not connected"),t.message&&k(t.message),t.coverage?.length){let o=t.coverage.slice(0,12);k(`Your plan covers: ${o.join(", ")}${t.coverage.length>o.length?`, and ${t.coverage.length-o.length} more`:""}.`)}t.state!=="connected"&&k(`\`gamestage sources connect ${e}\` gives you the link to add a key.`),h()}async function eR(e,t={}){if(mu(e))return VP(e,t);Am(e),QP(e,await XP(e,"GET"))}async function tR(e,t={}){if(mu(e))return KP(e,t);Am(e),QP(e,await XP(e,"DELETE"))}async function S8(e,t,o=x8){Am(e),_8.test(t)||S("--from-op takes a 1Password reference, such as op://Vault/Item/field.",["It never takes a key itself. To paste a key instead, open the page `gamestage sources connect "+e+"` prints."]);let r=await Qn(),n=await o(t);n.ok||S(n.reason,[]);let a;try{a=await fetch(`${Re}/v1/sources/${encodeURIComponent(e)}/key`,{method:"PUT",headers:{...ct(),authorization:`Bearer ${r.accessToken}`,"content-type":"application/json",accept:"application/json","x-gamestage-via":"cli"},body:JSON.stringify({key:n.value})})}catch{a=void 0}a||S("Could not reach Gamestage.",["Check your connection and try again."]);let i=await a.json().catch(()=>({})),c=u=>u.split(n.value).join("[key]");Jt({status:a.status,code:i.error?.code,message:i.error?.message&&c(i.error.message)}),(a.status===422||i.state==="rejected")&&S(`${e} refused that key. Check the 1Password item holds the whole API token, then try again.`,[]),a.status===429&&S("Too many attempts to connect a key in the last hour. Wait an hour, then try again.",[]),(a.status===401||a.status===403)&&S("Gamestage did not accept your session.",["Run `gamestage login`, then try again."]),a.ok||S(`Gamestage could not connect the key (HTTP ${a.status}). Try again in a minute.`,[]);let d=(i.coverage??[]).map(c),l=/^[A-Za-z0-9]{4}$/.test(i.keyEnding??"")?i.keyEnding:n.value.slice(-4);if(C()){L({ok:!0,source:e,state:"connected",key_ending:l,coverage:d});return}I("Connected"),A("Key ending",l),zs.some(u=>u.id===e)?k(c(i.message??"Connected.")):d.length?k(`Your plan covers: ${d.join(", ")}.`):k("Your plan covers no competitions yet."),h()}xe();rt();Wo();import{readFile as nR}from"node:fs/promises";import{dirname as T8,join as E8,resolve as D_}from"node:path";import{createInterface as oR}from"node:readline/promises";Ie();zt();async function $8(e){let t=await Y1(D_(e));t&&S(t);let o=await kr(e);if(!o.ok&&!o.missing&&S(jo(o.path),o.problems),!o.ok){let n;try{let c=We(await nR(D_(e),"utf8"));c.ok&&(n=c.manifest.backend.archetype)}catch{}let a=await nR(E8(T8(D_(e)),"index.html"),"utf8").catch(()=>""),i=n?I8(n,qo(a)):[];S(`There is no ${Le} to push.`,["Most games write their rounds in Studio directly, and","`gamestage status <game>` prints the link to the game's Studio project.",...i.length?["",`To start from a round on this machine, write one to ${Le}, then push it.`,"This is one for this game's format:","",...i.map(c=>` ${c}`),"",`Every field is described at ${p_(n??"")?.docs??"https://gamestage.ai/docs/game-formats"}`]:[]])}let r=o.round;return r.archetype==="predict"&&S("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."]),r}function rR(e){if(I("What goes into Studio"),k(`What a fan is told: ${e.prompt||"(nothing)"}`),e.archetype==="push"){k(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)k(`${t.label||t.id}: ${t.entries.map(o=>o.label||o.key).join(", ")}`);h(),h("No point values go with it. They stay in your reference data, where only"),h("the Engine reads them.")}else if(e.archetype==="shoot")k(`Shots: ${e.shotsAllowed}, goals to win: ${e.goalsToWin}, points per goal: ${e.pointsPerGoal}`),k(`Keeper: ${e.difficulty}`),h(),h("Nothing here is an answer. The keeper is decided by the Engine at play time,"),h("from entropy it minted when the round was provisioned.");else if(e.archetype==="hunt"&&e.guess)k(`The answer: ${e.guess.answer}`),k(`Guesses a fan gets: ${e.guess.guessesAllowed}`),e.guess.clues?.length&&k(`Clues: ${e.guess.clues.length}, earned one per wrong guess or skip`),h(),h("The answer and the clues go into fields Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read them.");else if(e.archetype==="hunt"&&e.solve)k(`The phrase: ${e.solve.solution}`),k(`Letters a fan draws: ${e.solve.drawsAllowed}`),h(),h("The phrase goes into a field Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read it.");else{if(k(`Board: ${e.board.join(", ")}`),e.archetype==="hunt"){if(k(`The answer: ${e.targets.join(", ")}`),e.lineup){let t=[...new Set(e.lineup.places.map(o=>o.row))].sort((o,r)=>r-o);k(`${e.lineup.team}${e.lineup.formation?`, ${e.lineup.formation}`:""}:`);for(let o of t){let r=e.lineup.places.filter(n=>n.row===o).sort((n,a)=>n.column-a.column).map(n=>n.label??"?");h(` ${r.join(" ")}`)}}}else for(let t of e.groups)k(`${t.label}: ${t.members.join(", ")}`);h(),h("The answer goes with it, into a field Studio withholds from a fan's browser."),h("Only a producer signed into Studio can read it.")}h()}async function A8(e,t){if(t)return!0;process.stdin.isTTY||S("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 o=oR({input:process.stdin,output:process.stdout});try{return(await o.question(`This replaces the round a producer may have edited on ${e}. Type yes to go ahead: `)).trim().toLowerCase()==="yes"}finally{o.close()}}async function aR(e,t){let o=t.manifest??"gamestage.yaml",r=await $8(o),n=r.archetype==="push"?fu(r):r;if(C()||rR(n),!await A8(e,!!t.yes)){h("Nothing was written.");return}try{let{client:a}=await be(),i=await a.seedRound(e,n);i.refused&&S("The round was not written into Studio.",[i.refused]);let c=n.archetype==="push"?{count:n.slates.length,noun:"groups of picks"}:n.archetype==="hunt"&&(n.guess||n.solve)?{count:1,noun:n.guess?"answer to guess":"phrase to solve"}:{count:n.board.length,noun:"picks on the board"};L({game:e,seeded:!0,archetype:n.archetype,parts:c.count,studioUrl:i.game.studioUrl??null}),C()||(I("Written"),k(`${c.count} ${c.noun} are now on ${e}'s round in Studio.`),k("A producer can change every word of it without another deploy."),i.game.studioUrl?A("Studio",i.game.studioUrl):k(`\`gamestage open ${e} studio\` opens it.`),k(`${Le} is unchanged, and stays on this laptop.`),h())}catch(a){await pe(a)}}async function iR(e){try{let{client:t}=await be(),o=await t.refreshRound(e);o.refused&&S("The round was not refreshed.",[o.refused]);let r=(o.game.logs??[]).slice(-3);if(L({game:e,refreshed:!0,logs:r}),!C()){I("Refreshed");for(let n of r)k(n.message);h()}}catch(t){await pe(t)}}async function C8(e,t,o,r){let n=iv.parse({...t,count:Number(t.count)}),a=await o.roundSeedCandidates(e,n);if(a.ok||S("Could not seed rounds.",[a.reason]),!a.ok)return;if(t.dryRun){console.log(JSON.stringify({game:e,dryRun:!0,...a},null,2));return}if(!C())for(let c of a.rounds)rR(c);if(!await r()){h("Nothing was written.");return}let i=0;for(let[c,d]of a.rounds.entries())try{let l=c===a.rounds.length-1,u=await o.seedRound(e,d,{create:!0,name:l});if(u.refused)throw new Error(u.refused);i++}catch(l){S(`Seeding stopped after ${i} of ${a.rounds.length} rounds were written.`,[l instanceof Error?l.message:String(l),"Inspect Studio before retrying: another seed creates additional elements."])}L({game:e,seeded:i,dataset:a.dataset,digest:a.digest}),C()||h(`Created ${i} rounds in Studio. A producer can review and publish them there.`)}async function sR(e,t){let o=iv.safeParse({...t,count:Number(t.count)});o.success||S("Invalid round seed options.",o.error.issues.map(r=>r.message));try{let{client:r}=await be();await C8(e,t,r,async()=>{if(t.yes)return!0;process.stdin.isTTY||S("Refusing to create Studio rounds without consent.",["Use --dry-run to preview, or --yes to create the rounds."]);let n=oR({input:process.stdin,output:process.stdout});try{return(await n.question(`Create ${t.count} new rounds on ${e}? Type yes: `)).trim().toLowerCase()==="yes"}finally{n.close()}})}catch(r){await pe(r)}}function I8(e,t){let o;try{o=Gu(Mn(e,t))}catch{return[]}let r=[],n=i=>typeof i=="string"?JSON.stringify(i):String(i),a=(i,c)=>{if(Array.isArray(i)){for(let d of i)d&&typeof d=="object"?Object.entries(d).forEach(([u,p],f)=>{let g=f===0?`${c}- `:`${c} `;p&&typeof p=="object"?(r.push(`${g}${u}:`),a(p,`${c} `)):r.push(`${g}${u}: ${n(p)}`)}):r.push(`${c}- ${n(d)}`);return}for(let[d,l]of Object.entries(i))l!==void 0&&(l&&typeof l=="object"?(r.push(`${c}${d}:`),a(l,`${c} `)):r.push(`${c}${d}: ${n(l)}`))};return a(o,""),r}va();xe();rt();Ie();import{readFile as cR}from"node:fs/promises";import{resolve as lR}from"node:path";import{createInterface as O8}from"node:readline/promises";var F_="practice/season.yaml";function P8(e,t){let o;try{o=ht.load(e,{schema:ht.CORE_SCHEMA})}catch(d){return{ok:!1,problems:[d instanceof Error?d.message:"It is not valid YAML."]}}let r=o??{},n=typeof r.timezone=="string"?r.timezone:"Europe/London";try{new Intl.DateTimeFormat("en-GB",{timeZone:n})}catch{return{ok:!1,problems:[`timezone "${n}" is not a time zone, e.g. Europe/London.`]}}if(!Array.isArray(r.days)||r.days.length===0)return{ok:!1,problems:["days The file needs a list of days, each with a date and its round."]};let a=[],i=new Set,c=[];return r.days.forEach((d,l)=>{let{date:u,...p}=d??{},f=`days.${l+1}`;if(typeof u!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(u)||Number.isNaN(Date.parse(`${u}T00:00:00Z`))){a.push(`${f}.date Write the date as 2026-11-01.`);return}i.has(u)&&a.push(`${f}.date ${u} is in the file twice.`),i.add(u);let g=Ve.safeParse({archetype:t,...p});if(!g.success){for(let x of g.error.issues)a.push(`${u} ${x.path.join(".")||"(round)"} ${x.message}`);return}let b=g.data;if(b.archetype==="predict"||b.archetype==="bingo"){a.push(`${u} A ${b.archetype} round is authored in Studio itself.`);return}let v=b.archetype==="push"?fu(b):b;c.push({date:u,round:v})}),a.length?{ok:!1,problems:a}:(c.sort((d,l)=>d.date.localeCompare(l.date)),{ok:!0,season:{timeZone:n,days:c}})}function M_(e,t){let[o,r,n]=e.split("-").map(Number),a=Date.UTC(o,r-1,n),i=d=>{let l=Object.fromEntries(new Intl.DateTimeFormat("en-GB",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(new Date(d)).map(p=>[p.type,p.value]));return Date.UTC(+l.year,+l.month-1,+l.day,+l.hour,+l.minute,+l.second)-d},c=a-i(a);return c=a-i(c),Math.floor(c/1e3)}function R8(e){let[t,o,r]=e.split("-").map(Number);return new Date(Date.UTC(t,o-1,r+1)).toISOString().slice(0,10)}async function N8(e,t,o,r){o.seedSeasonDay||S("This control plane cannot take a season yet.",["It is running a build older than this CLI. Push one round at a time with `gamestage round push` until it is updated."]);let n=[];for(let a of t.days){let i=await o.seedSeasonDay(e,{name:a.date,dayStart:M_(a.date,t.timeZone),dayEnd:M_(R8(a.date),t.timeZone),round:a.round,...r?{overwrite:!0}:{}});n.push({date:a.date,status:i.status,..."reason"in i?{reason:i.reason}:{},...i.status==="seeded"?{startsAt:i.startsAt}:{}})}return n}async function L8(e){try{let t=ht.load(await cR(lR(e),"utf8"),{schema:ht.CORE_SCHEMA});if(typeof t?.backend?.archetype=="string")return t.backend.archetype}catch{}S(`Could not read the game's format from ${e}.`,["Run this beside the game's gamestage.yaml, or pass --manifest."])}async function dR(e,t){let o=t.file??F_,r;try{r=await cR(lR(o),"utf8")}catch{S(`There is no ${o} to read.`,["Write one day per entry, each a round plus its date:",""," timezone: Europe/London"," days:"," - date: 2026-11-01"," prompt: Team nickname"," solve:"," solution: Silver Arrows"])}let n=P8(r,await L8(t.manifest??"gamestage.yaml"));n.ok||S(`${o} has problems, so nothing was written.`,n.problems);let{season:a}=n,i=a.days[0].date,c=a.days.at(-1).date;if(C()||(I("Season"),k(`${a.days.length} days, ${i} to ${c}, each starting at midnight ${a.timeZone}.`),k(t.overwrite?"Days that already have a round in Studio are written over.":"Days that already have a round in Studio are kept as they are."),h()),t.dryRun){L({game:e,days:a.days.length,first:i,last:c,written:!1});return}if(!t.yes){process.stdin.isTTY||S("Refusing to write a season without being asked.",["Re-run with --yes, or --dry-run to check the file."]);let d=O8({input:process.stdin,output:process.stdout});try{let l=t.overwrite?`This replaces any day a producer has edited on ${e}. Type yes to go ahead: `:`Write ${a.days.length} days to ${e} in Studio? Type yes: `;if((await d.question(l)).trim().toLowerCase()!=="yes"){h("Nothing was written.");return}}finally{d.close()}}try{let{client:d}=await be(),l=await N8(e,a,d,!!t.overwrite),u=p=>l.filter(f=>f.status===p).length;if(L({game:e,days:l}),!C()){I("Written"),k(`${u("seeded")} days written, ${u("kept")} kept as a producer left them.`);for(let p of l)p.status==="unsupported"||p.status==="failed"?k(`${p.date}: not written. ${p.reason}`):p.status==="seeded"&&p.startsAt!==void 0&&p.startsAt!==M_(p.date,a.timeZone)&&k(`${p.date}: starts at ${new Date(p.startsAt*1e3).toISOString().slice(11,16)} UTC, when the edition before it ends.`);k("A producer can change any day in Studio without another deploy."),h()}u("unsupported")+u("failed")>0&&(process.exitCode=1)}catch(d){await pe(d)}}sn();var Cm={orderMode:"auto",sortDirection:"desc",scoreFormat:"points",secondaryScoreEnabled:!1,showScores:!0,colourPreset:"dark",storyModeEnabled:!1,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1},Im=`
20011
20011
  /* Prev and Next render as bordered web buttons on a graphic nobody can
20012
20012
  click, next to "PAGE 1 OF 4". A director seeing browser chrome concludes
20013
20013
  the feed is a screen-share rather than a broadcast source. */
@@ -20046,13 +20046,13 @@ live:
20046
20046
  background: transparent !important;
20047
20047
  }
20048
20048
  body { padding: 0 !important; }
20049
- `,L8=213;function pR(e,t,o){return`
20049
+ `,z8=213;function pR(e,t,o){return`
20050
20050
  /* On the root rather than on .entries, so everything inherits it. The
20051
20051
  header's own numbers are sized from it too, and a custom property set on
20052
20052
  the rows cannot be read by anything above them. */
20053
20053
  #root {
20054
20054
  --rows: ${e};
20055
- --row-h: min(${t}px, calc((100vh - ${L8}px) / var(--rows)));
20055
+ --row-h: min(${t}px, calc((100vh - ${z8}px) / var(--rows)));
20056
20056
  }
20057
20057
  .entries { display: flex; flex-direction: column; min-height: 0; }
20058
20058
  .entry-row {
@@ -20382,8 +20382,8 @@ live:
20382
20382
  .entry-score { font-size: calc(var(--row-cap) * ${e.score}) !important; }
20383
20383
  .entry-rank { font-size: calc(var(--row-cap) * ${e.rank}) !important; }
20384
20384
  .table-header .col { font-size: ${e.header}vmin !important; }
20385
- `}var bR={primaryFontUrl:ls("Archivo Narrow"),primaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif',secondaryFontUrl:ls("Archivo Narrow"),secondaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif'},Om="#1E4B8F";function z8(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/[ \t]+/g," ").replace(/\n\s*\n+/g,`
20386
- `).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var j8=[{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:{...Cm,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:Om,cssOverrides:`${Im}${mR}${hR}${pR(3,68,20)}${uR}
20385
+ `}var bR={primaryFontUrl:ls("Archivo Narrow"),primaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif',secondaryFontUrl:ls("Archivo Narrow"),secondaryFontFamily:'"Archivo Narrow", "Arial Narrow", "Liberation Sans Narrow", sans-serif'},Om="#1E4B8F";function j8(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/[ \t]+/g," ").replace(/\n\s*\n+/g,`
20386
+ `).replace(/\s*([{}:;,])\s*/g,"$1").trim()}var D8=[{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:{...Cm,rowsPerScreen:3,embedPageSize:3,showAvatars:!1,aspectRatio:"16/9",accentColour:Om,cssOverrides:`${Im}${mR}${hR}${pR(3,68,20)}${uR}
20387
20387
  /* The lower third of the frame, inside the title-safe area. */
20388
20388
  #root {
20389
20389
  position: fixed;
@@ -20434,29 +20434,29 @@ live:
20434
20434
  eight rows and the chrome fill the panel. The min() still governs anything
20435
20435
  smaller, so a 720x1280 panel is unchanged. No backticks in here: this
20436
20436
  comment is inside a template literal and one of them ends the string. */
20437
- `}},{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"}}],kc=j8.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:z8(t)}}:e}),ri="bigscreen";function Pm(e){return kc.find(t=>t.id===e)}function wR(){return kc.map(e=>e.id)}import{createServer as D8}from"node:http";import{readFile as kR}from"node:fs/promises";import{extname as M8}from"node:path";rt();Ie();var Yo=1e4,Rm="preview",F8=[{name:"Happy Robin",primaryScore:61257},{name:"Copper Panda",primaryScore:59917},{name:"Sunny Robin",primaryScore:58582},{name:"Bo",primaryScore:58150},{name:"Wise Raven",primaryScore:56621},{name:"Marguerite Vandersteen-Whitlock",primaryScore:54903},{name:"Keen Marten",primaryScore:51044},{name:"Quiet Otter",primaryScore:49781},{name:"Quick Falcon",primaryScore:48310},{name:"Kind Puffin",primaryScore:47225},{name:"Ready Tapir",primaryScore:46980},{name:"Steady Finch",primaryScore:44117},{name:"Zesty Quokka",primaryScore:43508},{name:"Lucky Raven",primaryScore:41966},{name:"Bold Ibex",primaryScore:40402},{name:"Jo",primaryScore:39875},{name:"Silver Bison",primaryScore:38214},{name:"Calm Osprey",primaryScore:36790},{name:"Eager Lynx",primaryScore:35636},{name:"Golden Marmot",primaryScore:34401},{name:"Nimble Shrike",primaryScore:33118},{name:"Patient Heron",primaryScore:32292},{name:"Clever Stoat",primaryScore:30877},{name:"Brisk Wombat",primaryScore:29618},{name:"Gentle Kestrel",primaryScore:28044},{name:"Sharp Meerkat",primaryScore:26510},{name:"Sly Pangolin",primaryScore:24903},{name:"Warm Capybara",primaryScore:23177},{name:"Swift Ocelot",primaryScore:21440},{name:"Merry Numbat",primaryScore:19862},{name:"Proud Caracal",primaryScore:17305},{name:"Keen Wallaby",primaryScore:15288},{name:"Mild Aardvark",primaryScore:13910},{name:"Brave Echidna",primaryScore:11642},{name:"Plucky Serval",primaryScore:9033},{name:"Tidy Bandicoot",primaryScore:8766},{name:"Sunny Kinkajou",primaryScore:6120},{name:"Bright Heron",primaryScore:-3020},{name:"Rash Coati",primaryScore:-5417},{name:"Still Fox",primaryScore:-8824}];function U8(e){switch(M8(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 G8(e){let t="";try{t=await kR(e.css,"utf8")}catch{}let o=Number(e.rows)||10,r=new Date().toISOString(),n=Pm(ri)?.attributes??{};return{instance:{instanceId:Rm,name:"Preview",type:"leaderboard",embedSlug:Rm,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:r,updatedAt:r,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:n.rowsPerScreen??o,storyModeEnabled:n.storyModeEnabled??!1,storySegmentSize:n.storySegmentSize??10,storySegmentDuration:n.storySegmentDuration??8,accentColour:e.accent??n.accentColour??"#FFD700",colourPreset:"dark",primaryFontUrl:n.primaryFontUrl,primaryFontFamily:n.primaryFontFamily,secondaryFontUrl:n.secondaryFontUrl,secondaryFontFamily:n.secondaryFontFamily,headerText:"Preview Game",statusText:"Live",logos:[{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><rect width="120" height="120" fill="none" stroke="#888" stroke-width="4"/><text x="60" y="66" font-family="monospace" font-size="16" fill="#888" text-anchor="middle">LOGO</text></svg>'),position:"top-right"}],embedPageSize:o,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,templateCss:n.cssOverrides,cssOverrides:t}},entries:F8.slice(0,o).map((a,i)=>({entryId:`preview-${i}`,instanceId:Rm,name:a.name,gender:"",primaryScore:a.primaryScore,rank:i+1,createdAt:r,updatedAt:r})),generatedAt:r}}async function vR(e,t){let o=new URL(t.replace(/^\/(r\/)?/,""),e.endsWith("/")?e:`${e}/`);return fetch(o,{redirect:"follow"})}async function _R(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}.
20438
- Pass --renderer <url> if your Space serves it somewhere else.`);let r=D8((i,c)=>{(async()=>{let d=(i.url??"/").split("?")[0]??"/";try{if(d==="/config.js"){c.writeHead(200,{"content-type":"text/javascript","cache-control":"no-store"}),c.end(`window.GFX_CONFIG = {"apiBase":""};
20439
- `);return}if(d.startsWith("/api/gfx/instances/")){let p=JSON.stringify(await G8(e));c.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),c.end(p);return}if(d==="/"||d==="/index.html"||d==="/embed.html"||d==="/bigscreen.html"){let g=await(await vR(t,"embed.html")).text();g=g.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),c.writeHead(200,{"content-type":"text/html; charset=utf-8"}),c.end(g);return}let l=await vR(t,d);if(!l.ok){c.writeHead(l.status),c.end();return}let u=Buffer.from(await l.arrayBuffer());c.writeHead(200,{"content-type":U8(d)}),c.end(u)}catch(l){c.writeHead(502,{"content-type":"text/plain"}),c.end(`Could not reach the renderer: ${l instanceof Error?l.message:String(l)}
20437
+ `}},{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"}}],kc=D8.map(e=>{let t=e.attributes.cssOverrides;return typeof t=="string"?{...e,attributes:{...e.attributes,cssOverrides:j8(t)}}:e}),ri="bigscreen";function Pm(e){return kc.find(t=>t.id===e)}function wR(){return kc.map(e=>e.id)}import{createServer as M8}from"node:http";import{readFile as kR}from"node:fs/promises";import{extname as F8}from"node:path";rt();Ie();var Yo=1e4,Rm="preview",U8=[{name:"Happy Robin",primaryScore:61257},{name:"Copper Panda",primaryScore:59917},{name:"Sunny Robin",primaryScore:58582},{name:"Bo",primaryScore:58150},{name:"Wise Raven",primaryScore:56621},{name:"Marguerite Vandersteen-Whitlock",primaryScore:54903},{name:"Keen Marten",primaryScore:51044},{name:"Quiet Otter",primaryScore:49781},{name:"Quick Falcon",primaryScore:48310},{name:"Kind Puffin",primaryScore:47225},{name:"Ready Tapir",primaryScore:46980},{name:"Steady Finch",primaryScore:44117},{name:"Zesty Quokka",primaryScore:43508},{name:"Lucky Raven",primaryScore:41966},{name:"Bold Ibex",primaryScore:40402},{name:"Jo",primaryScore:39875},{name:"Silver Bison",primaryScore:38214},{name:"Calm Osprey",primaryScore:36790},{name:"Eager Lynx",primaryScore:35636},{name:"Golden Marmot",primaryScore:34401},{name:"Nimble Shrike",primaryScore:33118},{name:"Patient Heron",primaryScore:32292},{name:"Clever Stoat",primaryScore:30877},{name:"Brisk Wombat",primaryScore:29618},{name:"Gentle Kestrel",primaryScore:28044},{name:"Sharp Meerkat",primaryScore:26510},{name:"Sly Pangolin",primaryScore:24903},{name:"Warm Capybara",primaryScore:23177},{name:"Swift Ocelot",primaryScore:21440},{name:"Merry Numbat",primaryScore:19862},{name:"Proud Caracal",primaryScore:17305},{name:"Keen Wallaby",primaryScore:15288},{name:"Mild Aardvark",primaryScore:13910},{name:"Brave Echidna",primaryScore:11642},{name:"Plucky Serval",primaryScore:9033},{name:"Tidy Bandicoot",primaryScore:8766},{name:"Sunny Kinkajou",primaryScore:6120},{name:"Bright Heron",primaryScore:-3020},{name:"Rash Coati",primaryScore:-5417},{name:"Still Fox",primaryScore:-8824}];function G8(e){switch(F8(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 B8(e){let t="";try{t=await kR(e.css,"utf8")}catch{}let o=Number(e.rows)||10,r=new Date().toISOString(),n=Pm(ri)?.attributes??{};return{instance:{instanceId:Rm,name:"Preview",type:"leaderboard",embedSlug:Rm,retracted:!1,updateInterval:5,embedUpdateInterval:5,createdAt:r,updatedAt:r,attributes:{orderMode:"auto",scoreFormat:"points",sortDirection:"desc",secondaryScoreEnabled:!1,rowsPerScreen:n.rowsPerScreen??o,storyModeEnabled:n.storyModeEnabled??!1,storySegmentSize:n.storySegmentSize??10,storySegmentDuration:n.storySegmentDuration??8,accentColour:e.accent??n.accentColour??"#FFD700",colourPreset:"dark",primaryFontUrl:n.primaryFontUrl,primaryFontFamily:n.primaryFontFamily,secondaryFontUrl:n.secondaryFontUrl,secondaryFontFamily:n.secondaryFontFamily,headerText:"Preview Game",statusText:"Live",logos:[{url:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><rect width="120" height="120" fill="none" stroke="#888" stroke-width="4"/><text x="60" y="66" font-family="monospace" font-size="16" fill="#888" text-anchor="middle">LOGO</text></svg>'),position:"top-right"}],embedPageSize:o,embedGenderFilterEnabled:!1,embedCategoryColumnEnabled:!1,bigscreenCategoryColumnEnabled:!1,templateCss:n.cssOverrides,cssOverrides:t}},entries:U8.slice(0,o).map((a,i)=>({entryId:`preview-${i}`,instanceId:Rm,name:a.name,gender:"",primaryScore:a.primaryScore,rank:i+1,createdAt:r,updatedAt:r})),generatedAt:r}}async function vR(e,t){let o=new URL(t.replace(/^\/(r\/)?/,""),e.endsWith("/")?e:`${e}/`);return fetch(o,{redirect:"follow"})}async function _R(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}.
20438
+ Pass --renderer <url> if your Space serves it somewhere else.`);let r=M8((i,c)=>{(async()=>{let d=(i.url??"/").split("?")[0]??"/";try{if(d==="/config.js"){c.writeHead(200,{"content-type":"text/javascript","cache-control":"no-store"}),c.end(`window.GFX_CONFIG = {"apiBase":""};
20439
+ `);return}if(d.startsWith("/api/gfx/instances/")){let p=JSON.stringify(await B8(e));c.writeHead(200,{"content-type":"application/json","cache-control":"no-store"}),c.end(p);return}if(d==="/"||d==="/index.html"||d==="/embed.html"||d==="/bigscreen.html"){let g=await(await vR(t,"embed.html")).text();g=g.replace("<head>",'<head><script>window.GFX_CONFIG={apiBase:""}</script>'),c.writeHead(200,{"content-type":"text/html; charset=utf-8"}),c.end(g);return}let l=await vR(t,d);if(!l.ok){c.writeHead(l.status),c.end();return}let u=Buffer.from(await l.arrayBuffer());c.writeHead(200,{"content-type":G8(d)}),c.end(u)}catch(l){c.writeHead(502,{"content-type":"text/plain"}),c.end(`Could not reach the renderer: ${l instanceof Error?l.message:String(l)}
20440
20440
  `)}})()});await new Promise((i,c)=>{r.once("error",c),r.listen(Number(e.port),"127.0.0.1",()=>i())});let n=r.address();if(!n||typeof n=="string")throw new Error("The local server did not report its listening address");let a=`http://127.0.0.1:${n.port}/?slug=${Rm}${e.bigscreen?"&bigscreen=true":""}`;process.stdout.write(["",` Your graphic: ${a}`,` 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(`
20441
- `)),await new Promise(i=>{let c=()=>{process.off("SIGINT",c),process.off("SIGTERM",c),r.close(()=>i())};process.once("SIGINT",c),process.once("SIGTERM",c)})}function B8(e,t){let o=new URL(e),r=o.pathname.split("/");return r.pop(),o.pathname=[...r,t.replace(/^\.?\//,"")].join("/"),o.toString()}async function xR(e,t){let o=(r,n,a,i={},c={})=>{if(process.exitCode=1,C()){L({ok:!1,reason:r,game:e,stylesheet:t.css,...c});return}I(n);for(let[d,l]of Object.entries(i))A(d,l);h();for(let d of a)k(d);h()};try{let r;try{r=await kR(t.css,"utf8")}catch{o("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(r.length>Yo){o("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Yo.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(r.length-Yo).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${r.length.toLocaleString()} characters`,Limit:`${Yo.toLocaleString()} characters`},{characters:r.length,limit:Yo});return}let{client:n}=await be(),a=await n.getGame(e);if(!a){o("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!a.playgroundUrl){o("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 ${a.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${a.name} (${a.id})`});return}let i=B8(a.playgroundUrl,t.css),c=!1,d=0;try{let l=await fetch(i);d=l.status,c=l.ok}catch{c=!1}if(!c){o("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${a.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":i,Answered:d?String(d):"nothing"},{url:i,status:d,characters:r.length,limit:Yo});return}if(C()){L({ok:!0,game:a.id,stylesheet:t.css,characters:r.length,limit:Yo,url:i});return}I("Ready for a producer"),A("Game",`${a.name} (${a.id})`),A("Stylesheet",`${t.css} (${r.length.toLocaleString()} of ${Yo.toLocaleString()} characters)`),A("Address",i),h(),k("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),k("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."),h()}catch(r){await pe(r)}}function U_(e,t){let r=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:r};let n=Pm(t.template)?.attributes?.rowsPerScreen,a=n?`${r}&rows=${n}`:r;return t.template==="bigscreen"?{Address:`${r}&bigscreen=true`,"Overlay form":a}:{Address:a}}function SR(e,t){return e.refused?(process.exitCode=1,C()?(L({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(I("Not done"),h(` ${e.refused}`),h(),!0)):!1}async function TR(e,t){let o=(n,a,i)=>{if(process.exitCode=1,C()){L({ok:!1,reason:n,game:e,template:t.template});return}I(a),h();for(let c of i)k(c);h()},r=Pm(t.template);if(!r){o("no_such_template",`No template called ${t.template}`,[`The templates are: ${wR().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){o("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 ${r.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await be(),a=await n.getGame(e);if(!a){o("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!a.playgroundUrl){o("not_deployed","This game has not been deployed",[r.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 ${a.id} --dir .\` first.`]);return}let i=await n.composeGraphic(a.id,{template:r.id,consent:!0});if(SR(i,"graphic create"))return;let c=(i.game.graphics??[]).at(-1);if(!c){o("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 ${a.id}\` before making another one.`]);return}let d=U_(a.playgroundUrl,c);if(C()){L({ok:!0,game:a.id,graphic:c,addresses:d});return}I("On screen"),A("Game",`${a.name} (${a.id})`),A("Template",`${r.id} - ${r.summary}`),A("Made for",r.madeFor);for(let[l,u]of Object.entries(d))A(l,u);h(),k("Open that address on the screen. It is a web page and needs no sign-in."),k(r.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."),k(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${a.id}\`.`),h()}catch(n){if(n.code==="graphics_not_configured"){o("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}await pe(n)}}async function ER(e){try{let{client:t}=await be(),o=await t.getGame(e);if(!o){process.exitCode=1,C()?L({ok:!1,reason:"no_such_game",game:e}):(I("No such game"),h(),k(`Nothing in your workspace has the id ${e}.`),h());return}let r=o.graphics??[];if(C()){L({ok:!0,game:o.id,graphics:r.map(n=>({...n,addresses:o.playgroundUrl?U_(o.playgroundUrl,n):{}}))});return}if(r.length===0){I("No graphics yet"),h(),k(`Make one with \`gamestage graphic create ${o.id} --template bigscreen --consent\`.`),h();return}I(`${r.length} graphic${r.length===1?"":"s"}`);for(let n of r){if(h(),A("Template",`${n.template} (${n.type})`),A("Id",n.instanceId),o.playgroundUrl)for(let[a,i]of Object.entries(U_(o.playgroundUrl,n)))A(a,i);A("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}h(),k(`Take one down with \`gamestage graphic remove ${o.id} <id>\`.`),h()}catch(t){await pe(t)}}async function $R(e,t){try{let{client:o}=await be(),r=await o.removeGraphic(e,t);if(SR(r,"graphic remove"))return;if(C()){L({ok:!0,game:r.game.id,removed:t});return}I("Taken down"),A("Game",`${r.game.name} (${r.game.id})`),A("Removed",t),h(),k("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),h()}catch(o){await pe(o)}}function AR(){if(C()){L({ok:!0,default:ri,templates:kc.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}I("Graphic templates");for(let e of kc)h(),A(e.id,e.id===ri?`${e.summary} (the default)`:e.summary),A("",e.madeFor);h(),k("Pick one with `gamestage graphic create <game> --template <id> --consent`."),h()}xe();Ie();Xu();Za();_r();zt();import{readFile as q8}from"node:fs/promises";import{dirname as W8,resolve as H8}from"node:path";async function CR(e,t){let o;try{o=await q8(e,"utf8")}catch{return S(`Cannot read ${e}`)}let r=We(o);if(!r.ok)return C()&&(L({ok:!1,stage:"parse",issues:r.issues}),process.exit(1)),S(yn(e,r.issues),r.issues.map(g=>`${w.cyan(g.path)} ${g.message}`));let n=r.manifest,a=Lt(n),i=null;if(t.level){let g=To.safeParse(t.level.toUpperCase());if(!g.success)return S(`Unknown level "${t.level}". Use L0 through L5.`);i=g.data}let c=i?J$(n,i):null,d=await bn(e),{registered:l,unnamed:u}=Ba(d.settings,d.settings?await no(oo(H8(W8(e)),{symlinks:"skip"}).files):[]),p=[...d.problems,...u.length?[qa(u)]:[]],f=!a.overclaimed&&(c?.ok??!0)&&p.length===0;if(C()&&(L({ok:f,manifest_id:n.app.id,conformance:{claimed:a.claimed,computed:a.computed,overclaimed:a.overclaimed},required_level:i,missing:c?.missing??[],blockers:a.blockers,rules:a.results,settings_file:p.length?{ok:!1,problems:p,...u.length?{unnamed:u}:{}}:d.settings?{ok:!0,keys:l}:null}),process.exit(f?0:1)),I(`${n.app.title} ${w.dim(n.app.id)}`),A("Schema",n.manifest.schema_version),A("Revision",String(n.manifest.revision)),A("Conformance",a.overclaimed?`${w.red(a.claimed)} claimed, ${w.bold(a.computed)} evidenced`:`${w.green(a.computed)} ${a.computedName}`),a.overclaimed){I("Overclaimed"),h(w.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let g of a.blockers)k(w.red(g.requirement))}if(i&&c&&!c.ok){I(`Not yet ${i}`);for(let g of c.missing)k(`${w.yellow(g.id)} ${g.requirement}`)}if(p.length){I("gamestage.settings.json");for(let g of p)k(w.red(g))}else d.settings&&A("Studio fields",`${l.length} filled from gamestage.settings.json on deploy`);if(f&&(h(),h(` ${w.green("Valid")}${i?` at ${i}`:""}.`),h(w.dim(" A manifest holds no round: real rounds live in Studio, and practice/round.yaml")),h(w.dim(" holds a practice one for `gamestage dev`.")),n.backend.arcade&&(h(w.dim(" Arcade limits here are what `gamestage dev` and `gamestage verify` check. A deploy sends them,")),h(w.dim(` and if fans have played the live edition, they take effect when it ends. \`gamestage status ${n.app.id}\` says which are in force.`))),a.blockers.length)){h(),h(w.dim(" Next level needs:"));for(let g of a.blockers)h(` ${w.dim("\xB7")} ${g.requirement}`)}h(),process.exit(f?0:1)}rt();Ie();var OR={"waiting-for-dns":"waiting for its DNS records","issuing-certificate":"records found, certificate being issued",live:"live","not-pointing":"no longer pointing at Gamestage",failed:"failed"},Y8=e=>new Promise(t=>setTimeout(t,e));function PR(e){if(!e)return"";let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/6e4));if(t<1)return"just now";if(t<60)return`${t} minute${t===1?"":"s"} ago`;let o=Math.round(t/60);return o<48?`${o} hour${o===1?"":"s"} ago`:`${Math.round(o/24)} days ago`}function RR(e,t){return t.refused?(process.exitCode=1,C()?L({ok:!1,game:e,code:t.code,reason:t.refused,...t}):h(t.refused),!0):!1}function NR(e){let t=e.domain,o=t.hostname.split(".").slice(-2).join(".");h(`Create the records shown where you manage DNS for ${o}:`);for(let r of t.records??[t.record])h(` ${r.type} ${r.host||r.name} -> ${r.value}`),h(w.dim(` (Some DNS hosts want the full name, ${r.name}.)`));t.verificationToken&&h("Keep the TXT record in place after the domain is live. Any new claim needs its own TXT value.")}function IR(e,t){let o=t.domain;if(!o){h(`${e} has no custom domain. It is at https://${e}.apps.gamestage.ai`),t.allowance===0?h("Custom domains come with the Publisher plan."):t.elsewhere?h(`Your plan's custom domain is on ${t.elsewhere.gameId} (${t.elsewhere.hostname}).`):h(`Add one with \`gamestage domain add ${e} quiz.myclub.com\`.`);return}let r=o.status==="live"?`since ${o.liveAt?.slice(0,10)}`:`(${o.lastSeen??"not checked yet"}, ${PR(o.lastCheckedAt)||"not checked yet"})`;h(`${o.hostname} ${OR[o.status]??o.status} ${r}`),o.reason&&h(o.reason),o.status==="live"&&h(`Open: ${o.url}`),(o.status==="waiting-for-dns"||o.status==="not-pointing")&&(h(),NR(t))}async function LR(e,t,o){try{let{client:r}=await be(),n=await r.addDomain(e,t,{move:o.move??!1});if(RR(e,n))return;if(C()){L({ok:!0,game:e,...n});return}let a=n.domain;h(`Added ${a.hostname} to ${e}.`),NR(n),h(`Then run: gamestage domain status ${e} --watch`)}catch(r){await pe(r)}}async function zR(e,t){try{let{client:o}=await be(),r=await o.getDomain(e);if(r.domain&&r.domain.status!=="failed"&&(r=await o.checkDomain(e)),!t.watch||!r.domain){let i=r.domain?.status==="failed";i&&(process.exitCode=1),C()?L({ok:!i,game:e,...r}):IR(e,r);return}let n="";for(;;){let i=`${r.domain.status} ${r.domain.lastSeen??""}`;if(i!==n&&!C()&&(IR(e,r),h()),n=i,r.domain.status==="live"||r.domain.status==="failed"||(await Y8(15e3),r=await o.checkDomain(e),!r.domain))break}let a=r.domain?.status==="failed";a&&(process.exitCode=1),C()&&L({ok:!a,game:e,...r})}catch(o){await pe(o)}}async function jR(e){try{let{client:t}=await be(),o=await t.getDomain(e),r=await t.removeDomain(e);if(RR(e,r))return;if(C()){L({ok:!0,game:e,removed:o.domain?.hostname??null,...r});return}h(`Removed ${o.domain?.hostname}. The game is still at https://${e}.apps.gamestage.ai`)}catch(t){await pe(t)}}async function DR(){try{let{admin:e}=await Xt(),t=await e.listDomains();if(C()){L({ok:!0,domains:t});return}if(!t.length){h("No custom domains yet.");return}I(`${t.length} custom domain${t.length===1?"":"s"}`);for(let o of t)h(),A(o.hostname,`${OR[o.status]??o.status}, ${PR(o.statusSince)}`),k(`${o.gameId} in ${o.workspaceId}${o.ownerEmail?` (${o.ownerEmail})`:""}`),o.lastSeen&&k(`DNS: ${o.lastSeen}`),o.reason&&k(o.reason);h()}catch(e){await pe(e)}}xe();hn();zt();rt();Ie();import{spawn as V8}from"node:child_process";import{mkdtemp as K8,readFile as _c,rm as Z8,writeFile as FR}from"node:fs/promises";import{tmpdir as J8}from"node:os";import{join as ai,resolve as ii}from"node:path";import{createInterface as X8}from"node:readline/promises";var UR="0.2.0";function xc(e,t){let o=process.env.GAMESTAGE_UI_RUNNER,[r,n]=o?[process.execPath,[o,...e]]:[process.platform==="win32"?"npx.cmd":"npx",["--yes",`gamestage-ui@${UR}`,...e]];return new Promise((a,i)=>{let c=V8(r,n,{cwd:t.cwd,env:t.env??process.env,stdio:t.inherit?"inherit":["ignore","pipe","pipe"]}),d="",l="";c.stdout?.on("data",u=>d+=u),c.stderr?.on("data",u=>l+=u),c.on("error",i),c.on("close",u=>a({code:u??1,stdout:d,stderr:l}))})}function Lm(e,t){let o=(t.stderr||t.stdout).trim().split(`
20442
- `).slice(-8);S(`gamestage-ui could not ${e}.`,[...o,`It ran gamestage-ui@${UR}. Check you are online the first time, so npx can fetch it.`])}function Q8(e){try{return Cw.parse(JSON.parse(e.stdout))}catch{Lm("check the theme",e)}}async function q_(e){let t=ai(e,"theme.json"),o;try{o=await _c(t,"utf8")}catch{S(`There is no theme.json in ${e}.`,["Run `gamestage theme init <name>` to start one, or pass the theme's folder."])}let r;try{r=JSON.parse(o)}catch(i){S(`${t} is not JSON: ${i.message}`)}let n={...r,fonts:(r.fonts??[]).map(i=>({licence:GR,...i}))},a=Aw.safeParse(n);return a.success||S(`${t} is not a theme Gamestage can read.`,a.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`)),{theme:a.data,raw:r}}var GR={declaredBy:"pending",declaredAt:"pending-declaration",statement:"pending declaration"},MR=e=>e.licence.declaredBy===GR.declaredBy;function G_(e){let t=e.src;try{t=new URL(e.src).host}catch{}return`We have the right to use the font ${e.family} in web games made with Gamestage, and it is served from ${t}, which we run or are licensed to use. Gamestage does not host it and does not check the licence.`}function B_(e){if(e.errors.length){I(`${e.errors.length} problem${e.errors.length===1?"":"s"} to fix`);for(let t of e.errors)k(`${t.token?`${t.token}: `:""}${t.message}`)}if(e.warnings.length){I(`${e.warnings.length} warning${e.warnings.length===1?"":"s"}`);for(let t of e.warnings)k(`${t.token?`${t.token}: `:""}${t.message}`)}}async function BR(e){let t=await xc(["theme","check",e,"--json"],{cwd:process.cwd()});return Q8(t)}async function qR(e,t){try{let o=ii(t.dir??`${e}-theme`),r=await xc(["theme","init",e,"--dir",o],{cwd:process.cwd()});if(r.code!==0&&Lm("start the theme",r),C()){L({ok:!0,name:e,dir:o});return}h(`Started ${e} in ${o}.`),h("Fill tokens.json from the client's Figma variables and styles, add their fonts to theme.json, then:"),h(` gamestage theme preview ${o}`),h(` gamestage theme check ${o}`)}catch(o){pe(o)}}async function WR(e){try{let t=ii(e??".");await q_(t);let o=await BR(t);C()?L({...o,dir:t}):(h(o.ok?"The theme passes. It can be published.":"The theme cannot be published yet."),B_(o),o.ok&&h(`Next: gamestage theme publish ${t}`)),o.ok||(process.exitCode=1)}catch(t){pe(t)}}async function HR(e,t){try{let o=ii(e??".");await q_(o);let r=["theme","preview",o,...t.port?["--port",t.port]:[]],n=await xc(r,{cwd:process.cwd(),inherit:!0});n.code!==0&&(process.exitCode=n.code)}catch(o){pe(o)}}async function eq(e,t,o){let r=e.filter(MR);if(!r.length)return e;let n=new Date().toISOString(),a=process.stdin.isTTY===!0&&!C();if(!o.declareFonts&&!a){process.exitCode=1;let d=r.map(l=>l.family);if(C())throw L({ok:!1,code:"font_licence_undeclared",reason:`Each font needs a licence declaration before the theme is published: ${d.join(", ")}.`,fonts:r.map(l=>({family:l.family,src:l.src,statement:G_(l)})),next:"Read each statement with the client. If they agree, run the publish again with --declare-fonts."}),new Nm;S(`Each font needs a licence declaration before the theme is published: ${d.join(", ")}.`,[...r.map(l=>G_(l)),"If the client agrees to each statement, run the publish again with --declare-fonts."])}let i=[],c=a&&!o.declareFonts?X8({input:process.stdin,output:process.stdout}):void 0;try{for(let d of e){if(!MR(d)){i.push(d);continue}let l=G_(d);if(c){h(l);let u=(await c.question("Is that true? (y/n) ")).trim().toLowerCase();u!=="y"&&u!=="yes"&&(process.exitCode=1,S(`Not published: ${d.family} has no licence declaration.`,["Use a font the client has the right to use on the web, or remove it from theme.json."]))}i.push({...d,licence:{declaredBy:t,declaredAt:n,statement:l}})}}finally{c?.close()}return i}var Nm=class extends Error{};async function YR(e,t){let o;try{let r=ii(e??"."),{theme:n,raw:a}=await q_(r),{client:i,email:c}=await be(),d=await BR(r);if(!d.ok){if(process.exitCode=1,C()){L({...d,ok:!1,code:"check_failed",reason:"The theme fails an accessibility check, so it cannot be published."});return}h("Not published. The theme fails an accessibility check, and a theme that fails one cannot be published."),B_(d),h(`Fix each problem in ${r}, then run: gamestage theme check ${r}`);return}let l=n.fonts.map(R=>({font:R,problem:$w(R.src)})).filter(R=>!!R.problem);if(l.length){if(process.exitCode=1,C()){L({ok:!1,code:"font_host",fonts:l.map(({font:R,problem:F})=>({family:R.family,src:R.src,reason:F})),reason:"A font in theme.json cannot be loaded by a game."});return}h("Not published. A font in theme.json cannot be loaded by a game:");for(let{font:R,problem:F}of l)h(` ${R.family}: ${F}`);h(`Change its src in ${r}/theme.json, then publish again.`);return}let u;try{u=await eq(n.fonts,c,t)}catch(R){if(R instanceof Nm)return;throw R}o=await K8(ai(J8(),"gamestage-theme-"));let p=await xc(["theme","build",r,"--out",o],{cwd:process.cwd()});p.code!==0&&Lm("build the theme",p);let f=await _c(ai(o,`theme-${n.name}.css`),"utf8"),g=JSON.parse(await _c(ai(r,"tokens.json"),"utf8")),b=await _c(ai(r,"overrides.css"),"utf8").catch(()=>{}),v=await i.publishDesignSystem(n.name,{version:n.version,theme:{...n,fonts:u},tokens:g,...b?.trim()?{overridesCss:b}:{},css:f,check:d});u.some((R,F)=>R!==n.fonts[F])&&await FR(ai(r,"theme.json"),`${JSON.stringify({...a,fonts:u},null,2)}
20443
- `,"utf8");let x=`${v.name}@${v.version}`;if(C()){L({ok:!0,...v,ref:x,warnings:d.warnings,next:`gamestage theme use ${x}`});return}h(`Published ${x}. Only your org can see it.`),d.warnings.length&&B_({...d,errors:[]}),h(`In a game's folder, run: gamestage theme use ${x}`)}catch(r){pe(r)}finally{o&&await Z8(o,{recursive:!0,force:!0})}}function tq(e){if(!e.length){h("Your org has no themes yet. Start one with: gamestage theme init <name>");return}I(`${e.length} theme${e.length===1?"":"s"}`);for(let t of e){h(),A(t.name,`latest ${t.latest}`);for(let o of t.versions)k(`${o.version} published by ${o.publishedBy}, ${o.publishedAt.slice(0,10)}${o.warnings?`, ${o.warnings} warning${o.warnings===1?"":"s"}`:""}`)}h(),h(w.dim("Pin one in a game with: gamestage theme use <name>@<version>"))}async function VR(){try{let{client:e}=await be(),t=await e.listDesignSystems();C()?L({ok:!0,designSystems:t}):tq(t)}catch(e){pe(e)}}function nq(e,t){let o=e.split(`
20441
+ `)),await new Promise(i=>{let c=()=>{process.off("SIGINT",c),process.off("SIGTERM",c),r.close(()=>i())};process.once("SIGINT",c),process.once("SIGTERM",c)})}function q8(e,t){let o=new URL(e),r=o.pathname.split("/");return r.pop(),o.pathname=[...r,t.replace(/^\.?\//,"")].join("/"),o.toString()}async function xR(e,t){let o=(r,n,a,i={},c={})=>{if(process.exitCode=1,C()){L({ok:!1,reason:r,game:e,stylesheet:t.css,...c});return}I(n);for(let[d,l]of Object.entries(i))A(d,l);h();for(let d of a)k(d);h()};try{let r;try{r=await kR(t.css,"utf8")}catch{o("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(r.length>Yo){o("stylesheet_too_long","The stylesheet is too long for a graphic",[`Live Graphics stores a graphic's stylesheet in a ${Yo.toLocaleString()}-character field and refuses anything longer.`,`Minify it, or cut ${(r.length-Yo).toLocaleString()} characters. A skin that cannot fit wants to be a graphic type rather than a stylesheet.`],{Length:`${r.length.toLocaleString()} characters`,Limit:`${Yo.toLocaleString()} characters`},{characters:r.length,limit:Yo});return}let{client:n}=await be(),a=await n.getGame(e);if(!a){o("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!a.playgroundUrl){o("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 ${a.id} --dir .\` first. It publishes ${t.css} along with everything else.`],{Game:`${a.name} (${a.id})`});return}let i=q8(a.playgroundUrl,t.css),c=!1,d=0;try{let l=await fetch(i);d=l.status,c=l.ok}catch{c=!1}if(!c){o("not_served","The stylesheet is not being served yet",[`Deploy the game and this address starts working: \`gamestage deploy ${a.id} --dir .\``,`A deploy publishes every file in the directory it is given, so ${t.css} has to be inside it.`],{"Expected at":i,Answered:d?String(d):"nothing"},{url:i,status:d,characters:r.length,limit:Yo});return}if(C()){L({ok:!0,game:a.id,stylesheet:t.css,characters:r.length,limit:Yo,url:i});return}I("Ready for a producer"),A("Game",`${a.name} (${a.id})`),A("Stylesheet",`${t.css} (${r.length.toLocaleString()} of ${Yo.toLocaleString()} characters)`),A("Address",i),h(),k("Give that address to whoever composes the graphic in Studio. Nothing here writes to a graphic, and your game holds no Live Graphics credential."),k("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."),h()}catch(r){await pe(r)}}function U_(e,t){let r=`${new URL(e).origin}/r/embed.html?slug=${encodeURIComponent(t.embedSlug)}`;if(t.type==="qr")return{Address:r};let n=Pm(t.template)?.attributes?.rowsPerScreen,a=n?`${r}&rows=${n}`:r;return t.template==="bigscreen"?{Address:`${r}&bigscreen=true`,"Overlay form":a}:{Address:a}}function SR(e,t){return e.refused?(process.exitCode=1,C()?(L({ok:!1,action:t,reason:e.code??"refused",message:e.refused}),!0):(I("Not done"),h(` ${e.refused}`),h(),!0)):!1}async function TR(e,t){let o=(n,a,i)=>{if(process.exitCode=1,C()){L({ok:!1,reason:n,game:e,template:t.template});return}I(a),h();for(let c of i)k(c);h()},r=Pm(t.template);if(!r){o("no_such_template",`No template called ${t.template}`,[`The templates are: ${wR().join(", ")}.`,"`gamestage graphic templates` lists what each one is cut for."]);return}if(!t.consent){o("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 ${r.id} --consent\`.`,"Your account is recorded on the graphic as the one who confirmed it."]);return}try{let{client:n}=await be(),a=await n.getGame(e);if(!a){o("no_such_game","No such game",[`Nothing in your workspace has the id ${e}.`]);return}if(!a.playgroundUrl){o("not_deployed","This game has not been deployed",[r.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 ${a.id} --dir .\` first.`]);return}let i=await n.composeGraphic(a.id,{template:r.id,consent:!0});if(SR(i,"graphic create"))return;let c=(i.game.graphics??[]).at(-1);if(!c){o("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 ${a.id}\` before making another one.`]);return}let d=U_(a.playgroundUrl,c);if(C()){L({ok:!0,game:a.id,graphic:c,addresses:d});return}I("On screen"),A("Game",`${a.name} (${a.id})`),A("Template",`${r.id} - ${r.summary}`),A("Made for",r.madeFor);for(let[l,u]of Object.entries(d))A(l,u);h(),k("Open that address on the screen. It is a web page and needs no sign-in."),k(r.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."),k(`Restyle it with \`gamestage graphic dev\`, then \`gamestage graphic push ${a.id}\`.`),h()}catch(n){if(n.code==="graphics_not_configured"){o("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}await pe(n)}}async function ER(e){try{let{client:t}=await be(),o=await t.getGame(e);if(!o){process.exitCode=1,C()?L({ok:!1,reason:"no_such_game",game:e}):(I("No such game"),h(),k(`Nothing in your workspace has the id ${e}.`),h());return}let r=o.graphics??[];if(C()){L({ok:!0,game:o.id,graphics:r.map(n=>({...n,addresses:o.playgroundUrl?U_(o.playgroundUrl,n):{}}))});return}if(r.length===0){I("No graphics yet"),h(),k(`Make one with \`gamestage graphic create ${o.id} --template bigscreen --consent\`.`),h();return}I(`${r.length} graphic${r.length===1?"":"s"}`);for(let n of r){if(h(),A("Template",`${n.template} (${n.type})`),A("Id",n.instanceId),o.playgroundUrl)for(let[a,i]of Object.entries(U_(o.playgroundUrl,n)))A(a,i);A("Confirmed by",`${n.consentBy}, ${n.createdAt.slice(0,10)}`)}h(),k(`Take one down with \`gamestage graphic remove ${o.id} <id>\`.`),h()}catch(t){await pe(t)}}async function $R(e,t){try{let{client:o}=await be(),r=await o.removeGraphic(e,t);if(SR(r,"graphic remove"))return;if(C()){L({ok:!0,game:r.game.id,removed:t});return}I("Taken down"),A("Game",`${r.game.name} (${r.game.id})`),A("Removed",t),h(),k("The address stops answering. Anything showing it goes blank, so take the screen down first if somebody is watching."),h()}catch(o){await pe(o)}}function AR(){if(C()){L({ok:!0,default:ri,templates:kc.map(e=>({id:e.id,type:e.type,summary:e.summary,madeFor:e.madeFor}))});return}I("Graphic templates");for(let e of kc)h(),A(e.id,e.id===ri?`${e.summary} (the default)`:e.summary),A("",e.madeFor);h(),k("Pick one with `gamestage graphic create <game> --template <id> --consent`."),h()}xe();Ie();Xu();Za();_r();zt();import{readFile as W8}from"node:fs/promises";import{dirname as H8,resolve as Y8}from"node:path";async function CR(e,t){let o;try{o=await W8(e,"utf8")}catch{return S(`Cannot read ${e}`)}let r=We(o);if(!r.ok)return C()&&(L({ok:!1,stage:"parse",issues:r.issues}),process.exit(1)),S(yn(e,r.issues),r.issues.map(g=>`${w.cyan(g.path)} ${g.message}`));let n=r.manifest,a=Lt(n),i=null;if(t.level){let g=To.safeParse(t.level.toUpperCase());if(!g.success)return S(`Unknown level "${t.level}". Use L0 through L5.`);i=g.data}let c=i?J$(n,i):null,d=await bn(e),{registered:l,unnamed:u}=Ba(d.settings,d.settings?await no(oo(Y8(H8(e)),{symlinks:"skip"}).files):[]),p=[...d.problems,...u.length?[qa(u)]:[]],f=!a.overclaimed&&(c?.ok??!0)&&p.length===0;if(C()&&(L({ok:f,manifest_id:n.app.id,conformance:{claimed:a.claimed,computed:a.computed,overclaimed:a.overclaimed},required_level:i,missing:c?.missing??[],blockers:a.blockers,rules:a.results,settings_file:p.length?{ok:!1,problems:p,...u.length?{unnamed:u}:{}}:d.settings?{ok:!0,keys:l}:null}),process.exit(f?0:1)),I(`${n.app.title} ${w.dim(n.app.id)}`),A("Schema",n.manifest.schema_version),A("Revision",String(n.manifest.revision)),A("Conformance",a.overclaimed?`${w.red(a.claimed)} claimed, ${w.bold(a.computed)} evidenced`:`${w.green(a.computed)} ${a.computedName}`),a.overclaimed){I("Overclaimed"),h(w.dim(" The manifest claims a level its evidence does not support. Lower the claim or supply the evidence."));for(let g of a.blockers)k(w.red(g.requirement))}if(i&&c&&!c.ok){I(`Not yet ${i}`);for(let g of c.missing)k(`${w.yellow(g.id)} ${g.requirement}`)}if(p.length){I("gamestage.settings.json");for(let g of p)k(w.red(g))}else d.settings&&A("Studio fields",`${l.length} filled from gamestage.settings.json on deploy`);if(f&&(h(),h(` ${w.green("Valid")}${i?` at ${i}`:""}.`),h(w.dim(" A manifest holds no round: real rounds live in Studio, and practice/round.yaml")),h(w.dim(" holds a practice one for `gamestage dev`.")),n.backend.arcade&&(h(w.dim(" Arcade limits here are what `gamestage dev` and `gamestage verify` check. A deploy sends them,")),h(w.dim(` and if fans have played the live edition, they take effect when it ends. \`gamestage status ${n.app.id}\` says which are in force.`))),a.blockers.length)){h(),h(w.dim(" Next level needs:"));for(let g of a.blockers)h(` ${w.dim("\xB7")} ${g.requirement}`)}h(),process.exit(f?0:1)}rt();Ie();var OR={"waiting-for-dns":"waiting for its DNS records","issuing-certificate":"records found, certificate being issued",live:"live","not-pointing":"no longer pointing at Gamestage",failed:"failed"},V8=e=>new Promise(t=>setTimeout(t,e));function PR(e){if(!e)return"";let t=Math.max(0,Math.round((Date.now()-Date.parse(e))/6e4));if(t<1)return"just now";if(t<60)return`${t} minute${t===1?"":"s"} ago`;let o=Math.round(t/60);return o<48?`${o} hour${o===1?"":"s"} ago`:`${Math.round(o/24)} days ago`}function RR(e,t){return t.refused?(process.exitCode=1,C()?L({ok:!1,game:e,code:t.code,reason:t.refused,...t}):h(t.refused),!0):!1}function NR(e){let t=e.domain,o=t.hostname.split(".").slice(-2).join(".");h(`Create the records shown where you manage DNS for ${o}:`);for(let r of t.records??[t.record])h(` ${r.type} ${r.host||r.name} -> ${r.value}`),h(w.dim(` (Some DNS hosts want the full name, ${r.name}.)`));t.verificationToken&&h("Keep the TXT record in place after the domain is live. Any new claim needs its own TXT value.")}function IR(e,t){let o=t.domain;if(!o){h(`${e} has no custom domain. It is at https://${e}.apps.gamestage.ai`),t.allowance===0?h("Custom domains come with the Publisher plan."):t.elsewhere?h(`Your plan's custom domain is on ${t.elsewhere.gameId} (${t.elsewhere.hostname}).`):h(`Add one with \`gamestage domain add ${e} quiz.myclub.com\`.`);return}let r=o.status==="live"?`since ${o.liveAt?.slice(0,10)}`:`(${o.lastSeen??"not checked yet"}, ${PR(o.lastCheckedAt)||"not checked yet"})`;h(`${o.hostname} ${OR[o.status]??o.status} ${r}`),o.reason&&h(o.reason),o.status==="live"&&h(`Open: ${o.url}`),(o.status==="waiting-for-dns"||o.status==="not-pointing")&&(h(),NR(t))}async function LR(e,t,o){try{let{client:r}=await be(),n=await r.addDomain(e,t,{move:o.move??!1});if(RR(e,n))return;if(C()){L({ok:!0,game:e,...n});return}let a=n.domain;h(`Added ${a.hostname} to ${e}.`),NR(n),h(`Then run: gamestage domain status ${e} --watch`)}catch(r){await pe(r)}}async function zR(e,t){try{let{client:o}=await be(),r=await o.getDomain(e);if(r.domain&&r.domain.status!=="failed"&&(r=await o.checkDomain(e)),!t.watch||!r.domain){let i=r.domain?.status==="failed";i&&(process.exitCode=1),C()?L({ok:!i,game:e,...r}):IR(e,r);return}let n="";for(;;){let i=`${r.domain.status} ${r.domain.lastSeen??""}`;if(i!==n&&!C()&&(IR(e,r),h()),n=i,r.domain.status==="live"||r.domain.status==="failed"||(await V8(15e3),r=await o.checkDomain(e),!r.domain))break}let a=r.domain?.status==="failed";a&&(process.exitCode=1),C()&&L({ok:!a,game:e,...r})}catch(o){await pe(o)}}async function jR(e){try{let{client:t}=await be(),o=await t.getDomain(e),r=await t.removeDomain(e);if(RR(e,r))return;if(C()){L({ok:!0,game:e,removed:o.domain?.hostname??null,...r});return}h(`Removed ${o.domain?.hostname}. The game is still at https://${e}.apps.gamestage.ai`)}catch(t){await pe(t)}}async function DR(){try{let{admin:e}=await Xt(),t=await e.listDomains();if(C()){L({ok:!0,domains:t});return}if(!t.length){h("No custom domains yet.");return}I(`${t.length} custom domain${t.length===1?"":"s"}`);for(let o of t)h(),A(o.hostname,`${OR[o.status]??o.status}, ${PR(o.statusSince)}`),k(`${o.gameId} in ${o.workspaceId}${o.ownerEmail?` (${o.ownerEmail})`:""}`),o.lastSeen&&k(`DNS: ${o.lastSeen}`),o.reason&&k(o.reason);h()}catch(e){await pe(e)}}xe();hn();zt();rt();Ie();import{spawn as K8}from"node:child_process";import{mkdtemp as Z8,readFile as _c,rm as J8,writeFile as FR}from"node:fs/promises";import{tmpdir as X8}from"node:os";import{join as ai,resolve as ii}from"node:path";import{createInterface as Q8}from"node:readline/promises";var UR="0.2.0";function xc(e,t){let o=process.env.GAMESTAGE_UI_RUNNER,[r,n]=o?[process.execPath,[o,...e]]:[process.platform==="win32"?"npx.cmd":"npx",["--yes",`gamestage-ui@${UR}`,...e]];return new Promise((a,i)=>{let c=K8(r,n,{cwd:t.cwd,env:t.env??process.env,stdio:t.inherit?"inherit":["ignore","pipe","pipe"]}),d="",l="";c.stdout?.on("data",u=>d+=u),c.stderr?.on("data",u=>l+=u),c.on("error",i),c.on("close",u=>a({code:u??1,stdout:d,stderr:l}))})}function Lm(e,t){let o=(t.stderr||t.stdout).trim().split(`
20442
+ `).slice(-8);S(`gamestage-ui could not ${e}.`,[...o,`It ran gamestage-ui@${UR}. Check you are online the first time, so npx can fetch it.`])}function eq(e){try{return Cw.parse(JSON.parse(e.stdout))}catch{Lm("check the theme",e)}}async function q_(e){let t=ai(e,"theme.json"),o;try{o=await _c(t,"utf8")}catch{S(`There is no theme.json in ${e}.`,["Run `gamestage theme init <name>` to start one, or pass the theme's folder."])}let r;try{r=JSON.parse(o)}catch(i){S(`${t} is not JSON: ${i.message}`)}let n={...r,fonts:(r.fonts??[]).map(i=>({licence:GR,...i}))},a=Aw.safeParse(n);return a.success||S(`${t} is not a theme Gamestage can read.`,a.error.issues.map(i=>`${i.path.join(".")}: ${i.message}`)),{theme:a.data,raw:r}}var GR={declaredBy:"pending",declaredAt:"pending-declaration",statement:"pending declaration"},MR=e=>e.licence.declaredBy===GR.declaredBy;function G_(e){let t=e.src;try{t=new URL(e.src).host}catch{}return`We have the right to use the font ${e.family} in web games made with Gamestage, and it is served from ${t}, which we run or are licensed to use. Gamestage does not host it and does not check the licence.`}function B_(e){if(e.errors.length){I(`${e.errors.length} problem${e.errors.length===1?"":"s"} to fix`);for(let t of e.errors)k(`${t.token?`${t.token}: `:""}${t.message}`)}if(e.warnings.length){I(`${e.warnings.length} warning${e.warnings.length===1?"":"s"}`);for(let t of e.warnings)k(`${t.token?`${t.token}: `:""}${t.message}`)}}async function BR(e){let t=await xc(["theme","check",e,"--json"],{cwd:process.cwd()});return eq(t)}async function qR(e,t){try{let o=ii(t.dir??`${e}-theme`),r=await xc(["theme","init",e,"--dir",o],{cwd:process.cwd()});if(r.code!==0&&Lm("start the theme",r),C()){L({ok:!0,name:e,dir:o});return}h(`Started ${e} in ${o}.`),h("Fill tokens.json from the client's Figma variables and styles, add their fonts to theme.json, then:"),h(` gamestage theme preview ${o}`),h(` gamestage theme check ${o}`)}catch(o){pe(o)}}async function WR(e){try{let t=ii(e??".");await q_(t);let o=await BR(t);C()?L({...o,dir:t}):(h(o.ok?"The theme passes. It can be published.":"The theme cannot be published yet."),B_(o),o.ok&&h(`Next: gamestage theme publish ${t}`)),o.ok||(process.exitCode=1)}catch(t){pe(t)}}async function HR(e,t){try{let o=ii(e??".");await q_(o);let r=["theme","preview",o,...t.port?["--port",t.port]:[]],n=await xc(r,{cwd:process.cwd(),inherit:!0});n.code!==0&&(process.exitCode=n.code)}catch(o){pe(o)}}async function tq(e,t,o){let r=e.filter(MR);if(!r.length)return e;let n=new Date().toISOString(),a=process.stdin.isTTY===!0&&!C();if(!o.declareFonts&&!a){process.exitCode=1;let d=r.map(l=>l.family);if(C())throw L({ok:!1,code:"font_licence_undeclared",reason:`Each font needs a licence declaration before the theme is published: ${d.join(", ")}.`,fonts:r.map(l=>({family:l.family,src:l.src,statement:G_(l)})),next:"Read each statement with the client. If they agree, run the publish again with --declare-fonts."}),new Nm;S(`Each font needs a licence declaration before the theme is published: ${d.join(", ")}.`,[...r.map(l=>G_(l)),"If the client agrees to each statement, run the publish again with --declare-fonts."])}let i=[],c=a&&!o.declareFonts?Q8({input:process.stdin,output:process.stdout}):void 0;try{for(let d of e){if(!MR(d)){i.push(d);continue}let l=G_(d);if(c){h(l);let u=(await c.question("Is that true? (y/n) ")).trim().toLowerCase();u!=="y"&&u!=="yes"&&(process.exitCode=1,S(`Not published: ${d.family} has no licence declaration.`,["Use a font the client has the right to use on the web, or remove it from theme.json."]))}i.push({...d,licence:{declaredBy:t,declaredAt:n,statement:l}})}}finally{c?.close()}return i}var Nm=class extends Error{};async function YR(e,t){let o;try{let r=ii(e??"."),{theme:n,raw:a}=await q_(r),{client:i,email:c}=await be(),d=await BR(r);if(!d.ok){if(process.exitCode=1,C()){L({...d,ok:!1,code:"check_failed",reason:"The theme fails an accessibility check, so it cannot be published."});return}h("Not published. The theme fails an accessibility check, and a theme that fails one cannot be published."),B_(d),h(`Fix each problem in ${r}, then run: gamestage theme check ${r}`);return}let l=n.fonts.map(R=>({font:R,problem:$w(R.src)})).filter(R=>!!R.problem);if(l.length){if(process.exitCode=1,C()){L({ok:!1,code:"font_host",fonts:l.map(({font:R,problem:F})=>({family:R.family,src:R.src,reason:F})),reason:"A font in theme.json cannot be loaded by a game."});return}h("Not published. A font in theme.json cannot be loaded by a game:");for(let{font:R,problem:F}of l)h(` ${R.family}: ${F}`);h(`Change its src in ${r}/theme.json, then publish again.`);return}let u;try{u=await tq(n.fonts,c,t)}catch(R){if(R instanceof Nm)return;throw R}o=await Z8(ai(X8(),"gamestage-theme-"));let p=await xc(["theme","build",r,"--out",o],{cwd:process.cwd()});p.code!==0&&Lm("build the theme",p);let f=await _c(ai(o,`theme-${n.name}.css`),"utf8"),g=JSON.parse(await _c(ai(r,"tokens.json"),"utf8")),b=await _c(ai(r,"overrides.css"),"utf8").catch(()=>{}),v=await i.publishDesignSystem(n.name,{version:n.version,theme:{...n,fonts:u},tokens:g,...b?.trim()?{overridesCss:b}:{},css:f,check:d});u.some((R,F)=>R!==n.fonts[F])&&await FR(ai(r,"theme.json"),`${JSON.stringify({...a,fonts:u},null,2)}
20443
+ `,"utf8");let x=`${v.name}@${v.version}`;if(C()){L({ok:!0,...v,ref:x,warnings:d.warnings,next:`gamestage theme use ${x}`});return}h(`Published ${x}. Only your org can see it.`),d.warnings.length&&B_({...d,errors:[]}),h(`In a game's folder, run: gamestage theme use ${x}`)}catch(r){pe(r)}finally{o&&await J8(o,{recursive:!0,force:!0})}}function nq(e){if(!e.length){h("Your org has no themes yet. Start one with: gamestage theme init <name>");return}I(`${e.length} theme${e.length===1?"":"s"}`);for(let t of e){h(),A(t.name,`latest ${t.latest}`);for(let o of t.versions)k(`${o.version} published by ${o.publishedBy}, ${o.publishedAt.slice(0,10)}${o.warnings?`, ${o.warnings} warning${o.warnings===1?"":"s"}`:""}`)}h(),h(w.dim("Pin one in a game with: gamestage theme use <name>@<version>"))}async function VR(){try{let{client:e}=await be(),t=await e.listDesignSystems();C()?L({ok:!0,designSystems:t}):nq(t)}catch(e){pe(e)}}function oq(e,t){let o=e.split(`
20444
20444
  `),r=g=>o.findIndex(b=>new RegExp(`^${g}:\\s*(#.*)?$`).test(b)),n=(g,b)=>{let v=g+1;for(;v<o.length&&(o[v].trim()===""||o[v].trim().startsWith("#")||o[v].search(/\S/)>b);)v++;for(;v>g+1&&o[v-1].trim()==="";)v--;return v},a=(g,b,v)=>{for(let x=g+1;x<b;x++){let R=/^(\s+)\S/.exec(o[x]);if(R&&!o[x].trim().startsWith("#"))return R[1]}return v},i=r("experience");if(i<0)return{ok:!0,text:`${e.replace(/\n*$/,`
20445
20445
  `)}experience:
20446
20446
  design:
20447
20447
  system: ${t}
20448
20448
  `};let c=n(i,0),d=a(i,c," "),l=o.findIndex((g,b)=>b>i&&b<c&&new RegExp(`^${d}design:\\s*(#.*)?$`).test(g));if(l<0)return o.splice(c,0,`${d}design:`,`${d}${d}system: ${t}`),{ok:!0,text:o.join(`
20449
20449
  `)};let u=n(l,d.length),p=a(l,u,d+d),f=o.findIndex((g,b)=>b>l&&b<u&&new RegExp(`^${p}system:`).test(g));return f>=0?o[f]=`${p}system: ${t}`:o.splice(u,0,`${p}system: ${t}`),{ok:!0,text:o.join(`
20450
- `)}}async function KR(e,t){try{let o=ya(e);o.ok||S(o.reason);let r=ii(t.manifest??"gamestage.yaml"),n;try{n=await _c(r,"utf8")}catch{S(`There is no ${r}.`,["Run this in the game's folder, or pass --manifest <path>."])}let{client:a}=await be();if(!(await a.listDesignSystems()).find(b=>b.name===o.name)?.versions.some(b=>b.version===o.version)){process.exitCode=1;let b=`${e} is not one of your org's themes.`,v="Run gamestage theme list to see what your org has, or publish it with gamestage theme publish.";C()?L({ok:!1,code:"unknown_theme",reason:b,next:v}):S(b,[v]);return}let d=nq(n,e);d.ok||S(d.reason);let l=We(d.text);l.ok||S("Pinning the theme would leave gamestage.yaml unreadable, so it was not changed.",[...l.issues.map(b=>`${b.path}: ${b.message}`),`Add it by hand under experience.design as system: ${e}`]);let u=await Ke(),p=`${Re.replace(/\/$/,"")}/v1/design-systems/registry/r`,f=await xc(["add",`theme-${o.name}@${o.version}`,"--registry",p],{cwd:ii(r,".."),env:{...process.env,GAMESTAGE_REGISTRY_TOKEN:u?.accessToken??""}});f.code!==0&&Lm(`install ${e}`,f),await FR(r,d.text,"utf8");let g=`Set data-gs-theme="${o.name}" on <html> in index.html, and import app/gamestage-theme-${o.name}.css after app/gamestage-tokens.css.`;if(C()){L({ok:!0,ref:e,manifest:r,installed:`app/gamestage-theme-${o.name}.css`,next:g});return}h(`Installed ${e} and pinned it in gamestage.yaml.`),h(g),h("Then run: gamestage verify")}catch(o){pe(o)}}qw();xe();rt();Ie();Za();Ka();import{readFile as W_,stat as oq,writeFile as rq}from"node:fs/promises";import{join as H_,resolve as zm}from"node:path";var Y_="Your organisation has no integration context yet. An organisation admin sets one with `gamestage org context set integration.md`.";function jm(e){return`revision ${e.revision}, set by ${e.setBy} on ${e.setAt.slice(0,10)}`}async function V_(){await Qn();let e=await zn();if(!e)throw new Error("Signed in, but the session could not be read. Run `gamestage login` again.");return e}async function ZR(e){try{let o=await(await V_()).orgContext(),r=e.save===void 0||e.save===!1?void 0:zm(typeof e.save=="string"?e.save:pr);if(!o){C()?L({ok:!0,context:null,message:Y_}):h(Y_);return}if(r&&await rq(r,o.markdown,"utf8"),C()){L({ok:!0,context:o,...r?{saved_to:r}:{}});return}if(r){h(`Saved your organisation's integration context, ${jm(o)}, to ${r}.`);return}aq(o)}catch(t){await pe(t)}}function aq(e){h(w.dim(`Your organisation's integration context, ${jm(e)}.`)),h(),process.stdout.write(e.markdown.endsWith(`
20450
+ `)}}async function KR(e,t){try{let o=ya(e);o.ok||S(o.reason);let r=ii(t.manifest??"gamestage.yaml"),n;try{n=await _c(r,"utf8")}catch{S(`There is no ${r}.`,["Run this in the game's folder, or pass --manifest <path>."])}let{client:a}=await be();if(!(await a.listDesignSystems()).find(b=>b.name===o.name)?.versions.some(b=>b.version===o.version)){process.exitCode=1;let b=`${e} is not one of your org's themes.`,v="Run gamestage theme list to see what your org has, or publish it with gamestage theme publish.";C()?L({ok:!1,code:"unknown_theme",reason:b,next:v}):S(b,[v]);return}let d=oq(n,e);d.ok||S(d.reason);let l=We(d.text);l.ok||S("Pinning the theme would leave gamestage.yaml unreadable, so it was not changed.",[...l.issues.map(b=>`${b.path}: ${b.message}`),`Add it by hand under experience.design as system: ${e}`]);let u=await Ke(),p=`${Re.replace(/\/$/,"")}/v1/design-systems/registry/r`,f=await xc(["add",`theme-${o.name}@${o.version}`,"--registry",p],{cwd:ii(r,".."),env:{...process.env,GAMESTAGE_REGISTRY_TOKEN:u?.accessToken??""}});f.code!==0&&Lm(`install ${e}`,f),await FR(r,d.text,"utf8");let g=`Set data-gs-theme="${o.name}" on <html> in index.html, and import app/gamestage-theme-${o.name}.css after app/gamestage-tokens.css.`;if(C()){L({ok:!0,ref:e,manifest:r,installed:`app/gamestage-theme-${o.name}.css`,next:g});return}h(`Installed ${e} and pinned it in gamestage.yaml.`),h(g),h("Then run: gamestage verify")}catch(o){pe(o)}}qw();xe();rt();Ie();Za();Ka();import{readFile as W_,stat as rq,writeFile as aq}from"node:fs/promises";import{join as H_,resolve as zm}from"node:path";var Y_="Your organisation has no integration context yet. An organisation admin sets one with `gamestage org context set integration.md`.";function jm(e){return`revision ${e.revision}, set by ${e.setBy} on ${e.setAt.slice(0,10)}`}async function V_(){await Qn();let e=await zn();if(!e)throw new Error("Signed in, but the session could not be read. Run `gamestage login` again.");return e}async function ZR(e){try{let o=await(await V_()).orgContext(),r=e.save===void 0||e.save===!1?void 0:zm(typeof e.save=="string"?e.save:pr);if(!o){C()?L({ok:!0,context:null,message:Y_}):h(Y_);return}if(r&&await aq(r,o.markdown,"utf8"),C()){L({ok:!0,context:o,...r?{saved_to:r}:{}});return}if(r){h(`Saved your organisation's integration context, ${jm(o)}, to ${r}.`);return}iq(o)}catch(t){await pe(t)}}function iq(e){h(w.dim(`Your organisation's integration context, ${jm(e)}.`)),h(),process.stdout.write(e.markdown.endsWith(`
20451
20451
  `)?e.markdown:`${e.markdown}
20452
- `)}async function JR(e){let t=zm(e),o;try{o=await W_(t)}catch(i){let c=i.code;return c==="ENOENT"?vn("not_found",`There is no file at ${t}. Write your integration context as Markdown, then run \`gamestage org context set ${e}\`.`):c==="EISDIR"?vn("not_a_file",`${t} is a folder. Name the Markdown file itself, such as ${t}/integration.md.`):vn("unreadable",`Could not read ${t}${c?` (${c})`:""}. Check the path and that you may read the file, then set it again.`)}let r;try{r=new TextDecoder("utf-8",{fatal:!0}).decode(o)}catch{return vn("invalid_context",`${t} is not UTF-8 text. Save it as plain Markdown in UTF-8 and set it again.`)}let n=MA(r);if(n)return vn("invalid_context",`Not set. ${n}`);let a=Ow(r);if(a.length)return vn("secret_found","Not set. The file looks like it contains a secret, and every member of your organisation and every agent they run reads it.",a.map(i=>`Line ${i.line}: ${i.kind}. Take the value out and say where it is kept instead.`),{lines:a});try{let{client:i}=await be(),c=await i.setOrgContext(r);if(C()){L({ok:!0,revision:c});return}h(`Set your organisation's integration context: ${jm(c)}.`),h(w.dim("Every member's agent reads it from now on, and `gamestage create` copies it into each new game's folder."))}catch(i){await pe(i)}}async function XR(){try{let t=await(await V_()).orgContextHistory();if(C()){L({ok:!0,revisions:t});return}if(!t.length){h(Y_);return}I(`${t.length} revision${t.length===1?"":"s"}, newest first`);for(let[o,r]of t.entries())k(`${jm(r)}, ${r.bytes.toLocaleString("en-GB")} bytes${o===0?w.dim(" (in force)"):""}`)}catch(e){await pe(e)}}function vn(e,t,o=[],r={}){if(process.exitCode=1,C()){L({ok:!1,code:e,reason:t,...r});return}h(t);for(let n of o)h(` ${n}`)}var iq="Your organisation has no starter apps yet. An organisation admin publishes one with `gamestage org starter publish <folder>`.";function sq(e){return e===$s?!0:e.includes("/")?!1:e==="package.json"||e==="package-lock.json"||/^README/i.test(e)}function cq(e){let t=oo(e,{symlinks:"throw"}),o=new Map,r=[...t.tooling];for(let n of t.files){let a=Mk(n.relativePath);if(a){r.includes(a)||r.push(a);continue}o.set(n.relativePath,n.path)}for(let n of t.withheld)sq(n)?o.set(n,H_(zm(e),n)):r.push(n);return{files:o,left:r}}async function QR(e){let t=zm(e),o=await oq(t).then(d=>d.isDirectory(),()=>{});if(o===void 0)return vn("not_found",`There is no folder at ${t}. Name the folder that holds your starter app and its ${Ta}.`);if(!o)return vn("not_a_folder",`${t} is a file. Name the folder that holds your starter app, not a file in it.`);let r,n;try{let d=JSON.parse(await W_(H_(t,Ta),"utf8"));typeof d.name=="string"&&(r=d.name),typeof d.version=="string"&&(n=d.version)}catch{}if(!r||!n)return vn("no_starter_manifest",`${H_(t,Ta)} is missing or does not name the starter. Add it with name, version, description and framework, such as {"name": "web-embed", "version": "1.0.0", "description": "Our web embed", "framework": "vanilla"}.`);let a;try{a=cq(t)}catch(d){let l=d instanceof Error?d.message:String(d);return vn("symlink",`Not published. ${l}. A starter may hold no symbolic links: replace each with the file it points to.`)}let i={};for(let[d,l]of[...a.files].sort(([u],[p])=>u.localeCompare(p)))i[d]=new Uint8Array(await W_(l));let c=QA(i,{level:6});try{let{client:d}=await be(),l=await d.startOrgStarterUpload(r,{version:n,bytes:c.length}),u=await fetch(l.uploadUrl,{method:l.method,headers:l.headers,body:c});if(!u.ok)return vn("upload_failed",`The upload was refused with ${u.status}, so nothing was published. Run the same command again; the signed address lasts ${Math.round(l.expiresInSeconds/60)} minutes.`);let p=await d.confirmOrgStarter(r,n);if(C()){L({ok:!0,starter:p,left_out:a.left});return}h(`Published ${p.name}@${p.version} (${p.framework}) for everyone in your organisation. Every check passed.`),A("Files",`${p.files.toLocaleString("en-GB")}, ${(p.bytes/1024).toFixed(0)} KB zipped`),a.left.length&&A("Left out",a.left.join(", ")),h(w.dim(`Every member can now start a game from it with \`gamestage create --starter ${r}\`.`))}catch(d){await pe(d)}}async function eN(){try{let t=await(await V_()).orgStarters();if(C()){L({ok:!0,starters:t});return}if(!t.length){h(iq);return}I(`${t.length} starter app${t.length===1?"":"s"}`);for(let o of t){let r=o.latest;k(`${w.bold(r.name)}@${r.version} ${w.dim(r.framework)}`),h(` ${r.description}`);let n=o.versions.slice(1).map(a=>a.version);h(w.dim(` Published by ${r.publishedBy} on ${r.publishedAt.slice(0,10)}${n.length?`. Older: ${n.join(", ")}`:""}.`)),r.build&&h(w.dim(` Build: ${r.build}, then deploy ${r.out??"the build folder"}.`))}h(),h(w.dim("Start a game from one with `gamestage create --starter <name>`."))}catch(e){await pe(e)}}xe();rt();Ie();var lq="partner products on the result screen of this game, subject to approval by Monterosa and the retail partner and to commercial terms agreed with Monterosa.";function K_(e,t){let o=du(t);h(`${e}: ${o.headline}`),h(o.next),t?.facts&&(h(),h(w.dim(` For: ${t.facts.audience}`)),h(w.dim(` Played on: ${t.facts.wherePlayed}`)),h(w.dim(` Countries: ${t.facts.countries}`)),h(w.dim(` Prize: ${t.facts.prize?"yes":"no"}`)),t.facts.note&&h(w.dim(` Note: ${t.facts.note}`)))}function tN(e,t,o){if(t.refused){if(process.exitCode=1,C()){L({ok:!1,game:e,code:t.code,reason:t.refused,request:t.request});return}h(t.refused),t.request&&(h(),K_(e,t.request));return}if(C()){L({ok:!0,game:e,request:t.request,...du(t.request)});return}o()}function dq(e){let t=[];return e.audience?.trim()||t.push("--audience"),e.where?.trim()||t.push("--where"),e.countries?.trim()||t.push("--countries"),e.prize===void 0&&t.push("--prize or --no-prize"),t}async function nN(e,t){try{let o=dq(t);if(o.length){process.exitCode=2;let a=`gamestage ads request ${e} --audience "Club fans in the UK, mostly adults" --where "the club app and website" --countries "United Kingdom" --no-prize`;if(C()){L({ok:!1,game:e,code:"missing_facts",missing:o,example:a});return}h(`Monterosa and the retail partner need to know about the game. Missing: ${o.join(", ")}.`),h(`For example: ${a}`);return}let{client:r}=await be(),n=await r.requestAds(e,{facts:{audience:t.audience,wherePlayed:t.where,countries:t.countries,prize:t.prize,note:t.note?.trim()||null}});tN(e,n,()=>{h(`Asked for ${lq}`),h(),K_(e,n.request),h(),h(`Check on it with: gamestage ads status ${e}`)})}catch(o){await pe(o)}}async function oN(e){try{let{client:t}=await be(),o=await t.getAdsRequest(e);if(C()){L({ok:!0,game:e,request:o,asked:o!==null,...du(o)});return}K_(e,o),o||h(`Ask with: gamestage ads request ${e} --audience "..." --where "..." --countries "..." --no-prize`)}catch(t){await pe(t)}}async function rN(e){try{let{client:t}=await be(),o=await t.requestAds(e,{wanted:!1});tN(e,o,()=>{h(`Noted: no partner products in ${e}. Nobody will ask again for this game.`),h(`If you change your mind: gamestage ads request ${e}`)})}catch(t){await pe(t)}}rt();Ie();var aN=e=>e?e.slice(0,10):"",iN={engine:"player data",workspace:"account records and datasets"};function Z_(e){let t=e.kind==="engine"?`${e.target} ${iN.engine}`:`${e.target} ${iN.workspace}`;if(e.completedAt)return`${t}: deleted ${aN(e.completedAt)}, ${e.deleted} row${e.deleted===1?"":"s"}`;let o=e.lastError==="no_engine"?" No Engine is wired to this control plane.":e.lastError==="no_dataset_store"?" No dataset bucket is wired to this control plane.":e.lastError?` Last attempt failed (${e.lastError}); the sweep retries every hour.`:"";return`${t}: in progress, due by ${aN(e.dueBy)}.${o}`}function sN(e,t,o){I(e.done?t:o);for(let r of e.erasures)k(Z_(r));h(),e.done||h("The control plane finishes what is left within the hour. Check with `gamestage admin erasures`.")}function cN(e,t,o){if(e.refused&&e.code!=="nothing_to_do"&&S(e.refused),C()){L({ok:!0,status:e.code==="nothing_to_do"?"already":e.done?"done":"queued",...o,done:e.done,erasures:e.erasures});return}if(e.code==="nothing_to_do"){sN(e,t.already??t.pending,t.already??t.pending);return}sN(e,t.done,t.pending)}async function lN(e){let{admin:t,email:o}=await Xt();try{let r=await t.eraseGame(e);cN(r,{done:`Deleted the player data of ${e}`,pending:`Deleting the player data of ${e}`},{game:e}),C()||A("Requested by",o)}catch(r){await pe(r)}}async function dN(e){let{admin:t,email:o}=await Xt();try{let r=await t.closeWorkspace(e);cN(r,{done:`Closed ${e}. Its games are off the air and its data is deleted`,pending:`Closed ${e}. Its games are off the air and its data is being deleted`,already:`${e} is already closing`},{workspace_id:e}),C()||(A("Closed by",o),h("Its audit trail is kept for six years, as the privacy page says."))}catch(r){await pe(r)}}async function uN(){let{admin:e}=await Xt();try{let t=await e.listErasures();if(C())return L({ok:!0,erasures:t});let o=t.filter(n=>!n.completedAt),r=t.filter(n=>n.completedAt).slice(0,20);if(!t.length){h("Nothing has been asked to be deleted yet.");return}I(o.length?`${o.length} in progress`:"Nothing in progress");for(let n of o)k(Z_(n));if(r.length){h(),I(`Finished, newest first${r.length===20?" (the last 20)":""}`);for(let n of r)k(Z_(n))}h()}catch(t){await pe(t)}}var mN={start:"none",doctor:"none",inspect:"none",review:"none",formats:"none",docs:"none",look:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","domain add":"approved","domain status":"approved","domain remove":"approved","theme init":"none","theme check":"none","theme preview":"none","theme publish":"approved","theme list":"approved","theme use":"approved","org context":"session","org context set":"approved","org context history":"session","org starter list":"session","org starter publish":"approved","workspace members":"approved","workspace invite":"approved","workspace remove":"approved","workspace use":"approved","ads request":"approved","ads status":"approved","ads skip":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none",live:"none","live on":"none","live off":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session","admin creator-sync":"session","admin refresh":"session","admin domains":"session","admin erase":"session","admin close":"session","admin erasures":"session",status:"session",deploy:"approved",archive:"session",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",open:"approved",logs:"approved",usage:"approved","manifest register":"session","reference push":"approved",sources:"approved","round push":"approved","round season":"approved","round seed":"approved","round refresh":"approved","link github":"approved"};function pN(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function hN(e,t){return e.commands.filter(o=>!o._hidden).map(o=>uq(o,t))}function uq(e,t){let o=t?`${t} ${e.name()}`:e.name(),r=!!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:pN(e),...r?{account:mN[o]??"none"}:{},commands:hN(e,o)}}function fN(e,t){return{name:e.name(),version:t,summary:e.description(),options:pN(e),commands:hN(e,"")}}function gN(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Ie();Jv();Nn();hn();rt();Rn();Ie();var mq=["play","studio","stage"];function pq(){if(process.platform==="darwin")return["open"];if(process.platform==="win32")return["cmd","/c","start",""];if(process.env.DISPLAY||process.env.WAYLAND_DISPLAY)return["xdg-open"]}async function yN(e,t="play"){if(!mq.includes(t))return S(`Nothing called "${t}" to open.`,[`${w.cyan("play")} the game, as a fan plays it`,`${w.cyan("studio")} its Studio project, where rounds and words are written`,`${w.cyan("stage")} its page on gamestage.ai: state, usage and settings`]);let{client:o}=await be();try{let r=await o.getGame(e);if(!r)return S(`No game with the id "${e}" in this workspace.`,["`gamestage list` shows your games and their ids."]);let n=t==="stage"?Aa(r.id):t==="studio"?r.studioUrl:r.playgroundUrl;if(!n)return S(t==="studio"?"This game has no Studio project yet.":"This game has not been deployed yet.",[`\`gamestage deploy ${r.id}\` puts it online and creates its Studio project.`]);let a=pq();if(C()||!a||!process.stdout.isTTY){if(C())return L({ok:!0,url:n,where:t});h(n);return}let[i,...c]=a;ik(i,[...c,n]),h(`Opened ${n}`)}catch(r){await pe(r)}}Xs();Ie();import{mkdir as hq,writeFile as fq}from"node:fs/promises";import{dirname as gq,resolve as yq}from"node:path";var bq=`(() => {
20452
+ `)}async function JR(e){let t=zm(e),o;try{o=await W_(t)}catch(i){let c=i.code;return c==="ENOENT"?vn("not_found",`There is no file at ${t}. Write your integration context as Markdown, then run \`gamestage org context set ${e}\`.`):c==="EISDIR"?vn("not_a_file",`${t} is a folder. Name the Markdown file itself, such as ${t}/integration.md.`):vn("unreadable",`Could not read ${t}${c?` (${c})`:""}. Check the path and that you may read the file, then set it again.`)}let r;try{r=new TextDecoder("utf-8",{fatal:!0}).decode(o)}catch{return vn("invalid_context",`${t} is not UTF-8 text. Save it as plain Markdown in UTF-8 and set it again.`)}let n=MA(r);if(n)return vn("invalid_context",`Not set. ${n}`);let a=Ow(r);if(a.length)return vn("secret_found","Not set. The file looks like it contains a secret, and every member of your organisation and every agent they run reads it.",a.map(i=>`Line ${i.line}: ${i.kind}. Take the value out and say where it is kept instead.`),{lines:a});try{let{client:i}=await be(),c=await i.setOrgContext(r);if(C()){L({ok:!0,revision:c});return}h(`Set your organisation's integration context: ${jm(c)}.`),h(w.dim("Every member's agent reads it from now on, and `gamestage create` copies it into each new game's folder."))}catch(i){await pe(i)}}async function XR(){try{let t=await(await V_()).orgContextHistory();if(C()){L({ok:!0,revisions:t});return}if(!t.length){h(Y_);return}I(`${t.length} revision${t.length===1?"":"s"}, newest first`);for(let[o,r]of t.entries())k(`${jm(r)}, ${r.bytes.toLocaleString("en-GB")} bytes${o===0?w.dim(" (in force)"):""}`)}catch(e){await pe(e)}}function vn(e,t,o=[],r={}){if(process.exitCode=1,C()){L({ok:!1,code:e,reason:t,...r});return}h(t);for(let n of o)h(` ${n}`)}var sq="Your organisation has no starter apps yet. An organisation admin publishes one with `gamestage org starter publish <folder>`.";function cq(e){return e===$s?!0:e.includes("/")?!1:e==="package.json"||e==="package-lock.json"||/^README/i.test(e)}function lq(e){let t=oo(e,{symlinks:"throw"}),o=new Map,r=[...t.tooling];for(let n of t.files){let a=Mk(n.relativePath);if(a){r.includes(a)||r.push(a);continue}o.set(n.relativePath,n.path)}for(let n of t.withheld)cq(n)?o.set(n,H_(zm(e),n)):r.push(n);return{files:o,left:r}}async function QR(e){let t=zm(e),o=await rq(t).then(d=>d.isDirectory(),()=>{});if(o===void 0)return vn("not_found",`There is no folder at ${t}. Name the folder that holds your starter app and its ${Ta}.`);if(!o)return vn("not_a_folder",`${t} is a file. Name the folder that holds your starter app, not a file in it.`);let r,n;try{let d=JSON.parse(await W_(H_(t,Ta),"utf8"));typeof d.name=="string"&&(r=d.name),typeof d.version=="string"&&(n=d.version)}catch{}if(!r||!n)return vn("no_starter_manifest",`${H_(t,Ta)} is missing or does not name the starter. Add it with name, version, description and framework, such as {"name": "web-embed", "version": "1.0.0", "description": "Our web embed", "framework": "vanilla"}.`);let a;try{a=lq(t)}catch(d){let l=d instanceof Error?d.message:String(d);return vn("symlink",`Not published. ${l}. A starter may hold no symbolic links: replace each with the file it points to.`)}let i={};for(let[d,l]of[...a.files].sort(([u],[p])=>u.localeCompare(p)))i[d]=new Uint8Array(await W_(l));let c=QA(i,{level:6});try{let{client:d}=await be(),l=await d.startOrgStarterUpload(r,{version:n,bytes:c.length}),u=await fetch(l.uploadUrl,{method:l.method,headers:l.headers,body:c});if(!u.ok)return vn("upload_failed",`The upload was refused with ${u.status}, so nothing was published. Run the same command again; the signed address lasts ${Math.round(l.expiresInSeconds/60)} minutes.`);let p=await d.confirmOrgStarter(r,n);if(C()){L({ok:!0,starter:p,left_out:a.left});return}h(`Published ${p.name}@${p.version} (${p.framework}) for everyone in your organisation. Every check passed.`),A("Files",`${p.files.toLocaleString("en-GB")}, ${(p.bytes/1024).toFixed(0)} KB zipped`),a.left.length&&A("Left out",a.left.join(", ")),h(w.dim(`Every member can now start a game from it with \`gamestage create --starter ${r}\`.`))}catch(d){await pe(d)}}async function eN(){try{let t=await(await V_()).orgStarters();if(C()){L({ok:!0,starters:t});return}if(!t.length){h(sq);return}I(`${t.length} starter app${t.length===1?"":"s"}`);for(let o of t){let r=o.latest;k(`${w.bold(r.name)}@${r.version} ${w.dim(r.framework)}`),h(` ${r.description}`);let n=o.versions.slice(1).map(a=>a.version);h(w.dim(` Published by ${r.publishedBy} on ${r.publishedAt.slice(0,10)}${n.length?`. Older: ${n.join(", ")}`:""}.`)),r.build&&h(w.dim(` Build: ${r.build}, then deploy ${r.out??"the build folder"}.`))}h(),h(w.dim("Start a game from one with `gamestage create --starter <name>`."))}catch(e){await pe(e)}}xe();rt();Ie();var dq="partner products on the result screen of this game, subject to approval by Monterosa and the retail partner and to commercial terms agreed with Monterosa.";function K_(e,t){let o=du(t);h(`${e}: ${o.headline}`),h(o.next),t?.facts&&(h(),h(w.dim(` For: ${t.facts.audience}`)),h(w.dim(` Played on: ${t.facts.wherePlayed}`)),h(w.dim(` Countries: ${t.facts.countries}`)),h(w.dim(` Prize: ${t.facts.prize?"yes":"no"}`)),t.facts.note&&h(w.dim(` Note: ${t.facts.note}`)))}function tN(e,t,o){if(t.refused){if(process.exitCode=1,C()){L({ok:!1,game:e,code:t.code,reason:t.refused,request:t.request});return}h(t.refused),t.request&&(h(),K_(e,t.request));return}if(C()){L({ok:!0,game:e,request:t.request,...du(t.request)});return}o()}function uq(e){let t=[];return e.audience?.trim()||t.push("--audience"),e.where?.trim()||t.push("--where"),e.countries?.trim()||t.push("--countries"),e.prize===void 0&&t.push("--prize or --no-prize"),t}async function nN(e,t){try{let o=uq(t);if(o.length){process.exitCode=2;let a=`gamestage ads request ${e} --audience "Club fans in the UK, mostly adults" --where "the club app and website" --countries "United Kingdom" --no-prize`;if(C()){L({ok:!1,game:e,code:"missing_facts",missing:o,example:a});return}h(`Monterosa and the retail partner need to know about the game. Missing: ${o.join(", ")}.`),h(`For example: ${a}`);return}let{client:r}=await be(),n=await r.requestAds(e,{facts:{audience:t.audience,wherePlayed:t.where,countries:t.countries,prize:t.prize,note:t.note?.trim()||null}});tN(e,n,()=>{h(`Asked for ${dq}`),h(),K_(e,n.request),h(),h(`Check on it with: gamestage ads status ${e}`)})}catch(o){await pe(o)}}async function oN(e){try{let{client:t}=await be(),o=await t.getAdsRequest(e);if(C()){L({ok:!0,game:e,request:o,asked:o!==null,...du(o)});return}K_(e,o),o||h(`Ask with: gamestage ads request ${e} --audience "..." --where "..." --countries "..." --no-prize`)}catch(t){await pe(t)}}async function rN(e){try{let{client:t}=await be(),o=await t.requestAds(e,{wanted:!1});tN(e,o,()=>{h(`Noted: no partner products in ${e}. Nobody will ask again for this game.`),h(`If you change your mind: gamestage ads request ${e}`)})}catch(t){await pe(t)}}rt();Ie();var aN=e=>e?e.slice(0,10):"",iN={engine:"player data",workspace:"account records and datasets"};function Z_(e){let t=e.kind==="engine"?`${e.target} ${iN.engine}`:`${e.target} ${iN.workspace}`;if(e.completedAt)return`${t}: deleted ${aN(e.completedAt)}, ${e.deleted} row${e.deleted===1?"":"s"}`;let o=e.lastError==="no_engine"?" No Engine is wired to this control plane.":e.lastError==="no_dataset_store"?" No dataset bucket is wired to this control plane.":e.lastError?` Last attempt failed (${e.lastError}); the sweep retries every hour.`:"";return`${t}: in progress, due by ${aN(e.dueBy)}.${o}`}function sN(e,t,o){I(e.done?t:o);for(let r of e.erasures)k(Z_(r));h(),e.done||h("The control plane finishes what is left within the hour. Check with `gamestage admin erasures`.")}function cN(e,t,o){if(e.refused&&e.code!=="nothing_to_do"&&S(e.refused),C()){L({ok:!0,status:e.code==="nothing_to_do"?"already":e.done?"done":"queued",...o,done:e.done,erasures:e.erasures});return}if(e.code==="nothing_to_do"){sN(e,t.already??t.pending,t.already??t.pending);return}sN(e,t.done,t.pending)}async function lN(e){let{admin:t,email:o}=await Xt();try{let r=await t.eraseGame(e);cN(r,{done:`Deleted the player data of ${e}`,pending:`Deleting the player data of ${e}`},{game:e}),C()||A("Requested by",o)}catch(r){await pe(r)}}async function dN(e){let{admin:t,email:o}=await Xt();try{let r=await t.closeWorkspace(e);cN(r,{done:`Closed ${e}. Its games are off the air and its data is deleted`,pending:`Closed ${e}. Its games are off the air and its data is being deleted`,already:`${e} is already closing`},{workspace_id:e}),C()||(A("Closed by",o),h("Its audit trail is kept for six years, as the privacy page says."))}catch(r){await pe(r)}}async function uN(){let{admin:e}=await Xt();try{let t=await e.listErasures();if(C())return L({ok:!0,erasures:t});let o=t.filter(n=>!n.completedAt),r=t.filter(n=>n.completedAt).slice(0,20);if(!t.length){h("Nothing has been asked to be deleted yet.");return}I(o.length?`${o.length} in progress`:"Nothing in progress");for(let n of o)k(Z_(n));if(r.length){h(),I(`Finished, newest first${r.length===20?" (the last 20)":""}`);for(let n of r)k(Z_(n))}h()}catch(t){await pe(t)}}var mN={start:"none",doctor:"none",inspect:"none",review:"none",formats:"none",docs:"none",look:"none",create:"none","graphic dev":"none","graphic push":"approved","graphic templates":"none","graphic create":"approved","graphic list":"approved","domain add":"approved","domain status":"approved","domain remove":"approved","theme init":"none","theme check":"none","theme preview":"none","theme publish":"approved","theme list":"approved","theme use":"approved","org context":"session","org context set":"approved","org context history":"session","org starter list":"session","org starter publish":"approved","workspace members":"approved","workspace invite":"approved","workspace remove":"approved","workspace use":"approved","ads request":"approved","ads status":"approved","ads skip":"approved","graphic remove":"approved",client:"none",suggest:"none",issue:"none","manifest validate":"none",live:"none","live on":"none","live off":"none","reference check":"none",login:"none",logout:"none",whoami:"none",verify:"session",dev:"session","admin approve":"session","admin refuse":"session","admin plan":"session","admin creator-sync":"session","admin refresh":"session","admin domains":"session","admin erase":"session","admin close":"session","admin erasures":"session",status:"session",deploy:"approved",archive:"session",promote:"approved",prune:"approved",plan:"approved",suspend:"approved",wake:"approved",endpoint:"approved",open:"approved",logs:"approved",usage:"approved","manifest register":"session","reference push":"approved",sources:"approved","round push":"approved","round season":"approved","round seed":"approved","round refresh":"approved","link github":"approved"};function pN(e){return e.options.filter(t=>!t.hidden).map(t=>({flags:t.flags,description:t.description,...t.defaultValue===void 0?{}:{default:t.defaultValue}}))}function hN(e,t){return e.commands.filter(o=>!o._hidden).map(o=>mq(o,t))}function mq(e,t){let o=t?`${t} ${e.name()}`:e.name(),r=!!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:pN(e),...r?{account:mN[o]??"none"}:{},commands:hN(e,o)}}function fN(e,t){return{name:e.name(),version:t,summary:e.description(),options:pN(e),commands:hN(e,"")}}function gN(e){return e.includes("--json")&&(e.includes("--help")||e.includes("-h"))}Ie();Jv();Nn();hn();rt();Rn();Ie();var pq=["play","studio","stage"];function hq(){if(process.platform==="darwin")return["open"];if(process.platform==="win32")return["cmd","/c","start",""];if(process.env.DISPLAY||process.env.WAYLAND_DISPLAY)return["xdg-open"]}async function yN(e,t="play"){if(!pq.includes(t))return S(`Nothing called "${t}" to open.`,[`${w.cyan("play")} the game, as a fan plays it`,`${w.cyan("studio")} its Studio project, where rounds and words are written`,`${w.cyan("stage")} its page on gamestage.ai: state, usage and settings`]);let{client:o}=await be();try{let r=await o.getGame(e);if(!r)return S(`No game with the id "${e}" in this workspace.`,["`gamestage list` shows your games and their ids."]);let n=t==="stage"?Aa(r.id):t==="studio"?r.studioUrl:r.playgroundUrl;if(!n)return S(t==="studio"?"This game has no Studio project yet.":"This game has not been deployed yet.",[`\`gamestage deploy ${r.id}\` puts it online and creates its Studio project.`]);let a=hq();if(C()||!a||!process.stdout.isTTY){if(C())return L({ok:!0,url:n,where:t});h(n);return}let[i,...c]=a;ik(i,[...c,n]),h(`Opened ${n}`)}catch(r){await pe(r)}}Xs();Ie();import{mkdir as fq,writeFile as gq}from"node:fs/promises";import{dirname as yq,resolve as bq}from"node:path";var wq=`(() => {
20453
20453
  const seen = (window.__gsLookErrors = window.__gsLookErrors || []);
20454
20454
  const original = console.error.bind(console);
20455
20455
  console.error = (...args) => {
20456
20456
  try { seen.push(args.map((a) => (a instanceof Error ? a.message : typeof a === "string" ? a : JSON.stringify(a))).join(" ")); } catch {}
20457
20457
  original(...args);
20458
20458
  };
20459
- })();`;function wq(e){return`(() => {
20459
+ })();`;function vq(e){return`(() => {
20460
20460
  for (const old of document.querySelectorAll("[data-gs-look]")) old.removeAttribute("data-gs-look");
20461
20461
  const want = ${JSON.stringify(e)};
20462
20462
  const visible = (el) => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== "hidden" && s.display !== "none"; };
@@ -20484,7 +20484,7 @@ Pass --renderer <url> if your Space serves it somewhere else.`);let r=D8((i,c)=>
20484
20484
  found.setAttribute("data-gs-look", "1");
20485
20485
  found.scrollIntoView({ block: "center", behavior: "instant" });
20486
20486
  return true;
20487
- })()`}var bN=e=>new Promise(t=>setTimeout(t,e));async function vq(e,t={},o){let r=Number(t.width??390),n=Number(t.height??844),a=Number(t.wait??1500);(!Number.isFinite(r)||r<200||r>3e3)&&S("Give --width between 200 and 3000 pixels."),(!Number.isFinite(n)||n<200||n>4e3)&&S("Give --height between 200 and 4000 pixels.");let i=o;if(!i){let c=await Qt();c.status!=="available"&&S("Chrome could not be started, so nothing was looked at.",[c.detail,"Set GAMESTAGE_CHROME to a working Chrome, Chromium, Brave or Edge, then run look again."]),i=c.browser}try{await i.addScriptToEvaluateOnNewDocument(bq),await i.setViewport(r,n);try{await i.navigate(e)}catch(g){S(`Nothing answered at ${e}.`,[g instanceof Error?g.message:String(g),"Start the game first with `gamestage dev --serve`, or pass the address it printed."])}await bN(a);let c=[];for(let g of t.tap??[]){let b=await i.run(wq(g));b&&(await i.click("[data-gs-look]"),await bN(a)),c.push({target:g,pressed:b})}let d=await i.run(`(() => {
20487
+ })()`}var bN=e=>new Promise(t=>setTimeout(t,e));async function kq(e,t={},o){let r=Number(t.width??390),n=Number(t.height??844),a=Number(t.wait??1500);(!Number.isFinite(r)||r<200||r>3e3)&&S("Give --width between 200 and 3000 pixels."),(!Number.isFinite(n)||n<200||n>4e3)&&S("Give --height between 200 and 4000 pixels.");let i=o;if(!i){let c=await Qt();c.status!=="available"&&S("Chrome could not be started, so nothing was looked at.",[c.detail,"Set GAMESTAGE_CHROME to a working Chrome, Chromium, Brave or Edge, then run look again."]),i=c.browser}try{await i.addScriptToEvaluateOnNewDocument(wq),await i.setViewport(r,n);try{await i.navigate(e)}catch(g){S(`Nothing answered at ${e}.`,[g instanceof Error?g.message:String(g),"Start the game first with `gamestage dev --serve`, or pass the address it printed."])}await bN(a);let c=[];for(let g of t.tap??[]){let b=await i.run(vq(g));b&&(await i.click("[data-gs-look]"),await bN(a)),c.push({target:g,pressed:b})}let d=await i.run(`(() => {
20488
20488
  const lines = [];
20489
20489
  const walker = document.createTreeWalker(document.body || document.documentElement, NodeFilter.SHOW_TEXT);
20490
20490
  const range = document.createRange();
@@ -20508,8 +20508,8 @@ Pass --renderer <url> if your Space serves it somewhere else.`);let r=D8((i,c)=>
20508
20508
  else { row = { top: line.top, words: [line.words] }; out.push(row); }
20509
20509
  }
20510
20510
  return out.map((r) => r.words.join(" ")).join("\\n").slice(0, 4000);
20511
- })()`),l=await i.run("Math.max(0, document.documentElement.scrollWidth - window.innerWidth)"),u=await i.run("window.__gsLookErrors || []"),p=[...i.pageErrors,...u],f=yq(t.out??".gamestage/look.png");return await hq(gq(f),{recursive:!0}),await fq(f,i.viewportShot?await i.viewportShot():await i.screenshot(r,n)),{url:e,width:r,height:n,screenshot:f,text:d,errors:p,overflowX:l,taps:c}}finally{o||await i.close()}}async function wN(e,t){let o=await vq(e??"http://127.0.0.1:4001",t);if(C()){L({ok:!0,...o});return}I(`Looked at ${o.url}`),A("Screenshot",`${o.screenshot} (${o.width} by ${o.height}). Open it to see the page.`);for(let r of o.taps)A("Pressed",r.pressed?r.target:`${r.target}: nothing on screen matched, so nothing was pressed`);if(A("Fits",o.overflowX>0?`no, the page is ${o.overflowX}px wider than the screen`:"yes, nothing scrolls sideways"),o.errors.length===0)A("Errors","none");else{A("Errors",String(o.errors.length));for(let r of o.errors.slice(0,10))h(` ${r}`)}h(),h("On screen:"),h(o.text||"(no text)")}Rn();Ie();var Dm=[{slug:"introduction",title:"Introduction"},{slug:"setup",title:"Set up Gamestage"},{slug:"how-it-works",title:"How it works"},{slug:"getting-started",title:"Getting started"},{slug:"journey",title:"The journey"},{slug:"game-formats",title:"Game formats"},{slug:"game-design",title:"Design a game fans come back to"},{slug:"migration",title:"Build and deploy"},{slug:"data",title:"Dataset"},{slug:"layout-and-loading",title:"Choose how your game sits on the screen"},{slug:"data-sources",title:"Data sources"},{slug:"live-data",title:"Live data"},{slug:"live-graphics",title:"Live Graphics"},{slug:"theming",title:"Theming"},{slug:"consent",title:"Ask fans for consent"},{slug:"organisation",title:"Your organisation's context and starter apps"},{slug:"app-manifest",title:"App Manifest reference"},{slug:"player-api",title:"Player API reference"},{slug:"cli",title:"CLI reference"},{slug:"endpoints",title:"Schemas and endpoints"},{slug:"gamestage-ui",title:"Gamestage UI"},{slug:"third-party",title:"Third-party tools and assets"},{slug:"custom-domains",title:"Use your own domain"},{slug:"ads",title:"Ads"},{slug:"starter-plan",title:"Plans and limits"},{slug:"attribution",title:"What Gamestage is built on"}],kq={formats:"game-formats",format:"game-formats",design:"game-design",deploy:"migration",start:"getting-started",manifest:"app-manifest",api:"player-api",commands:"cli",plans:"starter-plan",ui:"gamestage-ui"};async function vN(e){if(!e){if(C()){L({ok:!0,chapters:Dm.map(a=>({...a,url:`${Je}/docs/${a.slug}`}))});return}I("Documentation");for(let a of Dm)h(` ${w.cyan(a.slug.padEnd(20))} ${a.title}`);h(),k(`${w.cyan(ee("docs game-formats"))} print a chapter here`),k(`${w.dim(`${Je}/docs`)} the same, in a browser`),h();return}let t=kq[e]??e,o=Dm.find(a=>a.slug===t);if(!o)return S(`No chapter called "${e}".`,[...Dm.map(a=>`${w.cyan(a.slug.padEnd(20))} ${a.title}`)]);let r=`${Je}/docs/${o.slug}.md`,n;try{let a=await fetch(r,{signal:AbortSignal.timeout(1e4)});if(!a.ok)throw new Error(`the site answered ${a.status}`);n=await a.text()}catch(a){return S(`Could not fetch ${o.title}.`,[`${a.message}. Read it at ${Je}/docs/${o.slug}`])}if(C()){L({ok:!0,chapter:{...o,url:`${Je}/docs/${o.slug}`},markdown:n});return}h(n.trimEnd()),h(),h(w.dim(`${Je}/docs/${o.slug}`))}No();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var kN,$e=new ja,_q=(()=>{let e=Yt.map(t=>`${ko[t].name} (${t})`);return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();$e.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(ot).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{if(A1(!!e.opts().json),Kv(process.env,!!e.opts().json,!!process.stderr.isTTY,ot)&&(kN=Zv(ot).catch(()=>{})),e.opts().json&&l1(process.env,ot)){let t=d1(ot);t?mk(Vv(t,ot)):Zv(ot,u1).then(o=>{o&&mk(Vv(o,ot))}).catch(()=>{})}}).hook("postAction",async()=>{let e=await kN;e&&process.stderr.write(`
20511
+ })()`),l=await i.run("Math.max(0, document.documentElement.scrollWidth - window.innerWidth)"),u=await i.run("window.__gsLookErrors || []"),p=[...i.pageErrors,...u],f=bq(t.out??".gamestage/look.png");return await fq(yq(f),{recursive:!0}),await gq(f,i.viewportShot?await i.viewportShot():await i.screenshot(r,n)),{url:e,width:r,height:n,screenshot:f,text:d,errors:p,overflowX:l,taps:c}}finally{o||await i.close()}}async function wN(e,t){let o=await kq(e??"http://127.0.0.1:4001",t);if(C()){L({ok:!0,...o});return}I(`Looked at ${o.url}`),A("Screenshot",`${o.screenshot} (${o.width} by ${o.height}). Open it to see the page.`);for(let r of o.taps)A("Pressed",r.pressed?r.target:`${r.target}: nothing on screen matched, so nothing was pressed`);if(A("Fits",o.overflowX>0?`no, the page is ${o.overflowX}px wider than the screen`:"yes, nothing scrolls sideways"),o.errors.length===0)A("Errors","none");else{A("Errors",String(o.errors.length));for(let r of o.errors.slice(0,10))h(` ${r}`)}h(),h("On screen:"),h(o.text||"(no text)")}Rn();Ie();var Dm=[{slug:"introduction",title:"Introduction"},{slug:"setup",title:"Set up Gamestage"},{slug:"how-it-works",title:"How it works"},{slug:"getting-started",title:"Getting started"},{slug:"journey",title:"The journey"},{slug:"game-formats",title:"Game formats"},{slug:"game-design",title:"Design a game fans come back to"},{slug:"migration",title:"Build and deploy"},{slug:"data",title:"Dataset"},{slug:"layout-and-loading",title:"Choose how your game sits on the screen"},{slug:"data-sources",title:"Data sources"},{slug:"live-data",title:"Live data"},{slug:"live-graphics",title:"Live Graphics"},{slug:"theming",title:"Theming"},{slug:"consent",title:"Ask fans for consent"},{slug:"organisation",title:"Your organisation's context and starter apps"},{slug:"app-manifest",title:"App Manifest reference"},{slug:"player-api",title:"Player API reference"},{slug:"cli",title:"CLI reference"},{slug:"endpoints",title:"Schemas and endpoints"},{slug:"gamestage-ui",title:"Gamestage UI"},{slug:"third-party",title:"Third-party tools and assets"},{slug:"custom-domains",title:"Use your own domain"},{slug:"ads",title:"Ads"},{slug:"starter-plan",title:"Plans and limits"},{slug:"attribution",title:"What Gamestage is built on"}],_q={formats:"game-formats",format:"game-formats",design:"game-design",deploy:"migration",start:"getting-started",manifest:"app-manifest",api:"player-api",commands:"cli",plans:"starter-plan",ui:"gamestage-ui"};async function vN(e){if(!e){if(C()){L({ok:!0,chapters:Dm.map(a=>({...a,url:`${Je}/docs/${a.slug}`}))});return}I("Documentation");for(let a of Dm)h(` ${w.cyan(a.slug.padEnd(20))} ${a.title}`);h(),k(`${w.cyan(ee("docs game-formats"))} print a chapter here`),k(`${w.dim(`${Je}/docs`)} the same, in a browser`),h();return}let t=_q[e]??e,o=Dm.find(a=>a.slug===t);if(!o)return S(`No chapter called "${e}".`,[...Dm.map(a=>`${w.cyan(a.slug.padEnd(20))} ${a.title}`)]);let r=`${Je}/docs/${o.slug}.md`,n;try{let a=await fetch(r,{signal:AbortSignal.timeout(1e4)});if(!a.ok)throw new Error(`the site answered ${a.status}`);n=await a.text()}catch(a){return S(`Could not fetch ${o.title}.`,[`${a.message}. Read it at ${Je}/docs/${o.slug}`])}if(C()){L({ok:!0,chapter:{...o,url:`${Je}/docs/${o.slug}`},markdown:n});return}h(n.trimEnd()),h(),h(w.dim(`${Je}/docs/${o.slug}`))}No();for(let e of[process.stdout,process.stderr])e.on("error",t=>{throw t.code==="EPIPE"&&process.exit(0),t});var kN,$e=new ja,xq=(()=>{let e=Yt.map(t=>`${ko[t].name} (${t})`);return e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`})();$e.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(ot).option("--json","machine-readable output for agents",!1).hook("preAction",e=>{if(A1(!!e.opts().json),Kv(process.env,!!e.opts().json,!!process.stderr.isTTY,ot)&&(kN=Zv(ot).catch(()=>{})),e.opts().json&&l1(process.env,ot)){let t=d1(ot);t?mk(Vv(t,ot)):Zv(ot,u1).then(o=>{o&&mk(Vv(o,ot))}).catch(()=>{})}}).hook("postAction",async()=>{let e=await kN;e&&process.stderr.write(`
20512
20512
  gamestage ${e} is out; this is ${ot}. Update with: npm install -g gamestage
20513
- `)});$e.command("start").description("read the current directory and point at the right next step").action(AP);$e.command("doctor").description("check the local environment").action(pP);$e.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(bP);$e.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${_q}`).addOption(new fn("--archetype <format>").hideHelp()).option("--host <host>","where it runs: fullscreen, article-launch, article-embed or app-webview (default fullscreen)").option("--layout <layout>","how it sits on the screen: screen, canvas, launch, card, page or sheet (default from the host and format)").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).option("--here","write into this folder even when it holds other things (by default a new folder is made)",!1).option("--brand <name>","who runs the game, named when a fan is asked for consent").option("--privacy-url <url>","your privacy policy's address, linked from the consent card").option("--starter <name[@version]>","start from your organisation's starter app (see `org starter list`)").option("--no-starter","start from the format's own page even when your organisation has starter apps").description("start a new game: asks how it is played and what it is called when run by hand (see `formats`)").action(wO);$e.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","the game's manifest (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 the deployed Engine and prove the migration is done (requires sign-in)").action(e=>c_({...e,noBrowser:e.browser===!1}));$e.command("review").option("--file <path>","the game's page (index.html)").option("--manifest <path>","the manifest (gamestage.yaml)").description("advice on whether fans will come back: plays the game against the deployed Engine and checks it against the game design rules").action(e=>mP(e));$e.command("formats").argument("[format]","one format in full, such as hunt").description("what each format is, with a game to play, before you choose one (no account needed)").action(e=>mO(e));$e.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(q1);var _N=$e.command("manifest").description("work with the App Manifest");_N.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(qO);_N.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(CR);$e.command("status").alias("list").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near (`list` with no game lists them)").action(zO);$e.command("open").argument("<game>","game id").argument("[where]","play (default), studio or stage").description("open the game, its Studio project or its Stage page in the browser").action((e,t)=>yN(e,t));$e.command("look").argument("[url]","the page to look at, by default the one `dev --serve` serves","http://127.0.0.1:4001").option("--tap <target>","press a button or link by its words, label or a CSS selector; repeat to press several in order",(e,t)=>[...t,e],[]).option("--width <px>","screen width","390").option("--height <px>","screen height","844").option("--out <file>","where to save the screenshot",".gamestage/look.png").option("--wait <ms>","how long to let the page settle after loading and after each press","1500").description("open a page at phone size, press things, and save what it looks like: a screenshot, its words and its errors").action((e,t)=>wN(e,t));$e.command("docs").argument("[chapter]","a chapter, such as game-formats or cli").description("read a documentation chapter in the terminal (no account needed)").action(e=>vN(e));$e.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>","the game's manifest (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--space <id>","the Studio space id to deploy this game's project into").option("--space-org <id>","the org that --space belongs to, when it is known").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(jO);var J_=$e.command("domain").description("serve a game from your own hostname, such as quiz.myclub.com (Publisher and Enterprise)");J_.command("add").argument("<game>","game id").argument("<hostname>","a subdomain you control, such as quiz.myclub.com").option("--move","take your plan's domain off its other game and put it here",!1).description("add a custom domain to a game, and print the DNS record to create").action((e,t,o)=>LR(e,t,o));J_.command("status").argument("<game>","game id").option("--watch","check every 15 seconds until the domain is live or failed",!1).description("check the domain's DNS record and certificate now").action((e,t)=>zR(e,t));J_.command("remove").argument("<game>","game id").description("stop serving the game from its custom domain; its own address keeps working").action(e=>jR(e));var Mm=$e.command("workspace").description(`share your workspace with up to ${mr} colleagues, and pick which workspace commands act in`);Mm.command("members").description("list the owner, members and invites not yet accepted").action(()=>z1());Mm.command("invite").argument("<email>","a colleague's work address").description(`invite a colleague; they join by signing in with that address (owner only). ${jA}`).action(e=>j1(e));Mm.command("remove").argument("<email>","a member's address, or an invite to cancel").description("remove a member or cancel an invite; it takes effect on their next request (owner only)").action(e=>D1(e));Mm.command("use").argument("[id]","a workspace you are a member of; leave out to list them").option("--own","go back to your own workspace",!1).description("act in a shared workspace from now on, or list the ones you can").action((e,t)=>M1(e,t));var si=$e.command("theme").description("make your own Gamestage UI theme, keep it privately for your org, and use it in a game");si.command("init").argument("<name>","the theme's name, such as your company's: lowercase letters, numbers and hyphens").option("--dir <path>","where to write it (default <name>-theme)").description("start a theme package: theme.json, tokens.json and an optional overrides.css").action((e,t)=>qR(e,t));si.command("check").argument("[dir]","the theme's folder",".").description("run the library's checks: contrast, type scale, unknown and missing roles, overrides").action(e=>WR(e));si.command("preview").argument("[dir]","the theme's folder",".").option("--port <port>","the local port to serve on").description("show the main components wearing the theme in a local page, rebuilt as you edit").action((e,t)=>HR(e,t));si.command("publish").argument("[dir]","the theme's folder",".").option("--declare-fonts","declare, in your name, that the client may use each font in web games",!1).description("check, build and store the theme privately for your org, as name@version (organisation admins only)").action((e,t)=>YR(e,t));si.command("list").description("your org's themes and their versions").action(()=>VR());si.command("use").argument("<ref>","the theme and exact version, such as acme@1.0.0").option("--manifest <path>","the game's manifest (gamestage.yaml)").description("install a theme version into this game and pin it in gamestage.yaml").action((e,t)=>KR(e,t));var xN=$e.command("org").description("your organisation's integration context and starter apps: how a game fits your organisation's app"),SN=xN.command("context").option("--save [path]","write it to a file for your agent to read (default integration.md)").description("print your organisation's integration context, or save it with --save").action(e=>ZR(e));SN.command("set").argument("<file>","the Markdown file to publish, such as integration.md").description("publish a new revision for everyone in your organisation (organisation admins only)").action(e=>JR(e));SN.command("history").description("every revision, newest first, with who set it and when").action(()=>XR());var TN=xN.command("starter").description("your organisation's starter apps: a working app in your own stack that new games start from");TN.command("publish").argument("<folder>","the folder holding the app and its gamestage-starter.json").description("check and publish a new version for everyone in your organisation (organisation admins only)").action(e=>QR(e));TN.command("list").description("every starter app, with its newest version, framework and who published it").action(()=>eN());var X_=$e.command("ads").description("ask for partner products on a game's result screen (in preview, subject to approval and commercial terms)");X_.command("request").argument("<game>","game id").option("--audience <text>",'who the game is for, such as "Club fans in the UK, mostly adults"').option("--where <text>",'where it is played, such as "the club app and website"').option("--countries <text>",'the countries its fans are in, such as "United Kingdom, Ireland"').option("--prize","the game has a prize").option("--no-prize","the game has no prize").option("--note <text>","anything else Monterosa should know").description("ask Monterosa and the retail partner to approve products for this game").action((e,t)=>nN(e,t));X_.command("status").argument("<game>","game id").description("where this game's request for products is, and what happens next").action(e=>oN(e));X_.command("skip").argument("<game>","game id").description("record that you do not want products in this game, so you are not asked again").action(e=>rN(e));var EN=$e.command("reference").description("the private data a round is scored against");EN.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").option("--drop-scoring","publish even though a measure that scores rounds today would stop scoring them").action(jP);EN.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(DP);var $N=$e.command("live").description("live data: follow a real contest as it happens (switch it on, off, or see which)").helpCommand(!0).option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>qP(e));$N.command("on").description("switch live data on in gamestage.yaml; deploy to apply it").option("--provider <provider>","where the contest's live data comes from","sportmonks").option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>GP(e));$N.command("off").description("switch live data off in gamestage.yaml; deploy to apply it").option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>BP(e));var Q_=$e.command("sources").description("where a game's real-world values can come from, and which you can use now").helpCommand(!0).action(MP);Q_.command("connect <source>").description("switch a source on: ESPN with --league, or the link to add your own key for Sportmonks").option("--league <league>","ESPN only: nba, wnba, nfl, mlb or nhl").option("--measures <keys>","ESPN only: comma-separated measures; `sources status espn --league nba` lists them").option("--season <year>","ESPN only: ESPN's year for the season, e.g. 2025; default the current one").option("--name <dataset>","ESPN only: the dataset's name, default espn-<league>").option("--from-op <reference>","keyed sources, at your own terminal only: read the key from 1Password (op://Vault/Item/field); never run by an agent").action((e,t)=>JP(e,t));Q_.command("status <source>").description("what is connected for a source; with --league, the measures ESPN offers there").option("--league <league>","ESPN only: list this league's measures").action((e,t)=>eR(e,t));Q_.command("disconnect <source>").description("stop a source's scheduled fetches; the data already fetched stays").option("--name <dataset>","ESPN only: which dataset, e.g. espn-nba").action((e,t)=>tR(e,t));var Fm=$e.command("round").description("the round a fan plays, and getting it into Studio");Fm.command("push").argument("<game>","game id").option("--manifest <path>","the game's manifest; the round is read from practice/round.yaml beside it","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(aR);Fm.command("season").argument("<game>","game id").option("--file <path>","the season: a list of dated rounds",F_).option("--manifest <path>","the game's manifest, for its format","gamestage.yaml").option("--overwrite","write over days that already have a round in Studio",!1).option("--dry-run","check the file and say what would be written, without writing",!1).option("--yes","do not ask before writing",!1).description("write a season of rounds into Studio, one edition a day").action(dR);Fm.command("seed").argument("<game>","game id").requiredOption("--count <n>","number of candidate rounds (1\u201380)").option("--measure <key>","dataset measure (required when there are several)").option("--position <position>","filter by position, case-insensitive exact match").option("--team <team>","filter by team, case-insensitive exact match").option("--layout <layout>","grid (cards, the default), pitch (players on a football pitch) or xi (Complete the XI, from a line-up dataset)").option("--dataset <name>","read this dataset of yours instead of the game's own, e.g. sportmonks/premier-league-lineups.json").option("--prompt <text>","the question for xi rounds, with {position} and {team}").option("--dry-run","print candidate rounds without writing",!1).option("--yes","create rounds without asking for consent",!1).description("build rounds from the game's connected dataset and create them in Studio").action(sR);Fm.command("refresh").argument("<game>","game id").description("read Studio and the dataset again now, rather than on the next fan's visit").action(iR);var ci=$e.command("graphic").description("the graphic your game puts on a screen");ci.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(_R);ci.command("templates").description("the screens a graphic can be cut for").action(AR);ci.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",ri).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(TR);ci.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(ER);ci.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action($R);ci.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(xR);$e.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(DO);$e.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(MO);$e.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(FO);$e.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(UO);$e.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>S_(e,!1));$e.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>S_(e,!0));$e.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(WO);$e.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(YO);$e.command("usage").argument("<game>","game id").description("what the game's Jev questions cost: per round, in total, and per fan's game").action(VO);$e.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","the game's manifest (gamestage.yaml)").addOption(new fn("--fixture").hideHelp()).addOption(new fn("--scenario <name>").hideHelp()).addOption(new fn("--as <player>").hideHelp()).option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("play your round through the deployed Engine, with your page on this machine (requires sign-in)").action(cP);$e.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)=>PP(e,t,ot));$e.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)=>LP(e,t,ot));$e.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=>SP(e.workspace));var xq=$e.command("link").description("connect an account Gamestage needs (requires sign-in)");xq.command("github").description("link your GitHub account, which a first deploy requires").action(_P);var io=$e.command("admin").description("approve, refuse, set the plan of, or close a creator's account (operators only)");io.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>x_(e,"approved"));io.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>x_(e,"refused"));io.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,o)=>BO(e,t,o));io.command("domains").description("every custom domain, with its game, workspace, status and what DNS last said").action(DR);io.command("refresh").argument("<workspace>","workspace id").argument("<dataset>","the dataset's name, e.g. espn-nba").argument("<hours>","fetch every this many hours (1 to 168), or `default` for the creator's own").description("fetch a switched-on source more (or less) often than twice a day").action((e,t,o)=>ZP(e,t,o));io.command("creator-sync").description("sync every creator into the Resend segment now, and print the counts").action(()=>GO());io.command("erase").argument("<game>","the game's id; it must be archived").description("delete one archived game's player data, for a creator's written request").action(e=>lN(e));io.command("close").argument("<workspace>","workspace id").description("close an account: take every game off the air and delete its data").action(e=>dN(e));io.command("erasures").description("every deletion asked for, what is still in progress and when it is due").action(uN);$e.command("logout").description("forget the stored session").action(TP);$e.command("whoami").description("show who the CLI is signed in as").action(EP);gN(process.argv)&&(process.stdout.write(`${JSON.stringify(fN($e,ot),null,2)}
20513
+ `)});$e.command("start").description("read the current directory and point at the right next step").action(AP);$e.command("doctor").description("check the local environment").action(pP);$e.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(bP);$e.command("create").option("--name <name>","game name").option("--format <format>",`how the game is played: ${xq}`).addOption(new fn("--archetype <format>").hideHelp()).option("--host <host>","where it runs: fullscreen, article-launch, article-embed or app-webview (default fullscreen)").option("--layout <layout>","how it sits on the screen: screen, canvas, launch, card, page or sheet (default from the host and format)").option("--write [path]","manifest path (default gamestage.yaml)").option("--force","replace files that are already here, losing what they hold",!1).option("--here","write into this folder even when it holds other things (by default a new folder is made)",!1).option("--brand <name>","who runs the game, named when a fan is asked for consent").option("--privacy-url <url>","your privacy policy's address, linked from the consent card").option("--starter <name[@version]>","start from your organisation's starter app (see `org starter list`)").option("--no-starter","start from the format's own page even when your organisation has starter apps").description("start a new game: asks how it is played and what it is called when run by hand (see `formats`)").action(wO);$e.command("verify").option("--file <path>","the game to verify (index.html)").option("--manifest <path>","the game's manifest (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 the deployed Engine and prove the migration is done (requires sign-in)").action(e=>c_({...e,noBrowser:e.browser===!1}));$e.command("review").option("--file <path>","the game's page (index.html)").option("--manifest <path>","the manifest (gamestage.yaml)").description("advice on whether fans will come back: plays the game against the deployed Engine and checks it against the game design rules").action(e=>mP(e));$e.command("formats").argument("[format]","one format in full, such as hunt").description("what each format is, with a game to play, before you choose one (no account needed)").action(e=>mO(e));$e.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(q1);var _N=$e.command("manifest").description("work with the App Manifest");_N.command("register").argument("[path]","manifest path","gamestage.yaml").description("register an existing manifest with the control plane (requires sign-in)").action(qO);_N.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(CR);$e.command("status").alias("list").argument("[game]","one game, or the whole workspace when omitted").description("what is deployed, what state it is in, and what caps are near (`list` with no game lists them)").action(zO);$e.command("open").argument("<game>","game id").argument("[where]","play (default), studio or stage").description("open the game, its Studio project or its Stage page in the browser").action((e,t)=>yN(e,t));$e.command("look").argument("[url]","the page to look at, by default the one `dev --serve` serves","http://127.0.0.1:4001").option("--tap <target>","press a button or link by its words, label or a CSS selector; repeat to press several in order",(e,t)=>[...t,e],[]).option("--width <px>","screen width","390").option("--height <px>","screen height","844").option("--out <file>","where to save the screenshot",".gamestage/look.png").option("--wait <ms>","how long to let the page settle after loading and after each press","1500").description("open a page at phone size, press things, and save what it looks like: a screenshot, its words and its errors").action((e,t)=>wN(e,t));$e.command("docs").argument("[chapter]","a chapter, such as game-formats or cli").description("read a documentation chapter in the terminal (no account needed)").action(e=>vN(e));$e.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>","the game's manifest (gamestage.yaml)").option("--notes <text>","what changed, said in the deploy announcement and the game's log").option("--space <id>","the Studio space id to deploy this game's project into").option("--space-org <id>","the org that --space belongs to, when it is known").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(jO);var J_=$e.command("domain").description("serve a game from your own hostname, such as quiz.myclub.com (Publisher and Enterprise)");J_.command("add").argument("<game>","game id").argument("<hostname>","a subdomain you control, such as quiz.myclub.com").option("--move","take your plan's domain off its other game and put it here",!1).description("add a custom domain to a game, and print the DNS record to create").action((e,t,o)=>LR(e,t,o));J_.command("status").argument("<game>","game id").option("--watch","check every 15 seconds until the domain is live or failed",!1).description("check the domain's DNS record and certificate now").action((e,t)=>zR(e,t));J_.command("remove").argument("<game>","game id").description("stop serving the game from its custom domain; its own address keeps working").action(e=>jR(e));var Mm=$e.command("workspace").description(`share your workspace with up to ${mr} colleagues, and pick which workspace commands act in`);Mm.command("members").description("list the owner, members and invites not yet accepted").action(()=>z1());Mm.command("invite").argument("<email>","a colleague's work address").description(`invite a colleague; they join by signing in with that address (owner only). ${jA}`).action(e=>j1(e));Mm.command("remove").argument("<email>","a member's address, or an invite to cancel").description("remove a member or cancel an invite; it takes effect on their next request (owner only)").action(e=>D1(e));Mm.command("use").argument("[id]","a workspace you are a member of; leave out to list them").option("--own","go back to your own workspace",!1).description("act in a shared workspace from now on, or list the ones you can").action((e,t)=>M1(e,t));var si=$e.command("theme").description("make your own Gamestage UI theme, keep it privately for your org, and use it in a game");si.command("init").argument("<name>","the theme's name, such as your company's: lowercase letters, numbers and hyphens").option("--dir <path>","where to write it (default <name>-theme)").description("start a theme package: theme.json, tokens.json and an optional overrides.css").action((e,t)=>qR(e,t));si.command("check").argument("[dir]","the theme's folder",".").description("run the library's checks: contrast, type scale, unknown and missing roles, overrides").action(e=>WR(e));si.command("preview").argument("[dir]","the theme's folder",".").option("--port <port>","the local port to serve on").description("show the main components wearing the theme in a local page, rebuilt as you edit").action((e,t)=>HR(e,t));si.command("publish").argument("[dir]","the theme's folder",".").option("--declare-fonts","declare, in your name, that the client may use each font in web games",!1).description("check, build and store the theme privately for your org, as name@version (organisation admins only)").action((e,t)=>YR(e,t));si.command("list").description("your org's themes and their versions").action(()=>VR());si.command("use").argument("<ref>","the theme and exact version, such as acme@1.0.0").option("--manifest <path>","the game's manifest (gamestage.yaml)").description("install a theme version into this game and pin it in gamestage.yaml").action((e,t)=>KR(e,t));var xN=$e.command("org").description("your organisation's integration context and starter apps: how a game fits your organisation's app"),SN=xN.command("context").option("--save [path]","write it to a file for your agent to read (default integration.md)").description("print your organisation's integration context, or save it with --save").action(e=>ZR(e));SN.command("set").argument("<file>","the Markdown file to publish, such as integration.md").description("publish a new revision for everyone in your organisation (organisation admins only)").action(e=>JR(e));SN.command("history").description("every revision, newest first, with who set it and when").action(()=>XR());var TN=xN.command("starter").description("your organisation's starter apps: a working app in your own stack that new games start from");TN.command("publish").argument("<folder>","the folder holding the app and its gamestage-starter.json").description("check and publish a new version for everyone in your organisation (organisation admins only)").action(e=>QR(e));TN.command("list").description("every starter app, with its newest version, framework and who published it").action(()=>eN());var X_=$e.command("ads").description("ask for partner products on a game's result screen (in preview, subject to approval and commercial terms)");X_.command("request").argument("<game>","game id").option("--audience <text>",'who the game is for, such as "Club fans in the UK, mostly adults"').option("--where <text>",'where it is played, such as "the club app and website"').option("--countries <text>",'the countries its fans are in, such as "United Kingdom, Ireland"').option("--prize","the game has a prize").option("--no-prize","the game has no prize").option("--note <text>","anything else Monterosa should know").description("ask Monterosa and the retail partner to approve products for this game").action((e,t)=>nN(e,t));X_.command("status").argument("<game>","game id").description("where this game's request for products is, and what happens next").action(e=>oN(e));X_.command("skip").argument("<game>","game id").description("record that you do not want products in this game, so you are not asked again").action(e=>rN(e));var EN=$e.command("reference").description("the private data a round is scored against");EN.command("push").argument("<name>",'the name a producer types in Studio, e.g. "the-limit/careers.json"').argument("<file>","the JSON file holding it").description("upload reference data, and an immutable copy a round can be pinned to").option("--drop-scoring","publish even though a measure that scores rounds today would stop scoring them").action(jP);EN.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(DP);var $N=$e.command("live").description("live data: follow a real contest as it happens (switch it on, off, or see which)").helpCommand(!0).option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>qP(e));$N.command("on").description("switch live data on in gamestage.yaml; deploy to apply it").option("--provider <provider>","where the contest's live data comes from","sportmonks").option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>GP(e));$N.command("off").description("switch live data off in gamestage.yaml; deploy to apply it").option("--manifest <path>","the manifest, default gamestage.yaml").action(e=>BP(e));var Q_=$e.command("sources").description("where a game's real-world values can come from, and which you can use now").helpCommand(!0).action(MP);Q_.command("connect <source>").description("switch a source on: ESPN with --league, or the link to add your own key for Sportmonks").option("--league <league>","ESPN only: nba, wnba, nfl, mlb or nhl").option("--measures <keys>","ESPN only: comma-separated measures; `sources status espn --league nba` lists them").option("--season <year>","ESPN only: ESPN's year for the season, e.g. 2025; default the current one").option("--name <dataset>","ESPN only: the dataset's name, default espn-<league>").option("--from-op <reference>","keyed sources, at your own terminal only: read the key from 1Password (op://Vault/Item/field); never run by an agent").action((e,t)=>JP(e,t));Q_.command("status <source>").description("what is connected for a source; with --league, the measures ESPN offers there").option("--league <league>","ESPN only: list this league's measures").action((e,t)=>eR(e,t));Q_.command("disconnect <source>").description("stop a source's scheduled fetches; the data already fetched stays").option("--name <dataset>","ESPN only: which dataset, e.g. espn-nba").action((e,t)=>tR(e,t));var Fm=$e.command("round").description("the round a fan plays, and getting it into Studio");Fm.command("push").argument("<game>","game id").option("--manifest <path>","the game's manifest; the round is read from practice/round.yaml beside it","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(aR);Fm.command("season").argument("<game>","game id").option("--file <path>","the season: a list of dated rounds",F_).option("--manifest <path>","the game's manifest, for its format","gamestage.yaml").option("--overwrite","write over days that already have a round in Studio",!1).option("--dry-run","check the file and say what would be written, without writing",!1).option("--yes","do not ask before writing",!1).description("write a season of rounds into Studio, one edition a day").action(dR);Fm.command("seed").argument("<game>","game id").requiredOption("--count <n>","number of candidate rounds (1\u201380)").option("--measure <key>","dataset measure (required when there are several)").option("--position <position>","filter by position, case-insensitive exact match").option("--team <team>","filter by team, case-insensitive exact match").option("--layout <layout>","grid (cards, the default), pitch (players on a football pitch) or xi (Complete the XI, from a line-up dataset)").option("--dataset <name>","read this dataset of yours instead of the game's own, e.g. sportmonks/premier-league-lineups.json").option("--prompt <text>","the question for xi rounds, with {position} and {team}").option("--dry-run","print candidate rounds without writing",!1).option("--yes","create rounds without asking for consent",!1).description("build rounds from the game's connected dataset and create them in Studio").action(sR);Fm.command("refresh").argument("<game>","game id").description("read Studio and the dataset again now, rather than on the next fan's visit").action(iR);var ci=$e.command("graphic").description("the graphic your game puts on a screen");ci.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(_R);ci.command("templates").description("the screens a graphic can be cut for").action(AR);ci.command("create").argument("<game>","game id").option("--template <id>","the screen to cut it for",ri).option("--consent","confirm the people named agreed to appear on a screen",!1).description("put this game's leaderboard on a screen").action(TR);ci.command("list").argument("<game>","game id").description("the graphics this game has, and where to watch them").action(ER);ci.command("remove").argument("<game>","game id").argument("<id>","the graphic's id, from `gamestage graphic list`").description("take a graphic off the air").action($R);ci.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(xR);$e.command("archive").argument("<game>","game id").description("take a game off the air while retaining its record and files").action(DO);$e.command("promote").argument("<game>","game id").description("approve your own game to move from dev to prod").action(MO);$e.command("prune").option("--yes","do not ask before deleting",!1).description("remove archived games that never deployed").action(FO);$e.command("plan").argument("<plan>","runtime, live or enterprise").description("change this workspace's plan and its limits").action(UO);$e.command("suspend").argument("<game>","game id").description("take a game off the air and free its live slot").action(e=>S_(e,!1));$e.command("wake").argument("<game>","game id").description("put a suspended game back on the air").action(e=>S_(e,!0));$e.command("endpoint").argument("<game>","game id").argument("[which]","player, control or playground; all three when omitted").description("print where a deployed game answers").action(WO);$e.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(YO);$e.command("usage").argument("<game>","game id").description("what the game's Jev questions cost: per round, in total, and per fan's game").action(VO);$e.command("dev").option("--port <port>","local HTTP port","4000").option("--manifest <path>","the game's manifest (gamestage.yaml)").addOption(new fn("--fixture").hideHelp()).addOption(new fn("--scenario <name>").hideHelp()).addOption(new fn("--as <player>").hideHelp()).option("--serve","also serve this directory, so the page has somewhere to open",!1).option("--serve-port <port>","port for the page (with --serve)","4001").description("play your round through the deployed Engine, with your page on this machine (requires sign-in)").action(cP);$e.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)=>PP(e,t,ot));$e.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)=>LP(e,t,ot));$e.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=>SP(e.workspace));var Sq=$e.command("link").description("connect an account Gamestage needs (requires sign-in)");Sq.command("github").description("link your GitHub account, which a first deploy requires").action(_P);var io=$e.command("admin").description("approve, refuse, set the plan of, or close a creator's account (operators only)");io.command("approve").argument("<workspace>","workspace id, from the registration alert").description("let this account use the runtime").action(e=>x_(e,"approved"));io.command("refuse").argument("<workspace>","workspace id, from the registration alert").description("turn this account down, finally").action(e=>x_(e,"refused"));io.command("plan").argument("<workspace>","workspace id").argument("<plan>","runtime (Starter), live (Publisher) or enterprise").option("--live-games <count>","live-game ceiling instead of the plan's own; 0 is none").description("move this account onto a plan, including a paid one").action((e,t,o)=>BO(e,t,o));io.command("domains").description("every custom domain, with its game, workspace, status and what DNS last said").action(DR);io.command("refresh").argument("<workspace>","workspace id").argument("<dataset>","the dataset's name, e.g. espn-nba").argument("<hours>","fetch every this many hours (1 to 168), or `default` for the creator's own").description("fetch a switched-on source more (or less) often than twice a day").action((e,t,o)=>ZP(e,t,o));io.command("creator-sync").description("sync every creator into the Resend segment now, and print the counts").action(()=>GO());io.command("erase").argument("<game>","the game's id; it must be archived").description("delete one archived game's player data, for a creator's written request").action(e=>lN(e));io.command("close").argument("<workspace>","workspace id").description("close an account: take every game off the air and delete its data").action(e=>dN(e));io.command("erasures").description("every deletion asked for, what is still in progress and when it is due").action(uN);$e.command("logout").description("forget the stored session").action(TP);$e.command("whoami").description("show who the CLI is signed in as").action(EP);gN(process.argv)&&(process.stdout.write(`${JSON.stringify(fN($e,ot),null,2)}
20514
20514
  `),process.exit(0));$e.parseAsync(process.argv).catch(e=>{Jt(e),process.stderr.write(`${e instanceof Error?e.message:String(e)}
20515
20515
  `),process.exit(1)});