@ggui-ai/console 0.5.0-rc.1 → 0.5.0-rc.2
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.
|
@@ -84,7 +84,7 @@ Error generating stack: `+i.message+`
|
|
|
84
84
|
|
|
85
85
|
`)}N.write("payload.value = newResult;"),N.write("return payload;");const $=N.compile();return(R,b)=>$(w,R,b)};let u;const f=Ko,p=!sv.jitless,h=p&&ox.value,y=n.catchall;let v;e._zod.parse=(w,N)=>{v??(v=l.value);const x=w.value;return f(x)?p&&h&&(N==null?void 0:N.async)===!1&&N.jitless!==!0?(u||(u=c(n.shape)),w=u(w,N),y?wv([],x,w,N,v,e):w):o(w,N):(w.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),w)}});function Wm(e,n,o,l){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const c=e.filter(u=>!Ri(u));return c.length===1?(n.value=c[0].value,c[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:o,errors:e.map(u=>u.issues.map(f=>dr(f,l,ur())))}),n)}const kv=ne("$ZodUnion",(e,n)=>{at.init(e,n),Ve(e._zod,"optin",()=>n.options.some(c=>c._zod.optin==="optional")?"optional":void 0),Ve(e._zod,"optout",()=>n.options.some(c=>c._zod.optout==="optional")?"optional":void 0),Ve(e._zod,"values",()=>{if(n.options.every(c=>c._zod.values))return new Set(n.options.flatMap(c=>Array.from(c._zod.values)))}),Ve(e._zod,"pattern",()=>{if(n.options.every(c=>c._zod.pattern)){const c=n.options.map(u=>u._zod.pattern);return new RegExp(`^(${c.map(u=>Mf(u.source)).join("|")})$`)}});const o=n.options.length===1,l=n.options[0]._zod.run;e._zod.parse=(c,u)=>{if(o)return l(c,u);let f=!1;const p=[];for(const g of n.options){const h=g._zod.run({value:c.value,issues:[]},u);if(h instanceof Promise)p.push(h),f=!0;else{if(h.issues.length===0)return h;p.push(h)}}return f?Promise.all(p).then(g=>Wm(g,c,e,u)):Wm(p,c,e,u)}}),Y5=ne("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,kv.init(e,n);const o=e._zod.parse;Ve(e._zod,"propValues",()=>{const c={};for(const u of n.options){const f=u._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(u)}"`);for(const[p,g]of Object.entries(f)){c[p]||(c[p]=new Set);for(const h of g)c[p].add(h)}}return c});const l=vc(()=>{var f;const c=n.options,u=new Map;for(const p of c){const g=(f=p._zod.propValues)==null?void 0:f[n.discriminator];if(!g||g.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(p)}"`);for(const h of g){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,p)}}return u});e._zod.parse=(c,u)=>{const f=c.value;if(!Ko(f))return c.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),c;const p=l.value.get(f==null?void 0:f[n.discriminator]);return p?p._zod.run(c,u):n.unionFallback?o(c,u):(c.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:f,path:[n.discriminator],inst:e}),c)}}),K5=ne("$ZodIntersection",(e,n)=>{at.init(e,n),e._zod.parse=(o,l)=>{const c=o.value,u=n.left._zod.run({value:c,issues:[]},l),f=n.right._zod.run({value:c,issues:[]},l);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([g,h])=>Jm(o,g,h)):Jm(o,u,f)}});function $f(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Ui(e)&&Ui(n)){const o=Object.keys(n),l=Object.keys(e).filter(u=>o.indexOf(u)!==-1),c={...e,...n};for(const u of l){const f=$f(e[u],n[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};c[u]=f.data}return{valid:!0,data:c}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let l=0;l<e.length;l++){const c=e[l],u=n[l],f=$f(c,u);if(!f.valid)return{valid:!1,mergeErrorPath:[l,...f.mergeErrorPath]};o.push(f.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Jm(e,n,o){const l=new Map;let c;for(const p of n.issues)if(p.code==="unrecognized_keys"){c??(c=p);for(const g of p.keys)l.has(g)||l.set(g,{}),l.get(g).l=!0}else e.issues.push(p);for(const p of o.issues)if(p.code==="unrecognized_keys")for(const g of p.keys)l.has(g)||l.set(g,{}),l.get(g).r=!0;else e.issues.push(p);const u=[...l].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(u.length&&c&&e.issues.push({...c,keys:u}),Ri(e))return e;const f=$f(n.value,o.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return e.value=f.data,e}const X5=ne("$ZodRecord",(e,n)=>{at.init(e,n),e._zod.parse=(o,l)=>{const c=o.value;if(!Ui(c))return o.issues.push({expected:"record",code:"invalid_type",input:c,inst:e}),o;const u=[],f=n.keyType._zod.values;if(f){o.value={};const p=new Set;for(const h of f)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);const y=n.valueType._zod.run({value:c[h],issues:[]},l);y instanceof Promise?u.push(y.then(v=>{v.issues.length&&o.issues.push(...Oi(h,v.issues)),o.value[h]=v.value})):(y.issues.length&&o.issues.push(...Oi(h,y.issues)),o.value[h]=y.value)}let g;for(const h in c)p.has(h)||(g=g??[],g.push(h));g&&g.length>0&&o.issues.push({code:"unrecognized_keys",input:c,inst:e,keys:g})}else{o.value={};for(const p of Reflect.ownKeys(c)){if(p==="__proto__")continue;let g=n.keyType._zod.run({value:p,issues:[]},l);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&vv.test(p)&&g.issues.length){const v=n.keyType._zod.run({value:Number(p),issues:[]},l);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(g=v)}if(g.issues.length){n.mode==="loose"?o.value[p]=c[p]:o.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(v=>dr(v,l,ur())),input:p,path:[p],inst:e});continue}const y=n.valueType._zod.run({value:c[p],issues:[]},l);y instanceof Promise?u.push(y.then(v=>{v.issues.length&&o.issues.push(...Oi(p,v.issues)),o.value[g.value]=v.value})):(y.issues.length&&o.issues.push(...Oi(p,y.issues)),o.value[g.value]=y.value)}}return u.length?Promise.all(u).then(()=>o):o}}),W5=ne("$ZodEnum",(e,n)=>{at.init(e,n);const o=cv(n.entries),l=new Set(o);e._zod.values=l,e._zod.pattern=new RegExp(`^(${o.filter(c=>lx.has(typeof c)).map(c=>typeof c=="string"?Ii(c):c.toString()).join("|")})$`),e._zod.parse=(c,u)=>{const f=c.value;return l.has(f)||c.issues.push({code:"invalid_value",values:o,input:f,inst:e}),c}}),J5=ne("$ZodLiteral",(e,n)=>{if(at.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const o=new Set(n.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.values.map(l=>typeof l=="string"?Ii(l):l?Ii(l.toString()):String(l)).join("|")})$`),e._zod.parse=(l,c)=>{const u=l.value;return o.has(u)||l.issues.push({code:"invalid_value",values:n.values,input:u,inst:e}),l}}),Q5=ne("$ZodTransform",(e,n)=>{at.init(e,n),e._zod.parse=(o,l)=>{if(l.direction==="backward")throw new lv(e.constructor.name);const c=n.transform(o.value,o);if(l.async)return(c instanceof Promise?c:Promise.resolve(c)).then(f=>(o.value=f,o));if(c instanceof Promise)throw new Ai;return o.value=c,o}});function Qm(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Nv=ne("$ZodOptional",(e,n)=>{at.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Ve(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Ve(e._zod,"pattern",()=>{const o=n.innerType._zod.pattern;return o?new RegExp(`^(${Mf(o.source)})?$`):void 0}),e._zod.parse=(o,l)=>{if(n.innerType._zod.optin==="optional"){const c=n.innerType._zod.run(o,l);return c instanceof Promise?c.then(u=>Qm(u,o.value)):Qm(c,o.value)}return o.value===void 0?o:n.innerType._zod.run(o,l)}}),e4=ne("$ZodExactOptional",(e,n)=>{Nv.init(e,n),Ve(e._zod,"values",()=>n.innerType._zod.values),Ve(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(o,l)=>n.innerType._zod.run(o,l)}),t4=ne("$ZodNullable",(e,n)=>{at.init(e,n),Ve(e._zod,"optin",()=>n.innerType._zod.optin),Ve(e._zod,"optout",()=>n.innerType._zod.optout),Ve(e._zod,"pattern",()=>{const o=n.innerType._zod.pattern;return o?new RegExp(`^(${Mf(o.source)}|null)$`):void 0}),Ve(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(o,l)=>o.value===null?o:n.innerType._zod.run(o,l)}),a4=ne("$ZodDefault",(e,n)=>{at.init(e,n),e._zod.optin="optional",Ve(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(o,l)=>{if(l.direction==="backward")return n.innerType._zod.run(o,l);if(o.value===void 0)return o.value=n.defaultValue,o;const c=n.innerType._zod.run(o,l);return c instanceof Promise?c.then(u=>eh(u,n)):eh(c,n)}});function eh(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const n4=ne("$ZodPrefault",(e,n)=>{at.init(e,n),e._zod.optin="optional",Ve(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(o,l)=>(l.direction==="backward"||o.value===void 0&&(o.value=n.defaultValue),n.innerType._zod.run(o,l))}),r4=ne("$ZodNonOptional",(e,n)=>{at.init(e,n),Ve(e._zod,"values",()=>{const o=n.innerType._zod.values;return o?new Set([...o].filter(l=>l!==void 0)):void 0}),e._zod.parse=(o,l)=>{const c=n.innerType._zod.run(o,l);return c instanceof Promise?c.then(u=>th(u,e)):th(c,e)}});function th(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const i4=ne("$ZodCatch",(e,n)=>{at.init(e,n),Ve(e._zod,"optin",()=>n.innerType._zod.optin),Ve(e._zod,"optout",()=>n.innerType._zod.optout),Ve(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(o,l)=>{if(l.direction==="backward")return n.innerType._zod.run(o,l);const c=n.innerType._zod.run(o,l);return c instanceof Promise?c.then(u=>(o.value=u.value,u.issues.length&&(o.value=n.catchValue({...o,error:{issues:u.issues.map(f=>dr(f,l,ur()))},input:o.value}),o.issues=[]),o)):(o.value=c.value,c.issues.length&&(o.value=n.catchValue({...o,error:{issues:c.issues.map(u=>dr(u,l,ur()))},input:o.value}),o.issues=[]),o)}}),o4=ne("$ZodPipe",(e,n)=>{at.init(e,n),Ve(e._zod,"values",()=>n.in._zod.values),Ve(e._zod,"optin",()=>n.in._zod.optin),Ve(e._zod,"optout",()=>n.out._zod.optout),Ve(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(o,l)=>{if(l.direction==="backward"){const u=n.out._zod.run(o,l);return u instanceof Promise?u.then(f=>ys(f,n.in,l)):ys(u,n.in,l)}const c=n.in._zod.run(o,l);return c instanceof Promise?c.then(u=>ys(u,n.out,l)):ys(c,n.out,l)}});function ys(e,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},o)}const l4=ne("$ZodReadonly",(e,n)=>{at.init(e,n),Ve(e._zod,"propValues",()=>n.innerType._zod.propValues),Ve(e._zod,"values",()=>n.innerType._zod.values),Ve(e._zod,"optin",()=>{var o,l;return(l=(o=n.innerType)==null?void 0:o._zod)==null?void 0:l.optin}),Ve(e._zod,"optout",()=>{var o,l;return(l=(o=n.innerType)==null?void 0:o._zod)==null?void 0:l.optout}),e._zod.parse=(o,l)=>{if(l.direction==="backward")return n.innerType._zod.run(o,l);const c=n.innerType._zod.run(o,l);return c instanceof Promise?c.then(ah):ah(c)}});function ah(e){return e.value=Object.freeze(e.value),e}const s4=ne("$ZodLazy",(e,n)=>{at.init(e,n),Ve(e._zod,"innerType",()=>n.getter()),Ve(e._zod,"pattern",()=>{var o,l;return(l=(o=e._zod.innerType)==null?void 0:o._zod)==null?void 0:l.pattern}),Ve(e._zod,"propValues",()=>{var o,l;return(l=(o=e._zod.innerType)==null?void 0:o._zod)==null?void 0:l.propValues}),Ve(e._zod,"optin",()=>{var o,l;return((l=(o=e._zod.innerType)==null?void 0:o._zod)==null?void 0:l.optin)??void 0}),Ve(e._zod,"optout",()=>{var o,l;return((l=(o=e._zod.innerType)==null?void 0:o._zod)==null?void 0:l.optout)??void 0}),e._zod.parse=(o,l)=>e._zod.innerType._zod.run(o,l)}),c4=ne("$ZodCustom",(e,n)=>{ra.init(e,n),at.init(e,n),e._zod.parse=(o,l)=>o,e._zod.check=o=>{const l=o.value,c=n.fn(l);if(c instanceof Promise)return c.then(u=>nh(u,o,l,e));nh(c,o,l,e)}});function nh(e,n,o,l){if(!e){const c={code:"custom",input:o,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(c.params=l._zod.def.params),n.issues.push(Xo(c))}}var rh;class u4{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...o){const l=o[0];return this._map.set(n,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const o=this._map.get(n);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(n),this}get(n){const o=n._zod.parent;if(o){const l={...this.get(o)??{}};delete l.id;const c={...l,...this._map.get(n)};return Object.keys(c).length?c:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function d4(){return new u4}(rh=globalThis).__zod_globalRegistry??(rh.__zod_globalRegistry=d4());const Yo=globalThis.__zod_globalRegistry;function f4(e,n){return new e({type:"string",..._e(n)})}function p4(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._e(n)})}function ih(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._e(n)})}function g4(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._e(n)})}function m4(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._e(n)})}function h4(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._e(n)})}function y4(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._e(n)})}function Ev(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._e(n)})}function v4(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._e(n)})}function $4(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._e(n)})}function b4(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._e(n)})}function x4(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._e(n)})}function _4(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._e(n)})}function j4(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._e(n)})}function S4(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._e(n)})}function w4(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._e(n)})}function k4(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._e(n)})}function N4(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._e(n)})}function E4(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._e(n)})}function z4(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._e(n)})}function C4(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._e(n)})}function T4(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._e(n)})}function M4(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._e(n)})}function R4(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._e(n)})}function O4(e,n){return new e({type:"string",format:"date",check:"string_format",..._e(n)})}function A4(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,..._e(n)})}function D4(e,n){return new e({type:"string",format:"duration",check:"string_format",..._e(n)})}function U4(e,n){return new e({type:"number",checks:[],..._e(n)})}function I4(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._e(n)})}function L4(e,n){return new e({type:"boolean",..._e(n)})}function V4(e,n){return new e({type:"null",..._e(n)})}function H4(e){return new e({type:"unknown"})}function B4(e,n){return new e({type:"never",..._e(n)})}function oh(e,n){return new bv({check:"less_than",..._e(n),value:e,inclusive:!1})}function Xd(e,n){return new bv({check:"less_than",..._e(n),value:e,inclusive:!0})}function lh(e,n){return new xv({check:"greater_than",..._e(n),value:e,inclusive:!1})}function Wd(e,n){return new xv({check:"greater_than",..._e(n),value:e,inclusive:!0})}function sh(e,n){return new t5({check:"multiple_of",..._e(n),value:e})}function zv(e,n){return new n5({check:"max_length",..._e(n),maximum:e})}function fc(e,n){return new r5({check:"min_length",..._e(n),minimum:e})}function Cv(e,n){return new i5({check:"length_equals",..._e(n),length:e})}function q4(e,n){return new o5({check:"string_format",format:"regex",..._e(n),pattern:e})}function P4(e){return new l5({check:"string_format",format:"lowercase",..._e(e)})}function Z4(e){return new s5({check:"string_format",format:"uppercase",..._e(e)})}function G4(e,n){return new c5({check:"string_format",format:"includes",..._e(n),includes:e})}function F4(e,n){return new u5({check:"string_format",format:"starts_with",..._e(n),prefix:e})}function Y4(e,n){return new d5({check:"string_format",format:"ends_with",..._e(n),suffix:e})}function Vi(e){return new f5({check:"overwrite",tx:e})}function K4(e){return Vi(n=>n.normalize(e))}function X4(){return Vi(e=>e.trim())}function W4(){return Vi(e=>e.toLowerCase())}function J4(){return Vi(e=>e.toUpperCase())}function Q4(){return Vi(e=>ix(e))}function e_(e,n,o){return new e({type:"array",element:n,..._e(o)})}function t_(e,n,o){return new e({type:"custom",check:"custom",fn:n,..._e(o)})}function a_(e){const n=n_(o=>(o.addIssue=l=>{if(typeof l=="string")o.issues.push(Xo(l,o.value,n._zod.def));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=o.value),c.inst??(c.inst=n),c.continue??(c.continue=!n._zod.def.abort),o.issues.push(Xo(c))}},e(o.value,o)));return n}function n_(e,n){const o=new ra({check:"custom",..._e(n)});return o._zod.check=e,o}function Tv(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Yo,target:n,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function yt(e,n,o={path:[],schemaPath:[]}){var y,v;var l;const c=e._zod.def,u=n.seen.get(e);if(u)return u.count++,o.schemaPath.includes(e)&&(u.cycle=o.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:o.path};n.seen.set(e,f);const p=(v=(y=e._zod).toJSONSchema)==null?void 0:v.call(y);if(p)f.schema=p;else{const w={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,f.schema,w);else{const x=f.schema,z=n.processors[c.type];if(!z)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${c.type}`);z(e,n,x,w)}const N=e._zod.parent;N&&(f.ref||(f.ref=N),yt(N,n,w),n.seen.get(N).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(f.schema,g),n.io==="input"&&Kt(e)&&(delete f.schema.examples,delete f.schema.default),n.io==="input"&&f.schema._prefault&&((l=f.schema).default??(l.default=f.schema._prefault)),delete f.schema._prefault,n.seen.get(e).schema}function Mv(e,n){var f,p,g,h;const o=e.seen.get(n);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=new Map;for(const y of e.seen.entries()){const v=(f=e.metadataRegistry.get(y[0]))==null?void 0:f.id;if(v){const w=l.get(v);if(w&&w!==y[0])throw new Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(v,y[0])}}const c=y=>{var z;const v=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(z=e.external.registry.get(y[0]))==null?void 0:z.id,k=e.external.uri??(S=>S);if(E)return{ref:k(E)};const $=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=$,{defId:$,ref:`${k("__shared")}#/${v}/${$}`}}if(y[1]===o)return{ref:"#"};const N=`#/${v}/`,x=y[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:N+x}},u=y=>{if(y[1].schema.$ref)return;const v=y[1],{ref:w,defId:N}=c(y);v.def={...v.schema},N&&(v.defId=N);const x=v.schema;for(const z in x)delete x[z];x.$ref=w};if(e.cycles==="throw")for(const y of e.seen.entries()){const v=y[1];if(v.cycle)throw new Error(`Cycle detected: #/${(p=v.cycle)==null?void 0:p.join("/")}/<root>
|
|
86
86
|
|
|
87
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const v=y[1];if(n===y[0]){u(y);continue}if(e.external){const N=(g=e.external.registry.get(y[0]))==null?void 0:g.id;if(n!==y[0]&&N){u(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){u(y);continue}if(v.cycle){u(y);continue}if(v.count>1&&e.reused==="ref"){u(y);continue}}}function Rv(e,n){var f,p,g;const o=e.seen.get(n);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=h=>{const y=e.seen.get(h);if(y.ref===null)return;const v=y.def??y.schema,w={...v},N=y.ref;if(y.ref=null,N){l(N);const z=e.seen.get(N),E=z.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(E)):Object.assign(v,E),Object.assign(v,w),h._zod.parent===N)for(const $ in v)$==="$ref"||$==="allOf"||$ in w||delete v[$];if(E.$ref&&z.def)for(const $ in v)$==="$ref"||$==="allOf"||$ in z.def&&JSON.stringify(v[$])===JSON.stringify(z.def[$])&&delete v[$]}const x=h._zod.parent;if(x&&x!==N){l(x);const z=e.seen.get(x);if(z!=null&&z.schema.$ref&&(v.$ref=z.schema.$ref,z.def))for(const E in v)E==="$ref"||E==="allOf"||E in z.def&&JSON.stringify(v[E])===JSON.stringify(z.def[E])&&delete v[E]}e.override({zodSchema:h,jsonSchema:v,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())l(h[0]);const c={};if(e.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":e.target,(f=e.external)!=null&&f.uri){const h=(p=e.external.registry.get(n))==null?void 0:p.id;if(!h)throw new Error("Schema is missing an `id` property");c.$id=e.external.uri(h)}Object.assign(c,o.def??o.schema);const u=((g=e.external)==null?void 0:g.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(u[y.defId]=y.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{const h=JSON.parse(JSON.stringify(c));return Object.defineProperty(h,"~standard",{value:{...n["~standard"],jsonSchema:{input:pc(n,"input",e.processors),output:pc(n,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Kt(e,n){const o=n??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return Kt(l.element,o);if(l.type==="set")return Kt(l.valueType,o);if(l.type==="lazy")return Kt(l.getter(),o);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return Kt(l.innerType,o);if(l.type==="intersection")return Kt(l.left,o)||Kt(l.right,o);if(l.type==="record"||l.type==="map")return Kt(l.keyType,o)||Kt(l.valueType,o);if(l.type==="pipe")return Kt(l.in,o)||Kt(l.out,o);if(l.type==="object"){for(const c in l.shape)if(Kt(l.shape[c],o))return!0;return!1}if(l.type==="union"){for(const c of l.options)if(Kt(c,o))return!0;return!1}if(l.type==="tuple"){for(const c of l.items)if(Kt(c,o))return!0;return!!(l.rest&&Kt(l.rest,o))}return!1}const r_=(e,n={})=>o=>{const l=Tv({...o,processors:n});return yt(e,l),Mv(l,e),Rv(l,e)},pc=(e,n,o={})=>l=>{const{libraryOptions:c,target:u}=l??{},f=Tv({...c??{},target:u,io:n,processors:o});return yt(e,f),Mv(f,e),Rv(f,e)},i_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o_=(e,n,o,l)=>{const c=o;c.type="string";const{minimum:u,maximum:f,format:p,patterns:g,contentEncoding:h}=e._zod.bag;if(typeof u=="number"&&(c.minLength=u),typeof f=="number"&&(c.maxLength=f),p&&(c.format=i_[p]??p,c.format===""&&delete c.format,p==="time"&&delete c.format),h&&(c.contentEncoding=h),g&&g.size>0){const y=[...g];y.length===1?c.pattern=y[0].source:y.length>1&&(c.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},l_=(e,n,o,l)=>{const c=o,{minimum:u,maximum:f,format:p,multipleOf:g,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof p=="string"&&p.includes("int")?c.type="integer":c.type="number",typeof y=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(c.minimum=y,c.exclusiveMinimum=!0):c.exclusiveMinimum=y),typeof u=="number"&&(c.minimum=u,typeof y=="number"&&n.target!=="draft-04"&&(y>=u?delete c.minimum:delete c.exclusiveMinimum)),typeof h=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(c.maximum=h,c.exclusiveMaximum=!0):c.exclusiveMaximum=h),typeof f=="number"&&(c.maximum=f,typeof h=="number"&&n.target!=="draft-04"&&(h<=f?delete c.maximum:delete c.exclusiveMaximum)),typeof g=="number"&&(c.multipleOf=g)},s_=(e,n,o,l)=>{o.type="boolean"},c_=(e,n,o,l)=>{n.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},u_=(e,n,o,l)=>{o.not={}},d_=(e,n,o,l)=>{},f_=(e,n,o,l)=>{const c=e._zod.def,u=cv(c.entries);u.every(f=>typeof f=="number")&&(o.type="number"),u.every(f=>typeof f=="string")&&(o.type="string"),o.enum=u},p_=(e,n,o,l)=>{const c=e._zod.def,u=[];for(const f of c.values)if(f===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(f))}else u.push(f);if(u.length!==0)if(u.length===1){const f=u[0];o.type=f===null?"null":typeof f,n.target==="draft-04"||n.target==="openapi-3.0"?o.enum=[f]:o.const=f}else u.every(f=>typeof f=="number")&&(o.type="number"),u.every(f=>typeof f=="string")&&(o.type="string"),u.every(f=>typeof f=="boolean")&&(o.type="boolean"),u.every(f=>f===null)&&(o.type="null"),o.enum=u},g_=(e,n,o,l)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},m_=(e,n,o,l)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},h_=(e,n,o,l)=>{const c=o,u=e._zod.def,{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(c.minItems=f),typeof p=="number"&&(c.maxItems=p),c.type="array",c.items=yt(u.element,n,{...l,path:[...l.path,"items"]})},y_=(e,n,o,l)=>{var h;const c=o,u=e._zod.def;c.type="object",c.properties={};const f=u.shape;for(const y in f)c.properties[y]=yt(f[y],n,{...l,path:[...l.path,"properties",y]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(y=>{const v=u.shape[y]._zod;return n.io==="input"?v.optin===void 0:v.optout===void 0}));g.size>0&&(c.required=Array.from(g)),((h=u.catchall)==null?void 0:h._zod.def.type)==="never"?c.additionalProperties=!1:u.catchall?u.catchall&&(c.additionalProperties=yt(u.catchall,n,{...l,path:[...l.path,"additionalProperties"]})):n.io==="output"&&(c.additionalProperties=!1)},v_=(e,n,o,l)=>{const c=e._zod.def,u=c.inclusive===!1,f=c.options.map((p,g)=>yt(p,n,{...l,path:[...l.path,u?"oneOf":"anyOf",g]}));u?o.oneOf=f:o.anyOf=f},$_=(e,n,o,l)=>{const c=e._zod.def,u=yt(c.left,n,{...l,path:[...l.path,"allOf",0]}),f=yt(c.right,n,{...l,path:[...l.path,"allOf",1]}),p=h=>"allOf"in h&&Object.keys(h).length===1,g=[...p(u)?u.allOf:[u],...p(f)?f.allOf:[f]];o.allOf=g},b_=(e,n,o,l)=>{const c=o,u=e._zod.def;c.type="object";const f=u.keyType,p=f._zod.bag,g=p==null?void 0:p.patterns;if(u.mode==="loose"&&g&&g.size>0){const y=yt(u.valueType,n,{...l,path:[...l.path,"patternProperties","*"]});c.patternProperties={};for(const v of g)c.patternProperties[v.source]=y}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(c.propertyNames=yt(u.keyType,n,{...l,path:[...l.path,"propertyNames"]})),c.additionalProperties=yt(u.valueType,n,{...l,path:[...l.path,"additionalProperties"]});const h=f._zod.values;if(h){const y=[...h].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(c.required=y)}},x_=(e,n,o,l)=>{const c=e._zod.def,u=yt(c.innerType,n,l),f=n.seen.get(e);n.target==="openapi-3.0"?(f.ref=c.innerType,o.nullable=!0):o.anyOf=[u,{type:"null"}]},__=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType},j_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,o.default=JSON.parse(JSON.stringify(c.defaultValue))},S_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,n.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},w_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=f},k_=(e,n,o,l)=>{const c=e._zod.def,u=n.io==="input"?c.in._zod.def.type==="transform"?c.out:c.in:c.out;yt(u,n,l);const f=n.seen.get(e);f.ref=u},N_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,o.readOnly=!0},Ov=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType},E_=(e,n,o,l)=>{const c=e._zod.innerType;yt(c,n,l);const u=n.seen.get(e);u.ref=c},z_=ne("ZodISODateTime",(e,n)=>{k5.init(e,n),st.init(e,n)});function C_(e){return R4(z_,e)}const T_=ne("ZodISODate",(e,n)=>{N5.init(e,n),st.init(e,n)});function M_(e){return O4(T_,e)}const R_=ne("ZodISOTime",(e,n)=>{E5.init(e,n),st.init(e,n)});function O_(e){return A4(R_,e)}const A_=ne("ZodISODuration",(e,n)=>{z5.init(e,n),st.init(e,n)});function D_(e){return D4(A_,e)}const U_=(e,n)=>{pv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>vx(e,o)},flatten:{value:o=>yx(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,vf,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,vf,2)}},isEmpty:{get(){return e.issues.length===0}}})},za=ne("ZodError",U_,{Parent:Error}),I_=Of(za),L_=Af(za),V_=$c(za),H_=bc(za),B_=xx(za),q_=_x(za),P_=jx(za),Z_=Sx(za),G_=wx(za),F_=kx(za),Y_=Nx(za),K_=Ex(za),nt=ne("ZodType",(e,n)=>(at.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:pc(e,"input"),output:pc(e,"output")}}),e.toJSONSchema=r_(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...o)=>e.clone(gr(n,{checks:[...n.checks??[],...o.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(o,l)=>mr(e,o,l),e.brand=()=>e,e.register=((o,l)=>(o.add(e,l),e)),e.parse=(o,l)=>I_(e,o,l,{callee:e.parse}),e.safeParse=(o,l)=>V_(e,o,l),e.parseAsync=async(o,l)=>L_(e,o,l,{callee:e.parseAsync}),e.safeParseAsync=async(o,l)=>H_(e,o,l),e.spa=e.safeParseAsync,e.encode=(o,l)=>B_(e,o,l),e.decode=(o,l)=>q_(e,o,l),e.encodeAsync=async(o,l)=>P_(e,o,l),e.decodeAsync=async(o,l)=>Z_(e,o,l),e.safeEncode=(o,l)=>G_(e,o,l),e.safeDecode=(o,l)=>F_(e,o,l),e.safeEncodeAsync=async(o,l)=>Y_(e,o,l),e.safeDecodeAsync=async(o,l)=>K_(e,o,l),e.refine=(o,l)=>e.check(Pj(o,l)),e.superRefine=o=>e.check(Zj(o)),e.overwrite=o=>e.check(Vi(o)),e.optional=()=>dh(e),e.exactOptional=()=>Cj(e),e.nullable=()=>fh(e),e.nullish=()=>dh(fh(e)),e.nonoptional=o=>Dj(e,o),e.array=()=>St(e),e.or=o=>yn([e,o]),e.and=o=>Sj(e,o),e.transform=o=>ph(e,Ej(o)),e.default=o=>Rj(e,o),e.prefault=o=>Aj(e,o),e.catch=o=>Ij(e,o),e.pipe=o=>ph(e,o),e.readonly=()=>Hj(e),e.describe=o=>{const l=e.clone();return Yo.add(l,{description:o}),l},Object.defineProperty(e,"description",{get(){var o;return(o=Yo.get(e))==null?void 0:o.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Yo.get(e);const l=e.clone();return Yo.add(l,o[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=o=>o(e),e)),Av=ne("_ZodString",(e,n)=>{Df.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>o_(e,l,c);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...l)=>e.check(q4(...l)),e.includes=(...l)=>e.check(G4(...l)),e.startsWith=(...l)=>e.check(F4(...l)),e.endsWith=(...l)=>e.check(Y4(...l)),e.min=(...l)=>e.check(fc(...l)),e.max=(...l)=>e.check(zv(...l)),e.length=(...l)=>e.check(Cv(...l)),e.nonempty=(...l)=>e.check(fc(1,...l)),e.lowercase=l=>e.check(P4(l)),e.uppercase=l=>e.check(Z4(l)),e.trim=()=>e.check(X4()),e.normalize=(...l)=>e.check(K4(...l)),e.toLowerCase=()=>e.check(W4()),e.toUpperCase=()=>e.check(J4()),e.slugify=()=>e.check(Q4())}),X_=ne("ZodString",(e,n)=>{Df.init(e,n),Av.init(e,n),e.email=o=>e.check(p4(W_,o)),e.url=o=>e.check(Ev(Dv,o)),e.jwt=o=>e.check(M4(fj,o)),e.emoji=o=>e.check(v4(J_,o)),e.guid=o=>e.check(ih(ch,o)),e.uuid=o=>e.check(g4(vs,o)),e.uuidv4=o=>e.check(m4(vs,o)),e.uuidv6=o=>e.check(h4(vs,o)),e.uuidv7=o=>e.check(y4(vs,o)),e.nanoid=o=>e.check($4(Q_,o)),e.guid=o=>e.check(ih(ch,o)),e.cuid=o=>e.check(b4(ej,o)),e.cuid2=o=>e.check(x4(tj,o)),e.ulid=o=>e.check(_4(aj,o)),e.base64=o=>e.check(z4(cj,o)),e.base64url=o=>e.check(C4(uj,o)),e.xid=o=>e.check(j4(nj,o)),e.ksuid=o=>e.check(S4(rj,o)),e.ipv4=o=>e.check(w4(ij,o)),e.ipv6=o=>e.check(k4(oj,o)),e.cidrv4=o=>e.check(N4(lj,o)),e.cidrv6=o=>e.check(E4(sj,o)),e.e164=o=>e.check(T4(dj,o)),e.datetime=o=>e.check(C_(o)),e.date=o=>e.check(M_(o)),e.time=o=>e.check(O_(o)),e.duration=o=>e.check(D_(o))});function G(e){return f4(X_,e)}const st=ne("ZodStringFormat",(e,n)=>{it.init(e,n),Av.init(e,n)}),W_=ne("ZodEmail",(e,n)=>{y5.init(e,n),st.init(e,n)}),ch=ne("ZodGUID",(e,n)=>{m5.init(e,n),st.init(e,n)}),vs=ne("ZodUUID",(e,n)=>{h5.init(e,n),st.init(e,n)}),Dv=ne("ZodURL",(e,n)=>{v5.init(e,n),st.init(e,n)});function $s(e){return Ev(Dv,e)}const J_=ne("ZodEmoji",(e,n)=>{$5.init(e,n),st.init(e,n)}),Q_=ne("ZodNanoID",(e,n)=>{b5.init(e,n),st.init(e,n)}),ej=ne("ZodCUID",(e,n)=>{x5.init(e,n),st.init(e,n)}),tj=ne("ZodCUID2",(e,n)=>{_5.init(e,n),st.init(e,n)}),aj=ne("ZodULID",(e,n)=>{j5.init(e,n),st.init(e,n)}),nj=ne("ZodXID",(e,n)=>{S5.init(e,n),st.init(e,n)}),rj=ne("ZodKSUID",(e,n)=>{w5.init(e,n),st.init(e,n)}),ij=ne("ZodIPv4",(e,n)=>{C5.init(e,n),st.init(e,n)}),oj=ne("ZodIPv6",(e,n)=>{T5.init(e,n),st.init(e,n)}),lj=ne("ZodCIDRv4",(e,n)=>{M5.init(e,n),st.init(e,n)}),sj=ne("ZodCIDRv6",(e,n)=>{R5.init(e,n),st.init(e,n)}),cj=ne("ZodBase64",(e,n)=>{O5.init(e,n),st.init(e,n)}),uj=ne("ZodBase64URL",(e,n)=>{D5.init(e,n),st.init(e,n)}),dj=ne("ZodE164",(e,n)=>{U5.init(e,n),st.init(e,n)}),fj=ne("ZodJWT",(e,n)=>{L5.init(e,n),st.init(e,n)}),Uv=ne("ZodNumber",(e,n)=>{jv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>l_(e,l,c),e.gt=(l,c)=>e.check(lh(l,c)),e.gte=(l,c)=>e.check(Wd(l,c)),e.min=(l,c)=>e.check(Wd(l,c)),e.lt=(l,c)=>e.check(oh(l,c)),e.lte=(l,c)=>e.check(Xd(l,c)),e.max=(l,c)=>e.check(Xd(l,c)),e.int=l=>e.check(uh(l)),e.safe=l=>e.check(uh(l)),e.positive=l=>e.check(lh(0,l)),e.nonnegative=l=>e.check(Wd(0,l)),e.negative=l=>e.check(oh(0,l)),e.nonpositive=l=>e.check(Xd(0,l)),e.multipleOf=(l,c)=>e.check(sh(l,c)),e.step=(l,c)=>e.check(sh(l,c)),e.finite=()=>e;const 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});function et(e){return U4(Uv,e)}const pj=ne("ZodNumberFormat",(e,n)=>{V5.init(e,n),Uv.init(e,n)});function uh(e){return I4(pj,e)}const gj=ne("ZodBoolean",(e,n)=>{H5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>s_(e,o,l)});function Zt(e){return L4(gj,e)}const mj=ne("ZodNull",(e,n)=>{B5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>c_(e,o,l)});function hj(e){return V4(mj,e)}const yj=ne("ZodUnknown",(e,n)=>{q5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>d_()});function fr(){return H4(yj)}const vj=ne("ZodNever",(e,n)=>{P5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>u_(e,o,l)});function $j(e){return B4(vj,e)}const bj=ne("ZodArray",(e,n)=>{Z5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>h_(e,o,l,c),e.element=n.element,e.min=(o,l)=>e.check(fc(o,l)),e.nonempty=o=>e.check(fc(1,o)),e.max=(o,l)=>e.check(zv(o,l)),e.length=(o,l)=>e.check(Cv(o,l)),e.unwrap=()=>e.element});function St(e,n){return e_(bj,e,n)}const xj=ne("ZodObject",(e,n)=>{F5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>y_(e,o,l,c),Ve(e,"shape",()=>n.shape),e.keyof=()=>rt(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fr()}),e.loose=()=>e.clone({...e._zod.def,catchall:fr()}),e.strict=()=>e.clone({...e._zod.def,catchall:$j()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>fx(e,o),e.safeExtend=o=>px(e,o),e.merge=o=>gx(e,o),e.pick=o=>ux(e,o),e.omit=o=>dx(e,o),e.partial=(...o)=>mx(Lv,e,o[0]),e.required=(...o)=>hx(Vv,e,o[0])});function se(e,n){const o={type:"object",shape:e??{},..._e(n)};return new xj(o)}const Iv=ne("ZodUnion",(e,n)=>{kv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>v_(e,o,l,c),e.options=n.options});function yn(e,n){return new Iv({type:"union",options:e,..._e(n)})}const _j=ne("ZodDiscriminatedUnion",(e,n)=>{Iv.init(e,n),Y5.init(e,n)});function el(e,n,o){return new _j({type:"union",options:n,discriminator:e,..._e(o)})}const jj=ne("ZodIntersection",(e,n)=>{K5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>$_(e,o,l,c)});function Sj(e,n){return new jj({type:"intersection",left:e,right:n})}const wj=ne("ZodRecord",(e,n)=>{X5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>b_(e,o,l,c),e.keyType=n.keyType,e.valueType=n.valueType});function vt(e,n,o){return new wj({type:"record",keyType:e,valueType:n,..._e(o)})}const bf=ne("ZodEnum",(e,n)=>{W5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>f_(e,l,c),e.enum=n.entries,e.options=Object.values(n.entries);const o=new Set(Object.keys(n.entries));e.extract=(l,c)=>{const u={};for(const f of l)if(o.has(f))u[f]=n.entries[f];else throw new Error(`Key ${f} not found in enum`);return new bf({...n,checks:[],..._e(c),entries:u})},e.exclude=(l,c)=>{const u={...n.entries};for(const f of l)if(o.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new bf({...n,checks:[],..._e(c),entries:u})}});function rt(e,n){const o=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new bf({type:"enum",entries:o,..._e(n)})}const kj=ne("ZodLiteral",(e,n)=>{J5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>p_(e,o,l),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Te(e,n){return new kj({type:"literal",values:Array.isArray(e)?e:[e],..._e(n)})}const Nj=ne("ZodTransform",(e,n)=>{Q5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>m_(e,o),e._zod.parse=(o,l)=>{if(l.direction==="backward")throw new lv(e.constructor.name);o.addIssue=u=>{if(typeof u=="string")o.issues.push(Xo(u,o.value,n));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=o.value),f.inst??(f.inst=e),o.issues.push(Xo(f))}};const c=n.transform(o.value,o);return c instanceof Promise?c.then(u=>(o.value=u,o)):(o.value=c,o)}});function Ej(e){return new Nj({type:"transform",transform:e})}const Lv=ne("ZodOptional",(e,n)=>{Nv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>Ov(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function dh(e){return new Lv({type:"optional",innerType:e})}const zj=ne("ZodExactOptional",(e,n)=>{e4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>Ov(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Cj(e){return new zj({type:"optional",innerType:e})}const Tj=ne("ZodNullable",(e,n)=>{t4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>x_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function fh(e){return new Tj({type:"nullable",innerType:e})}const Mj=ne("ZodDefault",(e,n)=>{a4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>j_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rj(e,n){return new Mj({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():dv(n)}})}const Oj=ne("ZodPrefault",(e,n)=>{n4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>S_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Aj(e,n){return new Oj({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():dv(n)}})}const Vv=ne("ZodNonOptional",(e,n)=>{r4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>__(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Dj(e,n){return new Vv({type:"nonoptional",innerType:e,..._e(n)})}const Uj=ne("ZodCatch",(e,n)=>{i4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>w_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ij(e,n){return new Uj({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Lj=ne("ZodPipe",(e,n)=>{o4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>k_(e,o,l,c),e.in=n.in,e.out=n.out});function ph(e,n){return new Lj({type:"pipe",in:e,out:n})}const Vj=ne("ZodReadonly",(e,n)=>{l4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>N_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Hj(e){return new Vj({type:"readonly",innerType:e})}const Bj=ne("ZodLazy",(e,n)=>{s4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>E_(e,o,l,c),e.unwrap=()=>e._zod.def.getter()});function Hv(e){return new Bj({type:"lazy",getter:e})}const qj=ne("ZodCustom",(e,n)=>{c4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>g_(e,o)});function Pj(e,n={}){return t_(qj,e,n)}function Zj(e){return a_(e)}const Bv="@ggui-ai/gadgets",Gj="0.5.0-rc.1",Fj=[{package:Bv,version:Gj,exports:[{hook:"useCamera",permission:"camera",description:"Capture stills or live video from the device camera.",usage:"Mount when the intent names photo capture, QR / barcode scanning, video recording, or anything that requires a camera feed. The hook returns a stream once `start()` resolves; thread the resulting blob or stream URL into a contextSpec slot or an actionSpec payload to surface it to the agent.",example:{call:"const cam = useCamera({ facingMode: 'environment' }); // on button click: await cam.start()",returns:{status:"completed",value:{dataUrl:"data:image/png;base64,…",width:640,height:480,mimeType:"image/png"}}}},{hook:"useClipboardPaste",permission:"clipboard-read",description:"Read the system clipboard contents on user gesture.",usage:"Mount when the intent involves importing copied content (paste-into-form, paste-image-to-upload, paste-link). The Permissions API requires a user gesture; gate `start()` behind a button click. Returned value lands in a contextSpec slot or an actionSpec payload.",example:{call:"const paste = useClipboardPaste(); // on button click: await paste.start()",returns:{status:"completed",value:"pasted clipboard text"}}},{hook:"useClipboardWrite",permission:"clipboard-write",description:"Write to the system clipboard on user gesture.",usage:"Mount when the intent includes copying generated text, share links, codes, or transcripts to the system clipboard. Fire an actionSpec event so the agent observes the act (it does not see the written value — that stays component-local).",example:{call:"const write = useClipboardWrite({ text: 'hello' }); // on button click: await write.start()",returns:{status:"completed",value:"hello"}}},{hook:"useFilePicker",description:"Open the native file picker and read selected files.",usage:"Mount when the intent names file upload, attachment selection, or document import. No permission required. The hook returns the picked files plus metadata; thread file refs / data URLs into a contextSpec slot or actionSpec payload.",example:{call:"const picker = useFilePicker({ accept: 'image/*' }); // on button click: await picker.start()",returns:{status:"completed",value:{files:[{name:"photo.png",type:"image/png",size:12345,_file:"<File>"}]}}}},{hook:"useGeolocation",permission:"geolocation",description:"Resolve the device's current geolocation.",usage:'Mount when the intent names "current location", maps, nearby search, location-aware UI. Browser prompts the user on `start()`; the hook returns coordinates once granted. Thread the resolved coords into a contextSpec slot so the agent observes the latest fix.',example:{call:"const geo = useGeolocation(); // on button click: await geo.start()",returns:{status:"completed",value:{latitude:37.7749,longitude:-122.4194,accuracy:20,timestamp:1718e9}}}},{hook:"useMicrophone",permission:"microphone",description:"Capture audio from the device microphone.",usage:"Mount when the intent names voice memos, audio messages, dictation, voice-driven UI. Returns an audio stream / blob; thread it into an actionSpec payload at recording-stop, or into a contextSpec slot for live transcription pipelines.",example:{call:"const mic = useMicrophone(); // record on click: await mic.start(); end with mic.stop()",returns:{status:"completed",value:{blob:"<Blob>",durationMs:4200,mimeType:"audio/webm"}}}},{hook:"useNotifications",permission:"notifications",description:"Show system / browser notifications to the user.",usage:"Mount when the intent involves alerting the user about something (reminders, completion of long tasks, incoming messages) and the UI may be in the background. Permission is prompted on first `start()`; the agent does NOT see notification dismissal directly — surface it via an actionSpec if needed.",example:{call:"const notify = useNotifications({ title: 'Done' }); // after the task completes: await notify.start()",returns:{status:"completed",value:{outcome:"closed"}}}}]}];Object.freeze(new Set(Fj.flatMap(e=>e.exports).map(e=>e.hook).filter(e=>e!==void 0)));const Uf=/^use[A-Z][A-Za-z0-9]*$/,If=/^[A-Z][A-Za-z0-9]*$/,Lf=["geolocation","notifications","microphone","camera","persistent-storage","midi","clipboard-read","clipboard-write","speaker-selection","storage-access","background-sync","accelerometer","gyroscope","magnetometer","ambient-light-sensor","screen-wake-lock"];new Set(Lf);const ft=Hv(()=>yn([G(),et(),Zt(),hj(),St(ft),vt(G(),ft)])),mn=Hv(()=>se({type:rt(["string","number","integer","boolean","array","object","null"]).optional(),description:G().optional(),enum:St(ft).optional(),default:ft.optional(),example:ft.optional(),items:mn.optional(),properties:vt(G(),mn).optional(),required:St(G()).optional(),additionalProperties:yn([mn,Zt()]).optional(),format:G().optional()}).passthrough()),Yj=se({description:G().optional(),schema:mn,required:Zt().optional(),default:ft.optional(),example:ft.optional(),sourceTool:G().optional()}).strict(),Kj=se({description:G().optional(),properties:vt(G(),Yj)}).strict(),Xj=se({description:G().optional(),label:G(),schema:mn.optional(),example:ft.optional(),icon:G().optional(),confirm:Zt().optional(),nextStep:G().min(1).optional()}).strict(),Wj=vt(G(),Xj),Jj=se({description:G().optional(),schema:mn,example:ft.optional(),mode:rt(["append","replace"]).optional(),replay:rt(["latest","all","none"]).optional(),complete:Zt().optional(),source:se({tool:G(),args:vt(G(),ft).optional()}).strict().optional()}).strict(),Qj=vt(G(),Jj),eS=se({description:G().optional(),schema:mn,default:ft.optional(),debounceMs:et().int().nonnegative().optional(),example:ft.optional()}).strict(),tS=vt(G(),eS),aS=se({serverInfo:se({name:G(),version:G().optional()}).strict().optional(),toolInfo:se({inputSchema:mn,description:G().optional(),outputSchema:mn.optional()}).strict(),usage:G().optional(),example:se({input:ft,output:ft}).strict().optional()}).strict(),nS=se({tools:vt(G(),aS)}).passthrough(),qv=/^GGUI_PUBLIC_APP_[A-Z0-9_]+$/,rS=St(G().regex(qv)).readonly(),gh=/^sha384-[A-Za-z0-9+/]+=*$/,Pv=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,iS=/^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/,oS=/^[a-z0-9.-]+(:\d+)?$/,Zv={gotchas:G().optional()},mh={...Zv,description:G().optional(),usage:G().optional(),example:ft.optional(),permission:G().optional()},hh={...Zv,description:G().min(1),usage:G().min(1),example:ft,permission:rt(Lf).optional()},Gv={version:G().regex(iS),package:G().regex(Pv),bundleUrl:$s().optional(),bundleHost:G().regex(oS).optional(),bundleSri:G().regex(gh).optional(),styleUrl:$s().optional(),connect:St($s()).readonly().optional(),requires:rS.optional(),typesUrl:$s().optional(),typesSri:G().regex(gh).optional()},lS=yn([se({hook:G().regex(Uf),...mh}).strict(),se({component:G().regex(If),...mh}).strict()]),sS=yn([se({hook:G().regex(Uf),...hh}).strict(),se({component:G().regex(If),...hh}).strict()]);se({...Gv,exports:St(lS).min(1)}).strict();const cS=se({...Gv,exports:St(sS).min(1)}).strict();cS.refine(e=>e.package===Bv||typeof e.typesUrl=="string",{message:"registered GadgetDescriptor MUST declare a `typesUrl` (HTTPS URL to the package's .d.ts) — the code-gen sandbox loads it to typecheck generated component code against the export signatures. Run `tsup --dts` (or `tsc --declaration`) in the wrapper build and publish the emitted .d.ts. Only the first-party `@ggui-ai/gadgets` stdlib is exempt.",path:["typesUrl"]});const uS=se({description:G().optional(),usage:G().optional()}).strict(),dS=vt(G().refine(e=>Uf.test(e)||If.test(e),{message:"gadget export name must be a `use`-prefixed hook or a PascalCase component identifier"}),uS).refine(e=>Object.keys(e).length>0,{message:"a `clientCapabilities.gadgets` package entry must declare at least one export"}),fS=se({gadgets:vt(G().regex(Pv),dS)}).strict();vt(G().regex(qv),G()).readonly();const tl=se({propsSpec:Kj.optional(),actionSpec:Wj.optional(),streamSpec:Qj.optional(),contextSpec:tS.optional(),agentCapabilities:nS.optional(),clientCapabilities:fS.optional()}).passthrough(),Fv=se({kind:Te("llm"),generator:G().min(1),model:G().min(1)}).strict(),Yv=se({kind:Te("user")}).strict(),pS=se({kind:Te("curated")}).strict(),Kv=yn([Fv,Yv,pS]),_c=se({persona:G().optional().describe('Design persona, e.g. "minimalist" / "data-dense". Part of cache identity.'),aesthetic:G().optional().describe('Visual aesthetic, e.g. "calm" / "ornate". Part of cache identity.'),context:vt(G(),ft).optional().describe('Deliberate design-shaping signals (e.g. {situation:"sad"}) — part of cache identity. NOT for per-user runtime data; put that in propsSpec/contextSpec.'),seedPrompt:G().optional().describe("Generation seed directive. Part of cache identity.")}).strict(),gS=se({blueprintId:G().min(1),contractHash:G().min(1),appId:G().min(1),codeS3Url:G().optional(),codeHash:G().optional(),source:Kv,validatorScore:et().min(0).max(1).optional(),variance:_c,isOperatorDefault:Te(!0).optional(),createdAt:G().min(1),createdBy:rt(["agent","operator"]),contract:tl,contractEmbedding:St(et()).optional()}).strict(),mS=se({hash:et().min(0).optional(),embed:et().min(0).optional(),struct:et().min(0).optional(),variance:et().min(0).optional(),intent:et().min(0).optional()}).strict();se({weights:mS.optional(),threshold:et().min(0).max(1).optional(),topK:et().int().min(1).optional()}).strict();const hS=rt(["cache","agent","synth"]),yS=yn([se({op:Te("add"),path:G(),value:ft}).strict(),se({op:Te("remove"),path:G()}).strict(),se({op:Te("replace"),path:G(),value:ft}).strict()]),vS=St(yS),$S=se({contract:tl,variance:se({persona:G().optional(),aesthetic:G().optional(),context:vt(G(),ft).optional(),seedPrompt:G().optional()}).strict().optional(),generator:G().optional()}).strict(),bS=$S,xS=se({blueprintId:G().min(1).optional(),contractHash:G().min(1),codeHash:G().optional(),source:Kv.optional(),variance:_c,selectedReason:G().optional()}).strict(),_S=se({code:G().min(1),severity:rt(["error","warn"]),path:G(),message:G()}).strict(),jS=se({contractDiff:vS,reasoning:G()}).strict(),SS=se({origin:hS,rationale:G(),blueprintMeta:xS,proposedContractSummary:G().optional(),amendments:jS.optional(),validationFindings:St(_S).optional()}).strict(),wS=se({width:et(),height:et()}),kS=se({viewport:wS,platform:rt(["web","mobile","desktop"]),deviceType:rt(["phone","tablet","desktop"]),orientation:rt(["portrait","landscape"]),devicePixelRatio:et().optional(),touchPrimary:Zt().optional(),shellType:rt(["chat","fullscreen","spatial"]).optional(),colorScheme:rt(["light","dark"]).optional(),reducedMotion:Zt().optional()}).passthrough(),NS={sessionId:G().min(1).describe("Globally-unique sessionId to consume events from. Cross-tenant access surfaces uniformly as session_not_found."),timeout:et().int().min(0).max(25).optional().describe("Inline long-poll seconds, integer in [0, 25]. 0 = immediate. Values outside the bound reject INVALID_PARAMS. Returns on first event OR timeout; re-call on empty to keep waiting — longer waits are your loop, not a bigger timeout.")};se(NS);const ES={sessionId:G().min(1),channel:G().min(1),payload:fr(),complete:Zt().optional()};se(ES);const zS={sessionId:G().min(1).describe("GguiSession opaque id (UUID) — returned by ggui_render.")};se(zS);const CS={};se(CS);const TS={query:G().min(1).describe("Natural-language description of the UI you're looking for"),limit:et().int().min(1).max(100).optional()};se(TS);const MS={blueprintId:G().min(1).describe("The stable blueprint id declared via ggui.ui.json#id. Must match an entry in this server's UI registry.")};se(MS);const RS={};se(RS);const OS={serviceId:G().min(1),reason:G().optional(),sessionId:G().optional()};se(OS);se({intent:G().min(1).describe('Concise purpose — same intent = same component reused. e.g. "Gmail inbox for email triage"'),blueprintDraft:bS.describe("Agent's draft: contract (required) + optional variance + optional generator slug hint. The server combines this with cached blueprints + validator outcomes to produce a three-mode suggestion (cache / agent / synth)."),forceCreate:Zt().optional()}).strict();se({handshakeId:G().describe("Stable id — pass to ggui_render / ggui_update"),action:rt(["create","reuse","update","replace","declined"]),suggestion:SS.describe("Server's suggestion — origin-routed (cache | agent | synth). Always carries a provisional `blueprintMeta` the agent reuses by rendering WITHOUT `override` (accept the proposal as-is)."),reason:G().max(280).optional().describe("Short rationale (≤280 chars) for the `action` value. Surfaced for agent + operator visibility; truncated to keep the structuredContent payload predictable."),nextStep:se({tool:Te("ggui_render"),description:G(),example:G()}).optional().describe("Wire-shape recovery hint. A worked literal example of the next ggui_render call the agent should emit — the example string can be copied verbatim and tweaked (e.g. fill in `props` placeholders). Top-level field so a skimming agent finds it immediately.")});const AS={handshakeId:G({message:"ggui_render: handshakeId is REQUIRED. Call ggui_handshake({intent, blueprintDraft}) first to negotiate — handshake returns a handshakeId + suggestion. Then render with {handshakeId, props} (accept the suggestion as-is) or {handshakeId, props, override: {contract?, variance?}} (re-aim the contract and/or variance). Direct-render without a handshakeId is not supported."}).min(1,"ggui_render: handshakeId must be a non-empty string from a prior ggui_handshake call."),props:vt(G(),fr()),themeId:G().min(1).optional().describe("Per-render theme override. Wins over App.defaultThemeId for THIS render. Omit to inherit the app theme."),infra:se({model:G().min(1).optional().describe("Provider-prefixed model id (e.g., `anthropic/claude-haiku-4-5`, `openai/gpt-5`). Generator-specific prefixes (e.g., `bedrock/...` for AWS Bedrock routing) supported when the bound generator handles them.")}).strict().optional(),override:se({contract:tl.optional().describe("STRICT full re-draft of the contract — must already conform; the server will not repair it."),variance:_c.optional().describe("Re-aim the variant (persona/aesthetic/context/seedPrompt); keeps the agreed contract.")}).strict().refine(e=>e.contract!==void 0||e.variance!==void 0,{message:"override must set contract and/or variance — omit override entirely to ACCEPT the handshake proposal as-is."}).optional().describe("Omit to ACCEPT the proposal as-is. Provide to re-aim contract and/or variance (PATCH semantics).")};se(AS);const DS=se({hit:Zt().describe("True when a stored component was served without generating new code."),similarity:et().optional().describe("Cosine similarity of the matched component to the request (semantic match only)."),cachedBlueprintId:G().optional().describe("The stored component id that was matched. Equals top-level blueprintId on a hit."),llmCallsAvoided:et().describe("Generation calls skipped by serving the stored component (0 on a fresh generation)."),kind:rt(["full-template","cold"]).optional().describe("full-template = a whole stored component was served; cold = freshly generated."),reason:G().optional().describe("Compact human-readable explanation of the cache outcome — why this render reused a stored component or generated cold. Diagnostic; default-available without the verbose env-gated trace.")}),US=rt(["PRODUCTION_FAILED","VALIDATION_ERROR","NO_PLATFORM_KEY","NO_CREDENTIALS"]),IS=se({code:US.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server."),message:G().describe("Human-readable failure detail — fold into the next attempt or surface to the operator.")});se({sessionId:G(),resourceUri:G().optional().describe("MCP-Apps mount URI (ui://ggui/render/{id}). Present iff the render is mountable; absent on a failed render."),action:rt(["create","reuse","update","replace","declined"]),contractHash:G().describe("Canonical hash of the rendered data contract (shape only — fields, types, specs). Same hash ⟺ same data flow."),blueprintId:G().describe("Opaque id of the materialised component for this render. On the handshake-decided reuse paths (accept a cache-origin proposal, or a variance re-aim that resolves to an existing variant) it is the stored id — equal ids across renders mean the same stored component. override.contract always generates cold and mints a fresh id, even for an identical contract."),variantKey:G().describe("Canonical hash of the design-time variance (persona, aesthetic, seed prompt, context). With contractHash it forms the reuse key: the same pair reuses one component; a different variant of the same contract gets its own."),cache:DS.describe("Reuse outcome for this render: whether a stored component was served, its similarity, the matched component id, and how many generation calls that avoided."),error:IS.optional().describe("Present iff the tool result is isError — canonical {code, message} for a failed/rejected generation. Absent on success."),nextStep:se({tool:Te("ggui_consume"),description:G(),example:G(),args:se({sessionId:G()})}).optional().describe("Recovery hint — when the rendered contract has actions, points the agent at ggui_consume({sessionId}) for the inbound action loop. Absent for pure-display renders.")});el("kind",[se({sessionId:G().describe("GguiSession opaque id (UUID) — returned by ggui_render."),kind:Te("replace"),props:vt(G(),fr()).describe("Full replacement props map. New map IS the new state.")}).strict(),se({sessionId:G().describe("GguiSession opaque id (UUID) — returned by ggui_render."),kind:Te("merge"),patch:vt(G(),fr()).describe("RFC 7396 JSON Merge Patch — null deletes a key; arrays fully replace.")}).strict()]);se({sessionId:G(),updated:Zt(),resourceUri:G()});se({toolCatalog:vt(G(),se({name:G(),version:G().optional()}).strict()).describe("Per-app canonical tool identities: bare tool name -> its server's initialize-declared serverInfo. Host/library-supplied; not an agent action.")}).strict();se({saved:Zt(),appId:G()}).strict();const LS=se({type:Te("text"),text:G()}),VS=se({type:Te("tool_use"),id:G(),name:G(),input:vt(G(),fr())}),HS=se({type:Te("tool_result"),tool_use_id:G(),content:fr(),is_error:Zt().optional()}),Xv=el("type",[LS,VS,HS]),BS=se({type:Te("text_delta"),text:G()}),qS=se({type:Te("input_json_delta"),partial_json:G()}),PS=el("type",[BS,qS]),ZS=se({type:Te("message_start"),message:se({id:G(),role:Te("assistant"),model:G().optional()})}),GS=se({type:Te("content_block_start"),index:et().int().nonnegative(),content_block:Xv}),FS=se({type:Te("content_block_delta"),index:et().int().nonnegative(),delta:PS}),YS=se({type:Te("content_block_stop"),index:et().int().nonnegative()}),KS=se({type:Te("message_delta"),delta:se({stop_reason:rt(["end_turn","max_tokens","tool_use","error"]),stop_sequence:G().nullable().optional()}),usage:se({input_tokens:et().int().nonnegative(),output_tokens:et().int().nonnegative()})}),XS=se({type:Te("message_stop")}),WS=se({type:Te("ping")}),JS=rt(["invalid_request","unauthorized","rate_limited","invoke_in_progress","upstream_error","tool_error","internal"]),QS=se({type:Te("error"),error:se({code:JS,message:G(),retryAfterMs:et().int().nonnegative().optional()})});el("type",[ZS,GS,FS,YS,KS,XS,WS,QS]);const e3=se({role:rt(["user","assistant"]),content:yn([G(),St(Xv)])});se({message:G(),history:St(e3).optional(),interfaceContext:kS.optional(),requestId:G().optional()});const t3=/^--ggui-[a-zA-Z0-9-]+$/,a3=/^[^;{}<>@]*$/,n3=G().min(1).max(256).regex(a3,"css value contains a disallowed character").refine(e=>!e.includes("/*"),"css value may not contain a comment");se({mode:rt(["light","dark"]),cssVariables:vt(G().regex(t3,"css var key must be --ggui-*"),n3).refine(e=>Object.keys(e).length<=200,"too many css variables (max 200)"),name:G().min(1).max(64).optional()}).strict();se({contract:tl,generator:G().min(1).optional().describe("Generator slug (e.g. `ui-gen-default-haiku-4-5`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`."),persona:G().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),aesthetic:G().optional().describe("Free-form aesthetic tag (e.g. 'glassmorphic', 'brutalist', 'editorial'). Persisted on `Blueprint.variance.aesthetic`. Distinct from persona — persona names the user mental model; aesthetic names the visual treatment."),context:vt(G(),ft).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),seedPrompt:G().optional().describe("The raw operator prompt that produced this variant. Round-trip input for the variant-selector + audit trail."),setAsOperatorDefault:Zt().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")}).strict();se({blueprintId:G().min(1),codeHash:G().optional().describe("Content hash of the generated code body. Absent when the generator returned a non-`ok` result and persistence skipped — the failure mode is surfaced through generator-level error reporting elsewhere."),validatorScore:et().min(0).max(1).optional().describe("Advanced generator's iterative-loop validator score (0-1). Absent for default-generator output."),source:Fv.describe("Provenance stamped on the persisted `Blueprint.source` — always the `llm` arm on this path: `generator` is the engine slug the dispatch resolved to (stamped from the engine's own metadata claim); `model` is the LLM model id the engine called.")}).strict();se({contract:tl,componentCode:G().min(1).describe("Verbatim component-code body to persist. Stored as-is — no LLM call, no validator pass. Operator owns correctness; the handler computes the canonical sha256 codeHash and routes the bytes through the same persistence seams as `*_generate_*`."),persona:G().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),aesthetic:G().optional().describe("Free-form aesthetic tag. Persisted on `Blueprint.variance.aesthetic`."),context:vt(G(),ft).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),seedPrompt:G().optional().describe("Optional originating prompt for audit + round-tripping (e.g. the prose the operator originally fed into `*_generate_*` before exporting)."),setAsOperatorDefault:Zt().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")}).strict();se({blueprintId:G().min(1),codeHash:G().min(1).describe("Content hash of the persisted code body (full sha256 hex)."),source:Yv.describe('Provenance stamped on the persisted `Blueprint.source` — always `{kind: "user"}` on this path: operator-supplied bytes, no LLM dispatch, no engine claim to record.')}).strict();se({contractHash:G().min(1).optional().describe("Filter to a single `(appId, contractHash)` group. Combine with `generator` / `persona` to narrow within the group."),generator:G().min(1).optional().describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this slug. `user`-sourced rows never match (they carry no engine provenance).'),persona:G().optional().describe("Filter on `variance.persona`. Normalized to match persisted form (lowercase+trim)."),intentKeywords:St(G().min(1)).optional().describe("Semantic-search tokens. When set, dispatches through `BlueprintSearch.search()` rather than indexed `list()`.")}).strict();se({blueprints:St(gS)}).strict();se({blueprintId:G().min(1),isOperatorDefault:Te(!0).optional().describe("When `true`, pins this blueprint as the operator default for its `(appId, contractHash)` group. Clears any prior default. Cannot set to `false` — to unpin, set another blueprint in the same group as default, or delete this one."),variance:_c.optional().describe('Partial-merge into the existing variance. Supplied keys overwrite; omitted keys preserve. Pass `{persona: ""}` to clear a persona (handler treats empty string as removal).')}).strict();se({blueprintId:G().min(1),updatedAt:G().min(1)}).strict();se({blueprintId:G().min(1)}).strict();se({deleted:Te(!0)}).strict();function r3(e){return"schemaVersion"in e?e.schemaVersion:nx}function i3(e){const n={sessionId:e.sessionId,type:e.type};e.payload!==void 0&&(n.payload=e.payload),e.clientSeq!==void 0&&(n.clientSeq=e.clientSeq);const o=r3(e);return o!==void 0&&(n.schemaVersion=o),n}var bs={exports:{}},Jd={},dn={},Vr={},Qd={},ef={},tf={},yh;function gc(){return yh||(yh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class n{}e._CodeOrName=n,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class o extends n{constructor($){if(super(),!e.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=o;class l extends n{constructor($){super(),this._items=typeof $=="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((S,R)=>`${S}${R}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((S,R)=>(R instanceof o&&(S[R.str]=(S[R.str]||0)+1),S),{})}}e._Code=l,e.nil=new l("");function c(k,...$){const S=[k[0]];let R=0;for(;R<$.length;)p(S,$[R]),S.push(k[++R]);return new l(S)}e._=c;const u=new l("+");function f(k,...$){const S=[N(k[0])];let R=0;for(;R<$.length;)S.push(u),p(S,$[R]),S.push(u,N(k[++R]));return g(S),new l(S)}e.str=f;function p(k,$){$ instanceof l?k.push(...$._items):$ instanceof o?k.push($):k.push(v($))}e.addCodeArg=p;function g(k){let $=1;for(;$<k.length-1;){if(k[$]===u){const S=h(k[$-1],k[$+1]);if(S!==void 0){k.splice($-1,3,S);continue}k[$++]="+"}$++}}function h(k,$){if($==='""')return k;if(k==='""')return $;if(typeof k=="string")return $ instanceof o||k[k.length-1]!=='"'?void 0:typeof $!="string"?`${k.slice(0,-1)}${$}"`:$[0]==='"'?k.slice(0,-1)+$.slice(1):void 0;if(typeof $=="string"&&$[0]==='"'&&!(k instanceof o))return`"${k}${$.slice(1)}`}function y(k,$){return $.emptyStr()?k:k.emptyStr()?$:f`${k}${$}`}e.strConcat=y;function v(k){return typeof k=="number"||typeof k=="boolean"||k===null?k:N(Array.isArray(k)?k.join(","):k)}function w(k){return new l(N(k))}e.stringify=w;function N(k){return JSON.stringify(k).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=N;function x(k){return typeof k=="string"&&e.IDENTIFIER.test(k)?new l(`.${k}`):c`[${k}]`}e.getProperty=x;function z(k){if(typeof k=="string"&&e.IDENTIFIER.test(k))return new l(`${k}`);throw new Error(`CodeGen: invalid export name: ${k}, use explicit $id name mapping`)}e.getEsmExportName=z;function E(k){return new l(k.toString())}e.regexpCode=E})(tf)),tf}var af={},vh;function $h(){return vh||(vh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=gc();class o extends Error{constructor(h){super(`CodeGen: "code" for ${h} not defined`),this.value=h.value}}var l;(function(g){g[g.Started=0]="Started",g[g.Completed=1]="Completed"})(l||(e.UsedValueState=l={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class c{constructor({prefixes:h,parent:y}={}){this._names={},this._prefixes=h,this._parent=y}toName(h){return h instanceof n.Name?h:this.name(h)}name(h){return new n.Name(this._newName(h))}_newName(h){const y=this._names[h]||this._nameGroup(h);return`${h}${y.index++}`}_nameGroup(h){var y,v;if(!((v=(y=this._parent)===null||y===void 0?void 0:y._prefixes)===null||v===void 0)&&v.has(h)||this._prefixes&&!this._prefixes.has(h))throw new Error(`CodeGen: prefix "${h}" is not allowed in this scope`);return this._names[h]={prefix:h,index:0}}}e.Scope=c;class u extends n.Name{constructor(h,y){super(y),this.prefix=h}setValue(h,{property:y,itemIndex:v}){this.value=h,this.scopePath=(0,n._)`.${new n.Name(y)}[${v}]`}}e.ValueScopeName=u;const f=(0,n._)`\n`;class p extends c{constructor(h){super(h),this._values={},this._scope=h.scope,this.opts={...h,_n:h.lines?f:n.nil}}get(){return this._scope}name(h){return new u(h,this._newName(h))}value(h,y){var v;if(y.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(h),{prefix:N}=w,x=(v=y.key)!==null&&v!==void 0?v:y.ref;let z=this._values[N];if(z){const $=z.get(x);if($)return $}else z=this._values[N]=new Map;z.set(x,w);const E=this._scope[N]||(this._scope[N]=[]),k=E.length;return E[k]=y.ref,w.setValue(y,{property:N,itemIndex:k}),w}getValue(h,y){const v=this._values[h];if(v)return v.get(y)}scopeRefs(h,y=this._values){return this._reduceValues(y,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,n._)`${h}${v.scopePath}`})}scopeCode(h=this._values,y,v){return this._reduceValues(h,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},y,v)}_reduceValues(h,y,v={},w){let N=n.nil;for(const x in h){const z=h[x];if(!z)continue;const E=v[x]=v[x]||new Map;z.forEach(k=>{if(E.has(k))return;E.set(k,l.Started);let $=y(k);if($){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;N=(0,n._)`${N}${S} ${k} = ${$};${this.opts._n}`}else if($=w==null?void 0:w(k))N=(0,n._)`${N}${$}${this.opts._n}`;else throw new o(k);E.set(k,l.Completed)})}return N}}e.ValueScope=p})(af)),af}var bh;function Oe(){return bh||(bh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const n=gc(),o=$h();var l=gc();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return l.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return l.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return l.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}});var c=$h();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return c.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return c.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return c.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return c.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class u{optimizeNodes(){return this}optimizeNames(C,L){return this}}class f extends u{constructor(C,L,K){super(),this.varKind=C,this.name=L,this.rhs=K}render({es5:C,_n:L}){const K=C?o.varKinds.var:this.varKind,me=this.rhs===void 0?"":` = ${this.rhs}`;return`${K} ${this.name}${me};`+L}optimizeNames(C,L){if(C[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,C,L)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class p extends u{constructor(C,L,K){super(),this.lhs=C,this.rhs=L,this.sideEffects=K}render({_n:C}){return`${this.lhs} = ${this.rhs};`+C}optimizeNames(C,L){if(!(this.lhs instanceof n.Name&&!C[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,C,L),this}get names(){const C=this.lhs instanceof n.Name?{}:{...this.lhs.names};return ue(C,this.rhs)}}class g extends p{constructor(C,L,K,me){super(C,K,me),this.op=L}render({_n:C}){return`${this.lhs} ${this.op}= ${this.rhs};`+C}}class h extends u{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`${this.label}:`+C}}class y extends u{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`break${this.label?` ${this.label}`:""};`+C}}class v extends u{constructor(C){super(),this.error=C}render({_n:C}){return`throw ${this.error};`+C}get names(){return this.error.names}}class w extends u{constructor(C){super(),this.code=C}render({_n:C}){return`${this.code};`+C}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(C,L){return this.code=de(this.code,C,L),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class N extends u{constructor(C=[]){super(),this.nodes=C}render(C){return this.nodes.reduce((L,K)=>L+K.render(C),"")}optimizeNodes(){const{nodes:C}=this;let L=C.length;for(;L--;){const K=C[L].optimizeNodes();Array.isArray(K)?C.splice(L,1,...K):K?C[L]=K:C.splice(L,1)}return C.length>0?this:void 0}optimizeNames(C,L){const{nodes:K}=this;let me=K.length;for(;me--;){const fe=K[me];fe.optimizeNames(C,L)||(je(C,fe.names),K.splice(me,1))}return K.length>0?this:void 0}get names(){return this.nodes.reduce((C,L)=>Q(C,L.names),{})}}class x extends N{render(C){return"{"+C._n+super.render(C)+"}"+C._n}}class z extends N{}class E extends x{}E.kind="else";class k extends x{constructor(C,L){super(L),this.condition=C}render(C){let L=`if(${this.condition})`+super.render(C);return this.else&&(L+="else "+this.else.render(C)),L}optimizeNodes(){super.optimizeNodes();const C=this.condition;if(C===!0)return this.nodes;let L=this.else;if(L){const K=L.optimizeNodes();L=this.else=Array.isArray(K)?new E(K):K}if(L)return C===!1?L instanceof k?L:L.nodes:this.nodes.length?this:new k(ce(C),L instanceof k?[L]:L.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,L){var K;if(this.else=(K=this.else)===null||K===void 0?void 0:K.optimizeNames(C,L),!!(super.optimizeNames(C,L)||this.else))return this.condition=de(this.condition,C,L),this}get names(){const C=super.names;return ue(C,this.condition),this.else&&Q(C,this.else.names),C}}k.kind="if";class $ extends x{}$.kind="for";class S extends ${constructor(C){super(),this.iteration=C}render(C){return`for(${this.iteration})`+super.render(C)}optimizeNames(C,L){if(super.optimizeNames(C,L))return this.iteration=de(this.iteration,C,L),this}get names(){return Q(super.names,this.iteration.names)}}class R extends ${constructor(C,L,K,me){super(),this.varKind=C,this.name=L,this.from=K,this.to=me}render(C){const L=C.es5?o.varKinds.var:this.varKind,{name:K,from:me,to:fe}=this;return`for(${L} ${K}=${me}; ${K}<${fe}; ${K}++)`+super.render(C)}get names(){const C=ue(super.names,this.from);return ue(C,this.to)}}class b extends ${constructor(C,L,K,me){super(),this.loop=C,this.varKind=L,this.name=K,this.iterable=me}render(C){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(C)}optimizeNames(C,L){if(super.optimizeNames(C,L))return this.iterable=de(this.iterable,C,L),this}get names(){return Q(super.names,this.iterable.names)}}class j extends x{constructor(C,L,K){super(),this.name=C,this.args=L,this.async=K}render(C){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(C)}}j.kind="func";class T extends N{render(C){return"return "+super.render(C)}}T.kind="return";class O extends x{render(C){let L="try"+super.render(C);return this.catch&&(L+=this.catch.render(C)),this.finally&&(L+=this.finally.render(C)),L}optimizeNodes(){var C,L;return super.optimizeNodes(),(C=this.catch)===null||C===void 0||C.optimizeNodes(),(L=this.finally)===null||L===void 0||L.optimizeNodes(),this}optimizeNames(C,L){var K,me;return super.optimizeNames(C,L),(K=this.catch)===null||K===void 0||K.optimizeNames(C,L),(me=this.finally)===null||me===void 0||me.optimizeNames(C,L),this}get names(){const C=super.names;return this.catch&&Q(C,this.catch.names),this.finally&&Q(C,this.finally.names),C}}class V extends x{constructor(C){super(),this.error=C}render(C){return`catch(${this.error})`+super.render(C)}}V.kind="catch";class F extends x{render(C){return"finally"+super.render(C)}}F.kind="finally";class H{constructor(C,L={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...L,_n:L.lines?`
|
|
87
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const v=y[1];if(n===y[0]){u(y);continue}if(e.external){const N=(g=e.external.registry.get(y[0]))==null?void 0:g.id;if(n!==y[0]&&N){u(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){u(y);continue}if(v.cycle){u(y);continue}if(v.count>1&&e.reused==="ref"){u(y);continue}}}function Rv(e,n){var f,p,g;const o=e.seen.get(n);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=h=>{const y=e.seen.get(h);if(y.ref===null)return;const v=y.def??y.schema,w={...v},N=y.ref;if(y.ref=null,N){l(N);const z=e.seen.get(N),E=z.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(E)):Object.assign(v,E),Object.assign(v,w),h._zod.parent===N)for(const $ in v)$==="$ref"||$==="allOf"||$ in w||delete v[$];if(E.$ref&&z.def)for(const $ in v)$==="$ref"||$==="allOf"||$ in z.def&&JSON.stringify(v[$])===JSON.stringify(z.def[$])&&delete v[$]}const x=h._zod.parent;if(x&&x!==N){l(x);const z=e.seen.get(x);if(z!=null&&z.schema.$ref&&(v.$ref=z.schema.$ref,z.def))for(const E in v)E==="$ref"||E==="allOf"||E in z.def&&JSON.stringify(v[E])===JSON.stringify(z.def[E])&&delete v[E]}e.override({zodSchema:h,jsonSchema:v,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())l(h[0]);const c={};if(e.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?c.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?c.$schema="http://json-schema.org/draft-04/schema#":e.target,(f=e.external)!=null&&f.uri){const h=(p=e.external.registry.get(n))==null?void 0:p.id;if(!h)throw new Error("Schema is missing an `id` property");c.$id=e.external.uri(h)}Object.assign(c,o.def??o.schema);const u=((g=e.external)==null?void 0:g.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(u[y.defId]=y.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{const h=JSON.parse(JSON.stringify(c));return Object.defineProperty(h,"~standard",{value:{...n["~standard"],jsonSchema:{input:pc(n,"input",e.processors),output:pc(n,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Kt(e,n){const o=n??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const l=e._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return Kt(l.element,o);if(l.type==="set")return Kt(l.valueType,o);if(l.type==="lazy")return Kt(l.getter(),o);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault")return Kt(l.innerType,o);if(l.type==="intersection")return Kt(l.left,o)||Kt(l.right,o);if(l.type==="record"||l.type==="map")return Kt(l.keyType,o)||Kt(l.valueType,o);if(l.type==="pipe")return Kt(l.in,o)||Kt(l.out,o);if(l.type==="object"){for(const c in l.shape)if(Kt(l.shape[c],o))return!0;return!1}if(l.type==="union"){for(const c of l.options)if(Kt(c,o))return!0;return!1}if(l.type==="tuple"){for(const c of l.items)if(Kt(c,o))return!0;return!!(l.rest&&Kt(l.rest,o))}return!1}const r_=(e,n={})=>o=>{const l=Tv({...o,processors:n});return yt(e,l),Mv(l,e),Rv(l,e)},pc=(e,n,o={})=>l=>{const{libraryOptions:c,target:u}=l??{},f=Tv({...c??{},target:u,io:n,processors:o});return yt(e,f),Mv(f,e),Rv(f,e)},i_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o_=(e,n,o,l)=>{const c=o;c.type="string";const{minimum:u,maximum:f,format:p,patterns:g,contentEncoding:h}=e._zod.bag;if(typeof u=="number"&&(c.minLength=u),typeof f=="number"&&(c.maxLength=f),p&&(c.format=i_[p]??p,c.format===""&&delete c.format,p==="time"&&delete c.format),h&&(c.contentEncoding=h),g&&g.size>0){const y=[...g];y.length===1?c.pattern=y[0].source:y.length>1&&(c.allOf=[...y.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},l_=(e,n,o,l)=>{const c=o,{minimum:u,maximum:f,format:p,multipleOf:g,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof p=="string"&&p.includes("int")?c.type="integer":c.type="number",typeof y=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(c.minimum=y,c.exclusiveMinimum=!0):c.exclusiveMinimum=y),typeof u=="number"&&(c.minimum=u,typeof y=="number"&&n.target!=="draft-04"&&(y>=u?delete c.minimum:delete c.exclusiveMinimum)),typeof h=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(c.maximum=h,c.exclusiveMaximum=!0):c.exclusiveMaximum=h),typeof f=="number"&&(c.maximum=f,typeof h=="number"&&n.target!=="draft-04"&&(h<=f?delete c.maximum:delete c.exclusiveMaximum)),typeof g=="number"&&(c.multipleOf=g)},s_=(e,n,o,l)=>{o.type="boolean"},c_=(e,n,o,l)=>{n.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},u_=(e,n,o,l)=>{o.not={}},d_=(e,n,o,l)=>{},f_=(e,n,o,l)=>{const c=e._zod.def,u=cv(c.entries);u.every(f=>typeof f=="number")&&(o.type="number"),u.every(f=>typeof f=="string")&&(o.type="string"),o.enum=u},p_=(e,n,o,l)=>{const c=e._zod.def,u=[];for(const f of c.values)if(f===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");u.push(Number(f))}else u.push(f);if(u.length!==0)if(u.length===1){const f=u[0];o.type=f===null?"null":typeof f,n.target==="draft-04"||n.target==="openapi-3.0"?o.enum=[f]:o.const=f}else u.every(f=>typeof f=="number")&&(o.type="number"),u.every(f=>typeof f=="string")&&(o.type="string"),u.every(f=>typeof f=="boolean")&&(o.type="boolean"),u.every(f=>f===null)&&(o.type="null"),o.enum=u},g_=(e,n,o,l)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},m_=(e,n,o,l)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},h_=(e,n,o,l)=>{const c=o,u=e._zod.def,{minimum:f,maximum:p}=e._zod.bag;typeof f=="number"&&(c.minItems=f),typeof p=="number"&&(c.maxItems=p),c.type="array",c.items=yt(u.element,n,{...l,path:[...l.path,"items"]})},y_=(e,n,o,l)=>{var h;const c=o,u=e._zod.def;c.type="object",c.properties={};const f=u.shape;for(const y in f)c.properties[y]=yt(f[y],n,{...l,path:[...l.path,"properties",y]});const p=new Set(Object.keys(f)),g=new Set([...p].filter(y=>{const v=u.shape[y]._zod;return n.io==="input"?v.optin===void 0:v.optout===void 0}));g.size>0&&(c.required=Array.from(g)),((h=u.catchall)==null?void 0:h._zod.def.type)==="never"?c.additionalProperties=!1:u.catchall?u.catchall&&(c.additionalProperties=yt(u.catchall,n,{...l,path:[...l.path,"additionalProperties"]})):n.io==="output"&&(c.additionalProperties=!1)},v_=(e,n,o,l)=>{const c=e._zod.def,u=c.inclusive===!1,f=c.options.map((p,g)=>yt(p,n,{...l,path:[...l.path,u?"oneOf":"anyOf",g]}));u?o.oneOf=f:o.anyOf=f},$_=(e,n,o,l)=>{const c=e._zod.def,u=yt(c.left,n,{...l,path:[...l.path,"allOf",0]}),f=yt(c.right,n,{...l,path:[...l.path,"allOf",1]}),p=h=>"allOf"in h&&Object.keys(h).length===1,g=[...p(u)?u.allOf:[u],...p(f)?f.allOf:[f]];o.allOf=g},b_=(e,n,o,l)=>{const c=o,u=e._zod.def;c.type="object";const f=u.keyType,p=f._zod.bag,g=p==null?void 0:p.patterns;if(u.mode==="loose"&&g&&g.size>0){const y=yt(u.valueType,n,{...l,path:[...l.path,"patternProperties","*"]});c.patternProperties={};for(const v of g)c.patternProperties[v.source]=y}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(c.propertyNames=yt(u.keyType,n,{...l,path:[...l.path,"propertyNames"]})),c.additionalProperties=yt(u.valueType,n,{...l,path:[...l.path,"additionalProperties"]});const h=f._zod.values;if(h){const y=[...h].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(c.required=y)}},x_=(e,n,o,l)=>{const c=e._zod.def,u=yt(c.innerType,n,l),f=n.seen.get(e);n.target==="openapi-3.0"?(f.ref=c.innerType,o.nullable=!0):o.anyOf=[u,{type:"null"}]},__=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType},j_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,o.default=JSON.parse(JSON.stringify(c.defaultValue))},S_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,n.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(c.defaultValue)))},w_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType;let f;try{f=c.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=f},k_=(e,n,o,l)=>{const c=e._zod.def,u=n.io==="input"?c.in._zod.def.type==="transform"?c.out:c.in:c.out;yt(u,n,l);const f=n.seen.get(e);f.ref=u},N_=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType,o.readOnly=!0},Ov=(e,n,o,l)=>{const c=e._zod.def;yt(c.innerType,n,l);const u=n.seen.get(e);u.ref=c.innerType},E_=(e,n,o,l)=>{const c=e._zod.innerType;yt(c,n,l);const u=n.seen.get(e);u.ref=c},z_=ne("ZodISODateTime",(e,n)=>{k5.init(e,n),st.init(e,n)});function C_(e){return R4(z_,e)}const T_=ne("ZodISODate",(e,n)=>{N5.init(e,n),st.init(e,n)});function M_(e){return O4(T_,e)}const R_=ne("ZodISOTime",(e,n)=>{E5.init(e,n),st.init(e,n)});function O_(e){return A4(R_,e)}const A_=ne("ZodISODuration",(e,n)=>{z5.init(e,n),st.init(e,n)});function D_(e){return D4(A_,e)}const U_=(e,n)=>{pv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>vx(e,o)},flatten:{value:o=>yx(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,vf,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,vf,2)}},isEmpty:{get(){return e.issues.length===0}}})},za=ne("ZodError",U_,{Parent:Error}),I_=Of(za),L_=Af(za),V_=$c(za),H_=bc(za),B_=xx(za),q_=_x(za),P_=jx(za),Z_=Sx(za),G_=wx(za),F_=kx(za),Y_=Nx(za),K_=Ex(za),nt=ne("ZodType",(e,n)=>(at.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:pc(e,"input"),output:pc(e,"output")}}),e.toJSONSchema=r_(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...o)=>e.clone(gr(n,{checks:[...n.checks??[],...o.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0}),e.with=e.check,e.clone=(o,l)=>mr(e,o,l),e.brand=()=>e,e.register=((o,l)=>(o.add(e,l),e)),e.parse=(o,l)=>I_(e,o,l,{callee:e.parse}),e.safeParse=(o,l)=>V_(e,o,l),e.parseAsync=async(o,l)=>L_(e,o,l,{callee:e.parseAsync}),e.safeParseAsync=async(o,l)=>H_(e,o,l),e.spa=e.safeParseAsync,e.encode=(o,l)=>B_(e,o,l),e.decode=(o,l)=>q_(e,o,l),e.encodeAsync=async(o,l)=>P_(e,o,l),e.decodeAsync=async(o,l)=>Z_(e,o,l),e.safeEncode=(o,l)=>G_(e,o,l),e.safeDecode=(o,l)=>F_(e,o,l),e.safeEncodeAsync=async(o,l)=>Y_(e,o,l),e.safeDecodeAsync=async(o,l)=>K_(e,o,l),e.refine=(o,l)=>e.check(Pj(o,l)),e.superRefine=o=>e.check(Zj(o)),e.overwrite=o=>e.check(Vi(o)),e.optional=()=>dh(e),e.exactOptional=()=>Cj(e),e.nullable=()=>fh(e),e.nullish=()=>dh(fh(e)),e.nonoptional=o=>Dj(e,o),e.array=()=>St(e),e.or=o=>yn([e,o]),e.and=o=>Sj(e,o),e.transform=o=>ph(e,Ej(o)),e.default=o=>Rj(e,o),e.prefault=o=>Aj(e,o),e.catch=o=>Ij(e,o),e.pipe=o=>ph(e,o),e.readonly=()=>Hj(e),e.describe=o=>{const l=e.clone();return Yo.add(l,{description:o}),l},Object.defineProperty(e,"description",{get(){var o;return(o=Yo.get(e))==null?void 0:o.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Yo.get(e);const l=e.clone();return Yo.add(l,o[0]),l},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=o=>o(e),e)),Av=ne("_ZodString",(e,n)=>{Df.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>o_(e,l,c);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...l)=>e.check(q4(...l)),e.includes=(...l)=>e.check(G4(...l)),e.startsWith=(...l)=>e.check(F4(...l)),e.endsWith=(...l)=>e.check(Y4(...l)),e.min=(...l)=>e.check(fc(...l)),e.max=(...l)=>e.check(zv(...l)),e.length=(...l)=>e.check(Cv(...l)),e.nonempty=(...l)=>e.check(fc(1,...l)),e.lowercase=l=>e.check(P4(l)),e.uppercase=l=>e.check(Z4(l)),e.trim=()=>e.check(X4()),e.normalize=(...l)=>e.check(K4(...l)),e.toLowerCase=()=>e.check(W4()),e.toUpperCase=()=>e.check(J4()),e.slugify=()=>e.check(Q4())}),X_=ne("ZodString",(e,n)=>{Df.init(e,n),Av.init(e,n),e.email=o=>e.check(p4(W_,o)),e.url=o=>e.check(Ev(Dv,o)),e.jwt=o=>e.check(M4(fj,o)),e.emoji=o=>e.check(v4(J_,o)),e.guid=o=>e.check(ih(ch,o)),e.uuid=o=>e.check(g4(vs,o)),e.uuidv4=o=>e.check(m4(vs,o)),e.uuidv6=o=>e.check(h4(vs,o)),e.uuidv7=o=>e.check(y4(vs,o)),e.nanoid=o=>e.check($4(Q_,o)),e.guid=o=>e.check(ih(ch,o)),e.cuid=o=>e.check(b4(ej,o)),e.cuid2=o=>e.check(x4(tj,o)),e.ulid=o=>e.check(_4(aj,o)),e.base64=o=>e.check(z4(cj,o)),e.base64url=o=>e.check(C4(uj,o)),e.xid=o=>e.check(j4(nj,o)),e.ksuid=o=>e.check(S4(rj,o)),e.ipv4=o=>e.check(w4(ij,o)),e.ipv6=o=>e.check(k4(oj,o)),e.cidrv4=o=>e.check(N4(lj,o)),e.cidrv6=o=>e.check(E4(sj,o)),e.e164=o=>e.check(T4(dj,o)),e.datetime=o=>e.check(C_(o)),e.date=o=>e.check(M_(o)),e.time=o=>e.check(O_(o)),e.duration=o=>e.check(D_(o))});function G(e){return f4(X_,e)}const st=ne("ZodStringFormat",(e,n)=>{it.init(e,n),Av.init(e,n)}),W_=ne("ZodEmail",(e,n)=>{y5.init(e,n),st.init(e,n)}),ch=ne("ZodGUID",(e,n)=>{m5.init(e,n),st.init(e,n)}),vs=ne("ZodUUID",(e,n)=>{h5.init(e,n),st.init(e,n)}),Dv=ne("ZodURL",(e,n)=>{v5.init(e,n),st.init(e,n)});function $s(e){return Ev(Dv,e)}const J_=ne("ZodEmoji",(e,n)=>{$5.init(e,n),st.init(e,n)}),Q_=ne("ZodNanoID",(e,n)=>{b5.init(e,n),st.init(e,n)}),ej=ne("ZodCUID",(e,n)=>{x5.init(e,n),st.init(e,n)}),tj=ne("ZodCUID2",(e,n)=>{_5.init(e,n),st.init(e,n)}),aj=ne("ZodULID",(e,n)=>{j5.init(e,n),st.init(e,n)}),nj=ne("ZodXID",(e,n)=>{S5.init(e,n),st.init(e,n)}),rj=ne("ZodKSUID",(e,n)=>{w5.init(e,n),st.init(e,n)}),ij=ne("ZodIPv4",(e,n)=>{C5.init(e,n),st.init(e,n)}),oj=ne("ZodIPv6",(e,n)=>{T5.init(e,n),st.init(e,n)}),lj=ne("ZodCIDRv4",(e,n)=>{M5.init(e,n),st.init(e,n)}),sj=ne("ZodCIDRv6",(e,n)=>{R5.init(e,n),st.init(e,n)}),cj=ne("ZodBase64",(e,n)=>{O5.init(e,n),st.init(e,n)}),uj=ne("ZodBase64URL",(e,n)=>{D5.init(e,n),st.init(e,n)}),dj=ne("ZodE164",(e,n)=>{U5.init(e,n),st.init(e,n)}),fj=ne("ZodJWT",(e,n)=>{L5.init(e,n),st.init(e,n)}),Uv=ne("ZodNumber",(e,n)=>{jv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>l_(e,l,c),e.gt=(l,c)=>e.check(lh(l,c)),e.gte=(l,c)=>e.check(Wd(l,c)),e.min=(l,c)=>e.check(Wd(l,c)),e.lt=(l,c)=>e.check(oh(l,c)),e.lte=(l,c)=>e.check(Xd(l,c)),e.max=(l,c)=>e.check(Xd(l,c)),e.int=l=>e.check(uh(l)),e.safe=l=>e.check(uh(l)),e.positive=l=>e.check(lh(0,l)),e.nonnegative=l=>e.check(Wd(0,l)),e.negative=l=>e.check(oh(0,l)),e.nonpositive=l=>e.check(Xd(0,l)),e.multipleOf=(l,c)=>e.check(sh(l,c)),e.step=(l,c)=>e.check(sh(l,c)),e.finite=()=>e;const 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});function et(e){return U4(Uv,e)}const pj=ne("ZodNumberFormat",(e,n)=>{V5.init(e,n),Uv.init(e,n)});function uh(e){return I4(pj,e)}const gj=ne("ZodBoolean",(e,n)=>{H5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>s_(e,o,l)});function Zt(e){return L4(gj,e)}const mj=ne("ZodNull",(e,n)=>{B5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>c_(e,o,l)});function hj(e){return V4(mj,e)}const yj=ne("ZodUnknown",(e,n)=>{q5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>d_()});function fr(){return H4(yj)}const vj=ne("ZodNever",(e,n)=>{P5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>u_(e,o,l)});function $j(e){return B4(vj,e)}const bj=ne("ZodArray",(e,n)=>{Z5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>h_(e,o,l,c),e.element=n.element,e.min=(o,l)=>e.check(fc(o,l)),e.nonempty=o=>e.check(fc(1,o)),e.max=(o,l)=>e.check(zv(o,l)),e.length=(o,l)=>e.check(Cv(o,l)),e.unwrap=()=>e.element});function St(e,n){return e_(bj,e,n)}const xj=ne("ZodObject",(e,n)=>{F5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>y_(e,o,l,c),Ve(e,"shape",()=>n.shape),e.keyof=()=>rt(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fr()}),e.loose=()=>e.clone({...e._zod.def,catchall:fr()}),e.strict=()=>e.clone({...e._zod.def,catchall:$j()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>fx(e,o),e.safeExtend=o=>px(e,o),e.merge=o=>gx(e,o),e.pick=o=>ux(e,o),e.omit=o=>dx(e,o),e.partial=(...o)=>mx(Lv,e,o[0]),e.required=(...o)=>hx(Vv,e,o[0])});function se(e,n){const o={type:"object",shape:e??{},..._e(n)};return new xj(o)}const Iv=ne("ZodUnion",(e,n)=>{kv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>v_(e,o,l,c),e.options=n.options});function yn(e,n){return new Iv({type:"union",options:e,..._e(n)})}const _j=ne("ZodDiscriminatedUnion",(e,n)=>{Iv.init(e,n),Y5.init(e,n)});function el(e,n,o){return new _j({type:"union",options:n,discriminator:e,..._e(o)})}const jj=ne("ZodIntersection",(e,n)=>{K5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>$_(e,o,l,c)});function Sj(e,n){return new jj({type:"intersection",left:e,right:n})}const wj=ne("ZodRecord",(e,n)=>{X5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>b_(e,o,l,c),e.keyType=n.keyType,e.valueType=n.valueType});function vt(e,n,o){return new wj({type:"record",keyType:e,valueType:n,..._e(o)})}const bf=ne("ZodEnum",(e,n)=>{W5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(l,c,u)=>f_(e,l,c),e.enum=n.entries,e.options=Object.values(n.entries);const o=new Set(Object.keys(n.entries));e.extract=(l,c)=>{const u={};for(const f of l)if(o.has(f))u[f]=n.entries[f];else throw new Error(`Key ${f} not found in enum`);return new bf({...n,checks:[],..._e(c),entries:u})},e.exclude=(l,c)=>{const u={...n.entries};for(const f of l)if(o.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new bf({...n,checks:[],..._e(c),entries:u})}});function rt(e,n){const o=Array.isArray(e)?Object.fromEntries(e.map(l=>[l,l])):e;return new bf({type:"enum",entries:o,..._e(n)})}const kj=ne("ZodLiteral",(e,n)=>{J5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>p_(e,o,l),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Te(e,n){return new kj({type:"literal",values:Array.isArray(e)?e:[e],..._e(n)})}const Nj=ne("ZodTransform",(e,n)=>{Q5.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>m_(e,o),e._zod.parse=(o,l)=>{if(l.direction==="backward")throw new lv(e.constructor.name);o.addIssue=u=>{if(typeof u=="string")o.issues.push(Xo(u,o.value,n));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=o.value),f.inst??(f.inst=e),o.issues.push(Xo(f))}};const c=n.transform(o.value,o);return c instanceof Promise?c.then(u=>(o.value=u,o)):(o.value=c,o)}});function Ej(e){return new Nj({type:"transform",transform:e})}const Lv=ne("ZodOptional",(e,n)=>{Nv.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>Ov(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function dh(e){return new Lv({type:"optional",innerType:e})}const zj=ne("ZodExactOptional",(e,n)=>{e4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>Ov(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Cj(e){return new zj({type:"optional",innerType:e})}const Tj=ne("ZodNullable",(e,n)=>{t4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>x_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function fh(e){return new Tj({type:"nullable",innerType:e})}const Mj=ne("ZodDefault",(e,n)=>{a4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>j_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rj(e,n){return new Mj({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():dv(n)}})}const Oj=ne("ZodPrefault",(e,n)=>{n4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>S_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Aj(e,n){return new Oj({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():dv(n)}})}const Vv=ne("ZodNonOptional",(e,n)=>{r4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>__(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Dj(e,n){return new Vv({type:"nonoptional",innerType:e,..._e(n)})}const Uj=ne("ZodCatch",(e,n)=>{i4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>w_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ij(e,n){return new Uj({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const Lj=ne("ZodPipe",(e,n)=>{o4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>k_(e,o,l,c),e.in=n.in,e.out=n.out});function ph(e,n){return new Lj({type:"pipe",in:e,out:n})}const Vj=ne("ZodReadonly",(e,n)=>{l4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>N_(e,o,l,c),e.unwrap=()=>e._zod.def.innerType});function Hj(e){return new Vj({type:"readonly",innerType:e})}const Bj=ne("ZodLazy",(e,n)=>{s4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>E_(e,o,l,c),e.unwrap=()=>e._zod.def.getter()});function Hv(e){return new Bj({type:"lazy",getter:e})}const qj=ne("ZodCustom",(e,n)=>{c4.init(e,n),nt.init(e,n),e._zod.processJSONSchema=(o,l,c)=>g_(e,o)});function Pj(e,n={}){return t_(qj,e,n)}function Zj(e){return a_(e)}const Bv="@ggui-ai/gadgets",Gj="0.5.0-rc.2",Fj=[{package:Bv,version:Gj,exports:[{hook:"useCamera",permission:"camera",description:"Capture stills or live video from the device camera.",usage:"Mount when the intent names photo capture, QR / barcode scanning, video recording, or anything that requires a camera feed. The hook returns a stream once `start()` resolves; thread the resulting blob or stream URL into a contextSpec slot or an actionSpec payload to surface it to the agent.",example:{call:"const cam = useCamera({ facingMode: 'environment' }); // on button click: await cam.start()",returns:{status:"completed",value:{dataUrl:"data:image/png;base64,…",width:640,height:480,mimeType:"image/png"}}}},{hook:"useClipboardPaste",permission:"clipboard-read",description:"Read the system clipboard contents on user gesture.",usage:"Mount when the intent involves importing copied content (paste-into-form, paste-image-to-upload, paste-link). The Permissions API requires a user gesture; gate `start()` behind a button click. Returned value lands in a contextSpec slot or an actionSpec payload.",example:{call:"const paste = useClipboardPaste(); // on button click: await paste.start()",returns:{status:"completed",value:"pasted clipboard text"}}},{hook:"useClipboardWrite",permission:"clipboard-write",description:"Write to the system clipboard on user gesture.",usage:"Mount when the intent includes copying generated text, share links, codes, or transcripts to the system clipboard. Fire an actionSpec event so the agent observes the act (it does not see the written value — that stays component-local).",example:{call:"const write = useClipboardWrite({ text: 'hello' }); // on button click: await write.start()",returns:{status:"completed",value:"hello"}}},{hook:"useFilePicker",description:"Open the native file picker and read selected files.",usage:"Mount when the intent names file upload, attachment selection, or document import. No permission required. The hook returns the picked files plus metadata; thread file refs / data URLs into a contextSpec slot or actionSpec payload.",example:{call:"const picker = useFilePicker({ accept: 'image/*' }); // on button click: await picker.start()",returns:{status:"completed",value:{files:[{name:"photo.png",type:"image/png",size:12345,_file:"<File>"}]}}}},{hook:"useGeolocation",permission:"geolocation",description:"Resolve the device's current geolocation.",usage:'Mount when the intent names "current location", maps, nearby search, location-aware UI. Browser prompts the user on `start()`; the hook returns coordinates once granted. Thread the resolved coords into a contextSpec slot so the agent observes the latest fix.',example:{call:"const geo = useGeolocation(); // on button click: await geo.start()",returns:{status:"completed",value:{latitude:37.7749,longitude:-122.4194,accuracy:20,timestamp:1718e9}}}},{hook:"useMicrophone",permission:"microphone",description:"Capture audio from the device microphone.",usage:"Mount when the intent names voice memos, audio messages, dictation, voice-driven UI. Returns an audio stream / blob; thread it into an actionSpec payload at recording-stop, or into a contextSpec slot for live transcription pipelines.",example:{call:"const mic = useMicrophone(); // record on click: await mic.start(); end with mic.stop()",returns:{status:"completed",value:{blob:"<Blob>",durationMs:4200,mimeType:"audio/webm"}}}},{hook:"useNotifications",permission:"notifications",description:"Show system / browser notifications to the user.",usage:"Mount when the intent involves alerting the user about something (reminders, completion of long tasks, incoming messages) and the UI may be in the background. Permission is prompted on first `start()`; the agent does NOT see notification dismissal directly — surface it via an actionSpec if needed.",example:{call:"const notify = useNotifications({ title: 'Done' }); // after the task completes: await notify.start()",returns:{status:"completed",value:{outcome:"closed"}}}}]}];Object.freeze(new Set(Fj.flatMap(e=>e.exports).map(e=>e.hook).filter(e=>e!==void 0)));const Uf=/^use[A-Z][A-Za-z0-9]*$/,If=/^[A-Z][A-Za-z0-9]*$/,Lf=["geolocation","notifications","microphone","camera","persistent-storage","midi","clipboard-read","clipboard-write","speaker-selection","storage-access","background-sync","accelerometer","gyroscope","magnetometer","ambient-light-sensor","screen-wake-lock"];new Set(Lf);const ft=Hv(()=>yn([G(),et(),Zt(),hj(),St(ft),vt(G(),ft)])),mn=Hv(()=>se({type:rt(["string","number","integer","boolean","array","object","null"]).optional(),description:G().optional(),enum:St(ft).optional(),default:ft.optional(),example:ft.optional(),items:mn.optional(),properties:vt(G(),mn).optional(),required:St(G()).optional(),additionalProperties:yn([mn,Zt()]).optional(),format:G().optional()}).passthrough()),Yj=se({description:G().optional(),schema:mn,required:Zt().optional(),default:ft.optional(),example:ft.optional(),sourceTool:G().optional()}).strict(),Kj=se({description:G().optional(),properties:vt(G(),Yj)}).strict(),Xj=se({description:G().optional(),label:G(),schema:mn.optional(),example:ft.optional(),icon:G().optional(),confirm:Zt().optional(),nextStep:G().min(1).optional()}).strict(),Wj=vt(G(),Xj),Jj=se({description:G().optional(),schema:mn,example:ft.optional(),mode:rt(["append","replace"]).optional(),replay:rt(["latest","all","none"]).optional(),complete:Zt().optional(),source:se({tool:G(),args:vt(G(),ft).optional()}).strict().optional()}).strict(),Qj=vt(G(),Jj),eS=se({description:G().optional(),schema:mn,default:ft.optional(),debounceMs:et().int().nonnegative().optional(),example:ft.optional()}).strict(),tS=vt(G(),eS),aS=se({serverInfo:se({name:G(),version:G().optional()}).strict().optional(),toolInfo:se({inputSchema:mn,description:G().optional(),outputSchema:mn.optional()}).strict(),usage:G().optional(),example:se({input:ft,output:ft}).strict().optional()}).strict(),nS=se({tools:vt(G(),aS)}).passthrough(),qv=/^GGUI_PUBLIC_APP_[A-Z0-9_]+$/,rS=St(G().regex(qv)).readonly(),gh=/^sha384-[A-Za-z0-9+/]+=*$/,Pv=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,iS=/^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/,oS=/^[a-z0-9.-]+(:\d+)?$/,Zv={gotchas:G().optional()},mh={...Zv,description:G().optional(),usage:G().optional(),example:ft.optional(),permission:G().optional()},hh={...Zv,description:G().min(1),usage:G().min(1),example:ft,permission:rt(Lf).optional()},Gv={version:G().regex(iS),package:G().regex(Pv),bundleUrl:$s().optional(),bundleHost:G().regex(oS).optional(),bundleSri:G().regex(gh).optional(),styleUrl:$s().optional(),connect:St($s()).readonly().optional(),requires:rS.optional(),typesUrl:$s().optional(),typesSri:G().regex(gh).optional()},lS=yn([se({hook:G().regex(Uf),...mh}).strict(),se({component:G().regex(If),...mh}).strict()]),sS=yn([se({hook:G().regex(Uf),...hh}).strict(),se({component:G().regex(If),...hh}).strict()]);se({...Gv,exports:St(lS).min(1)}).strict();const cS=se({...Gv,exports:St(sS).min(1)}).strict();cS.refine(e=>e.package===Bv||typeof e.typesUrl=="string",{message:"registered GadgetDescriptor MUST declare a `typesUrl` (HTTPS URL to the package's .d.ts) — the code-gen sandbox loads it to typecheck generated component code against the export signatures. Run `tsup --dts` (or `tsc --declaration`) in the wrapper build and publish the emitted .d.ts. Only the first-party `@ggui-ai/gadgets` stdlib is exempt.",path:["typesUrl"]});const uS=se({description:G().optional(),usage:G().optional()}).strict(),dS=vt(G().refine(e=>Uf.test(e)||If.test(e),{message:"gadget export name must be a `use`-prefixed hook or a PascalCase component identifier"}),uS).refine(e=>Object.keys(e).length>0,{message:"a `clientCapabilities.gadgets` package entry must declare at least one export"}),fS=se({gadgets:vt(G().regex(Pv),dS)}).strict();vt(G().regex(qv),G()).readonly();const tl=se({propsSpec:Kj.optional(),actionSpec:Wj.optional(),streamSpec:Qj.optional(),contextSpec:tS.optional(),agentCapabilities:nS.optional(),clientCapabilities:fS.optional()}).passthrough(),Fv=se({kind:Te("llm"),generator:G().min(1),model:G().min(1)}).strict(),Yv=se({kind:Te("user")}).strict(),pS=se({kind:Te("curated")}).strict(),Kv=yn([Fv,Yv,pS]),_c=se({persona:G().optional().describe('Design persona, e.g. "minimalist" / "data-dense". Part of cache identity.'),aesthetic:G().optional().describe('Visual aesthetic, e.g. "calm" / "ornate". Part of cache identity.'),context:vt(G(),ft).optional().describe('Deliberate design-shaping signals (e.g. {situation:"sad"}) — part of cache identity. NOT for per-user runtime data; put that in propsSpec/contextSpec.'),seedPrompt:G().optional().describe("Generation seed directive. Part of cache identity.")}).strict(),gS=se({blueprintId:G().min(1),contractHash:G().min(1),appId:G().min(1),codeS3Url:G().optional(),codeHash:G().optional(),source:Kv,validatorScore:et().min(0).max(1).optional(),variance:_c,isOperatorDefault:Te(!0).optional(),createdAt:G().min(1),createdBy:rt(["agent","operator"]),contract:tl,contractEmbedding:St(et()).optional()}).strict(),mS=se({hash:et().min(0).optional(),embed:et().min(0).optional(),struct:et().min(0).optional(),variance:et().min(0).optional(),intent:et().min(0).optional()}).strict();se({weights:mS.optional(),threshold:et().min(0).max(1).optional(),topK:et().int().min(1).optional()}).strict();const hS=rt(["cache","agent","synth"]),yS=yn([se({op:Te("add"),path:G(),value:ft}).strict(),se({op:Te("remove"),path:G()}).strict(),se({op:Te("replace"),path:G(),value:ft}).strict()]),vS=St(yS),$S=se({contract:tl,variance:se({persona:G().optional(),aesthetic:G().optional(),context:vt(G(),ft).optional(),seedPrompt:G().optional()}).strict().optional(),generator:G().optional()}).strict(),bS=$S,xS=se({blueprintId:G().min(1).optional(),contractHash:G().min(1),codeHash:G().optional(),source:Kv.optional(),variance:_c,selectedReason:G().optional()}).strict(),_S=se({code:G().min(1),severity:rt(["error","warn"]),path:G(),message:G()}).strict(),jS=se({contractDiff:vS,reasoning:G()}).strict(),SS=se({origin:hS,rationale:G(),blueprintMeta:xS,proposedContractSummary:G().optional(),amendments:jS.optional(),validationFindings:St(_S).optional()}).strict(),wS=se({width:et(),height:et()}),kS=se({viewport:wS,platform:rt(["web","mobile","desktop"]),deviceType:rt(["phone","tablet","desktop"]),orientation:rt(["portrait","landscape"]),devicePixelRatio:et().optional(),touchPrimary:Zt().optional(),shellType:rt(["chat","fullscreen","spatial"]).optional(),colorScheme:rt(["light","dark"]).optional(),reducedMotion:Zt().optional()}).passthrough(),NS={sessionId:G().min(1).describe("Globally-unique sessionId to consume events from. Cross-tenant access surfaces uniformly as session_not_found."),timeout:et().int().min(0).max(25).optional().describe("Inline long-poll seconds, integer in [0, 25]. 0 = immediate. Values outside the bound reject INVALID_PARAMS. Returns on first event OR timeout; re-call on empty to keep waiting — longer waits are your loop, not a bigger timeout.")};se(NS);const ES={sessionId:G().min(1),channel:G().min(1),payload:fr(),complete:Zt().optional()};se(ES);const zS={sessionId:G().min(1).describe("GguiSession opaque id (UUID) — returned by ggui_render.")};se(zS);const CS={};se(CS);const TS={query:G().min(1).describe("Natural-language description of the UI you're looking for"),limit:et().int().min(1).max(100).optional()};se(TS);const MS={blueprintId:G().min(1).describe("The stable blueprint id declared via ggui.ui.json#id. Must match an entry in this server's UI registry.")};se(MS);const RS={};se(RS);const OS={serviceId:G().min(1),reason:G().optional(),sessionId:G().optional()};se(OS);se({intent:G().min(1).describe('Concise purpose — same intent = same component reused. e.g. "Gmail inbox for email triage"'),blueprintDraft:bS.describe("Agent's draft: contract (required) + optional variance + optional generator slug hint. The server combines this with cached blueprints + validator outcomes to produce a three-mode suggestion (cache / agent / synth)."),forceCreate:Zt().optional()}).strict();se({handshakeId:G().describe("Stable id — pass to ggui_render / ggui_update"),action:rt(["create","reuse","update","replace","declined"]),suggestion:SS.describe("Server's suggestion — origin-routed (cache | agent | synth). Always carries a provisional `blueprintMeta` the agent reuses by rendering WITHOUT `override` (accept the proposal as-is)."),reason:G().max(280).optional().describe("Short rationale (≤280 chars) for the `action` value. Surfaced for agent + operator visibility; truncated to keep the structuredContent payload predictable."),nextStep:se({tool:Te("ggui_render"),description:G(),example:G()}).optional().describe("Wire-shape recovery hint. A worked literal example of the next ggui_render call the agent should emit — the example string can be copied verbatim and tweaked (e.g. fill in `props` placeholders). Top-level field so a skimming agent finds it immediately.")});const AS={handshakeId:G({message:"ggui_render: handshakeId is REQUIRED. Call ggui_handshake({intent, blueprintDraft}) first to negotiate — handshake returns a handshakeId + suggestion. Then render with {handshakeId, props} (accept the suggestion as-is) or {handshakeId, props, override: {contract?, variance?}} (re-aim the contract and/or variance). Direct-render without a handshakeId is not supported."}).min(1,"ggui_render: handshakeId must be a non-empty string from a prior ggui_handshake call."),props:vt(G(),fr()),themeId:G().min(1).optional().describe("Per-render theme override. Wins over App.defaultThemeId for THIS render. Omit to inherit the app theme."),infra:se({model:G().min(1).optional().describe("Provider-prefixed model id (e.g., `anthropic/claude-haiku-4-5`, `openai/gpt-5`). Generator-specific prefixes (e.g., `bedrock/...` for AWS Bedrock routing) supported when the bound generator handles them.")}).strict().optional(),override:se({contract:tl.optional().describe("STRICT full re-draft of the contract — must already conform; the server will not repair it."),variance:_c.optional().describe("Re-aim the variant (persona/aesthetic/context/seedPrompt); keeps the agreed contract.")}).strict().refine(e=>e.contract!==void 0||e.variance!==void 0,{message:"override must set contract and/or variance — omit override entirely to ACCEPT the handshake proposal as-is."}).optional().describe("Omit to ACCEPT the proposal as-is. Provide to re-aim contract and/or variance (PATCH semantics).")};se(AS);const DS=se({hit:Zt().describe("True when a stored component was served without generating new code."),similarity:et().optional().describe("Cosine similarity of the matched component to the request (semantic match only)."),cachedBlueprintId:G().optional().describe("The stored component id that was matched. Equals top-level blueprintId on a hit."),llmCallsAvoided:et().describe("Generation calls skipped by serving the stored component (0 on a fresh generation)."),kind:rt(["full-template","cold"]).optional().describe("full-template = a whole stored component was served; cold = freshly generated."),reason:G().optional().describe("Compact human-readable explanation of the cache outcome — why this render reused a stored component or generated cold. Diagnostic; default-available without the verbose env-gated trace.")}),US=rt(["PRODUCTION_FAILED","VALIDATION_ERROR","NO_PLATFORM_KEY","NO_CREDENTIALS"]),IS=se({code:US.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server."),message:G().describe("Human-readable failure detail — fold into the next attempt or surface to the operator.")});se({sessionId:G(),resourceUri:G().optional().describe("MCP-Apps mount URI (ui://ggui/render/{id}). Present iff the render is mountable; absent on a failed render."),action:rt(["create","reuse","update","replace","declined"]),contractHash:G().describe("Canonical hash of the rendered data contract (shape only — fields, types, specs). Same hash ⟺ same data flow."),blueprintId:G().describe("Opaque id of the materialised component for this render. On the handshake-decided reuse paths (accept a cache-origin proposal, or a variance re-aim that resolves to an existing variant) it is the stored id — equal ids across renders mean the same stored component. override.contract always generates cold and mints a fresh id, even for an identical contract."),variantKey:G().describe("Canonical hash of the design-time variance (persona, aesthetic, seed prompt, context). With contractHash it forms the reuse key: the same pair reuses one component; a different variant of the same contract gets its own."),cache:DS.describe("Reuse outcome for this render: whether a stored component was served, its similarity, the matched component id, and how many generation calls that avoided."),error:IS.optional().describe("Present iff the tool result is isError — canonical {code, message} for a failed/rejected generation. Absent on success."),nextStep:se({tool:Te("ggui_consume"),description:G(),example:G(),args:se({sessionId:G()})}).optional().describe("Recovery hint — when the rendered contract has actions, points the agent at ggui_consume({sessionId}) for the inbound action loop. Absent for pure-display renders.")});el("kind",[se({sessionId:G().describe("GguiSession opaque id (UUID) — returned by ggui_render."),kind:Te("replace"),props:vt(G(),fr()).describe("Full replacement props map. New map IS the new state.")}).strict(),se({sessionId:G().describe("GguiSession opaque id (UUID) — returned by ggui_render."),kind:Te("merge"),patch:vt(G(),fr()).describe("RFC 7396 JSON Merge Patch — null deletes a key; arrays fully replace.")}).strict()]);se({sessionId:G(),updated:Zt(),resourceUri:G()});se({toolCatalog:vt(G(),se({name:G(),version:G().optional()}).strict()).describe("Per-app canonical tool identities: bare tool name -> its server's initialize-declared serverInfo. Host/library-supplied; not an agent action.")}).strict();se({saved:Zt(),appId:G()}).strict();const LS=se({type:Te("text"),text:G()}),VS=se({type:Te("tool_use"),id:G(),name:G(),input:vt(G(),fr())}),HS=se({type:Te("tool_result"),tool_use_id:G(),content:fr(),is_error:Zt().optional()}),Xv=el("type",[LS,VS,HS]),BS=se({type:Te("text_delta"),text:G()}),qS=se({type:Te("input_json_delta"),partial_json:G()}),PS=el("type",[BS,qS]),ZS=se({type:Te("message_start"),message:se({id:G(),role:Te("assistant"),model:G().optional()})}),GS=se({type:Te("content_block_start"),index:et().int().nonnegative(),content_block:Xv}),FS=se({type:Te("content_block_delta"),index:et().int().nonnegative(),delta:PS}),YS=se({type:Te("content_block_stop"),index:et().int().nonnegative()}),KS=se({type:Te("message_delta"),delta:se({stop_reason:rt(["end_turn","max_tokens","tool_use","error"]),stop_sequence:G().nullable().optional()}),usage:se({input_tokens:et().int().nonnegative(),output_tokens:et().int().nonnegative()})}),XS=se({type:Te("message_stop")}),WS=se({type:Te("ping")}),JS=rt(["invalid_request","unauthorized","rate_limited","invoke_in_progress","upstream_error","tool_error","internal"]),QS=se({type:Te("error"),error:se({code:JS,message:G(),retryAfterMs:et().int().nonnegative().optional()})});el("type",[ZS,GS,FS,YS,KS,XS,WS,QS]);const e3=se({role:rt(["user","assistant"]),content:yn([G(),St(Xv)])});se({message:G(),history:St(e3).optional(),interfaceContext:kS.optional(),requestId:G().optional()});const t3=/^--ggui-[a-zA-Z0-9-]+$/,a3=/^[^;{}<>@]*$/,n3=G().min(1).max(256).regex(a3,"css value contains a disallowed character").refine(e=>!e.includes("/*"),"css value may not contain a comment");se({mode:rt(["light","dark"]),cssVariables:vt(G().regex(t3,"css var key must be --ggui-*"),n3).refine(e=>Object.keys(e).length<=200,"too many css variables (max 200)"),name:G().min(1).max(64).optional()}).strict();se({contract:tl,generator:G().min(1).optional().describe("Generator slug (e.g. `ui-gen-default-haiku-4-5`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`."),persona:G().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),aesthetic:G().optional().describe("Free-form aesthetic tag (e.g. 'glassmorphic', 'brutalist', 'editorial'). Persisted on `Blueprint.variance.aesthetic`. Distinct from persona — persona names the user mental model; aesthetic names the visual treatment."),context:vt(G(),ft).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),seedPrompt:G().optional().describe("The raw operator prompt that produced this variant. Round-trip input for the variant-selector + audit trail."),setAsOperatorDefault:Zt().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")}).strict();se({blueprintId:G().min(1),codeHash:G().optional().describe("Content hash of the generated code body. Absent when the generator returned a non-`ok` result and persistence skipped — the failure mode is surfaced through generator-level error reporting elsewhere."),validatorScore:et().min(0).max(1).optional().describe("Advanced generator's iterative-loop validator score (0-1). Absent for default-generator output."),source:Fv.describe("Provenance stamped on the persisted `Blueprint.source` — always the `llm` arm on this path: `generator` is the engine slug the dispatch resolved to (stamped from the engine's own metadata claim); `model` is the LLM model id the engine called.")}).strict();se({contract:tl,componentCode:G().min(1).describe("Verbatim component-code body to persist. Stored as-is — no LLM call, no validator pass. Operator owns correctness; the handler computes the canonical sha256 codeHash and routes the bytes through the same persistence seams as `*_generate_*`."),persona:G().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),aesthetic:G().optional().describe("Free-form aesthetic tag. Persisted on `Blueprint.variance.aesthetic`."),context:vt(G(),ft).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),seedPrompt:G().optional().describe("Optional originating prompt for audit + round-tripping (e.g. the prose the operator originally fed into `*_generate_*` before exporting)."),setAsOperatorDefault:Zt().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")}).strict();se({blueprintId:G().min(1),codeHash:G().min(1).describe("Content hash of the persisted code body (full sha256 hex)."),source:Yv.describe('Provenance stamped on the persisted `Blueprint.source` — always `{kind: "user"}` on this path: operator-supplied bytes, no LLM dispatch, no engine claim to record.')}).strict();se({contractHash:G().min(1).optional().describe("Filter to a single `(appId, contractHash)` group. Combine with `generator` / `persona` to narrow within the group."),generator:G().min(1).optional().describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this slug. `user`-sourced rows never match (they carry no engine provenance).'),persona:G().optional().describe("Filter on `variance.persona`. Normalized to match persisted form (lowercase+trim)."),intentKeywords:St(G().min(1)).optional().describe("Semantic-search tokens. When set, dispatches through `BlueprintSearch.search()` rather than indexed `list()`.")}).strict();se({blueprints:St(gS)}).strict();se({blueprintId:G().min(1),isOperatorDefault:Te(!0).optional().describe("When `true`, pins this blueprint as the operator default for its `(appId, contractHash)` group. Clears any prior default. Cannot set to `false` — to unpin, set another blueprint in the same group as default, or delete this one."),variance:_c.optional().describe('Partial-merge into the existing variance. Supplied keys overwrite; omitted keys preserve. Pass `{persona: ""}` to clear a persona (handler treats empty string as removal).')}).strict();se({blueprintId:G().min(1),updatedAt:G().min(1)}).strict();se({blueprintId:G().min(1)}).strict();se({deleted:Te(!0)}).strict();function r3(e){return"schemaVersion"in e?e.schemaVersion:nx}function i3(e){const n={sessionId:e.sessionId,type:e.type};e.payload!==void 0&&(n.payload=e.payload),e.clientSeq!==void 0&&(n.clientSeq=e.clientSeq);const o=r3(e);return o!==void 0&&(n.schemaVersion=o),n}var bs={exports:{}},Jd={},dn={},Vr={},Qd={},ef={},tf={},yh;function gc(){return yh||(yh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class n{}e._CodeOrName=n,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class o extends n{constructor($){if(super(),!e.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=o;class l extends n{constructor($){super(),this._items=typeof $=="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((S,R)=>`${S}${R}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((S,R)=>(R instanceof o&&(S[R.str]=(S[R.str]||0)+1),S),{})}}e._Code=l,e.nil=new l("");function c(k,...$){const S=[k[0]];let R=0;for(;R<$.length;)p(S,$[R]),S.push(k[++R]);return new l(S)}e._=c;const u=new l("+");function f(k,...$){const S=[N(k[0])];let R=0;for(;R<$.length;)S.push(u),p(S,$[R]),S.push(u,N(k[++R]));return g(S),new l(S)}e.str=f;function p(k,$){$ instanceof l?k.push(...$._items):$ instanceof o?k.push($):k.push(v($))}e.addCodeArg=p;function g(k){let $=1;for(;$<k.length-1;){if(k[$]===u){const S=h(k[$-1],k[$+1]);if(S!==void 0){k.splice($-1,3,S);continue}k[$++]="+"}$++}}function h(k,$){if($==='""')return k;if(k==='""')return $;if(typeof k=="string")return $ instanceof o||k[k.length-1]!=='"'?void 0:typeof $!="string"?`${k.slice(0,-1)}${$}"`:$[0]==='"'?k.slice(0,-1)+$.slice(1):void 0;if(typeof $=="string"&&$[0]==='"'&&!(k instanceof o))return`"${k}${$.slice(1)}`}function y(k,$){return $.emptyStr()?k:k.emptyStr()?$:f`${k}${$}`}e.strConcat=y;function v(k){return typeof k=="number"||typeof k=="boolean"||k===null?k:N(Array.isArray(k)?k.join(","):k)}function w(k){return new l(N(k))}e.stringify=w;function N(k){return JSON.stringify(k).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=N;function x(k){return typeof k=="string"&&e.IDENTIFIER.test(k)?new l(`.${k}`):c`[${k}]`}e.getProperty=x;function z(k){if(typeof k=="string"&&e.IDENTIFIER.test(k))return new l(`${k}`);throw new Error(`CodeGen: invalid export name: ${k}, use explicit $id name mapping`)}e.getEsmExportName=z;function E(k){return new l(k.toString())}e.regexpCode=E})(tf)),tf}var af={},vh;function $h(){return vh||(vh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=gc();class o extends Error{constructor(h){super(`CodeGen: "code" for ${h} not defined`),this.value=h.value}}var l;(function(g){g[g.Started=0]="Started",g[g.Completed=1]="Completed"})(l||(e.UsedValueState=l={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class c{constructor({prefixes:h,parent:y}={}){this._names={},this._prefixes=h,this._parent=y}toName(h){return h instanceof n.Name?h:this.name(h)}name(h){return new n.Name(this._newName(h))}_newName(h){const y=this._names[h]||this._nameGroup(h);return`${h}${y.index++}`}_nameGroup(h){var y,v;if(!((v=(y=this._parent)===null||y===void 0?void 0:y._prefixes)===null||v===void 0)&&v.has(h)||this._prefixes&&!this._prefixes.has(h))throw new Error(`CodeGen: prefix "${h}" is not allowed in this scope`);return this._names[h]={prefix:h,index:0}}}e.Scope=c;class u extends n.Name{constructor(h,y){super(y),this.prefix=h}setValue(h,{property:y,itemIndex:v}){this.value=h,this.scopePath=(0,n._)`.${new n.Name(y)}[${v}]`}}e.ValueScopeName=u;const f=(0,n._)`\n`;class p extends c{constructor(h){super(h),this._values={},this._scope=h.scope,this.opts={...h,_n:h.lines?f:n.nil}}get(){return this._scope}name(h){return new u(h,this._newName(h))}value(h,y){var v;if(y.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(h),{prefix:N}=w,x=(v=y.key)!==null&&v!==void 0?v:y.ref;let z=this._values[N];if(z){const $=z.get(x);if($)return $}else z=this._values[N]=new Map;z.set(x,w);const E=this._scope[N]||(this._scope[N]=[]),k=E.length;return E[k]=y.ref,w.setValue(y,{property:N,itemIndex:k}),w}getValue(h,y){const v=this._values[h];if(v)return v.get(y)}scopeRefs(h,y=this._values){return this._reduceValues(y,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,n._)`${h}${v.scopePath}`})}scopeCode(h=this._values,y,v){return this._reduceValues(h,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},y,v)}_reduceValues(h,y,v={},w){let N=n.nil;for(const x in h){const z=h[x];if(!z)continue;const E=v[x]=v[x]||new Map;z.forEach(k=>{if(E.has(k))return;E.set(k,l.Started);let $=y(k);if($){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;N=(0,n._)`${N}${S} ${k} = ${$};${this.opts._n}`}else if($=w==null?void 0:w(k))N=(0,n._)`${N}${$}${this.opts._n}`;else throw new o(k);E.set(k,l.Completed)})}return N}}e.ValueScope=p})(af)),af}var bh;function Oe(){return bh||(bh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const n=gc(),o=$h();var l=gc();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return l.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return l.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return l.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}});var c=$h();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return c.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return c.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return c.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return c.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class u{optimizeNodes(){return this}optimizeNames(C,L){return this}}class f extends u{constructor(C,L,K){super(),this.varKind=C,this.name=L,this.rhs=K}render({es5:C,_n:L}){const K=C?o.varKinds.var:this.varKind,me=this.rhs===void 0?"":` = ${this.rhs}`;return`${K} ${this.name}${me};`+L}optimizeNames(C,L){if(C[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,C,L)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class p extends u{constructor(C,L,K){super(),this.lhs=C,this.rhs=L,this.sideEffects=K}render({_n:C}){return`${this.lhs} = ${this.rhs};`+C}optimizeNames(C,L){if(!(this.lhs instanceof n.Name&&!C[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,C,L),this}get names(){const C=this.lhs instanceof n.Name?{}:{...this.lhs.names};return ue(C,this.rhs)}}class g extends p{constructor(C,L,K,me){super(C,K,me),this.op=L}render({_n:C}){return`${this.lhs} ${this.op}= ${this.rhs};`+C}}class h extends u{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`${this.label}:`+C}}class y extends u{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`break${this.label?` ${this.label}`:""};`+C}}class v extends u{constructor(C){super(),this.error=C}render({_n:C}){return`throw ${this.error};`+C}get names(){return this.error.names}}class w extends u{constructor(C){super(),this.code=C}render({_n:C}){return`${this.code};`+C}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(C,L){return this.code=de(this.code,C,L),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class N extends u{constructor(C=[]){super(),this.nodes=C}render(C){return this.nodes.reduce((L,K)=>L+K.render(C),"")}optimizeNodes(){const{nodes:C}=this;let L=C.length;for(;L--;){const K=C[L].optimizeNodes();Array.isArray(K)?C.splice(L,1,...K):K?C[L]=K:C.splice(L,1)}return C.length>0?this:void 0}optimizeNames(C,L){const{nodes:K}=this;let me=K.length;for(;me--;){const fe=K[me];fe.optimizeNames(C,L)||(je(C,fe.names),K.splice(me,1))}return K.length>0?this:void 0}get names(){return this.nodes.reduce((C,L)=>Q(C,L.names),{})}}class x extends N{render(C){return"{"+C._n+super.render(C)+"}"+C._n}}class z extends N{}class E extends x{}E.kind="else";class k extends x{constructor(C,L){super(L),this.condition=C}render(C){let L=`if(${this.condition})`+super.render(C);return this.else&&(L+="else "+this.else.render(C)),L}optimizeNodes(){super.optimizeNodes();const C=this.condition;if(C===!0)return this.nodes;let L=this.else;if(L){const K=L.optimizeNodes();L=this.else=Array.isArray(K)?new E(K):K}if(L)return C===!1?L instanceof k?L:L.nodes:this.nodes.length?this:new k(ce(C),L instanceof k?[L]:L.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,L){var K;if(this.else=(K=this.else)===null||K===void 0?void 0:K.optimizeNames(C,L),!!(super.optimizeNames(C,L)||this.else))return this.condition=de(this.condition,C,L),this}get names(){const C=super.names;return ue(C,this.condition),this.else&&Q(C,this.else.names),C}}k.kind="if";class $ extends x{}$.kind="for";class S extends ${constructor(C){super(),this.iteration=C}render(C){return`for(${this.iteration})`+super.render(C)}optimizeNames(C,L){if(super.optimizeNames(C,L))return this.iteration=de(this.iteration,C,L),this}get names(){return Q(super.names,this.iteration.names)}}class R extends ${constructor(C,L,K,me){super(),this.varKind=C,this.name=L,this.from=K,this.to=me}render(C){const L=C.es5?o.varKinds.var:this.varKind,{name:K,from:me,to:fe}=this;return`for(${L} ${K}=${me}; ${K}<${fe}; ${K}++)`+super.render(C)}get names(){const C=ue(super.names,this.from);return ue(C,this.to)}}class b extends ${constructor(C,L,K,me){super(),this.loop=C,this.varKind=L,this.name=K,this.iterable=me}render(C){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(C)}optimizeNames(C,L){if(super.optimizeNames(C,L))return this.iterable=de(this.iterable,C,L),this}get names(){return Q(super.names,this.iterable.names)}}class j extends x{constructor(C,L,K){super(),this.name=C,this.args=L,this.async=K}render(C){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(C)}}j.kind="func";class T extends N{render(C){return"return "+super.render(C)}}T.kind="return";class O extends x{render(C){let L="try"+super.render(C);return this.catch&&(L+=this.catch.render(C)),this.finally&&(L+=this.finally.render(C)),L}optimizeNodes(){var C,L;return super.optimizeNodes(),(C=this.catch)===null||C===void 0||C.optimizeNodes(),(L=this.finally)===null||L===void 0||L.optimizeNodes(),this}optimizeNames(C,L){var K,me;return super.optimizeNames(C,L),(K=this.catch)===null||K===void 0||K.optimizeNames(C,L),(me=this.finally)===null||me===void 0||me.optimizeNames(C,L),this}get names(){const C=super.names;return this.catch&&Q(C,this.catch.names),this.finally&&Q(C,this.finally.names),C}}class V extends x{constructor(C){super(),this.error=C}render(C){return`catch(${this.error})`+super.render(C)}}V.kind="catch";class F extends x{render(C){return"finally"+super.render(C)}}F.kind="finally";class H{constructor(C,L={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...L,_n:L.lines?`
|
|
88
88
|
`:""},this._extScope=C,this._scope=new o.Scope({parent:C}),this._nodes=[new z]}toString(){return this._root.render(this.opts)}name(C){return this._scope.name(C)}scopeName(C){return this._extScope.name(C)}scopeValue(C,L){const K=this._extScope.value(C,L);return(this._values[K.prefix]||(this._values[K.prefix]=new Set)).add(K),K}getScopeValue(C,L){return this._extScope.getValue(C,L)}scopeRefs(C){return this._extScope.scopeRefs(C,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(C,L,K,me){const fe=this._scope.toName(L);return K!==void 0&&me&&(this._constants[fe.str]=K),this._leafNode(new f(C,fe,K)),fe}const(C,L,K){return this._def(o.varKinds.const,C,L,K)}let(C,L,K){return this._def(o.varKinds.let,C,L,K)}var(C,L,K){return this._def(o.varKinds.var,C,L,K)}assign(C,L,K){return this._leafNode(new p(C,L,K))}add(C,L){return this._leafNode(new g(C,e.operators.ADD,L))}code(C){return typeof C=="function"?C():C!==n.nil&&this._leafNode(new w(C)),this}object(...C){const L=["{"];for(const[K,me]of C)L.length>1&&L.push(","),L.push(K),(K!==me||this.opts.es5)&&(L.push(":"),(0,n.addCodeArg)(L,me));return L.push("}"),new n._Code(L)}if(C,L,K){if(this._blockNode(new k(C)),L&&K)this.code(L).else().code(K).endIf();else if(L)this.code(L).endIf();else if(K)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(C){return this._elseNode(new k(C))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(k,E)}_for(C,L){return this._blockNode(C),L&&this.code(L).endFor(),this}for(C,L){return this._for(new S(C),L)}forRange(C,L,K,me,fe=this.opts.es5?o.varKinds.var:o.varKinds.let){const we=this._scope.toName(C);return this._for(new R(fe,we,L,K),()=>me(we))}forOf(C,L,K,me=o.varKinds.const){const fe=this._scope.toName(C);if(this.opts.es5){const we=L instanceof n.Name?L:this.var("_arr",L);return this.forRange("_i",0,(0,n._)`${we}.length`,$e=>{this.var(fe,(0,n._)`${we}[${$e}]`),K(fe)})}return this._for(new b("of",me,fe,L),()=>K(fe))}forIn(C,L,K,me=this.opts.es5?o.varKinds.var:o.varKinds.const){if(this.opts.ownProperties)return this.forOf(C,(0,n._)`Object.keys(${L})`,K);const fe=this._scope.toName(C);return this._for(new b("in",me,fe,L),()=>K(fe))}endFor(){return this._endBlockNode($)}label(C){return this._leafNode(new h(C))}break(C){return this._leafNode(new y(C))}return(C){const L=new T;if(this._blockNode(L),this.code(C),L.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(T)}try(C,L,K){if(!L&&!K)throw new Error('CodeGen: "try" without "catch" and "finally"');const me=new O;if(this._blockNode(me),this.code(C),L){const fe=this.name("e");this._currNode=me.catch=new V(fe),L(fe)}return K&&(this._currNode=me.finally=new F,this.code(K)),this._endBlockNode(V,F)}throw(C){return this._leafNode(new v(C))}block(C,L){return this._blockStarts.push(this._nodes.length),C&&this.code(C).endBlock(L),this}endBlock(C){const L=this._blockStarts.pop();if(L===void 0)throw new Error("CodeGen: not in self-balancing block");const K=this._nodes.length-L;if(K<0||C!==void 0&&K!==C)throw new Error(`CodeGen: wrong number of nodes: ${K} vs ${C} expected`);return this._nodes.length=L,this}func(C,L=n.nil,K,me){return this._blockNode(new j(C,L,K)),me&&this.code(me).endFunc(),this}endFunc(){return this._endBlockNode(j)}optimize(C=1){for(;C-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(C){return this._currNode.nodes.push(C),this}_blockNode(C){this._currNode.nodes.push(C),this._nodes.push(C)}_endBlockNode(C,L){const K=this._currNode;if(K instanceof C||L&&K instanceof L)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${L?`${C.kind}/${L.kind}`:C.kind}"`)}_elseNode(C){const L=this._currNode;if(!(L instanceof k))throw new Error('CodeGen: "else" without "if"');return this._currNode=L.else=C,this}get _root(){return this._nodes[0]}get _currNode(){const C=this._nodes;return C[C.length-1]}set _currNode(C){const L=this._nodes;L[L.length-1]=C}}e.CodeGen=H;function Q(B,C){for(const L in C)B[L]=(B[L]||0)+(C[L]||0);return B}function ue(B,C){return C instanceof n._CodeOrName?Q(B,C.names):B}function de(B,C,L){if(B instanceof n.Name)return K(B);if(!me(B))return B;return new n._Code(B._items.reduce((fe,we)=>(we instanceof n.Name&&(we=K(we)),we instanceof n._Code?fe.push(...we._items):fe.push(we),fe),[]));function K(fe){const we=L[fe.str];return we===void 0||C[fe.str]!==1?fe:(delete C[fe.str],we)}function me(fe){return fe instanceof n._Code&&fe._items.some(we=>we instanceof n.Name&&C[we.str]===1&&L[we.str]!==void 0)}}function je(B,C){for(const L in C)B[L]=(B[L]||0)-(C[L]||0)}function ce(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,n._)`!${ee(B)}`}e.not=ce;const ve=D(e.operators.AND);function ge(...B){return B.reduce(ve)}e.and=ge;const Ae=D(e.operators.OR);function A(...B){return B.reduce(Ae)}e.or=A;function D(B){return(C,L)=>C===n.nil?L:L===n.nil?C:(0,n._)`${ee(C)} ${B} ${ee(L)}`}function ee(B){return B instanceof n.Name?B:(0,n._)`(${B})`}})(ef)),ef}var Re={},xh;function Be(){if(xh)return Re;xh=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.checkStrictMode=Re.getErrorPath=Re.Type=Re.useFunc=Re.setEvaluated=Re.evaluatedPropsToName=Re.mergeEvaluated=Re.eachItem=Re.unescapeJsonPointer=Re.escapeJsonPointer=Re.escapeFragment=Re.unescapeFragment=Re.schemaRefOrVal=Re.schemaHasRulesButRef=Re.schemaHasRules=Re.checkUnknownRules=Re.alwaysValidSchema=Re.toHash=void 0;const e=Oe(),n=gc();function o(b){const j={};for(const T of b)j[T]=!0;return j}Re.toHash=o;function l(b,j){return typeof j=="boolean"?j:Object.keys(j).length===0?!0:(c(b,j),!u(j,b.self.RULES.all))}Re.alwaysValidSchema=l;function c(b,j=b.schema){const{opts:T,self:O}=b;if(!T.strictSchema||typeof j=="boolean")return;const V=O.RULES.keywords;for(const F in j)V[F]||R(b,`unknown keyword: "${F}"`)}Re.checkUnknownRules=c;function u(b,j){if(typeof b=="boolean")return!b;for(const T in b)if(j[T])return!0;return!1}Re.schemaHasRules=u;function f(b,j){if(typeof b=="boolean")return!b;for(const T in b)if(T!=="$ref"&&j.all[T])return!0;return!1}Re.schemaHasRulesButRef=f;function p({topSchemaRef:b,schemaPath:j},T,O,V){if(!V){if(typeof T=="number"||typeof T=="boolean")return T;if(typeof T=="string")return(0,e._)`${T}`}return(0,e._)`${b}${j}${(0,e.getProperty)(O)}`}Re.schemaRefOrVal=p;function g(b){return v(decodeURIComponent(b))}Re.unescapeFragment=g;function h(b){return encodeURIComponent(y(b))}Re.escapeFragment=h;function y(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}Re.escapeJsonPointer=y;function v(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}Re.unescapeJsonPointer=v;function w(b,j){if(Array.isArray(b))for(const T of b)j(T);else j(b)}Re.eachItem=w;function N({mergeNames:b,mergeToName:j,mergeValues:T,resultToName:O}){return(V,F,H,Q)=>{const ue=H===void 0?F:H instanceof e.Name?(F instanceof e.Name?b(V,F,H):j(V,F,H),H):F instanceof e.Name?(j(V,H,F),F):T(F,H);return Q===e.Name&&!(ue instanceof e.Name)?O(V,ue):ue}}Re.mergeEvaluated={props:N({mergeNames:(b,j,T)=>b.if((0,e._)`${T} !== true && ${j} !== undefined`,()=>{b.if((0,e._)`${j} === true`,()=>b.assign(T,!0),()=>b.assign(T,(0,e._)`${T} || {}`).code((0,e._)`Object.assign(${T}, ${j})`))}),mergeToName:(b,j,T)=>b.if((0,e._)`${T} !== true`,()=>{j===!0?b.assign(T,!0):(b.assign(T,(0,e._)`${T} || {}`),z(b,T,j))}),mergeValues:(b,j)=>b===!0?!0:{...b,...j},resultToName:x}),items:N({mergeNames:(b,j,T)=>b.if((0,e._)`${T} !== true && ${j} !== undefined`,()=>b.assign(T,(0,e._)`${j} === true ? true : ${T} > ${j} ? ${T} : ${j}`)),mergeToName:(b,j,T)=>b.if((0,e._)`${T} !== true`,()=>b.assign(T,j===!0?!0:(0,e._)`${T} > ${j} ? ${T} : ${j}`)),mergeValues:(b,j)=>b===!0?!0:Math.max(b,j),resultToName:(b,j)=>b.var("items",j)})};function x(b,j){if(j===!0)return b.var("props",!0);const T=b.var("props",(0,e._)`{}`);return j!==void 0&&z(b,T,j),T}Re.evaluatedPropsToName=x;function z(b,j,T){Object.keys(T).forEach(O=>b.assign((0,e._)`${j}${(0,e.getProperty)(O)}`,!0))}Re.setEvaluated=z;const E={};function k(b,j){return b.scopeValue("func",{ref:j,code:E[j.code]||(E[j.code]=new n._Code(j.code))})}Re.useFunc=k;var $;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})($||(Re.Type=$={}));function S(b,j,T){if(b instanceof e.Name){const O=j===$.Num;return T?O?(0,e._)`"[" + ${b} + "]"`:(0,e._)`"['" + ${b} + "']"`:O?(0,e._)`"/" + ${b}`:(0,e._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return T?(0,e.getProperty)(b).toString():"/"+y(b)}Re.getErrorPath=S;function R(b,j,T=b.opts.strictSchema){if(T){if(j=`strict mode: ${j}`,T===!0)throw new Error(j);b.self.logger.warn(j)}}return Re.checkStrictMode=R,Re}var xs={},_h;function hr(){if(_h)return xs;_h=1,Object.defineProperty(xs,"__esModule",{value:!0});const e=Oe(),n={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return xs.default=n,xs}var jh;function jc(){return jh||(jh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const n=Oe(),o=Be(),l=hr();e.keywordError={message:({keyword:E})=>(0,n.str)`must pass "${E}" keyword validation`},e.keyword$DataError={message:({keyword:E,schemaType:k})=>k?(0,n.str)`"${E}" keyword must be ${k} ($data)`:(0,n.str)`"${E}" keyword is invalid ($data)`};function c(E,k=e.keywordError,$,S){const{it:R}=E,{gen:b,compositeRule:j,allErrors:T}=R,O=v(E,k,$);S??(j||T)?g(b,O):h(R,(0,n._)`[${O}]`)}e.reportError=c;function u(E,k=e.keywordError,$){const{it:S}=E,{gen:R,compositeRule:b,allErrors:j}=S,T=v(E,k,$);g(R,T),b||j||h(S,l.default.vErrors)}e.reportExtraError=u;function f(E,k){E.assign(l.default.errors,k),E.if((0,n._)`${l.default.vErrors} !== null`,()=>E.if(k,()=>E.assign((0,n._)`${l.default.vErrors}.length`,k),()=>E.assign(l.default.vErrors,null)))}e.resetErrorsCount=f;function p({gen:E,keyword:k,schemaValue:$,data:S,errsCount:R,it:b}){if(R===void 0)throw new Error("ajv implementation error");const j=E.name("err");E.forRange("i",R,l.default.errors,T=>{E.const(j,(0,n._)`${l.default.vErrors}[${T}]`),E.if((0,n._)`${j}.instancePath === undefined`,()=>E.assign((0,n._)`${j}.instancePath`,(0,n.strConcat)(l.default.instancePath,b.errorPath))),E.assign((0,n._)`${j}.schemaPath`,(0,n.str)`${b.errSchemaPath}/${k}`),b.opts.verbose&&(E.assign((0,n._)`${j}.schema`,$),E.assign((0,n._)`${j}.data`,S))})}e.extendErrors=p;function g(E,k){const $=E.const("err",k);E.if((0,n._)`${l.default.vErrors} === null`,()=>E.assign(l.default.vErrors,(0,n._)`[${$}]`),(0,n._)`${l.default.vErrors}.push(${$})`),E.code((0,n._)`${l.default.errors}++`)}function h(E,k){const{gen:$,validateName:S,schemaEnv:R}=E;R.$async?$.throw((0,n._)`new ${E.ValidationError}(${k})`):($.assign((0,n._)`${S}.errors`,k),$.return(!1))}const y={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function v(E,k,$){const{createErrors:S}=E.it;return S===!1?(0,n._)`{}`:w(E,k,$)}function w(E,k,$={}){const{gen:S,it:R}=E,b=[N(R,$),x(E,$)];return z(E,k,b),S.object(...b)}function N({errorPath:E},{instancePath:k}){const $=k?(0,n.str)`${E}${(0,o.getErrorPath)(k,o.Type.Str)}`:E;return[l.default.instancePath,(0,n.strConcat)(l.default.instancePath,$)]}function x({keyword:E,it:{errSchemaPath:k}},{schemaPath:$,parentSchema:S}){let R=S?k:(0,n.str)`${k}/${E}`;return $&&(R=(0,n.str)`${R}${(0,o.getErrorPath)($,o.Type.Str)}`),[y.schemaPath,R]}function z(E,{params:k,message:$},S){const{keyword:R,data:b,schemaValue:j,it:T}=E,{opts:O,propertyName:V,topSchemaRef:F,schemaPath:H}=T;S.push([y.keyword,R],[y.params,typeof k=="function"?k(E):k||(0,n._)`{}`]),O.messages&&S.push([y.message,typeof $=="function"?$(E):$]),O.verbose&&S.push([y.schema,j],[y.parentSchema,(0,n._)`${F}${H}`],[l.default.data,b]),V&&S.push([y.propertyName,V])}})(Qd)),Qd}var Sh;function o3(){if(Sh)return Vr;Sh=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.boolOrEmptySchema=Vr.topBoolOrEmptySchema=void 0;const e=jc(),n=Oe(),o=hr(),l={message:"boolean schema is false"};function c(p){const{gen:g,schema:h,validateName:y}=p;h===!1?f(p,!1):typeof h=="object"&&h.$async===!0?g.return(o.default.data):(g.assign((0,n._)`${y}.errors`,null),g.return(!0))}Vr.topBoolOrEmptySchema=c;function u(p,g){const{gen:h,schema:y}=p;y===!1?(h.var(g,!1),f(p)):h.var(g,!0)}Vr.boolOrEmptySchema=u;function f(p,g){const{gen:h,data:y}=p,v={gen:h,keyword:"false schema",data:y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:p};(0,e.reportError)(v,l,void 0,g)}return Vr}var Ut={},Hr={},wh;function Wv(){if(wh)return Hr;wh=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.getRules=Hr.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],n=new Set(e);function o(c){return typeof c=="string"&&n.has(c)}Hr.isJSONType=o;function l(){const c={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...c,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},c.number,c.string,c.array,c.object],post:{rules:[]},all:{},keywords:{}}}return Hr.getRules=l,Hr}var fn={},kh;function Jv(){if(kh)return fn;kh=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.shouldUseRule=fn.shouldUseGroup=fn.schemaHasRulesForType=void 0;function e({schema:l,self:c},u){const f=c.RULES.types[u];return f&&f!==!0&&n(l,f)}fn.schemaHasRulesForType=e;function n(l,c){return c.rules.some(u=>o(l,u))}fn.shouldUseGroup=n;function o(l,c){var u;return l[c.keyword]!==void 0||((u=c.definition.implements)===null||u===void 0?void 0:u.some(f=>l[f]!==void 0))}return fn.shouldUseRule=o,fn}var Nh;function mc(){if(Nh)return Ut;Nh=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.reportTypeError=Ut.checkDataTypes=Ut.checkDataType=Ut.coerceAndCheckDataType=Ut.getJSONTypes=Ut.getSchemaTypes=Ut.DataType=void 0;const e=Wv(),n=Jv(),o=jc(),l=Oe(),c=Be();var u;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(u||(Ut.DataType=u={}));function f($){const S=p($.type);if(S.includes("null")){if($.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!S.length&&$.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');$.nullable===!0&&S.push("null")}return S}Ut.getSchemaTypes=f;function p($){const S=Array.isArray($)?$:$?[$]:[];if(S.every(e.isJSONType))return S;throw new Error("type must be JSONType or JSONType[]: "+S.join(","))}Ut.getJSONTypes=p;function g($,S){const{gen:R,data:b,opts:j}=$,T=y(S,j.coerceTypes),O=S.length>0&&!(T.length===0&&S.length===1&&(0,n.schemaHasRulesForType)($,S[0]));if(O){const V=x(S,b,j.strictNumbers,u.Wrong);R.if(V,()=>{T.length?v($,S,T):E($)})}return O}Ut.coerceAndCheckDataType=g;const h=new Set(["string","number","integer","boolean","null"]);function y($,S){return S?$.filter(R=>h.has(R)||S==="array"&&R==="array"):[]}function v($,S,R){const{gen:b,data:j,opts:T}=$,O=b.let("dataType",(0,l._)`typeof ${j}`),V=b.let("coerced",(0,l._)`undefined`);T.coerceTypes==="array"&&b.if((0,l._)`${O} == 'object' && Array.isArray(${j}) && ${j}.length == 1`,()=>b.assign(j,(0,l._)`${j}[0]`).assign(O,(0,l._)`typeof ${j}`).if(x(S,j,T.strictNumbers),()=>b.assign(V,j))),b.if((0,l._)`${V} !== undefined`);for(const H of R)(h.has(H)||H==="array"&&T.coerceTypes==="array")&&F(H);b.else(),E($),b.endIf(),b.if((0,l._)`${V} !== undefined`,()=>{b.assign(j,V),w($,V)});function F(H){switch(H){case"string":b.elseIf((0,l._)`${O} == "number" || ${O} == "boolean"`).assign(V,(0,l._)`"" + ${j}`).elseIf((0,l._)`${j} === null`).assign(V,(0,l._)`""`);return;case"number":b.elseIf((0,l._)`${O} == "boolean" || ${j} === null
|
|
89
89
|
|| (${O} == "string" && ${j} && ${j} == +${j})`).assign(V,(0,l._)`+${j}`);return;case"integer":b.elseIf((0,l._)`${O} === "boolean" || ${j} === null
|
|
90
90
|
|| (${O} === "string" && ${j} && ${j} == +${j} && !(${j} % 1))`).assign(V,(0,l._)`+${j}`);return;case"boolean":b.elseIf((0,l._)`${j} === "false" || ${j} === 0 || ${j} === null`).assign(V,!1).elseIf((0,l._)`${j} === "true" || ${j} === 1`).assign(V,!0);return;case"null":b.elseIf((0,l._)`${j} === "" || ${j} === 0 || ${j} === false`),b.assign(V,null);return;case"array":b.elseIf((0,l._)`${O} === "string" || ${O} === "number"
|
|
@@ -181,7 +181,7 @@ ${u}
|
|
|
181
181
|
${f}
|
|
182
182
|
}
|
|
183
183
|
}`;return`${y}
|
|
184
|
-
${v}`}var Ck=["useAction","useStream","useAuth","useApp","useRender","useGguiContext","useContract","useWireContext","GguiWireProvider"],Tk=["Container","Card","Stack","Row","Grid","Box","Divider","Spacer","Text","Heading","Button","Input","TextArea","Select","Checkbox","Toggle","RadioGroup","Slider","Badge","Spinner","Skeleton","Avatar","Alert","Progress","Image","Icon","Link","Tooltip","Table","Tabs","Toast","Accordion","MotionKeyframes","useMotion","useAnimationKey"],Mk=["SearchField","FormField","MenuItem","Tag","Dropdown","Autocomplete","Breadcrumb","Pagination","EmptyState","Stat","Stepper"],Rk=["Header","Sidebar","CardGrid","CommentThread","DataTable","ChatWindow","NavigationBar","FileUploader","NotificationCenter","Modal","CommandPalette","Footer","Hero"],qy=["Clickable","Hoverable","Pressable"],Ok=["useState","useEffect","useRef","useCallback","useMemo","useContext","useReducer","useId","use","useActionState","useOptimistic","useTransition","startTransition","useDeferredValue","useSyncExternalStore","useInsertionEffect","useLayoutEffect","useImperativeHandle","useDebugValue","createElement","Fragment","Children","cloneElement","createContext","forwardRef","memo","lazy","Suspense","Component","PureComponent","isValidElement","createRef"],Ak=["animation","duration","easing","transition","keyframes","thinkingAnimation","thinkingKeyframes","thinkingPresets","THINKING_DEFAULT_STYLE","motionSafe","reducedMotion","reducedMotionCSS","colors","gray","primary","semantic","chartColors","success","warning","error","info","highContrast","typography","fontFamily","fontSize","fontSizeValues","fontWeight","lineHeight","letterSpacing","headingStyles","spacing","spacingValues","radius","shadow","elevation","maxWidth","zIndex","accessibility","focusRing","nativeTokens","tokens"];function It(e,n,o){return e=e.split(`from"${n}"`).join(`from"${o}"`),e=e.split(`from "${n}"`).join(`from "${o}"`),e=e.split(`from'${n}'`).join(`from'${o}'`),e=e.split(`from '${n}'`).join(`from '${o}'`),e=e.split(`import"${n}"`).join(`import"${o}"`),e=e.split(`import "${n}"`).join(`import "${o}"`),e=e.split(`import'${n}'`).join(`import'${o}'`),e=e.split(`import '${n}'`).join(`import '${o}'`),e}function Jf(e,n){return`(globalThis.__ggui__&&globalThis.__ggui__["${e}"]||window["${n}"])`}function Dk(e){const n=Ok.map(c=>`export const ${c} = R.${c};`).join(" "),l=`const R = ${Jf("react",e)}; export default R; ${n}`;return`data:text/javascript,${encodeURIComponent(l)}`}function Uk(){const o=`const D = globalThis.__ggui__["reactDom"]; export default D; ${["createPortal","flushSync","unstable_batchedUpdates"].map(l=>`export const ${l} = D.${l};`).join(" ")}`;return`data:text/javascript,${encodeURIComponent(o)}`}function Ik(e){const o=[`const R = ${Jf("react",e)};`,"function jsx(t,p,k){","if(k!==undefined){p={...p,key:k}}","const c=p.children;","delete p.children;","return Array.isArray(c)?R.createElement(t,p,...c):c!==undefined?R.createElement(t,p,c):R.createElement(t,p)","}","export{jsx,jsx as jsxs,jsx as jsxDEV};","export const Fragment=R.Fragment;"].join("");return`data:text/javascript,${encodeURIComponent(o)}`}function Zn(e,n,o,l,c){if(o&&o.length>0){const p=[e,...l||[]],g=[n,...c||[]],h=p.map((N,x)=>`(globalThis.__ggui__&&globalThis.__ggui__["${g[x]}"]||window["${N}"]||{})`),y=h.join(","),v=o.map(N=>`export const ${N} = M["${N}"];`).join(" "),w=h.length>1?`const M = Object.assign({}, ${y}); ${v} export default M;`:`const M = ${h[0]}; ${v} export default M;`;return`data:text/javascript,${encodeURIComponent(w)}`}const f=`const M = ${Jf(n,e)} || {}; const handler = { get(_, key) { return M[key]; } }; export default new Proxy({}, handler);`;return`data:text/javascript,${encodeURIComponent(f)}`}function Lk(){const n=`const w = globalThis.__ggui__.wire; ${Ck.map(o=>`export const ${o} = w.${o};`).join(" ")} export default w;`;return`data:text/javascript,${encodeURIComponent(n)}`}function Vk(e,n){var f;const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`import\\s*(?:[A-Za-z_$][\\w$]*\\s*,\\s*)?\\{([^}]*)\\}\\s*from\\s*['"]${o}['"]`,"g"),c=new Set;let u;for(;(u=l.exec(e))!==null;)for(const p of u[1].split(",")){const g=(f=p.trim().split(/\s+as\s+/)[0])==null?void 0:f.trim();g!==void 0&&/^[A-Za-z_$][\w$]*$/.test(g)&&c.add(g)}return[...c]}function Hk(e,n){const o=JSON.stringify(e),l=n.some(u=>/^[A-Z]/.test(u)),c=[];c.push(`var P=${o};`),c.push("function NS(){return(globalThis.__ggui__&&globalThis.__ggui__.gadgets&&globalThis.__ggui__.gadgets[P])||{};}"),c.push('function H(n){return function(){var f=NS()[n];if(typeof f!=="function")throw new Error("[gadget] export "+n+" from package "+P+" is not loaded — the package failed to load at iframe boot or is not registered on App.gadgets.");return f.apply(this,arguments);};}'),l&&(c.push("var R=globalThis.__ggui__&&globalThis.__ggui__.react;"),c.push('class GEB extends R.Component{constructor(p){super(p);this.state={e:null};}static getDerivedStateFromError(e){return{e:e};}render(){if(this.state.e)return R.createElement("div",{style:{padding:"8px",border:"1px solid #e0a0c0",borderRadius:"6px",color:"#a03070",font:"13px system-ui"}},"[gadget] "+this.props.g+" failed to render");return this.props.children;}}'),c.push('function C(n){return function(props){var Cmp=NS()[n];if(typeof Cmp!=="function")return R.createElement("div",{style:{padding:"8px",border:"1px solid #e0a0c0",borderRadius:"6px",color:"#a03070",font:"13px system-ui"}},"[gadget] component "+n+" from package "+P+" is not loaded");return R.createElement(GEB,{g:n},R.createElement(Cmp,props));};}'));for(const u of n){const f=/^[A-Z]/.test(u)?"C":"H";c.push(`export const ${u}=${f}(${JSON.stringify(u)});`)}return c.push("export default new Proxy({},{get:function(_,k){return NS()[k];}});"),`data:text/javascript,${encodeURIComponent(c.join(""))}`}function Bk(e,n){const o=n.reactGlobal??"__REACT",l=n.primitivesGlobal??"__GGUI_PRIMITIVES",c=n.componentsGlobal??"__GGUI_COMPONENTS",u=n.compositionsGlobal??"__GGUI_COMPOSITIONS",f=n.interactGlobal??"__GGUI_INTERACT",p=n.appComponentsGlobal??"__GGUI_APP_COMPONENTS",g=Dk(o),h=Ik(o);e=It(e,"react/jsx-runtime",h),e=It(e,"react/jsx-dev-runtime",h);const y=Uk();e=It(e,"react-dom",y),e=It(e,"react",g);const v=[...Tk,...Mk,...Rk,...qy];e=It(e,"@ggui-ai/design/primitives",Zn(l,"primitives",v,[c,u,f],["components","compositions","interact"])),e=It(e,"@ggui-ai/design/components",Zn(c,"components",v,[l,u,f],["primitives","compositions","interact"])),e=It(e,"@ggui-ai/design/compositions",Zn(u,"compositions",v,[l,c,f],["primitives","components","interact"])),e=It(e,"@ggui-ai/design/interact",Zn(f,"interact",[...qy])),e=It(e,"@ggui-ai/design/templates",Zn(u,"compositions",v,[l,c],["primitives","components"])),e=It(e,"@ggui-ai/design/app-components",Zn(p,"appComponents")),e=It(e,"@ggui-ai/design/tokens",Zn("__GGUI_TOKENS","tokens",[...Ak])),e=It(e,"@ggui-ai/design",Zn(l,"primitives",v,[c,u,f],["components","compositions","interact"])),e=It(e,"@ggui-ai/wire",Lk());const w=[...new Set(["@ggui-ai/gadgets",...n.gadgetPackages??[]])];for(const N of w){const x=Vk(e,N);e=It(e,N,Hk(N,x))}return e}function qk(e,n){const o=n.reactBaseUrl??"https://esm.sh/react@18.2.0";return e=It(e,"react/jsx-runtime",`${o}/jsx-runtime`),e=It(e,"react/jsx-dev-runtime",`${o}/jsx-runtime`),e=It(e,"react",o),e}function Pk(e,n){switch(n.mode){case"data-url":return Bk(e,n);case"importmap":return qk(e,n)}}function Zk(e){const n=e.split(";"),o=[],l=[];for(const c of n)c.trimStart().startsWith("import")?o.push(c):l.push(c);return o.length===0?e:o.join(";")+";"+l.join(";")}async function Gk(e){const n=new Blob([e],{type:"application/javascript"}),o=URL.createObjectURL(n);try{return await import(o)}finally{URL.revokeObjectURL(o)}}var Fk=0;function Yk(e){return`ggui-rcr-${e.replace(/[^a-z0-9]/gi,"")}`}var Kk=1,Xk=500,Wk=class extends uc.Component{constructor(){super(...arguments);cn(this,"state",{error:null,catchCount:0,autoRetrying:!1});cn(this,"retryTimer",null)}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){var l,c;const o=this.state.catchCount+1;this.setState({catchCount:o}),o<=Kk?(this.setState({autoRetrying:!0}),this.retryTimer=setTimeout(()=>{this.setState({error:null,autoRetrying:!1})},Xk)):(c=(l=this.props).onError)==null||c.call(l,n)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{error:n,autoRetrying:o,catchCount:l}=this.state;return n?o?r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:24,minHeight:80,gap:8,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:13,color:"rgba(255,255,255,0.4)"},children:[r.jsx("div",{style:{width:16,height:16,border:"2px solid rgba(255,255,255,0.15)",borderTopColor:"rgba(255,255,255,0.5)",borderRadius:"50%",animation:"ggui-err-spin 0.6s linear infinite"}}),"Retrying...",r.jsx("style",{children:"@keyframes ggui-err-spin { to { transform: rotate(360deg); } }"})]}):r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 24px",minHeight:120,gap:12,textAlign:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[r.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"rgba(239, 68, 68, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"!"}),r.jsx("div",{style:{fontSize:14,fontWeight:600,color:"rgba(255,255,255,0.8)"},children:"Something went wrong"}),r.jsx("div",{style:{fontSize:12,color:"rgba(255,255,255,0.4)",maxWidth:280,lineHeight:1.4},children:"This component encountered an error. Try asking for a different view."}),r.jsx("button",{onClick:()=>this.setState({error:null,catchCount:0}),style:{marginTop:4,padding:"8px 20px",borderRadius:8,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.7)",fontSize:13,fontWeight:500,cursor:"pointer"},children:"Retry"}),l>1&&r.jsx("div",{style:{fontSize:11,color:"rgba(255,255,255,0.2)"},children:n.message})]}):this.props.children}};function Jk({code:e,props:n={},themeId:o,cssOverrides:l,fallback:c=r.jsx("div",{children:"Loading component..."}),onError:u}){const f=U.useId(),[p]=U.useState(()=>Yk(f)||`ggui-rcr-${++Fk}`),[g,h]=U.useState(null),[y,v]=U.useState(null),[w,N]=U.useState(!0);U.useEffect(()=>{if(!e||e.trim().length===0){h(null),N(!1);return}let z=!1;N(!0),v(null),h(null);async function E(){try{let k=e;if(e.startsWith("https://")){const V=await fetch(e);if(!V.ok)throw new Error(`Failed to fetch component code: ${V.status}`);k=await V.text()}const $=Z8(k),S=globalThis;let R={};try{R=await tx(()=>import("./index-6mvzld66.js").then(V=>V.i),[])}catch{}S.__ggui__={react:uc,reactDom:R,primitives:xf,components:jf,compositions:wf,interact:kf,wire:L6},S.__REACT=uc,S.__GGUI_PRIMITIVES=xf,S.__GGUI_COMPONENTS=jf,S.__GGUI_COMPOSITIONS=wf,S.__GGUI_INTERACT=kf;const b=Zk($),j=Pk(b,{mode:"data-url"}),T=await Gk(j);if(z)return;const O=T.default??Object.values(T).find(V=>typeof V=="function");if(!O)throw new Error("Module does not export a default component");h(()=>O),v(null)}catch(k){if(z)return;const $=k instanceof Error?k:new Error(String(k));v($),h(null),u==null||u($)}finally{z||N(!1)}}return E(),()=>{z=!0}},[e]);const x=o?Wf(o,p):Ek(p);return!e||e.trim().length===0?r.jsx("div",{children:c}):w?r.jsx("div",{children:c}):y?r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 24px",minHeight:120,gap:12,textAlign:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[r.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"rgba(239, 68, 68, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"!"}),r.jsx("div",{style:{fontSize:14,fontWeight:600,color:"rgba(255,255,255,0.8)"},children:"Failed to load component"}),r.jsx("div",{style:{fontSize:12,color:"rgba(255,255,255,0.4)",maxWidth:280,lineHeight:1.4},children:y.message})]}):g?r.jsxs("div",{className:p,children:[r.jsxs("style",{children:[x,l??""]}),r.jsx(Wk,{onError:u,children:r.jsx(g,{...n})},e.length)]}):r.jsx("div",{children:c})}var Py="ggui-preview-keyframes",Qk=`@keyframes ggui-preview-shimmer {
|
|
184
|
+
${v}`}var Ck=["useAction","useStream","useAuth","useApp","useRender","useGguiContext","useContract","useWireContext","GguiWireProvider"],Tk=["Container","Card","Stack","Row","Grid","Box","Divider","Spacer","Text","Heading","Button","Input","TextArea","Select","Checkbox","Toggle","RadioGroup","Slider","Badge","Spinner","Skeleton","Avatar","Alert","Progress","Image","Icon","Link","Tooltip","Table","Tabs","Toast","Accordion","MotionKeyframes","useMotion","useAnimationKey"],Mk=["SearchField","FormField","MenuItem","Tag","Dropdown","Autocomplete","Breadcrumb","Pagination","EmptyState","Stat","Stepper"],Rk=["Header","Sidebar","CardGrid","CommentThread","DataTable","ChatWindow","NavigationBar","FileUploader","NotificationCenter","Modal","CommandPalette","Footer","Hero"],qy=["Clickable","Hoverable","Pressable"],Ok=["useState","useEffect","useRef","useCallback","useMemo","useContext","useReducer","useId","use","useActionState","useOptimistic","useTransition","startTransition","useDeferredValue","useSyncExternalStore","useInsertionEffect","useLayoutEffect","useImperativeHandle","useDebugValue","createElement","Fragment","Children","cloneElement","createContext","forwardRef","memo","lazy","Suspense","Component","PureComponent","isValidElement","createRef"],Ak=["animation","duration","easing","transition","keyframes","thinkingAnimation","thinkingKeyframes","thinkingPresets","THINKING_DEFAULT_STYLE","motionSafe","reducedMotion","reducedMotionCSS","colors","gray","primary","semantic","chartColors","success","warning","error","info","highContrast","typography","fontFamily","fontSize","fontSizeValues","fontWeight","lineHeight","letterSpacing","headingStyles","spacing","spacingValues","radius","shadow","elevation","maxWidth","zIndex","accessibility","focusRing","nativeTokens","tokens"];function It(e,n,o){return e=e.split(`from"${n}"`).join(`from"${o}"`),e=e.split(`from "${n}"`).join(`from "${o}"`),e=e.split(`from'${n}'`).join(`from'${o}'`),e=e.split(`from '${n}'`).join(`from '${o}'`),e=e.split(`import"${n}"`).join(`import"${o}"`),e=e.split(`import "${n}"`).join(`import "${o}"`),e=e.split(`import'${n}'`).join(`import'${o}'`),e=e.split(`import '${n}'`).join(`import '${o}'`),e}function Jf(e,n){return`(globalThis.__ggui__&&globalThis.__ggui__["${e}"]||window["${n}"])`}function Dk(e){const n=Ok.map(c=>`export const ${c} = R.${c};`).join(" "),l=`const R = ${Jf("react",e)}; export default R; ${n}`;return`data:text/javascript,${encodeURIComponent(l)}`}function Uk(){const o=`const D = globalThis.__ggui__["reactDom"]; export default D; ${["createPortal","flushSync","unstable_batchedUpdates"].map(l=>`export const ${l} = D.${l};`).join(" ")}`;return`data:text/javascript,${encodeURIComponent(o)}`}function Ik(e){const o=[`const R = ${Jf("react",e)};`,"function jsx(t,p,k){","if(k!==undefined){p={...p,key:k}}","const c=p.children;","delete p.children;","return Array.isArray(c)?R.createElement(t,p,...c):c!==undefined?R.createElement(t,p,c):R.createElement(t,p)","}","export{jsx,jsx as jsxs,jsx as jsxDEV};","export const Fragment=R.Fragment;"].join("");return`data:text/javascript,${encodeURIComponent(o)}`}function Zn(e,n,o,l,c){if(o&&o.length>0){const p=[e,...l||[]],g=[n,...c||[]],h=p.map((N,x)=>`(globalThis.__ggui__&&globalThis.__ggui__["${g[x]}"]||window["${N}"]||{})`),y=h.join(","),v=o.map(N=>`export const ${N} = M["${N}"];`).join(" "),w=h.length>1?`const M = Object.assign({}, ${y}); ${v} export default M;`:`const M = ${h[0]}; ${v} export default M;`;return`data:text/javascript,${encodeURIComponent(w)}`}const f=`const M = ${Jf(n,e)} || {}; const handler = { get(_, key) { return M[key]; } }; export default new Proxy({}, handler);`;return`data:text/javascript,${encodeURIComponent(f)}`}function Lk(){const n=`const w = globalThis.__ggui__.wire; ${Ck.map(o=>`export const ${o} = w.${o};`).join(" ")} export default w;`;return`data:text/javascript,${encodeURIComponent(n)}`}function Vk(e,n){var f;const o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`import\\s*(?:[A-Za-z_$][\\w$]*\\s*,\\s*)?\\{([^}]*)\\}\\s*from\\s*['"]${o}['"]`,"g"),c=new Set;let u;for(;(u=l.exec(e))!==null;)for(const p of u[1].split(",")){const g=(f=p.trim().split(/\s+as\s+/)[0])==null?void 0:f.trim();g!==void 0&&/^[A-Za-z_$][\w$]*$/.test(g)&&c.add(g)}return[...c]}function Hk(e,n){const o=JSON.stringify(e),l=n.some(u=>/^[A-Z]/.test(u)),c=[];c.push(`var P=${o};`),c.push("function NS(){return(globalThis.__ggui__&&globalThis.__ggui__.gadgets&&globalThis.__ggui__.gadgets[P])||{};}"),c.push('function H(n){return function(){var f=NS()[n];if(typeof f!=="function")throw new Error("[gadget] export "+n+" from package "+P+" is not loaded — the package failed to load at iframe boot or is not registered on App.gadgets.");return f.apply(this,arguments);};}'),l&&(c.push("var R=globalThis.__ggui__&&globalThis.__ggui__.react;"),c.push('class GEB extends R.Component{constructor(p){super(p);this.state={e:null};}static getDerivedStateFromError(e){return{e:e};}render(){if(this.state.e)return R.createElement("div",{style:{padding:"8px",border:"1px solid #e0a0c0",borderRadius:"6px",color:"#a03070",font:"13px system-ui"}},"[gadget] "+this.props.g+" failed to render");return this.props.children;}}'),c.push('function C(n){return function(props){var Cmp=NS()[n];if(typeof Cmp!=="function")return R.createElement("div",{style:{padding:"8px",border:"1px solid #e0a0c0",borderRadius:"6px",color:"#a03070",font:"13px system-ui"}},"[gadget] component "+n+" from package "+P+" is not loaded");return R.createElement(GEB,{g:n},R.createElement(Cmp,props));};}'));for(const u of n){const f=/^[A-Z]/.test(u)?"C":"H";c.push(`export const ${u}=${f}(${JSON.stringify(u)});`)}return c.push("export default new Proxy({},{get:function(_,k){return NS()[k];}});"),`data:text/javascript,${encodeURIComponent(c.join(""))}`}function Bk(e,n){const o=n.reactGlobal??"__REACT",l=n.primitivesGlobal??"__GGUI_PRIMITIVES",c=n.componentsGlobal??"__GGUI_COMPONENTS",u=n.compositionsGlobal??"__GGUI_COMPOSITIONS",f=n.interactGlobal??"__GGUI_INTERACT",p=n.appComponentsGlobal??"__GGUI_APP_COMPONENTS",g=Dk(o),h=Ik(o);e=It(e,"react/jsx-runtime",h),e=It(e,"react/jsx-dev-runtime",h);const y=Uk();e=It(e,"react-dom",y),e=It(e,"react",g);const v=[...Tk,...Mk,...Rk,...qy];e=It(e,"@ggui-ai/design/primitives",Zn(l,"primitives",v,[c,u,f],["components","compositions","interact"])),e=It(e,"@ggui-ai/design/components",Zn(c,"components",v,[l,u,f],["primitives","compositions","interact"])),e=It(e,"@ggui-ai/design/compositions",Zn(u,"compositions",v,[l,c,f],["primitives","components","interact"])),e=It(e,"@ggui-ai/design/interact",Zn(f,"interact",[...qy])),e=It(e,"@ggui-ai/design/templates",Zn(u,"compositions",v,[l,c],["primitives","components"])),e=It(e,"@ggui-ai/design/app-components",Zn(p,"appComponents")),e=It(e,"@ggui-ai/design/tokens",Zn("__GGUI_TOKENS","tokens",[...Ak])),e=It(e,"@ggui-ai/design",Zn(l,"primitives",v,[c,u,f],["components","compositions","interact"])),e=It(e,"@ggui-ai/wire",Lk());const w=[...new Set(["@ggui-ai/gadgets",...n.gadgetPackages??[]])];for(const N of w){const x=Vk(e,N);e=It(e,N,Hk(N,x))}return e}function qk(e,n){const o=n.reactBaseUrl??"https://esm.sh/react@18.2.0";return e=It(e,"react/jsx-runtime",`${o}/jsx-runtime`),e=It(e,"react/jsx-dev-runtime",`${o}/jsx-runtime`),e=It(e,"react",o),e}function Pk(e,n){switch(n.mode){case"data-url":return Bk(e,n);case"importmap":return qk(e,n)}}function Zk(e){const n=e.split(";"),o=[],l=[];for(const c of n)c.trimStart().startsWith("import")?o.push(c):l.push(c);return o.length===0?e:o.join(";")+";"+l.join(";")}async function Gk(e){const n=new Blob([e],{type:"application/javascript"}),o=URL.createObjectURL(n);try{return await import(o)}finally{URL.revokeObjectURL(o)}}var Fk=0;function Yk(e){return`ggui-rcr-${e.replace(/[^a-z0-9]/gi,"")}`}var Kk=1,Xk=500,Wk=class extends uc.Component{constructor(){super(...arguments);cn(this,"state",{error:null,catchCount:0,autoRetrying:!1});cn(this,"retryTimer",null)}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n){var l,c;const o=this.state.catchCount+1;this.setState({catchCount:o}),o<=Kk?(this.setState({autoRetrying:!0}),this.retryTimer=setTimeout(()=>{this.setState({error:null,autoRetrying:!1})},Xk)):(c=(l=this.props).onError)==null||c.call(l,n)}componentWillUnmount(){this.retryTimer&&clearTimeout(this.retryTimer)}render(){const{error:n,autoRetrying:o,catchCount:l}=this.state;return n?o?r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:24,minHeight:80,gap:8,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:13,color:"rgba(255,255,255,0.4)"},children:[r.jsx("div",{style:{width:16,height:16,border:"2px solid rgba(255,255,255,0.15)",borderTopColor:"rgba(255,255,255,0.5)",borderRadius:"50%",animation:"ggui-err-spin 0.6s linear infinite"}}),"Retrying...",r.jsx("style",{children:"@keyframes ggui-err-spin { to { transform: rotate(360deg); } }"})]}):r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 24px",minHeight:120,gap:12,textAlign:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[r.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"rgba(239, 68, 68, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"!"}),r.jsx("div",{style:{fontSize:14,fontWeight:600,color:"rgba(255,255,255,0.8)"},children:"Something went wrong"}),r.jsx("div",{style:{fontSize:12,color:"rgba(255,255,255,0.4)",maxWidth:280,lineHeight:1.4},children:"This component encountered an error. Try asking for a different view."}),r.jsx("button",{onClick:()=>this.setState({error:null,catchCount:0}),style:{marginTop:4,padding:"8px 20px",borderRadius:8,border:"1px solid rgba(255,255,255,0.15)",background:"rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.7)",fontSize:13,fontWeight:500,cursor:"pointer"},children:"Retry"}),l>1&&r.jsx("div",{style:{fontSize:11,color:"rgba(255,255,255,0.2)"},children:n.message})]}):this.props.children}};function Jk({code:e,props:n={},themeId:o,cssOverrides:l,fallback:c=r.jsx("div",{children:"Loading component..."}),onError:u}){const f=U.useId(),[p]=U.useState(()=>Yk(f)||`ggui-rcr-${++Fk}`),[g,h]=U.useState(null),[y,v]=U.useState(null),[w,N]=U.useState(!0);U.useEffect(()=>{if(!e||e.trim().length===0){h(null),N(!1);return}let z=!1;N(!0),v(null),h(null);async function E(){try{let k=e;if(e.startsWith("https://")){const V=await fetch(e);if(!V.ok)throw new Error(`Failed to fetch component code: ${V.status}`);k=await V.text()}const $=Z8(k),S=globalThis;let R={};try{R=await tx(()=>import("./index-Xvb6gJOO.js").then(V=>V.i),[])}catch{}S.__ggui__={react:uc,reactDom:R,primitives:xf,components:jf,compositions:wf,interact:kf,wire:L6},S.__REACT=uc,S.__GGUI_PRIMITIVES=xf,S.__GGUI_COMPONENTS=jf,S.__GGUI_COMPOSITIONS=wf,S.__GGUI_INTERACT=kf;const b=Zk($),j=Pk(b,{mode:"data-url"}),T=await Gk(j);if(z)return;const O=T.default??Object.values(T).find(V=>typeof V=="function");if(!O)throw new Error("Module does not export a default component");h(()=>O),v(null)}catch(k){if(z)return;const $=k instanceof Error?k:new Error(String(k));v($),h(null),u==null||u($)}finally{z||N(!1)}}return E(),()=>{z=!0}},[e]);const x=o?Wf(o,p):Ek(p);return!e||e.trim().length===0?r.jsx("div",{children:c}):w?r.jsx("div",{children:c}):y?r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 24px",minHeight:120,gap:12,textAlign:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[r.jsx("div",{style:{width:48,height:48,borderRadius:14,background:"rgba(239, 68, 68, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"!"}),r.jsx("div",{style:{fontSize:14,fontWeight:600,color:"rgba(255,255,255,0.8)"},children:"Failed to load component"}),r.jsx("div",{style:{fontSize:12,color:"rgba(255,255,255,0.4)",maxWidth:280,lineHeight:1.4},children:y.message})]}):g?r.jsxs("div",{className:p,children:[r.jsxs("style",{children:[x,l??""]}),r.jsx(Wk,{onError:u,children:r.jsx(g,{...n})},e.length)]}):r.jsx("div",{children:c})}var Py="ggui-preview-keyframes",Qk=`@keyframes ggui-preview-shimmer {
|
|
185
185
|
0% { transform: translateX(-100%); }
|
|
186
186
|
100% { transform: translateX(100%); }
|
|
187
187
|
}`,e9=`@keyframes ggui-preview-caret {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as s,r as c}from"./index-
|
|
1
|
+
import{g as s,r as c}from"./index-BLXcdjFm.js";function f(t,a){for(var o=0;o<a.length;o++){const e=a[o];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var i=c();const p=s(i),g=f({__proto__:null,default:p},[i]);export{g as i};
|
package/dist/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
Single-letter mark reads cleanly at 16px tab size.
|
|
21
21
|
-->
|
|
22
22
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Cpath d='M 0 0 H 50 V 25 H 25 V 50 H 0 Z' fill='%23292929'/%3E%3Crect x='33' y='33' width='17' height='17' fill='%23f4f3ed'/%3E%3C/svg%3E" />
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-BLXcdjFm.js"></script>
|
|
24
24
|
<link rel="stylesheet" crossorigin href="/assets/index-CHgj9yqx.css">
|
|
25
25
|
</head>
|
|
26
26
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/console",
|
|
3
|
-
"version": "0.5.0-rc.
|
|
3
|
+
"version": "0.5.0-rc.2",
|
|
4
4
|
"description": "Operator console for a self-hosted @ggui-ai/mcp-server instance — a single-origin admin and devtools surface served by the server itself.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ggui",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"react": "^19.0.0",
|
|
29
29
|
"react-dom": "^19.0.0",
|
|
30
|
-
"@ggui-ai/design": "0.5.0-rc.
|
|
31
|
-
"@ggui-ai/project-config": "0.5.0-rc.
|
|
32
|
-
"@ggui-ai/react": "0.5.0-rc.
|
|
30
|
+
"@ggui-ai/design": "0.5.0-rc.2",
|
|
31
|
+
"@ggui-ai/project-config": "0.5.0-rc.2",
|
|
32
|
+
"@ggui-ai/react": "0.5.0-rc.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@testing-library/react": "^16.0.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "^5.0.0",
|
|
43
43
|
"vite": "^6.4.2",
|
|
44
44
|
"vitest": "^3.2.6",
|
|
45
|
-
"@ggui-ai/protocol": "0.5.0-rc.
|
|
45
|
+
"@ggui-ai/protocol": "0.5.0-rc.2"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|