@jxsuite/compiler 11.1.0 → 11.1.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.
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ ${r}"""${n}`;return NS(o,e)?o:null}function lu(e,t,n){if(!TS(e))throw new qt(`${
50
50
  `))t.push(...Tn(`.${n}`,r,s,i));else e.push(`${a}=${l}`)}function LS(e,t){return["$head {",...e.flatMap((n,r)=>Bt(n)&&!Xa(n)&&_(n.tagName)&&!n.$ref?um(n,t,`/$head/${r}`):Tn("-",n,t,`/$head/${r}`)),"}"]}function HJ(e){let{document:t,spans:n}=nm(e);return{document:L(t)?t:null,spans:n}}function fm(e,t){let n=WJ(e);return t===void 0?n:iu(t,n,HJ)}function WJ(e){if(!L(e))throw new qt("A document is an object");let t=e,n=["/- kdl-version 2"],r={},s=Object.keys(t).some((i)=>!i.startsWith("$")),o=[];for(let[i,a]of Object.entries(t)){let l=i==="$script"&&s?VJ(a,Wt):null;if(l)o=l;else if(i==="$head"&&Array.isArray(a))n.push(...LS(a,Wt));else if(i==="$head")n.push(`(object)${Tn(i,a,"","/$head").join(`
51
51
  `)}`);else if(i.startsWith("$"))n.push(...Tn(i,a,"",nt("",i)));else r[i]=a}if(Object.keys(r).length>0)n.push("",...um(r,"","",o));return`${n.join(`
52
52
  `)}
53
- `}var Wt=" ",cm=100,CS,RS,OJ,AJ,Bt=(e)=>L(e),Xa=(e)=>Bt(e)&&_(e.$ref)&&Object.keys(e).length===1,nt=(e,t)=>`${e}/${String(t).replaceAll("~","~0").replaceAll("/","~1")}`,NJ;var uu=M(()=>{Qc();ae();wi();Ka();au();CS=/^(?![-+]?\.?\d)(?!(?:true|false|null|inf|-inf|nan)$)[^\s\\/(){};[\]"#=,\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,RS=/[\p{Cc}\p{Zl}\p{Zp}‎‏‪-‮⁦-⁩]/u,OJ=/(?!\n)\p{Cc}|[\p{Zl}\p{Zp}‎‏‪-‮⁦-⁩]/u,AJ=new Set(["-","attributes","script","state","style"]);NJ=new Set(["$export","$src","arguments","timing"])});function zJ(e,t,n){if(vi(e,t)!==null)throw Ae(e,t,`"project" names the file's kind, and takes no annotation`);let r=Hn(e,t);if(r.length>1||Wn(t).length>0||Ht(t).length>0)throw Ae(e,t,`"project" holds one value, the project's name, and nothing else`);if(r[0]!==void 0)je(n,"name",r[0],e,t),Et(e,"/name",t)}function KJ(e,t,n){let r=t.getName(),s=`/${it(r)}`,o=t.getTag()===null,i;if(r==="$head"&&o)i=em(e,t),Et(e,s,t);else if(UJ.has(r)&&o)i=nu(e,t,s);else i=qn(e,t,s);je(n,r,i,e,t)}function GJ(e){if(li(e.text)==="document")throw new qt('A project file declares itself: its first node, after any $ metadata, is project "<name>"');let t=tm(e.text),n={},r=!1;for(let s of t.nodes)if(s.getName()===BJ){if(r)throw Ae(e,s,'"project" is written twice, and a file declares one project');zJ(e,s,n),r=!0}else KJ(e,s,n);return ii(n)}function dm(e,t){try{return GJ({spans:null,text:e})}catch(n){throw t!==void 0&&n instanceof qt?n.inFile(t):n}}var BJ="project",UJ;var pm=M(()=>{ae();Ft();Da();wi();Ka();au();uu();UJ=new Set(["$media","style"])});var os=M(()=>{Da();ru();wi();ES();Ka();au();uu();pm()});function HS(e){if(e===null)throw TypeError("A class descriptor cannot be null");return L(e)?e:{}}class Ya{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,n,r){this.name=e,this.classPath=t,this.classDef=n,this.#t=r;let{format:s}=n;this.extensions=(s?.extensions??[]).map((o)=>o.toLowerCase()),this.mediaType=s?.mediaType??null,this.mediaTypeEssence=J$(this.mediaType),this.documentKinds=s?.documentKinds??[],this.exportTarget=s?.exportTarget===!0,this.remote=s?.remote===!0,this.studio=n.$studio??null,this.project=n.project??null,this.server=n.server??null,this.connector=n.connector??null,this.capabilities=ZJ(n)}implementation(){if(!this.#e){let e=this.classDef.$implementation;if(!e)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#e=this.#t.importModule(this.#t.resolvePath(this.classPath,e))}return this.#e}async implementationExport(){return this.#n(await this.implementation())}#n(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let n=this.capabilities[e];if(!n)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let r=this.#n(await this.implementation()),s=r?.[n.identifier];if(!Ot(s)){let i=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${i}" has no static "${n.identifier}" method`)}return await s.call(r,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class fu{#t;get#e(){return[...this.#t,nM]}constructor(e){this.#t=e;for(let t of e)if(t.extensions.includes(".jxn"))throw Error(`Format "${t.name}" claims ".jxn", which is built in`);for(let t of e){if(t.mediaType===null)continue;let n=N$(t.mediaType);if(n!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${n}`)}for(let t of VS){let n=new Map;for(let r of e){if(!r.capabilities[t])continue;for(let s of r.extensions){let o=n.get(s);if(o)throw Error(`Format conflict: "${o.name}" and "${r.name}" both claim "${s}" with the "${t}" capability`);n.set(s,r)}}}}get entries(){return this.#t}byExtension(e,t){let n=FS(e);return this.#e.find((r)=>r.extensions.includes(n)&&(!t||r.capabilities[t]))}byName(e){return this.#t.find((t)=>t.name===e)}withCapability(e){return this.#e.filter((t)=>t.capabilities[e])}documentExtensions(e){let t=new Set;for(let n of this.#e){if(e&&!n.documentKinds.includes(e))continue;for(let r of n.extensions)t.add(r)}return t.delete(".json"),[...t]}has(e){let t=FS(e);return this.#e.some((n)=>n.extensions.includes(t))}}function ZJ(e){let t={},n=e.$defs?.methods??{};for(let[r,s]of Object.entries(n)){let{role:o}=s;if(!eM(o))continue;let i={identifier:s.identifier??r,timing:s.timing??YJ};if(_(s.discriminator))i.discriminator=s.discriminator;t[o]=i}return t}function eM(e){return e!==void 0&&QJ.has(e)}function FS(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var VS,qS,YJ,QJ,tM,nM;var mm=M(()=>{ae();Cp();VS=["parse","serialize","rewrite","discover","load"],qS=[...VS,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];YJ=["compiler","server"];QJ=new Set(qS);tM={importModule:async()=>{await Promise.resolve().then(() => os());return{JxNotation:{parse:(n)=>Po(n),serialize:(n)=>fm(n)}}},loadJson:()=>Promise.reject(Error("Jx Notation reads no file of its own")),resolvePath:(e,t)=>t},nM=new Ya("jxn","",{$defs:{methods:{parse:{role:"parse"},serialize:{role:"serialize"}}},$implementation:"jxn",format:{documentKinds:["page","component"],extensions:[".jxn"]},title:"JxNotation"},tM)});class WS{#t;#e;#n;constructor(e){this.#t=e,this.#e=e.flatMap((s)=>s.classes);let t=new Map;for(let s of e)for(let o of s.classes){let i=t.get(o.name);if(i&&i!==s.specifier)throw Error(`Extension conflict: "${i}" and "${s.specifier}" both provide a class named "${o.name}"`);t.set(o.name,s.specifier)}let n=new Map;for(let s of this.#e){if(!s.project)continue;let o=n.get(s.project.key);if(o)throw Error(`Extension conflict: "${o.name}" and "${s.name}" both claim the project section "${s.project.key}"`);n.set(s.project.key,s)}let r=new Map;for(let s of this.#e){if(!s.server)continue;let{basePath:o}=s.server;if(!o.startsWith("/_jx/"))throw Error(`Extension "${s.name}": server basePath "${o}" must be under /_jx/`);let i=r.get(o);if(i)throw Error(`Extension conflict: "${i.name}" and "${s.name}" both mount "${o}"`);r.set(o,s)}this.#n=new fu(this.#e.filter((s)=>s.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#n}byName(e){return this.#e.find((t)=>t.name===e)}projectContributions(){return this.#e.filter((e)=>e.project!==null)}byProjectKey(e){return this.#e.find((t)=>t.project?.key===e)}byPathsDiscriminator(e){return this.#e.find((t)=>t.capabilities.resolvePaths?.discriminator===e)}emitters(){return this.#e.filter((e)=>e.capabilities.emit!==void 0)}headProviders(){return this.#e.filter((e)=>e.capabilities.head!==void 0)}assetProviders(){return this.#e.filter((e)=>e.capabilities.assets!==void 0)}serverMounts(){return this.#e.filter((e)=>e.server!==null).toSorted((e,t)=>(e.server?.order??100)-(t.server?.order??100)||e.name.localeCompare(t.name))}connectors(){return this.#e.filter((e)=>e.connector!==null)}schemaFragments(e){return this.#t.map((t)=>t.schemas[e]).filter((t)=>typeof t==="string")}}async function BS(e,t,n){let r=[];for(let s of e??[])r.push(await rM(s,t,n));return new WS(r)}async function rM(e,t,n){let r;if(e.startsWith("./")||e.startsWith("../")){let l=t.resolvePath(n,e);r=t.resolvePath(`${l}/package.json`,`./${Za}`)}else try{r=t.resolvePath(n,`${e}/${Za}`)}catch(l){throw Error(`Extension "${e}" is not resolvable: it must export ${Za} (is the package installed, and does its exports map include it?): ${hm(l)}`,{cause:l})}let s;try{s=await t.loadJson(r)}catch(l){throw Error(`Extension "${e}": cannot read manifest ${r}: ${hm(l)}`,{cause:l})}if(!L(s)||!_(s.name))throw Error(`Extension "${e}": ${Za} must declare a "name"`);let o=s;if(!e.startsWith(".")&&o.name!==e)throw Error(`Extension "${e}": manifest name "${o.name}" does not match the specifier`);let i=[];for(let[l,c]of Object.entries(o.classes??{})){let u=t.resolvePath(r,c),d;try{d=await t.loadJson(u)}catch(p){throw Error(`Extension "${e}": cannot read class "${l}" at ${u}: ${hm(p)}`,{cause:p})}i.push(new Ya(l,u,HS(d),t))}let a={};if(o.schemas?.project)a.project=t.resolvePath(r,o.schemas.project);if(o.schemas?.document)a.document=t.resolvePath(r,o.schemas.document);if(o.schemas?.fields)a.fields=t.resolvePath(r,o.schemas.fields);return{specifier:e,manifestPath:r,manifest:o,classes:i,schemas:a}}function hm(e){return e instanceof Error?e.message:String(e)}var Za="jx-extension.json";var US=M(()=>{mm();ae();mm()});var zS=M(()=>{ae()});function oM(e){return`${e} holds both project.jxn and project.json, and a project has one. Keep the one you edit and delete the other`}function GS(e){let t=sM.filter((n)=>e(n));if(t.length>1)return"conflict";return t[0]??null}function du(e,t){return rs(t)?dm(e,t):$$(e,t)}var sM,KS="project.jxn",gm;var pu=M(()=>{ae();zS();Da();ru();pm();Ft();sM=["project.jxn","project.json"];gm=class gm extends Error{constructor(e){super(oM(e));this.name="ProjectFileConflictError"}}});import{accessSync as uX,closeSync as fX,constants as dX,existsSync as iM,fstatSync as pX,lstatSync as mX,openSync as hX,readFileSync as gX,statSync as yX}from"node:fs";import{dirname as bX,join as XS}from"node:path";function aM(e){return GS((t)=>iM(XS(e,t)))}function Un(e){let t=aM(e);if(t==="conflict")throw new gm(e);return XS(e,t??KS)}var ko=M(()=>{pu()});import{existsSync as lM,readFileSync as cM}from"node:fs";import{dirname as hu,isAbsolute as uM,resolve as YS,sep as mu}from"node:path";import{pathToFileURL as fM}from"node:url";import{createRequire as dM}from"node:module";function ZS(e){let t=[e],n=`${mu}src${mu}`,r=`${mu}dist${mu}`;if(e.includes(n)){let s=e.replace(n,r);if(t.push(s),s.endsWith(".ts"))t.push(`${s.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);return t}function QS(e){let t=ZS(e),n=hu(e),r=[...t.filter((o)=>hu(o)===n),...t.filter((o)=>hu(o)!==n)],s=r.find((o)=>lM(o));if(s===void 0)throw Error(`no module at ${e} (tried ${r.join(", ")})`);return s}async function ym(e){let t=ZS(e),n;for(let r of t)try{return await import(fM(r).href)}catch(s){n=s}throw n instanceof Error?n:Error(String(n))}function xm(e,t){return dM(YS(e,"package.json")).resolve(t)}function bm(e){return{importModule:(t)=>ym(t),loadJson:async(t)=>JSON.parse(cM(t,"utf8")),resolvePath:(t,n)=>{if(n.startsWith("./")||n.startsWith("../"))return YS(hu(t),n);if(uM(n))return n;return xm(e,n)}}}async function Rs(e,t){return BS(t?.extensions,bm(e),Un(e))}function gu(e,t){return Error(`No format class registered for "${t}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var is=M(()=>{US();ae();ko()});var $m,Sm;var wm=M(()=>{$m={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},Sm={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var vm;var Em=M(()=>{vm={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var jm,Pm,km;var _m=M(()=>{jm={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},Pm={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},km={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var Om;var Am=M(()=>{Om={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var Cm,Rm;var Tm=M(()=>{Cm={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},Rm={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var Qa;var Nm=M(()=>{Qa={description:"Image optimization configuration for the project.",properties:{formats:{description:'Output formats, each one of "avif", "jpeg", "png" or "webp" (default ["avif", "jpeg"]). AVIF and JPEG are lossy; PNG and WebP are written losslessly, so listing WebP produces larger files than either. A source with transparency is written as PNG wherever JPEG is listed.',items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{description:"Lossy quality per format, 1 to 100 (defaults: avif 65, jpeg 80). The build writes png and webp losslessly, so png is never read and webp is read only by the cloudflare service, as the quality of its transform URLs (default 80).",properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" encodes variants at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var Jm;var Mm=M(()=>{Jm={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var Im,Dm,Lm,Fm,Vm,qm,Hm,Wm,Bm;var Um=M(()=>{Im={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},Dm={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},Lm={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Fm={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Vm={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},qm={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done","#/$map/item/text"],pattern:String.raw`^(#/)?\$map/(item|index)(/.*)?$`,type:"string"},Hm={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Wm={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},Bm={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var el;var zm=M(()=>{el={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var Km,Gm;var Xm=M(()=>{Km={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item, in either spelling ($map/item/id or #/$map/item/id). A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^(#/)?\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Gm={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var Ym,Zm,Qm,eh,th,yu;var nh=M(()=>{Ym={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},Zm={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},Qm={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},eh={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},th={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},yu={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var rh;var sh=M(()=>{rh={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var oh;var ih=M(()=>{oh={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive; declaring both is an error. First parameter is always state (the reactive scope).',not:{required:["body","$src"]},properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: a source string in erasable TypeScript, which plain JavaScript already is (spec §23.1; types are erased before it is analysed or run; first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → source string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',"const input = event.target as HTMLInputElement; state.label = input.value",[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var ah,lh;var ch=M(()=>{ah={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},lh={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var uh,fh;var dh=M(()=>{uh=["Function","Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream"],fh={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var ph;var mh=M(()=>{ph={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});function nw(){return`the Intl helpers ${gh.join(", ")}`}var _r="en-US",hh="UTC",ew,gh,tw;var yh=M(()=>{ew=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],gh=ew.map((e)=>e.path),tw=Object.fromEntries(ew.map((e)=>[e.path,e.params.indexOf("locale")]))});var xh,bh,$h,Sh,wh,vh,Eh,jh,Ph,kh,_h,Oh,Ah,Ch,Rh,Th,Nh;var Jh=M(()=>{yh();xh={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},bh={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},$h={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},Sh={enum:["!","-"]},wh={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},vh={const:"?:"},Eh={const:"switch"},jh={const:"call"},Ph={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},kh={enum:["=","+=","-=","*=","/="]},_h={enum:["pop","shift"]},Oh={enum:["push","unshift"]},Ah={const:"splice"},Ch={const:"reduce"},Rh={enum:["map","filter"]},Th={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${nw()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},Nh={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var Mh,Ih,Dh,Lh;var Fh=M(()=>{Mh={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},Ih={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},Dh={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Lh={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var rw,xu,bu,$u,Su,wu,vu,Eu,ju,Pu,Vh;var qh=M(()=>{rw=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],xu={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},bu={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},$u={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},Su={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:rw,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},wu={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},vu={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Eu={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},ju={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},Pu={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},Vh={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});function zn(e){if(!_(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function tl(e){let t=zn(e);if(t===null)return"ltr";let n=new Intl.Locale(t),r=n.script??n.maximize().script;return r!==void 0&&pM.has(r)?"rtl":"ltr"}function sw(e){let t=zn(e);if(t===null)return _(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Hh(e){let t=e.i18n,n=[];if(!F(t))return{errors:n,i18n:null};let r=Array.isArray(t.locales)?t.locales:[],s=[];for(let l of r){let c=zn(l);if(c===null){n.push(`i18n.locales: "${String(l)}" is not a well-formed BCP 47 language tag.`);continue}if(!s.includes(c))s.push(c)}let o=zn(t.defaultLocale)??s[0]??null;if(t.defaultLocale!==void 0&&zn(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(o===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};let i=[o,...s.filter((l)=>l!==o)],a=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:mM;return{errors:n,i18n:{defaultLocale:o,locales:i,routing:a}}}function fr(e,t){if(t===null)return null;let n=e.split("/").find(Boolean);if(n===void 0)return t.defaultLocale;let r=zn(n);return r!==null&&t.locales.includes(r)?r:t.defaultLocale}var pM,ku="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",mM="prefix-except-default";var _o=M(()=>{ae();pM=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});var ow,Ts="utf-8",_u;var Wh=M(()=>{_o();ow=[301,302,303,307,308],_u={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"JSON Schema type definitions, tooling only. A document's #/$defs/Name reference resolves here when the document does not define Name itself.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"},sources:{additionalProperties:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:"Add sources to a computed directive without restating it. Each entry is appended after the derived sources (the script hashes and collected origins stay), skipped if already present. A directive the policy does not carry is created from the one a browser falls back to, `default-src` for the fetch directives. For origins that arrive only at runtime. A directive named here and in `directives` is a build error.",propertyNames:{pattern:"^[A-Za-z][A-Za-z0-9-]*$"},type:"object"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:Ts,description:"The <meta charset> every page declares. The HTML Standard allows only utf-8, which is the default.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:ku,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:ku,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:ku,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...ow],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});var Bh;var Uh=M(()=>{Bh={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var nl="https://jxsuite.com/schema/project/fields/v2",Oo="https://jxsuite.com/schema/document/paths/v2",zh,Kh,rl,Gh;var sl=M(()=>{zh={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},Kh={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},rl=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{additionalProperties:!1,description:"Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",properties:{each:{description:"Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",type:["object","array"]},pageSize:{description:"Items on each page.",minimum:1,type:"integer"},paginate:{additionalProperties:!1,description:"The state entry to page.",properties:{$ref:{description:"A pointer to an entry of this page's state: `#/state/<key>`.",pattern:"^#/state/[^/]+$",type:"string"}},required:["$ref"],type:"object"}},required:["paginate","pageSize"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],Gh={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});var ol=M(()=>{wm();Em();_m();Am();Tm();Nm();Mm();Um();zm();Xm();nh();sh();ih();ch();dh();mh();Jh();Fh();qh();Wh();Uh();sl()});import{existsSync as hM,readFileSync as gM}from"node:fs";import{basename as yM,resolve as xM}from"node:path";function as(e){let t=Un(e);if(!hM(t))throw Error(`No project.jxn or project.json in ${e}`);let n;try{n=du(gM(t,"utf8"),t)}catch(i){throw Error(`Invalid ${yM(t)}: ${ye(i)}`,{cause:i})}let r={...il,...n,build:{...il.build,...n.build},defaults:{...il.defaults,...n.defaults},images:{...il.images,...n.images},url:n.url??il.url};if(n.$head)r.$head=n.$head;if(n.$media)r.$media=n.$media;if(n.style)r.style=n.style;if(n.state)r.state=n.state;if(n.redirects)r.redirects=n.redirects;if(n.imports)r.imports=n.imports;let s=["cloudflare-workers","cloudflare-pages","node","bun"];if(r.build.adapter==="static")delete r.build.adapter;if(r.build.adapter&&!s.includes(r.build.adapter))throw Error(`Unknown build adapter "${r.build.adapter}" in project.json. Valid adapters: ${s.join(", ")}`);let o=["build","cloudflare"];if(!o.includes(r.images.service))throw Error(`Unknown images.service "${r.images.service}" in project.json. Valid services: ${o.join(", ")}`);return{config:r,configPath:t,projectRoot:xM(e)}}function iw(e){return["0","false","no","off"].includes((e??"").trim().toLowerCase())}var il;var ji=M(()=>{ol();Ft();pu();ko();il={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:Ts,lang:"en",layout:null},images:{formats:["avif","jpeg"],lazyLoad:!0,optimize:!0,picture:!0,quality:{avif:65,jpeg:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{existsSync as Xh,readFileSync as aw,writeFileSync as bM}from"node:fs";import{resolve as lw}from"node:path";async function cw(e,t={}){let{dryRun:n=!1,connection:r}=t,{config:s}=as(e),o=await Rs(e,s),i=L(s.connections)?s.connections:{},a=L(s.data)?s.data:{},l=Object.keys(i).filter((g)=>!r||g===r);if(r&&l.length===0)throw Error(`Unknown connection "${r}" (no such connections entry in project.json)`);if(l.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let c={...process.env,...SM(e),JX_PROJECT_ROOT:e},u=[],d=[];for(let g of l){let b=i[g],h=L(b)?{...b,$name:g}:{$name:g},x=String(h.provider??""),k=$M(o.connectors(),x);if(!k)throw Error(`Connection "${g}" names provider "${x}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let w={};for(let[E,O]of Object.entries(a))if(L(O)&&O.connection===g)w[E]=O;let v=await k.call("deploySchema",w,h,{dryRun:n,env:c});if(u.push({applied:v.applied??!n,connection:g,provider:x,statements:v.statements??[],tables:Object.keys(w),warnings:v.warnings??[]}),k.capabilities.bindings){let E=await k.call("bindings",h);if(L(E)&&Object.keys(E).length>0)d.push(E)}}let p=lw(e,"wrangler.jsonc"),m=!1;if(!n&&d.length>0&&Xh(p)){let g=aw(p,"utf8"),{content:b,patched:h}=k$(g,d);if(h&&b!==g)bM(p,b,"utf8"),m=!0}return{bindingsPatched:m,results:u,wranglerPath:Xh(p)?p:null}}function $M(e,t){return e.find((n)=>n.connector?.provider===t)}function SM(e){let t=lw(e,".dev.vars");if(!Xh(t))return{};let n=new Map;for(let r of aw(t,"utf8").split(`
53
+ `}var Wt=" ",cm=100,CS,RS,OJ,AJ,Bt=(e)=>L(e),Xa=(e)=>Bt(e)&&_(e.$ref)&&Object.keys(e).length===1,nt=(e,t)=>`${e}/${String(t).replaceAll("~","~0").replaceAll("/","~1")}`,NJ;var uu=M(()=>{Qc();ae();wi();Ka();au();CS=/^(?![-+]?\.?\d)(?!(?:true|false|null|inf|-inf|nan)$)[^\s\\/(){};[\]"#=,\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,RS=/[\p{Cc}\p{Zl}\p{Zp}‎‏‪-‮⁦-⁩]/u,OJ=/(?!\n)\p{Cc}|[\p{Zl}\p{Zp}‎‏‪-‮⁦-⁩]/u,AJ=new Set(["-","attributes","script","state","style"]);NJ=new Set(["$export","$src","arguments","timing"])});function zJ(e,t,n){if(vi(e,t)!==null)throw Ae(e,t,`"project" names the file's kind, and takes no annotation`);let r=Hn(e,t);if(r.length>1||Wn(t).length>0||Ht(t).length>0)throw Ae(e,t,`"project" holds one value, the project's name, and nothing else`);if(r[0]!==void 0)je(n,"name",r[0],e,t),Et(e,"/name",t)}function KJ(e,t,n){let r=t.getName(),s=`/${it(r)}`,o=t.getTag()===null,i;if(r==="$head"&&o)i=em(e,t),Et(e,s,t);else if(UJ.has(r)&&o)i=nu(e,t,s);else i=qn(e,t,s);je(n,r,i,e,t)}function GJ(e){if(li(e.text)==="document")throw new qt('A project file declares itself: its first node, after any $ metadata, is project "<name>"');let t=tm(e.text),n={},r=!1;for(let s of t.nodes)if(s.getName()===BJ){if(r)throw Ae(e,s,'"project" is written twice, and a file declares one project');zJ(e,s,n),r=!0}else KJ(e,s,n);return ii(n)}function dm(e,t){try{return GJ({spans:null,text:e})}catch(n){throw t!==void 0&&n instanceof qt?n.inFile(t):n}}var BJ="project",UJ;var pm=M(()=>{ae();Ft();Da();wi();Ka();au();uu();UJ=new Set(["$media","style"])});var os=M(()=>{Da();ru();wi();ES();Ka();au();uu();pm()});function HS(e){if(e===null)throw TypeError("A class descriptor cannot be null");return L(e)?e:{}}class Ya{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,n,r){this.name=e,this.classPath=t,this.classDef=n,this.#t=r;let{format:s}=n;this.extensions=(s?.extensions??[]).map((o)=>o.toLowerCase()),this.mediaType=s?.mediaType??null,this.mediaTypeEssence=J$(this.mediaType),this.documentKinds=s?.documentKinds??[],this.exportTarget=s?.exportTarget===!0,this.remote=s?.remote===!0,this.studio=n.$studio??null,this.project=n.project??null,this.server=n.server??null,this.connector=n.connector??null,this.capabilities=ZJ(n)}implementation(){if(!this.#e){let e=this.classDef.$implementation;if(!e)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#e=this.#t.importModule(this.#t.resolvePath(this.classPath,e))}return this.#e}async implementationExport(){return this.#n(await this.implementation())}#n(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let n=this.capabilities[e];if(!n)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let r=this.#n(await this.implementation()),s=r?.[n.identifier];if(!Ot(s)){let i=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${i}" has no static "${n.identifier}" method`)}return await s.call(r,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class fu{#t;get#e(){return[...this.#t,nM]}constructor(e){this.#t=e;for(let t of e)if(t.extensions.includes(".jxn"))throw Error(`Format "${t.name}" claims ".jxn", which is built in`);for(let t of e){if(t.mediaType===null)continue;let n=N$(t.mediaType);if(n!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${n}`)}for(let t of VS){let n=new Map;for(let r of e){if(!r.capabilities[t])continue;for(let s of r.extensions){let o=n.get(s);if(o)throw Error(`Format conflict: "${o.name}" and "${r.name}" both claim "${s}" with the "${t}" capability`);n.set(s,r)}}}}get entries(){return this.#t}byExtension(e,t){let n=FS(e);return this.#e.find((r)=>r.extensions.includes(n)&&(!t||r.capabilities[t]))}byName(e){return this.#t.find((t)=>t.name===e)}withCapability(e){return this.#e.filter((t)=>t.capabilities[e])}documentExtensions(e){let t=new Set;for(let n of this.#e){if(e&&!n.documentKinds.includes(e))continue;for(let r of n.extensions)t.add(r)}return t.delete(".json"),[...t]}has(e){let t=FS(e);return this.#e.some((n)=>n.extensions.includes(t))}}function ZJ(e){let t={},n=e.$defs?.methods??{};for(let[r,s]of Object.entries(n)){let{role:o}=s;if(!eM(o))continue;let i={identifier:s.identifier??r,timing:s.timing??YJ};if(_(s.discriminator))i.discriminator=s.discriminator;t[o]=i}return t}function eM(e){return e!==void 0&&QJ.has(e)}function FS(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var VS,qS,YJ,QJ,tM,nM;var mm=M(()=>{ae();Cp();VS=["parse","serialize","rewrite","discover","load"],qS=[...VS,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];YJ=["compiler","server"];QJ=new Set(qS);tM={importModule:async()=>{await Promise.resolve().then(() => os());return{JxNotation:{parse:(n)=>Po(n),serialize:(n)=>fm(n)}}},loadJson:()=>Promise.reject(Error("Jx Notation reads no file of its own")),resolvePath:(e,t)=>t},nM=new Ya("jxn","",{$defs:{methods:{parse:{role:"parse"},serialize:{role:"serialize"}}},$implementation:"jxn",format:{documentKinds:["page","component"],extensions:[".jxn"]},title:"JxNotation"},tM)});class WS{#t;#e;#n;constructor(e){this.#t=e,this.#e=e.flatMap((s)=>s.classes);let t=new Map;for(let s of e)for(let o of s.classes){let i=t.get(o.name);if(i&&i!==s.specifier)throw Error(`Extension conflict: "${i}" and "${s.specifier}" both provide a class named "${o.name}"`);t.set(o.name,s.specifier)}let n=new Map;for(let s of this.#e){if(!s.project)continue;let o=n.get(s.project.key);if(o)throw Error(`Extension conflict: "${o.name}" and "${s.name}" both claim the project section "${s.project.key}"`);n.set(s.project.key,s)}let r=new Map;for(let s of this.#e){if(!s.server)continue;let{basePath:o}=s.server;if(!o.startsWith("/_jx/"))throw Error(`Extension "${s.name}": server basePath "${o}" must be under /_jx/`);let i=r.get(o);if(i)throw Error(`Extension conflict: "${i.name}" and "${s.name}" both mount "${o}"`);r.set(o,s)}this.#n=new fu(this.#e.filter((s)=>s.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#n}byName(e){return this.#e.find((t)=>t.name===e)}projectContributions(){return this.#e.filter((e)=>e.project!==null)}byProjectKey(e){return this.#e.find((t)=>t.project?.key===e)}byPathsDiscriminator(e){return this.#e.find((t)=>t.capabilities.resolvePaths?.discriminator===e)}emitters(){return this.#e.filter((e)=>e.capabilities.emit!==void 0)}headProviders(){return this.#e.filter((e)=>e.capabilities.head!==void 0)}assetProviders(){return this.#e.filter((e)=>e.capabilities.assets!==void 0)}serverMounts(){return this.#e.filter((e)=>e.server!==null).toSorted((e,t)=>(e.server?.order??100)-(t.server?.order??100)||e.name.localeCompare(t.name))}connectors(){return this.#e.filter((e)=>e.connector!==null)}schemaFragments(e){return this.#t.map((t)=>t.schemas[e]).filter((t)=>typeof t==="string")}}async function BS(e,t,n){let r=[];for(let s of e??[])r.push(await rM(s,t,n));return new WS(r)}async function rM(e,t,n){let r;if(e.startsWith("./")||e.startsWith("../")){let l=t.resolvePath(n,e);r=t.resolvePath(`${l}/package.json`,`./${Za}`)}else try{r=t.resolvePath(n,`${e}/${Za}`)}catch(l){throw Error(`Extension "${e}" is not resolvable: it must export ${Za} (is the package installed, and does its exports map include it?): ${hm(l)}`,{cause:l})}let s;try{s=await t.loadJson(r)}catch(l){throw Error(`Extension "${e}": cannot read manifest ${r}: ${hm(l)}`,{cause:l})}if(!L(s)||!_(s.name))throw Error(`Extension "${e}": ${Za} must declare a "name"`);let o=s;if(!e.startsWith(".")&&o.name!==e)throw Error(`Extension "${e}": manifest name "${o.name}" does not match the specifier`);let i=[];for(let[l,c]of Object.entries(o.classes??{})){let u=t.resolvePath(r,c),d;try{d=await t.loadJson(u)}catch(p){throw Error(`Extension "${e}": cannot read class "${l}" at ${u}: ${hm(p)}`,{cause:p})}i.push(new Ya(l,u,HS(d),t))}let a={};if(o.schemas?.project)a.project=t.resolvePath(r,o.schemas.project);if(o.schemas?.document)a.document=t.resolvePath(r,o.schemas.document);if(o.schemas?.fields)a.fields=t.resolvePath(r,o.schemas.fields);return{specifier:e,manifestPath:r,manifest:o,classes:i,schemas:a}}function hm(e){return e instanceof Error?e.message:String(e)}var Za="jx-extension.json";var US=M(()=>{mm();ae();mm()});var zS=M(()=>{ae()});function oM(e){return`${e} holds both project.jxn and project.json, and a project has one. Keep the one you edit and delete the other`}function GS(e){let t=sM.filter((n)=>e(n));if(t.length>1)return"conflict";return t[0]??null}function du(e,t){return rs(t)?dm(e,t):$$(e,t)}var sM,KS="project.jxn",gm;var pu=M(()=>{ae();zS();Da();ru();pm();Ft();sM=["project.jxn","project.json"];gm=class gm extends Error{constructor(e){super(oM(e));this.name="ProjectFileConflictError"}}});import{accessSync as uX,closeSync as fX,constants as dX,existsSync as iM,fstatSync as pX,lstatSync as mX,openSync as hX,readFileSync as gX,statSync as yX}from"node:fs";import{dirname as bX,join as XS}from"node:path";function aM(e){return GS((t)=>iM(XS(e,t)))}function Un(e){let t=aM(e);if(t==="conflict")throw new gm(e);return XS(e,t??KS)}var ko=M(()=>{pu()});import{existsSync as lM,readFileSync as cM}from"node:fs";import{dirname as hu,isAbsolute as uM,resolve as YS,sep as mu}from"node:path";import{pathToFileURL as fM}from"node:url";import{createRequire as dM}from"node:module";function ZS(e){let t=[e],n=`${mu}src${mu}`,r=`${mu}dist${mu}`;if(e.includes(n)){let s=e.replace(n,r);if(t.push(s),s.endsWith(".ts"))t.push(`${s.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);return t}function QS(e){let t=ZS(e),n=hu(e),r=[...t.filter((o)=>hu(o)===n),...t.filter((o)=>hu(o)!==n)],s=r.find((o)=>lM(o));if(s===void 0)throw Error(`no module at ${e} (tried ${r.join(", ")})`);return s}async function ym(e){let t=ZS(e),n;for(let r of t)try{return await import(fM(r).href)}catch(s){n=s}throw n instanceof Error?n:Error(String(n))}function xm(e,t){return dM(YS(e,"package.json")).resolve(t)}function bm(e){return{importModule:(t)=>ym(t),loadJson:async(t)=>JSON.parse(cM(t,"utf8")),resolvePath:(t,n)=>{if(n.startsWith("./")||n.startsWith("../"))return YS(hu(t),n);if(uM(n))return n;return xm(e,n)}}}async function Rs(e,t){return BS(t?.extensions,bm(e),Un(e))}function gu(e,t){return Error(`No format class registered for "${t}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var is=M(()=>{US();ae();ko()});var $m,Sm;var wm=M(()=>{$m={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},Sm={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var vm;var Em=M(()=>{vm={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var jm,Pm,km;var _m=M(()=>{jm={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},Pm={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},km={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var Om;var Am=M(()=>{Om={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var Cm,Rm;var Tm=M(()=>{Cm={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},Rm={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var Qa;var Nm=M(()=>{Qa={description:"Image optimization configuration for the project.",properties:{formats:{description:'Output formats, each one of "avif", "jpeg", "png" or "webp" (default ["avif", "jpeg"]). AVIF and JPEG are lossy; PNG and WebP are written losslessly, so listing WebP produces larger files than either. A source with transparency is written as PNG wherever JPEG is listed.',items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{description:"Lossy quality per format, 1 to 100 (defaults: avif 65, jpeg 80). The build writes png and webp losslessly, so png is never read and webp is read only by the cloudflare service, as the quality of its transform URLs (default 80).",properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" encodes variants at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var Jm;var Mm=M(()=>{Jm={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var Im,Dm,Lm,Fm,Vm,qm,Hm,Wm,Bm;var Um=M(()=>{Im={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},Dm={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},Lm={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Fm={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Vm={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},qm={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done","#/$map/item/text"],pattern:String.raw`^(#/)?\$map/(item|index)(/.*)?$`,type:"string"},Hm={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Wm={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},Bm={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var el;var zm=M(()=>{el={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var Km,Gm;var Xm=M(()=>{Km={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item, in either spelling ($map/item/id or #/$map/item/id). A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^(#/)?\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Gm={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var Ym,Zm,Qm,eh,th,yu;var nh=M(()=>{Ym={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},Zm={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},Qm={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},eh={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},th={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},yu={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var rh;var sh=M(()=>{rh={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var oh;var ih=M(()=>{oh={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive; declaring both is an error. First parameter is always state (the reactive scope).',not:{required:["body","$src"]},properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: a source string in erasable TypeScript, which plain JavaScript already is (spec §23.1; types are erased before it is analysed or run; first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → source string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',"const input = event.target as HTMLInputElement; state.label = input.value",[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var ah,lh;var ch=M(()=>{ah={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},lh={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var uh,fh;var dh=M(()=>{uh=["Function","Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream"],fh={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var ph;var mh=M(()=>{ph={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});function nw(){return`the Intl helpers ${gh.join(", ")}`}var _r="en-US",hh="UTC",ew,gh,tw;var yh=M(()=>{ew=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],gh=ew.map((e)=>e.path),tw=Object.fromEntries(ew.map((e)=>[e.path,e.params.indexOf("locale")]))});var xh,bh,$h,Sh,wh,vh,Eh,jh,Ph,kh,_h,Oh,Ah,Ch,Rh,Th,Nh;var Jh=M(()=>{yh();xh={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},bh={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},$h={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},Sh={enum:["!","-"]},wh={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},vh={const:"?:"},Eh={const:"switch"},jh={const:"call"},Ph={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},kh={enum:["=","+=","-=","*=","/="]},_h={enum:["pop","shift"]},Oh={enum:["push","unshift"]},Ah={const:"splice"},Ch={const:"reduce"},Rh={enum:["map","filter"]},Th={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${nw()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},Nh={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var Mh,Ih,Dh,Lh;var Fh=M(()=>{Mh={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},Ih={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},Dh={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Lh={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var rw,xu,bu,$u,Su,wu,vu,Eu,ju,Pu,Vh;var qh=M(()=>{rw=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],xu={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},bu={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},$u={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},Su={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:rw,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},wu={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},vu={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Eu={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},ju={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},Pu={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},Vh={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});function zn(e){if(!_(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function tl(e){let t=zn(e);if(t===null)return"ltr";let n=new Intl.Locale(t),r=n.script??n.maximize().script;return r!==void 0&&pM.has(r)?"rtl":"ltr"}function sw(e){let t=zn(e);if(t===null)return _(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Hh(e){let t=e.i18n,n=[];if(!F(t))return{errors:n,i18n:null};let r=Array.isArray(t.locales)?t.locales:[],s=[];for(let l of r){let c=zn(l);if(c===null){n.push(`i18n.locales: "${String(l)}" is not a well-formed BCP 47 language tag.`);continue}if(!s.includes(c))s.push(c)}let o=zn(t.defaultLocale)??s[0]??null;if(t.defaultLocale!==void 0&&zn(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(o===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};let i=[o,...s.filter((l)=>l!==o)],a=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:mM;return{errors:n,i18n:{defaultLocale:o,locales:i,routing:a}}}function fr(e,t){if(t===null)return null;let n=e.split("/").find(Boolean);if(n===void 0)return t.defaultLocale;let r=zn(n);return r!==null&&t.locales.includes(r)?r:t.defaultLocale}var pM,ku="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",mM="prefix-except-default";var _o=M(()=>{ae();pM=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});var ow,Ts="utf-8",_u;var Wh=M(()=>{_o();ow=[301,302,303,307,308],_u={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"JSON Schema type definitions, tooling only. A document's #/$defs/Name reference resolves here when the document does not define Name itself.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"},sources:{additionalProperties:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:"Add sources to a computed directive without restating it. Each entry is appended after the derived sources (the script hashes and collected origins stay), skipped if already present. A directive the policy does not carry is created from the one a browser falls back to, `default-src` for the fetch directives. For origins that arrive only at runtime. A directive named here and in `directives` is a build error.",propertyNames:{pattern:"^[A-Za-z][A-Za-z0-9-]*$"},type:"object"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:Ts,description:"The <meta charset> every page declares. The HTML Standard allows only utf-8, which is the default.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},format:{default:"jxn",description:"The native notation Studio writes new documents in: `jxn` (Jx Notation) or `json`. Both are read everywhere; this decides only what is created.",enum:["jxn","json"],type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:ku,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:ku,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:ku,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...ow],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});var Bh;var Uh=M(()=>{Bh={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var nl="https://jxsuite.com/schema/project/fields/v2",Oo="https://jxsuite.com/schema/document/paths/v2",zh,Kh,rl,Gh;var sl=M(()=>{zh={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},Kh={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},rl=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{additionalProperties:!1,description:"Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",properties:{each:{description:"Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",type:["object","array"]},pageSize:{description:"Items on each page.",minimum:1,type:"integer"},paginate:{additionalProperties:!1,description:"The state entry to page.",properties:{$ref:{description:"A pointer to an entry of this page's state: `#/state/<key>`.",pattern:"^#/state/[^/]+$",type:"string"}},required:["$ref"],type:"object"}},required:["paginate","pageSize"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],Gh={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});var ol=M(()=>{wm();Em();_m();Am();Tm();Nm();Mm();Um();zm();Xm();nh();sh();ih();ch();dh();mh();Jh();Fh();qh();Wh();Uh();sl()});import{existsSync as hM,readFileSync as gM}from"node:fs";import{basename as yM,resolve as xM}from"node:path";function as(e){let t=Un(e);if(!hM(t))throw Error(`No project.jxn or project.json in ${e}`);let n;try{n=du(gM(t,"utf8"),t)}catch(i){throw Error(`Invalid ${yM(t)}: ${ye(i)}`,{cause:i})}let r={...il,...n,build:{...il.build,...n.build},defaults:{...il.defaults,...n.defaults},images:{...il.images,...n.images},url:n.url??il.url};if(n.$head)r.$head=n.$head;if(n.$media)r.$media=n.$media;if(n.style)r.style=n.style;if(n.state)r.state=n.state;if(n.redirects)r.redirects=n.redirects;if(n.imports)r.imports=n.imports;let s=["cloudflare-workers","cloudflare-pages","node","bun"];if(r.build.adapter==="static")delete r.build.adapter;if(r.build.adapter&&!s.includes(r.build.adapter))throw Error(`Unknown build adapter "${r.build.adapter}" in project.json. Valid adapters: ${s.join(", ")}`);let o=["build","cloudflare"];if(!o.includes(r.images.service))throw Error(`Unknown images.service "${r.images.service}" in project.json. Valid services: ${o.join(", ")}`);return{config:r,configPath:t,projectRoot:xM(e)}}function iw(e){return["0","false","no","off"].includes((e??"").trim().toLowerCase())}var il;var ji=M(()=>{ol();Ft();pu();ko();il={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:Ts,lang:"en",layout:null},images:{formats:["avif","jpeg"],lazyLoad:!0,optimize:!0,picture:!0,quality:{avif:65,jpeg:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{existsSync as Xh,readFileSync as aw,writeFileSync as bM}from"node:fs";import{resolve as lw}from"node:path";async function cw(e,t={}){let{dryRun:n=!1,connection:r}=t,{config:s}=as(e),o=await Rs(e,s),i=L(s.connections)?s.connections:{},a=L(s.data)?s.data:{},l=Object.keys(i).filter((g)=>!r||g===r);if(r&&l.length===0)throw Error(`Unknown connection "${r}" (no such connections entry in project.json)`);if(l.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let c={...process.env,...SM(e),JX_PROJECT_ROOT:e},u=[],d=[];for(let g of l){let b=i[g],h=L(b)?{...b,$name:g}:{$name:g},x=String(h.provider??""),k=$M(o.connectors(),x);if(!k)throw Error(`Connection "${g}" names provider "${x}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let w={};for(let[E,O]of Object.entries(a))if(L(O)&&O.connection===g)w[E]=O;let v=await k.call("deploySchema",w,h,{dryRun:n,env:c});if(u.push({applied:v.applied??!n,connection:g,provider:x,statements:v.statements??[],tables:Object.keys(w),warnings:v.warnings??[]}),k.capabilities.bindings){let E=await k.call("bindings",h);if(L(E)&&Object.keys(E).length>0)d.push(E)}}let p=lw(e,"wrangler.jsonc"),m=!1;if(!n&&d.length>0&&Xh(p)){let g=aw(p,"utf8"),{content:b,patched:h}=k$(g,d);if(h&&b!==g)bM(p,b,"utf8"),m=!0}return{bindingsPatched:m,results:u,wranglerPath:Xh(p)?p:null}}function $M(e,t){return e.find((n)=>n.connector?.provider===t)}function SM(e){let t=lw(e,".dev.vars");if(!Xh(t))return{};let n=new Map;for(let r of aw(t,"utf8").split(`
54
54
  `)){let s=r.trim();if(s===""||s.startsWith("#"))continue;let o=s.indexOf("=");if(o===-1)continue;let i=s.slice(0,o).trim(),a=s.slice(o+1).trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))a=a.slice(1,-1);if(i!=="")n.set(i,a)}return Object.fromEntries(n)}var uw=M(()=>{O$();is();ji();ae()});function Yh(e,t=[]){if(!L(e))return t;let{children:n}=e;if(e.tagName==="slot"){let r=e.attributes,s=L(r)?r.name:void 0,o={name:_(s)?s.trim():""};if(Array.isArray(n)&&n.length>0)o.fallback=n;t.push(o)}if(Array.isArray(n))for(let r of n)Yh(r,t);return t}var fw=M(()=>{ae()});function wM(e){let t=new Set,n=new Set,r=(o)=>{if(o.startsWith("#/state/"))t.add(o.slice(8).split("/")[0])},s=(o)=>{if(_(o)){for(let i of o.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/gu))t.add(i[1]);return}if(Array.isArray(o)){if(!n.has(o)){n.add(o);for(let i of o)s(i)}return}if(!L(o)||n.has(o))return;if(n.add(o),o.operator==="call"&&pe(o.target))r(o.target.$ref);if(o.$prototype==="Array"){for(let i of[o.filter,o.sort])if(pe(i))r(i.$ref)}for(let[i,a]of Object.entries(o)){if(i==="$defs")continue;if(i.startsWith("on")&&pe(a))r(a.$ref);s(a)}};s(e);for(let o of Zh)if(L(e.state)&&o in e.state)t.add(o);return t}function Qh(e){return"body"in e&&"$src"in e}function al(e){return Ac(e.parameters??e.arguments).length>0}function Or(e){let t=["state"];for(let n of Ac(e.parameters??e.arguments))if(n!=="state")t.push(n);return t}function vM(e,t,n){if(vr(t))return"callable";if(Ac(t.parameters??t.arguments).length>0)return"callable";if(_(t.body))return c$(t.body)?"computed":"callable";if(t.$src)return n().has(e)?"callable":"computed";return"callable"}function Ar(e){let t=new Map,n=null,r=()=>n??=wM(e);for(let[s,o]of Object.entries(e.state??{}))if(At(o))t.set(s,vM(s,o,r));return t}var Zh;var Pi=M(()=>{ae();Zh=new Set(["onMount","onUnmount","onAdopted"])});function dw(e){if(e===null||e===void 0)return"null";if(Array.isArray(e))return"array";if(_(e))return"string";if(De(e))return"number";return Xe(e)?"boolean":"object"}function EM(e){if(_(e))return e;if(!L(e))return;if(_(e.text))return e.text;if(_(e.type))return e.type;if(Array.isArray(e.type))return e.type.filter((t)=>_(t)).join(" | ");return _(e.$ref)?e.$ref.slice(e.$ref.lastIndexOf("/")+1):void 0}function ll(e){let t=EM(e);return t===void 0||t===""?void 0:{text:t}}function mw(e){if(_(e)&&e!=="")return e;return e===!0?!0:void 0}function jM(e,t){let n={kind:"field",name:e};if(Oc(t)){let r=ll(t.type)??ll(_(t.$ref)?{$ref:t.$ref}:void 0);if(n.type=r??{text:dw(t.default)},n.default=JSON.stringify(t.default),_(t.description))n.description=t.description;let s=mw(t.deprecated);if(s!==void 0)n.deprecated=s;return n}if(L(t)){if(Object.keys(t).some((s)=>s.startsWith("$"))||i$(t))return null}else if(ce(t))return null;return n.type={text:dw(t)},n.default=JSON.stringify(t),n}function PM(e){if(_(e))return{name:e};if(!L(e)||!_(e.name))return null;let t={name:e.name},n=ll(e.type);if(n)t.type=n;if(_(e.description))t.description=e.description;if(Xe(e.optional))t.optional=e.optional;if(e.default!==void 0)t.default=JSON.stringify(e.default);return t}function kM(e,t){let n={kind:"method",name:e};if(_(t.description))n.description=t.description;let s=(t.parameters??t.arguments??[]).map((i)=>PM(i)).filter((i)=>i!==null&&i.name!=="state");if(s.length>0)n.parameters=s;let o=ll(t.type);if(o)n.return={type:o};return n}function pw(e,t){if(!Array.isArray(e))return;for(let n of e){if(!L(n)||!_(n.name)||t.has(n.name))continue;let r={name:n.name,type:ll(n.type)??{text:"Event"}};if(_(n.description))r.description=n.description;let s=mw(n.deprecated);if(s!==void 0)r.deprecated=s;t.set(n.name,r)}}function _M(e){let t=new Set,n=(s)=>{if(!L(s))return;let o=L(s.attributes)?s.attributes.part:void 0;if(_(o)){for(let i of o.split(/\s+/u))if(i!=="")t.add(i)}r(s)},r=(s)=>{if(Array.isArray(s.children))for(let o of s.children)n(o)};return r(e),[...t]}function OM(e){let t=e.doc,n=L(t.state)?t.state:{},r=Ar(e.doc),s=[],o=[],i=new Map,a=new Map;pw(t.emits,a);for(let[x,k]of Object.entries(n)){if(si(x))continue;if(At(k)){if(pw(k.emits,a),!Zh.has(x)&&r.get(x)!=="computed")o.push(kM(x,k));continue}let w=jM(x,k);if(w)o.push(w),i.set(x,w)}let l=[],c=new Set,u=Array.isArray(t.observedAttributes)?t.observedAttributes:[];for(let x of new Set(u.filter((k)=>_(k)))){let k={name:x},w=oi(x),v=i.get(w);if(v){k.fieldName=w;for(let E of["type","default","description","deprecated"])if(v[E]!==void 0)Object.assign(k,{[E]:v[E]});if(!c.has(w)){c.add(w),v.attribute=x;let E=n[w];if(L(E)&&E.reflects===!0)v.reflects=!0}}l.push(k)}for(let[x,k]of Object.entries(n)){if(si(x)||!L(k)||!_(k.attribute))continue;if(i.get(x)?.attribute!==k.attribute)s.push(`${e.tagName}: state entry "${x}" declares attribute "${k.attribute}", but the `+"element does not observe it into that entry (spec.md §16.5); add it to "+"observedAttributes or remove it")}let d={customElement:!0,kind:"class",members:o,name:e.className,tagName:e.tagName},p=_(t.description)?t.description:t.$description;if(_(p))d.description=p;if(l.length>0)d.attributes=l;if(a.size>0)d.events=[...a.values()];let m=Yh(t).map((x)=>({name:x.name}));if(m.length>0)d.slots=m;let g=L(t.style)?t.style:{},b=Object.entries(g).filter(([x])=>x.startsWith("--")).map(([x,k])=>({default:String(k),name:x}));if(b.length>0)d.cssProperties=b;let h=e.shadow?_M(e.doc).map((x)=>({name:x})):[];if(h.length>0)d.cssParts=h;return{module:{declarations:[d],exports:[{declaration:{name:e.className},kind:"custom-element-definition",name:e.tagName}],kind:"javascript-module",path:e.modulePath},warnings:s}}function Ou(e){let n=e.toSorted((r,s)=>r.tagName<s.tagName?-1:1).map((r)=>OM(r));return{manifest:{modules:n.map((r)=>r.module),schemaVersion:"2.1.0"},warnings:n.flatMap((r)=>r.warnings)}}function Au(e){return`${JSON.stringify(e,null,2)}
55
55
  `}var eg=M(()=>{fw();Pi();ae()});function Ao(e){return e.startsWith(Cu)}function Ru(e){let t=e;if(Ao(t))t=t.slice(Cu.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${tg}${t}.js`}function hw(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",n=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${tg}${n}`:`${tg}${n}.${t}`}function gw(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function Tu(e){let t=gw(e);return t.startsWith("/")?t:`/${t}`}function AM(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function Nu(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let s of AM(e,"urlPrefix")){let o=Tu(s.urlPrefix);if(!r.startsWith(`${o}/`))continue;let a=r.slice(o.length+1).split("/");if(a.some((c)=>c===""||c==="."||c===".."))return null;let{filter:l}=s;if(l&&!l(a.join("/")))return null;return`${gw(s.dir)}/${a.join("/")}`}return null}function yw(e,t){let n=new Set;for(let r of t){let s=Tu(r.urlPrefix),o=new RegExp(`${s.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${CM}]+`,"g");for(let i of e.matchAll(o)){let a=i[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))n.add(a)}}return[...n].filter(Boolean)}function ng(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let s=e.slice(r,n);if(s.endsWith(",")){t.push({descriptor:"",url:s.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let o=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(o,n).trim();if(n+=1,s=s.replace(/,+$/,""),s!=="")t.push({descriptor:i,url:s})}return t}function rg(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Co(e){if(!_(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let n=t.replace(/\/+$/,"");if(n===""||n==="/")return"";return n.startsWith("/")?n:`/${n}`}function Te(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function Ns(e,t){let n=new URL(t);if(!n.pathname.endsWith("/"))n.pathname+="/";return new URL(e.replace(/^\/+/,""),n).href}var Cu="npm:",tg="/assets/",CM;var hn=M(()=>{ae();CM=String.raw`"'\s<>()\\`});function xw(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function sg(e,t=()=>new Date){let n=e.SOURCE_DATE_EPOCH;if(n===void 0||n==="")return xw(t());let r=new Date(Number(n)*1000);if(!RM.test(n)||Number.isNaN(r.getTime()))throw RangeError(`SOURCE_DATE_EPOCH must be a non-negative integer number of seconds, got "${n}"`);return xw(r)}var RM;var bw=M(()=>{RM=/^\d+$/});function ul(e,t){return e.replaceAll(JM,(n,r,s)=>{let o=s.trim(),i=FM.exec(o),a=i?i[2]:o,l=Te(t,a);if(l===a)return n;return`url(${r}${i?`${i[1]}${l}${i[1]}`:l}${r})`})}function og(e,t,n,r,s){let o=n.toLowerCase();if($w.has(o))return Te(s,r);if(Sw.has(o)){let i=ng(r);return i.length===0?r:rg(i.map((a)=>({descriptor:a.descriptor,url:Te(s,a.url)})))}if(o==="style")return ul(r,s);if(o==="content"&&e==="meta"&&LM.test(t))return Te(s,r);return r}function ig(e,t){if(t==="")return e;let n=e.replaceAll(IM,(r,s,o,i)=>{let a=o.replaceAll(MM,(l,c)=>`"${Te(t,c)}"`);return s+a+i});return n=n.replaceAll(DM,(r,s,o,i)=>s+ul(o,t)+i),n.replaceAll(TM,(r,s,o)=>{if(o==="")return r;let i=s.toLowerCase(),a=o.replaceAll(NM,(l,c,u,d,p)=>{let m=d===void 0?"'":'"',g=d??p??"",b=og(i,o,c,g,t);return b===g?l:`${c}=${m}${b}${m}`});return a===o?r:`<${s}${a}>`})}function VM(e,t){let n=_(e.tagName)?e.tagName.toLowerCase():"",{attributes:r}=e;if(F(r)){for(let[s,o]of Object.entries(r))if(_(o))r[s]=og(n,"",s,o,t)}for(let s of Object.keys(e)){let o=s.toLowerCase(),i=e[s];if(_(i)&&($w.has(o)||Sw.has(o)))e[s]=og(n,"",o,i,t)}if(_(e.innerHTML))e.innerHTML=ig(e.innerHTML,t)}function cl(e,t){if(!F(e)||Array.isArray(e))return;if(Le(e)){cl(e.map,t);return}let n=e;VM(n,t);let{cases:r,children:s}=n;if(Array.isArray(s))for(let o of s)cl(o,t);else cl(s,t);if(F(r))for(let o of Object.values(r))cl(o,t)}function ww(e,t){if(t!=="")cl(e,t)}var $w,Sw,TM,NM,JM,MM,IM,DM,LM,FM;var vw=M(()=>{hn();ae();$w=new Set(["href","src","poster","action","formaction","data"]),Sw=new Set(["srcset","imagesrcset"]),TM=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,NM=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,JM=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,MM=/"(\/[^"/][^"]*)"/g,IM=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,DM=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,LM=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,FM=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var gl=B(function(eZ,Kw){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:fg,getOwnPropertyDescriptor:qM,getOwnPropertyNames:HM}=Object,WM=Object.prototype.hasOwnProperty,BM=(e,t)=>{for(var n in t)fg(e,n,{get:t[n],enumerable:!0})},UM=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of HM(t))if(!WM.call(e,s)&&s!==n)fg(e,s,{get:()=>t[s],enumerable:!(r=qM(t,s))||r.enumerable})}return e},zM=(e)=>UM(fg({},"__esModule",{value:!0}),e),ml={};BM(ml,{analyzeMetafile:()=>EI,analyzeMetafileSync:()=>_I,build:()=>$I,buildSync:()=>jI,context:()=>SI,default:()=>RI,formatMessages:()=>vI,formatMessagesSync:()=>kI,initialize:()=>AI,stop:()=>OI,transform:()=>wI,transformSync:()=>PI,version:()=>bI});Kw.exports=zM(ml);function Ew(e){let t=(r)=>{if(r===null)n.write8(0);else if(typeof r==="boolean")n.write8(1),n.write8(+r);else if(typeof r==="number")n.write8(2),n.write32(r|0);else if(typeof r==="string")n.write8(3),n.write(dr(r));else if(r instanceof Uint8Array)n.write8(4),n.write(r);else if(r instanceof Array){n.write8(5),n.write32(r.length);for(let s of r)t(s)}else{let s=Object.keys(r);n.write8(6),n.write32(s.length);for(let o of s)n.write(dr(o)),t(r[o])}},n=new Nw;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),lg(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function KM(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return Mo(n.read());case 4:return n.read();case 5:{let i=n.read32(),a=[];for(let l=0;l<i;l++)a.push(t());return a}case 6:{let i=n.read32(),a={};for(let l=0;l<i;l++)a[Mo(n.read())]=t();return a}default:throw Error("Invalid packet")}},n=new Nw(e),r=n.read32(),s=(r&1)===0;r>>>=1;let o=t();if(n.ptr!==e.length)throw Error("Invalid packet");return{id:r,isRequest:s,value:o}}var Nw=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);lg(this.buf,e,t)}write(e){let t=this._write(4+e.length);lg(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return Jw(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),n=this._read(t.length);return t.set(this.buf.subarray(n,n+e)),t}},dr,Mo,ag;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;dr=(n)=>e.encode(n),Mo=(n)=>t.decode(n),ag='new TextEncoder().encode("")'}else if(typeof Buffer<"u")dr=(e)=>Buffer.from(e),Mo=(e)=>{let{buffer:t,byteOffset:n,byteLength:r}=e;return Buffer.from(t,n,r).toString()},ag='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(dr("")instanceof Uint8Array))throw Error(`Invariant violation: "${ag} instanceof Uint8Array" is incorrectly false
56
56
 
package/dist/compiler.js CHANGED
@@ -10,7 +10,7 @@ ${e}
10
10
  `),t,n).split(`
11
11
  `);return e}function Ma(e,t,n){let{code:r,problems:s}=Of(e),[o,...i]=s.filter((l)=>l.kind==="unsupported");if(o)throw new Fa(t,[o,...i]);for(let l of s)n.push({...t,problem:l});return r}function Eo(e,t,n){if(Array.isArray(e))return e.map((i,l)=>Eo(i,{...t,pointer:`${t.pointer}/${l}`},n));if(!A(e))return e;let r=bo(e),s=[],o={set:(i,l)=>{s.push([i,l])}};for(let[i,l]of Object.entries(e)){let c={...t,pointer:`${t.pointer}/${jf(i)}`};if(r&&i==="body")o.set(i,_a(l,c,n));else if(r&&(i==="getter"||i==="setter")&&A(l)){let a={...l};if(l.body!==void 0)a.body=_a(l.body,{...c,pointer:`${c.pointer}/body`},n);o.set(i,a)}else o.set(i,Eo(l,c,n))}return Object.fromEntries(s)}function vo(e,t,n=[]){return Eo(e,{path:t,pointer:""},n)}function Va(e,t,n=[]){return vo(e,t,n)}var Ef,$o,Vr=null,wo=null,Pa,Fa;var Jo=v(()=>{K();Ef=/(^|[\n;{}])(\s*)(import|export)(?=[\s{*"'])/gu;$o=new Map;Pa=new Map;Fa=class Fa extends Error{problems;site;constructor(e,t){let[n]=t;super(`${e.path}${e.pointer}: ${n.message} (line ${n.line}, column ${n.column})`);this.name="EraseError",this.problems=t,this.site=e}}});import{createRequire as Af}from"node:module";var Wa=v(()=>{Jo();Jo();Ia(()=>Af(import.meta.url)("ts-blank-space").default)});function Ba(e){for(let{path:t,pointer:n,problem:r}of e){let s=`${t}${n} (line ${r.line}, column ${r.column}): ${r.message}`;if(!Ha.has(s))Ha.add(s),console.warn(`Warning: ${s}`)}}function Wn(e,t){let n=[],r=vo(e,t,n);return Ba(n),r}function qa(e,t){let n=[],r=Va(e,t,n);return Ba(n),r}var Ha;var Wr=v(()=>{Wa();Ha=new Set});function Cf(e){let t=new Set,n=new Set,r=(o)=>{if(o.startsWith("#/state/"))t.add(o.slice(8).split("/")[0])},s=(o)=>{if(y(o)){for(let i of o.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/gu))t.add(i[1]);return}if(Array.isArray(o)){if(!n.has(o)){n.add(o);for(let i of o)s(i)}return}if(!A(o)||n.has(o))return;if(n.add(o),o.operator==="call"&&_(o.target))r(o.target.$ref);if(o.$prototype==="Array"){for(let i of[o.filter,o.sort])if(_(i))r(i.$ref)}for(let[i,l]of Object.entries(o)){if(i==="$defs")continue;if(i.startsWith("on")&&_(l))r(l.$ref);s(l)}};s(e);for(let o of Oo)if(A(e.state)&&o in e.state)t.add(o);return t}function jo(e){return"body"in e&&"$src"in e}function Hn(e){return Fr(e.parameters??e.arguments).length>0}function nt(e){let t=["state"];for(let n of Fr(e.parameters??e.arguments))if(n!=="state")t.push(n);return t}function Nf(e,t,n){if(tt(t))return"callable";if(Fr(t.parameters??t.arguments).length>0)return"callable";if(y(t.body))return Na(t.body)?"computed":"callable";if(t.$src)return n().has(e)?"callable":"computed";return"callable"}function rt(e){let t=new Map,n=null,r=()=>n??=Cf(e);for(let[s,o]of Object.entries(e.state??{}))if(me(o))t.set(s,Nf(s,o,r));return t}var Oo;var en=v(()=>{K();Oo=new Set(["onMount","onUnmount","onAdopted"])});function Re(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function za(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return Rf.has(n.toLowerCase())?n:e.slice(1)}return null}function Bn(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function qn(e){return e.startsWith("@keyframes")}function Ka(e,t){let n=[];for(let r of tn(e))for(let s of tn(t))n.push(Ao(r,s));return n.join(", ")}function Ao(e,t){let n=kf(e,t);if(n!==null)return n;let r=el(t,e);if(r!==null)return r;if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Ga(e,t){let n=0,r=null;for(let s=t;s<e.length;s+=1){let o=e[s];if(o==="\\")s+=1;else if(r)r=o===r?null:r;else if(o==='"'||o==="'")r=o;else if(o==="(")n+=1;else if(o===")"){if(n-=1,n===0)return s+1}}return-1}function Ya(e){if(e.endsWith(":host"))return{inner:"",prefix:e.slice(0,-5)};let t=e.lastIndexOf(":host(");if(t===-1||Ga(e,t+5)!==e.length)return null;return{inner:e.slice(t+6,-1),prefix:e.slice(0,t)}}function Xa(e){if(!e.startsWith(":host"))return null;let t=e.slice(5);if(t.startsWith("(")){let n=Ga(t,0);return n===-1?null:{inner:t.slice(1,n-1),rest:t.slice(n)}}return/^[\w-]/u.test(t)?null:{inner:null,rest:t}}function Za(e){let t=0,n=null;for(let r=0;r<e.length;r+=1){let s=e[r];if(s==="\\")r+=1;else if(n)n=s===n?null:n;else if(s==='"'||s==="'")n=s;else if(s==="("||s==="[")t+=1;else if(s===")"||s==="]")t-=1;else if(t===0){if(/[\s>+~]/u.test(s)||e.startsWith("::",r))return r;if(s===":"&&Tf.test(e.slice(r)))return r}}return e.length}function kf(e,t){let n=Ya(e);if(n===null||!Ro(t))return null;let r=Br(t);if(r.length>1||r.length===1&&r[0]!==0)return null;let s=r.length===1?t.slice(1):t,o=Za(s);if(o===0)return`${e}${s}`;return`${n.prefix}:host(${n.inner}${s.slice(0,o)})${s.slice(o)}`}function _f(e,t,n){let r=Xa(e);if(r===null)return n==="shadow"&&Pf.test(e)?e:Ao(t,e);let{inner:s,rest:o}=r;if(n==="light")return`${t}${s??""}${o}`;let l=`${Ya(t)?.prefix??""}:host${s===null?"":`(${s})`}`;if(o==="")return l;return/^[\s>+~]/u.test(o)?`${l}${o}`:Ao(l,o)}function Qa(e,t,n){let r=[];for(let s of tn(t))for(let o of tn(e))r.push(_f(o,s,n));return r.join(", ")}function Mf(e){return tn(e).every((t)=>{let n=Xa(t);if(n===null)return Ro(t);let r=Za(n.rest);return n.rest.slice(r).replace(/^::?[\w-]+(?:\([^)]*\))?/u,"")===""})}function Br(e){let t=[],n=null,r=0;for(let s=0;s<e.length;s+=1){let o=e[s];if(n){if(o==="\\")s+=1;else if(o===n)n=null;continue}if(o==="\\")s+=1;else if(o==='"'||o==="'")n=o;else if(o==="[")r+=1;else if(o==="]")r=Math.max(0,r-1);else if(o==="&"&&r===0)t.push(s)}return t}function el(e,t){return Br(e).length>0?Df(e,t):null}function Df(e,t){let n="",r=0;for(let s of Br(e))n+=e.slice(r,s)+t,r=s+1;return n+e.slice(r)}function tn(e){let t=[],n=0,r=null,s=0;for(let i=0;i<e.length;i+=1){let l=e[i];if(r){if(l==="\\")i+=1;else if(l===r)r=null;continue}if(l==='"'||l==="'")r=l;else if(l==="("||l==="[")n+=1;else if(l===")"||l==="]")n=Math.max(0,n-1);else if(l===","&&n===0)t.push(e.slice(s,i)),s=i+1}t.push(e.slice(s));let o=t.flatMap((i)=>{let l=i.trim();return l===""?[]:[l]});return o.length>0?o:[e]}function ft(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function Co(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${ze}]))`,forced:`${e}:where([${ze}="${t}"])`};return{auto:`:where(:root:not([${ze}])) ${e}`,forced:`:where(:root[${ze}="${t}"]) ${e}`}}function Un(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function No(e){return e.startsWith("--")?e:Re(e)}function Hr(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function tl(e,t,n){let r=n.map(([o,i])=>`${o}: ${i}`).join("; "),s=t===null?r:`${t} { ${r} }`;for(let o=e.length-1;o>=0;o-=1)s=`${e[o]} { ${s} }`;return s}function zn(e){if(e.description===void 0)return e.text;return`/* ${e.description.replaceAll("*/","* /")} */
12
12
  ${e.text}`}function If(e,t,n){let r=n.map(({selector:o,declarations:i})=>`${o} { ${i.map(([l,c])=>`${l}: ${c}`).join("; ")} }`).join(" "),s=`@keyframes ${t} { ${r} }`;for(let o=e.length-1;o>=0;o-=1)s=`${e[o]} { ${s} }`;return s}function Lf(e){let t=Object.keys(e).filter((r)=>qn(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function Ro(e){let n=Br(e).at(-1),r=n===void 0?e:e.slice(n+1);return r===""||r.startsWith(":")||r.startsWith(".")||r.startsWith("[")}function nn(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:s=(S)=>S,transposeSelector:o=(S)=>S,resolveValue:i,host:l,shadowTree:c=!1}=t,a=[],u=(S)=>S!==null&&typeof S==="object"&&!Array.isArray(S)&&!_(S),f=(S,E)=>{if(u(E))return[E];if(!Bn(S)||!Array.isArray(E)||E.length===0)return[];return E.every((J)=>u(J))?E:[]},p=(S,E,J,M)=>{if(E===void 0||E===null)return null;if(_(E))return J?i?.(S,E,M)??null:null;if(j(E))return null;let k=String(E);if(B(k))return J?i?.(S,k,M)??null:null;return s(k)},d=(S,E,J=!0,M="self")=>{let k=[];for(let[P,R]of Object.entries(S)){if(f(P,R).length>0)continue;if(E&&(P.startsWith("@")||Un(P)))continue;if(P.startsWith("$"))continue;let H=p(P,R,J,M);if(H!==null)k.push([No(P),H])}return k},x=(S)=>y(S)&&S!==""?{description:S}:{},w=(S,E,J,M,k)=>{if(J.length===0)return;let P=E;if(P!==null){let O=o(P);if(O===null)return;P=O}let R=tl(S,P,J),H={text:R,conditions:[...S],selector:P,declarations:J,target:M,key:Hr(R)};a.push({...H,...x(k)})},g=(S,E,J)=>{let M=S.slice(10).trim();if(M==="")return;let k=[];for(let[R,H]of Object.entries(E)){if(!u(H))continue;let O=d(H,!0,!1,"unscoped");if(O.length>0)k.push({declarations:O,selector:R.trim()})}if(k.length===0)return;let P=If(J,M,k);a.push({blocks:k,conditions:[...J],declarations:[],key:Hr(P),selector:null,target:"unscoped",text:P,...x(E.$description)})},m=(S,E,J,M,k,P)=>{if(S==="@--")return;if(Bn(S)){w([...M,S],null,d(E,!1,!0,"unscoped"),"unscoped",E.$description);return}if(qn(S)){g(S,E,M);return}let R=za(S,r),H=R===null?S:`@media ${R}`,O=R===null?null:ft(R);if(O!==null&&J!==null&&!c){let{auto:T,forced:de}=Co(J,O);b(E,T,[...M,H],k,P),b(Lf(E),de,M,k,P);return}b(E,J,[...M,H],k,P)};function b(S,E,J,M,k){w(J,E,d(S,!0,!0,M),M,S.$description);for(let[P,R]of Object.entries(S))for(let H of f(P,R))if(P.startsWith("@"))m(P,H,E,J,M,k);else if(E!==null&&k&&l!==void 0)b(H,Qa(P,E,l),J,Mf(P)?M:"descendant",!1);else if(E!==null)b(H,Ka(E,P),J,Ro(P)?M:"descendant",!1)}return b(e,n,[],"self",!0),a}function Ua(e){return e===!1||e==="open"||e==="closed"}function dt(e,t){let n=e?.$shadow;if(Ua(n))return n===!1?null:n;let r=t?.shadow;return Ua(r)&&r!==!1?r:null}var Rf,Tf,Pf,ze="data-color-scheme",qr="jx-color-scheme";var Kn=v(()=>{K();Rf=new Set(["all","print","screen","speech"]);Tf=/^:(?:before|after|first-line|first-letter)(?![\w-])/u;Pf=/^::(?:slotted|part)\(/u});function sl(){return`the Intl helpers ${ko.join(", ")}`}var st="en-US",To="UTC",nl,ko,rl;var Po=v(()=>{nl=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],ko=nl.map((e)=>e.path),rl=Object.fromEntries(nl.map((e)=>[e.path,e.params.indexOf("locale")]))});function Ff(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function xe(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function Ae(e){return e.startsWith("#/$map/")?e.slice(2):e}function Le(e){if(e==="")return[];return e.split("/").map((t)=>Ff(t))}function be(e,t){let n=e;for(let r of Le(t))n=n?.[r];return n}function U(e,t){let n=e;for(let r of Le(t))n+=_o.test(r)?`.${r}`:`[${JSON.stringify(r)}]`;return n}function ol(e,t){let n=e;for(let[r,s]of Le(t).entries()){let o=r===0?"":"?.";n+=_o.test(s)?`${r===0?".":o}${s}`:`${o}[${JSON.stringify(s)}]`}return n}function mt(e){return _o.test(e)?e:JSON.stringify(e)}function il(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var _o;var rn=v(()=>{_o=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function Mo(e){let t=e.$map;return j(t)?t:void 0}function Kr(e){return j(e)&&!Array.isArray(e)&&"operator"in e}function sn(e){return j(e)&&!Array.isArray(e)&&"$ref"in e}function Bf(e,t,n){let r=rl[e];if(r===void 0||r<0||t[r]!=null)return t;let s=be(n.$page,"locale");if(!y(s)||s==="")return t;let o=[...t];return o[r]=s,o}function dl(){return globalThis.window??globalThis}function ml(e){return e.startsWith("window#/")&&Wf.has(e.slice(8))}function Ke(e){return ul.has(e)}function Ur(e){if(Array.isArray(e))return e.some((t)=>Ur(t));if(e===void 0||!Kr(e))return!1;return Ke(e.operator)||[e.target,e.value,e.initial,e.default].some((t)=>Ur(t))||Object.values(e.cases??{}).some((t)=>Ur(t))}function Gn(e){return et(e)&&!Ur(e.$expression)}function Do(e,t){if(Array.isArray(e)){for(let n of e)Do(n,t);return}if(e===void 0||!j(e))return;if(sn(e)){if(!qf.test(e.$ref)){let n=e.$ref.replace(/^(?:#\/state\/|parent#\/)/,"");t.add(Le(n)[0]??"")}return}if(Kr(e)){let n=[e.target,e.value,e.initial,e.default];for(let r of[...n,...Object.values(e.cases??{})])Do(r,t)}}function Ho(e){let t=new Set;return Do(e.$expression,t),[...t]}function Bo(e){let t=new Map;for(let[r,s]of Object.entries(e??{}))if(!r.startsWith("$")&&Gn(s))t.set(r,s);let n=!1;while(!n){n=!0;for(let[r,s]of t)if(Ho(s).some((o)=>!t.has(o)))t.delete(r),n=!1}return Object.fromEntries(t)}function ae(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>Uf)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function se(e,t,n,r,s){if(e===null||e===void 0)return e;if(Kr(e))return Me(e,t,n,r,s);if(sn(e)){let o=zr(e.$ref,t,n,r);return s?.report(s.path??[],o),o}if(Array.isArray(e))return gl(e,t,n,r,s);return s?.report(s.path??[],e),e}function gl(e,t,n,r,s){return e.map((o,i)=>se(o,t,n,r,ae(s,i)))}function zf(e,t,n,r){let s=Ae(e),o=(i)=>{if(!s.slice(i.length).includes("/"))return t;return zr(s.slice(0,s.lastIndexOf("/")),t,n,r)};if(s.startsWith("#/state/"))return o("#/state/");if(s.startsWith("parent#/"))return o("parent#/");if(s.startsWith("$map/")||s.startsWith("$args/"))return s.split("/").length>2?zr(s.slice(0,s.lastIndexOf("/")),t,n,r):void 0;return}function zr(e,t,n,r){let s=Ae(e);if(s==="$reduce/acc")return r?.acc;if(s.startsWith("$reduce/"))return r?.acc;if(s.startsWith("$args/")){let o=s.slice(6).split("/"),i=r?.args?.[o[0]];return o.length>1?be(i,o.slice(1).join("/")):i}if(s.startsWith("event#/")){let o=s.slice(7);return be(n,o)}if(s.startsWith("$map/")){let o=s.split("/"),[,i]=o,l,c=Mo(t);if(i==="item")l=r?.item??c?.item??t["$map/item"];else if(i==="index")l=r?.index??c?.index??t["$map/index"];else l=c?.[i]??t[`$map/${i}`];return o.length>2?be(l,o.slice(2).join("/")):l}if(s.startsWith("#/state/"))return be(t,s.slice(8));if(s.startsWith("parent#/"))return be(t,s.slice(8));if(s.startsWith("window#/"))return be(dl(),s.slice(8));if(s.startsWith("document#/"))return be(globalThis.document,s.slice(10));return be(t,s)??null}function Kf(e,t,n,r){let s=Ae(e);if(s.startsWith("$map/")){let o=s.split("/"),[,i]=o,l,c=Mo(t);if(i==="item")l=r?.item??c?.item??t["$map/item"];else if(i==="index")l=r?.index??c?.index??t["$map/index"];else l=c?.[i]??t[`$map/${i}`];if(o.length>2){let a=o.slice(2),u=a.pop(),f=a.length>0?be(l,a.join("/")):l;return{key:u,obj:f}}return{key:i==="item"?"$map/item":"$map/index",obj:Mo(t)??t}}if(s.startsWith("#/state/")){let o=s.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let l=Le(o),c=l.pop(),a=t;for(let u of l)a=a[u];return{key:c,obj:a}}return{key:s,obj:t}}function Me(e,t,n,r,s){let o=Gf(e,t,n,r,s);return s?.report(s.path??[],o),o}function ll(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n;case"%":return t%n;case"<":return t<n;case"<=":return t<=n;case">":return t>n;default:return t>=n}}function Gf(e,t,n,r,s){let{operator:o,target:i,value:l,initial:c}=e;if(!Vf.has(o))throw Error(`$expression: unknown operator "${o}"`);if(Io.has(o)&&!("value"in e)){let a=se(i,t,n,r,ae(s,"target"));if(o==="!")return!a;if(o==="-")return-a}if(o==="call"){let a=sn(i)?i.$ref:void 0;if(!y(a))throw TypeError("$expression: call target must be a $ref pointer");let u=(r?.callDepth??0)+1;if(u>al)throw Error(`$expression: call depth exceeded (${al})`);let f=Array.isArray(l)?l.map((d,x)=>se(d,t,n,r,ae(s,["value",x]))):[];if(a.startsWith("window#/")){if(!ml(a))throw Error(`$expression: "${a}" is not a blessed pure global`);let d=a.slice(8),x=Hf.get(d);if(x)return x(...Bf(d,f,t));let w=dl(),g=be(w,d),m=d.lastIndexOf("/"),b=m===-1?w:be(w,d.slice(0,m));return g.apply(b,f)}let p=zr(a,t,n,r);if(je(p))return p.apply(zf(a,t,n,r),f);if(j(p)&&"$expression"in p){let d=p,x={};for(let[w,g]of(d.parameters??[]).entries()){let m=y(g)?g:g?.name??"";if(!m)continue;x[m]=f[w]===void 0&&j(g)&&"default"in g?g.default:f[w]}return Me(d.$expression,t,n,{args:x,callDepth:u})}throw TypeError(`$expression: call target "${a}" is not callable`)}if(Vo.has(o)){if(o==="?:"){let d=se(i,t,n,r,ae(s,"target"));if(s){let x=se(l,t,n,r,ae(s,"value")),w=se(c,t,n,r,ae(s,"initial"));return d?x:w}return d?se(l,t,n,r):se(c,t,n,r)}let a=se(i,t,n,r,ae(s,"target")),u=String(a),f=e.cases??{},p=Object.hasOwn(f,u);if(s){let d;for(let[w,g]of Object.entries(f)){let m=se(g,t,n,r,ae(s,["cases",w]));if(w===u)d=m}let x=se(e.default,t,n,r,ae(s,"default"));return p?d:x}return p?se(f[u],t,n,r):se(e.default,t,n,r)}if(Lo.has(o)){let a=se(i,t,n,r,ae(s,"target")),u=se(l,t,n,r,ae(s,"value"));switch(o){case"===":return a===u;case"!==":return a!==u;case"&&":return a&&u;case"||":return a||u;case"??":return a??u;default:return ll(o,a,u)}}if(pl.has(o)){let a=se(l,t,n,r,ae(s,"value")),{obj:u,key:f}=Kf(i.$ref,t,n,r);u[f]=o==="="?a:ll(o.slice(0,-1),u[f],a);return}if(fl.has(o)){let a=se(i,t,n,r,ae(s,"target"));switch(o){case"push":return a.push(se(l,t,n,r,ae(s,"value")));case"unshift":return a.unshift(se(l,t,n,r,ae(s,"value")));case"pop":return a.pop();case"shift":return a.shift();case"splice":{let u=se(l,t,n,r,ae(s,"value"));return a.splice(...u)}default:break}}if(Wo.has(o)){let a=se(i,t,n,r,ae(s,"target")),u=l===void 0?[]:Array.isArray(l)?gl(l,t,n,r,ae(s,"value")):[se(l,t,n,r,ae(s,"value"))],f=be(a,o);if(!je(f))return;return f.apply(a,u)}if(Fo.has(o)){let a=se(i,t,n,r,ae(s,"target")),u=l;if(o==="reduce"){let f=se(c,t,n,r,ae(s,"initial"));for(let[p,d]of a.entries())f=Me(u,t,n,{acc:f,index:p,item:d},p===0?ae(s,"value"):void 0);return f}if(o==="map")return a.map((f,p)=>Me(u,t,n,{...r,index:p,item:f},p===0?ae(s,"value"):void 0));if(o==="filter")return a.filter((f,p)=>Me(u,t,n,{...r,index:p,item:f},p===0?ae(s,"value"):void 0))}return}function ce(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(Kr(e))return Te(e,t);if(sn(e))return qo(e.$ref,t);if(Array.isArray(e))return e.map((n)=>ce(n,t)).join(", ");return JSON.stringify(e)}function Yf(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function qo(e,t){let n=Ae(e),r=t.statePrefix??"state",s=t.eventParam??"event";if(n==="$reduce/acc")return"_acc";if(n.startsWith("$reduce/"))return"_acc";if(n.startsWith("$args/"))return U("_args",n.slice(6));if(n.startsWith("event#/"))return U(s,n.slice(7));if(n.startsWith("$map/")){let o=n.split("/"),[,i]=o;if(i==="item")return o.length>2?U("_item",o.slice(2).join("/")):"_item";if(i==="index")return"_index";return`_${i}`}if(n.startsWith("#/state/"))return U(r,n.slice(8));if(n.startsWith("parent#/"))return U(r,n.slice(8));if(n.startsWith("window#/"))return U("window",n.slice(8));if(n.startsWith("document#/"))return U("document",n.slice(10));return U(r,n)}function cl(e,t){if(sn(e))return qo(e.$ref,t);return ce(e,t)}function Xf(e,t,n){let r=(i)=>t[i]??"undefined",s=`(${n.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(st)})`,o=JSON.stringify(To);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${r(1)} ?? ${s}, ${r(2)}).format(${r(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${r(1)} ?? ${s}, {timeZone: ${o}, ...${r(2)}}).format(new Date(${r(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${r(2)} ?? ${s}, ${r(3)}).format(${r(0)}, ${r(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${r(1)} ?? ${s}, ${r(2)}).format(${r(0)})`;case"Intl/plural":return`new Intl.PluralRules(${r(1)} ?? ${s}, ${r(2)}).select(${r(0)})`;case"Intl/compare":return`new Intl.Collator(${r(2)} ?? ${s}, ${r(3)}).compare(${r(0)}, ${r(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${r(2)} ?? ${s}, {...${r(3)}, type: ${r(1)} ?? 'language'}).of(${r(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${r(2)} ?? ${s}, {granularity: ${r(1)} ?? 'grapheme'}).segment(${r(0)})].map((p) => p.segment)`;default:return null}}function Te(e,t={}){let{operator:n,target:r,value:s,initial:o}=e;if(Io.has(n)&&!("value"in e)){let i=ce(r,t);if(n==="!")return`!(${i})`;if(n==="-")return`-(${i})`}if(n==="call"){let i=(sn(r)?r.$ref:void 0)??"",l=Array.isArray(s)?s.map((c)=>ce(c,t)):[];if(i.startsWith("window#/")){if(!ml(i))throw Error(`$expression: "${i}" is not a blessed pure global`);let c=Xf(i.slice(8),l,t);if(c)return c;return`window.${i.slice(8).replaceAll("/",".")}(${l.join(", ")})`}if(i.startsWith("#/state/")){let c=i.slice(8),a=t.formulaParams?.[c];if(a){let u=a.map((f,p)=>`${JSON.stringify(f)}: ${l[p]??"undefined"}`).join(", ");return`${Yf(c)}(${t.statePrefix??"state"}, { ${u} })`}}return`${qo(i,t)}(${l.join(", ")})`}if(Vo.has(n)){if(n==="?:"){let a=ce(r,t),u=ce(s,t),f=ce(o,t);return`(${a} ? ${u} : ${f})`}let i=ce(r,t),l=Object.entries(e.cases??{}).map(([a,u])=>`_d === ${JSON.stringify(a)} ? ${ce(u,t)} : `).join(""),c="default"in e?ce(e.default,t):"undefined";return`((_d) => ${l}${c})(String(${i}))`}if(Lo.has(n)){let i=ce(r,t),l=ce(s,t);return`(${i} ${n} ${l})`}if(pl.has(n)){let i=cl(r,t),l=ce(s,t);return`${i} ${n} ${l}`}if(fl.has(n)){let i=cl(r,t);switch(n){case"push":return`${i}.push(${ce(s,t)})`;case"unshift":return`${i}.unshift(${ce(s,t)})`;case"pop":return`${i}.pop()`;case"shift":return`${i}.shift()`;case"splice":{let l=Array.isArray(s)?s.map((c)=>ce(c,t)).join(", "):ce(s,t);return`${i}.splice(${l})`}default:break}}if(Wo.has(n)){let i=ce(r,t),l=s===void 0?"":Array.isArray(s)?s.map((c)=>ce(c,t)).join(", "):ce(s,t);return`(${i})?.${n}?.(${l})`}if(Fo.has(n)){let i=ce(r,t),l=Te(s,t);if(n==="reduce"){let c=ce(o,t);return`${i}.reduce((_acc, _item, _index) => ${l}, ${c})`}if(n==="map")return`${i}.map((_item, _index) => ${l})`;if(n==="filter")return`${i}.filter((_item, _index) => ${l})`}return"undefined"}function on(e,t,n,r){return se(e,t,n,r)}function gt(e,t={}){return ce(e,t)}var ul,Io,Lo,pl,fl,Fo,Vo,Wo,Vf,Wf,Hf,qf,al=64,Uf=64;var an=v(()=>{Po();K();rn();ul=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Io=new Set(["!","-"]),Lo=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),pl=new Set(["=","+=","-=","*=","/="]),fl=new Set(["push","pop","shift","unshift","splice"]),Fo=new Set(["reduce","map","filter"]),Vo=new Set(["?:","switch"]),Wo=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),Vf=new Set([...ul,...Io,...Lo,...Fo,...Vo,...Wo,"call"]),Wf=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...ko]),Hf=new Map([["Intl/compare",(e,t,n,r)=>new Intl.Collator(n??st,r).compare(e,t)],["Intl/displayName",(e,t,n,r)=>new Intl.DisplayNames(n??st,{...r,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,n)=>new Intl.DateTimeFormat(t??st,{timeZone:To,...n}).format(new Date(e))],["Intl/formatList",(e,t,n)=>new Intl.ListFormat(t??st,n).format(e)],["Intl/formatNumber",(e,t,n)=>new Intl.NumberFormat(t??st,n).format(e)],["Intl/formatRelativeTime",(e,t,n,r)=>new Intl.RelativeTimeFormat(n??st,r).format(e,t)],["Intl/plural",(e,t,n)=>new Intl.PluralRules(t??st,n).select(e)],["Intl/segment",(e,t,n)=>[...new Intl.Segmenter(n??st,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)]]);qf=/^(?:\$args\/|\$reduce\/|\$map\/|window#\/|document#\/|event#\/)/});function Zf(e){return e.startsWith(hl)}function jx(e){let t=e;if(Zf(t))t=t.slice(hl.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${Uo}${t}.js`}function Ax(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",n=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${Uo}${n}`:`${Uo}${n}.${t}`}function yl(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function xl(e){let t=yl(e);return t.startsWith("/")?t:`/${t}`}function Qf(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function Cx(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let s of Qf(e,"urlPrefix")){let o=xl(s.urlPrefix);if(!r.startsWith(`${o}/`))continue;let l=r.slice(o.length+1).split("/");if(l.some((a)=>a===""||a==="."||a===".."))return null;let{filter:c}=s;if(c&&!c(l.join("/")))return null;return`${yl(s.dir)}/${l.join("/")}`}return null}function Nx(e,t){let n=new Set;for(let r of t){let s=xl(r.urlPrefix),o=new RegExp(`${s.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${ed}]+`,"g");for(let i of e.matchAll(o)){let l=i[0].split("#")[0].split("?")[0];if(!l.endsWith("/"))n.add(l)}}return[...n].filter(Boolean)}function td(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let s=e.slice(r,n);if(s.endsWith(",")){t.push({descriptor:"",url:s.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let o=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(o,n).trim();if(n+=1,s=s.replace(/,+$/,""),s!=="")t.push({descriptor:i,url:s})}return t}function nd(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Rx(e){if(!y(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let n=t.replace(/\/+$/,"");if(n===""||n==="/")return"";return n.startsWith("/")?n:`/${n}`}function ln(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function Tx(e,t){let n=new URL(t);if(!n.pathname.endsWith("/"))n.pathname+="/";return new URL(e.replace(/^\/+/,""),n).href}var hl="npm:",Uo="/assets/",ed;var Gr=v(()=>{K();ed=String.raw`"'\s<>()\\`});function bl(e){if("operator"in e)return{kind:"expression",node:e};if("if"in e)return{kind:"if",node:e};if("$switch"in e)return{kind:"switch",node:e};if("stopPropagation"in e)return{kind:"stopPropagation"};if("preventDefault"in e)return{kind:"preventDefault"};return{kind:"dispatch",node:e}}function rd(e){return(j(e)||je(e))&&"then"in e&&je(e.then)}async function cn(e,t,n,r={}){let s=r.args?{args:r.args}:void 0;for(let o of e){let i=bl(o);switch(i.kind){case"expression":{let l=Me(i.node,t,n,s);if(rd(l))await l;break}case"if":{let l=i.node,c=on(l.if,t,n,s)?l.then:l.else;if(Array.isArray(c))await cn(c,t,n,r);break}case"switch":{let l=i.node,c=String(on(l.$switch,t,n,s)),a=l.cases??{},u=Object.hasOwn(a,c)?a[c]:l.default;if(Array.isArray(u))await cn(u,t,n,r);break}case"dispatch":{let l=i.node,c=je(r.target)?r.target():r.target,a=n?.currentTarget??c;if(!a)break;let u={};if("detail"in l)u.detail=on(l.detail,t,n,s);if(l.bubbles!==void 0)u.bubbles=l.bubbles;if(l.composed!==void 0)u.composed=l.composed;a.dispatchEvent(new CustomEvent(l.dispatchEvent,u));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}}function Fe(e,t={}){let n=t.indent??"",r=[];for(let s of e){let o=bl(s);switch(o.kind){case"expression":{r.push(`${n}${Te(o.node,t)};`);break}case"if":{let i=o.node,l=gt(i.if,t),c={...t,indent:`${n} `};if(r.push(`${n}if (${l}) {`,Fe(i.then??[],c)),i.else)r.push(`${n}} else {`,Fe(i.else,c));r.push(`${n}}`);break}case"switch":{let i=o.node,l=gt(i.$switch,t),c={...t,indent:`${n} `};r.push(`${n}switch (String(${l})) {`);for(let[a,u]of Object.entries(i.cases??{}))r.push(`${n} case ${JSON.stringify(a)}: {`,Fe(u,c),`${n} break;`,`${n} }`);if(i.default)r.push(`${n} default: {`,Fe(i.default,c),`${n} }`);r.push(`${n}}`);break}case"dispatch":{let i=o.node,l=t.eventParam??"event",c=t.dispatchTarget??`(${l} && ${l}.currentTarget)`,a=[];if("detail"in i)a.push(`detail: ${gt(i.detail,t)}`);if(i.bubbles!==void 0)a.push(`bubbles: ${JSON.stringify(i.bubbles)}`);if(i.composed!==void 0)a.push(`composed: ${JSON.stringify(i.composed)}`);let u=a.length>0?`, { ${a.join(", ")} }`:"";r.push(`${n}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(i.dispatchEvent)}${u}));`);break}case"stopPropagation":{r.push(`${n}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{r.push(`${n}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return r.join(`
13
- `)}var Yr=v(()=>{K();an()});var zo=v(()=>{K()});function Xo(e){if(e===sd)return"client";if(e===od)return"server";return null}function id(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"")}function Sl(e,t){return`${Yo}${id(e)}#${t}`}function wl(e){return e.startsWith(Yo)}function El(e){if(!wl(e))return null;let t=e.slice(Yo.length),n=t.lastIndexOf("#");if(n<=0)return null;let r=t.slice(n+1);if(r!=="client"&&r!=="server")return null;return{path:t.slice(0,n),side:r}}function Ko(e,t){if(Array.isArray(e)){let r=e.map((s)=>Ko(s,t));return r.some((s,o)=>s!==e[o])?r:e}if(!A(e))return e;let n=null;for(let[r,s]of Object.entries(e)){let o=s;if(r==="$src"&&y(s)){let i=Xo(s);o=i===null?s:Sl(t,i)}else if(r!=="$script")o=Ko(s,t);if(o!==s)n??={...e},n[r]=o}return n===null?e:n}function Zo(e,t){return Ko(e,t)}function cd(e){return ad.test(e)&&!ld.test(e)}function $l(e){return Xo(e)==="client"||El(e)?.side==="client"}function Go(e,t,n){if(Array.isArray(e)){for(let[r,s]of e.entries())Go(s,[...t,r],n);return n}if(!A(e))return n;if(y(e.$src))n.push({lazy:e.$lazy===!0,path:t,src:e.$src});for(let[r,s]of Object.entries(e))if(r!=="$script")Go(s,[...t,r],n);return n}function ud(e){let t=e.at(-1);return y(t)?`"${t}"`:"this entry"}function Fx(e){let t=Go(e,[],[]),n=t.some((s)=>!s.lazy&&$l(s.src)),r=[];for(let s of t){let o=ud(s.path);if(!s.lazy&&cd(s.src))r.push({detail:'A module only this document uses can be the document\'s own script: move the code into the client script (the server script for a `timing: "server"` entry) and name it with `$src: "#client"` or `$src: "#server"`. A module several documents import stays a file, and this one keeps working as it is.',message:`${o} imports ${s.src}, which the document could carry as its own script`,path:s.path,rule:"relative-src"});else if(s.lazy&&n&&$l(s.src))r.push({detail:"A document has one client script, and another entry imports it as the page loads, so `$lazy` defers nothing here. Move this export to a `$src` module of its own to load it on its first call.",message:`${o} is $lazy, but the script it is in loads with the page`,path:s.path,rule:"lazy-shares-script"})}return r}var Yo="jx-script:",sd="#client",od="#server",ad,ld;var Qo=v(()=>{K();ad=/^\.{1,2}\//u,ld=/\.json$/iu});function gd(e){for(let t of Object.keys(e))if(md.has(t))return!0;return!1}function Xr(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let[t,...n]=Ta(e);return t!==void 0&&n.length===0&&t.start===0&&t.end===e.length}function Ol(){return[...Jl].toSorted()}function ot(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Jl.has(n))return String(t);return t?"":null}function jl(e,t,n){if(!Array.isArray(e))return[];let r=e;if(je(t))r=r.filter(t);if(je(n))r=[...r].toSorted(n);return r}function Al(e,t,n,r){let s=Qt(t);if(r?.has(s)&&r.get(s)===void 0)return;let o=e[s];if(le(o)){e[s]=n!==null&&n!=="false";return}if(n===null){let i=r?.get(s);e[s]=i===void 0?Y(o)?0:"":i;return}e[s]=Y(o)?Number(n):n}function ei(e){let t=vl.get(e);if(t)return t;let n=new Set,r=rt(e);for(let[s,o]of Object.entries(e.state??{}))if(y(o)?B(o):Ne(o)?!et(o)&&!Ke(o.$expression.operator):r.get(s)==="computed")n.add(s);return vl.set(e,n),n}function Cl(e){let t=e.state??{},n=ei(e),r=(s)=>(s in t)&&!n.has(s);return{checked:r("checked"),disabled:r("disabled"),required:r("required"),value:r("value")}}function ti(e){let t=new Map;for(let[n,r]of Object.entries(e.state??{})){if(y(r)&&B(r)){t.set(n,void 0);continue}if(j(r)&&!Array.isArray(r)){if("default"in r){t.set(n,r.default);continue}if(hd.some((s)=>(s in r))){t.set(n,void 0);continue}if(gd(r))continue}t.set(n,r)}return t}var md,Ge,Jl,pb,vl,hd,ni=32,Zr,Qr="jx-slot",ri="data-jx-slots",si="jx.slot.group",fb;var Yn=v(()=>{Kn();an();rn();K();en();Gr();Yr();zo();Qo();zo();Kn();md=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]);Ge=new Set(["$schema","$shadow","formAssociated","formValue","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$script","$media","$map","timing","default","description","body","parameters","arguments","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),Jl=new Set(["contenteditable","draggable","spellcheck"]);pb=Object.freeze({emptyRow:!0});vl=new WeakMap;hd=["$expression","$prototype","$ref","$src"],Zr=/^[\t\n\f\r ]+$/u,fb=(()=>{let e=Symbol.for(si),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function bd(){if(!Xn){Xn=new Map;for(let[e,t,n]of xd){let r=Xn.get(e);if(!r)r=new Map,Xn.set(e,r);for(let s of t.split(" "))r.set(s,n)}}return Xn}function Rl(e,t){return Nl??=new Map(yd),Nl.get(t)??bd().get(t)?.get(e.toLowerCase())??null}function oi(e,t){if(t==="innerText")return!0;if(t==="value"||t==="defaultValue")return $d.has(e.toLowerCase());return t==="text"&&Sd.has(e.toLowerCase())}var h=(e,t={})=>({attribute:e,kind:"text",...t}),D=(e,t={})=>({attribute:e,kind:"boolean",...t}),es,yd,xd,Nl,Xn,$d,Sd;var Tl=v(()=>{es={live:!0},yd=[["accessKey",h("accesskey")],["ariaAtomic",h("aria-atomic")],["ariaAutoComplete",h("aria-autocomplete")],["ariaBrailleLabel",h("aria-braillelabel")],["ariaBrailleRoleDescription",h("aria-brailleroledescription")],["ariaBusy",h("aria-busy")],["ariaChecked",h("aria-checked")],["ariaColCount",h("aria-colcount")],["ariaColIndex",h("aria-colindex")],["ariaColIndexText",h("aria-colindextext")],["ariaColSpan",h("aria-colspan")],["ariaCurrent",h("aria-current")],["ariaDescription",h("aria-description")],["ariaDisabled",h("aria-disabled")],["ariaExpanded",h("aria-expanded")],["ariaHasPopup",h("aria-haspopup")],["ariaHidden",h("aria-hidden")],["ariaInvalid",h("aria-invalid")],["ariaKeyShortcuts",h("aria-keyshortcuts")],["ariaLabel",h("aria-label")],["ariaLevel",h("aria-level")],["ariaLive",h("aria-live")],["ariaModal",h("aria-modal")],["ariaMultiLine",h("aria-multiline")],["ariaMultiSelectable",h("aria-multiselectable")],["ariaOrientation",h("aria-orientation")],["ariaPlaceholder",h("aria-placeholder")],["ariaPosInSet",h("aria-posinset")],["ariaPressed",h("aria-pressed")],["ariaReadOnly",h("aria-readonly")],["ariaRelevant",h("aria-relevant")],["ariaRequired",h("aria-required")],["ariaRoleDescription",h("aria-roledescription")],["ariaRowCount",h("aria-rowcount")],["ariaRowIndex",h("aria-rowindex")],["ariaRowIndexText",h("aria-rowindextext")],["ariaRowSpan",h("aria-rowspan")],["ariaSelected",h("aria-selected")],["ariaSetSize",h("aria-setsize")],["ariaSort",h("aria-sort")],["ariaValueMax",h("aria-valuemax")],["ariaValueMin",h("aria-valuemin")],["ariaValueNow",h("aria-valuenow")],["ariaValueText",h("aria-valuetext")],["autocapitalize",h("autocapitalize")],["autocorrect",D("autocorrect",{keywords:["on","off"]})],["autofocus",D("autofocus")],["className",h("class")],["contentEditable",h("contenteditable")],["dir",h("dir")],["draggable",D("draggable")],["enterKeyHint",h("enterkeyhint")],["headingOffset",h("headingoffset")],["headingReset",D("headingreset")],["hidden",{attribute:"hidden",kind:"hidden"}],["id",h("id")],["inert",D("inert")],["inputMode",h("inputmode")],["lang",h("lang")],["popover",h("popover")],["role",h("role")],["slot",h("slot")],["spellcheck",D("spellcheck")],["tabIndex",h("tabindex")],["title",h("title")],["translate",D("translate",{keywords:["yes","no"]})],["writingSuggestions",h("writingsuggestions")]],xd=[["aLink","body",h("alink")],["abbr","td th",h("abbr")],["accept","input",h("accept")],["acceptCharset","form",h("accept-charset")],["action","form",h("action")],["align","caption col colgroup div embed h1 h2 h3 h4 h5 h6 hr iframe img input legend object p table tbody td tfoot th thead tr",h("align")],["allow","iframe",h("allow")],["allowFullscreen","iframe",D("allowfullscreen")],["alpha","input",D("alpha")],["alt","area img input",h("alt")],["archive","object",h("archive")],["as","link",h("as")],["async","script",D("async")],["autocomplete","form input select textarea",h("autocomplete")],["autoplay","audio video",D("autoplay")],["axis","td th",h("axis")],["background","body",h("background")],["behavior","marquee",h("behavior")],["bgColor","body marquee table td th tr",h("bgcolor")],["border","img object table",h("border")],["cellPadding","table",h("cellpadding")],["cellSpacing","table",h("cellspacing")],["ch","col colgroup tbody td tfoot th thead tr",h("char")],["chOff","col colgroup tbody td tfoot th thead tr",h("charoff")],["charset","a link script",h("charset")],["checked","input",D("checked",es)],["cite","blockquote del ins q",h("cite")],["clear","br",h("clear")],["closedBy","dialog",h("closedby")],["code","object",h("code")],["codeBase","object",h("codebase")],["codeType","object",h("codetype")],["colSpan","td th",h("colspan")],["color","font hr",h("color")],["colorSpace","input",h("colorspace")],["cols","frameset textarea",h("cols")],["command","button",h("command")],["compact","dir dl menu ol ul",D("compact")],["content","meta",h("content")],["controls","audio img video",D("controls")],["coords","a area",h("coords")],["crossOrigin","audio img link script video",h("crossorigin")],["data","object",h("data")],["dateTime","del ins time",h("datetime")],["declare","object",D("declare")],["decoding","img",h("decoding")],["default","track",D("default")],["defaultChecked","input",D("checked")],["defaultMuted","audio video",D("muted")],["defaultSelected","option",D("selected")],["defaultValue","input",h("value")],["defer","script",D("defer")],["dirName","input textarea",h("dirname")],["direction","marquee",h("direction")],["disabled","button fieldset input link optgroup option select textarea",D("disabled")],["download","a area",h("download")],["encoding","form",h("enctype")],["enctype","form",h("enctype")],["event","script",h("event")],["face","font",h("face")],["fetchPriority","img link script",h("fetchpriority")],["formAction","button input",h("formaction")],["formEnctype","button input",h("formenctype")],["formMethod","button input",h("formmethod")],["formNoValidate","button input",D("formnovalidate")],["formTarget","button input",h("formtarget")],["frame","table",h("frame")],["frameBorder","frame iframe",h("frameborder")],["headers","td th",h("headers")],["height","canvas embed iframe img input marquee object source td th video",h("height")],["high","meter",h("high")],["href","a area base link",h("href")],["hreflang","a area link",h("hreflang")],["hspace","embed img input marquee object",h("hspace")],["htmlFor","label script template",h("for")],["httpEquiv","meta",h("http-equiv")],["imageSizes","link",h("imagesizes")],["imageSrcset","link",h("imagesrcset")],["integrity","link script",h("integrity")],["isMap","img",D("ismap")],["kind","track",h("kind")],["label","optgroup option track",h("label")],["link","body",h("link")],["loading","audio iframe img video",h("loading")],["longDesc","frame iframe img",h("longdesc")],["loop","audio video",D("loop")],["low","meter",h("low")],["lowsrc","img",h("lowsrc")],["marginHeight","frame iframe",h("marginheight")],["marginWidth","frame iframe",h("marginwidth")],["max","input meter progress",h("max")],["maxLength","input textarea",h("maxlength")],["media","link meta source style",h("media")],["method","form",h("method")],["min","input meter",h("min")],["minLength","input textarea",h("minlength")],["multiple","input select",D("multiple")],["muted","audio video",D("muted",es)],["name","a button details embed fieldset form frame iframe img input map meta object output param select slot textarea",h("name")],["noHref","area",D("nohref")],["noModule","script",D("nomodule")],["noResize","frame",D("noresize")],["noShade","hr",D("noshade")],["noValidate","form",D("novalidate")],["noWrap","td th",D("nowrap")],["open","details dialog",D("open")],["optimum","meter",h("optimum")],["pattern","input",h("pattern")],["ping","a area",h("ping")],["placeholder","input textarea",h("placeholder")],["playsInline","video",D("playsinline")],["popoverTargetAction","button input",h("popovertargetaction")],["poster","video",h("poster")],["preload","audio video",h("preload")],["readOnly","input textarea",D("readonly")],["referrerPolicy","a area iframe img link script",h("referrerpolicy")],["rel","a area form link",h("rel")],["required","input select textarea",D("required")],["rev","a link",h("rev")],["reversed","ol",D("reversed")],["rowSpan","td th",h("rowspan")],["rows","frameset textarea",h("rows")],["rules","table",h("rules")],["scheme","meta",h("scheme")],["scope","td th",h("scope")],["scrollAmount","marquee",h("scrollamount")],["scrollDelay","marquee",h("scrolldelay")],["scrolling","frame iframe",h("scrolling")],["selected","option",D("selected",es)],["shadowRootClonable","template",D("shadowrootclonable")],["shadowRootCustomElementRegistry","template",h("shadowrootcustomelementregistry")],["shadowRootDelegatesFocus","template",D("shadowrootdelegatesfocus")],["shadowRootMode","template",h("shadowrootmode")],["shadowRootSerializable","template",D("shadowrootserializable")],["shadowRootSlotAssignment","template",h("shadowrootslotassignment")],["shape","a area",h("shape")],["size","font hr input select",h("size")],["sizes","img source",h("sizes")],["span","col colgroup",h("span")],["src","audio embed frame iframe img input source track video",h("src")],["srcdoc","iframe",h("srcdoc")],["srclang","track",h("srclang")],["srcset","img source",h("srcset")],["standby","object",h("standby")],["start","ol",h("start")],["step","input",h("step")],["summary","table",h("summary")],["target","a area base form link",h("target")],["text","body",h("text")],["trueSpeed","marquee",D("truespeed")],["type","a area button embed input li link object ol param script source style ul",h("type")],["useMap","img input object",h("usemap")],["vAlign","col colgroup tbody td tfoot th thead tr",h("valign")],["vLink","body",h("vlink")],["value","button data li meter option param progress",h("value")],["value","input",h("value",es)],["valueType","param",h("valuetype")],["version","html",h("version")],["vspace","embed img input marquee object",h("vspace")],["width","canvas col colgroup embed hr iframe img input listing marquee object pre source table td th video xmp",h("width")],["wrap","textarea",h("wrap")]];$d=new Set(["output","textarea"]),Sd=new Set(["a","option","title"])});var wd,Ed;var kl=v(()=>{wd={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},Ed={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var vd;var Pl=v(()=>{vd={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var Jd,Od,jd;var _l=v(()=>{Jd={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},Od={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},jd={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var Ad;var Ml=v(()=>{Ad={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var Cd,Nd;var Dl=v(()=>{Cd={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},Nd={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var Rd;var Il=v(()=>{Rd={description:"Image optimization configuration for the project.",properties:{formats:{description:'Output formats, each one of "avif", "jpeg", "png" or "webp" (default ["avif", "jpeg"]). AVIF and JPEG are lossy; PNG and WebP are written losslessly, so listing WebP produces larger files than either. A source with transparency is written as PNG wherever JPEG is listed.',items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{description:"Lossy quality per format, 1 to 100 (defaults: avif 65, jpeg 80). The build writes png and webp losslessly, so png is never read and webp is read only by the cloudflare service, as the quality of its transform URLs (default 80).",properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" encodes variants at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var Td;var Ll=v(()=>{Td={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var kd,Pd,_d,Md,Dd,Id,Ld,Fd,Vd;var Fl=v(()=>{kd={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},Pd={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},_d={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Md={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Dd={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},Id={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done","#/$map/item/text"],pattern:String.raw`^(#/)?\$map/(item|index)(/.*)?$`,type:"string"},Ld={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Fd={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},Vd={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var Wd;var Vl=v(()=>{Wd={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var Hd,Bd;var Wl=v(()=>{Hd={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item, in either spelling ($map/item/id or #/$map/item/id). A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^(#/)?\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Bd={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var qd,Ud,zd,Kd,Gd,Yd;var Hl=v(()=>{qd={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},Ud={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},zd={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},Kd={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},Gd={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},Yd={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var Xd;var Bl=v(()=>{Xd={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var Zd;var ql=v(()=>{Zd={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive; declaring both is an error. First parameter is always state (the reactive scope).',not:{required:["body","$src"]},properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: a source string in erasable TypeScript, which plain JavaScript already is (spec §23.1; types are erased before it is analysed or run; first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → source string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',"const input = event.target as HTMLInputElement; state.label = input.value",[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var Qd,em;var Ul=v(()=>{Qd={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},em={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var ii,tm;var zl=v(()=>{ii=["Function","Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream"],tm={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var nm;var Kl=v(()=>{nm={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var rm,sm,om,im,am,lm,cm,um,pm,fm,dm,mm,gm,hm,ym,xm,bm;var Gl=v(()=>{Po();rm={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},sm={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},om={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},im={enum:["!","-"]},am={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},lm={const:"?:"},cm={const:"switch"},um={const:"call"},pm={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},fm={enum:["=","+=","-=","*=","/="]},dm={enum:["pop","shift"]},mm={enum:["push","unshift"]},gm={const:"splice"},hm={const:"reduce"},ym={enum:["map","filter"]},xm={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${sl()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},bm={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var $m,Sm,wm,Em;var Yl=v(()=>{$m={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},Sm={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},wm={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Em={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var Xl,vm,Jm,Om,jm,Am,Cm,Nm,Rm,Tm,km;var Zl=v(()=>{Xl=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],vm={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},Jm={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},Om={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},jm={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:Xl,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},Am={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},Cm={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Nm={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Rm={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},Tm={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},km={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});function un(e){if(!y(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Lb(e){let t=un(e);if(t===null)return"ltr";let n=new Intl.Locale(t),r=n.script??n.maximize().script;return r!==void 0&&Pm.has(r)?"rtl":"ltr"}function Fb(e){let t=un(e);if(t===null)return y(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Vb(e){let t=e.i18n,n=[];if(!j(t))return{errors:n,i18n:null};let r=Array.isArray(t.locales)?t.locales:[],s=[];for(let c of r){let a=un(c);if(a===null){n.push(`i18n.locales: "${String(c)}" is not a well-formed BCP 47 language tag.`);continue}if(!s.includes(a))s.push(a)}let o=un(t.defaultLocale)??s[0]??null;if(t.defaultLocale!==void 0&&un(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(o===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};let i=[o,...s.filter((c)=>c!==o)],l=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:_m;return{errors:n,i18n:{defaultLocale:o,locales:i,routing:l}}}function Wb(e,t){if(t===null)return null;let n=e.split("/").find(Boolean);if(n===void 0)return t.defaultLocale;let r=un(n);return r!==null&&t.locales.includes(r)?r:t.defaultLocale}var Pm,ts="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",_m="prefix-except-default";var Ql=v(()=>{K();Pm=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});var ec,tc="utf-8",Mm;var nc=v(()=>{Ql();ec=[301,302,303,307,308],Mm={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"JSON Schema type definitions, tooling only. A document's #/$defs/Name reference resolves here when the document does not define Name itself.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"},sources:{additionalProperties:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:"Add sources to a computed directive without restating it. Each entry is appended after the derived sources (the script hashes and collected origins stay), skipped if already present. A directive the policy does not carry is created from the one a browser falls back to, `default-src` for the fetch directives. For origins that arrive only at runtime. A directive named here and in `directives` is a build error.",propertyNames:{pattern:"^[A-Za-z][A-Za-z0-9-]*$"},type:"object"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:tc,description:"The <meta charset> every page declares. The HTML Standard allows only utf-8, which is the default.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:ts,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:ts,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:ts,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...ec],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});var Dm;var rc=v(()=>{Dm={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var zb="https://jxsuite.com/schema/project/fields/v2",Kb="https://jxsuite.com/schema/document/paths/v2",Im,Lm,Gb,Yb;var sc=v(()=>{Im={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},Lm={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},Gb=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{additionalProperties:!1,description:"Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",properties:{each:{description:"Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",type:["object","array"]},pageSize:{description:"Items on each page.",minimum:1,type:"integer"},paginate:{additionalProperties:!1,description:"The state entry to page.",properties:{$ref:{description:"A pointer to an entry of this page's state: `#/state/<key>`.",pattern:"^#/state/[^/]+$",type:"string"}},required:["$ref"],type:"object"}},required:["paginate","pageSize"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],Yb={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});var oc=v(()=>{kl();Pl();_l();Ml();Dl();Il();Ll();Fl();Vl();Wl();Hl();Bl();ql();Ul();zl();Kl();Gl();Yl();Zl();nc();rc();sc()});function ic(e,t,n){let r=e.$description;if(y(r))(Object.keys(t).length>0?t:n).$description=r}function ac(e,t,n,r,s=Fm,o={}){let i=[],l=(p,d)=>{let x={mediaQueries:t,scope:d,transposeValue:n};if(r)x.resolveValue=(w,g)=>r(w,g,d);for(let w of nn(p,x))i.push(o.comments===!0?zn(w):w.text)},c={},a={},u=[],f=[];for(let[p,d]of Object.entries(e)){if(j(d)&&!Array.isArray(d)){if(p.startsWith("@"))u.push([p,d]);else if(!p.startsWith("--"))f.push([p,d]);continue}if(Un(p)||p.startsWith("@")||p.startsWith("$"))continue;if(p.startsWith("--")||p==="colorScheme"||p==="color-scheme")c[p]=d;else a[p]=d}ic(e,c,a),l(c,s.root),l(a,s.body);for(let[p,d]of f)if(p.startsWith("&"))l({[p]:d},s.root);else l(d,p);for(let[p,d]of u){if(Bn(p)||qn(p)){l({[p]:d},null);continue}let x={},w={},g=[];for(let[m,b]of Object.entries(d)){if(j(b)&&!Array.isArray(b)){if(!m.startsWith("@"))g.push([m,b]);continue}if(m.startsWith("$"))continue;if(m.startsWith("--"))x[m]=b;else w[m]=b}ic(d,x,w),l({[p]:x},s.root),l({[p]:w},s.body);for(let[m,b]of g)l({[p]:b},m)}if(Object.values(t).some((p)=>ft(p)!==null)&&!("colorScheme"in e))i.push(`${s.root} { color-scheme: light dark }`,`${s.root}:where([${ze}="light"]) { color-scheme: light }`,`${s.root}:where([${ze}="dark"]) { color-scheme: dark }`);return i.join(`
13
+ `)}var Yr=v(()=>{K();an()});var zo=v(()=>{K()});function Xo(e){if(e===sd)return"client";if(e===od)return"server";return null}function id(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"")}function Sl(e,t){return`${Yo}${id(e)}#${t}`}function wl(e){return e.startsWith(Yo)}function El(e){if(!wl(e))return null;let t=e.slice(Yo.length),n=t.lastIndexOf("#");if(n<=0)return null;let r=t.slice(n+1);if(r!=="client"&&r!=="server")return null;return{path:t.slice(0,n),side:r}}function Ko(e,t){if(Array.isArray(e)){let r=e.map((s)=>Ko(s,t));return r.some((s,o)=>s!==e[o])?r:e}if(!A(e))return e;let n=null;for(let[r,s]of Object.entries(e)){let o=s;if(r==="$src"&&y(s)){let i=Xo(s);o=i===null?s:Sl(t,i)}else if(r!=="$script")o=Ko(s,t);if(o!==s)n??={...e},n[r]=o}return n===null?e:n}function Zo(e,t){return Ko(e,t)}function cd(e){return ad.test(e)&&!ld.test(e)}function $l(e){return Xo(e)==="client"||El(e)?.side==="client"}function Go(e,t,n){if(Array.isArray(e)){for(let[r,s]of e.entries())Go(s,[...t,r],n);return n}if(!A(e))return n;if(y(e.$src))n.push({lazy:e.$lazy===!0,path:t,src:e.$src});for(let[r,s]of Object.entries(e))if(r!=="$script")Go(s,[...t,r],n);return n}function ud(e){let t=e.at(-1);return y(t)?`"${t}"`:"this entry"}function Fx(e){let t=Go(e,[],[]),n=t.some((s)=>!s.lazy&&$l(s.src)),r=[];for(let s of t){let o=ud(s.path);if(!s.lazy&&cd(s.src))r.push({detail:'A module only this document uses can be the document\'s own script: move the code into the client script (the server script for a `timing: "server"` entry) and name it with `$src: "#client"` or `$src: "#server"`. A module several documents import stays a file, and this one keeps working as it is.',message:`${o} imports ${s.src}, which the document could carry as its own script`,path:s.path,rule:"relative-src"});else if(s.lazy&&n&&$l(s.src))r.push({detail:"A document has one client script, and another entry imports it as the page loads, so `$lazy` defers nothing here. Move this export to a `$src` module of its own to load it on its first call.",message:`${o} is $lazy, but the script it is in loads with the page`,path:s.path,rule:"lazy-shares-script"})}return r}var Yo="jx-script:",sd="#client",od="#server",ad,ld;var Qo=v(()=>{K();ad=/^\.{1,2}\//u,ld=/\.json$/iu});function gd(e){for(let t of Object.keys(e))if(md.has(t))return!0;return!1}function Xr(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let[t,...n]=Ta(e);return t!==void 0&&n.length===0&&t.start===0&&t.end===e.length}function Ol(){return[...Jl].toSorted()}function ot(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Jl.has(n))return String(t);return t?"":null}function jl(e,t,n){if(!Array.isArray(e))return[];let r=e;if(je(t))r=r.filter(t);if(je(n))r=[...r].toSorted(n);return r}function Al(e,t,n,r){let s=Qt(t);if(r?.has(s)&&r.get(s)===void 0)return;let o=e[s];if(le(o)){e[s]=n!==null&&n!=="false";return}if(n===null){let i=r?.get(s);e[s]=i===void 0?Y(o)?0:"":i;return}e[s]=Y(o)?Number(n):n}function ei(e){let t=vl.get(e);if(t)return t;let n=new Set,r=rt(e);for(let[s,o]of Object.entries(e.state??{}))if(y(o)?B(o):Ne(o)?!et(o)&&!Ke(o.$expression.operator):r.get(s)==="computed")n.add(s);return vl.set(e,n),n}function Cl(e){let t=e.state??{},n=ei(e),r=(s)=>(s in t)&&!n.has(s);return{checked:r("checked"),disabled:r("disabled"),required:r("required"),value:r("value")}}function ti(e){let t=new Map;for(let[n,r]of Object.entries(e.state??{})){if(y(r)&&B(r)){t.set(n,void 0);continue}if(j(r)&&!Array.isArray(r)){if("default"in r){t.set(n,r.default);continue}if(hd.some((s)=>(s in r))){t.set(n,void 0);continue}if(gd(r))continue}t.set(n,r)}return t}var md,Ge,Jl,pb,vl,hd,ni=32,Zr,Qr="jx-slot",ri="data-jx-slots",si="jx.slot.group",fb;var Yn=v(()=>{Kn();an();rn();K();en();Gr();Yr();zo();Qo();zo();Kn();md=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]);Ge=new Set(["$schema","$shadow","formAssociated","formValue","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$script","$media","$map","timing","default","description","body","parameters","arguments","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),Jl=new Set(["contenteditable","draggable","spellcheck"]);pb=Object.freeze({emptyRow:!0});vl=new WeakMap;hd=["$expression","$prototype","$ref","$src"],Zr=/^[\t\n\f\r ]+$/u,fb=(()=>{let e=Symbol.for(si),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function bd(){if(!Xn){Xn=new Map;for(let[e,t,n]of xd){let r=Xn.get(e);if(!r)r=new Map,Xn.set(e,r);for(let s of t.split(" "))r.set(s,n)}}return Xn}function Rl(e,t){return Nl??=new Map(yd),Nl.get(t)??bd().get(t)?.get(e.toLowerCase())??null}function oi(e,t){if(t==="innerText")return!0;if(t==="value"||t==="defaultValue")return $d.has(e.toLowerCase());return t==="text"&&Sd.has(e.toLowerCase())}var h=(e,t={})=>({attribute:e,kind:"text",...t}),D=(e,t={})=>({attribute:e,kind:"boolean",...t}),es,yd,xd,Nl,Xn,$d,Sd;var Tl=v(()=>{es={live:!0},yd=[["accessKey",h("accesskey")],["ariaAtomic",h("aria-atomic")],["ariaAutoComplete",h("aria-autocomplete")],["ariaBrailleLabel",h("aria-braillelabel")],["ariaBrailleRoleDescription",h("aria-brailleroledescription")],["ariaBusy",h("aria-busy")],["ariaChecked",h("aria-checked")],["ariaColCount",h("aria-colcount")],["ariaColIndex",h("aria-colindex")],["ariaColIndexText",h("aria-colindextext")],["ariaColSpan",h("aria-colspan")],["ariaCurrent",h("aria-current")],["ariaDescription",h("aria-description")],["ariaDisabled",h("aria-disabled")],["ariaExpanded",h("aria-expanded")],["ariaHasPopup",h("aria-haspopup")],["ariaHidden",h("aria-hidden")],["ariaInvalid",h("aria-invalid")],["ariaKeyShortcuts",h("aria-keyshortcuts")],["ariaLabel",h("aria-label")],["ariaLevel",h("aria-level")],["ariaLive",h("aria-live")],["ariaModal",h("aria-modal")],["ariaMultiLine",h("aria-multiline")],["ariaMultiSelectable",h("aria-multiselectable")],["ariaOrientation",h("aria-orientation")],["ariaPlaceholder",h("aria-placeholder")],["ariaPosInSet",h("aria-posinset")],["ariaPressed",h("aria-pressed")],["ariaReadOnly",h("aria-readonly")],["ariaRelevant",h("aria-relevant")],["ariaRequired",h("aria-required")],["ariaRoleDescription",h("aria-roledescription")],["ariaRowCount",h("aria-rowcount")],["ariaRowIndex",h("aria-rowindex")],["ariaRowIndexText",h("aria-rowindextext")],["ariaRowSpan",h("aria-rowspan")],["ariaSelected",h("aria-selected")],["ariaSetSize",h("aria-setsize")],["ariaSort",h("aria-sort")],["ariaValueMax",h("aria-valuemax")],["ariaValueMin",h("aria-valuemin")],["ariaValueNow",h("aria-valuenow")],["ariaValueText",h("aria-valuetext")],["autocapitalize",h("autocapitalize")],["autocorrect",D("autocorrect",{keywords:["on","off"]})],["autofocus",D("autofocus")],["className",h("class")],["contentEditable",h("contenteditable")],["dir",h("dir")],["draggable",D("draggable")],["enterKeyHint",h("enterkeyhint")],["headingOffset",h("headingoffset")],["headingReset",D("headingreset")],["hidden",{attribute:"hidden",kind:"hidden"}],["id",h("id")],["inert",D("inert")],["inputMode",h("inputmode")],["lang",h("lang")],["popover",h("popover")],["role",h("role")],["slot",h("slot")],["spellcheck",D("spellcheck")],["tabIndex",h("tabindex")],["title",h("title")],["translate",D("translate",{keywords:["yes","no"]})],["writingSuggestions",h("writingsuggestions")]],xd=[["aLink","body",h("alink")],["abbr","td th",h("abbr")],["accept","input",h("accept")],["acceptCharset","form",h("accept-charset")],["action","form",h("action")],["align","caption col colgroup div embed h1 h2 h3 h4 h5 h6 hr iframe img input legend object p table tbody td tfoot th thead tr",h("align")],["allow","iframe",h("allow")],["allowFullscreen","iframe",D("allowfullscreen")],["alpha","input",D("alpha")],["alt","area img input",h("alt")],["archive","object",h("archive")],["as","link",h("as")],["async","script",D("async")],["autocomplete","form input select textarea",h("autocomplete")],["autoplay","audio video",D("autoplay")],["axis","td th",h("axis")],["background","body",h("background")],["behavior","marquee",h("behavior")],["bgColor","body marquee table td th tr",h("bgcolor")],["border","img object table",h("border")],["cellPadding","table",h("cellpadding")],["cellSpacing","table",h("cellspacing")],["ch","col colgroup tbody td tfoot th thead tr",h("char")],["chOff","col colgroup tbody td tfoot th thead tr",h("charoff")],["charset","a link script",h("charset")],["checked","input",D("checked",es)],["cite","blockquote del ins q",h("cite")],["clear","br",h("clear")],["closedBy","dialog",h("closedby")],["code","object",h("code")],["codeBase","object",h("codebase")],["codeType","object",h("codetype")],["colSpan","td th",h("colspan")],["color","font hr",h("color")],["colorSpace","input",h("colorspace")],["cols","frameset textarea",h("cols")],["command","button",h("command")],["compact","dir dl menu ol ul",D("compact")],["content","meta",h("content")],["controls","audio img video",D("controls")],["coords","a area",h("coords")],["crossOrigin","audio img link script video",h("crossorigin")],["data","object",h("data")],["dateTime","del ins time",h("datetime")],["declare","object",D("declare")],["decoding","img",h("decoding")],["default","track",D("default")],["defaultChecked","input",D("checked")],["defaultMuted","audio video",D("muted")],["defaultSelected","option",D("selected")],["defaultValue","input",h("value")],["defer","script",D("defer")],["dirName","input textarea",h("dirname")],["direction","marquee",h("direction")],["disabled","button fieldset input link optgroup option select textarea",D("disabled")],["download","a area",h("download")],["encoding","form",h("enctype")],["enctype","form",h("enctype")],["event","script",h("event")],["face","font",h("face")],["fetchPriority","img link script",h("fetchpriority")],["formAction","button input",h("formaction")],["formEnctype","button input",h("formenctype")],["formMethod","button input",h("formmethod")],["formNoValidate","button input",D("formnovalidate")],["formTarget","button input",h("formtarget")],["frame","table",h("frame")],["frameBorder","frame iframe",h("frameborder")],["headers","td th",h("headers")],["height","canvas embed iframe img input marquee object source td th video",h("height")],["high","meter",h("high")],["href","a area base link",h("href")],["hreflang","a area link",h("hreflang")],["hspace","embed img input marquee object",h("hspace")],["htmlFor","label script template",h("for")],["httpEquiv","meta",h("http-equiv")],["imageSizes","link",h("imagesizes")],["imageSrcset","link",h("imagesrcset")],["integrity","link script",h("integrity")],["isMap","img",D("ismap")],["kind","track",h("kind")],["label","optgroup option track",h("label")],["link","body",h("link")],["loading","audio iframe img video",h("loading")],["longDesc","frame iframe img",h("longdesc")],["loop","audio video",D("loop")],["low","meter",h("low")],["lowsrc","img",h("lowsrc")],["marginHeight","frame iframe",h("marginheight")],["marginWidth","frame iframe",h("marginwidth")],["max","input meter progress",h("max")],["maxLength","input textarea",h("maxlength")],["media","link meta source style",h("media")],["method","form",h("method")],["min","input meter",h("min")],["minLength","input textarea",h("minlength")],["multiple","input select",D("multiple")],["muted","audio video",D("muted",es)],["name","a button details embed fieldset form frame iframe img input map meta object output param select slot textarea",h("name")],["noHref","area",D("nohref")],["noModule","script",D("nomodule")],["noResize","frame",D("noresize")],["noShade","hr",D("noshade")],["noValidate","form",D("novalidate")],["noWrap","td th",D("nowrap")],["open","details dialog",D("open")],["optimum","meter",h("optimum")],["pattern","input",h("pattern")],["ping","a area",h("ping")],["placeholder","input textarea",h("placeholder")],["playsInline","video",D("playsinline")],["popoverTargetAction","button input",h("popovertargetaction")],["poster","video",h("poster")],["preload","audio video",h("preload")],["readOnly","input textarea",D("readonly")],["referrerPolicy","a area iframe img link script",h("referrerpolicy")],["rel","a area form link",h("rel")],["required","input select textarea",D("required")],["rev","a link",h("rev")],["reversed","ol",D("reversed")],["rowSpan","td th",h("rowspan")],["rows","frameset textarea",h("rows")],["rules","table",h("rules")],["scheme","meta",h("scheme")],["scope","td th",h("scope")],["scrollAmount","marquee",h("scrollamount")],["scrollDelay","marquee",h("scrolldelay")],["scrolling","frame iframe",h("scrolling")],["selected","option",D("selected",es)],["shadowRootClonable","template",D("shadowrootclonable")],["shadowRootCustomElementRegistry","template",h("shadowrootcustomelementregistry")],["shadowRootDelegatesFocus","template",D("shadowrootdelegatesfocus")],["shadowRootMode","template",h("shadowrootmode")],["shadowRootSerializable","template",D("shadowrootserializable")],["shadowRootSlotAssignment","template",h("shadowrootslotassignment")],["shape","a area",h("shape")],["size","font hr input select",h("size")],["sizes","img source",h("sizes")],["span","col colgroup",h("span")],["src","audio embed frame iframe img input source track video",h("src")],["srcdoc","iframe",h("srcdoc")],["srclang","track",h("srclang")],["srcset","img source",h("srcset")],["standby","object",h("standby")],["start","ol",h("start")],["step","input",h("step")],["summary","table",h("summary")],["target","a area base form link",h("target")],["text","body",h("text")],["trueSpeed","marquee",D("truespeed")],["type","a area button embed input li link object ol param script source style ul",h("type")],["useMap","img input object",h("usemap")],["vAlign","col colgroup tbody td tfoot th thead tr",h("valign")],["vLink","body",h("vlink")],["value","button data li meter option param progress",h("value")],["value","input",h("value",es)],["valueType","param",h("valuetype")],["version","html",h("version")],["vspace","embed img input marquee object",h("vspace")],["width","canvas col colgroup embed hr iframe img input listing marquee object pre source table td th video xmp",h("width")],["wrap","textarea",h("wrap")]];$d=new Set(["output","textarea"]),Sd=new Set(["a","option","title"])});var wd,Ed;var kl=v(()=>{wd={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},Ed={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var vd;var Pl=v(()=>{vd={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var Jd,Od,jd;var _l=v(()=>{Jd={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},Od={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},jd={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var Ad;var Ml=v(()=>{Ad={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var Cd,Nd;var Dl=v(()=>{Cd={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},Nd={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var Rd;var Il=v(()=>{Rd={description:"Image optimization configuration for the project.",properties:{formats:{description:'Output formats, each one of "avif", "jpeg", "png" or "webp" (default ["avif", "jpeg"]). AVIF and JPEG are lossy; PNG and WebP are written losslessly, so listing WebP produces larger files than either. A source with transparency is written as PNG wherever JPEG is listed.',items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{description:"Lossy quality per format, 1 to 100 (defaults: avif 65, jpeg 80). The build writes png and webp losslessly, so png is never read and webp is read only by the cloudflare service, as the quality of its transform URLs (default 80).",properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" encodes variants at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var Td;var Ll=v(()=>{Td={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var kd,Pd,_d,Md,Dd,Id,Ld,Fd,Vd;var Fl=v(()=>{kd={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},Pd={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},_d={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Md={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Dd={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},Id={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done","#/$map/item/text"],pattern:String.raw`^(#/)?\$map/(item|index)(/.*)?$`,type:"string"},Ld={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Fd={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},Vd={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var Wd;var Vl=v(()=>{Wd={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var Hd,Bd;var Wl=v(()=>{Hd={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item, in either spelling ($map/item/id or #/$map/item/id). A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^(#/)?\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Bd={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var qd,Ud,zd,Kd,Gd,Yd;var Hl=v(()=>{qd={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},Ud={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},zd={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},Kd={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},Gd={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},Yd={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var Xd;var Bl=v(()=>{Xd={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var Zd;var ql=v(()=>{Zd={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive; declaring both is an error. First parameter is always state (the reactive scope).',not:{required:["body","$src"]},properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: a source string in erasable TypeScript, which plain JavaScript already is (spec §23.1; types are erased before it is analysed or run; first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → source string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',"const input = event.target as HTMLInputElement; state.label = input.value",[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var Qd,em;var Ul=v(()=>{Qd={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},em={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var ii,tm;var zl=v(()=>{ii=["Function","Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream"],tm={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var nm;var Kl=v(()=>{nm={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var rm,sm,om,im,am,lm,cm,um,pm,fm,dm,mm,gm,hm,ym,xm,bm;var Gl=v(()=>{Po();rm={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},sm={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},om={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},im={enum:["!","-"]},am={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},lm={const:"?:"},cm={const:"switch"},um={const:"call"},pm={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},fm={enum:["=","+=","-=","*=","/="]},dm={enum:["pop","shift"]},mm={enum:["push","unshift"]},gm={const:"splice"},hm={const:"reduce"},ym={enum:["map","filter"]},xm={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${sl()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},bm={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var $m,Sm,wm,Em;var Yl=v(()=>{$m={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},Sm={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},wm={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Em={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var Xl,vm,Jm,Om,jm,Am,Cm,Nm,Rm,Tm,km;var Zl=v(()=>{Xl=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],vm={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},Jm={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},Om={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},jm={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{description:"The member's body in erasable TypeScript, which plain JavaScript already is (spec §23.1), as one string or as an array of lines.",oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:Xl,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},Am={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},Cm={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Nm={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Rm={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},Tm={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},km={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});function un(e){if(!y(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Lb(e){let t=un(e);if(t===null)return"ltr";let n=new Intl.Locale(t),r=n.script??n.maximize().script;return r!==void 0&&Pm.has(r)?"rtl":"ltr"}function Fb(e){let t=un(e);if(t===null)return y(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Vb(e){let t=e.i18n,n=[];if(!j(t))return{errors:n,i18n:null};let r=Array.isArray(t.locales)?t.locales:[],s=[];for(let c of r){let a=un(c);if(a===null){n.push(`i18n.locales: "${String(c)}" is not a well-formed BCP 47 language tag.`);continue}if(!s.includes(a))s.push(a)}let o=un(t.defaultLocale)??s[0]??null;if(t.defaultLocale!==void 0&&un(t.defaultLocale)===null)n.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(o===null)return n.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:n,i18n:null};let i=[o,...s.filter((c)=>c!==o)],l=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:_m;return{errors:n,i18n:{defaultLocale:o,locales:i,routing:l}}}function Wb(e,t){if(t===null)return null;let n=e.split("/").find(Boolean);if(n===void 0)return t.defaultLocale;let r=un(n);return r!==null&&t.locales.includes(r)?r:t.defaultLocale}var Pm,ts="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",_m="prefix-except-default";var Ql=v(()=>{K();Pm=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});var ec,tc="utf-8",Mm;var nc=v(()=>{Ql();ec=[301,302,303,307,308],Mm={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"JSON Schema type definitions, tooling only. A document's #/$defs/Name reference resolves here when the document does not define Name itself.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"},sources:{additionalProperties:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:"Add sources to a computed directive without restating it. Each entry is appended after the derived sources (the script hashes and collected origins stay), skipped if already present. A directive the policy does not carry is created from the one a browser falls back to, `default-src` for the fetch directives. For origins that arrive only at runtime. A directive named here and in `directives` is a build error.",propertyNames:{pattern:"^[A-Za-z][A-Za-z0-9-]*$"},type:"object"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:tc,description:"The <meta charset> every page declares. The HTML Standard allows only utf-8, which is the default.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},format:{default:"jxn",description:"The native notation Studio writes new documents in: `jxn` (Jx Notation) or `json`. Both are read everywhere; this decides only what is created.",enum:["jxn","json"],type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:ts,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:ts,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:ts,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...ec],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});var Dm;var rc=v(()=>{Dm={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var zb="https://jxsuite.com/schema/project/fields/v2",Kb="https://jxsuite.com/schema/document/paths/v2",Im,Lm,Gb,Yb;var sc=v(()=>{Im={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},Lm={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},Gb=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{additionalProperties:!1,description:"Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",properties:{each:{description:"Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",type:["object","array"]},pageSize:{description:"Items on each page.",minimum:1,type:"integer"},paginate:{additionalProperties:!1,description:"The state entry to page.",properties:{$ref:{description:"A pointer to an entry of this page's state: `#/state/<key>`.",pattern:"^#/state/[^/]+$",type:"string"}},required:["$ref"],type:"object"}},required:["paginate","pageSize"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],Yb={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});var oc=v(()=>{kl();Pl();_l();Ml();Dl();Il();Ll();Fl();Vl();Wl();Hl();Bl();ql();Ul();zl();Kl();Gl();Yl();Zl();nc();rc();sc()});function ic(e,t,n){let r=e.$description;if(y(r))(Object.keys(t).length>0?t:n).$description=r}function ac(e,t,n,r,s=Fm,o={}){let i=[],l=(p,d)=>{let x={mediaQueries:t,scope:d,transposeValue:n};if(r)x.resolveValue=(w,g)=>r(w,g,d);for(let w of nn(p,x))i.push(o.comments===!0?zn(w):w.text)},c={},a={},u=[],f=[];for(let[p,d]of Object.entries(e)){if(j(d)&&!Array.isArray(d)){if(p.startsWith("@"))u.push([p,d]);else if(!p.startsWith("--"))f.push([p,d]);continue}if(Un(p)||p.startsWith("@")||p.startsWith("$"))continue;if(p.startsWith("--")||p==="colorScheme"||p==="color-scheme")c[p]=d;else a[p]=d}ic(e,c,a),l(c,s.root),l(a,s.body);for(let[p,d]of f)if(p.startsWith("&"))l({[p]:d},s.root);else l(d,p);for(let[p,d]of u){if(Bn(p)||qn(p)){l({[p]:d},null);continue}let x={},w={},g=[];for(let[m,b]of Object.entries(d)){if(j(b)&&!Array.isArray(b)){if(!m.startsWith("@"))g.push([m,b]);continue}if(m.startsWith("$"))continue;if(m.startsWith("--"))x[m]=b;else w[m]=b}ic(d,x,w),l({[p]:x},s.root),l({[p]:w},s.body);for(let[m,b]of g)l({[p]:b},m)}if(Object.values(t).some((p)=>ft(p)!==null)&&!("colorScheme"in e))i.push(`${s.root} { color-scheme: light dark }`,`${s.root}:where([${ze}="light"]) { color-scheme: light }`,`${s.root}:where([${ze}="dark"]) { color-scheme: dark }`);return i.join(`
14
14
  `)}var Fm;var lc=v(()=>{Kn();K();Fm={body:"body",root:":root"}});function uc(e){return Vm.has(e.toLowerCase())?"block":"inline"}function pc(e){let t=e;for(let r=cc.exec(t);r;r=cc.exec(t))t=t.slice(r[0].length);if(t==="")return null;let n=Wm.exec(t);return n?uc(n[1]):"text"}function fc(e){let t=e;while(t.endsWith("-->")){let r=t.lastIndexOf("<!--");if(r===-1)break;t=t.slice(0,r)}if(t==="")return null;let n=Hm.exec(t)??Bm.exec(t);return n?uc(n[1]):"text"}function qm(e,t){let n=fc(e),r=pc(t);if(n===null||r===null)return!1;return n!=="text"&&r!=="text"&&(n==="block"||r==="block")}function Ce(e,t={}){let{lead:n="",preformatted:r=!1,separator:s=`
15
15
  `}=t;if(r)return e.join("");let o=e.filter((l)=>l!==""&&l!==n),i="";for(let[l,c]of o.entries()){if(l===0){i=c;continue}let a=o[l-1],u=ai(c,n);i+=qm(a,u)?`${s}${c}`:u}return i}function ns(e,t){let{close:n,lead:r="",open:s}=t;if(e==="")return e;let o=pc(ai(e,r)),i=fc(e),l=o==="block"?s:"",c=i==="block"?n:"";return`${l}${l===""?ai(e,r):e}${c}`}function li(e,t){let{close:n,open:r,...s}=t,o=Ce(e,s);return s.preformatted?o:ns(o,{close:n,lead:s.lead,open:r})}function ai(e,t){return e.startsWith(t)?e.slice(t.length):e}var Vm,cc,Wm,Hm,Bm;var Zn=v(()=>{Vm=new Set(["address","article","aside","blockquote","body","br","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","optgroup","option","p","plaintext","pre","search","section","summary","table","tbody","td","tfoot","th","thead","tr","ul","xmp"]);cc=/^<!--[\s\S]*?-->/u,Wm=/^<([a-zA-Z][^\s/>]*)/u,Hm=/<\/([a-zA-Z][^\s>]*)\s*>$/u,Bm=/<([a-zA-Z][^\s/<>]*)(?:\s[^<]*)?>$/u});function dc(e,t){return t===null?e:":host"}var rs=v(()=>{Kn()});function or(e,t){let n=[];for(let[r,s]of(e.parameters??[]).entries()){let o=gc(s);if(!o)continue;let i=hc(s)?`_a[${r}] === undefined ? ${JSON.stringify(s.default)} : _a[${r}]`:`_a[${r}]`;n.push(`${JSON.stringify(o)}: ${i}`)}return`(..._a) => { const _args = { ${n.join(", ")} }; return ${t}; }`}function gc(e){return y(e)?e:e?.name??""}function hc(e){return j(e)&&"default"in e}function Um(e,t){let n=yc(e,t);return n===e?e:`${n} as ${e}`}function yc(e,t){let n=t?.$export;return y(n)&&n!==""?n:e}function cs(e,t,n={}){let{statePrefix:r="state",indent:s="",collect:o}=n,{url:i}=t,l=B(i),c=t.method??"GET";if(t.manual)return`${s}// ${e}: manual Request — fetch triggered by user action`;let a=[`// ${e}: auto-fetch from ${l?"(dynamic URL)":i}`,o?`${o}.push(effect(() => {`:"effect(() => {"];if(l)a.push(` const url = \`${Km(i,r)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else a.push(` const url = ${JSON.stringify(i)};`);let u=[];if(c!=="GET")u.push(`method: ${JSON.stringify(c)}`);if(t.headers)u.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let p=j(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);u.push(`body: ${p}`)}let f=u.length>0?`, { ${u.join(", ")} }`:"";return a.push(` fetch(url${f})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${r}.${e} = d; })`,` .catch(e => { ${r}.${e} = { error: String(e) }; });`,o?"}));":"});"),a.map((p)=>`${s}${p}`).join(`
16
16
  `)}function us(e,t,n={}){let{statePrefix:r="state",indent:s="",collect:o,serverBaseUrl:i="/_jx/server"}=n,l=JSON.stringify(`${i}/${t.$export}`),c=Object.entries(t.arguments??{}),a=c.map(([w,g])=>{if(!_(g))return`${mt(w)}: ${JSON.stringify(g)}`;if(zm.some((m)=>g.$ref.startsWith(m)))throw Error(`Server function "${e}": argument "${w}" references "${g.$ref}", which a state entry cannot read. Use a #/state/, parent#/, window#/ or document#/ reference.`);return`${mt(w)}: ${gt({$ref:g.$ref},{statePrefix:r})}`}),u=c.some(([,w])=>_(w)),f=`${kc}(${l}, ${a.length>0?`{ ${a.join(", ")} }`:"{}"})`,p=U(r,xe(e)),d=`console.error(${JSON.stringify(`Jx server function ${t.$export}:`)}, e)`;return(u?[`// ${e}: server function ${t.$export}, called again when an argument changes`,"{"," let _jxSeq = 0;",o?` ${o}.push(effect(() => {`:" effect(() => {"," const _seq = ++_jxSeq;",` ${f}`,` .then((d) => { if (_seq === _jxSeq) ${p} = d; })`,` .catch((e) => { if (_seq === _jxSeq) ${d}; });`,o?" }));":" });","}"]:[`// ${e}: server function ${t.$export}, called once`,f,` .then((d) => { ${p} = d; })`,` .catch((e) => { ${d}; });`]).map((w)=>`${s}${w}`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/compiler",
3
- "version": "11.1.0",
3
+ "version": "11.1.2",
4
4
  "description": "Jx static HTML compiler, island detector, and site builder",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -56,19 +56,19 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@jxsuite/compiler-binding": "^0.3.0",
59
- "@jxsuite/create": "^1.8.6",
60
- "@jxsuite/erase": "^0.3.5",
61
- "@jxsuite/runtime": "^9.0.1",
62
- "@jxsuite/schema": "^8.1.0",
63
- "@jxsuite/site": "^4.1.0",
64
- "@vue/reactivity": "3.5.45",
59
+ "@jxsuite/create": "^1.8.8",
60
+ "@jxsuite/erase": "^0.3.7",
61
+ "@jxsuite/runtime": "^9.0.3",
62
+ "@jxsuite/schema": "^8.2.1",
63
+ "@jxsuite/site": "^4.1.2",
64
+ "@vue/reactivity": "3.5.46",
65
65
  "esbuild": "^0.28.2",
66
66
  "lit-html": "^3.3.3"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@happy-dom/global-registrator": "^21.0.4",
70
- "@jxsuite/connector": "^0.8.14",
71
- "@jxsuite/parser": "^5.2.1",
70
+ "@jxsuite/connector": "^0.8.16",
71
+ "@jxsuite/parser": "^5.2.3",
72
72
  "@jxsuite/test-support": "^0.0.0",
73
73
  "@types/mdast": "^4.0.4"
74
74
  },