@jxsuite/compiler 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,60 +1,62 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as yA}from"node:module";var EA=Object.create;var{getPrototypeOf:RA,defineProperty:DZ,getOwnPropertyNames:PA}=Object;var CA=Object.prototype.hasOwnProperty;function SA($){return this[$]}var _A,xA,B$=($,Z,X)=>{var Q=$!=null&&typeof $==="object";if(Q){var J=Z?_A??=new WeakMap:xA??=new WeakMap,G=J.get($);if(G)return G}X=$!=null?EA(RA($)):{};let W=Z||!$||!$.__esModule?DZ(X,"default",{value:$,enumerable:!0}):X;for(let Y of PA($))if(!CA.call(W,Y))DZ(W,Y,{get:SA.bind($,Y),enumerable:!0});if(Q)J.set($,W);return W};var b=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var bA=($)=>$;function kA($,Z){this[$]=bA.bind(null,Z)}var h6=($,Z)=>{for(var X in Z)DZ($,X,{get:Z[X],enumerable:!0,configurable:!0,set:kA.bind(Z,X)})};var t=($,Z)=>()=>($&&(Z=$($=0)),Z);var w0=yA(import.meta.url);function wZ($){let Z=$.$map;return Z&&typeof Z==="object"?Z:void 0}function vJ($){return $.startsWith("window#/")&&gA.has($.slice(8))}function U1($){return bJ.has($)}function h0($,Z){if(!$)return;let X=($.depth??0)+1;if(X>hA)return;return{depth:X,path:[...$.path??[],...Array.isArray(Z)?Z:[Z]],report:$.report}}function v0($,Z,X,Q,J){if($===null||$===void 0)return $;if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return u$($,Z,X,Q,J);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $){let G=gJ($.$ref,Z,X,Q);return J?.report(J.path??[],G),G}if(Array.isArray($))return $.map((G,W)=>v0(G,Z,X,Q,h0(J,W)));return J?.report(J.path??[],$),$}function gJ($,Z,X,Q){if($==="$reduce/acc")return Q?.acc;if($.startsWith("$reduce/"))return Q?.acc;if($.startsWith("$args/")){let J=$.slice(6).split("/"),G=Q?.args?.[J[0]];return J.length>1?u6(G,J.slice(1).join("/")):G}if($.startsWith("event#/")){let J=$.slice(7);return u6(X,J)}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=wZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];return J.length>2?u6(W,J.slice(2).join("/")):W}if($.startsWith("#/state/")){let J=$.slice(8),G=J.indexOf("/");if(G===-1)return Z[J];return u6(Z[J.slice(0,G)],J.slice(G+1))}if($.startsWith("parent#/"))return Z[$.slice(8)];if($.startsWith("window#/"))return u6(globalThis.window,$.slice(8));if($.startsWith("document#/"))return u6(globalThis.document,$.slice(10));return Z[$]??null}function uA($,Z,X,Q){if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=wZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];if(J.length>2){let z=J.slice(2),q=z.pop(),H=z.length>0?u6(W,z.join("/")):W;return{key:q,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:wZ(Z)??Z}}if($.startsWith("#/state/")){let J=$.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:Z};let W=J.split("/"),Y=W.pop(),z=Z;for(let q of W)z=z[q];return{key:Y,obj:z}}return{key:$,obj:Z}}function u$($,Z,X,Q,J){let G=mA($,Z,X,Q,J);return J?.report(J.path??[],G),G}function mA($,Z,X,Q,J){let{operator:G,target:W,value:Y,initial:z}=$;if(!vA.has(G))throw Error(`$expression: unknown operator "${G}"`);if(TZ.has(G)&&!("value"in $)){let q=v0(W,Z,X,Q,h0(J,"target"));if(G==="!")return!q;if(G==="-")return-q}if(G==="call"){let q=W?.$ref;if(typeof q!=="string")throw TypeError("$expression: call target must be a $ref pointer");let H=(Q?.callDepth??0)+1;if(H>_J)throw Error(`$expression: call depth exceeded (${_J})`);let B=Array.isArray(Y)?Y.map((M,A)=>v0(M,Z,X,Q,h0(J,["value",A]))):[];if(q.startsWith("window#/")){if(!vJ(q))throw Error(`$expression: "${q}" is not a blessed pure global`);let M=q.slice(8),A=fA[M];if(A)return A(...B);let w=u6(globalThis.window,M),D=M.lastIndexOf("/"),j=D===-1?globalThis.window:u6(globalThis.window,M.slice(0,D));return w.apply(j,B)}let L=gJ(q,Z,X,Q);if(typeof L==="function")return L(...B);if(L&&typeof L==="object"&&"$expression"in L){let M=L,A={};for(let[w,D]of(M.parameters??[]).entries()){let j=typeof D==="string"?D:D?.name??"";if(!j)continue;A[j]=B[w]===void 0&&typeof D==="object"&&D!==null&&"default"in D?D.default:B[w]}return u$(M.$expression,Z,X,{args:A,callDepth:H})}throw TypeError(`$expression: call target "${q}" is not callable`)}if(EZ.has(G)){if(G==="?:"){let M=v0(W,Z,X,Q,h0(J,"target"));if(J){let A=v0(Y,Z,X,Q,h0(J,"value")),w=v0(z,Z,X,Q,h0(J,"initial"));return M?A:w}return M?v0(Y,Z,X,Q):v0(z,Z,X,Q)}let q=v0(W,Z,X,Q,h0(J,"target")),H=String(q),B=$.cases??{},L=Object.hasOwn(B,H);if(J){let M;for(let[w,D]of Object.entries(B)){let j=v0(D,Z,X,Q,h0(J,["cases",w]));if(w===H)M=j}let A=v0($.default,Z,X,Q,h0(J,"default"));return L?M:A}return L?v0(B[H],Z,X,Q):v0($.default,Z,X,Q)}if(jZ.has(G)){let q=v0(W,Z,X,Q,h0(J,"target")),H=v0(Y,Z,X,Q,h0(J,"value"));switch(G){case"+":return q+H;case"-":return q-H;case"*":return q*H;case"/":return q/H;case"%":return q%H;case"===":return q===H;case"!==":return q!==H;case"<":return q<H;case"<=":return q<=H;case">":return q>H;case">=":return q>=H;case"&&":return q&&H;case"||":return q||H;case"??":return q??H;default:break}}if(kJ.has(G)){let q=v0(Y,Z,X,Q,h0(J,"value")),{obj:H,key:B}=uA(W.$ref,Z,X,Q);switch(G){case"=":{H[B]=q;break}case"+=":{let L=H[B];H[B]=L+q;break}case"-=":{let L=H[B];H[B]=L-q;break}case"*=":{let L=H[B];H[B]=L*q;break}case"/=":{let L=H[B];H[B]=L/q;break}default:break}return}if(yJ.has(G)){let q=v0(W,Z,X,Q,h0(J,"target"));switch(G){case"push":return q.push(v0(Y,Z,X,Q,h0(J,"value")));case"unshift":return q.unshift(v0(Y,Z,X,Q,h0(J,"value")));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let H=v0(Y,Z,X,Q,h0(J,"value"));return q.splice(...H)}default:break}}if(RZ.has(G)){let q=v0(W,Z,X,Q,h0(J,"target")),H=Y===void 0?[]:Array.isArray(Y)?v0(Y,Z,X,Q,h0(J,"value")):[v0(Y,Z,X,Q,h0(J,"value"))],B=q?.[G];if(typeof B!=="function")return;return B.apply(q,H)}if(OZ.has(G)){let q=v0(W,Z,X,Q,h0(J,"target"));if(G==="reduce"){let H=v0(z,Z,X,Q,h0(J,"initial"));for(let[B,L]of q.entries())H=u$(Y,Z,X,{acc:H,index:B,item:L},B===0?h0(J,"value"):void 0);return H}if(G==="map")return q.map((H,B)=>u$(Y,Z,X,{...Q,index:B,item:H},B===0?h0(J,"value"):void 0));if(G==="filter")return q.filter((H,B)=>u$(Y,Z,X,{...Q,index:B,item:H},B===0?h0(J,"value"):void 0))}return}function d0($,Z){if($===null)return"null";if($===void 0)return"undefined";if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return F$($,Z);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $)return PZ($.$ref,Z);if(Array.isArray($))return $.map((X)=>d0(X,Z)).join(", ");return JSON.stringify($)}function dA($){return`_fx_${$.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function PZ($,Z){let X=Z.statePrefix??"state",Q=Z.eventParam??"event";if($==="$reduce/acc")return"_acc";if($.startsWith("$reduce/"))return"_acc";if($.startsWith("$args/"))return`_args${$.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if($.startsWith("event#/")){let J=$.slice(7);return`${Q}.${J.replaceAll("/",".")}`}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if($.startsWith("#/state/")){let J=$.slice(8);return`${X}.${J.replaceAll("/",".")}`}if($.startsWith("parent#/"))return`${X}.${$.slice(8)}`;if($.startsWith("window#/"))return`window.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("document#/"))return`document.${$.slice(10).replaceAll("/",".")}`;return`${X}.${$}`}function xJ($,Z){if(typeof $==="object"&&$!==null&&"$ref"in $)return PZ($.$ref,Z);return d0($,Z)}function lA($,Z){let X=(Q)=>Z[Q]??"undefined";switch($){case"Intl/formatNumber":return`new Intl.NumberFormat(${X(1)}, ${X(2)}).format(${X(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${X(1)}, ${X(2)}).format(new Date(${X(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${X(2)}, ${X(3)}).format(${X(0)}, ${X(1)})`;default:return null}}function F$($,Z={}){let{operator:X,target:Q,value:J,initial:G}=$;if(TZ.has(X)&&!("value"in $)){let W=d0(Q,Z);if(X==="!")return`!(${W})`;if(X==="-")return`-(${W})`}if(X==="call"){let W=Q?.$ref??"",Y=Array.isArray(J)?J.map((z)=>d0(z,Z)):[];if(W.startsWith("window#/")){if(!vJ(W))throw Error(`$expression: "${W}" is not a blessed pure global`);let z=lA(W.slice(8),Y);if(z)return z;return`window.${W.slice(8).replaceAll("/",".")}(${Y.join(", ")})`}if(W.startsWith("#/state/")){let z=W.slice(8),q=Z.formulaParams?.[z];if(q){let H=q.map((B,L)=>`${JSON.stringify(B)}: ${Y[L]??"undefined"}`).join(", ");return`${dA(z)}(${Z.statePrefix??"state"}, { ${H} })`}}return`${PZ(W,Z)}(${Y.join(", ")})`}if(EZ.has(X)){if(X==="?:"){let q=d0(Q,Z),H=d0(J,Z),B=d0(G,Z);return`(${q} ? ${H} : ${B})`}let W=d0(Q,Z),Y=Object.entries($.cases??{}).map(([q,H])=>`_d === ${JSON.stringify(q)} ? ${d0(H,Z)} : `).join(""),z="default"in $?d0($.default,Z):"undefined";return`((_d) => ${Y}${z})(String(${W}))`}if(jZ.has(X)){let W=d0(Q,Z),Y=d0(J,Z);return`(${W} ${X} ${Y})`}if(kJ.has(X)){let W=xJ(Q,Z),Y=d0(J,Z);return`${W} ${X} ${Y}`}if(yJ.has(X)){let W=xJ(Q,Z);switch(X){case"push":return`${W}.push(${d0(J,Z)})`;case"unshift":return`${W}.unshift(${d0(J,Z)})`;case"pop":return`${W}.pop()`;case"shift":return`${W}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((z)=>d0(z,Z)).join(", "):d0(J,Z);return`${W}.splice(${Y})`}default:break}}if(RZ.has(X)){let W=d0(Q,Z),Y=J===void 0?"":Array.isArray(J)?J.map((z)=>d0(z,Z)).join(", "):d0(J,Z);return`(${W})?.${X}?.(${Y})`}if(OZ.has(X)){let W=d0(Q,Z),Y=F$(J,Z);if(X==="reduce"){let z=d0(G,Z);return`${W}.reduce((_acc, _item, _index) => ${Y}, ${z})`}if(X==="map")return`${W}.map((_item, _index) => ${Y})`;if(X==="filter")return`${W}.filter((_item, _index) => ${Y})`}return"undefined"}function u6($,Z){let X=$;for(let Q of Z.split(/[./]/))X=X?.[Q];return X}function F5($,Z,X,Q){return v0($,Z,X,Q)}function L5($,Z={}){return d0($,Z)}var bJ,TZ,jZ,kJ,yJ,OZ,EZ,RZ,vA,gA,fA,_J=64,hA=64;var W9=t(()=>{bJ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),TZ=new Set(["!","-"]),jZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),kJ=new Set(["=","+=","-=","*=","/="]),yJ=new Set(["push","pop","shift","unshift","splice"]),OZ=new Set(["reduce","map","filter"]),EZ=new Set(["?:","switch"]),RZ=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"]),vA=new Set([...bJ,...TZ,...jZ,...OZ,...EZ,...RZ,"call"]),gA=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","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),fA={"Intl/formatDate":($,Z,X)=>new Intl.DateTimeFormat(Z,X).format(new Date($)),"Intl/formatNumber":($,Z,X)=>new Intl.NumberFormat(Z,X).format($),"Intl/formatRelativeTime":($,Z,X,Q)=>new Intl.RelativeTimeFormat(X,Q).format($,Z)}});function m$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function d$($){return m$($)&&typeof $.$ref==="string"}function I6($){return m$($)&&$.$prototype==="Function"}function n$($){return m$($)&&m$($.$expression)}function g1($){return n$($)&&Array.isArray($.parameters)&&$.parameters.length>0}function N6($){return I6($)&&Array.isArray($.body)}function f1($){return m$($)&&typeof $.$prototype==="string"&&$.$prototype!=="Function"}function CZ($){return m$($)&&$.timing==="server"&&typeof $.$src==="string"&&typeof $.$export==="string"&&!$.$prototype}function fJ($){return m$($)&&!$.$prototype&&!$.$expression&&"default"in $}function K1($){if(!m$($))return!1;for(let Z of Object.keys($))if(!hJ.has(Z))return!1;return!0}function G$($){return m$($)&&$.$prototype==="Array"}function SZ($){if(G$($))return!0;return Array.isArray($)&&$.some((Z)=>G$(Z))}function uJ($){return m$($)&&$.$prototype==="Class"}function I0($){return typeof $==="string"&&$.includes("${")}function _Z($){return/\breturn\b/.test($)}function H1($){if(!$)return[];return $.map((Z)=>typeof Z==="string"?Z:Z.name)}var hJ;var D6=t(()=>{hJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function mJ($){if("operator"in $)return"expression";if("if"in $)return"if";if("$switch"in $)return"switch";return"dispatch"}async function z4($,Z,X,Q={}){let J=Q.args?{args:Q.args}:void 0;for(let G of $)switch(mJ(G)){case"expression":{let W=u$(G,Z,X,J);if(W&&typeof W.then==="function")await W;break}case"if":{let W=G,Y=F5(W.if,Z,X,J)?W.then:W.else;if(Array.isArray(Y))await z4(Y,Z,X,Q);break}case"switch":{let W=G,Y=String(F5(W.$switch,Z,X,J)),z=W.cases??{},q=Object.hasOwn(z,Y)?z[Y]:W.default;if(Array.isArray(q))await z4(q,Z,X,Q);break}case"dispatch":{let W=G,Y=Q.target??X?.currentTarget;if(!Y)break;let z={};if("detail"in W)z.detail=F5(W.detail,Z,X,J);if(W.bubbles!==void 0)z.bubbles=W.bubbles;if(W.composed!==void 0)z.composed=W.composed;Y.dispatchEvent(new CustomEvent(W.dispatchEvent,z));break}default:break}}function r$($,Z={}){let X=Z.indent??"",Q=[];for(let J of $)switch(mJ(J)){case"expression":{Q.push(`${X}${F$(J,Z)};`);break}case"if":{let G=J,W=L5(G.if,Z),Y={...Z,indent:`${X} `};if(Q.push(`${X}if (${W}) {`,r$(G.then??[],Y)),G.else)Q.push(`${X}} else {`,r$(G.else,Y));Q.push(`${X}}`);break}case"switch":{let G=J,W=L5(G.$switch,Z),Y={...Z,indent:`${X} `};Q.push(`${X}switch (String(${W})) {`);for(let[z,q]of Object.entries(G.cases??{}))Q.push(`${X} case ${JSON.stringify(z)}: {`,r$(q,Y),`${X} break;`,`${X} }`);if(G.default)Q.push(`${X} default: {`,r$(G.default,Y),`${X} }`);Q.push(`${X}}`);break}case"dispatch":{let G=J,W=Z.eventParam??"event",Y=Z.dispatchTarget??`(${W} && ${W}.currentTarget)`,z=[];if("detail"in G)z.push(`detail: ${L5(G.detail,Z)}`);if(G.bubbles!==void 0)z.push(`bubbles: ${JSON.stringify(G.bubbles)}`);if(G.composed!==void 0)z.push(`composed: ${JSON.stringify(G.composed)}`);let q=z.length>0?`, { ${z.join(", ")} }`:"";Q.push(`${X}${Y}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${q}));`);break}default:break}return Q.join(`
3
- `)}var M5=t(()=>{W9()});function nA($){if(!cA||!$.includes("v"))return $;return $.replace(pA,(Z,X,Q)=>`${X}${iA[Q.toLowerCase()]??`cq${Q}`}`)}function rA($){return $.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")}function E$($){return $.replaceAll(/[A-Z]/g,(Z)=>`-${Z.toLowerCase()}`)}function a$($){return Object.entries($).filter(([Z,X])=>!rA(Z)&&(X===null||typeof X!=="object")).map(([Z,X])=>`${E$(Z)}: ${nA(String(X))}`).join("; ")}function w6($){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec($.trim())?.[1]??null}function bZ($,Z){if($===":root"||$==="html")return{auto:`${$}:where(:not([${m6}]))`,forced:`${$}:where([${m6}="${Z}"])`};return{auto:`:where(:root:not([${m6}])) ${$}`,forced:`:where(:root[${m6}="${Z}"]) ${$}`}}var cA=!1,pA,iA,V1,m6="data-color-scheme",xZ="jx-color-scheme";var Y9=t(()=>{W9();D6();M5();pA=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,iA={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};V1=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function z9($,Z){let X=[];for(let[Q,J]of($.parameters??[]).entries()){let G=typeof J==="string"?J:J?.name??"";if(!G)continue;let Y=typeof J==="object"&&J!==null&&"default"in J?`_a[${Q}] === undefined ? ${JSON.stringify(J.default)} : _a[${Q}]`:`_a[${Q}]`;X.push(`${JSON.stringify(G)}: ${Y}`)}return`(..._a) => { const _args = { ${X.join(", ")} }; return ${Z}; }`}function I5($){if(!$||typeof $!=="object")return!1;if($.state)for(let[Z,X]of Object.entries($.state)){if(Z==="$site"||Z==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(K1(X))continue;return!0}if($.$switch)return!0;if(G$($)||SZ($.children))return!0;if(Array.isArray($.children)&&$.children.some((Z)=>I5(Z)))return!0;for(let[Z,X]of Object.entries($)){if(V1.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(I0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(I0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(I0(Z))return!0}return!1}function lJ($){if(!$||typeof $!=="object")return!1;if($.$switch)return!0;if(G$($)||SZ($.children))return!0;for(let[Z,X]of Object.entries($)){if(V1.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(I0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(I0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(I0(Z))return!0}return!1}function V4($,Z=null,X={},Q={}){let J=$?.state?B4($.state,Z):Z??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function B4($={},Z=null){let X=Object.create(Z??null);for(let[Q,J]of Object.entries($)){if(typeof J!=="object"||J===null||Array.isArray(J)){d6(X,Q,A5(J));continue}let G=J;if("default"in G){d6(X,Q,A5(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!K1(G))d6(X,Q,A5(G))}for(let[Q,J]of Object.entries($)){if(typeof J==="string"&&I0(J)){kZ(X,Q,()=>L$(J,X));continue}if(!J||typeof J!=="object")continue;if(n$(J)){let G=J.$expression;if(g1(J)){let W=J.parameters;d6(X,Q,(...Y)=>{let z={};for(let[q,H]of W.entries()){let B=typeof H==="string"?H:H?.name??"";if(!B)continue;z[B]=Y[q]===void 0&&typeof H==="object"&&H!==null&&"default"in H?H.default:Y[q]}return u$(G,X,null,{args:z})})}else if(U1(G.operator))d6(X,Q,(W,Y)=>u$(G,W,Y));else kZ(X,Q,()=>u$(G,X,null));continue}if(I6(J)){if(N6(J)){let{body:G}=J;d6(X,Q,(W,Y)=>{z4(G,W??X,Y??null)})}else if(typeof J.body==="string"){let G=J.parameters?H1(J.parameters):J.arguments??[],{body:W}=J,Y=Function("state",...G,W);if(_Z(W))kZ(X,Q,()=>Y(X));else d6(X,Q,Y)}else d6(X,Q,()=>{});continue}if(f1(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))d6(X,Q,A5(J.default??null))}return X}function d6($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,value:X,writable:!0})}function kZ($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get:X})}function i0($,Z){if(W6($))return vZ($.$ref,Z);if(I0($))return L$($,Z);return $}function W6($){return d$($)}function vZ($,Z){if(typeof $!=="string")return $;if($.startsWith("$map/")){let X=$.split("/"),Q=X[1],J=Z.$map?.[Q]??Z[`$map/${Q}`];return X.length>2?dJ(J,X.slice(2).join("/")):J}if($.startsWith("#/state/")){let X=$.slice(8),Q=X.indexOf("/");if(Q===-1)return Z[X];return dJ(Z[X.slice(0,Q)],X.slice(Q+1))}return Z[$]??null}function L$($,Z){try{let X=$.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(Z,Z?.$map);return Function("state","$map",`return \`${$}\``)(Z,Z?.$map)}catch{return null}}function dJ($,Z){if(!Z)return $;let X=$;for(let Q of Z.split("/"))X=X==null?void 0:X[Q];return X}function A5($){if($===null||typeof $!=="object")return $;return structuredClone($)}function U4($,Z){let X="",Q=i0($.id,Z),J=i0($.className,Z),G=i0($.hidden,Z),W=i0($.tabIndex,Z),Y=i0($.title,Z),z=i0($.lang,Z),q=i0($.dir,Z);if(Q)X+=` id="${C0(String(Q))}"`;if(J)X+=` class="${C0(String(J))}"`;if(G)X+=" hidden";if(W!==void 0&&W!==null)X+=` tabindex="${C0(String(W))}"`;if(Y)X+=` title="${C0(String(Y))}"`;if(z)X+=` lang="${C0(String(z))}"`;if(q)X+=` dir="${C0(String(q))}"`;if($.style&&Z){let H=Object.entries($.style).filter(([B,L])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&L!==null&&typeof L!=="object"&&typeof L==="string"&&I0(L)).map(([B,L])=>{let M=i0(L,Z);return M==null?null:`${E$(B)}: ${M}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if($.attributes)for(let[H,B]of Object.entries($.attributes)){let L=i0(B,Z);if(L!==null&&L!==void 0&&(typeof L==="string"||typeof L==="number"||typeof L==="boolean"))X+=` ${H}="${C0(String(L))}"`}if($.tagName==="img"){if(!$.attributes?.loading)X+=' loading="lazy"';if(!$.attributes?.decoding)X+=' decoding="async"'}if($.$static)X+=" data-jx-static";else if($.$prerendered)X+=" data-jx-prerendered";return X}function F4(){let $=JSON.stringify(xZ),Z=JSON.stringify(m6);return`(function(){try{var s=localStorage.getItem(${$});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${Z},s)}}catch(e){}})()`}function cJ($,Z,X){let Q=$.startsWith("@--")?Z[$.slice(1)]??$.slice(1):$.startsWith("@(")?$.slice(1):null,J=Q===null?$:`@media ${Q}`,G=Q===null?null:w6(Q);return(W,Y)=>{if(!Y)return;if(G){let{auto:z,forced:q}=bZ(W,G);X.push(`${J} { ${z} { ${Y} } }`,`${q} { ${Y} }`)}else X.push(`${J} { ${W} { ${Y} } }`)}}function N5($,Z,X,Q,J){if(J===null||typeof J!=="object"||Array.isArray(J))return;let G=cJ(Z,X,$);G(Q,a$(J));for(let[W,Y]of Object.entries(J)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(W.startsWith("@"))continue;let z=W.startsWith("&")?W.replace("&",Q):W.startsWith(":")||W.startsWith(".")||W.startsWith("[")?`${Q}${W}`:`${Q} ${W}`;G(z,a$(Y))}}function L4($,Z={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let L=a$(B);if(L)Q.push(`${H} { ${L} }`);for(let[M,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(M.startsWith("@")){N5(Q,M,Z,H,A);continue}let w=M.startsWith("&")?M.replace("&",H):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${H}${M}`:`${H} ${M}`;G(w,A)}},W={},Y={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))W[H]=B;else Y[H]=B}let z=a$(W);if(z)Q.push(`:root { ${z} }`);let q=a$(Y);if(q)Q.push(`body { ${q} }`);for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")&&B!==null&&typeof B==="object"&&!Array.isArray(B)){let L=cJ(H,Z,Q),M={},A={},w=[];for(let[D,j]of Object.entries(B)){if(j!==null&&typeof j==="object"&&!Array.isArray(j)){if(!D.startsWith("@"))w.push([D,j]);continue}if(D.startsWith("--"))M[D]=j;else A[D]=j}L(":root",a$(M)),L("body",a$(A));for(let[D,j]of w)L(D,a$(j))}}if(Object.values(Z).some((G)=>w6(G)!==null)&&!(X&&typeof X==="object"&&("colorScheme"in X)))Q.push(":root { color-scheme: light dark }",`:root:where([${m6}="light"]) { color-scheme: light }`,`:root:where([${m6}="dark"]) { color-scheme: dark }`);if(B1($,Q,Z,"",{n:0}),Q.length===0)return"";return`<style>
2
+ import{createRequire as X2}from"node:module";var nA=Object.create;var{getPrototypeOf:rA,defineProperty:kZ,getOwnPropertyNames:aA}=Object;var oA=Object.prototype.hasOwnProperty;function sA($){return this[$]}var tA,eA,F$=($,Z,X)=>{var Q=$!=null&&typeof $==="object";if(Q){var J=Z?tA??=new WeakMap:eA??=new WeakMap,G=J.get($);if(G)return G}X=$!=null?nA(rA($)):{};let W=Z||!$||!$.__esModule?kZ(X,"default",{value:$,enumerable:!0}):X;for(let Y of aA($))if(!oA.call(W,Y))kZ(W,Y,{get:sA.bind($,Y),enumerable:!0});if(Q)J.set($,W);return W};var b=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var $2=($)=>$;function Z2($,Z){this[$]=$2.bind(null,Z)}var m1=($,Z)=>{for(var X in Z)kZ($,X,{get:Z[X],enumerable:!0,configurable:!0,set:Z2.bind(Z,X)})};var s=($,Z)=>()=>($&&(Z=$($=0)),Z);var O0=X2(import.meta.url);function yZ($){let Z=$.$map;return Z&&typeof Z==="object"?Z:void 0}function oJ($){return $.startsWith("window#/")&&J2.has($.slice(8))}function U6($){return nJ.has($)}function u0($,Z){if(!$)return;let X=($.depth??0)+1;if(X>W2)return;return{depth:X,path:[...$.path??[],...Array.isArray(Z)?Z:[Z]],report:$.report}}function g0($,Z,X,Q,J){if($===null||$===void 0)return $;if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return m$($,Z,X,Q,J);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $){let G=sJ($.$ref,Z,X,Q);return J?.report(J.path??[],G),G}if(Array.isArray($))return $.map((G,W)=>g0(G,Z,X,Q,u0(J,W)));return J?.report(J.path??[],$),$}function sJ($,Z,X,Q){if($==="$reduce/acc")return Q?.acc;if($.startsWith("$reduce/"))return Q?.acc;if($.startsWith("$args/")){let J=$.slice(6).split("/"),G=Q?.args?.[J[0]];return J.length>1?d1(G,J.slice(1).join("/")):G}if($.startsWith("event#/")){let J=$.slice(7);return d1(X,J)}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=yZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];return J.length>2?d1(W,J.slice(2).join("/")):W}if($.startsWith("#/state/")){let J=$.slice(8),G=J.indexOf("/");if(G===-1)return Z[J];return d1(Z[J.slice(0,G)],J.slice(G+1))}if($.startsWith("parent#/"))return Z[$.slice(8)];if($.startsWith("window#/"))return d1(globalThis.window,$.slice(8));if($.startsWith("document#/"))return d1(globalThis.document,$.slice(10));return Z[$]??null}function Y2($,Z,X,Q){if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=yZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];if(J.length>2){let z=J.slice(2),q=z.pop(),H=z.length>0?d1(W,z.join("/")):W;return{key:q,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:yZ(Z)??Z}}if($.startsWith("#/state/")){let J=$.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:Z};let W=J.split("/"),Y=W.pop(),z=Z;for(let q of W)z=z[q];return{key:Y,obj:z}}return{key:$,obj:Z}}function m$($,Z,X,Q,J){let G=z2($,Z,X,Q,J);return J?.report(J.path??[],G),G}function z2($,Z,X,Q,J){let{operator:G,target:W,value:Y,initial:z}=$;if(!Q2.has(G))throw Error(`$expression: unknown operator "${G}"`);if(vZ.has(G)&&!("value"in $)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="!")return!q;if(G==="-")return-q}if(G==="call"){let q=W?.$ref;if(typeof q!=="string")throw TypeError("$expression: call target must be a $ref pointer");let H=(Q?.callDepth??0)+1;if(H>pJ)throw Error(`$expression: call depth exceeded (${pJ})`);let B=Array.isArray(Y)?Y.map((L,w)=>g0(L,Z,X,Q,u0(J,["value",w]))):[];if(q.startsWith("window#/")){if(!oJ(q))throw Error(`$expression: "${q}" is not a blessed pure global`);let L=q.slice(8),w=G2[L];if(w)return w(...B);let N=d1(globalThis.window,L),I=L.lastIndexOf("/"),T=I===-1?globalThis.window:d1(globalThis.window,L.slice(0,I));return N.apply(T,B)}let F=sJ(q,Z,X,Q);if(typeof F==="function")return F(...B);if(F&&typeof F==="object"&&"$expression"in F){let L=F,w={};for(let[N,I]of(L.parameters??[]).entries()){let T=typeof I==="string"?I:I?.name??"";if(!T)continue;w[T]=B[N]===void 0&&typeof I==="object"&&I!==null&&"default"in I?I.default:B[N]}return m$(L.$expression,Z,X,{args:w,callDepth:H})}throw TypeError(`$expression: call target "${q}" is not callable`)}if(hZ.has(G)){if(G==="?:"){let L=g0(W,Z,X,Q,u0(J,"target"));if(J){let w=g0(Y,Z,X,Q,u0(J,"value")),N=g0(z,Z,X,Q,u0(J,"initial"));return L?w:N}return L?g0(Y,Z,X,Q):g0(z,Z,X,Q)}let q=g0(W,Z,X,Q,u0(J,"target")),H=String(q),B=$.cases??{},F=Object.hasOwn(B,H);if(J){let L;for(let[N,I]of Object.entries(B)){let T=g0(I,Z,X,Q,u0(J,["cases",N]));if(N===H)L=T}let w=g0($.default,Z,X,Q,u0(J,"default"));return F?L:w}return F?g0(B[H],Z,X,Q):g0($.default,Z,X,Q)}if(gZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=g0(Y,Z,X,Q,u0(J,"value"));switch(G){case"+":return q+H;case"-":return q-H;case"*":return q*H;case"/":return q/H;case"%":return q%H;case"===":return q===H;case"!==":return q!==H;case"<":return q<H;case"<=":return q<=H;case">":return q>H;case">=":return q>=H;case"&&":return q&&H;case"||":return q||H;case"??":return q??H;default:break}}if(rJ.has(G)){let q=g0(Y,Z,X,Q,u0(J,"value")),{obj:H,key:B}=Y2(W.$ref,Z,X,Q);switch(G){case"=":{H[B]=q;break}case"+=":{let F=H[B];H[B]=F+q;break}case"-=":{let F=H[B];H[B]=F-q;break}case"*=":{let F=H[B];H[B]=F*q;break}case"/=":{let F=H[B];H[B]=F/q;break}default:break}return}if(aJ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));switch(G){case"push":return q.push(g0(Y,Z,X,Q,u0(J,"value")));case"unshift":return q.unshift(g0(Y,Z,X,Q,u0(J,"value")));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let H=g0(Y,Z,X,Q,u0(J,"value"));return q.splice(...H)}default:break}}if(uZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=Y===void 0?[]:Array.isArray(Y)?g0(Y,Z,X,Q,u0(J,"value")):[g0(Y,Z,X,Q,u0(J,"value"))],B=q?.[G];if(typeof B!=="function")return;return B.apply(q,H)}if(fZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="reduce"){let H=g0(z,Z,X,Q,u0(J,"initial"));for(let[B,F]of q.entries())H=m$(Y,Z,X,{acc:H,index:B,item:F},B===0?u0(J,"value"):void 0);return H}if(G==="map")return q.map((H,B)=>m$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0));if(G==="filter")return q.filter((H,B)=>m$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0))}return}function l0($,Z){if($===null)return"null";if($===void 0)return"undefined";if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return L$($,Z);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $)return mZ($.$ref,Z);if(Array.isArray($))return $.map((X)=>l0(X,Z)).join(", ");return JSON.stringify($)}function q2($){return`_fx_${$.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function mZ($,Z){let X=Z.statePrefix??"state",Q=Z.eventParam??"event";if($==="$reduce/acc")return"_acc";if($.startsWith("$reduce/"))return"_acc";if($.startsWith("$args/"))return`_args${$.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if($.startsWith("event#/")){let J=$.slice(7);return`${Q}.${J.replaceAll("/",".")}`}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if($.startsWith("#/state/")){let J=$.slice(8);return`${X}.${J.replaceAll("/",".")}`}if($.startsWith("parent#/"))return`${X}.${$.slice(8)}`;if($.startsWith("window#/"))return`window.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("document#/"))return`document.${$.slice(10).replaceAll("/",".")}`;return`${X}.${$}`}function iJ($,Z){if(typeof $==="object"&&$!==null&&"$ref"in $)return mZ($.$ref,Z);return l0($,Z)}function K2($,Z){let X=(Q)=>Z[Q]??"undefined";switch($){case"Intl/formatNumber":return`new Intl.NumberFormat(${X(1)}, ${X(2)}).format(${X(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${X(1)}, ${X(2)}).format(new Date(${X(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${X(2)}, ${X(3)}).format(${X(0)}, ${X(1)})`;default:return null}}function L$($,Z={}){let{operator:X,target:Q,value:J,initial:G}=$;if(vZ.has(X)&&!("value"in $)){let W=l0(Q,Z);if(X==="!")return`!(${W})`;if(X==="-")return`-(${W})`}if(X==="call"){let W=Q?.$ref??"",Y=Array.isArray(J)?J.map((z)=>l0(z,Z)):[];if(W.startsWith("window#/")){if(!oJ(W))throw Error(`$expression: "${W}" is not a blessed pure global`);let z=K2(W.slice(8),Y);if(z)return z;return`window.${W.slice(8).replaceAll("/",".")}(${Y.join(", ")})`}if(W.startsWith("#/state/")){let z=W.slice(8),q=Z.formulaParams?.[z];if(q){let H=q.map((B,F)=>`${JSON.stringify(B)}: ${Y[F]??"undefined"}`).join(", ");return`${q2(z)}(${Z.statePrefix??"state"}, { ${H} })`}}return`${mZ(W,Z)}(${Y.join(", ")})`}if(hZ.has(X)){if(X==="?:"){let q=l0(Q,Z),H=l0(J,Z),B=l0(G,Z);return`(${q} ? ${H} : ${B})`}let W=l0(Q,Z),Y=Object.entries($.cases??{}).map(([q,H])=>`_d === ${JSON.stringify(q)} ? ${l0(H,Z)} : `).join(""),z="default"in $?l0($.default,Z):"undefined";return`((_d) => ${Y}${z})(String(${W}))`}if(gZ.has(X)){let W=l0(Q,Z),Y=l0(J,Z);return`(${W} ${X} ${Y})`}if(rJ.has(X)){let W=iJ(Q,Z),Y=l0(J,Z);return`${W} ${X} ${Y}`}if(aJ.has(X)){let W=iJ(Q,Z);switch(X){case"push":return`${W}.push(${l0(J,Z)})`;case"unshift":return`${W}.unshift(${l0(J,Z)})`;case"pop":return`${W}.pop()`;case"shift":return`${W}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((z)=>l0(z,Z)).join(", "):l0(J,Z);return`${W}.splice(${Y})`}default:break}}if(uZ.has(X)){let W=l0(Q,Z),Y=J===void 0?"":Array.isArray(J)?J.map((z)=>l0(z,Z)).join(", "):l0(J,Z);return`(${W})?.${X}?.(${Y})`}if(fZ.has(X)){let W=l0(Q,Z),Y=L$(J,Z);if(X==="reduce"){let z=l0(G,Z);return`${W}.reduce((_acc, _item, _index) => ${Y}, ${z})`}if(X==="map")return`${W}.map((_item, _index) => ${Y})`;if(X==="filter")return`${W}.filter((_item, _index) => ${Y})`}return"undefined"}function d1($,Z){let X=$;for(let Q of Z.split(/[./]/))X=X?.[Q];return X}function j8($,Z,X,Q){return g0($,Z,X,Q)}function O8($,Z={}){return l0($,Z)}var nJ,vZ,gZ,rJ,aJ,fZ,hZ,uZ,Q2,J2,G2,pJ=64,W2=64;var H9=s(()=>{nJ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),vZ=new Set(["!","-"]),gZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),rJ=new Set(["=","+=","-=","*=","/="]),aJ=new Set(["push","pop","shift","unshift","splice"]),fZ=new Set(["reduce","map","filter"]),hZ=new Set(["?:","switch"]),uZ=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"]),Q2=new Set([...nJ,...vZ,...gZ,...fZ,...hZ,...uZ,"call"]),J2=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","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),G2={"Intl/formatDate":($,Z,X)=>new Intl.DateTimeFormat(Z,X).format(new Date($)),"Intl/formatNumber":($,Z,X)=>new Intl.NumberFormat(Z,X).format($),"Intl/formatRelativeTime":($,Z,X,Q)=>new Intl.RelativeTimeFormat(X,Q).format($,Z)}});function d$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function U$($){return d$($)&&typeof $.$ref==="string"}function N1($){return d$($)&&$.$prototype==="Function"}function n$($){return d$($)&&d$($.$expression)}function u6($){return n$($)&&Array.isArray($.parameters)&&$.parameters.length>0}function D1($){return N1($)&&Array.isArray($.body)}function H6($){return d$($)&&typeof $.$prototype==="string"&&$.$prototype!=="Function"}function dZ($){return d$($)&&$.timing==="server"&&typeof $.$src==="string"&&typeof $.$export==="string"&&!$.$prototype}function tJ($){return d$($)&&!$.$prototype&&!$.$expression&&"default"in $}function V6($){if(!d$($))return!1;for(let Z of Object.keys($))if(!eJ.has(Z))return!1;return!0}function G$($){return d$($)&&$.$prototype==="Array"}function lZ($){if(G$($))return!0;return Array.isArray($)&&$.some((Z)=>G$(Z))}function $G($){return d$($)&&$.$prototype==="Class"}function w0($){return typeof $==="string"&&$.includes("${")}function m6($){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test($)}function l1($){if(!$)return[];return $.map((Z)=>typeof Z==="string"?Z:Z.name)}var eJ;var w1=s(()=>{eJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function ZG($){if("operator"in $)return"expression";if("if"in $)return"if";if("$switch"in $)return"switch";return"dispatch"}async function B4($,Z,X,Q={}){let J=Q.args?{args:Q.args}:void 0;for(let G of $)switch(ZG(G)){case"expression":{let W=m$(G,Z,X,J);if(W&&typeof W.then==="function")await W;break}case"if":{let W=G,Y=j8(W.if,Z,X,J)?W.then:W.else;if(Array.isArray(Y))await B4(Y,Z,X,Q);break}case"switch":{let W=G,Y=String(j8(W.$switch,Z,X,J)),z=W.cases??{},q=Object.hasOwn(z,Y)?z[Y]:W.default;if(Array.isArray(q))await B4(q,Z,X,Q);break}case"dispatch":{let W=G,Y=Q.target??X?.currentTarget;if(!Y)break;let z={};if("detail"in W)z.detail=j8(W.detail,Z,X,J);if(W.bubbles!==void 0)z.bubbles=W.bubbles;if(W.composed!==void 0)z.composed=W.composed;Y.dispatchEvent(new CustomEvent(W.dispatchEvent,z));break}default:break}}function r$($,Z={}){let X=Z.indent??"",Q=[];for(let J of $)switch(ZG(J)){case"expression":{Q.push(`${X}${L$(J,Z)};`);break}case"if":{let G=J,W=O8(G.if,Z),Y={...Z,indent:`${X} `};if(Q.push(`${X}if (${W}) {`,r$(G.then??[],Y)),G.else)Q.push(`${X}} else {`,r$(G.else,Y));Q.push(`${X}}`);break}case"switch":{let G=J,W=O8(G.$switch,Z),Y={...Z,indent:`${X} `};Q.push(`${X}switch (String(${W})) {`);for(let[z,q]of Object.entries(G.cases??{}))Q.push(`${X} case ${JSON.stringify(z)}: {`,r$(q,Y),`${X} break;`,`${X} }`);if(G.default)Q.push(`${X} default: {`,r$(G.default,Y),`${X} }`);Q.push(`${X}}`);break}case"dispatch":{let G=J,W=Z.eventParam??"event",Y=Z.dispatchTarget??`(${W} && ${W}.currentTarget)`,z=[];if("detail"in G)z.push(`detail: ${O8(G.detail,Z)}`);if(G.bubbles!==void 0)z.push(`bubbles: ${JSON.stringify(G.bubbles)}`);if(G.composed!==void 0)z.push(`composed: ${JSON.stringify(G.composed)}`);let q=z.length>0?`, { ${z.join(", ")} }`:"";Q.push(`${X}${Y}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${q}));`);break}default:break}return Q.join(`
3
+ `)}var E8=s(()=>{H9()});function B2($){if(!U2||!$.includes("v"))return $;return $.replace(H2,(Z,X,Q)=>`${X}${V2[Q.toLowerCase()]??`cq${Q}`}`)}function F2($){return $.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")}function R$($){return $.replaceAll(/[A-Z]/g,(Z)=>`-${Z.toLowerCase()}`)}function a$($){return Object.entries($).filter(([Z,X])=>!F2(Z)&&(X===null||typeof X!=="object")).map(([Z,X])=>`${R$(Z)}: ${B2(String(X))}`).join("; ")}function T1($){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec($.trim())?.[1]??null}function pZ($,Z){if($===":root"||$==="html")return{auto:`${$}:where(:not([${c1}]))`,forced:`${$}:where([${c1}="${Z}"])`};return{auto:`:where(:root:not([${c1}])) ${$}`,forced:`:where(:root[${c1}="${Z}"]) ${$}`}}var U2=!1,H2,V2,B6,c1="data-color-scheme",cZ="jx-color-scheme";var V9=s(()=>{H9();w1();E8();H2=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,V2={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};B6=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function B9($,Z){let X=[];for(let[Q,J]of($.parameters??[]).entries()){let G=typeof J==="string"?J:J?.name??"";if(!G)continue;let Y=typeof J==="object"&&J!==null&&"default"in J?`_a[${Q}] === undefined ? ${JSON.stringify(J.default)} : _a[${Q}]`:`_a[${Q}]`;X.push(`${JSON.stringify(G)}: ${Y}`)}return`(..._a) => { const _args = { ${X.join(", ")} }; return ${Z}; }`}function P8($,Z){let X=Z?.$export,Q=typeof X==="string"&&X!==""?X:$;return Q===$?$:`${Q} as ${$}`}function C8($,Z,X={}){let{statePrefix:Q="state",indent:J="",collect:G}=X,{url:W}=Z,Y=w0(W),z=Z.method??"GET";if(Z.manual)return`${J}// ${$}: manual Request — fetch triggered by user action`;let q=[`// ${$}: auto-fetch from ${Y?"(dynamic URL)":W}`,G?`${G}.push(effect(() => {`:"effect(() => {"];if(Y)q.push(` const url = \`${L2(W,Q)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else q.push(` const url = ${JSON.stringify(W)};`);let H=[];if(z!=="GET")H.push(`method: ${JSON.stringify(z)}`);if(Z.headers)H.push(`headers: ${JSON.stringify(Z.headers)}`);if(Z.body){let F=typeof Z.body==="object"?JSON.stringify(JSON.stringify(Z.body)):JSON.stringify(Z.body);H.push(`body: ${F}`)}let B=H.length>0?`, { ${H.join(", ")} }`:"";return q.push(` fetch(url${B})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${Q}.${$} = d; })`,` .catch(e => { ${Q}.${$} = { error: String(e) }; });`,G?"}));":"});"),q.map((F)=>`${J}${F}`).join(`
4
+ `)}function L2($,Z){if(Z==="state")return $;return $.replaceAll(/\$\{([^}]*)\}/g,(X,Q)=>`\${${Q.replaceAll(/(?<!this\.)\bstate\./g,`${Z}.`)}}`)}function S8($){if(!$||typeof $!=="object")return!1;if($.state)for(let[Z,X]of Object.entries($.state)){if(Z==="$site"||Z==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(V6(X))continue;return!0}if($.$switch)return!0;if(G$($)||lZ($.children))return!0;if(Array.isArray($.children)&&$.children.some((Z)=>S8(Z)))return!0;for(let[Z,X]of Object.entries($)){if(B6.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(w0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(w0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(w0(Z))return!0}return!1}function QG($){if(!$||typeof $!=="object")return!1;if($.$switch)return!0;if(G$($)||lZ($.children))return!0;for(let[Z,X]of Object.entries($)){if(B6.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(w0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(w0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(w0(Z))return!0}return!1}function I4($,Z=null,X={},Q={}){let J=$?.state?N4($.state,Z):Z??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function N4($={},Z=null){let X=Object.create(Z??null),Q=Z?.[nZ],J=new Set(Q instanceof Set?Q:[]);Object.defineProperty(X,nZ,{configurable:!0,enumerable:!1,value:J,writable:!0});for(let[W,Y]of Object.entries($)){if(typeof Y!=="object"||Y===null||Array.isArray(Y)){p1(X,W,R8(Y));continue}let z=Y;if("default"in z){p1(X,W,R8(z.default));continue}if(!z.$prototype&&!("$expression"in z)&&!V6(z))p1(X,W,R8(z))}let G=[];for(let[W,Y]of Object.entries($)){if(typeof Y==="string"&&w0(Y)){G.push([W,Y]);continue}if(!Y||typeof Y!=="object")continue;if(n$(Y)){let z=Y.$expression;if(u6(Y)){let q=Y.parameters;p1(X,W,(...H)=>{let B={};for(let[F,L]of q.entries()){let w=typeof L==="string"?L:L?.name??"";if(!w)continue;B[w]=H[F]===void 0&&typeof L==="object"&&L!==null&&"default"in L?L.default:H[F]}return m$(z,X,null,{args:B})})}else if(U6(z.operator))p1(X,W,(q,H)=>m$(z,q,H));else iZ(X,W,()=>m$(z,X,null));continue}if(N1(Y)){if(D1(Y)){let{body:z}=Y;p1(X,W,(q,H)=>{B4(z,q??X,H??null)})}else if(typeof Y.body==="string"){let z=Y.parameters?l1(Y.parameters):Y.arguments??[],{body:q}=Y,H=z.includes("state")?z:["state",...z],B=Function(...H,q),F=(L,w)=>B(...H.map((N)=>N==="state"?L:w));if(m6(q))iZ(X,W,()=>F(X));else p1(X,W,F)}else p1(X,W,()=>{}),J.add(W);continue}if(H6(Y)&&(Y.$prototype==="LocalStorage"||Y.$prototype==="SessionStorage")){p1(X,W,R8(Y.default??null));continue}if(H6(Y)&&Y.$prototype==="Request")J.add(W)}for(let[W,Y]of G){if(JG(Y,X))J.add(W);iZ(X,W,()=>M$(Y,X))}return X}function p1($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,value:X,writable:!0})}function iZ($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get:X})}function r0($,Z){if(o$($))return aZ($.$ref,Z);if(w0($))return M$($,Z);return $}function o$($){return U$($)}function aZ($,Z){if(typeof $!=="string")return $;if($.startsWith("$map/")){let X=$.split("/"),Q=X[1],J=Z.$map?.[Q]??Z[`$map/${Q}`];return X.length>2?XG(J,X.slice(2).join("/")):J}if($.startsWith("#/state/")){let X=$.slice(8),Q=X.indexOf("/");if(Q===-1)return Z[X];return XG(Z[X.slice(0,Q)],X.slice(Q+1))}return Z[$]??null}function JG($,Z){if(!Z)return!1;let X=Z[nZ];for(let Q of $.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(Q[2])continue;let J=Q[1];if(X instanceof Set&&X.has(J))return!0;if(typeof Z[J]==="function")return!0}return!1}function M$($,Z){if(JG($,Z))return null;try{let X=$.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(Z,Z?.$map);return Function("state","$map",`return \`${$}\``)(Z,Z?.$map)}catch{return null}}function XG($,Z){if(!Z)return $;let X=$;for(let Q of Z.split("/"))X=X==null?void 0:X[Q];return X}function R8($){if($===null||typeof $!=="object")return $;return structuredClone($)}function L4($,Z){let X="",Q=r0($.id,Z),J=r0($.className,Z),G=r0($.hidden,Z),W=r0($.tabIndex,Z),Y=r0($.title,Z),z=r0($.lang,Z),q=r0($.dir,Z);if(Q)X+=` id="${_0(String(Q))}"`;if(J)X+=` class="${_0(String(J))}"`;if(G)X+=" hidden";if(W!==void 0&&W!==null)X+=` tabindex="${_0(String(W))}"`;if(Y)X+=` title="${_0(String(Y))}"`;if(z)X+=` lang="${_0(String(z))}"`;if(q)X+=` dir="${_0(String(q))}"`;if($.style&&Z){let H=Object.entries($.style).filter(([B,F])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&F!==null&&typeof F!=="object"&&typeof F==="string"&&w0(F)).map(([B,F])=>{let L=r0(F,Z);return L==null?null:`${R$(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if($.attributes)for(let[H,B]of Object.entries($.attributes)){let F=r0(B,Z);if(F!==null&&F!==void 0&&(typeof F==="string"||typeof F==="number"||typeof F==="boolean"))X+=` ${H}="${_0(String(F))}"`}if($.tagName==="img"){if(!$.attributes?.loading)X+=' loading="lazy"';if(!$.attributes?.decoding)X+=' decoding="async"'}if($.$static)X+=" data-jx-static";else if($.$prerendered)X+=" data-jx-prerendered";return X}function F9($,Z=" "){return $?"":`
5
+ ${Z}`}function D4(){let $=JSON.stringify(cZ),Z=JSON.stringify(c1);return`(function(){try{var s=localStorage.getItem(${$});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${Z},s)}}catch(e){}})()`}function GG($,Z,X){let Q=$.startsWith("@--")?Z[$.slice(1)]??$.slice(1):$.startsWith("@(")?$.slice(1):null,J=Q===null?$:`@media ${Q}`,G=Q===null?null:T1(Q);return(W,Y)=>{if(!Y)return;if(G){let{auto:z,forced:q}=pZ(W,G);X.push(`${J} { ${z} { ${Y} } }`,`${q} { ${Y} }`)}else X.push(`${J} { ${W} { ${Y} } }`)}}function _8($,Z,X,Q,J){if(J===null||typeof J!=="object"||Array.isArray(J))return;let G=GG(Z,X,$);G(Q,a$(J));for(let[W,Y]of Object.entries(J)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(W.startsWith("@"))continue;let z=W.startsWith("&")?W.replace("&",Q):W.startsWith(":")||W.startsWith(".")||W.startsWith("[")?`${Q}${W}`:`${Q} ${W}`;G(z,a$(Y))}}function w4($,Z={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let F=a$(B);if(F)Q.push(`${H} { ${F} }`);for(let[L,w]of Object.entries(B)){if(w===null||typeof w!=="object"||Array.isArray(w))continue;if(L.startsWith("@")){_8(Q,L,Z,H,w);continue}let N=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(N,w)}},W={},Y={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))W[H]=B;else Y[H]=B}let z=a$(W);if(z)Q.push(`:root { ${z} }`);let q=a$(Y);if(q)Q.push(`body { ${q} }`);for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")&&B!==null&&typeof B==="object"&&!Array.isArray(B)){let F=GG(H,Z,Q),L={},w={},N=[];for(let[I,T]of Object.entries(B)){if(T!==null&&typeof T==="object"&&!Array.isArray(T)){if(!I.startsWith("@"))N.push([I,T]);continue}if(I.startsWith("--"))L[I]=T;else w[I]=T}F(":root",a$(L)),F("body",a$(w));for(let[I,T]of N)F(I,a$(T))}}if(Object.values(Z).some((G)=>T1(G)!==null)&&!(X&&typeof X==="object"&&("colorScheme"in X)))Q.push(":root { color-scheme: light dark }",`:root:where([${c1}="light"]) { color-scheme: light }`,`:root:where([${c1}="dark"]) { color-scheme: dark }`);if(F6($,Q,Z,"",{n:0}),Q.length===0)return"";return`<style>
4
6
  ${Q.join(`
5
7
  `)}
6
- </style>`}function pJ($,Z,X,Q){let J=a$(Z);if(J)X.push(`${$} { ${J} }`);for(let[G,W]of Object.entries(Z)){if(W===null||typeof W!=="object"||Array.isArray(W))continue;if(G.startsWith("@")){N5(X,G,Q,$,W);continue}let Y=G.startsWith("&")?G.replace("&",$):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${$}${G}`:`${$} ${G}`;pJ(Y,W,X,Q)}}function B1($,Z,X,Q="",J,G="jx"){let W=J??{n:0};if(!$||typeof $!=="object")return;if($.style&&!$.id&&!$.className)$.className=`${G}-${W.n}`,W.n+=1;let Y=$.id?`#${$.id}`:$.className?`.${$.className.split(" ")[0]}`:$.tagName??"*";if($.style){let z=[];for(let[q,H]of Object.entries($.style)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(H===null||typeof H==="object")continue;if(typeof H==="string"&&I0(H))continue;z.push(` ${E$(q)}: ${H};`)}if(z.length>0)Z.push(`${Y} {
8
+ </style>`}function WG($,Z,X,Q){let J=a$(Z);if(J)X.push(`${$} { ${J} }`);for(let[G,W]of Object.entries(Z)){if(W===null||typeof W!=="object"||Array.isArray(W))continue;if(G.startsWith("@")){_8(X,G,Q,$,W);continue}let Y=G.startsWith("&")?G.replace("&",$):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${$}${G}`:`${$} ${G}`;WG(Y,W,X,Q)}}function F6($,Z,X,Q="",J,G="jx"){let W=J??{n:0};if(!$||typeof $!=="object")return;if($.style&&!$.id&&!$.className)$.className=`${G}-${W.n}`,W.n+=1;let Y=$.id?`#${$.id}`:$.className?`.${$.className.split(" ")[0]}`:$.tagName??"*";if($.style){let z=[];for(let[q,H]of Object.entries($.style)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(H===null||typeof H==="object")continue;if(typeof H==="string"&&w0(H))continue;z.push(` ${R$(q)}: ${H};`)}if(z.length>0)Z.push(`${Y} {
7
9
  ${z.join(`
8
10
  `)}
9
- }`);for(let[q,H]of Object.entries($.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(q.startsWith("@"))N5(Z,q,X,Y,H);else{let B=q.startsWith("&")?q.replace("&",Y):q.startsWith(":")||q.startsWith(".")||q.startsWith("[")?`${Y}${q}`:`${Y} ${q}`;pJ(B,H,Z,X)}}}if(Array.isArray($.children))for(let z of $.children)B1(z,Z,X,Y,W,G);if($.cases&&typeof $.cases==="object")for(let z of Object.values($.cases))B1(z,Z,X,Y,W,G)}function C0($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function D5($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function w5($){let Z=new Map;return iJ($,Z),[...Z.values()]}function iJ($,Z){if(!$||typeof $!=="object")return;if($.state){for(let[X,Q]of Object.entries($.state))if(CZ(Q))Z.set(Q.$export,{exportName:Q.$export,key:X,src:Q.$src})}if(Array.isArray($.children))for(let X of $.children)iJ(X,Z)}function q4($,Z,X=null){if(typeof $==="string"){if(I0($)&&Z){let W=L$($,Z);return W!=null?C0(String(W)):C0($)}return C0($)}if(typeof $==="number"||typeof $==="boolean")return C0(String($));if(Array.isArray($))return $.map((W)=>q4(W,Z,X)).join(`
10
- `);if(!$||typeof $!=="object")return"";if($.$prototype==="Array")return"";if($.$switch){let W=$.tagName??"div",Y=U4($,Z),z=i0($.$switch,Z),q=z==null?void 0:$.cases?.[String(z)],H=q!==void 0&&!W6(q)?q4(q,Z,X):"";return`<${W}${Y}>${H}</${W}>`}let Q=$.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=U4($,Z);if(gZ.has(Q))return`<${Q}${J}>`;let G="";if($.textContent!==void 0){let W=i0($.textContent,Z);G=W!=null?C0(String(W)):""}else if($.innerHTML){let W=i0($.innerHTML,Z);G=W!=null?String(W):$.innerHTML}else if(Array.isArray($.children))G=$.children.map((W)=>q4(W,Z,X)).join(`
11
- `);return`<${Q}${J}>${G}</${Q}>`}function nJ($,Z=null,X=null){let Q=$.state??{};if(Z){Q={...Q};for(let[G,W]of Object.entries(Z))if(G in Q){let Y=Q[G];Q[G]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:W}:W}else Q[G]=W}let J=B4(Q,null);if(!Array.isArray($.children))return"";return $.children.map((G)=>q4(G,J,X)).join(`
12
- `)}function fZ($){return yZ($)}function yZ($){if(!$||typeof $!=="object")return!0;if(Array.isArray($))return $.every((Z)=>yZ(Z));if($.$prototype)return!1;if($.$ref)return!1;if($.state)for(let Z of Object.values($.state)){if(!Z||typeof Z!=="object")continue;let X=Z;if(X.$prototype)return!1;if(X.$ref)return!1}for(let Z of Object.keys($))if(Z.startsWith("on")&&Z!=="observedAttributes")return!1;if(Array.isArray($.children))return $.children.every((Z)=>yZ(Z));if($.children&&typeof $.children==="object"&&$.children.$prototype)return!1;return!0}function rJ($,Z,X=null,Q={}){let J=[];if(Z&&typeof Z==="object"){let G=[];for(let[W,Y]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&I0(Y))continue;G.push(` ${E$(W)}: ${Y};`)}if(G.length>0)J.push(`${$} {
11
+ }`);for(let[q,H]of Object.entries($.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(q.startsWith("@"))_8(Z,q,X,Y,H);else{let B=q.startsWith("&")?q.replace("&",Y):q.startsWith(":")||q.startsWith(".")||q.startsWith("[")?`${Y}${q}`:`${Y} ${q}`;WG(B,H,Z,X)}}}if(Array.isArray($.children))for(let z of $.children)F6(z,Z,X,Y,W,G);if($.cases&&typeof $.cases==="object")for(let z of Object.values($.cases))F6(z,Z,X,Y,W,G)}function _0($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function b8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function x8($){let Z=new Map;return YG($,Z),[...Z.values()]}function YG($,Z){if(!$||typeof $!=="object")return;if($.state){for(let[X,Q]of Object.entries($.state))if(dZ(Q))Z.set(Q.$export,{exportName:Q.$export,key:X,src:Q.$src})}if(Array.isArray($.children))for(let X of $.children)YG(X,Z)}function F4($,Z,X=null){if(typeof $==="string"){if(w0($)&&Z){let W=M$($,Z);return W!=null?_0(String(W)):_0($)}return _0($)}if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(Array.isArray($))return $.map((W)=>F4(W,Z,X)).join(`
12
+ `);if(!$||typeof $!=="object")return"";if($.$prototype==="Array")return"";if($.$switch){let W=$.tagName??"div",Y=L4($,Z),z=r0($.$switch,Z),q=z==null?void 0:$.cases?.[String(z)],H=q!==void 0&&!o$(q)?F4(q,Z,X):"";return`<${W}${Y}>${H}</${W}>`}let Q=$.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=L4($,Z);if(oZ.has(Q))return`<${Q}${J}>`;let G="";if($.textContent!==void 0){let W=r0($.textContent,Z);G=W!=null?_0(String(W)):""}else if($.innerHTML){let W=r0($.innerHTML,Z);G=W!=null?String(W):$.innerHTML}else if(Array.isArray($.children))G=$.children.map((W)=>F4(W,Z,X)).join(`
13
+ `);return`<${Q}${J}>${G}</${Q}>`}function zG($,Z=null,X=null){let Q=$.state??{};if(Z){Q={...Q};for(let[G,W]of Object.entries(Z))if(G in Q){let Y=Q[G];Q[G]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:W}:W}else Q[G]=W}let J=N4(Q,null);if(!Array.isArray($.children))return"";return $.children.map((G)=>F4(G,J,X)).join(`
14
+ `)}function sZ($){return rZ($)}function rZ($){if(!$||typeof $!=="object")return!0;if(Array.isArray($))return $.every((Z)=>rZ(Z));if($.$prototype)return!1;if($.$ref)return!1;if($.state)for(let Z of Object.values($.state)){if(!Z||typeof Z!=="object")continue;let X=Z;if(X.$prototype)return!1;if(X.$ref)return!1}for(let Z of Object.keys($))if(Z.startsWith("on")&&Z!=="observedAttributes")return!1;if(Array.isArray($.children))return $.children.every((Z)=>rZ(Z));if($.children&&typeof $.children==="object"&&$.children.$prototype)return!1;return!0}function qG($,Z,X=null,Q={}){let J=[];if(Z&&typeof Z==="object"){let G=[];for(let[W,Y]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&w0(Y))continue;G.push(` ${R$(W)}: ${Y};`)}if(G.length>0)J.push(`${$} {
13
15
  ${G.join(`
14
16
  `)}
15
- }`);for(let[W,Y]of Object.entries(Z))if(W.startsWith("@"))N5(J,W,Q,$,Y);else if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")){let z=W.startsWith("&")?W.replace("&",$):`${$}${W}`;J.push(`${z} { ${a$(Y)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let W of X.children)B1(W,J,Q,"",G,$)}return J.length>0?`${J.join(`
17
+ }`);for(let[W,Y]of Object.entries(Z))if(W.startsWith("@"))_8(J,W,Q,$,Y);else if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")){let z=W.startsWith("&")?W.replace("&",$):`${$}${W}`;J.push(`${z} { ${a$(Y)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let W of X.children)F6(W,J,Q,"",G,$)}return J.length>0?`${J.join(`
16
18
  `)}
17
- `:""}var K4="https://esm.sh/@vue/reactivity@3.5.40",H4="https://esm.sh/lit-html@3.3.0",gZ;var F1=t(()=>{Y9();W9();M5();D6();Y9();W9();M5();D6();gZ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function c6($){if($.startsWith("\\\\?\\"))return $;return $.split("\\").join("/")}var aA,q9=()=>aA;var aJ=t(()=>{aA=/^win/.test(globalThis.process?globalThis.process.platform:"")});function n0($,Z){let X=new URL(c6($),"https://aaa.nonexistanturl.com"),Q=new URL(c6(Z),X),J=Z.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:W,search:Y,hash:z}=Q;return W+Y+decodeURIComponent(z)+J}let G=Q.toString()+J;if(G.includes("#")){let[W,Y]=G.split("#",2);return W+"#"+decodeURIComponent(Y||"")}return G}function h1(){if(typeof window<"u"&&window.location&&window.location.href){let $=window.location.href;if(!$||!$.startsWith("http"))try{return new URL($),$}catch{return"/"}return $}if(typeof process<"u"&&process.cwd){let $=process.cwd(),Z=$.slice(-1);if(Z==="/"||Z==="\\")return $;else return $+"/"}return"/"}function sJ($){let Z=sA.exec($||"");if(Z)return Z[1].toLowerCase();return}function tJ($){let Z=$.lastIndexOf(".");if(Z>=0)return Q2($.substring(Z).toLowerCase());return""}function Q2($){let Z=$.indexOf("?");if(Z>=0)$=$.substring(0,Z);return $}function T6($){if(!$)return"#";let Z=$.indexOf("#");if(Z>=0)return $.substring(Z);return"#"}function r0($){if(!$)return"";let Z=$.indexOf("#");if(Z>=0)$=$.substring(0,Z);return $}function eJ($){let Z=sJ($);if(Z==="http"||Z==="https")return!0;else if(Z===void 0)return typeof window<"u";else return!1}function T5($){if(!$||typeof $!=="string")return!0;let Z=$.trim().toLowerCase();if(!Z)return!0;if(Z.startsWith("javascript:")||Z.startsWith("vbscript:")||Z.startsWith("data:"))return!0;if(Z.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(Z.startsWith("//")?"http:"+Z:Z);if($G(X.hostname))return!0;let Q=X.port;if(Q&&q2(parseInt(Q)))return!0}catch{if(Z.startsWith("/")&&!Z.startsWith("//"))return!1;if(z2(Z))return!0}return!1}function $G($){let Z=J2($);if(!Z)return!0;if(Z==="localhost"||X2.some((J)=>Z.endsWith(J)))return!0;let X=ZG(Z);if(X)return XG(X);let Q=G2(Z);if(Q)return W2(Q);return!1}function J2($){let Z=$.trim().toLowerCase();if(Z.startsWith("[")&&Z.endsWith("]"))Z=Z.slice(1,-1);while(Z.endsWith("."))Z=Z.slice(0,-1);return Z}function ZG($){let Z=$.split(".");if(Z.length!==4)return;let X=Z.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function XG([$,Z,X,Q]){return $===0||$===10||$===127||$===100&&Z>=64&&Z<=127||$===169&&Z===254||$===172&&Z>=16&&Z<=31||$===192&&Z===0&&X===0||$===192&&Z===168||$===198&&(Z===18||Z===19)||$>=224||$===255&&Z===255&&X===255&&Q===255}function G2($){if(!$.includes(":"))return;let Z=$,X=Z.lastIndexOf(":"),Q=Z.slice(X+1);if(Q.includes(".")){let z=ZG(Q);if(!z)return;let q=z[0]*256+z[1],H=z[2]*256+z[3];Z=`${Z.slice(0,X+1)}${q.toString(16)}:${H.toString(16)}`}let J=Z.split("::");if(J.length>2)return;let G=oJ(J[0]),W=J.length===2?oJ(J[1]):[];if(!G||!W)return;if(J.length===1)return G.length===8?G:void 0;let Y=8-G.length-W.length;if(Y<1)return;return[...G,...Array(Y).fill(0),...W]}function oJ($){if(!$)return[];let Z=$.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(Z.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return Z}function W2($){if($.length!==8)return!1;let Z=$.every((Y)=>Y===0),X=$.slice(0,7).every((Y)=>Y===0)&&$[7]===1,Q=($[0]&65024)===64512,J=($[0]&65472)===65152,G=($[0]&65280)===65280;if(Z||X||Q||J||G)return!0;let W=Y2($);return W?XG(W):!1}function Y2($){let Z=$.slice(0,5).every((J)=>J===0),X=Z&&$[5]===0,Q=Z&&$[5]===65535;if(!X&&!Q)return;return[Math.floor($[6]/256),$[6]%256,Math.floor($[7]/256),$[7]%256]}function z2($){return $.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>$G(X))}function q2($){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes($)}function j5($){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let Z=sJ($);return Z===void 0||Z==="file"}function QG($){if(q9()){let Z=h1(),X=$.toUpperCase(),J=c6(Z).toUpperCase(),G=X.includes(J),W=X.includes(J),Y=$2.test($)||$.startsWith("http://")||$.startsWith("https://")||$.startsWith("file://");if(!(G||W||Y)&&!Z.startsWith("http"))$=((q,H)=>{if(q.endsWith("/")||q.endsWith("\\"))return q+H;else return q+"/"+H})(Z,$);$=c6($)}$=encodeURI($);for(let Z of Z2)$=$.replace(Z[0],Z[1]);return $}function A4($,Z){$=$.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),$=decodeURI($);for(let Q=0;Q<hZ.length;Q+=2)$=$.replace(hZ[Q],hZ[Q+1]);let X=$.toLowerCase().startsWith("file://");if(X){if($=$.replace(/^file:\/\//,"").replace(/^\//,""),q9()&&$[1]==="/")$=`${$[0]}:${$.substring(1)}`;if(Z)$="file:///"+$;else X=!1,$=q9()?$:"/"+$}if(q9()&&!X){if($=$.replace(oA,"\\"),$.match(/^[a-z]:\\/i))$=$[0].toUpperCase()+$.substring(1)}return $}function O5($){if($.length<=1||$[0]!=="#"||$[1]!=="/")return[];return $.slice(2).split("/").map((Z)=>{return Z.replace(tA,"/").replace(eA,"~")})}var oA,sA,tA,eA,$2,Z2,hZ,X2,M4=($)=>new URL($);var R$=t(()=>{aJ();oA=/\//g,sA=/^(\w{2,}):\/\//i,tA=/~1/g,eA=/~0/g,$2=/^[a-zA-Z]:[\\/]/,Z2=[[/\?/g,"%3F"],[/#/g,"%23"]],hZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],X2=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function JG(){let $={},Z=this;for(let X of V2(Z))if(typeof X==="string"){let Q=Z[X],J=typeof Q;if(!U2.includes(J))$[X]=Q}return $}function V2($,Z=[]){let X=[];while($&&$!==H2)X=X.concat(Object.getOwnPropertyNames($),Object.getOwnPropertySymbols($)),$=Object.getPrototypeOf($);let Q=new Set(X);for(let J of Z.concat(K2))Q.delete(J);return Q}function O6($){return $ instanceof l$||$ instanceof I4}function mZ($){if($.path===null)$.path=[];return $}var U2,K2,H2,l$,I4,o$,E5,Y6,R5,P5,uZ,N4;var s$=t(()=>{R$();U2=["function","symbol","undefined"],K2=["constructor","prototype","__proto__"],H2=Object.getPrototypeOf({});l$=class l$ extends Error{name;message;source;path;code;constructor($,Z){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=$,this.source=Z,this.path=null}toJSON=JG.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};I4=class I4 extends Error{files;constructor($){super();this.files=$,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${A4($.$refs._root$Ref.path)}'`}toJSON=JG.bind(this);static getParserErrors($){let Z=[];for(let X of Object.values($.$refs._$refs))if(X.errors)Z.push(...X.errors);return Z}get errors(){return I4.getParserErrors(this.files)}};o$=class o$ extends l${code="EPARSER";name="ParserError";constructor($,Z){super(`Error parsing ${Z}: ${$}`,Z)}};E5=class E5 extends l${code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor($){super(`Could not find parser for "${$}"`,$)}};Y6=class Y6 extends l${code="ERESOLVER";name="ResolverError";ioErrorCode;constructor($,Z){super($.message||`Error reading file "${Z}"`,Z);if("code"in $)this.ioErrorCode=String($.code)}};R5=class R5 extends l${code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor($){super(`Could not find resolver for "${$}"`,$)}};P5=class P5 extends l${code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor($,Z,X,Q,J){super(`Missing $ref pointer "${T6(Z)}". Token "${$}" does not exist.`,r0(Z));this.targetToken=$,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};uZ=class uZ extends l${code="ETIMEOUT";name="TimeoutError";constructor($){super(`Dereferencing timeout reached: ${$}ms`)}};N4=class N4 extends l${code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor($,Z){super(`Invalid $ref pointer "${$}". Pointers must begin with "#/"`,r0(Z))}}});function M$($,Z){let X=B2(Z);return X?n0($,X):$}function C5($){if(!$||typeof $!=="object"||ArrayBuffer.isView($))return!1;let Z=$.$schema;if(typeof Z==="string"&&(Z.includes("draft/2019-09/")||Z.includes("draft/2020-12/")||Z.includes("oas/3.1/")))return!0;let X=$.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function S5($,Z,X,Q,J=!1){if(!J)return;let G=new Set,W=(Y,z)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||G.has(Y))return;G.add(Y);let q=M$(z,Y);if(q!==z)$._addAlias(q,Y,Q,J);for(let H of Object.keys(Y))W(Y[H],q)};W(X,Z)}function B2($){if($&&typeof $==="object"&&"$id"in $&&typeof $.$id==="string"&&$.$id.length>0)return $.$id;return}var u1=t(()=>{R$()});class m1{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor($,Z,X){this.$ref=$,this.path=Z,this.originalPath=X||Z,this.scopeBase=$.path||r0(Z),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve($,Z,X,Q=new Set,J=!0){let G=m1.parse(this.path,this.originalPath),W=[];if(this.value=WG($),this.$ref.dynamicIdScope&&!YG(this.$ref))this.scopeBase=M$(this.scopeBase,this.value);for(let z=0;z<G.length;z++){let q=this.circular,H=this.chainCircular,B=l0.isExtended$Ref(this.value);if(_5(this,Z,X,Q))this.path=m1.join(this.path,G.slice(z));else if(B)this.circular=q,this.chainCircular=H;let L=G[z];if(this.value[L]===void 0||this.value[L]===null&&z===G.length-1){let M=!1;for(let E=G.length-1;E>z;E--){let P=G.slice(z,E+1).join("/");if(this.value[P]!==void 0){this.value=this.value[P],z=E,M=!0;break}}if(M){this.chainCircular=H;continue}if(L in this.value&&this.value[L]===null){this.value=x5,this.chainCircular=H;continue}this.value=null;let A=this.$ref.path||"",w=this.path.replace(A,""),D=m1.join("",W),j=X?.replace(A,"");throw new P5(L,decodeURI(this.originalPath),w,D,j)}else this.value=this.value[L];if(this.chainCircular=H,W.push(L),this.$ref.dynamicIdScope)this.scopeBase=M$(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let z=this.value?.$ref?n0(Y,this.value.$ref):void 0,q=typeof X==="string"?n0(this.$ref.$refs._root$Ref.path,X):X;if(l0.isAllowed$Ref(this.value,Z)&&z===q&&z!==this.path)this.chainCircular=!0;else if(!this.value||z)_5(this,Z,X,Q)}return this}set($,Z,X){let Q=m1.parse(this.path),J;if(Q.length===0)return this.value=Z,Z;if(N2(this.path,Q),this.value=WG($),this.$ref.dynamicIdScope&&!YG(this.$ref))this.scopeBase=M$(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(_5(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=GG(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=M$(this.scopeBase,this.value)}return _5(this,X),J=Q[Q.length-1],GG(this,J,Z),$}static parse($,Z){let X=T6($).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(M2,"/").replace(A2,"~");if(Q[0]!=="")throw new N4(X,Z===void 0?$:Z);return Q.slice(1)}static join($,Z){if($.indexOf("#")===-1)$+="#";Z=Array.isArray(Z)?Z:[Z];for(let X=0;X<Z.length;X++){let Q=Z[X];$+="/"+Q.replace(L2,"~0").replace(F2,"~1")}return $}}function _5($,Z,X,Q=new Set){let J=!1,G=X,W=[];try{while(l0.isAllowed$Ref($.value,Z)){let Y=l0.isExtended$Ref($.value),z=$.value,q=$.path,H=$.$ref.dynamicIdScope?$.scopeBase:$.path,B=n0(H,$.value.$ref);if(B===$.path&&!D2(G))return $.circular=!0,$.chainCircular=!0,J;let L=typeof G==="string"?n0($.$ref.$refs._root$Ref.path,G):G;if(B===L&&B!==$.path)return $.chainCircular=!0,J;if(Q.has(B))return $.chainCircular=!0,J;let M=Z?.dereference?.maxDepth??500;if(Q.size>=M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${$.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);Q.add(B),W.push(B);let A=$.$ref.$refs._resolve(B,q,Z,Q,Y);if(A===null)return J;if($.indirections+=A.indirections+1,$.chainCircular||=A.circular||A.chainCircular,Y){if($.chainCircular)return J;return $.value=l0.dereference(z,A.value,Z),J}else $.$ref=A.$ref,$.path=A.path,$.value=A.value,$.scopeBase=A.scopeBase,G=q,J=!0}return J}finally{for(let Y of W)Q.delete(Y)}}function GG($,Z,X){if($.value&&typeof $.value==="object")if(Z==="-"&&Array.isArray($.value))$.value.push(X);else $.value[Z]=X;else throw new l$(`Error assigning $ref pointer "${$.path}".
18
- Cannot set "${Z}" of a non-object.`);return X}function N2($,Z){for(let X of Z)if(I2.has(X))throw new l$(`Error assigning $ref pointer "${$}".
19
- Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function WG($){if(O6($))throw $;return $}function D2($){return typeof $=="string"&&m1.parse($).length==0}function YG($){return Boolean($.path&&$.path in $.$refs._aliases)}var x5,F2,L2,M2,A2,I2,P$;var U9=t(()=>{D4();R$();s$();u1();x5=Symbol("null"),F2=/\//g,L2=/~/g,M2=/~1/g,A2=/~0/g,I2=new Set(["__proto__","constructor","prototype"]);P$=m1});class K9{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor($){this.$refs=$}addError($){if(this.errors===void 0)this.errors=[];let Z=this.errors.map(({footprint:X})=>X);if("errors"in $&&Array.isArray($.errors))this.errors.push(...$.errors.map(mZ).filter(({footprint:X})=>!Z.includes(X)));else if(!("footprint"in $)||!Z.includes($.footprint))this.errors.push(mZ($))}exists($,Z){try{return this.resolve($,Z),!0}catch{return!1}}get($,Z){return this.resolve($,Z)?.value}resolve($,Z,X,Q,J,G=!0){let W=new P$(this,$,X);try{let Y=W.resolve(this.value,Z,Q,J,G);if(Y.value===x5)Y.value=null;return Y}catch(Y){if(!Z||!Z.continueOnError||!O6(Y))throw Y;if(Y.path===null)Y.path=O5(T6(Q));if(Y instanceof N4)Y.source=decodeURI(r0(Q));return this.addError(Y),null}}set($,Z){let X=new P$(this,$);if(this.value=X.set(this.value,Z),this.value===x5)this.value=null}static is$Ref($){return Boolean($)&&typeof $==="object"&&$!==null&&"$ref"in $&&typeof $.$ref==="string"&&$.$ref.length>0}static isExternal$Ref($){return K9.is$Ref($)&&$.$ref[0]!=="#"}static isAllowed$Ref($,Z){if(this.is$Ref($)){if($.$ref.substring(0,2)==="#/"||$.$ref==="#")return!0;else if($.$ref[0]!=="#"&&(!Z||Z.resolve?.external))return!0}return}static isExtended$Ref($){return K9.is$Ref($)&&Object.keys($).length>1}static dereference($,Z,X){if(Z&&typeof Z==="object"&&K9.isExtended$Ref($)){let Q={};for(let G of Object.keys($))if(G!=="$ref")Q[G]=$[G];let J=X?.dereference?.mergeKeys??!0;for(let G of Object.keys(Z)){let W=G;if(!(W in Q))Q[W]=Z[W];else if(J&&typeof Q[W]==="object"&&Q[W]!==null&&typeof Z[W]==="object"&&Z[W]!==null)Q[W]=zG(Z[W],Q[W])}return Q}else return Z}}function zG($,Z){if(typeof $!=="object"||$===null)return Z;if(typeof Z!=="object"||Z===null)return Z;let X=Array.isArray($)?[...$]:{...$};for(let Q of Object.keys(Z))if(Array.isArray(Z[Q]))X[Q]=[...Z[Q]];else if(typeof Z[Q]==="object"&&Z[Q]!==null)X[Q]=zG($[Q],Z[Q]);else X[Q]=Z[Q];return X}var l0;var D4=t(()=>{U9();s$();R$();l0=K9});class H9{circular;paths(...$){return qG(this._$refs,$.flat()).map((X)=>{return c6(X.decoded)})}values(...$){let Z=this._$refs;return qG(Z,$.flat()).reduce((Q,J)=>{return Q[c6(J.decoded)]=Z[J.encoded].value,Q},{})}exists($,Z){try{return this._resolve($,"",Z),!0}catch{return!1}}get($,Z){return this._resolve($,"",Z).value}set($,Z){let X=n0(this._root$Ref.path,$),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${$}".
20
- "${r0(X)}" not found.`);Q.set(X,Z)}_get$Ref($){return $=n0(this._root$Ref.path,$),this._getRef($)}_add($){let Z=r0($),X=new l0(this);return X.path=Z,this._$refs[Z]=X,this._root$Ref=this._root$Ref||X,X}_addAlias($,Z,X,Q=!1){let J=r0($);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new l0(this);return G.path=J,G.pathType=X,G.value=Z,G.dynamicIdScope=Q,this._aliases[J]=G,G}_resolve($,Z,X,Q,J=!0){let G=n0(this._root$Ref.path,$),W=this._getRef(G);if(!W)throw Error(`Error resolving $ref pointer "${$}".
21
- "${r0(G)}" not found.`);return W.resolve(G,X,$,Z,Q,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef($){let Z=r0($);return this._$refs[Z]||this._aliases[Z]}}function qG($,Z){let X=Object.keys($);if(Z=Array.isArray(Z[0])?Z[0]:Array.prototype.slice.call(Z),Z.length>0&&Z[0])X=X.filter((Q)=>{return Z.includes($[Q].pathType)});return X.map((Q)=>{return{encoded:Q,decoded:$[Q].pathType==="file"?A4(Q,!0):Q}})}var UG=t(()=>{D4();R$()});function dZ($){return Object.keys($||{}).filter((Z)=>{return typeof $[Z]==="object"}).map((Z)=>{return $[Z].name=Z,$[Z]})}function lZ($,Z,X,Q,J){return $.filter((G)=>{return!!KG(G,Z,X,Q,J)})}function cZ($){for(let Z of $)Z.order=Z.order||Number.MAX_SAFE_INTEGER;return $.sort((Z,X)=>{return Z.order-X.order})}async function pZ($,Z,X,Q){let J,G,W=0;return new Promise((Y,z)=>{q();function q(){if(J=$[W++],!J)return z(G);try{let M=KG(J,Z,X,H,Q);if(M&&typeof M.then==="function")M.then(B,L);else if(M!==void 0)B(M);else if(W===$.length)throw Error("No promise has been returned or callback has been called.")}catch(M){L(M)}}function H(M,A){if(M)L(M);else B(A)}function B(M){Y({plugin:J,result:M})}function L(M){G={plugin:J,error:M},q()}})}function KG($,Z,X,Q,J){let G=$[Z];if(typeof G==="function")return G.apply($,[X,Q,J]);if(!Q){if(G instanceof RegExp)return G.test(X.url);else if(typeof G==="string")return G===X.extension;else if(Array.isArray(G))return G.indexOf(X.extension)!==-1}return G}async function w2($,Z,X){let Q=typeof $==="string"?$:$.url,J=typeof $==="string"?void 0:$.baseUrl,G=typeof $==="string"?void 0:$.reference,W=Q.indexOf("#"),Y="";if(W>=0)Y=Q.substring(W),Q=Q.substring(0,W);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let z=Z._add(Q),q={url:Q,hash:Y,extension:tJ(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await T2(q,X,Z);z.pathType=H.plugin.name,q.data=H.result;let B=await j2(q,X,Z);return z.value=B.result,z.dynamicIdScope=C5(z.value),S5(Z,z.path,z.value,z.pathType,z.dynamicIdScope),B.result}catch(H){if(O6(H))z.value=H;throw H}}async function T2($,Z,X){let Q=dZ(Z.resolve);Q=lZ(Q,"canRead",$,void 0,X),cZ(Q);try{return await pZ(Q,"read",$,X)}catch(J){if(!J&&Z.continueOnError)throw new R5($.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${$.url}"`,{cause:J});else if(J.error instanceof Y6)throw J.error;else throw new Y6(J,$.url)}}async function j2($,Z,X){let Q=dZ(Z.parse),J=lZ(Q,"canParse",$),G=J.length>0?J:Q;cZ(G);try{let W=await pZ(G,"parse",$,X);if(!W.plugin.allowEmpty&&O2(W.result))throw SyntaxError(`Error parsing "${$.url}" as ${W.plugin.name}.
22
- Parsed value is empty`);else return W}catch(W){if(!W&&Z.continueOnError)throw new E5($.url);else if(W&&W.message&&W.message.startsWith("Error parsing"))throw W;else if(!W||!("error"in W))throw SyntaxError(`Unable to parse ${$.url}`,{cause:W});else if(W.error instanceof o$)throw W.error;else throw new o$(W.error.message,$.url)}}function O2($){return $===void 0||typeof $==="object"&&Object.keys($).length===0||typeof $==="string"&&$.trim().length===0||Buffer.isBuffer($)&&$.length===0}var b5;var iZ=t(()=>{R$();u1();s$();b5=w2});var HG;var VG=t(()=>{s$();HG={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")if(Z.trim().length===0)return;else try{return JSON.parse(Z)}catch(X){if(this.allowBOM)try{let Q=Z.indexOf("{");return Z=Z.slice(Q),JSON.parse(Z)}catch(Q){throw new o$(Q.message,$.url)}throw new o$(X.message,$.url)}else return Z}}});function E2($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}function V9(){if(BG)return L1;BG=1;function $(W){return typeof W>"u"||W===null}function Z(W){return typeof W==="object"&&W!==null}function X(W){if(Array.isArray(W))return W;else if($(W))return[];return[W]}function Q(W,Y){if(Y){let z=Object.keys(Y);for(let q=0,H=z.length;q<H;q+=1){let B=z[q];W[B]=Y[B]}}return W}function J(W,Y){let z="";for(let q=0;q<Y;q+=1)z+=W;return z}function G(W){return W===0&&Number.NEGATIVE_INFINITY===1/W}return L1.isNothing=$,L1.isObject=Z,L1.toArray=X,L1.repeat=J,L1.isNegativeZero=G,L1.extend=Q,L1}function B9(){if(FG)return nZ;FG=1;function $(X,Q){let J="",G=X.reason||"(unknown reason)";if(!X.mark)return G;if(X.mark.name)J+='in "'+X.mark.name+'" ';if(J+="("+(X.mark.line+1)+":"+(X.mark.column+1)+")",!Q&&X.mark.snippet)J+=`
19
+ `:""}var nZ,M4="https://esm.sh/@vue/reactivity@3.5.40",A4="https://esm.sh/lit-html@3.3.0",d6,oZ;var L6=s(()=>{V9();H9();E8();w1();V9();H9();E8();w1();nZ=Symbol("jx.runtimeOnlyStateKeys");d6=new Set(["pre","textarea","listing","plaintext","xmp"]);oZ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function i1($){if($.startsWith("\\\\?\\"))return $;return $.split("\\").join("/")}var M2,L9=()=>M2;var KG=s(()=>{M2=/^win/.test(globalThis.process?globalThis.process.platform:"")});function a0($,Z){let X=new URL(i1($),"https://aaa.nonexistanturl.com"),Q=new URL(i1(Z),X),J=Z.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:W,search:Y,hash:z}=Q;return W+Y+decodeURIComponent(z)+J}let G=Q.toString()+J;if(G.includes("#")){let[W,Y]=G.split("#",2);return W+"#"+decodeURIComponent(Y||"")}return G}function c6(){if(typeof window<"u"&&window.location&&window.location.href){let $=window.location.href;if(!$||!$.startsWith("http"))try{return new URL($),$}catch{return"/"}return $}if(typeof process<"u"&&process.cwd){let $=process.cwd(),Z=$.slice(-1);if(Z==="/"||Z==="\\")return $;else return $+"/"}return"/"}function HG($){let Z=I2.exec($||"");if(Z)return Z[1].toLowerCase();return}function VG($){let Z=$.lastIndexOf(".");if(Z>=0)return O2($.substring(Z).toLowerCase());return""}function O2($){let Z=$.indexOf("?");if(Z>=0)$=$.substring(0,Z);return $}function j1($){if(!$)return"#";let Z=$.indexOf("#");if(Z>=0)return $.substring(Z);return"#"}function o0($){if(!$)return"";let Z=$.indexOf("#");if(Z>=0)$=$.substring(0,Z);return $}function BG($){let Z=HG($);if(Z==="http"||Z==="https")return!0;else if(Z===void 0)return typeof window<"u";else return!1}function k8($){if(!$||typeof $!=="string")return!0;let Z=$.trim().toLowerCase();if(!Z)return!0;if(Z.startsWith("javascript:")||Z.startsWith("vbscript:")||Z.startsWith("data:"))return!0;if(Z.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(Z.startsWith("//")?"http:"+Z:Z);if(FG(X.hostname))return!0;let Q=X.port;if(Q&&_2(parseInt(Q)))return!0}catch{if(Z.startsWith("/")&&!Z.startsWith("//"))return!1;if(S2(Z))return!0}return!1}function FG($){let Z=E2($);if(!Z)return!0;if(Z==="localhost"||j2.some((J)=>Z.endsWith(J)))return!0;let X=LG(Z);if(X)return MG(X);let Q=R2(Z);if(Q)return P2(Q);return!1}function E2($){let Z=$.trim().toLowerCase();if(Z.startsWith("[")&&Z.endsWith("]"))Z=Z.slice(1,-1);while(Z.endsWith("."))Z=Z.slice(0,-1);return Z}function LG($){let Z=$.split(".");if(Z.length!==4)return;let X=Z.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function MG([$,Z,X,Q]){return $===0||$===10||$===127||$===100&&Z>=64&&Z<=127||$===169&&Z===254||$===172&&Z>=16&&Z<=31||$===192&&Z===0&&X===0||$===192&&Z===168||$===198&&(Z===18||Z===19)||$>=224||$===255&&Z===255&&X===255&&Q===255}function R2($){if(!$.includes(":"))return;let Z=$,X=Z.lastIndexOf(":"),Q=Z.slice(X+1);if(Q.includes(".")){let z=LG(Q);if(!z)return;let q=z[0]*256+z[1],H=z[2]*256+z[3];Z=`${Z.slice(0,X+1)}${q.toString(16)}:${H.toString(16)}`}let J=Z.split("::");if(J.length>2)return;let G=UG(J[0]),W=J.length===2?UG(J[1]):[];if(!G||!W)return;if(J.length===1)return G.length===8?G:void 0;let Y=8-G.length-W.length;if(Y<1)return;return[...G,...Array(Y).fill(0),...W]}function UG($){if(!$)return[];let Z=$.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(Z.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return Z}function P2($){if($.length!==8)return!1;let Z=$.every((Y)=>Y===0),X=$.slice(0,7).every((Y)=>Y===0)&&$[7]===1,Q=($[0]&65024)===64512,J=($[0]&65472)===65152,G=($[0]&65280)===65280;if(Z||X||Q||J||G)return!0;let W=C2($);return W?MG(W):!1}function C2($){let Z=$.slice(0,5).every((J)=>J===0),X=Z&&$[5]===0,Q=Z&&$[5]===65535;if(!X&&!Q)return;return[Math.floor($[6]/256),$[6]%256,Math.floor($[7]/256),$[7]%256]}function S2($){return $.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>FG(X))}function _2($){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes($)}function y8($){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let Z=HG($);return Z===void 0||Z==="file"}function AG($){if(L9()){let Z=c6(),X=$.toUpperCase(),J=i1(Z).toUpperCase(),G=X.includes(J),W=X.includes(J),Y=w2.test($)||$.startsWith("http://")||$.startsWith("https://")||$.startsWith("file://");if(!(G||W||Y)&&!Z.startsWith("http"))$=((q,H)=>{if(q.endsWith("/")||q.endsWith("\\"))return q+H;else return q+"/"+H})(Z,$);$=i1($)}$=encodeURI($);for(let Z of T2)$=$.replace(Z[0],Z[1]);return $}function j4($,Z){$=$.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),$=decodeURI($);for(let Q=0;Q<tZ.length;Q+=2)$=$.replace(tZ[Q],tZ[Q+1]);let X=$.toLowerCase().startsWith("file://");if(X){if($=$.replace(/^file:\/\//,"").replace(/^\//,""),L9()&&$[1]==="/")$=`${$[0]}:${$.substring(1)}`;if(Z)$="file:///"+$;else X=!1,$=L9()?$:"/"+$}if(L9()&&!X){if($=$.replace(A2,"\\"),$.match(/^[a-z]:\\/i))$=$[0].toUpperCase()+$.substring(1)}return $}function v8($){if($.length<=1||$[0]!=="#"||$[1]!=="/")return[];return $.slice(2).split("/").map((Z)=>{return Z.replace(N2,"/").replace(D2,"~")})}var A2,I2,N2,D2,w2,T2,tZ,j2,T4=($)=>new URL($);var P$=s(()=>{KG();A2=/\//g,I2=/^(\w{2,}):\/\//i,N2=/~1/g,D2=/~0/g,w2=/^[a-zA-Z]:[\\/]/,T2=[[/\?/g,"%3F"],[/#/g,"%23"]],tZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],j2=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function IG(){let $={},Z=this;for(let X of y2(Z))if(typeof X==="string"){let Q=Z[X],J=typeof Q;if(!b2.includes(J))$[X]=Q}return $}function y2($,Z=[]){let X=[];while($&&$!==k2)X=X.concat(Object.getOwnPropertyNames($),Object.getOwnPropertySymbols($)),$=Object.getPrototypeOf($);let Q=new Set(X);for(let J of Z.concat(x2))Q.delete(J);return Q}function E1($){return $ instanceof l$||$ instanceof O4}function $7($){if($.path===null)$.path=[];return $}var b2,x2,k2,l$,O4,s$,g8,Y1,f8,h8,eZ,E4;var t$=s(()=>{P$();b2=["function","symbol","undefined"],x2=["constructor","prototype","__proto__"],k2=Object.getPrototypeOf({});l$=class l$ extends Error{name;message;source;path;code;constructor($,Z){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=$,this.source=Z,this.path=null}toJSON=IG.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};O4=class O4 extends Error{files;constructor($){super();this.files=$,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${j4($.$refs._root$Ref.path)}'`}toJSON=IG.bind(this);static getParserErrors($){let Z=[];for(let X of Object.values($.$refs._$refs))if(X.errors)Z.push(...X.errors);return Z}get errors(){return O4.getParserErrors(this.files)}};s$=class s$ extends l${code="EPARSER";name="ParserError";constructor($,Z){super(`Error parsing ${Z}: ${$}`,Z)}};g8=class g8 extends l${code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor($){super(`Could not find parser for "${$}"`,$)}};Y1=class Y1 extends l${code="ERESOLVER";name="ResolverError";ioErrorCode;constructor($,Z){super($.message||`Error reading file "${Z}"`,Z);if("code"in $)this.ioErrorCode=String($.code)}};f8=class f8 extends l${code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor($){super(`Could not find resolver for "${$}"`,$)}};h8=class h8 extends l${code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor($,Z,X,Q,J){super(`Missing $ref pointer "${j1(Z)}". Token "${$}" does not exist.`,o0(Z));this.targetToken=$,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};eZ=class eZ extends l${code="ETIMEOUT";name="TimeoutError";constructor($){super(`Dereferencing timeout reached: ${$}ms`)}};E4=class E4 extends l${code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor($,Z){super(`Invalid $ref pointer "${$}". Pointers must begin with "#/"`,o0(Z))}}});function A$($,Z){let X=v2(Z);return X?a0($,X):$}function u8($){if(!$||typeof $!=="object"||ArrayBuffer.isView($))return!1;let Z=$.$schema;if(typeof Z==="string"&&(Z.includes("draft/2019-09/")||Z.includes("draft/2020-12/")||Z.includes("oas/3.1/")))return!0;let X=$.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function m8($,Z,X,Q,J=!1){if(!J)return;let G=new Set,W=(Y,z)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||G.has(Y))return;G.add(Y);let q=A$(z,Y);if(q!==z)$._addAlias(q,Y,Q,J);for(let H of Object.keys(Y))W(Y[H],q)};W(X,Z)}function v2($){if($&&typeof $==="object"&&"$id"in $&&typeof $.$id==="string"&&$.$id.length>0)return $.$id;return}var p6=s(()=>{P$()});class i6{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor($,Z,X){this.$ref=$,this.path=Z,this.originalPath=X||Z,this.scopeBase=$.path||o0(Z),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve($,Z,X,Q=new Set,J=!0){let G=i6.parse(this.path,this.originalPath),W=[];if(this.value=DG($),this.$ref.dynamicIdScope&&!wG(this.$ref))this.scopeBase=A$(this.scopeBase,this.value);for(let z=0;z<G.length;z++){let q=this.circular,H=this.chainCircular,B=c0.isExtended$Ref(this.value);if(d8(this,Z,X,Q))this.path=i6.join(this.path,G.slice(z));else if(B)this.circular=q,this.chainCircular=H;let F=G[z];if(this.value[F]===void 0||this.value[F]===null&&z===G.length-1){let L=!1;for(let E=G.length-1;E>z;E--){let P=G.slice(z,E+1).join("/");if(this.value[P]!==void 0){this.value=this.value[P],z=E,L=!0;break}}if(L){this.chainCircular=H;continue}if(F in this.value&&this.value[F]===null){this.value=l8,this.chainCircular=H;continue}this.value=null;let w=this.$ref.path||"",N=this.path.replace(w,""),I=i6.join("",W),T=X?.replace(w,"");throw new h8(F,decodeURI(this.originalPath),N,I,T)}else this.value=this.value[F];if(this.chainCircular=H,W.push(F),this.$ref.dynamicIdScope)this.scopeBase=A$(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let z=this.value?.$ref?a0(Y,this.value.$ref):void 0,q=typeof X==="string"?a0(this.$ref.$refs._root$Ref.path,X):X;if(c0.isAllowed$Ref(this.value,Z)&&z===q&&z!==this.path)this.chainCircular=!0;else if(!this.value||z)d8(this,Z,X,Q)}return this}set($,Z,X){let Q=i6.parse(this.path),J;if(Q.length===0)return this.value=Z,Z;if(d2(this.path,Q),this.value=DG($),this.$ref.dynamicIdScope&&!wG(this.$ref))this.scopeBase=A$(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(d8(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=NG(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=A$(this.scopeBase,this.value)}return d8(this,X),J=Q[Q.length-1],NG(this,J,Z),$}static parse($,Z){let X=j1($).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(h2,"/").replace(u2,"~");if(Q[0]!=="")throw new E4(X,Z===void 0?$:Z);return Q.slice(1)}static join($,Z){if($.indexOf("#")===-1)$+="#";Z=Array.isArray(Z)?Z:[Z];for(let X=0;X<Z.length;X++){let Q=Z[X];$+="/"+Q.replace(f2,"~0").replace(g2,"~1")}return $}}function d8($,Z,X,Q=new Set){let J=!1,G=X,W=[];try{while(c0.isAllowed$Ref($.value,Z)){let Y=c0.isExtended$Ref($.value),z=$.value,q=$.path,H=$.$ref.dynamicIdScope?$.scopeBase:$.path,B=a0(H,$.value.$ref);if(B===$.path&&!l2(G))return $.circular=!0,$.chainCircular=!0,J;let F=typeof G==="string"?a0($.$ref.$refs._root$Ref.path,G):G;if(B===F&&B!==$.path)return $.chainCircular=!0,J;if(Q.has(B))return $.chainCircular=!0,J;let L=Z?.dereference?.maxDepth??500;if(Q.size>=L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${$.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);Q.add(B),W.push(B);let w=$.$ref.$refs._resolve(B,q,Z,Q,Y);if(w===null)return J;if($.indirections+=w.indirections+1,$.chainCircular||=w.circular||w.chainCircular,Y){if($.chainCircular)return J;return $.value=c0.dereference(z,w.value,Z),J}else $.$ref=w.$ref,$.path=w.path,$.value=w.value,$.scopeBase=w.scopeBase,G=q,J=!0}return J}finally{for(let Y of W)Q.delete(Y)}}function NG($,Z,X){if($.value&&typeof $.value==="object")if(Z==="-"&&Array.isArray($.value))$.value.push(X);else $.value[Z]=X;else throw new l$(`Error assigning $ref pointer "${$.path}".
20
+ Cannot set "${Z}" of a non-object.`);return X}function d2($,Z){for(let X of Z)if(m2.has(X))throw new l$(`Error assigning $ref pointer "${$}".
21
+ Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function DG($){if(E1($))throw $;return $}function l2($){return typeof $=="string"&&i6.parse($).length==0}function wG($){return Boolean($.path&&$.path in $.$refs._aliases)}var l8,g2,f2,h2,u2,m2,C$;var M9=s(()=>{R4();P$();t$();p6();l8=Symbol("null"),g2=/\//g,f2=/~/g,h2=/~1/g,u2=/~0/g,m2=new Set(["__proto__","constructor","prototype"]);C$=i6});class A9{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor($){this.$refs=$}addError($){if(this.errors===void 0)this.errors=[];let Z=this.errors.map(({footprint:X})=>X);if("errors"in $&&Array.isArray($.errors))this.errors.push(...$.errors.map($7).filter(({footprint:X})=>!Z.includes(X)));else if(!("footprint"in $)||!Z.includes($.footprint))this.errors.push($7($))}exists($,Z){try{return this.resolve($,Z),!0}catch{return!1}}get($,Z){return this.resolve($,Z)?.value}resolve($,Z,X,Q,J,G=!0){let W=new C$(this,$,X);try{let Y=W.resolve(this.value,Z,Q,J,G);if(Y.value===l8)Y.value=null;return Y}catch(Y){if(!Z||!Z.continueOnError||!E1(Y))throw Y;if(Y.path===null)Y.path=v8(j1(Q));if(Y instanceof E4)Y.source=decodeURI(o0(Q));return this.addError(Y),null}}set($,Z){let X=new C$(this,$);if(this.value=X.set(this.value,Z),this.value===l8)this.value=null}static is$Ref($){return Boolean($)&&typeof $==="object"&&$!==null&&"$ref"in $&&typeof $.$ref==="string"&&$.$ref.length>0}static isExternal$Ref($){return A9.is$Ref($)&&$.$ref[0]!=="#"}static isAllowed$Ref($,Z){if(this.is$Ref($)){if($.$ref.substring(0,2)==="#/"||$.$ref==="#")return!0;else if($.$ref[0]!=="#"&&(!Z||Z.resolve?.external))return!0}return}static isExtended$Ref($){return A9.is$Ref($)&&Object.keys($).length>1}static dereference($,Z,X){if(Z&&typeof Z==="object"&&A9.isExtended$Ref($)){let Q={};for(let G of Object.keys($))if(G!=="$ref")Q[G]=$[G];let J=X?.dereference?.mergeKeys??!0;for(let G of Object.keys(Z)){let W=G;if(!(W in Q))Q[W]=Z[W];else if(J&&typeof Q[W]==="object"&&Q[W]!==null&&typeof Z[W]==="object"&&Z[W]!==null)Q[W]=TG(Z[W],Q[W])}return Q}else return Z}}function TG($,Z){if(typeof $!=="object"||$===null)return Z;if(typeof Z!=="object"||Z===null)return Z;let X=Array.isArray($)?[...$]:{...$};for(let Q of Object.keys(Z))if(Array.isArray(Z[Q]))X[Q]=[...Z[Q]];else if(typeof Z[Q]==="object"&&Z[Q]!==null)X[Q]=TG($[Q],Z[Q]);else X[Q]=Z[Q];return X}var c0;var R4=s(()=>{M9();t$();P$();c0=A9});class I9{circular;paths(...$){return jG(this._$refs,$.flat()).map((X)=>{return i1(X.decoded)})}values(...$){let Z=this._$refs;return jG(Z,$.flat()).reduce((Q,J)=>{return Q[i1(J.decoded)]=Z[J.encoded].value,Q},{})}exists($,Z){try{return this._resolve($,"",Z),!0}catch{return!1}}get($,Z){return this._resolve($,"",Z).value}set($,Z){let X=a0(this._root$Ref.path,$),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${$}".
22
+ "${o0(X)}" not found.`);Q.set(X,Z)}_get$Ref($){return $=a0(this._root$Ref.path,$),this._getRef($)}_add($){let Z=o0($),X=new c0(this);return X.path=Z,this._$refs[Z]=X,this._root$Ref=this._root$Ref||X,X}_addAlias($,Z,X,Q=!1){let J=o0($);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new c0(this);return G.path=J,G.pathType=X,G.value=Z,G.dynamicIdScope=Q,this._aliases[J]=G,G}_resolve($,Z,X,Q,J=!0){let G=a0(this._root$Ref.path,$),W=this._getRef(G);if(!W)throw Error(`Error resolving $ref pointer "${$}".
23
+ "${o0(G)}" not found.`);return W.resolve(G,X,$,Z,Q,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef($){let Z=o0($);return this._$refs[Z]||this._aliases[Z]}}function jG($,Z){let X=Object.keys($);if(Z=Array.isArray(Z[0])?Z[0]:Array.prototype.slice.call(Z),Z.length>0&&Z[0])X=X.filter((Q)=>{return Z.includes($[Q].pathType)});return X.map((Q)=>{return{encoded:Q,decoded:$[Q].pathType==="file"?j4(Q,!0):Q}})}var OG=s(()=>{R4();P$()});function Z7($){return Object.keys($||{}).filter((Z)=>{return typeof $[Z]==="object"}).map((Z)=>{return $[Z].name=Z,$[Z]})}function X7($,Z,X,Q,J){return $.filter((G)=>{return!!EG(G,Z,X,Q,J)})}function Q7($){for(let Z of $)Z.order=Z.order||Number.MAX_SAFE_INTEGER;return $.sort((Z,X)=>{return Z.order-X.order})}async function J7($,Z,X,Q){let J,G,W=0;return new Promise((Y,z)=>{q();function q(){if(J=$[W++],!J)return z(G);try{let L=EG(J,Z,X,H,Q);if(L&&typeof L.then==="function")L.then(B,F);else if(L!==void 0)B(L);else if(W===$.length)throw Error("No promise has been returned or callback has been called.")}catch(L){F(L)}}function H(L,w){if(L)F(L);else B(w)}function B(L){Y({plugin:J,result:L})}function F(L){G={plugin:J,error:L},q()}})}function EG($,Z,X,Q,J){let G=$[Z];if(typeof G==="function")return G.apply($,[X,Q,J]);if(!Q){if(G instanceof RegExp)return G.test(X.url);else if(typeof G==="string")return G===X.extension;else if(Array.isArray(G))return G.indexOf(X.extension)!==-1}return G}async function c2($,Z,X){let Q=typeof $==="string"?$:$.url,J=typeof $==="string"?void 0:$.baseUrl,G=typeof $==="string"?void 0:$.reference,W=Q.indexOf("#"),Y="";if(W>=0)Y=Q.substring(W),Q=Q.substring(0,W);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let z=Z._add(Q),q={url:Q,hash:Y,extension:VG(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await p2(q,X,Z);z.pathType=H.plugin.name,q.data=H.result;let B=await i2(q,X,Z);return z.value=B.result,z.dynamicIdScope=u8(z.value),m8(Z,z.path,z.value,z.pathType,z.dynamicIdScope),B.result}catch(H){if(E1(H))z.value=H;throw H}}async function p2($,Z,X){let Q=Z7(Z.resolve);Q=X7(Q,"canRead",$,void 0,X),Q7(Q);try{return await J7(Q,"read",$,X)}catch(J){if(!J&&Z.continueOnError)throw new f8($.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${$.url}"`,{cause:J});else if(J.error instanceof Y1)throw J.error;else throw new Y1(J,$.url)}}async function i2($,Z,X){let Q=Z7(Z.parse),J=X7(Q,"canParse",$),G=J.length>0?J:Q;Q7(G);try{let W=await J7(G,"parse",$,X);if(!W.plugin.allowEmpty&&n2(W.result))throw SyntaxError(`Error parsing "${$.url}" as ${W.plugin.name}.
24
+ Parsed value is empty`);else return W}catch(W){if(!W&&Z.continueOnError)throw new g8($.url);else if(W&&W.message&&W.message.startsWith("Error parsing"))throw W;else if(!W||!("error"in W))throw SyntaxError(`Unable to parse ${$.url}`,{cause:W});else if(W.error instanceof s$)throw W.error;else throw new s$(W.error.message,$.url)}}function n2($){return $===void 0||typeof $==="object"&&Object.keys($).length===0||typeof $==="string"&&$.trim().length===0||Buffer.isBuffer($)&&$.length===0}var c8;var G7=s(()=>{P$();p6();t$();c8=c2});var RG;var PG=s(()=>{t$();RG={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")if(Z.trim().length===0)return;else try{return JSON.parse(Z)}catch(X){if(this.allowBOM)try{let Q=Z.indexOf("{");return Z=Z.slice(Q),JSON.parse(Z)}catch(Q){throw new s$(Q.message,$.url)}throw new s$(X.message,$.url)}else return Z}}});function r2($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}function N9(){if(CG)return M6;CG=1;function $(W){return typeof W>"u"||W===null}function Z(W){return typeof W==="object"&&W!==null}function X(W){if(Array.isArray(W))return W;else if($(W))return[];return[W]}function Q(W,Y){if(Y){let z=Object.keys(Y);for(let q=0,H=z.length;q<H;q+=1){let B=z[q];W[B]=Y[B]}}return W}function J(W,Y){let z="";for(let q=0;q<Y;q+=1)z+=W;return z}function G(W){return W===0&&Number.NEGATIVE_INFINITY===1/W}return M6.isNothing=$,M6.isObject=Z,M6.toArray=X,M6.repeat=J,M6.isNegativeZero=G,M6.extend=Q,M6}function D9(){if(SG)return W7;SG=1;function $(X,Q){let J="",G=X.reason||"(unknown reason)";if(!X.mark)return G;if(X.mark.name)J+='in "'+X.mark.name+'" ';if(J+="("+(X.mark.line+1)+":"+(X.mark.column+1)+")",!Q&&X.mark.snippet)J+=`
23
25
 
24
- `+X.mark.snippet;return G+" "+J}function Z(X,Q){if(Error.call(this),this.name="YAMLException",this.reason=X,this.mark=Q,this.message=$(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z.prototype.toString=function(Q){return this.name+": "+$(this,Q)},nZ=Z,nZ}function R2(){if(LG)return rZ;LG=1;let $=V9();function Z(J,G,W,Y,z){let q="",H="",B=Math.floor(z/2)-1;if(Y-G>B)q=" ... ",G=Y-B+q.length;if(W-Y>B)H=" ...",W=Y+B-H.length;return{str:q+J.slice(G,W).replace(/\t/g,"→")+H,pos:Y-G+q.length}}function X(J,G){return $.repeat(" ",G-J.length)+J}function Q(J,G){if(G=Object.create(G||null),!J.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;let W=/\r?\n|\r|\0/g,Y=[0],z=[],q,H=-1;while(q=W.exec(J.buffer))if(z.push(q.index),Y.push(q.index+q[0].length),J.position<=q.index&&H<0)H=Y.length-2;if(H<0)H=Y.length-1;let B="",L=Math.min(J.line+G.linesAfter,z.length).toString().length,M=G.maxLength-(G.indent+L+3);for(let w=1;w<=G.linesBefore;w++){if(H-w<0)break;let D=Z(J.buffer,Y[H-w],z[H-w],J.position-(Y[H]-Y[H-w]),M);B=$.repeat(" ",G.indent)+X((J.line-w+1).toString(),L)+" | "+D.str+`
25
- `+B}let A=Z(J.buffer,Y[H],z[H],J.position,M);B+=$.repeat(" ",G.indent)+X((J.line+1).toString(),L)+" | "+A.str+`
26
- `,B+=$.repeat("-",G.indent+L+3+A.pos)+`^
27
- `;for(let w=1;w<=G.linesAfter;w++){if(H+w>=z.length)break;let D=Z(J.buffer,Y[H+w],z[H+w],J.position-(Y[H]-Y[H+w]),M);B+=$.repeat(" ",G.indent)+X((J.line+w+1).toString(),L)+" | "+D.str+`
28
- `}return B.replace(/\n$/,"")}return rZ=Q,rZ}function A$(){if(MG)return aZ;MG=1;let $=B9(),Z=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],X=["scalar","sequence","mapping"];function Q(G){let W={};if(G!==null)Object.keys(G).forEach(function(Y){G[Y].forEach(function(z){W[String(z)]=Y})});return W}function J(G,W){if(W=W||{},Object.keys(W).forEach(function(Y){if(Z.indexOf(Y)===-1)throw new $('Unknown option "'+Y+'" is met in definition of "'+G+'" YAML type.')}),this.options=W,this.tag=G,this.kind=W.kind||null,this.resolve=W.resolve||function(){return!0},this.construct=W.construct||function(Y){return Y},this.instanceOf=W.instanceOf||null,this.predicate=W.predicate||null,this.represent=W.represent||null,this.representName=W.representName||null,this.defaultStyle=W.defaultStyle||null,this.multi=W.multi||!1,this.styleAliases=Q(W.styleAliases||null),X.indexOf(this.kind)===-1)throw new $('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return aZ=J,aZ}function hG(){if(AG)return oZ;AG=1;let $=B9(),Z=A$();function X(G,W){let Y=[];return G[W].forEach(function(z){let q=Y.length;Y.forEach(function(H,B){if(H.tag===z.tag&&H.kind===z.kind&&H.multi===z.multi)q=B}),Y[q]=z}),Y}function Q(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function W(Y){if(Y.multi)G.multi[Y.kind].push(Y),G.multi.fallback.push(Y);else G[Y.kind][Y.tag]=G.fallback[Y.tag]=Y}for(let Y=0,z=arguments.length;Y<z;Y+=1)arguments[Y].forEach(W);return G}function J(G){return this.extend(G)}return J.prototype.extend=function(W){let Y=[],z=[];if(W instanceof Z)z.push(W);else if(Array.isArray(W))z=z.concat(W);else if(W&&(Array.isArray(W.implicit)||Array.isArray(W.explicit))){if(W.implicit)Y=Y.concat(W.implicit);if(W.explicit)z=z.concat(W.explicit)}else throw new $("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");Y.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(H.loadKind&&H.loadKind!=="scalar")throw new $("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(H.multi)throw new $("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),z.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let q=Object.create(J.prototype);return q.implicit=(this.implicit||[]).concat(Y),q.explicit=(this.explicit||[]).concat(z),q.compiledImplicit=X(q,"implicit"),q.compiledExplicit=X(q,"explicit"),q.compiledTypeMap=Q(q.compiledImplicit,q.compiledExplicit),q},oZ=J,oZ}function uG(){if(IG)return sZ;return IG=1,sZ=new(A$())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),sZ}function mG(){if(NG)return tZ;return NG=1,tZ=new(A$())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),tZ}function dG(){if(DG)return eZ;return DG=1,eZ=new(A$())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),eZ}function lG(){if(wG)return $7;return wG=1,$7=new(hG())({explicit:[uG(),mG(),dG()]}),$7}function cG(){if(TG)return Z7;TG=1;let $=A$();function Z(J){if(J===null)return!0;let G=J.length;return G===1&&J==="~"||G===4&&(J==="null"||J==="Null"||J==="NULL")}function X(){return null}function Q(J){return J===null}return Z7=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Z7}function pG(){if(jG)return X7;jG=1;let $=A$();function Z(J){if(J===null)return!1;let G=J.length;return G===4&&(J==="true"||J==="True"||J==="TRUE")||G===5&&(J==="false"||J==="False"||J==="FALSE")}function X(J){return J==="true"||J==="True"||J==="TRUE"}function Q(J){return Object.prototype.toString.call(J)==="[object Boolean]"}return X7=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{lowercase:function(J){return J?"true":"false"},uppercase:function(J){return J?"TRUE":"FALSE"},camelcase:function(J){return J?"True":"False"}},defaultStyle:"lowercase"}),X7}function iG(){if(OG)return Q7;OG=1;let $=V9(),Z=A$();function X(q){return q>=48&&q<=57||q>=65&&q<=70||q>=97&&q<=102}function Q(q){return q>=48&&q<=55}function J(q){return q>=48&&q<=57}function G(q){if(q===null)return!1;let H=q.length,B=0,L=!1;if(!H)return!1;let M=q[B];if(M==="-"||M==="+")M=q[++B];if(M==="0"){if(B+1===H)return!0;if(M=q[++B],M==="b"){B++;for(;B<H;B++){if(M=q[B],M!=="0"&&M!=="1")return!1;L=!0}return L&&isFinite(W(q))}if(M==="x"){B++;for(;B<H;B++){if(!X(q.charCodeAt(B)))return!1;L=!0}return L&&isFinite(W(q))}if(M==="o"){B++;for(;B<H;B++){if(!Q(q.charCodeAt(B)))return!1;L=!0}return L&&isFinite(W(q))}}for(;B<H;B++){if(!J(q.charCodeAt(B)))return!1;L=!0}if(!L)return!1;return isFinite(W(q))}function W(q){let H=q,B=1,L=H[0];if(L==="-"||L==="+"){if(L==="-")B=-1;H=H.slice(1),L=H[0]}if(H==="0")return 0;if(L==="0"){if(H[1]==="b")return B*parseInt(H.slice(2),2);if(H[1]==="x")return B*parseInt(H.slice(2),16);if(H[1]==="o")return B*parseInt(H.slice(2),8)}return B*parseInt(H,10)}function Y(q){return W(q)}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1===0&&!$.isNegativeZero(q))}return Q7=new Z("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:Y,predicate:z,represent:{binary:function(q){return q>=0?"0b"+q.toString(2):"-0b"+q.toString(2).slice(1)},octal:function(q){return q>=0?"0o"+q.toString(8):"-0o"+q.toString(8).slice(1)},decimal:function(q){return q.toString(10)},hexadecimal:function(q){return q>=0?"0x"+q.toString(16).toUpperCase():"-0x"+q.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Q7}function nG(){if(EG)return J7;EG=1;let $=V9(),Z=A$(),X=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Q=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J(q){if(q===null)return!1;if(!X.test(q))return!1;if(isFinite(parseFloat(q,10)))return!0;return Q.test(q)}function G(q){let H=q.toLowerCase(),B=H[0]==="-"?-1:1;if("+-".indexOf(H[0])>=0)H=H.slice(1);if(H===".inf")return B===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(H===".nan")return NaN;return B*parseFloat(H,10)}let W=/^[-+]?[0-9]+e/;function Y(q,H){if(isNaN(q))switch(H){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===q)switch(H){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===q)switch(H){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($.isNegativeZero(q))return"-0.0";let B=q.toString(10);return W.test(B)?B.replace("e",".e"):B}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1!==0||$.isNegativeZero(q))}return J7=new Z("tag:yaml.org,2002:float",{kind:"scalar",resolve:J,construct:G,predicate:z,represent:Y,defaultStyle:"lowercase"}),J7}function rG(){if(RG)return G7;return RG=1,G7=lG().extend({implicit:[cG(),pG(),iG(),nG()]}),G7}function aG(){if(PG)return W7;return PG=1,W7=rG(),W7}function oG(){if(CG)return Y7;CG=1;let $=A$(),Z=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Q(W){if(W===null)return!1;if(Z.exec(W)!==null)return!0;if(X.exec(W)!==null)return!0;return!1}function J(W){let Y=0,z=null,q=Z.exec(W);if(q===null)q=X.exec(W);if(q===null)throw Error("Date resolve error");let H=+q[1],B=+q[2]-1,L=+q[3];if(!q[4])return new Date(Date.UTC(H,B,L));let M=+q[4],A=+q[5],w=+q[6];if(q[7]){Y=q[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(q[9]){let j=+q[10],E=+(q[11]||0);if(z=(j*60+E)*60000,q[9]==="-")z=-z}let D=new Date(Date.UTC(H,B,L,M,A,w,Y));if(z)D.setTime(D.getTime()-z);return D}function G(W){return W.toISOString()}return Y7=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q,construct:J,instanceOf:Date,represent:G}),Y7}function sG(){if(SG)return z7;SG=1;let $=A$();function Z(X){return X==="<<"||X===null}return z7=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Z}),z7}function tG(){if(_G)return q7;_G=1;let $=A$(),Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
29
- \r`;function X(W){if(W===null)return!1;let Y=0,z=W.length,q=Z;for(let H=0;H<z;H++){let B=q.indexOf(W.charAt(H));if(B>64)continue;if(B<0)return!1;Y+=6}return Y%8===0}function Q(W){let Y=W.replace(/[\r\n=]/g,""),z=Y.length,q=Z,H=0,B=[];for(let M=0;M<z;M++){if(M%4===0&&M)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);H=H<<6|q.indexOf(Y.charAt(M))}let L=z%4*6;if(L===0)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);else if(L===18)B.push(H>>10&255),B.push(H>>2&255);else if(L===12)B.push(H>>4&255);return new Uint8Array(B)}function J(W){let Y="",z=0,q=W.length,H=Z;for(let L=0;L<q;L++){if(L%3===0&&L)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];z=(z<<8)+W[L]}let B=q%3;if(B===0)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];else if(B===2)Y+=H[z>>10&63],Y+=H[z>>4&63],Y+=H[z<<2&63],Y+=H[64];else if(B===1)Y+=H[z>>2&63],Y+=H[z<<4&63],Y+=H[64],Y+=H[64];return Y}function G(W){return Object.prototype.toString.call(W)==="[object Uint8Array]"}return q7=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:X,construct:Q,predicate:G,represent:J}),q7}function eG(){if(xG)return U7;xG=1;let $=A$(),Z=Object.prototype.hasOwnProperty,X=Object.prototype.toString;function Q(G){if(G===null)return!0;let W=[],Y=G;for(let z=0,q=Y.length;z<q;z+=1){let H=Y[z],B=!1;if(X.call(H)!=="[object Object]")return!1;let L;for(L in H)if(Z.call(H,L))if(!B)B=!0;else return!1;if(!B)return!1;if(W.indexOf(L)===-1)W.push(L);else return!1}return!0}function J(G){return G!==null?G:[]}return U7=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Q,construct:J}),U7}function $W(){if(bG)return K7;bG=1;let $=A$(),Z=Object.prototype.toString;function X(J){if(J===null)return!0;let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y];if(Z.call(q)!=="[object Object]")return!1;let H=Object.keys(q);if(H.length!==1)return!1;W[Y]=[H[0],q[H[0]]]}return!0}function Q(J){if(J===null)return[];let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y],H=Object.keys(q);W[Y]=[H[0],q[H[0]]]}return W}return K7=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:X,construct:Q}),K7}function ZW(){if(kG)return H7;kG=1;let $=A$(),Z=Object.prototype.hasOwnProperty;function X(J){if(J===null)return!0;let G=J;for(let W in G)if(Z.call(G,W)){if(G[W]!==null)return!1}return!0}function Q(J){return J!==null?J:{}}return H7=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:X,construct:Q}),H7}function F7(){if(yG)return V7;return yG=1,V7=aG().extend({implicit:[oG(),sG()],explicit:[tG(),eG(),$W(),ZW()]}),V7}function P2(){if(vG)return k5;vG=1;let $=V9(),Z=B9(),X=R2(),Q=F7(),J=Object.prototype.hasOwnProperty,G=1,W=2,Y=3,z=4,q=1,H=2,B=3,L=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,M=/[\x85\u2028\u2029]/,A=/[,\[\]{}]/,w=/^(?:!|!!|![0-9A-Za-z-]+!)$/,D=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function j(V){return Object.prototype.toString.call(V)}function E(V){return V===10||V===13}function P(V){return V===9||V===32}function R(V){return V===9||V===32||V===10||V===13}function C(V){return V===44||V===91||V===93||V===123||V===125}function v(V){if(V>=48&&V<=57)return V-48;let S=V|32;if(S>=97&&S<=102)return S-97+10;return-1}function d(V){if(V===120)return 2;if(V===117)return 4;if(V===85)return 8;return 0}function f(V){if(V>=48&&V<=57)return V-48;return-1}function a(V){switch(V){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
30
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function $0(V){if(V<=65535)return String.fromCharCode(V);return String.fromCharCode((V-65536>>10)+55296,(V-65536&1023)+56320)}function u(V,S,h){if(S==="__proto__")Object.defineProperty(V,S,{configurable:!0,enumerable:!0,writable:!0,value:h});else V[S]=h}let e=Array(256),Y0=Array(256);for(let V=0;V<256;V++)e[V]=a(V)?1:0,Y0[V]=a(V);function J0(V,S){this.input=V,this.filename=S.filename||null,this.schema=S.schema||Q,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.maxDepth=typeof S.maxDepth==="number"?S.maxDepth:100,this.maxTotalMergeKeys=typeof S.maxTotalMergeKeys==="number"?S.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=V.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function L0(V,S){let h={name:V.filename,buffer:V.input.slice(0,-1),position:V.position,line:V.line,column:V.position-V.lineStart};return h.snippet=X(h),new Z(S,h)}function _(V,S){throw L0(V,S)}function p(V,S){if(V.onWarning)V.onWarning.call(null,L0(V,S))}function o(V,S,h){let c=V.anchorMapTransactions;if(c.length!==0){let y=c[c.length-1];if(!J.call(y,S))y[S]={existed:J.call(V.anchorMap,S),value:V.anchorMap[S]}}V.anchorMap[S]=h}function K0(V){V.anchorMapTransactions.push(Object.create(null))}function i(V){let S=V.anchorMapTransactions.pop(),h=V.anchorMapTransactions;if(h.length===0)return;let c=h[h.length-1],y=Object.keys(S);for(let s=0,I=y.length;s<I;s+=1){let x=y[s];if(!J.call(c,x))c[x]=S[x]}}function G0(V){let S=V.anchorMapTransactions.pop(),h=Object.keys(S);for(let c=h.length-1;c>=0;c-=1){let y=S[h[c]];if(y.existed)V.anchorMap[h[c]]=y.value;else delete V.anchorMap[h[c]]}}function X0(V){return{position:V.position,line:V.line,lineStart:V.lineStart,lineIndent:V.lineIndent,firstTabInLine:V.firstTabInLine,tag:V.tag,anchor:V.anchor,kind:V.kind,result:V.result}}function Z0(V,S){V.position=S.position,V.line=S.line,V.lineStart=S.lineStart,V.lineIndent=S.lineIndent,V.firstTabInLine=S.firstTabInLine,V.tag=S.tag,V.anchor=S.anchor,V.kind=S.kind,V.result=S.result}let x0={YAML:function(S,h,c){if(S.version!==null)_(S,"duplication of %YAML directive");if(c.length!==1)_(S,"YAML directive accepts exactly one argument");let y=/^([0-9]+)\.([0-9]+)$/.exec(c[0]);if(y===null)_(S,"ill-formed argument of the YAML directive");let s=parseInt(y[1],10),I=parseInt(y[2],10);if(s!==1)_(S,"unacceptable YAML version of the document");if(S.version=c[0],S.checkLineBreaks=I<2,I!==1&&I!==2)p(S,"unsupported YAML version of the document")},TAG:function(S,h,c){let y;if(c.length!==2)_(S,"TAG directive accepts exactly two arguments");let s=c[0];if(y=c[1],!w.test(s))_(S,"ill-formed tag handle (first argument) of the TAG directive");if(J.call(S.tagMap,s))_(S,'there is a previously declared suffix for "'+s+'" tag handle');if(!D.test(y))_(S,"ill-formed tag prefix (second argument) of the TAG directive");try{y=decodeURIComponent(y)}catch(I){_(S,"tag prefix is malformed: "+y)}S.tagMap[s]=y}};function j0(V,S,h,c){if(S<h){let y=V.input.slice(S,h);if(c)for(let s=0,I=y.length;s<I;s+=1){let x=y.charCodeAt(s);if(!(x===9||x>=32&&x<=1114111))_(V,"expected valid JSON character")}else if(L.test(y))_(V,"the stream contains non-printable characters");V.result+=y}}function m0(V,S,h,c){if(!$.isObject(h))_(V,"cannot merge mappings; the provided source object is unacceptable");let y=Object.keys(h);for(let s=0,I=y.length;s<I;s+=1){let x=y[s];if(V.maxTotalMergeKeys!==-1&&++V.totalMergeKeys>V.maxTotalMergeKeys)_(V,"merge keys exceeded maxTotalMergeKeys ("+V.maxTotalMergeKeys+")");if(!J.call(S,x))u(S,x,h[x]),c[x]=!0}}function W0(V,S,h,c,y,s,I,x,r){if(Array.isArray(y)){y=Array.prototype.slice.call(y);for(let m=0,l=y.length;m<l;m+=1){if(Array.isArray(y[m]))_(V,"nested arrays are not supported inside keys");if(typeof y==="object"&&j(y[m])==="[object Object]")y[m]="[object Object]"}}if(typeof y==="object"&&j(y)==="[object Object]")y="[object Object]";if(y=String(y),S===null)S={};if(c==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(let m=0,l=s.length;m<l;m+=1)m0(V,S,s[m],h);else m0(V,S,s,h);else{if(!V.json&&!J.call(h,y)&&J.call(S,y))V.line=I||V.line,V.lineStart=x||V.lineStart,V.position=r||V.position,_(V,"duplicated mapping key");u(S,y,s),delete h[y]}return S}function X$(V){let S=V.input.charCodeAt(V.position);if(S===10)V.position++;else if(S===13){if(V.position++,V.input.charCodeAt(V.position)===10)V.position++}else _(V,"a line break is expected");V.line+=1,V.lineStart=V.position,V.firstTabInLine=-1}function E0(V,S,h){let c=0,y=V.input.charCodeAt(V.position);while(y!==0){while(P(y)){if(y===9&&V.firstTabInLine===-1)V.firstTabInLine=V.position;y=V.input.charCodeAt(++V.position)}if(S&&y===35)do y=V.input.charCodeAt(++V.position);while(y!==10&&y!==13&&y!==0);if(E(y)){X$(V),y=V.input.charCodeAt(V.position),c++,V.lineIndent=0;while(y===32)V.lineIndent++,y=V.input.charCodeAt(++V.position)}else break}if(h!==-1&&c!==0&&V.lineIndent<h)p(V,"deficient indentation");return c}function t0(V){let S=V.position,h=V.input.charCodeAt(S);if((h===45||h===46)&&h===V.input.charCodeAt(S+1)&&h===V.input.charCodeAt(S+2)){if(S+=3,h=V.input.charCodeAt(S),h===0||R(h))return!0}return!1}function y0(V,S){if(S===1)V.result+=" ";else if(S>1)V.result+=$.repeat(`
31
- `,S-1)}function c0(V,S,h){let c,y,s,I,x,r,m=V.kind,l=V.result,U=V.input.charCodeAt(V.position);if(R(U)||C(U)||U===35||U===38||U===42||U===33||U===124||U===62||U===39||U===34||U===37||U===64||U===96)return!1;if(U===63||U===45){let F=V.input.charCodeAt(V.position+1);if(R(F)||h&&C(F))return!1}V.kind="scalar",V.result="",c=y=V.position,s=!1;while(U!==0){if(U===58){let F=V.input.charCodeAt(V.position+1);if(R(F)||h&&C(F))break}else if(U===35){let F=V.input.charCodeAt(V.position-1);if(R(F))break}else if(V.position===V.lineStart&&t0(V)||h&&C(U))break;else if(E(U))if(I=V.line,x=V.lineStart,r=V.lineIndent,E0(V,!1,-1),V.lineIndent>=S){s=!0,U=V.input.charCodeAt(V.position);continue}else{V.position=y,V.line=I,V.lineStart=x,V.lineIndent=r;break}if(s)j0(V,c,y,!1),y0(V,V.line-I),c=y=V.position,s=!1;if(!P(U))y=V.position+1;U=V.input.charCodeAt(++V.position)}if(j0(V,c,y,!1),V.result)return!0;return V.kind=m,V.result=l,!1}function j$(V,S){let h,c,y=V.input.charCodeAt(V.position);if(y!==39)return!1;V.kind="scalar",V.result="",V.position++,h=c=V.position;while((y=V.input.charCodeAt(V.position))!==0)if(y===39)if(j0(V,h,V.position,!0),y=V.input.charCodeAt(++V.position),y===39)h=V.position,V.position++,c=V.position;else return!0;else if(E(y))j0(V,h,c,!0),y0(V,E0(V,!1,S)),h=c=V.position;else if(V.position===V.lineStart&&t0(V))_(V,"unexpected end of the document within a single quoted scalar");else if(V.position++,!P(y))c=V.position;_(V,"unexpected end of the stream within a single quoted scalar")}function q$(V,S){let h,c,y,s=V.input.charCodeAt(V.position);if(s!==34)return!1;V.kind="scalar",V.result="",V.position++,h=c=V.position;while((s=V.input.charCodeAt(V.position))!==0)if(s===34)return j0(V,h,V.position,!0),V.position++,!0;else if(s===92){if(j0(V,h,V.position,!0),s=V.input.charCodeAt(++V.position),E(s))E0(V,!1,S);else if(s<256&&e[s])V.result+=Y0[s],V.position++;else if((y=d(s))>0){let I=y,x=0;for(;I>0;I--)if(s=V.input.charCodeAt(++V.position),(y=v(s))>=0)x=(x<<4)+y;else _(V,"expected hexadecimal character");V.result+=$0(x),V.position++}else _(V,"unknown escape sequence");h=c=V.position}else if(E(s))j0(V,h,c,!0),y0(V,E0(V,!1,S)),h=c=V.position;else if(V.position===V.lineStart&&t0(V))_(V,"unexpected end of the document within a double quoted scalar");else if(V.position++,!P(s))c=V.position;_(V,"unexpected end of the stream within a double quoted scalar")}function L6(V,S){let h=!0,c,y,s,I=V.tag,x,r=V.anchor,m,l,U,F,N=Object.create(null),T,O,g,n=V.input.charCodeAt(V.position);if(n===91)m=93,F=!1,x=[];else if(n===123)m=125,F=!0,x={};else return!1;if(V.anchor!==null)o(V,V.anchor,x);n=V.input.charCodeAt(++V.position);while(n!==0){if(E0(V,!0,S),n=V.input.charCodeAt(V.position),n===m)return V.position++,V.tag=I,V.anchor=r,V.kind=F?"mapping":"sequence",V.result=x,!0;else if(!h)_(V,"missed comma between flow collection entries");else if(n===44)_(V,"expected the node content, but found ','");if(O=T=g=null,l=U=!1,n===63){let Q0=V.input.charCodeAt(V.position+1);if(R(Q0))l=U=!0,V.position++,E0(V,!0,S)}if(c=V.line,y=V.lineStart,s=V.position,f$(V,S,G,!1,!0),O=V.tag,T=V.result,E0(V,!0,S),n=V.input.charCodeAt(V.position),(U||V.line===c)&&n===58)l=!0,n=V.input.charCodeAt(++V.position),E0(V,!0,S),f$(V,S,G,!1,!0),g=V.result;if(F)W0(V,x,N,O,T,g,c,y,s);else if(l)x.push(W0(V,null,N,O,T,g,c,y,s));else x.push(T);if(E0(V,!0,S),n=V.input.charCodeAt(V.position),n===44)h=!0,n=V.input.charCodeAt(++V.position);else h=!1}_(V,"unexpected end of the stream within a flow collection")}function M6(V,S){let h,c=q,y=!1,s=!1,I=S,x=0,r=!1,m,l=V.input.charCodeAt(V.position);if(l===124)h=!1;else if(l===62)h=!0;else return!1;V.kind="scalar",V.result="";while(l!==0)if(l=V.input.charCodeAt(++V.position),l===43||l===45)if(q===c)c=l===43?B:H;else _(V,"repeat of a chomping mode identifier");else if((m=f(l))>=0)if(m===0)_(V,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!s)I=S+m-1,s=!0;else _(V,"repeat of an indentation width identifier");else break;if(P(l)){do l=V.input.charCodeAt(++V.position);while(P(l));if(l===35)do l=V.input.charCodeAt(++V.position);while(!E(l)&&l!==0)}while(l!==0){X$(V),V.lineIndent=0,l=V.input.charCodeAt(V.position);while((!s||V.lineIndent<I)&&l===32)V.lineIndent++,l=V.input.charCodeAt(++V.position);if(!s&&V.lineIndent>I)I=V.lineIndent;if(E(l)){x++;continue}if(!s&&I===0)_(V,"missing indentation for block scalar");if(V.lineIndent<I){if(c===B)V.result+=$.repeat(`
32
- `,y?1+x:x);else if(c===q){if(y)V.result+=`
33
- `}break}if(h)if(P(l))r=!0,V.result+=$.repeat(`
34
- `,y?1+x:x);else if(r)r=!1,V.result+=$.repeat(`
35
- `,x+1);else if(x===0){if(y)V.result+=" "}else V.result+=$.repeat(`
36
- `,x);else V.result+=$.repeat(`
37
- `,y?1+x:x);y=!0,s=!0,x=0;let U=V.position;while(!E(l)&&l!==0)l=V.input.charCodeAt(++V.position);j0(V,U,V.position,!1)}return!0}function g$(V,S){let{tag:h,anchor:c}=V,y=[],s=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)o(V,V.anchor,y);let I=V.input.charCodeAt(V.position);while(I!==0){if(V.firstTabInLine!==-1)V.position=V.firstTabInLine,_(V,"tab characters must not be used in indentation");if(I!==45)break;let x=V.input.charCodeAt(V.position+1);if(!R(x))break;if(s=!0,V.position++,E0(V,!0,-1)){if(V.lineIndent<=S){y.push(null),I=V.input.charCodeAt(V.position);continue}}let r=V.line;if(f$(V,S,Y,!1,!0),y.push(V.result),E0(V,!0,-1),I=V.input.charCodeAt(V.position),(V.line===r||V.lineIndent>S)&&I!==0)_(V,"bad indentation of a sequence entry");else if(V.lineIndent<S)break}if(s)return V.tag=h,V.anchor=c,V.kind="sequence",V.result=y,!0;return!1}function U$(V,S,h){let c,y,s,I,x=V.tag,r=V.anchor,m={},l=Object.create(null),U=null,F=null,N=null,T=!1,O=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)o(V,V.anchor,m);let g=V.input.charCodeAt(V.position);while(g!==0){if(!T&&V.firstTabInLine!==-1)V.position=V.firstTabInLine,_(V,"tab characters must not be used in indentation");let n=V.input.charCodeAt(V.position+1),Q0=V.line;if((g===63||g===58)&&R(n)){if(g===63){if(T)W0(V,m,l,U,F,null,y,s,I),U=F=N=null;O=!0,T=!0,c=!0}else if(T)T=!1,c=!0;else _(V,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");V.position+=1,g=n}else{if(y=V.line,s=V.lineStart,I=V.position,!f$(V,h,W,!1,!0))break;if(V.line===Q0){g=V.input.charCodeAt(V.position);while(P(g))g=V.input.charCodeAt(++V.position);if(g===58){if(g=V.input.charCodeAt(++V.position),!R(g))_(V,"a whitespace character is expected after the key-value separator within a block mapping");if(T)W0(V,m,l,U,F,null,y,s,I),U=F=N=null;O=!0,T=!1,c=!1,U=V.tag,F=V.result}else if(O)_(V,"can not read an implicit mapping pair; a colon is missed");else return V.tag=x,V.anchor=r,!0}else if(O)_(V,"can not read a block mapping entry; a multiline key may not be an implicit key");else return V.tag=x,V.anchor=r,!0}if(V.line===Q0||V.lineIndent>S){if(T)y=V.line,s=V.lineStart,I=V.position;if(f$(V,S,z,!0,c))if(T)F=V.result;else N=V.result;if(!T)W0(V,m,l,U,F,N,y,s,I),U=F=N=null;E0(V,!0,-1),g=V.input.charCodeAt(V.position)}if((V.line===Q0||V.lineIndent>S)&&g!==0)_(V,"bad indentation of a mapping entry");else if(V.lineIndent<S)break}if(T)W0(V,m,l,U,F,null,y,s,I);if(O)V.tag=x,V.anchor=r,V.kind="mapping",V.result=m;return O}function A6(V){let S=!1,h=!1,c,y,s=V.input.charCodeAt(V.position);if(s!==33)return!1;if(V.tag!==null)_(V,"duplication of a tag property");if(s=V.input.charCodeAt(++V.position),s===60)S=!0,s=V.input.charCodeAt(++V.position);else if(s===33)h=!0,c="!!",s=V.input.charCodeAt(++V.position);else c="!";let I=V.position;if(S){do s=V.input.charCodeAt(++V.position);while(s!==0&&s!==62);if(V.position<V.length)y=V.input.slice(I,V.position),s=V.input.charCodeAt(++V.position);else _(V,"unexpected end of the stream within a verbatim tag")}else{while(s!==0&&!R(s)){if(s===33)if(!h){if(c=V.input.slice(I-1,V.position+1),!w.test(c))_(V,"named tag handle cannot contain such characters");h=!0,I=V.position+1}else _(V,"tag suffix cannot contain exclamation marks");s=V.input.charCodeAt(++V.position)}if(y=V.input.slice(I,V.position),A.test(y))_(V,"tag suffix cannot contain flow indicator characters")}if(y&&!D.test(y))_(V,"tag name cannot contain such characters: "+y);try{y=decodeURIComponent(y)}catch(x){_(V,"tag name is malformed: "+y)}if(S)V.tag=y;else if(J.call(V.tagMap,c))V.tag=V.tagMap[c]+y;else if(c==="!")V.tag="!"+y;else if(c==="!!")V.tag="tag:yaml.org,2002:"+y;else _(V,'undeclared tag handle "'+c+'"');return!0}function W1(V){let S=V.input.charCodeAt(V.position);if(S!==38)return!1;if(V.anchor!==null)_(V,"duplication of an anchor property");S=V.input.charCodeAt(++V.position);let h=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===h)_(V,"name of an anchor node must contain at least one character");return V.anchor=V.input.slice(h,V.position),!0}function g6(V){let S=V.input.charCodeAt(V.position);if(S!==42)return!1;S=V.input.charCodeAt(++V.position);let h=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===h)_(V,"name of an alias node must contain at least one character");let c=V.input.slice(h,V.position);if(!J.call(V.anchorMap,c))_(V,'unidentified alias "'+c+'"');return V.result=V.anchorMap[c],E0(V,!0,-1),!0}function Z9(V,S,h,c){let y=X0(V);if(K0(V),Z0(V,S),V.tag=null,V.anchor=null,V.kind=null,V.result=null,U$(V,h,c)&&V.kind==="mapping")return i(V),!0;return G0(V),Z0(V,y),!1}function f$(V,S,h,c,y){let s,I,x=1,r=!1,m=!1,l=null,U,F,N;if(V.depth>=V.maxDepth)_(V,"nesting exceeded maxDepth ("+V.maxDepth+")");if(V.depth+=1,V.listener!==null)V.listener("open",V);V.tag=null,V.anchor=null,V.kind=null,V.result=null;let T=s=I=z===h||Y===h;if(c){if(E0(V,!0,-1)){if(r=!0,V.lineIndent>S)x=1;else if(V.lineIndent===S)x=0;else if(V.lineIndent<S)x=-1}}if(x===1)while(!0){let O=V.input.charCodeAt(V.position),g=X0(V);if(r&&(O===33&&V.tag!==null||O===38&&V.anchor!==null))break;if(!A6(V)&&!W1(V))break;if(l===null)l=g;if(E0(V,!0,-1)){if(r=!0,I=T,V.lineIndent>S)x=1;else if(V.lineIndent===S)x=0;else if(V.lineIndent<S)x=-1}else I=!1}if(I)I=r||y;if(x===1||z===h){if(G===h||W===h)F=S;else F=S+1;if(N=V.position-V.lineStart,x===1)if(I&&(g$(V,N)||U$(V,N,F))||L6(V,F))m=!0;else{let O=V.input.charCodeAt(V.position);if(l!==null&&T&&!I&&O!==124&&O!==62&&Z9(V,l,l.position-l.lineStart,F))m=!0;else if(s&&M6(V,F)||j$(V,F)||q$(V,F))m=!0;else if(g6(V)){if(m=!0,V.tag!==null||V.anchor!==null)_(V,"alias node should not have any properties")}else if(c0(V,F,G===h)){if(m=!0,V.tag===null)V.tag="?"}if(V.anchor!==null)o(V,V.anchor,V.result)}else if(x===0)m=I&&g$(V,N)}if(V.tag===null){if(V.anchor!==null)o(V,V.anchor,V.result)}else if(V.tag==="?"){if(V.result!==null&&V.kind!=="scalar")_(V,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+V.kind+'"');for(let O=0,g=V.implicitTypes.length;O<g;O+=1)if(U=V.implicitTypes[O],U.resolve(V.result)){if(V.result=U.construct(V.result),V.tag=U.tag,V.anchor!==null)o(V,V.anchor,V.result);break}}else if(V.tag!=="!"){if(J.call(V.typeMap[V.kind||"fallback"],V.tag))U=V.typeMap[V.kind||"fallback"][V.tag];else{U=null;let O=V.typeMap.multi[V.kind||"fallback"];for(let g=0,n=O.length;g<n;g+=1)if(V.tag.slice(0,O[g].tag.length)===O[g].tag){U=O[g];break}}if(!U)_(V,"unknown tag !<"+V.tag+">");if(V.result!==null&&U.kind!==V.kind)_(V,"unacceptable node kind for !<"+V.tag+'> tag; it should be "'+U.kind+'", not "'+V.kind+'"');if(!U.resolve(V.result,V.tag))_(V,"cannot resolve a node with !<"+V.tag+"> explicit tag");else if(V.result=U.construct(V.result,V.tag),V.anchor!==null)o(V,V.anchor,V.result)}if(V.listener!==null)V.listener("close",V);return V.depth-=1,V.tag!==null||V.anchor!==null||m}function X9(V){let S=V.position,h=!1,c;V.version=null,V.checkLineBreaks=V.legacy,V.tagMap=Object.create(null),V.anchorMap=Object.create(null);while((c=V.input.charCodeAt(V.position))!==0){if(E0(V,!0,-1),c=V.input.charCodeAt(V.position),V.lineIndent>0||c!==37)break;h=!0,c=V.input.charCodeAt(++V.position);let y=V.position;while(c!==0&&!R(c))c=V.input.charCodeAt(++V.position);let s=V.input.slice(y,V.position),I=[];if(s.length<1)_(V,"directive name must not be less than one character in length");while(c!==0){while(P(c))c=V.input.charCodeAt(++V.position);if(c===35){do c=V.input.charCodeAt(++V.position);while(c!==0&&!E(c));break}if(E(c))break;y=V.position;while(c!==0&&!R(c))c=V.input.charCodeAt(++V.position);I.push(V.input.slice(y,V.position))}if(c!==0)X$(V);if(J.call(x0,s))x0[s](V,s,I);else p(V,'unknown document directive "'+s+'"')}if(E0(V,!0,-1),V.lineIndent===0&&V.input.charCodeAt(V.position)===45&&V.input.charCodeAt(V.position+1)===45&&V.input.charCodeAt(V.position+2)===45)V.position+=3,E0(V,!0,-1);else if(h)_(V,"directives end mark is expected");if(f$(V,V.lineIndent-1,z,!1,!0),E0(V,!0,-1),V.checkLineBreaks&&M.test(V.input.slice(S,V.position)))p(V,"non-ASCII line breaks are interpreted as content");if(V.documents.push(V.result),V.position===V.lineStart&&t0(V)){if(V.input.charCodeAt(V.position)===46)V.position+=3,E0(V,!0,-1);return}if(V.position<V.length-1)_(V,"end of the stream or a document separator is expected")}function Y1(V,S){if(V=String(V),S=S||{},V.length!==0){if(V.charCodeAt(V.length-1)!==10&&V.charCodeAt(V.length-1)!==13)V+=`
38
- `;if(V.charCodeAt(0)===65279)V=V.slice(1)}let h=new J0(V,S),c=V.indexOf("\x00");if(c!==-1)h.position=c,_(h,"null byte is not allowed in input");h.input+="\x00";while(h.input.charCodeAt(h.position)===32)h.lineIndent+=1,h.position+=1;while(h.position<h.length-1)X9(h);return h.documents}function z1(V,S,h){if(S!==null&&typeof S==="object"&&typeof h>"u")h=S,S=null;let c=Y1(V,h);if(typeof S!=="function")return c;for(let y=0,s=c.length;y<s;y+=1)S(c[y])}function q1(V,S){let h=Y1(V,S);if(h.length===0)return;else if(h.length===1)return h[0];throw new Z("expected a single document in the stream, but found more")}return k5.loadAll=z1,k5.load=q1,k5}function C2(){if(gG)return B7;gG=1;let $=V9(),Z=B9(),X=F7(),Q=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=65279,W=9,Y=10,z=13,q=32,H=33,B=34,L=35,M=37,A=38,w=39,D=42,j=44,E=45,P=58,R=61,C=62,v=63,d=64,f=91,a=93,$0=96,u=123,e=124,Y0=125,J0={};J0[0]="\\0",J0[7]="\\a",J0[8]="\\b",J0[9]="\\t",J0[10]="\\n",J0[11]="\\v",J0[12]="\\f",J0[13]="\\r",J0[27]="\\e",J0[34]="\\\"",J0[92]="\\\\",J0[133]="\\N",J0[160]="\\_",J0[8232]="\\L",J0[8233]="\\P";let L0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],_=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function p(I,x){if(x===null)return{};let r={},m=Object.keys(x);for(let l=0,U=m.length;l<U;l+=1){let F=m[l],N=String(x[F]);if(F.slice(0,2)==="!!")F="tag:yaml.org,2002:"+F.slice(2);let T=I.compiledTypeMap.fallback[F];if(T&&J.call(T.styleAliases,N))N=T.styleAliases[N];r[F]=N}return r}function o(I){let x,r,m=I.toString(16).toUpperCase();if(I<=255)x="x",r=2;else if(I<=65535)x="u",r=4;else if(I<=4294967295)x="U",r=8;else throw new Z("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+x+$.repeat("0",r-m.length)+m}let K0=1,i=2;function G0(I){this.schema=I.schema||X,this.indent=Math.max(1,I.indent||2),this.noArrayIndent=I.noArrayIndent||!1,this.skipInvalid=I.skipInvalid||!1,this.flowLevel=$.isNothing(I.flowLevel)?-1:I.flowLevel,this.styleMap=p(this.schema,I.styles||null),this.sortKeys=I.sortKeys||!1,this.lineWidth=I.lineWidth||80,this.noRefs=I.noRefs||!1,this.noCompatMode=I.noCompatMode||!1,this.condenseFlow=I.condenseFlow||!1,this.quotingType=I.quotingType==='"'?i:K0,this.forceQuotes=I.forceQuotes||!1,this.replacer=typeof I.replacer==="function"?I.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function X0(I,x){let r=$.repeat(" ",x),m=0,l="",U=I.length;while(m<U){let F,N=I.indexOf(`
39
- `,m);if(N===-1)F=I.slice(m),m=U;else F=I.slice(m,N+1),m=N+1;if(F.length&&F!==`
40
- `)l+=r;l+=F}return l}function Z0(I,x){return`
41
- `+$.repeat(" ",I.indent*x)}function x0(I,x){for(let r=0,m=I.implicitTypes.length;r<m;r+=1)if(I.implicitTypes[r].resolve(x))return!0;return!1}function j0(I){return I===q||I===W}function m0(I){return I>=32&&I<=126||I>=161&&I<=55295&&I!==8232&&I!==8233||I>=57344&&I<=65533&&I!==G||I>=65536&&I<=1114111}function W0(I){return m0(I)&&I!==G&&I!==z&&I!==Y}function X$(I,x,r){let m=W0(I),l=m&&!j0(I);return(r?m:m&&I!==j&&I!==f&&I!==a&&I!==u&&I!==Y0)&&I!==L&&!(x===P&&!l)||W0(x)&&!j0(x)&&I===L||x===P&&l}function E0(I){return m0(I)&&I!==G&&!j0(I)&&I!==E&&I!==v&&I!==P&&I!==j&&I!==f&&I!==a&&I!==u&&I!==Y0&&I!==L&&I!==A&&I!==D&&I!==H&&I!==e&&I!==R&&I!==C&&I!==w&&I!==B&&I!==M&&I!==d&&I!==$0}function t0(I){return!j0(I)&&I!==P}function y0(I,x){let r=I.charCodeAt(x),m;if(r>=55296&&r<=56319&&x+1<I.length){if(m=I.charCodeAt(x+1),m>=56320&&m<=57343)return(r-55296)*1024+m-56320+65536}return r}function c0(I){return/^\n* /.test(I)}let j$=1,q$=2,L6=3,M6=4,g$=5;function U$(I,x,r,m,l,U,F,N){let T,O=0,g=null,n=!1,Q0=!1,B0=m!==-1,F0=-1,D0=E0(y0(I,0))&&t0(y0(I,I.length-1));if(x||F)for(T=0;T<I.length;O>=65536?T+=2:T++){if(O=y0(I,T),!m0(O))return g$;D0=D0&&X$(O,g,N),g=O}else{for(T=0;T<I.length;O>=65536?T+=2:T++){if(O=y0(I,T),O===Y){if(n=!0,B0)Q0=Q0||T-F0-1>m&&I[F0+1]!==" ",F0=T}else if(!m0(O))return g$;D0=D0&&X$(O,g,N),g=O}Q0=Q0||B0&&(T-F0-1>m&&I[F0+1]!==" ")}if(!n&&!Q0){if(D0&&!F&&!l(I))return j$;return U===i?g$:q$}if(r>9&&c0(I))return g$;if(!F)return Q0?M6:L6;return U===i?g$:q$}function A6(I,x,r,m,l){I.dump=function(){if(x.length===0)return I.quotingType===i?'""':"''";if(!I.noCompatMode){if(L0.indexOf(x)!==-1||_.test(x))return I.quotingType===i?'"'+x+'"':"'"+x+"'"}let U=I.indent*Math.max(1,r),F=I.lineWidth===-1?-1:Math.max(Math.min(I.lineWidth,40),I.lineWidth-U),N=m||I.flowLevel>-1&&r>=I.flowLevel;function T(O){return x0(I,O)}switch(U$(x,N,I.indent,F,T,I.quotingType,I.forceQuotes&&!m,l)){case j$:return x;case q$:return"'"+x.replace(/'/g,"''")+"'";case L6:return"|"+W1(x,I.indent)+g6(X0(x,U));case M6:return">"+W1(x,I.indent)+g6(X0(Z9(x,F),U));case g$:return'"'+X9(x)+'"';default:throw new Z("impossible error: invalid scalar style")}}()}function W1(I,x){let r=c0(I)?String(x):"",m=I[I.length-1]===`
42
- `,U=m&&(I[I.length-2]===`
43
- `||I===`
44
- `)?"+":m?"":"-";return r+U+`
45
- `}function g6(I){return I[I.length-1]===`
46
- `?I.slice(0,-1):I}function Z9(I,x){let r=/(\n+)([^\n]*)/g,m=function(){let N=I.indexOf(`
47
- `);return N=N!==-1?N:I.length,r.lastIndex=N,f$(I.slice(0,N),x)}(),l=I[0]===`
48
- `||I[0]===" ",U,F;while(F=r.exec(I)){let N=F[1],T=F[2];U=T[0]===" ",m+=N+(!l&&!U&&T!==""?`
49
- `:"")+f$(T,x),l=U}return m}function f$(I,x){if(I===""||I[0]===" ")return I;let r=/ [^ ]/g,m,l=0,U,F=0,N=0,T="";while(m=r.exec(I)){if(N=m.index,N-l>x)U=F>l?F:N,T+=`
50
- `+I.slice(l,U),l=U+1;F=N}if(T+=`
51
- `,I.length-l>x&&F>l)T+=I.slice(l,F)+`
52
- `+I.slice(F+1);else T+=I.slice(l);return T.slice(1)}function X9(I){let x="",r=0;for(let m=0;m<I.length;r>=65536?m+=2:m++){r=y0(I,m);let l=J0[r];if(!l&&m0(r)){if(x+=I[m],r>=65536)x+=I[m+1]}else x+=l||o(r)}return x}function Y1(I,x,r){let m="",l=I.tag;for(let U=0,F=r.length;U<F;U+=1){let N=r[U];if(I.replacer)N=I.replacer.call(r,String(U),N);if(h(I,x,N,!1,!1)||typeof N>"u"&&h(I,x,null,!1,!1)){if(m!=="")m+=","+(!I.condenseFlow?" ":"");m+=I.dump}}I.tag=l,I.dump="["+m+"]"}function z1(I,x,r,m){let l="",U=I.tag;for(let F=0,N=r.length;F<N;F+=1){let T=r[F];if(I.replacer)T=I.replacer.call(r,String(F),T);if(h(I,x+1,T,!0,!0,!1,!0)||typeof T>"u"&&h(I,x+1,null,!0,!0,!1,!0)){if(!m||l!=="")l+=Z0(I,x);if(I.dump&&Y===I.dump.charCodeAt(0))l+="-";else l+="- ";l+=I.dump}}I.tag=U,I.dump=l||"[]"}function q1(I,x,r){let m="",l=I.tag,U=Object.keys(r);for(let F=0,N=U.length;F<N;F+=1){let T="";if(m!=="")T+=", ";if(I.condenseFlow)T+='"';let O=U[F],g=r[O];if(I.replacer)g=I.replacer.call(r,O,g);if(!h(I,x,O,!1,!1))continue;if(I.dump.length>1024)T+="? ";if(T+=I.dump+(I.condenseFlow?'"':"")+":"+(I.condenseFlow?"":" "),!h(I,x,g,!1,!1))continue;T+=I.dump,m+=T}I.tag=l,I.dump="{"+m+"}"}function V(I,x,r,m){let l="",U=I.tag,F=Object.keys(r);if(I.sortKeys===!0)F.sort();else if(typeof I.sortKeys==="function")F.sort(I.sortKeys);else if(I.sortKeys)throw new Z("sortKeys must be a boolean or a function");for(let N=0,T=F.length;N<T;N+=1){let O="";if(!m||l!=="")O+=Z0(I,x);let g=F[N],n=r[g];if(I.replacer)n=I.replacer.call(r,g,n);if(!h(I,x+1,g,!0,!0,!0))continue;let Q0=I.tag!==null&&I.tag!=="?"||I.dump&&I.dump.length>1024;if(Q0)if(I.dump&&Y===I.dump.charCodeAt(0))O+="?";else O+="? ";if(O+=I.dump,Q0)O+=Z0(I,x);if(!h(I,x+1,n,!0,Q0))continue;if(I.dump&&Y===I.dump.charCodeAt(0))O+=":";else O+=": ";O+=I.dump,l+=O}I.tag=U,I.dump=l||"{}"}function S(I,x,r){let m=r?I.explicitTypes:I.implicitTypes;for(let l=0,U=m.length;l<U;l+=1){let F=m[l];if((F.instanceOf||F.predicate)&&(!F.instanceOf||typeof x==="object"&&x instanceof F.instanceOf)&&(!F.predicate||F.predicate(x))){if(r)if(F.multi&&F.representName)I.tag=F.representName(x);else I.tag=F.tag;else I.tag="?";if(F.represent){let N=I.styleMap[F.tag]||F.defaultStyle,T;if(Q.call(F.represent)==="[object Function]")T=F.represent(x,N);else if(J.call(F.represent,N))T=F.represent[N](x,N);else throw new Z("!<"+F.tag+'> tag resolver accepts not "'+N+'" style');I.dump=T}return!0}}return!1}function h(I,x,r,m,l,U,F){if(I.tag=null,I.dump=r,!S(I,r,!1))S(I,r,!0);let N=Q.call(I.dump),T=m;if(m)m=I.flowLevel<0||I.flowLevel>x;let O=N==="[object Object]"||N==="[object Array]",g,n;if(O)g=I.duplicates.indexOf(r),n=g!==-1;if(I.tag!==null&&I.tag!=="?"||n||I.indent!==2&&x>0)l=!1;if(n&&I.usedDuplicates[g])I.dump="*ref_"+g;else{if(O&&n&&!I.usedDuplicates[g])I.usedDuplicates[g]=!0;if(N==="[object Object]"){if(m&&Object.keys(I.dump).length!==0){if(V(I,x,I.dump,l),n)I.dump="&ref_"+g+I.dump}else if(q1(I,x,I.dump),n)I.dump="&ref_"+g+" "+I.dump}else if(N==="[object Array]"){if(m&&I.dump.length!==0){if(I.noArrayIndent&&!F&&x>0)z1(I,x-1,I.dump,l);else z1(I,x,I.dump,l);if(n)I.dump="&ref_"+g+I.dump}else if(Y1(I,x,I.dump),n)I.dump="&ref_"+g+" "+I.dump}else if(N==="[object String]"){if(I.tag!=="?")A6(I,I.dump,x,U,T)}else if(N==="[object Undefined]")return!1;else{if(I.skipInvalid)return!1;throw new Z("unacceptable kind of an object to dump "+N)}if(I.tag!==null&&I.tag!=="?"){let Q0=encodeURI(I.tag[0]==="!"?I.tag.slice(1):I.tag).replace(/!/g,"%21");if(I.tag[0]==="!")Q0="!"+Q0;else if(Q0.slice(0,18)==="tag:yaml.org,2002:")Q0="!!"+Q0.slice(18);else Q0="!<"+Q0+">";I.dump=Q0+" "+I.dump}}return!0}function c(I,x){let r=[],m=[];y(I,r,m);let l=m.length;for(let U=0;U<l;U+=1)x.duplicates.push(r[m[U]]);x.usedDuplicates=Array(l)}function y(I,x,r){if(I!==null&&typeof I==="object"){let m=x.indexOf(I);if(m!==-1){if(r.indexOf(m)===-1)r.push(m)}else if(x.push(I),Array.isArray(I))for(let l=0,U=I.length;l<U;l+=1)y(I[l],x,r);else{let l=Object.keys(I);for(let U=0,F=l.length;U<F;U+=1)y(I[l[U]],x,r)}}}function s(I,x){x=x||{};let r=new G0(x);if(!r.noRefs)c(I,r);let m=I;if(r.replacer)m=r.replacer.call({"":m},"",m);if(h(r,0,m,!0,!0))return r.dump+`
53
- `;return""}return B7.dump=s,B7}function S2(){if(fG)return K$;fG=1;let $=P2(),Z=C2();function X(Q,J){return function(){throw Error("Function yaml."+Q+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}return K$.Type=A$(),K$.Schema=hG(),K$.FAILSAFE_SCHEMA=lG(),K$.JSON_SCHEMA=rG(),K$.CORE_SCHEMA=aG(),K$.DEFAULT_SCHEMA=F7(),K$.load=$.load,K$.loadAll=$.loadAll,K$.dump=Z.dump,K$.YAMLException=B9(),K$.types={binary:tG(),float:nG(),map:dG(),null:cG(),pairs:$W(),set:ZW(),timestamp:oG(),bool:pG(),int:iG(),merge:sG(),omap:eG(),seq:mG(),str:uG()},K$.safeLoad=X("safeLoad","load"),K$.safeLoadAll=X("safeLoadAll","loadAll"),K$.safeDump=X("safeDump","dump"),K$}var K$,k5,L1,BG,nZ,FG,rZ,LG,aZ,MG,oZ,AG,sZ,IG,tZ,NG,eZ,DG,$7,wG,Z7,TG,X7,jG,Q7,OG,J7,EG,G7,RG,W7,PG,Y7,CG,z7,SG,q7,_G,U7,xG,K7,bG,H7,kG,V7,yG,vG,B7,gG,fG,_2,y5,Eh,Rh,Ph,XW,Ch,Sh,_h,xh,bh,kh,yh,vh,gh,fh;var L7=t(()=>{K$={},k5={},L1={};B7={};_2=S2(),y5=E2(_2),{Type:Eh,Schema:Rh,FAILSAFE_SCHEMA:Ph,JSON_SCHEMA:XW,CORE_SCHEMA:Ch,DEFAULT_SCHEMA:Sh,load:_h,loadAll:xh,dump:bh,YAMLException:kh,types:yh,safeLoad:vh,safeLoadAll:gh,safeDump:fh}=y5});var QW;var JW=t(()=>{s$();L7();L7();QW={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")try{return y5.load(Z,{schema:XW})}catch{try{return y5.load(Z)}catch(X){throw new o$(X?.message||"Parser Error",$.url)}}else return Z}}});var x2,GW;var WW=t(()=>{s$();x2=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,GW={order:300,allowEmpty:!0,encoding:"utf8",canParse($){return(typeof $.data==="string"||Buffer.isBuffer($.data))&&x2.test($.url)},parse($){if(typeof $.data==="string")return $.data;else if(Buffer.isBuffer($.data))return $.data.toString(this.encoding);else throw new o$("data is not text",$.url)}}});var b2,YW;var zW=t(()=>{b2=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,YW={order:400,allowEmpty:!0,canParse($){return Buffer.isBuffer($.data)&&b2.test($.url)},parse($){if(Buffer.isBuffer($.data))return $.data;else return Buffer.from($.data)}}});var M7;var A7=t(()=>{R$();s$();M7={order:100,canRead($){return j5($.url)},async read($){let Z,X=await import("fs");try{Z=A4($.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${$.url}: ${J.message}`,new Y6(J,$.url)}if(Z.endsWith("/")||Z.endsWith("\\"))Z=Z.slice(0,-1);try{return await X.promises.readFile(Z)}catch(Q){let J=Q;throw J.message=`Error opening file ${Z}: ${J.message}`,new Y6(J,Z)}}}});async function qW($,Z,X){$=M4($);let Q=X||[];Q.push($.href);try{if(Z.safeUrlResolver&&T5($.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${$.href}`);let J=await k2($,Z);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(Z.redirects)&&Q.length>Z.redirects){let G=Error(`Error downloading ${Q[0]}.
26
+ `+X.mark.snippet;return G+" "+J}function Z(X,Q){if(Error.call(this),this.name="YAMLException",this.reason=X,this.mark=Q,this.message=$(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z.prototype.toString=function(Q){return this.name+": "+$(this,Q)},W7=Z,W7}function a2(){if(_G)return Y7;_G=1;let $=N9();function Z(J,G,W,Y,z){let q="",H="",B=Math.floor(z/2)-1;if(Y-G>B)q=" ... ",G=Y-B+q.length;if(W-Y>B)H=" ...",W=Y+B-H.length;return{str:q+J.slice(G,W).replace(/\t/g,"→")+H,pos:Y-G+q.length}}function X(J,G){return $.repeat(" ",G-J.length)+J}function Q(J,G){if(G=Object.create(G||null),!J.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;let W=/\r?\n|\r|\0/g,Y=[0],z=[],q,H=-1;while(q=W.exec(J.buffer))if(z.push(q.index),Y.push(q.index+q[0].length),J.position<=q.index&&H<0)H=Y.length-2;if(H<0)H=Y.length-1;let B="",F=Math.min(J.line+G.linesAfter,z.length).toString().length,L=G.maxLength-(G.indent+F+3);for(let N=1;N<=G.linesBefore;N++){if(H-N<0)break;let I=Z(J.buffer,Y[H-N],z[H-N],J.position-(Y[H]-Y[H-N]),L);B=$.repeat(" ",G.indent)+X((J.line-N+1).toString(),F)+" | "+I.str+`
27
+ `+B}let w=Z(J.buffer,Y[H],z[H],J.position,L);B+=$.repeat(" ",G.indent)+X((J.line+1).toString(),F)+" | "+w.str+`
28
+ `,B+=$.repeat("-",G.indent+F+3+w.pos)+`^
29
+ `;for(let N=1;N<=G.linesAfter;N++){if(H+N>=z.length)break;let I=Z(J.buffer,Y[H+N],z[H+N],J.position-(Y[H]-Y[H+N]),L);B+=$.repeat(" ",G.indent)+X((J.line+N+1).toString(),F)+" | "+I.str+`
30
+ `}return B.replace(/\n$/,"")}return Y7=Q,Y7}function I$(){if(bG)return z7;bG=1;let $=D9(),Z=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],X=["scalar","sequence","mapping"];function Q(G){let W={};if(G!==null)Object.keys(G).forEach(function(Y){G[Y].forEach(function(z){W[String(z)]=Y})});return W}function J(G,W){if(W=W||{},Object.keys(W).forEach(function(Y){if(Z.indexOf(Y)===-1)throw new $('Unknown option "'+Y+'" is met in definition of "'+G+'" YAML type.')}),this.options=W,this.tag=G,this.kind=W.kind||null,this.resolve=W.resolve||function(){return!0},this.construct=W.construct||function(Y){return Y},this.instanceOf=W.instanceOf||null,this.predicate=W.predicate||null,this.represent=W.represent||null,this.representName=W.representName||null,this.defaultStyle=W.defaultStyle||null,this.multi=W.multi||!1,this.styleAliases=Q(W.styleAliases||null),X.indexOf(this.kind)===-1)throw new $('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return z7=J,z7}function $W(){if(xG)return q7;xG=1;let $=D9(),Z=I$();function X(G,W){let Y=[];return G[W].forEach(function(z){let q=Y.length;Y.forEach(function(H,B){if(H.tag===z.tag&&H.kind===z.kind&&H.multi===z.multi)q=B}),Y[q]=z}),Y}function Q(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function W(Y){if(Y.multi)G.multi[Y.kind].push(Y),G.multi.fallback.push(Y);else G[Y.kind][Y.tag]=G.fallback[Y.tag]=Y}for(let Y=0,z=arguments.length;Y<z;Y+=1)arguments[Y].forEach(W);return G}function J(G){return this.extend(G)}return J.prototype.extend=function(W){let Y=[],z=[];if(W instanceof Z)z.push(W);else if(Array.isArray(W))z=z.concat(W);else if(W&&(Array.isArray(W.implicit)||Array.isArray(W.explicit))){if(W.implicit)Y=Y.concat(W.implicit);if(W.explicit)z=z.concat(W.explicit)}else throw new $("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");Y.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(H.loadKind&&H.loadKind!=="scalar")throw new $("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(H.multi)throw new $("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),z.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let q=Object.create(J.prototype);return q.implicit=(this.implicit||[]).concat(Y),q.explicit=(this.explicit||[]).concat(z),q.compiledImplicit=X(q,"implicit"),q.compiledExplicit=X(q,"explicit"),q.compiledTypeMap=Q(q.compiledImplicit,q.compiledExplicit),q},q7=J,q7}function ZW(){if(kG)return K7;return kG=1,K7=new(I$())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),K7}function XW(){if(yG)return U7;return yG=1,U7=new(I$())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),U7}function QW(){if(vG)return H7;return vG=1,H7=new(I$())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),H7}function JW(){if(gG)return V7;return gG=1,V7=new($W())({explicit:[ZW(),XW(),QW()]}),V7}function GW(){if(fG)return B7;fG=1;let $=I$();function Z(J){if(J===null)return!0;let G=J.length;return G===1&&J==="~"||G===4&&(J==="null"||J==="Null"||J==="NULL")}function X(){return null}function Q(J){return J===null}return B7=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),B7}function WW(){if(hG)return F7;hG=1;let $=I$();function Z(J){if(J===null)return!1;let G=J.length;return G===4&&(J==="true"||J==="True"||J==="TRUE")||G===5&&(J==="false"||J==="False"||J==="FALSE")}function X(J){return J==="true"||J==="True"||J==="TRUE"}function Q(J){return Object.prototype.toString.call(J)==="[object Boolean]"}return F7=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{lowercase:function(J){return J?"true":"false"},uppercase:function(J){return J?"TRUE":"FALSE"},camelcase:function(J){return J?"True":"False"}},defaultStyle:"lowercase"}),F7}function YW(){if(uG)return L7;uG=1;let $=N9(),Z=I$();function X(q){return q>=48&&q<=57||q>=65&&q<=70||q>=97&&q<=102}function Q(q){return q>=48&&q<=55}function J(q){return q>=48&&q<=57}function G(q){if(q===null)return!1;let H=q.length,B=0,F=!1;if(!H)return!1;let L=q[B];if(L==="-"||L==="+")L=q[++B];if(L==="0"){if(B+1===H)return!0;if(L=q[++B],L==="b"){B++;for(;B<H;B++){if(L=q[B],L!=="0"&&L!=="1")return!1;F=!0}return F&&isFinite(W(q))}if(L==="x"){B++;for(;B<H;B++){if(!X(q.charCodeAt(B)))return!1;F=!0}return F&&isFinite(W(q))}if(L==="o"){B++;for(;B<H;B++){if(!Q(q.charCodeAt(B)))return!1;F=!0}return F&&isFinite(W(q))}}for(;B<H;B++){if(!J(q.charCodeAt(B)))return!1;F=!0}if(!F)return!1;return isFinite(W(q))}function W(q){let H=q,B=1,F=H[0];if(F==="-"||F==="+"){if(F==="-")B=-1;H=H.slice(1),F=H[0]}if(H==="0")return 0;if(F==="0"){if(H[1]==="b")return B*parseInt(H.slice(2),2);if(H[1]==="x")return B*parseInt(H.slice(2),16);if(H[1]==="o")return B*parseInt(H.slice(2),8)}return B*parseInt(H,10)}function Y(q){return W(q)}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1===0&&!$.isNegativeZero(q))}return L7=new Z("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:Y,predicate:z,represent:{binary:function(q){return q>=0?"0b"+q.toString(2):"-0b"+q.toString(2).slice(1)},octal:function(q){return q>=0?"0o"+q.toString(8):"-0o"+q.toString(8).slice(1)},decimal:function(q){return q.toString(10)},hexadecimal:function(q){return q>=0?"0x"+q.toString(16).toUpperCase():"-0x"+q.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),L7}function zW(){if(mG)return M7;mG=1;let $=N9(),Z=I$(),X=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Q=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J(q){if(q===null)return!1;if(!X.test(q))return!1;if(isFinite(parseFloat(q,10)))return!0;return Q.test(q)}function G(q){let H=q.toLowerCase(),B=H[0]==="-"?-1:1;if("+-".indexOf(H[0])>=0)H=H.slice(1);if(H===".inf")return B===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(H===".nan")return NaN;return B*parseFloat(H,10)}let W=/^[-+]?[0-9]+e/;function Y(q,H){if(isNaN(q))switch(H){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===q)switch(H){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===q)switch(H){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($.isNegativeZero(q))return"-0.0";let B=q.toString(10);return W.test(B)?B.replace("e",".e"):B}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1!==0||$.isNegativeZero(q))}return M7=new Z("tag:yaml.org,2002:float",{kind:"scalar",resolve:J,construct:G,predicate:z,represent:Y,defaultStyle:"lowercase"}),M7}function qW(){if(dG)return A7;return dG=1,A7=JW().extend({implicit:[GW(),WW(),YW(),zW()]}),A7}function KW(){if(lG)return I7;return lG=1,I7=qW(),I7}function UW(){if(cG)return N7;cG=1;let $=I$(),Z=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Q(W){if(W===null)return!1;if(Z.exec(W)!==null)return!0;if(X.exec(W)!==null)return!0;return!1}function J(W){let Y=0,z=null,q=Z.exec(W);if(q===null)q=X.exec(W);if(q===null)throw Error("Date resolve error");let H=+q[1],B=+q[2]-1,F=+q[3];if(!q[4])return new Date(Date.UTC(H,B,F));let L=+q[4],w=+q[5],N=+q[6];if(q[7]){Y=q[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(q[9]){let T=+q[10],E=+(q[11]||0);if(z=(T*60+E)*60000,q[9]==="-")z=-z}let I=new Date(Date.UTC(H,B,F,L,w,N,Y));if(z)I.setTime(I.getTime()-z);return I}function G(W){return W.toISOString()}return N7=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q,construct:J,instanceOf:Date,represent:G}),N7}function HW(){if(pG)return D7;pG=1;let $=I$();function Z(X){return X==="<<"||X===null}return D7=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Z}),D7}function VW(){if(iG)return w7;iG=1;let $=I$(),Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
31
+ \r`;function X(W){if(W===null)return!1;let Y=0,z=W.length,q=Z;for(let H=0;H<z;H++){let B=q.indexOf(W.charAt(H));if(B>64)continue;if(B<0)return!1;Y+=6}return Y%8===0}function Q(W){let Y=W.replace(/[\r\n=]/g,""),z=Y.length,q=Z,H=0,B=[];for(let L=0;L<z;L++){if(L%4===0&&L)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);H=H<<6|q.indexOf(Y.charAt(L))}let F=z%4*6;if(F===0)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);else if(F===18)B.push(H>>10&255),B.push(H>>2&255);else if(F===12)B.push(H>>4&255);return new Uint8Array(B)}function J(W){let Y="",z=0,q=W.length,H=Z;for(let F=0;F<q;F++){if(F%3===0&&F)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];z=(z<<8)+W[F]}let B=q%3;if(B===0)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];else if(B===2)Y+=H[z>>10&63],Y+=H[z>>4&63],Y+=H[z<<2&63],Y+=H[64];else if(B===1)Y+=H[z>>2&63],Y+=H[z<<4&63],Y+=H[64],Y+=H[64];return Y}function G(W){return Object.prototype.toString.call(W)==="[object Uint8Array]"}return w7=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:X,construct:Q,predicate:G,represent:J}),w7}function BW(){if(nG)return T7;nG=1;let $=I$(),Z=Object.prototype.hasOwnProperty,X=Object.prototype.toString;function Q(G){if(G===null)return!0;let W=[],Y=G;for(let z=0,q=Y.length;z<q;z+=1){let H=Y[z],B=!1;if(X.call(H)!=="[object Object]")return!1;let F;for(F in H)if(Z.call(H,F))if(!B)B=!0;else return!1;if(!B)return!1;if(W.indexOf(F)===-1)W.push(F);else return!1}return!0}function J(G){return G!==null?G:[]}return T7=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Q,construct:J}),T7}function FW(){if(rG)return j7;rG=1;let $=I$(),Z=Object.prototype.toString;function X(J){if(J===null)return!0;let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y];if(Z.call(q)!=="[object Object]")return!1;let H=Object.keys(q);if(H.length!==1)return!1;W[Y]=[H[0],q[H[0]]]}return!0}function Q(J){if(J===null)return[];let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y],H=Object.keys(q);W[Y]=[H[0],q[H[0]]]}return W}return j7=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:X,construct:Q}),j7}function LW(){if(aG)return O7;aG=1;let $=I$(),Z=Object.prototype.hasOwnProperty;function X(J){if(J===null)return!0;let G=J;for(let W in G)if(Z.call(G,W)){if(G[W]!==null)return!1}return!0}function Q(J){return J!==null?J:{}}return O7=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:X,construct:Q}),O7}function P7(){if(oG)return E7;return oG=1,E7=KW().extend({implicit:[UW(),HW()],explicit:[VW(),BW(),FW(),LW()]}),E7}function o2(){if(sG)return p8;sG=1;let $=N9(),Z=D9(),X=a2(),Q=P7(),J=Object.prototype.hasOwnProperty,G=1,W=2,Y=3,z=4,q=1,H=2,B=3,F=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,L=/[\x85\u2028\u2029]/,w=/[,\[\]{}]/,N=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function T(V){return Object.prototype.toString.call(V)}function E(V){return V===10||V===13}function P(V){return V===9||V===32}function R(V){return V===9||V===32||V===10||V===13}function C(V){return V===44||V===91||V===93||V===123||V===125}function y(V){if(V>=48&&V<=57)return V-48;let S=V|32;if(S>=97&&S<=102)return S-97+10;return-1}function v(V){if(V===120)return 2;if(V===117)return 4;if(V===85)return 8;return 0}function h(V){if(V>=48&&V<=57)return V-48;return-1}function X0(V){switch(V){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
32
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function r(V){if(V<=65535)return String.fromCharCode(V);return String.fromCharCode((V-65536>>10)+55296,(V-65536&1023)+56320)}function u(V,S,m){if(S==="__proto__")Object.defineProperty(V,S,{configurable:!0,enumerable:!0,writable:!0,value:m});else V[S]=m}let t=Array(256),Y0=Array(256);for(let V=0;V<256;V++)t[V]=X0(V)?1:0,Y0[V]=X0(V);function G0(V,S){this.input=V,this.filename=S.filename||null,this.schema=S.schema||Q,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.maxDepth=typeof S.maxDepth==="number"?S.maxDepth:100,this.maxTotalMergeKeys=typeof S.maxTotalMergeKeys==="number"?S.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=V.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function A0(V,S){let m={name:V.filename,buffer:V.input.slice(0,-1),position:V.position,line:V.line,column:V.position-V.lineStart};return m.snippet=X(m),new Z(S,m)}function l(V,S){throw A0(V,S)}function K0(V,S){if(V.onWarning)V.onWarning.call(null,A0(V,S))}function V0(V,S,m){let p=V.anchorMapTransactions;if(p.length!==0){let k=p[p.length-1];if(!J.call(k,S))k[S]={existed:J.call(V.anchorMap,S),value:V.anchorMap[S]}}V.anchorMap[S]=m}function o(V){V.anchorMapTransactions.push(Object.create(null))}function f(V){let S=V.anchorMapTransactions.pop(),m=V.anchorMapTransactions;if(m.length===0)return;let p=m[m.length-1],k=Object.keys(S);for(let a=0,A=k.length;a<A;a+=1){let _=k[a];if(!J.call(p,_))p[_]=S[_]}}function Z0(V){let S=V.anchorMapTransactions.pop(),m=Object.keys(S);for(let p=m.length-1;p>=0;p-=1){let k=S[m[p]];if(k.existed)V.anchorMap[m[p]]=k.value;else delete V.anchorMap[m[p]]}}function J0(V){return{position:V.position,line:V.line,lineStart:V.lineStart,lineIndent:V.lineIndent,firstTabInLine:V.firstTabInLine,tag:V.tag,anchor:V.anchor,kind:V.kind,result:V.result}}function $0(V,S){V.position=S.position,V.line=S.line,V.lineStart=S.lineStart,V.lineIndent=S.lineIndent,V.firstTabInLine=S.firstTabInLine,V.tag=S.tag,V.anchor=S.anchor,V.kind=S.kind,V.result=S.result}let F0={YAML:function(S,m,p){if(S.version!==null)l(S,"duplication of %YAML directive");if(p.length!==1)l(S,"YAML directive accepts exactly one argument");let k=/^([0-9]+)\.([0-9]+)$/.exec(p[0]);if(k===null)l(S,"ill-formed argument of the YAML directive");let a=parseInt(k[1],10),A=parseInt(k[2],10);if(a!==1)l(S,"unacceptable YAML version of the document");if(S.version=p[0],S.checkLineBreaks=A<2,A!==1&&A!==2)K0(S,"unsupported YAML version of the document")},TAG:function(S,m,p){let k;if(p.length!==2)l(S,"TAG directive accepts exactly two arguments");let a=p[0];if(k=p[1],!N.test(a))l(S,"ill-formed tag handle (first argument) of the TAG directive");if(J.call(S.tagMap,a))l(S,'there is a previously declared suffix for "'+a+'" tag handle');if(!I.test(k))l(S,"ill-formed tag prefix (second argument) of the TAG directive");try{k=decodeURIComponent(k)}catch(A){l(S,"tag prefix is malformed: "+k)}S.tagMap[a]=k}};function U0(V,S,m,p){if(S<m){let k=V.input.slice(S,m);if(p)for(let a=0,A=k.length;a<A;a+=1){let _=k.charCodeAt(a);if(!(_===9||_>=32&&_<=1114111))l(V,"expected valid JSON character")}else if(F.test(k))l(V,"the stream contains non-printable characters");V.result+=k}}function D0(V,S,m,p){if(!$.isObject(m))l(V,"cannot merge mappings; the provided source object is unacceptable");let k=Object.keys(m);for(let a=0,A=k.length;a<A;a+=1){let _=k[a];if(V.maxTotalMergeKeys!==-1&&++V.totalMergeKeys>V.maxTotalMergeKeys)l(V,"merge keys exceeded maxTotalMergeKeys ("+V.maxTotalMergeKeys+")");if(!J.call(S,_))u(S,_,m[_]),p[_]=!0}}function e(V,S,m,p,k,a,A,_,n){if(Array.isArray(k)){k=Array.prototype.slice.call(k);for(let d=0,c=k.length;d<c;d+=1){if(Array.isArray(k[d]))l(V,"nested arrays are not supported inside keys");if(typeof k==="object"&&T(k[d])==="[object Object]")k[d]="[object Object]"}}if(typeof k==="object"&&T(k)==="[object Object]")k="[object Object]";if(k=String(k),S===null)S={};if(p==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(let d=0,c=a.length;d<c;d+=1)D0(V,S,a[d],m);else D0(V,S,a,m);else{if(!V.json&&!J.call(m,k)&&J.call(S,k))V.line=A||V.line,V.lineStart=_||V.lineStart,V.position=n||V.position,l(V,"duplicated mapping key");u(S,k,a),delete m[k]}return S}function d0(V){let S=V.input.charCodeAt(V.position);if(S===10)V.position++;else if(S===13){if(V.position++,V.input.charCodeAt(V.position)===10)V.position++}else l(V,"a line break is expected");V.line+=1,V.lineStart=V.position,V.firstTabInLine=-1}function R0(V,S,m){let p=0,k=V.input.charCodeAt(V.position);while(k!==0){while(P(k)){if(k===9&&V.firstTabInLine===-1)V.firstTabInLine=V.position;k=V.input.charCodeAt(++V.position)}if(S&&k===35)do k=V.input.charCodeAt(++V.position);while(k!==10&&k!==13&&k!==0);if(E(k)){d0(V),k=V.input.charCodeAt(V.position),p++,V.lineIndent=0;while(k===32)V.lineIndent++,k=V.input.charCodeAt(++V.position)}else break}if(m!==-1&&p!==0&&V.lineIndent<m)K0(V,"deficient indentation");return p}function p0(V){let S=V.position,m=V.input.charCodeAt(S);if((m===45||m===46)&&m===V.input.charCodeAt(S+1)&&m===V.input.charCodeAt(S+2)){if(S+=3,m=V.input.charCodeAt(S),m===0||R(m))return!0}return!1}function v0(V,S){if(S===1)V.result+=" ";else if(S>1)V.result+=$.repeat(`
33
+ `,S-1)}function i0(V,S,m){let p,k,a,A,_,n,d=V.kind,c=V.result,K=V.input.charCodeAt(V.position);if(R(K)||C(K)||K===35||K===38||K===42||K===33||K===124||K===62||K===39||K===34||K===37||K===64||K===96)return!1;if(K===63||K===45){let M=V.input.charCodeAt(V.position+1);if(R(M)||m&&C(M))return!1}V.kind="scalar",V.result="",p=k=V.position,a=!1;while(K!==0){if(K===58){let M=V.input.charCodeAt(V.position+1);if(R(M)||m&&C(M))break}else if(K===35){let M=V.input.charCodeAt(V.position-1);if(R(M))break}else if(V.position===V.lineStart&&p0(V)||m&&C(K))break;else if(E(K))if(A=V.line,_=V.lineStart,n=V.lineIndent,R0(V,!1,-1),V.lineIndent>=S){a=!0,K=V.input.charCodeAt(V.position);continue}else{V.position=k,V.line=A,V.lineStart=_,V.lineIndent=n;break}if(a)U0(V,p,k,!1),v0(V,V.line-A),p=k=V.position,a=!1;if(!P(K))k=V.position+1;K=V.input.charCodeAt(++V.position)}if(U0(V,p,k,!1),V.result)return!0;return V.kind=d,V.result=c,!1}function O$(V,S){let m,p,k=V.input.charCodeAt(V.position);if(k!==39)return!1;V.kind="scalar",V.result="",V.position++,m=p=V.position;while((k=V.input.charCodeAt(V.position))!==0)if(k===39)if(U0(V,m,V.position,!0),k=V.input.charCodeAt(++V.position),k===39)m=V.position,V.position++,p=V.position;else return!0;else if(E(k))U0(V,m,p,!0),v0(V,R0(V,!1,S)),m=p=V.position;else if(V.position===V.lineStart&&p0(V))l(V,"unexpected end of the document within a single quoted scalar");else if(V.position++,!P(k))p=V.position;l(V,"unexpected end of the stream within a single quoted scalar")}function q$(V,S){let m,p,k,a=V.input.charCodeAt(V.position);if(a!==34)return!1;V.kind="scalar",V.result="",V.position++,m=p=V.position;while((a=V.input.charCodeAt(V.position))!==0)if(a===34)return U0(V,m,V.position,!0),V.position++,!0;else if(a===92){if(U0(V,m,V.position,!0),a=V.input.charCodeAt(++V.position),E(a))R0(V,!1,S);else if(a<256&&t[a])V.result+=Y0[a],V.position++;else if((k=v(a))>0){let A=k,_=0;for(;A>0;A--)if(a=V.input.charCodeAt(++V.position),(k=y(a))>=0)_=(_<<4)+k;else l(V,"expected hexadecimal character");V.result+=r(_),V.position++}else l(V,"unknown escape sequence");m=p=V.position}else if(E(a))U0(V,m,p,!0),v0(V,R0(V,!1,S)),m=p=V.position;else if(V.position===V.lineStart&&p0(V))l(V,"unexpected end of the document within a double quoted scalar");else if(V.position++,!P(a))p=V.position;l(V,"unexpected end of the stream within a double quoted scalar")}function M1(V,S){let m=!0,p,k,a,A=V.tag,_,n=V.anchor,d,c,K,M,D=Object.create(null),j,O,g,i=V.input.charCodeAt(V.position);if(i===91)d=93,M=!1,_=[];else if(i===123)d=125,M=!0,_={};else return!1;if(V.anchor!==null)V0(V,V.anchor,_);i=V.input.charCodeAt(++V.position);while(i!==0){if(R0(V,!0,S),i=V.input.charCodeAt(V.position),i===d)return V.position++,V.tag=A,V.anchor=n,V.kind=M?"mapping":"sequence",V.result=_,!0;else if(!m)l(V,"missed comma between flow collection entries");else if(i===44)l(V,"expected the node content, but found ','");if(O=j=g=null,c=K=!1,i===63){let Q0=V.input.charCodeAt(V.position+1);if(R(Q0))c=K=!0,V.position++,R0(V,!0,S)}if(p=V.line,k=V.lineStart,a=V.position,h$(V,S,G,!1,!0),O=V.tag,j=V.result,R0(V,!0,S),i=V.input.charCodeAt(V.position),(K||V.line===p)&&i===58)c=!0,i=V.input.charCodeAt(++V.position),R0(V,!0,S),h$(V,S,G,!1,!0),g=V.result;if(M)e(V,_,D,O,j,g,p,k,a);else if(c)_.push(e(V,null,D,O,j,g,p,k,a));else _.push(j);if(R0(V,!0,S),i=V.input.charCodeAt(V.position),i===44)m=!0,i=V.input.charCodeAt(++V.position);else m=!1}l(V,"unexpected end of the stream within a flow collection")}function A1(V,S){let m,p=q,k=!1,a=!1,A=S,_=0,n=!1,d,c=V.input.charCodeAt(V.position);if(c===124)m=!1;else if(c===62)m=!0;else return!1;V.kind="scalar",V.result="";while(c!==0)if(c=V.input.charCodeAt(++V.position),c===43||c===45)if(q===p)p=c===43?B:H;else l(V,"repeat of a chomping mode identifier");else if((d=h(c))>=0)if(d===0)l(V,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!a)A=S+d-1,a=!0;else l(V,"repeat of an indentation width identifier");else break;if(P(c)){do c=V.input.charCodeAt(++V.position);while(P(c));if(c===35)do c=V.input.charCodeAt(++V.position);while(!E(c)&&c!==0)}while(c!==0){d0(V),V.lineIndent=0,c=V.input.charCodeAt(V.position);while((!a||V.lineIndent<A)&&c===32)V.lineIndent++,c=V.input.charCodeAt(++V.position);if(!a&&V.lineIndent>A)A=V.lineIndent;if(E(c)){_++;continue}if(!a&&A===0)l(V,"missing indentation for block scalar");if(V.lineIndent<A){if(p===B)V.result+=$.repeat(`
34
+ `,k?1+_:_);else if(p===q){if(k)V.result+=`
35
+ `}break}if(m)if(P(c))n=!0,V.result+=$.repeat(`
36
+ `,k?1+_:_);else if(n)n=!1,V.result+=$.repeat(`
37
+ `,_+1);else if(_===0){if(k)V.result+=" "}else V.result+=$.repeat(`
38
+ `,_);else V.result+=$.repeat(`
39
+ `,k?1+_:_);k=!0,a=!0,_=0;let K=V.position;while(!E(c)&&c!==0)c=V.input.charCodeAt(++V.position);U0(V,K,V.position,!1)}return!0}function f$(V,S){let{tag:m,anchor:p}=V,k=[],a=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)V0(V,V.anchor,k);let A=V.input.charCodeAt(V.position);while(A!==0){if(V.firstTabInLine!==-1)V.position=V.firstTabInLine,l(V,"tab characters must not be used in indentation");if(A!==45)break;let _=V.input.charCodeAt(V.position+1);if(!R(_))break;if(a=!0,V.position++,R0(V,!0,-1)){if(V.lineIndent<=S){k.push(null),A=V.input.charCodeAt(V.position);continue}}let n=V.line;if(h$(V,S,Y,!1,!0),k.push(V.result),R0(V,!0,-1),A=V.input.charCodeAt(V.position),(V.line===n||V.lineIndent>S)&&A!==0)l(V,"bad indentation of a sequence entry");else if(V.lineIndent<S)break}if(a)return V.tag=m,V.anchor=p,V.kind="sequence",V.result=k,!0;return!1}function K$(V,S,m){let p,k,a,A,_=V.tag,n=V.anchor,d={},c=Object.create(null),K=null,M=null,D=null,j=!1,O=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)V0(V,V.anchor,d);let g=V.input.charCodeAt(V.position);while(g!==0){if(!j&&V.firstTabInLine!==-1)V.position=V.firstTabInLine,l(V,"tab characters must not be used in indentation");let i=V.input.charCodeAt(V.position+1),Q0=V.line;if((g===63||g===58)&&R(i)){if(g===63){if(j)e(V,d,c,K,M,null,k,a,A),K=M=D=null;O=!0,j=!0,p=!0}else if(j)j=!1,p=!0;else l(V,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");V.position+=1,g=i}else{if(k=V.line,a=V.lineStart,A=V.position,!h$(V,m,W,!1,!0))break;if(V.line===Q0){g=V.input.charCodeAt(V.position);while(P(g))g=V.input.charCodeAt(++V.position);if(g===58){if(g=V.input.charCodeAt(++V.position),!R(g))l(V,"a whitespace character is expected after the key-value separator within a block mapping");if(j)e(V,d,c,K,M,null,k,a,A),K=M=D=null;O=!0,j=!1,p=!1,K=V.tag,M=V.result}else if(O)l(V,"can not read an implicit mapping pair; a colon is missed");else return V.tag=_,V.anchor=n,!0}else if(O)l(V,"can not read a block mapping entry; a multiline key may not be an implicit key");else return V.tag=_,V.anchor=n,!0}if(V.line===Q0||V.lineIndent>S){if(j)k=V.line,a=V.lineStart,A=V.position;if(h$(V,S,z,!0,p))if(j)M=V.result;else D=V.result;if(!j)e(V,d,c,K,M,D,k,a,A),K=M=D=null;R0(V,!0,-1),g=V.input.charCodeAt(V.position)}if((V.line===Q0||V.lineIndent>S)&&g!==0)l(V,"bad indentation of a mapping entry");else if(V.lineIndent<S)break}if(j)e(V,d,c,K,M,null,k,a,A);if(O)V.tag=_,V.anchor=n,V.kind="mapping",V.result=d;return O}function I1(V){let S=!1,m=!1,p,k,a=V.input.charCodeAt(V.position);if(a!==33)return!1;if(V.tag!==null)l(V,"duplication of a tag property");if(a=V.input.charCodeAt(++V.position),a===60)S=!0,a=V.input.charCodeAt(++V.position);else if(a===33)m=!0,p="!!",a=V.input.charCodeAt(++V.position);else p="!";let A=V.position;if(S){do a=V.input.charCodeAt(++V.position);while(a!==0&&a!==62);if(V.position<V.length)k=V.input.slice(A,V.position),a=V.input.charCodeAt(++V.position);else l(V,"unexpected end of the stream within a verbatim tag")}else{while(a!==0&&!R(a)){if(a===33)if(!m){if(p=V.input.slice(A-1,V.position+1),!N.test(p))l(V,"named tag handle cannot contain such characters");m=!0,A=V.position+1}else l(V,"tag suffix cannot contain exclamation marks");a=V.input.charCodeAt(++V.position)}if(k=V.input.slice(A,V.position),w.test(k))l(V,"tag suffix cannot contain flow indicator characters")}if(k&&!I.test(k))l(V,"tag name cannot contain such characters: "+k);try{k=decodeURIComponent(k)}catch(_){l(V,"tag name is malformed: "+k)}if(S)V.tag=k;else if(J.call(V.tagMap,p))V.tag=V.tagMap[p]+k;else if(p==="!")V.tag="!"+k;else if(p==="!!")V.tag="tag:yaml.org,2002:"+k;else l(V,'undeclared tag handle "'+p+'"');return!0}function Y6(V){let S=V.input.charCodeAt(V.position);if(S!==38)return!1;if(V.anchor!==null)l(V,"duplication of an anchor property");S=V.input.charCodeAt(++V.position);let m=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===m)l(V,"name of an anchor node must contain at least one character");return V.anchor=V.input.slice(m,V.position),!0}function h1(V){let S=V.input.charCodeAt(V.position);if(S!==42)return!1;S=V.input.charCodeAt(++V.position);let m=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===m)l(V,"name of an alias node must contain at least one character");let p=V.input.slice(m,V.position);if(!J.call(V.anchorMap,p))l(V,'unidentified alias "'+p+'"');return V.result=V.anchorMap[p],R0(V,!0,-1),!0}function Y9(V,S,m,p){let k=J0(V);if(o(V),$0(V,S),V.tag=null,V.anchor=null,V.kind=null,V.result=null,K$(V,m,p)&&V.kind==="mapping")return f(V),!0;return Z0(V),$0(V,k),!1}function h$(V,S,m,p,k){let a,A,_=1,n=!1,d=!1,c=null,K,M,D;if(V.depth>=V.maxDepth)l(V,"nesting exceeded maxDepth ("+V.maxDepth+")");if(V.depth+=1,V.listener!==null)V.listener("open",V);V.tag=null,V.anchor=null,V.kind=null,V.result=null;let j=a=A=z===m||Y===m;if(p){if(R0(V,!0,-1)){if(n=!0,V.lineIndent>S)_=1;else if(V.lineIndent===S)_=0;else if(V.lineIndent<S)_=-1}}if(_===1)while(!0){let O=V.input.charCodeAt(V.position),g=J0(V);if(n&&(O===33&&V.tag!==null||O===38&&V.anchor!==null))break;if(!I1(V)&&!Y6(V))break;if(c===null)c=g;if(R0(V,!0,-1)){if(n=!0,A=j,V.lineIndent>S)_=1;else if(V.lineIndent===S)_=0;else if(V.lineIndent<S)_=-1}else A=!1}if(A)A=n||k;if(_===1||z===m){if(G===m||W===m)M=S;else M=S+1;if(D=V.position-V.lineStart,_===1)if(A&&(f$(V,D)||K$(V,D,M))||M1(V,M))d=!0;else{let O=V.input.charCodeAt(V.position);if(c!==null&&j&&!A&&O!==124&&O!==62&&Y9(V,c,c.position-c.lineStart,M))d=!0;else if(a&&A1(V,M)||O$(V,M)||q$(V,M))d=!0;else if(h1(V)){if(d=!0,V.tag!==null||V.anchor!==null)l(V,"alias node should not have any properties")}else if(i0(V,M,G===m)){if(d=!0,V.tag===null)V.tag="?"}if(V.anchor!==null)V0(V,V.anchor,V.result)}else if(_===0)d=A&&f$(V,D)}if(V.tag===null){if(V.anchor!==null)V0(V,V.anchor,V.result)}else if(V.tag==="?"){if(V.result!==null&&V.kind!=="scalar")l(V,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+V.kind+'"');for(let O=0,g=V.implicitTypes.length;O<g;O+=1)if(K=V.implicitTypes[O],K.resolve(V.result)){if(V.result=K.construct(V.result),V.tag=K.tag,V.anchor!==null)V0(V,V.anchor,V.result);break}}else if(V.tag!=="!"){if(J.call(V.typeMap[V.kind||"fallback"],V.tag))K=V.typeMap[V.kind||"fallback"][V.tag];else{K=null;let O=V.typeMap.multi[V.kind||"fallback"];for(let g=0,i=O.length;g<i;g+=1)if(V.tag.slice(0,O[g].tag.length)===O[g].tag){K=O[g];break}}if(!K)l(V,"unknown tag !<"+V.tag+">");if(V.result!==null&&K.kind!==V.kind)l(V,"unacceptable node kind for !<"+V.tag+'> tag; it should be "'+K.kind+'", not "'+V.kind+'"');if(!K.resolve(V.result,V.tag))l(V,"cannot resolve a node with !<"+V.tag+"> explicit tag");else if(V.result=K.construct(V.result,V.tag),V.anchor!==null)V0(V,V.anchor,V.result)}if(V.listener!==null)V.listener("close",V);return V.depth-=1,V.tag!==null||V.anchor!==null||d}function z9(V){let S=V.position,m=!1,p;V.version=null,V.checkLineBreaks=V.legacy,V.tagMap=Object.create(null),V.anchorMap=Object.create(null);while((p=V.input.charCodeAt(V.position))!==0){if(R0(V,!0,-1),p=V.input.charCodeAt(V.position),V.lineIndent>0||p!==37)break;m=!0,p=V.input.charCodeAt(++V.position);let k=V.position;while(p!==0&&!R(p))p=V.input.charCodeAt(++V.position);let a=V.input.slice(k,V.position),A=[];if(a.length<1)l(V,"directive name must not be less than one character in length");while(p!==0){while(P(p))p=V.input.charCodeAt(++V.position);if(p===35){do p=V.input.charCodeAt(++V.position);while(p!==0&&!E(p));break}if(E(p))break;k=V.position;while(p!==0&&!R(p))p=V.input.charCodeAt(++V.position);A.push(V.input.slice(k,V.position))}if(p!==0)d0(V);if(J.call(F0,a))F0[a](V,a,A);else K0(V,'unknown document directive "'+a+'"')}if(R0(V,!0,-1),V.lineIndent===0&&V.input.charCodeAt(V.position)===45&&V.input.charCodeAt(V.position+1)===45&&V.input.charCodeAt(V.position+2)===45)V.position+=3,R0(V,!0,-1);else if(m)l(V,"directives end mark is expected");if(h$(V,V.lineIndent-1,z,!1,!0),R0(V,!0,-1),V.checkLineBreaks&&L.test(V.input.slice(S,V.position)))K0(V,"non-ASCII line breaks are interpreted as content");if(V.documents.push(V.result),V.position===V.lineStart&&p0(V)){if(V.input.charCodeAt(V.position)===46)V.position+=3,R0(V,!0,-1);return}if(V.position<V.length-1)l(V,"end of the stream or a document separator is expected")}function z6(V,S){if(V=String(V),S=S||{},V.length!==0){if(V.charCodeAt(V.length-1)!==10&&V.charCodeAt(V.length-1)!==13)V+=`
40
+ `;if(V.charCodeAt(0)===65279)V=V.slice(1)}let m=new G0(V,S),p=V.indexOf("\x00");if(p!==-1)m.position=p,l(m,"null byte is not allowed in input");m.input+="\x00";while(m.input.charCodeAt(m.position)===32)m.lineIndent+=1,m.position+=1;while(m.position<m.length-1)z9(m);return m.documents}function q6(V,S,m){if(S!==null&&typeof S==="object"&&typeof m>"u")m=S,S=null;let p=z6(V,m);if(typeof S!=="function")return p;for(let k=0,a=p.length;k<a;k+=1)S(p[k])}function K6(V,S){let m=z6(V,S);if(m.length===0)return;else if(m.length===1)return m[0];throw new Z("expected a single document in the stream, but found more")}return p8.loadAll=q6,p8.load=K6,p8}function s2(){if(tG)return R7;tG=1;let $=N9(),Z=D9(),X=P7(),Q=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=65279,W=9,Y=10,z=13,q=32,H=33,B=34,F=35,L=37,w=38,N=39,I=42,T=44,E=45,P=58,R=61,C=62,y=63,v=64,h=91,X0=93,r=96,u=123,t=124,Y0=125,G0={};G0[0]="\\0",G0[7]="\\a",G0[8]="\\b",G0[9]="\\t",G0[10]="\\n",G0[11]="\\v",G0[12]="\\f",G0[13]="\\r",G0[27]="\\e",G0[34]="\\\"",G0[92]="\\\\",G0[133]="\\N",G0[160]="\\_",G0[8232]="\\L",G0[8233]="\\P";let A0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],l=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function K0(A,_){if(_===null)return{};let n={},d=Object.keys(_);for(let c=0,K=d.length;c<K;c+=1){let M=d[c],D=String(_[M]);if(M.slice(0,2)==="!!")M="tag:yaml.org,2002:"+M.slice(2);let j=A.compiledTypeMap.fallback[M];if(j&&J.call(j.styleAliases,D))D=j.styleAliases[D];n[M]=D}return n}function V0(A){let _,n,d=A.toString(16).toUpperCase();if(A<=255)_="x",n=2;else if(A<=65535)_="u",n=4;else if(A<=4294967295)_="U",n=8;else throw new Z("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+_+$.repeat("0",n-d.length)+d}let o=1,f=2;function Z0(A){this.schema=A.schema||X,this.indent=Math.max(1,A.indent||2),this.noArrayIndent=A.noArrayIndent||!1,this.skipInvalid=A.skipInvalid||!1,this.flowLevel=$.isNothing(A.flowLevel)?-1:A.flowLevel,this.styleMap=K0(this.schema,A.styles||null),this.sortKeys=A.sortKeys||!1,this.lineWidth=A.lineWidth||80,this.noRefs=A.noRefs||!1,this.noCompatMode=A.noCompatMode||!1,this.condenseFlow=A.condenseFlow||!1,this.quotingType=A.quotingType==='"'?f:o,this.forceQuotes=A.forceQuotes||!1,this.replacer=typeof A.replacer==="function"?A.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function J0(A,_){let n=$.repeat(" ",_),d=0,c="",K=A.length;while(d<K){let M,D=A.indexOf(`
41
+ `,d);if(D===-1)M=A.slice(d),d=K;else M=A.slice(d,D+1),d=D+1;if(M.length&&M!==`
42
+ `)c+=n;c+=M}return c}function $0(A,_){return`
43
+ `+$.repeat(" ",A.indent*_)}function F0(A,_){for(let n=0,d=A.implicitTypes.length;n<d;n+=1)if(A.implicitTypes[n].resolve(_))return!0;return!1}function U0(A){return A===q||A===W}function D0(A){return A>=32&&A<=126||A>=161&&A<=55295&&A!==8232&&A!==8233||A>=57344&&A<=65533&&A!==G||A>=65536&&A<=1114111}function e(A){return D0(A)&&A!==G&&A!==z&&A!==Y}function d0(A,_,n){let d=e(A),c=d&&!U0(A);return(n?d:d&&A!==T&&A!==h&&A!==X0&&A!==u&&A!==Y0)&&A!==F&&!(_===P&&!c)||e(_)&&!U0(_)&&A===F||_===P&&c}function R0(A){return D0(A)&&A!==G&&!U0(A)&&A!==E&&A!==y&&A!==P&&A!==T&&A!==h&&A!==X0&&A!==u&&A!==Y0&&A!==F&&A!==w&&A!==I&&A!==H&&A!==t&&A!==R&&A!==C&&A!==N&&A!==B&&A!==L&&A!==v&&A!==r}function p0(A){return!U0(A)&&A!==P}function v0(A,_){let n=A.charCodeAt(_),d;if(n>=55296&&n<=56319&&_+1<A.length){if(d=A.charCodeAt(_+1),d>=56320&&d<=57343)return(n-55296)*1024+d-56320+65536}return n}function i0(A){return/^\n* /.test(A)}let O$=1,q$=2,M1=3,A1=4,f$=5;function K$(A,_,n,d,c,K,M,D){let j,O=0,g=null,i=!1,Q0=!1,L0=d!==-1,M0=-1,j0=R0(v0(A,0))&&p0(v0(A,A.length-1));if(_||M)for(j=0;j<A.length;O>=65536?j+=2:j++){if(O=v0(A,j),!D0(O))return f$;j0=j0&&d0(O,g,D),g=O}else{for(j=0;j<A.length;O>=65536?j+=2:j++){if(O=v0(A,j),O===Y){if(i=!0,L0)Q0=Q0||j-M0-1>d&&A[M0+1]!==" ",M0=j}else if(!D0(O))return f$;j0=j0&&d0(O,g,D),g=O}Q0=Q0||L0&&(j-M0-1>d&&A[M0+1]!==" ")}if(!i&&!Q0){if(j0&&!M&&!c(A))return O$;return K===f?f$:q$}if(n>9&&i0(A))return f$;if(!M)return Q0?A1:M1;return K===f?f$:q$}function I1(A,_,n,d,c){A.dump=function(){if(_.length===0)return A.quotingType===f?'""':"''";if(!A.noCompatMode){if(A0.indexOf(_)!==-1||l.test(_))return A.quotingType===f?'"'+_+'"':"'"+_+"'"}let K=A.indent*Math.max(1,n),M=A.lineWidth===-1?-1:Math.max(Math.min(A.lineWidth,40),A.lineWidth-K),D=d||A.flowLevel>-1&&n>=A.flowLevel;function j(O){return F0(A,O)}switch(K$(_,D,A.indent,M,j,A.quotingType,A.forceQuotes&&!d,c)){case O$:return _;case q$:return"'"+_.replace(/'/g,"''")+"'";case M1:return"|"+Y6(_,A.indent)+h1(J0(_,K));case A1:return">"+Y6(_,A.indent)+h1(J0(Y9(_,M),K));case f$:return'"'+z9(_)+'"';default:throw new Z("impossible error: invalid scalar style")}}()}function Y6(A,_){let n=i0(A)?String(_):"",d=A[A.length-1]===`
44
+ `,K=d&&(A[A.length-2]===`
45
+ `||A===`
46
+ `)?"+":d?"":"-";return n+K+`
47
+ `}function h1(A){return A[A.length-1]===`
48
+ `?A.slice(0,-1):A}function Y9(A,_){let n=/(\n+)([^\n]*)/g,d=function(){let D=A.indexOf(`
49
+ `);return D=D!==-1?D:A.length,n.lastIndex=D,h$(A.slice(0,D),_)}(),c=A[0]===`
50
+ `||A[0]===" ",K,M;while(M=n.exec(A)){let D=M[1],j=M[2];K=j[0]===" ",d+=D+(!c&&!K&&j!==""?`
51
+ `:"")+h$(j,_),c=K}return d}function h$(A,_){if(A===""||A[0]===" ")return A;let n=/ [^ ]/g,d,c=0,K,M=0,D=0,j="";while(d=n.exec(A)){if(D=d.index,D-c>_)K=M>c?M:D,j+=`
52
+ `+A.slice(c,K),c=K+1;M=D}if(j+=`
53
+ `,A.length-c>_&&M>c)j+=A.slice(c,M)+`
54
+ `+A.slice(M+1);else j+=A.slice(c);return j.slice(1)}function z9(A){let _="",n=0;for(let d=0;d<A.length;n>=65536?d+=2:d++){n=v0(A,d);let c=G0[n];if(!c&&D0(n)){if(_+=A[d],n>=65536)_+=A[d+1]}else _+=c||V0(n)}return _}function z6(A,_,n){let d="",c=A.tag;for(let K=0,M=n.length;K<M;K+=1){let D=n[K];if(A.replacer)D=A.replacer.call(n,String(K),D);if(m(A,_,D,!1,!1)||typeof D>"u"&&m(A,_,null,!1,!1)){if(d!=="")d+=","+(!A.condenseFlow?" ":"");d+=A.dump}}A.tag=c,A.dump="["+d+"]"}function q6(A,_,n,d){let c="",K=A.tag;for(let M=0,D=n.length;M<D;M+=1){let j=n[M];if(A.replacer)j=A.replacer.call(n,String(M),j);if(m(A,_+1,j,!0,!0,!1,!0)||typeof j>"u"&&m(A,_+1,null,!0,!0,!1,!0)){if(!d||c!=="")c+=$0(A,_);if(A.dump&&Y===A.dump.charCodeAt(0))c+="-";else c+="- ";c+=A.dump}}A.tag=K,A.dump=c||"[]"}function K6(A,_,n){let d="",c=A.tag,K=Object.keys(n);for(let M=0,D=K.length;M<D;M+=1){let j="";if(d!=="")j+=", ";if(A.condenseFlow)j+='"';let O=K[M],g=n[O];if(A.replacer)g=A.replacer.call(n,O,g);if(!m(A,_,O,!1,!1))continue;if(A.dump.length>1024)j+="? ";if(j+=A.dump+(A.condenseFlow?'"':"")+":"+(A.condenseFlow?"":" "),!m(A,_,g,!1,!1))continue;j+=A.dump,d+=j}A.tag=c,A.dump="{"+d+"}"}function V(A,_,n,d){let c="",K=A.tag,M=Object.keys(n);if(A.sortKeys===!0)M.sort();else if(typeof A.sortKeys==="function")M.sort(A.sortKeys);else if(A.sortKeys)throw new Z("sortKeys must be a boolean or a function");for(let D=0,j=M.length;D<j;D+=1){let O="";if(!d||c!=="")O+=$0(A,_);let g=M[D],i=n[g];if(A.replacer)i=A.replacer.call(n,g,i);if(!m(A,_+1,g,!0,!0,!0))continue;let Q0=A.tag!==null&&A.tag!=="?"||A.dump&&A.dump.length>1024;if(Q0)if(A.dump&&Y===A.dump.charCodeAt(0))O+="?";else O+="? ";if(O+=A.dump,Q0)O+=$0(A,_);if(!m(A,_+1,i,!0,Q0))continue;if(A.dump&&Y===A.dump.charCodeAt(0))O+=":";else O+=": ";O+=A.dump,c+=O}A.tag=K,A.dump=c||"{}"}function S(A,_,n){let d=n?A.explicitTypes:A.implicitTypes;for(let c=0,K=d.length;c<K;c+=1){let M=d[c];if((M.instanceOf||M.predicate)&&(!M.instanceOf||typeof _==="object"&&_ instanceof M.instanceOf)&&(!M.predicate||M.predicate(_))){if(n)if(M.multi&&M.representName)A.tag=M.representName(_);else A.tag=M.tag;else A.tag="?";if(M.represent){let D=A.styleMap[M.tag]||M.defaultStyle,j;if(Q.call(M.represent)==="[object Function]")j=M.represent(_,D);else if(J.call(M.represent,D))j=M.represent[D](_,D);else throw new Z("!<"+M.tag+'> tag resolver accepts not "'+D+'" style');A.dump=j}return!0}}return!1}function m(A,_,n,d,c,K,M){if(A.tag=null,A.dump=n,!S(A,n,!1))S(A,n,!0);let D=Q.call(A.dump),j=d;if(d)d=A.flowLevel<0||A.flowLevel>_;let O=D==="[object Object]"||D==="[object Array]",g,i;if(O)g=A.duplicates.indexOf(n),i=g!==-1;if(A.tag!==null&&A.tag!=="?"||i||A.indent!==2&&_>0)c=!1;if(i&&A.usedDuplicates[g])A.dump="*ref_"+g;else{if(O&&i&&!A.usedDuplicates[g])A.usedDuplicates[g]=!0;if(D==="[object Object]"){if(d&&Object.keys(A.dump).length!==0){if(V(A,_,A.dump,c),i)A.dump="&ref_"+g+A.dump}else if(K6(A,_,A.dump),i)A.dump="&ref_"+g+" "+A.dump}else if(D==="[object Array]"){if(d&&A.dump.length!==0){if(A.noArrayIndent&&!M&&_>0)q6(A,_-1,A.dump,c);else q6(A,_,A.dump,c);if(i)A.dump="&ref_"+g+A.dump}else if(z6(A,_,A.dump),i)A.dump="&ref_"+g+" "+A.dump}else if(D==="[object String]"){if(A.tag!=="?")I1(A,A.dump,_,K,j)}else if(D==="[object Undefined]")return!1;else{if(A.skipInvalid)return!1;throw new Z("unacceptable kind of an object to dump "+D)}if(A.tag!==null&&A.tag!=="?"){let Q0=encodeURI(A.tag[0]==="!"?A.tag.slice(1):A.tag).replace(/!/g,"%21");if(A.tag[0]==="!")Q0="!"+Q0;else if(Q0.slice(0,18)==="tag:yaml.org,2002:")Q0="!!"+Q0.slice(18);else Q0="!<"+Q0+">";A.dump=Q0+" "+A.dump}}return!0}function p(A,_){let n=[],d=[];k(A,n,d);let c=d.length;for(let K=0;K<c;K+=1)_.duplicates.push(n[d[K]]);_.usedDuplicates=Array(c)}function k(A,_,n){if(A!==null&&typeof A==="object"){let d=_.indexOf(A);if(d!==-1){if(n.indexOf(d)===-1)n.push(d)}else if(_.push(A),Array.isArray(A))for(let c=0,K=A.length;c<K;c+=1)k(A[c],_,n);else{let c=Object.keys(A);for(let K=0,M=c.length;K<M;K+=1)k(A[c[K]],_,n)}}}function a(A,_){_=_||{};let n=new Z0(_);if(!n.noRefs)p(A,n);let d=A;if(n.replacer)d=n.replacer.call({"":d},"",d);if(m(n,0,d,!0,!0))return n.dump+`
55
+ `;return""}return R7.dump=a,R7}function t2(){if(eG)return H$;eG=1;let $=o2(),Z=s2();function X(Q,J){return function(){throw Error("Function yaml."+Q+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}return H$.Type=I$(),H$.Schema=$W(),H$.FAILSAFE_SCHEMA=JW(),H$.JSON_SCHEMA=qW(),H$.CORE_SCHEMA=KW(),H$.DEFAULT_SCHEMA=P7(),H$.load=$.load,H$.loadAll=$.loadAll,H$.dump=Z.dump,H$.YAMLException=D9(),H$.types={binary:VW(),float:zW(),map:QW(),null:GW(),pairs:FW(),set:LW(),timestamp:UW(),bool:WW(),int:YW(),merge:HW(),omap:BW(),seq:XW(),str:ZW()},H$.safeLoad=X("safeLoad","load"),H$.safeLoadAll=X("safeLoadAll","loadAll"),H$.safeDump=X("safeDump","dump"),H$}var H$,p8,M6,CG,W7,SG,Y7,_G,z7,bG,q7,xG,K7,kG,U7,yG,H7,vG,V7,gG,B7,fG,F7,hG,L7,uG,M7,mG,A7,dG,I7,lG,N7,cG,D7,pG,w7,iG,T7,nG,j7,rG,O7,aG,E7,oG,sG,R7,tG,eG,e2,i8,Uu,Hu,Vu,MW,Bu,Fu,Lu,Mu,Au,Iu,Nu,Du,wu,Tu;var C7=s(()=>{H$={},p8={},M6={};R7={};e2=t2(),i8=r2(e2),{Type:Uu,Schema:Hu,FAILSAFE_SCHEMA:Vu,JSON_SCHEMA:MW,CORE_SCHEMA:Bu,DEFAULT_SCHEMA:Fu,load:Lu,loadAll:Mu,dump:Au,YAMLException:Iu,types:Nu,safeLoad:Du,safeLoadAll:wu,safeDump:Tu}=i8});var AW;var IW=s(()=>{t$();C7();C7();AW={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")try{return i8.load(Z,{schema:MW})}catch{try{return i8.load(Z)}catch(X){throw new s$(X?.message||"Parser Error",$.url)}}else return Z}}});var $I,NW;var DW=s(()=>{t$();$I=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,NW={order:300,allowEmpty:!0,encoding:"utf8",canParse($){return(typeof $.data==="string"||Buffer.isBuffer($.data))&&$I.test($.url)},parse($){if(typeof $.data==="string")return $.data;else if(Buffer.isBuffer($.data))return $.data.toString(this.encoding);else throw new s$("data is not text",$.url)}}});var ZI,wW;var TW=s(()=>{ZI=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,wW={order:400,allowEmpty:!0,canParse($){return Buffer.isBuffer($.data)&&ZI.test($.url)},parse($){if(Buffer.isBuffer($.data))return $.data;else return Buffer.from($.data)}}});var S7;var _7=s(()=>{P$();t$();S7={order:100,canRead($){return y8($.url)},async read($){let Z,X=await import("fs");try{Z=j4($.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${$.url}: ${J.message}`,new Y1(J,$.url)}if(Z.endsWith("/")||Z.endsWith("\\"))Z=Z.slice(0,-1);try{return await X.promises.readFile(Z)}catch(Q){let J=Q;throw J.message=`Error opening file ${Z}: ${J.message}`,new Y1(J,Z)}}}});async function jW($,Z,X){$=T4($);let Q=X||[];Q.push($.href);try{if(Z.safeUrlResolver&&k8($.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${$.href}`);let J=await XI($,Z);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(Z.redirects)&&Q.length>Z.redirects){let G=Error(`Error downloading ${Q[0]}.
54
56
  Too many redirects:
55
57
  ${Q.join(`
56
- `)}`);throw G.status=J.status,new Y6(G)}else{let G=y2(J,"location");if(!G){let Y=Error(`HTTP ${J.status} redirect with no location header`);throw Y.status=J.status,Y}let W=n0($.href,G);return qW(W,Z,Q)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${$.href}: ${G.message}`,new Y6(G,$.href)}}async function k2($,Z){let X,Q;if(Z.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),Z.timeout);let J=await fetch($,{method:"GET",headers:Z.headers||{},credentials:Z.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function y2($,Z){return $.headers.get(Z)}var I7;var N7=t(()=>{R$();s$();I7={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead($){return eJ($.url)&&(!this.safeUrlResolver||!T5($.url))},read($){let Z=M4($.url);if(typeof window<"u"&&!Z.protocol)Z.protocol=M4(location.href).protocol;return qW(Z,this)}}});function VW($,Z){if(UW(Z)){let X=Object.keys(Z).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=Z[J],W=$[J];if(UW(G))$[J]=VW(W||{},G);else if(G!==void 0)$[J]=G}}return $}function UW($){return $&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof RegExp)&&!($ instanceof Date)}var KW=()=>{return{parse:{json:{...HG},yaml:{...QW},text:{...GW},binary:{...YW}},resolve:{file:{...M7},http:{...I7},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},HW=($)=>{let Z=KW();if($)VW(Z,$);return Z};var D7=t(()=>{VG();JW();WW();zW();A7();N7()});function v2($){let Z,X,Q,J,G=Array.prototype.slice.call($);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(Z=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else Z="",X=G[0],Q=G[1];try{Q=HW(Q)}catch(W){console.error(`JSON Schema Ref Parser: Error normalizing options: ${W}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:Z,schema:X,options:Q,callback:J}}var F9;var BW=t(()=>{D7();F9=v2});function g2($,Z){if(!Z.resolve?.external)return Promise.resolve();try{let X=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=w7($.schema,$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,$.$refs,Z);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function w7($,Z,X,Q,J,G,W,Y){W||=new Set;let z=[];if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!W.has($)){W.add($);let q=X;if(l0.isExternal$Ref($))z.push(f2($,Z,q,Q,J,G));let H=Object.keys($);for(let B of H){let L=P$.join(Z,B),M=$[B],A=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?M$(q,M):q;z=z.concat(w7(M,L,A,Q,J,G,W,Y))}}return z}async function f2($,Z,X,Q,J,G){let Y=G.dereference?.externalReferenceResolution==="root"?h1():Q?X:Z,z=n0(Y,$.$ref),q=r0(z),H=J._get$Ref(q);if(H)return Promise.resolve(H.value);try{let B=$.$ref,L={url:z,baseUrl:Y};if(typeof B==="string")L.reference=B;let M=await b5(L,J,G),A=J._get$Ref(q),w=w7(M,q+"#",q,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(w)}catch(B){if(!G?.continueOnError||!O6(B))throw B;if(J._$refs[q])B.source=decodeURI(r0(Z)),B.path=O5(T6(Z));return[]}}var FW;var LW=t(()=>{D4();U9();iZ();R$();s$();u1();FW=g2});function h2($,Z){let X=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=[];T7($,"schema",$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,"#",0,Q,$.$refs,Z);let J=$.schema&&typeof $.schema==="object"&&"$id"in $.schema?$.schema.$id:void 0;if(u2(Q,Z,J),(Z.bundle||{}).optimizeInternalRefs!==!1)l2(Q,$.schema)}function T7($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=q.bundle||{},L=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!L(G)){let M=Q;if(l0.isAllowed$Ref(H))MW($,Z,X,M,J,G,W,Y,z,q);else{let A=Object.keys(H).sort((w,D)=>{if(w==="definitions"||w==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return w.length-D.length});for(let w of A){let D=P$.join(X,w),j=P$.join(G,w),E=H[w],P=J&&E&&typeof E==="object"&&!ArrayBuffer.isView(E)?M$(M,E):M;if(l0.isAllowed$Ref(E))MW(H,w,D,P,J,j,W,Y,z,q);else T7(H,w,D,P,J,j,W,Y,z,q);if(E&&typeof E==="object"&&!Array.isArray(E)){if("$ref"in E)B?.onBundle?.(E.$ref,H[w],H,w)}}}}}function MW($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=n0(J?Q:X,H.$ref),L=z._resolve(B,G,q);if(L===null)return;let A=P$.parse(G).length,w=r0(L.path),D=T6(L.path),j=w!==z._root$Ref.path&&!z._aliases[w],E=Boolean(z._aliases[w])&&L.$ref.value!==z._root$Ref.value,P=l0.isExtended$Ref(H);W+=L.indirections;let R=m2(Y,$,Z);if(R)if(A<R.depth||W<R.indirections)d2(Y,R);else return;if(Y.push({$ref:H,parent:$,key:Z,pathFromRoot:G,depth:A,file:w,hash:D,value:L.value,circular:L.circular,extended:P,external:j,nestedResource:E,indirections:W}),!R||j)T7(L.value,null,L.path,L.$ref.path,L.$ref.dynamicIdScope,G,W+1,Y,z,q)}function u2($,Z,X){$.sort((W,Y)=>{if(W.file!==Y.file)return W.file<Y.file?-1:1;else if(W.hash!==Y.hash)return W.hash<Y.hash?-1:1;else if(W.circular!==Y.circular)return W.circular?-1:1;else if(W.extended!==Y.extended)return W.extended?1:-1;else if(W.indirections!==Y.indirections)return W.indirections-Y.indirections;else if(W.depth!==Y.depth)return W.depth-Y.depth;else{let z=Math.max(W.pathFromRoot.lastIndexOf("/definitions"),W.pathFromRoot.lastIndexOf("/$defs")),q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(z!==q)return q-z;else return W.pathFromRoot.length-Y.pathFromRoot.length}});let Q,J,G;for(let W of $){let Y=Z.bundle||{};if(!W.external){if(Y.optimizeInternalRefs!==!1&&!W.nestedResource)W.$ref.$ref=W.hash}else if(W.file===Q&&W.hash===J)if(X&&AW($,W))W.$ref.$ref=X+G;else W.$ref.$ref=G;else if(W.file===Q&&W.hash.indexOf(J+"/")===0){let z=P$.join(G,P$.parse(W.hash.replace(J,"#")));if(X&&AW($,W))W.$ref.$ref=X+z;else W.$ref.$ref=z}else if(Q=W.file,J=W.hash,G=W.pathFromRoot,W.$ref=W.parent[W.key]=l0.dereference(W.$ref,W.value,Z),W.circular)W.$ref.$ref=W.pathFromRoot}}function m2($,Z,X){for(let Q of $)if(Q&&Q.parent===Z&&Q.key===X)return Q;return}function d2($,Z){let X=$.indexOf(Z);$.splice(X,1)}function l2($,Z){for(let X of $){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=c2(Z,Q);if(J!==Q)X.$ref.$ref=J}}function c2($,Z){if(!Z.startsWith("#/"))return Z;let X=Z.slice(2).split("/"),Q=$,J=[];for(let W of X){if(Q===null||Q===void 0||typeof Q!=="object")return Z;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let q=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...q),Q=p2($,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return Z}let Y=W.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(Y):Y;Q=Q[z],J.push(W)}return"#/"+J.join("/")}function p2($,Z){if(!Z.startsWith("#/"))return;let X=Z.slice(2).split("/"),Q=$;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),W=Array.isArray(Q)?parseInt(G):G;Q=Q[W]}return Q}function AW($,Z){for(let X of $){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(Z.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var IW;var NW=t(()=>{D4();U9();R$();u1();IW=h2});function i2($,Z){let X=Date.now(),Q=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,J=j7($.schema,$.$refs._root$Ref.path,Q,$.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,$.$refs,Z,X,0);$.$refs.circular=J.circular,$.schema=J.value}function j7($,Z,X,Q,J,G,W,Y,z,q,H,B){let L,M={value:$,circular:!1};wW(H,q);let A=q.dereference||{},w=A.maxDepth??500;if(B>w)throw RangeError(`Maximum dereference depth (${w}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let D=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!W.has($)){if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!D(J)){G.add($),W.add($);let j=X;if(l0.isAllowed$Ref($,q))L=DW($,Z,j,Q,J,G,W,Y,z,q,H,B),M.circular=L.circular,M.value=L.value;else for(let E of Object.keys($)){wW(H,q);let P=P$.join(Z,E),R=P$.join(J,E);if(D(R))continue;let C=$[E],v=Q&&C&&typeof C==="object"&&!ArrayBuffer.isView(C)?M$(j,C):j,d;if(l0.isAllowed$Ref(C,q)){if(L=DW(C,P,v,Q,R,G,W,Y,z,q,H,B),d=L.circular,$[E]!==L.value){let f=new Map;if(A?.preservedProperties){if(typeof $[E]==="object"&&!Array.isArray($[E]))A?.preservedProperties.forEach(($0)=>{if($0 in $[E])f.set($0,$[E][$0])})}let a=L.value;if(A?.cloneReferences&&!d&&a&&typeof a==="object")a=structuredClone(a);if($[E]=a,A?.preservedProperties){if(f.size&&typeof $[E]==="object"&&!Array.isArray($[E]))f.forEach(($0,u)=>{$[E][u]=$0})}A?.onDereference?.(C.$ref,$[E],$,E)}}else if(!G.has(C)){if(L=j7(C,P,v,Q,R,G,W,Y,z,q,H,B+1),d=L.circular,$[E]!==L.value)$[E]=L.value}else d=v5(P,z,q);M.circular=M.circular||d}G.delete($)}}return M}function DW($,Z,X,Q,J,G,W,Y,z,q,H,B){let A=l0.isExternal$Ref($)&&q?.dereference?.externalReferenceResolution==="root"?h1():Q?X:Z,w=n0(A,$.$ref),D=Y.get(w);if(D){if(!D.circular){let v=Object.keys($);if(v.length>1){let d={};for(let f of v)if(f!=="$ref"&&!(f in D.value))d[f]=$[f];return{circular:D.circular,value:Object.assign({},D.value,d)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in $){if(D.value.$ref===$.$ref)return v5(Z,z,q),D}else return v5(Z,z,q),D}let j=z._resolve(w,Z,q);if(j===null)return{circular:!1,value:null};let E=j.circular,P=E||j.chainCircular||G.has(j.value);if(P)v5(Z,z,q);let R=l0.dereference($,j.value,q);if(!P){let v=j7(R,j.path,j.$ref.path,j.$ref.dynamicIdScope,J,G,W,Y,z,q,H,B+1);P=v.circular,R=v.value}if(P&&!E&&q.dereference?.circular==="ignore")R=$;if(E&&R!==$)R.$ref=J;let C={circular:P,value:R};if(Object.keys($).length===1)Y.set(w,C);return C}function wW($,Z){if(Z&&Z.timeoutMs){if(Date.now()-$>Z.timeoutMs)throw new uZ(Z.timeoutMs)}}function v5($,Z,X){if(Z.circular=!0,X?.dereference?.onCircular?.($),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${$}`);return!0}var TW;var jW=t(()=>{D4();U9();R$();u1();s$();TW=i2});function n2(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(Z){setTimeout(Z,0)}}var O7;var OW=t(()=>{O7=n2()});function c$($,Z){if($){Z.then(function(X){O7(function(){$(null,X)})},function(X){O7(function(){$(X)})});return}else return Z}var EW=t(()=>{OW()});class p6{schema=null;$refs=new H9;async parse(){let $=F9(arguments),Z;if(!$.path&&!$.schema){let Q=Error(`Expected a file path, URL, or object. Got ${$.path||$.schema}`);return c$($.callback,Promise.reject(Q))}this.schema=null,this.$refs=new H9;let X="http";if(j5($.path))$.path=QG($.path),X="file";else if(!$.path&&$.schema&&"$id"in $.schema&&$.schema.$id){let Q=M4($.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);$.path=`${Q.protocol}//${Q.hostname}:${J}`}if($.path=n0(h1(),$.path),$.schema&&typeof $.schema==="object"){let Q=this.$refs._add($.path);Q.value=$.schema,Q.pathType=X,Q.dynamicIdScope=C5(Q.value),S5(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),Z=Promise.resolve($.schema)}else Z=b5($.path,this.$refs,$.options);try{let Q=await Z;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,c$($.callback,Promise.resolve(this.schema));else if($.options.continueOnError)return this.schema=null,c$($.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!$.options.continueOnError||!O6(Q))return c$($.callback,Promise.reject(Q));if(this.$refs._$refs[r0($.path)])this.$refs._$refs[r0($.path)].addError(Q);return c$($.callback,Promise.resolve(null))}}static parse(){let $=new p6;return $.parse.apply($,arguments)}async resolve(){let $=F9(arguments);try{return await this.parse($.path,$.schema,$.options),await FW(this,$.options),E7(this),c$($.callback,Promise.resolve(this.$refs))}catch(Z){return c$($.callback,Promise.reject(Z))}}static resolve(){let $=new p6;return $.resolve.apply($,arguments)}static bundle(){let $=new p6;return $.bundle.apply($,arguments)}async bundle(){let $=F9(arguments);try{return await this.resolve($.path,$.schema,$.options),IW(this,$.options),E7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}static dereference(){let $=new p6;return $.dereference.apply($,arguments)}async dereference(){let $=F9(arguments);try{return await this.resolve($.path,$.schema,$.options),TW(this,$.options),E7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}}function E7($){if(I4.getParserErrors($).length>0)throw new I4($)}var gu,fu,hu,RW;var PW=t(()=>{UG();iZ();BW();LW();NW();jW();R$();A7();N7();s$();EW();u1();D7();R$();gu=p6.parse,fu=p6.resolve,hu=p6.bundle,RW=p6.dereference});async function L9($,Z={}){let{baseUrl:X="/_jx/server"}=Z,Q=await RW($),J=w5(Q);if(J.length===0)return null;let G=J.map(({exportName:Y,src:z})=>`import { ${Y} } from '${z}'`).join(`
57
- `),W=J.map(({exportName:Y})=>CW(Y,X)).join(`
58
+ `)}`);throw G.status=J.status,new Y1(G)}else{let G=QI(J,"location");if(!G){let Y=Error(`HTTP ${J.status} redirect with no location header`);throw Y.status=J.status,Y}let W=a0($.href,G);return jW(W,Z,Q)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${$.href}: ${G.message}`,new Y1(G,$.href)}}async function XI($,Z){let X,Q;if(Z.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),Z.timeout);let J=await fetch($,{method:"GET",headers:Z.headers||{},credentials:Z.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function QI($,Z){return $.headers.get(Z)}var b7;var x7=s(()=>{P$();t$();b7={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead($){return BG($.url)&&(!this.safeUrlResolver||!k8($.url))},read($){let Z=T4($.url);if(typeof window<"u"&&!Z.protocol)Z.protocol=T4(location.href).protocol;return jW(Z,this)}}});function PW($,Z){if(OW(Z)){let X=Object.keys(Z).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=Z[J],W=$[J];if(OW(G))$[J]=PW(W||{},G);else if(G!==void 0)$[J]=G}}return $}function OW($){return $&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof RegExp)&&!($ instanceof Date)}var EW=()=>{return{parse:{json:{...RG},yaml:{...AW},text:{...NW},binary:{...wW}},resolve:{file:{...S7},http:{...b7},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},RW=($)=>{let Z=EW();if($)PW(Z,$);return Z};var k7=s(()=>{PG();IW();DW();TW();_7();x7()});function JI($){let Z,X,Q,J,G=Array.prototype.slice.call($);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(Z=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else Z="",X=G[0],Q=G[1];try{Q=RW(Q)}catch(W){console.error(`JSON Schema Ref Parser: Error normalizing options: ${W}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:Z,schema:X,options:Q,callback:J}}var w9;var CW=s(()=>{k7();w9=JI});function GI($,Z){if(!Z.resolve?.external)return Promise.resolve();try{let X=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=y7($.schema,$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,$.$refs,Z);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function y7($,Z,X,Q,J,G,W,Y){W||=new Set;let z=[];if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!W.has($)){W.add($);let q=X;if(c0.isExternal$Ref($))z.push(WI($,Z,q,Q,J,G));let H=Object.keys($);for(let B of H){let F=C$.join(Z,B),L=$[B],w=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?A$(q,L):q;z=z.concat(y7(L,F,w,Q,J,G,W,Y))}}return z}async function WI($,Z,X,Q,J,G){let Y=G.dereference?.externalReferenceResolution==="root"?c6():Q?X:Z,z=a0(Y,$.$ref),q=o0(z),H=J._get$Ref(q);if(H)return Promise.resolve(H.value);try{let B=$.$ref,F={url:z,baseUrl:Y};if(typeof B==="string")F.reference=B;let L=await c8(F,J,G),w=J._get$Ref(q),N=y7(L,q+"#",q,w?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(N)}catch(B){if(!G?.continueOnError||!E1(B))throw B;if(J._$refs[q])B.source=decodeURI(o0(Z)),B.path=v8(j1(Z));return[]}}var SW;var _W=s(()=>{R4();M9();G7();P$();t$();p6();SW=GI});function YI($,Z){let X=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=[];v7($,"schema",$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,"#",0,Q,$.$refs,Z);let J=$.schema&&typeof $.schema==="object"&&"$id"in $.schema?$.schema.$id:void 0;if(zI(Q,Z,J),(Z.bundle||{}).optimizeInternalRefs!==!1)UI(Q,$.schema)}function v7($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=q.bundle||{},F=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!F(G)){let L=Q;if(c0.isAllowed$Ref(H))bW($,Z,X,L,J,G,W,Y,z,q);else{let w=Object.keys(H).sort((N,I)=>{if(N==="definitions"||N==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return N.length-I.length});for(let N of w){let I=C$.join(X,N),T=C$.join(G,N),E=H[N],P=J&&E&&typeof E==="object"&&!ArrayBuffer.isView(E)?A$(L,E):L;if(c0.isAllowed$Ref(E))bW(H,N,I,P,J,T,W,Y,z,q);else v7(H,N,I,P,J,T,W,Y,z,q);if(E&&typeof E==="object"&&!Array.isArray(E)){if("$ref"in E)B?.onBundle?.(E.$ref,H[N],H,N)}}}}}function bW($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=a0(J?Q:X,H.$ref),F=z._resolve(B,G,q);if(F===null)return;let w=C$.parse(G).length,N=o0(F.path),I=j1(F.path),T=N!==z._root$Ref.path&&!z._aliases[N],E=Boolean(z._aliases[N])&&F.$ref.value!==z._root$Ref.value,P=c0.isExtended$Ref(H);W+=F.indirections;let R=qI(Y,$,Z);if(R)if(w<R.depth||W<R.indirections)KI(Y,R);else return;if(Y.push({$ref:H,parent:$,key:Z,pathFromRoot:G,depth:w,file:N,hash:I,value:F.value,circular:F.circular,extended:P,external:T,nestedResource:E,indirections:W}),!R||T)v7(F.value,null,F.path,F.$ref.path,F.$ref.dynamicIdScope,G,W+1,Y,z,q)}function zI($,Z,X){$.sort((W,Y)=>{if(W.file!==Y.file)return W.file<Y.file?-1:1;else if(W.hash!==Y.hash)return W.hash<Y.hash?-1:1;else if(W.circular!==Y.circular)return W.circular?-1:1;else if(W.extended!==Y.extended)return W.extended?1:-1;else if(W.indirections!==Y.indirections)return W.indirections-Y.indirections;else if(W.depth!==Y.depth)return W.depth-Y.depth;else{let z=Math.max(W.pathFromRoot.lastIndexOf("/definitions"),W.pathFromRoot.lastIndexOf("/$defs")),q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(z!==q)return q-z;else return W.pathFromRoot.length-Y.pathFromRoot.length}});let Q,J,G;for(let W of $){let Y=Z.bundle||{};if(!W.external){if(Y.optimizeInternalRefs!==!1&&!W.nestedResource)W.$ref.$ref=W.hash}else if(W.file===Q&&W.hash===J)if(X&&xW($,W))W.$ref.$ref=X+G;else W.$ref.$ref=G;else if(W.file===Q&&W.hash.indexOf(J+"/")===0){let z=C$.join(G,C$.parse(W.hash.replace(J,"#")));if(X&&xW($,W))W.$ref.$ref=X+z;else W.$ref.$ref=z}else if(Q=W.file,J=W.hash,G=W.pathFromRoot,W.$ref=W.parent[W.key]=c0.dereference(W.$ref,W.value,Z),W.circular)W.$ref.$ref=W.pathFromRoot}}function qI($,Z,X){for(let Q of $)if(Q&&Q.parent===Z&&Q.key===X)return Q;return}function KI($,Z){let X=$.indexOf(Z);$.splice(X,1)}function UI($,Z){for(let X of $){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=HI(Z,Q);if(J!==Q)X.$ref.$ref=J}}function HI($,Z){if(!Z.startsWith("#/"))return Z;let X=Z.slice(2).split("/"),Q=$,J=[];for(let W of X){if(Q===null||Q===void 0||typeof Q!=="object")return Z;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let q=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...q),Q=VI($,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return Z}let Y=W.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(Y):Y;Q=Q[z],J.push(W)}return"#/"+J.join("/")}function VI($,Z){if(!Z.startsWith("#/"))return;let X=Z.slice(2).split("/"),Q=$;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),W=Array.isArray(Q)?parseInt(G):G;Q=Q[W]}return Q}function xW($,Z){for(let X of $){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(Z.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var kW;var yW=s(()=>{R4();M9();P$();p6();kW=YI});function BI($,Z){let X=Date.now(),Q=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,J=g7($.schema,$.$refs._root$Ref.path,Q,$.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,$.$refs,Z,X,0);$.$refs.circular=J.circular,$.schema=J.value}function g7($,Z,X,Q,J,G,W,Y,z,q,H,B){let F,L={value:$,circular:!1};gW(H,q);let w=q.dereference||{},N=w.maxDepth??500;if(B>N)throw RangeError(`Maximum dereference depth (${N}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=w.excludedPathMatcher||(()=>!1);if(w?.circular==="ignore"||!W.has($)){if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!I(J)){G.add($),W.add($);let T=X;if(c0.isAllowed$Ref($,q))F=vW($,Z,T,Q,J,G,W,Y,z,q,H,B),L.circular=F.circular,L.value=F.value;else for(let E of Object.keys($)){gW(H,q);let P=C$.join(Z,E),R=C$.join(J,E);if(I(R))continue;let C=$[E],y=Q&&C&&typeof C==="object"&&!ArrayBuffer.isView(C)?A$(T,C):T,v;if(c0.isAllowed$Ref(C,q)){if(F=vW(C,P,y,Q,R,G,W,Y,z,q,H,B),v=F.circular,$[E]!==F.value){let h=new Map;if(w?.preservedProperties){if(typeof $[E]==="object"&&!Array.isArray($[E]))w?.preservedProperties.forEach((r)=>{if(r in $[E])h.set(r,$[E][r])})}let X0=F.value;if(w?.cloneReferences&&!v&&X0&&typeof X0==="object")X0=structuredClone(X0);if($[E]=X0,w?.preservedProperties){if(h.size&&typeof $[E]==="object"&&!Array.isArray($[E]))h.forEach((r,u)=>{$[E][u]=r})}w?.onDereference?.(C.$ref,$[E],$,E)}}else if(!G.has(C)){if(F=g7(C,P,y,Q,R,G,W,Y,z,q,H,B+1),v=F.circular,$[E]!==F.value)$[E]=F.value}else v=n8(P,z,q);L.circular=L.circular||v}G.delete($)}}return L}function vW($,Z,X,Q,J,G,W,Y,z,q,H,B){let w=c0.isExternal$Ref($)&&q?.dereference?.externalReferenceResolution==="root"?c6():Q?X:Z,N=a0(w,$.$ref),I=Y.get(N);if(I){if(!I.circular){let y=Object.keys($);if(y.length>1){let v={};for(let h of y)if(h!=="$ref"&&!(h in I.value))v[h]=$[h];return{circular:I.circular,value:Object.assign({},I.value,v)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in $){if(I.value.$ref===$.$ref)return n8(Z,z,q),I}else return n8(Z,z,q),I}let T=z._resolve(N,Z,q);if(T===null)return{circular:!1,value:null};let E=T.circular,P=E||T.chainCircular||G.has(T.value);if(P)n8(Z,z,q);let R=c0.dereference($,T.value,q);if(!P){let y=g7(R,T.path,T.$ref.path,T.$ref.dynamicIdScope,J,G,W,Y,z,q,H,B+1);P=y.circular,R=y.value}if(P&&!E&&q.dereference?.circular==="ignore")R=$;if(E&&R!==$)R.$ref=J;let C={circular:P,value:R};if(Object.keys($).length===1)Y.set(N,C);return C}function gW($,Z){if(Z&&Z.timeoutMs){if(Date.now()-$>Z.timeoutMs)throw new eZ(Z.timeoutMs)}}function n8($,Z,X){if(Z.circular=!0,X?.dereference?.onCircular?.($),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${$}`);return!0}var fW;var hW=s(()=>{R4();M9();P$();p6();t$();fW=BI});function FI(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(Z){setTimeout(Z,0)}}var f7;var uW=s(()=>{f7=FI()});function c$($,Z){if($){Z.then(function(X){f7(function(){$(null,X)})},function(X){f7(function(){$(X)})});return}else return Z}var mW=s(()=>{uW()});class n1{schema=null;$refs=new I9;async parse(){let $=w9(arguments),Z;if(!$.path&&!$.schema){let Q=Error(`Expected a file path, URL, or object. Got ${$.path||$.schema}`);return c$($.callback,Promise.reject(Q))}this.schema=null,this.$refs=new I9;let X="http";if(y8($.path))$.path=AG($.path),X="file";else if(!$.path&&$.schema&&"$id"in $.schema&&$.schema.$id){let Q=T4($.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);$.path=`${Q.protocol}//${Q.hostname}:${J}`}if($.path=a0(c6(),$.path),$.schema&&typeof $.schema==="object"){let Q=this.$refs._add($.path);Q.value=$.schema,Q.pathType=X,Q.dynamicIdScope=u8(Q.value),m8(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),Z=Promise.resolve($.schema)}else Z=c8($.path,this.$refs,$.options);try{let Q=await Z;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,c$($.callback,Promise.resolve(this.schema));else if($.options.continueOnError)return this.schema=null,c$($.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!$.options.continueOnError||!E1(Q))return c$($.callback,Promise.reject(Q));if(this.$refs._$refs[o0($.path)])this.$refs._$refs[o0($.path)].addError(Q);return c$($.callback,Promise.resolve(null))}}static parse(){let $=new n1;return $.parse.apply($,arguments)}async resolve(){let $=w9(arguments);try{return await this.parse($.path,$.schema,$.options),await SW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.$refs))}catch(Z){return c$($.callback,Promise.reject(Z))}}static resolve(){let $=new n1;return $.resolve.apply($,arguments)}static bundle(){let $=new n1;return $.bundle.apply($,arguments)}async bundle(){let $=w9(arguments);try{return await this.resolve($.path,$.schema,$.options),kW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}static dereference(){let $=new n1;return $.dereference.apply($,arguments)}async dereference(){let $=w9(arguments);try{return await this.resolve($.path,$.schema,$.options),fW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}}function h7($){if(O4.getParserErrors($).length>0)throw new O4($)}var wm,Tm,jm,dW;var lW=s(()=>{OG();G7();CW();_W();yW();hW();P$();_7();x7();t$();mW();p6();k7();P$();wm=n1.parse,Tm=n1.resolve,jm=n1.bundle,dW=n1.dereference});async function T9($,Z={}){let{baseUrl:X="/_jx/server"}=Z,Q=await dW($),J=x8(Q);if(J.length===0)return null;let G=J.map(({exportName:Y,src:z})=>`import { ${Y} } from '${z}'`).join(`
59
+ `),W=J.map(({exportName:Y})=>cW(Y,X)).join(`
58
60
  `);return`// Generated by @jxsuite/compiler — do not edit manually
59
61
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
60
62
  // Requires: npm install hono
@@ -66,8 +68,8 @@ const app = new Hono()
66
68
  ${W}
67
69
 
68
70
  export default app
69
- `}function R7($,Z={}){let{baseUrl:X="/_jx/server",adapter:Q=null,mounts:J=[],connectors:G=[]}=Z;if($.length===0&&J.length===0&&!Q)return null;let W=$.map(({exportName:H,src:B})=>`import { ${H} } from '${B}'`).join(`
70
- `),Y=r2(J,G),z=$.map(({exportName:H})=>CW(H,X)).join(`
71
+ `}function u7($,Z={}){let{baseUrl:X="/_jx/server",adapter:Q=null,mounts:J=[],connectors:G=[]}=Z;if($.length===0&&J.length===0&&!Q)return null;let W=$.map(({exportName:H,src:B})=>`import { ${H} } from '${B}'`).join(`
72
+ `),Y=LI(J,G),z=$.map(({exportName:H})=>cW(H,X)).join(`
71
73
  `),q=Q==="cloudflare-workers"||Q==="cloudflare-pages"?`
72
74
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
73
75
  `:`
@@ -79,11 +81,11 @@ const app = new Hono()
79
81
  ${Y.routes}${z}
80
82
  ${q}
81
83
  export default app
82
- `}function r2($,Z){if($.length===0)return{imports:"",routes:""};let X=$.toSorted((G,W)=>G.order-W.order),Q=[];for(let G of X)Q.push(`import { ${G.className} } from '${G.module}'`);for(let G of Z)Q.push(`import { ${G.className} } from '${G.module}'`);let J=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${Z.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,W]of X.entries()){let Y=JSON.stringify(W.options);J.push(`const jxMount${G} = await ${W.className}.mount({ ...${Y}, connectors: jxConnectors }, jxCtx)`,`app.all('${W.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${W.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
84
+ `}function LI($,Z){if($.length===0)return{imports:"",routes:""};let X=$.toSorted((G,W)=>G.order-W.order),Q=[];for(let G of X)Q.push(`import { ${G.className} } from '${G.module}'`);for(let G of Z)Q.push(`import { ${G.className} } from '${G.module}'`);let J=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${Z.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,W]of X.entries()){let Y=JSON.stringify(W.options);J.push(`const jxMount${G} = await ${W.className}.mount({ ...${Y}, connectors: jxConnectors }, jxCtx)`,`app.all('${W.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${W.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
83
85
  ${Q.join(`
84
86
  `)}`,routes:`${J.join(`
85
87
  `)}
86
- `}}function CW($,Z){return`
88
+ `}}function cW($,Z){return`
87
89
  app.post('${Z}/${$}', async (c) => {
88
90
  const args = await c.req.json().catch(() => ({}))
89
91
  try {
@@ -91,12 +93,12 @@ app.post('${Z}/${$}', async (c) => {
91
93
  } catch (e) {
92
94
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
93
95
  }
94
- })`}var P7=t(()=>{PW();F1()});function M1($){return $ instanceof Error?$.message:String($)}function C7($,Z,X){let Q;try{Q=JSON.parse($)}catch(J){throw Error(`Failed to parse ${X} at ${Z}: ${M1(J)}`,{cause:J})}if(!m$(Q))throw Error(`Invalid ${X} at ${Z}: expected a JSON object`);return Q}function A1($,Z){return C7($,Z,"Jx document")}function SW($,Z){return C7($,Z,"project config")}function _W($,Z){return C7($,Z,"class definition")}var I1=t(()=>{D6()});class g5{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#$=null;constructor($,Z,X,Q){this.name=$,this.classPath=Z,this.classDef=X,this.#Z=Q;let{format:J}=X;this.extensions=(J?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J?.mediaType??null,this.documentKinds=J?.documentKinds??[],this.exportTarget=J?.exportTarget===!0,this.remote=J?.remote===!0,this.studio=X.$studio??null,this.project=X.project??null,this.server=X.server??null,this.connector=X.connector??null,this.capabilities=o2(X)}implementation(){if(!this.#$){let $=this.classDef.$implementation;if(!$)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#$=this.#Z.importModule(this.#Z.resolvePath(this.classPath,$))}return this.#$}async call($,...Z){let X=this.capabilities[$];if(!X)throw Error(`Format class "${this.name}" does not declare a "${$}" capability`);let Q=await this.implementation(),J=this.classDef.title??this.name,G=Q[J]??Q.default?.[J]??Q.default,W=G?.[X.identifier];if(typeof W!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await W.call(G,...Z)}}class f5{#Z;constructor($){this.#Z=$;for(let Z of bW){let X=new Map;for(let Q of $){if(!Q.capabilities[Z])continue;for(let J of Q.extensions){let G=X.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${Q.name}" both claim "${J}" with the "${Z}" capability`);X.set(J,Q)}}}}get entries(){return this.#Z}byExtension($,Z){let X=xW($);return this.#Z.find((Q)=>Q.extensions.includes(X)&&(!Z||Q.capabilities[Z]))}byName($){return this.#Z.find((Z)=>Z.name===$)}withCapability($){return this.#Z.filter((Z)=>Z.capabilities[$])}documentExtensions($){let Z=new Set;for(let X of this.#Z){if($&&!X.documentKinds.includes($))continue;for(let Q of X.extensions)Z.add(Q)}return Z.delete(".json"),[...Z]}has($){let Z=xW($);return this.#Z.some((X)=>X.extensions.includes(Z))}}function o2($){let Z={},X=$.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!kW.includes(G))continue;let W={identifier:J.identifier??Q,timing:J.timing??a2};if(typeof J.discriminator==="string")W.discriminator=J.discriminator;Z[G]=W}return Z}function xW($){let Z=$.toLowerCase();return Z.startsWith(".")?Z:`.${Z}`}var bW,kW,a2;var S7=t(()=>{bW=["parse","serialize","discover","load"],kW=[...bW,"projectData","resolvePaths","lower","emit","mount","dialect","deploySchema","bindings","testConnection"],a2=["compiler","server"]});class yW{#Z;#$;#X;constructor($){this.#Z=$,this.#$=$.flatMap((J)=>J.classes);let Z=new Map;for(let J of $)for(let G of J.classes){let W=Z.get(G.name);if(W&&W!==J.specifier)throw Error(`Extension conflict: "${W}" and "${J.specifier}" both provide a class named "${G.name}"`);Z.set(G.name,J.specifier)}let X=new Map;for(let J of this.#$){if(!J.project)continue;let G=X.get(J.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${J.name}" both claim the project section "${J.project.key}"`);X.set(J.project.key,J)}let Q=new Map;for(let J of this.#$){if(!J.server)continue;let{basePath:G}=J.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${J.name}": server basePath "${G}" must be under /_jx/`);let W=Q.get(G);if(W)throw Error(`Extension conflict: "${W.name}" and "${J.name}" both mount "${G}"`);Q.set(G,J)}this.#X=new f5(this.#$.filter((J)=>J.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#$}get formats(){return this.#X}byName($){return this.#$.find((Z)=>Z.name===$)}projectContributions(){return this.#$.filter(($)=>$.project!==null)}byProjectKey($){return this.#$.find((Z)=>Z.project?.key===$)}byPathsDiscriminator($){return this.#$.find((Z)=>Z.capabilities.resolvePaths?.discriminator===$)}emitters(){return this.#$.filter(($)=>$.capabilities.emit!==void 0)}serverMounts(){return this.#$.filter(($)=>$.server!==null).toSorted(($,Z)=>($.server?.order??100)-(Z.server?.order??100)||$.name.localeCompare(Z.name))}connectors(){return this.#$.filter(($)=>$.connector!==null)}schemaFragments($){return this.#Z.map((Z)=>Z.schemas[$]).filter((Z)=>typeof Z==="string")}}async function vW($,Z,X){let Q=[];for(let J of $??[])Q.push(await s2(J,Z,X));return new yW(Q)}async function s2($,Z,X){let Q;if($.startsWith("./")||$.startsWith("../")){let Y=Z.resolvePath(X,$);Q=Z.resolvePath(`${Y}/package.json`,`./${h5}`)}else try{Q=Z.resolvePath(X,`${$}/${h5}`)}catch(Y){throw Error(`Extension "${$}" is not resolvable: it must export ${h5} (is the package installed, and does its exports map include it?): ${_7(Y)}`,{cause:Y})}let J;try{J=await Z.loadJson(Q)}catch(Y){throw Error(`Extension "${$}": cannot read manifest ${Q}: ${_7(Y)}`,{cause:Y})}if(!J||typeof J!=="object"||typeof J.name!=="string")throw Error(`Extension "${$}": ${h5} must declare a "name"`);if(!$.startsWith(".")&&J.name!==$)throw Error(`Extension "${$}": manifest name "${J.name}" does not match the specifier`);let G=[];for(let[Y,z]of Object.entries(J.classes??{})){let q=Z.resolvePath(Q,z),H;try{H=await Z.loadJson(q)}catch(B){throw Error(`Extension "${$}": cannot read class "${Y}" at ${q}: ${_7(B)}`,{cause:B})}G.push(new g5(Y,q,H,Z))}let W={};if(J.schemas?.project)W.project=Z.resolvePath(Q,J.schemas.project);if(J.schemas?.document)W.document=Z.resolvePath(Q,J.schemas.document);if(J.schemas?.fields)W.fields=Z.resolvePath(Q,J.schemas.fields);return{specifier:$,manifestPath:Q,manifest:J,classes:G,schemas:W}}function _7($){return $ instanceof Error?$.message:String($)}var h5="jx-extension.json";var gW=t(()=>{S7();S7()});var b7={};h6(b7,{unknownFormatError:()=>QI,importImplementation:()=>m5,createNodeFormatIO:()=>d5,buildProjectFormatRegistry:()=>ZI,buildProjectExtensionRegistry:()=>E6,buildExtensionsPayload:()=>XI});import{readFileSync as hW}from"node:fs";import{dirname as t2,isAbsolute as e2,resolve as x7,sep as u5}from"node:path";import{pathToFileURL as $I}from"node:url";import{createRequire as fW}from"node:module";async function m5($){let Z=[$],X=`${u5}src${u5}`,Q=`${u5}dist${u5}`;if($.includes(X))Z.push($.replace(X,Q));if($.endsWith(".js"))Z.push(`${$.slice(0,-3)}.ts`);let J;for(let G of Z)try{return await import($I(G).href)}catch(W){J=W}throw J instanceof Error?J:Error(String(J))}function d5($){return{importModule:(Z)=>m5(Z),loadJson:async(Z)=>JSON.parse(hW(Z,"utf8")),resolvePath:(Z,X)=>{if(X.startsWith("./")||X.startsWith("../"))return x7(t2(Z),X);if(e2(X))return X;let Q=fW(x7($,"package.json"));try{return Q.resolve(X)}catch{return fW(import.meta.url).resolve(X)}}}}async function E6($,Z){return vW(Z?.extensions,d5($),x7($,"project.json"))}async function ZI($,Z){return(await E6($,Z)).formats}function XI($){let Z=[];for(let X of $.extensions){let Q={};if(X.schemas.project)try{Q=JSON.parse(hW(X.schemas.project,"utf8")).properties??{}}catch{Q={}}let J=[];for(let G of X.classes){if(!G.project)continue;J.push({className:G.name,entrySchema:Q[G.project.key]??null,project:G.project,studio:G.studio})}Z.push({classes:X.classes.map((G)=>{let W=G.studio?.stateDefaults,Y=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...Y?{state:!0}:{},...W&&typeof W==="object"?{stateDefaults:W}:{}}}),contributions:J,name:X.manifest.name,specifier:X.specifier,...X.manifest.title===void 0?{}:{title:X.manifest.title},...X.manifest.description===void 0?{}:{description:X.manifest.description}})}return Z}function QI($,Z){return Error(`No format class registered for "${Z}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var i6=t(()=>{gW()});async function c5($,Z={}){let{resolveElementPath:X,$media:Q,formats:J}=Z,G=[],W=new Set;async function Y(z,q){let H,B;if(typeof z==="string"){let{readFileSync:R}=await import("node:fs"),{resolve:C}=await import("node:path");if(B=q?C(q,z):C(z),W.has(B))return;if(W.add(B),B.endsWith(".json"))H=A1(R(B,"utf8"),B);else{let{extname:v}=await import("node:path"),d=v(B).toLowerCase(),f=J?.byExtension?.(d,"parse");if(!f){let{unknownFormatError:a}=await Promise.resolve().then(() => (i6(),b7));throw a(B,d)}H=await f.call("parse",R(B,"utf8"))}}else{if(H=z,B=null,H.tagName&&W.has(H.tagName))return;if(H.tagName)W.add(H.tagName)}let{tagName:L}=H;if(!L||!L.includes("-"))throw Error(`compileElement: tagName "${L}" must contain a hyphen`);let{dirname:M}=await import("node:path"),A=B?M(B):null,w=[];if(Array.isArray(H.$elements))for(let R of H.$elements){let C=d$(R)?R.$ref:R;if(typeof C!=="string")continue;if(A)await Y(C,A);let v=X?X(C,A):C.replace(/\.json$/,".js");w.push(v)}let D=D5(L);if(Q)H.$media={...Q,...H.$media};let{rewriteSrc:j}=Z,E=M9(H,D,w,j?(R)=>j(R,A):void 0),P=B?B.replace(/\.json$/,".js"):`${L}.js`;G.push({content:E,path:P,tagName:L})}return await Y($,Z.basePath??null),{files:G}}async function JI($,Z={}){let{title:X="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=Z,G=await c5($,Z),W=G.files.at(-1);if(!W)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),z=Y(W.path),q=`<!DOCTYPE html>
96
+ })`}var m7=s(()=>{lW();L6()});function A6($){return $ instanceof Error?$.message:String($)}function d7($,Z,X){let Q;try{Q=JSON.parse($)}catch(J){throw Error(`Failed to parse ${X} at ${Z}: ${A6(J)}`,{cause:J})}if(!d$(Q))throw Error(`Invalid ${X} at ${Z}: expected a JSON object`);return Q}function I6($,Z){return d7($,Z,"Jx document")}function pW($,Z){return d7($,Z,"project config")}function iW($,Z){return d7($,Z,"class definition")}var N6=s(()=>{w1()});class r8{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#$=null;constructor($,Z,X,Q){this.name=$,this.classPath=Z,this.classDef=X,this.#Z=Q;let{format:J}=X;this.extensions=(J?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J?.mediaType??null,this.documentKinds=J?.documentKinds??[],this.exportTarget=J?.exportTarget===!0,this.remote=J?.remote===!0,this.studio=X.$studio??null,this.project=X.project??null,this.server=X.server??null,this.connector=X.connector??null,this.capabilities=AI(X)}implementation(){if(!this.#$){let $=this.classDef.$implementation;if(!$)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#$=this.#Z.importModule(this.#Z.resolvePath(this.classPath,$))}return this.#$}async call($,...Z){let X=this.capabilities[$];if(!X)throw Error(`Format class "${this.name}" does not declare a "${$}" capability`);let Q=await this.implementation(),J=this.classDef.title??this.name,G=Q[J]??Q.default?.[J]??Q.default,W=G?.[X.identifier];if(typeof W!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await W.call(G,...Z)}}class a8{#Z;constructor($){this.#Z=$;for(let Z of rW){let X=new Map;for(let Q of $){if(!Q.capabilities[Z])continue;for(let J of Q.extensions){let G=X.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${Q.name}" both claim "${J}" with the "${Z}" capability`);X.set(J,Q)}}}}get entries(){return this.#Z}byExtension($,Z){let X=nW($);return this.#Z.find((Q)=>Q.extensions.includes(X)&&(!Z||Q.capabilities[Z]))}byName($){return this.#Z.find((Z)=>Z.name===$)}withCapability($){return this.#Z.filter((Z)=>Z.capabilities[$])}documentExtensions($){let Z=new Set;for(let X of this.#Z){if($&&!X.documentKinds.includes($))continue;for(let Q of X.extensions)Z.add(Q)}return Z.delete(".json"),[...Z]}has($){let Z=nW($);return this.#Z.some((X)=>X.extensions.includes(Z))}}function AI($){let Z={},X=$.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!aW.includes(G))continue;let W={identifier:J.identifier??Q,timing:J.timing??MI};if(typeof J.discriminator==="string")W.discriminator=J.discriminator;Z[G]=W}return Z}function nW($){let Z=$.toLowerCase();return Z.startsWith(".")?Z:`.${Z}`}var rW,aW,MI;var l7=s(()=>{rW=["parse","serialize","discover","load"],aW=[...rW,"projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],MI=["compiler","server"]});class oW{#Z;#$;#X;constructor($){this.#Z=$,this.#$=$.flatMap((J)=>J.classes);let Z=new Map;for(let J of $)for(let G of J.classes){let W=Z.get(G.name);if(W&&W!==J.specifier)throw Error(`Extension conflict: "${W}" and "${J.specifier}" both provide a class named "${G.name}"`);Z.set(G.name,J.specifier)}let X=new Map;for(let J of this.#$){if(!J.project)continue;let G=X.get(J.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${J.name}" both claim the project section "${J.project.key}"`);X.set(J.project.key,J)}let Q=new Map;for(let J of this.#$){if(!J.server)continue;let{basePath:G}=J.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${J.name}": server basePath "${G}" must be under /_jx/`);let W=Q.get(G);if(W)throw Error(`Extension conflict: "${W.name}" and "${J.name}" both mount "${G}"`);Q.set(G,J)}this.#X=new a8(this.#$.filter((J)=>J.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#$}get formats(){return this.#X}byName($){return this.#$.find((Z)=>Z.name===$)}projectContributions(){return this.#$.filter(($)=>$.project!==null)}byProjectKey($){return this.#$.find((Z)=>Z.project?.key===$)}byPathsDiscriminator($){return this.#$.find((Z)=>Z.capabilities.resolvePaths?.discriminator===$)}emitters(){return this.#$.filter(($)=>$.capabilities.emit!==void 0)}assetProviders(){return this.#$.filter(($)=>$.capabilities.assets!==void 0)}serverMounts(){return this.#$.filter(($)=>$.server!==null).toSorted(($,Z)=>($.server?.order??100)-(Z.server?.order??100)||$.name.localeCompare(Z.name))}connectors(){return this.#$.filter(($)=>$.connector!==null)}schemaFragments($){return this.#Z.map((Z)=>Z.schemas[$]).filter((Z)=>typeof Z==="string")}}async function sW($,Z,X){let Q=[];for(let J of $??[])Q.push(await II(J,Z,X));return new oW(Q)}async function II($,Z,X){let Q;if($.startsWith("./")||$.startsWith("../")){let Y=Z.resolvePath(X,$);Q=Z.resolvePath(`${Y}/package.json`,`./${o8}`)}else try{Q=Z.resolvePath(X,`${$}/${o8}`)}catch(Y){throw Error(`Extension "${$}" is not resolvable: it must export ${o8} (is the package installed, and does its exports map include it?): ${c7(Y)}`,{cause:Y})}let J;try{J=await Z.loadJson(Q)}catch(Y){throw Error(`Extension "${$}": cannot read manifest ${Q}: ${c7(Y)}`,{cause:Y})}if(!J||typeof J!=="object"||typeof J.name!=="string")throw Error(`Extension "${$}": ${o8} must declare a "name"`);if(!$.startsWith(".")&&J.name!==$)throw Error(`Extension "${$}": manifest name "${J.name}" does not match the specifier`);let G=[];for(let[Y,z]of Object.entries(J.classes??{})){let q=Z.resolvePath(Q,z),H;try{H=await Z.loadJson(q)}catch(B){throw Error(`Extension "${$}": cannot read class "${Y}" at ${q}: ${c7(B)}`,{cause:B})}G.push(new r8(Y,q,H,Z))}let W={};if(J.schemas?.project)W.project=Z.resolvePath(Q,J.schemas.project);if(J.schemas?.document)W.document=Z.resolvePath(Q,J.schemas.document);if(J.schemas?.fields)W.fields=Z.resolvePath(Q,J.schemas.fields);return{specifier:$,manifestPath:Q,manifest:J,classes:G,schemas:W}}function c7($){return $ instanceof Error?$.message:String($)}var o8="jx-extension.json";var tW=s(()=>{l7();l7()});var i7={};m1(i7,{unknownFormatError:()=>OI,importImplementation:()=>t8,createNodeFormatIO:()=>e8,buildProjectFormatRegistry:()=>TI,buildProjectExtensionRegistry:()=>R1,buildExtensionsPayload:()=>jI});import{readFileSync as $Y}from"node:fs";import{dirname as NI,isAbsolute as DI,resolve as p7,sep as s8}from"node:path";import{pathToFileURL as wI}from"node:url";import{createRequire as eW}from"node:module";async function t8($){let Z=[$],X=`${s8}src${s8}`,Q=`${s8}dist${s8}`;if($.includes(X))Z.push($.replace(X,Q));if($.endsWith(".js"))Z.push(`${$.slice(0,-3)}.ts`);let J;for(let G of Z)try{return await import(wI(G).href)}catch(W){J=W}throw J instanceof Error?J:Error(String(J))}function e8($){return{importModule:(Z)=>t8(Z),loadJson:async(Z)=>JSON.parse($Y(Z,"utf8")),resolvePath:(Z,X)=>{if(X.startsWith("./")||X.startsWith("../"))return p7(NI(Z),X);if(DI(X))return X;let Q=eW(p7($,"package.json"));try{return Q.resolve(X)}catch{return eW(import.meta.url).resolve(X)}}}}async function R1($,Z){return sW(Z?.extensions,e8($),p7($,"project.json"))}async function TI($,Z){return(await R1($,Z)).formats}function jI($){let Z=[];for(let X of $.extensions){let Q={};if(X.schemas.project)try{Q=JSON.parse($Y(X.schemas.project,"utf8")).properties??{}}catch{Q={}}let J=[];for(let G of X.classes){if(!G.project)continue;J.push({className:G.name,entrySchema:Q[G.project.key]??null,project:G.project,studio:G.studio})}Z.push({classes:X.classes.map((G)=>{let W=G.studio?.stateDefaults,Y=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...Y?{state:!0}:{},...W&&typeof W==="object"?{stateDefaults:W}:{}}}),contributions:J,name:X.manifest.name,specifier:X.specifier,...X.manifest.title===void 0?{}:{title:X.manifest.title},...X.manifest.description===void 0?{}:{description:X.manifest.description}})}return Z}function OI($,Z){return Error(`No format class registered for "${Z}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var r1=s(()=>{tW()});async function Z5($,Z={}){let{resolveElementPath:X,$media:Q,formats:J}=Z,G=[],W=new Set;async function Y(z,q){let H,B;if(typeof z==="string"){let{readFileSync:R}=await import("node:fs"),{resolve:C}=await import("node:path");if(B=q?C(q,z):C(z),W.has(B))return;if(W.add(B),B.endsWith(".json"))H=I6(R(B,"utf8"),B);else{let{extname:y}=await import("node:path"),v=y(B).toLowerCase(),h=J?.byExtension?.(v,"parse");if(!h){let{unknownFormatError:X0}=await Promise.resolve().then(() => (r1(),i7));throw X0(B,v)}H=await h.call("parse",R(B,"utf8"))}}else{if(H=z,B=null,H.tagName&&W.has(H.tagName))return;if(H.tagName)W.add(H.tagName)}let{tagName:F}=H;if(!F||!F.includes("-"))throw Error(`compileElement: tagName "${F}" must contain a hyphen`);let{dirname:L}=await import("node:path"),w=B?L(B):null,N=[];if(Array.isArray(H.$elements))for(let R of H.$elements){let C=U$(R)?R.$ref:R;if(typeof C!=="string")continue;if(w)await Y(C,w);let y=X?X(C,w):C.replace(/\.json$/,".js");N.push(y)}let I=b8(F);if(Q)H.$media={...Q,...H.$media};let{rewriteSrc:T}=Z,E=j9(H,I,N,T?(R)=>T(R,w):void 0),P=B?B.replace(/\.json$/,".js"):`${F}.js`;G.push({content:E,path:P,tagName:F})}return await Y($,Z.basePath??null),{files:G}}async function EI($,Z={}){let{title:X="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=Z,G=await Z5($,Z),W=G.files.at(-1);if(!W)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),z=Y(W.path),q=`<!DOCTYPE html>
95
97
  <html lang="en">
96
98
  <head>
97
99
  <meta charset="utf-8">
98
100
  <meta name="viewport" content="width=device-width, initial-scale=1">
99
- <title>${C0(X)}</title>
101
+ <title>${_0(X)}</title>
100
102
  <script type="importmap">
101
103
  {
102
104
  "imports": {
@@ -110,58 +112,57 @@ app.post('${Z}/${$}', async (c) => {
110
112
  <${W.tagName}></${W.tagName}>
111
113
  <script type="module" src="./${z}"></script>
112
114
  </body>
113
- </html>`;return{files:G.files,html:q}}function GI($){if($===null||typeof $!=="object"||Array.isArray($))return JSON.stringify($);if("default"in $)return JSON.stringify($.default);if(K1($))return;if($.$prototype==="LocalStorage"||$.$prototype==="SessionStorage")return JSON.stringify($.default??null);if($.$prototype==="Request")return"null";return JSON.stringify($)}function M9($,Z,X,Q){let J=["// Generated by @jxsuite/compiler — do not edit manually"];if($.$id)J.push(`// Source: ${$.$id}`);for(let M of X)J.push(`import '${M}';`);let G=new Map,W=$.state??{};for(let[M,A]of Object.entries(W)){let w=A;if(w&&typeof w==="object"&&!Array.isArray(w)&&w.$prototype==="Function"&&w.$src){let D=w.$src;if(!G.has(D))G.set(D,[]);G.get(D).push(M)}}for(let[M,A]of G){let w=Q?Q(M):M;J.push(`import { ${A.join(", ")} } from '${w}';`)}J.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${Z} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let Y=[],z=[],q=[],H=[];for(let[M,A]of Object.entries(W)){let w=A;if(n$(w)){let D=w.$expression;if(g1(w))H.push([M,w]);else if(U1(D.operator))q.push([M,w]);else z.push([M,w])}else if(I6(w))if(typeof w.body==="string"&&w.body.includes("return"))z.push([M,w]);else q.push([M,w]);else{let D=GI(w);if(D!==void 0)Y.push([M,D])}}J.push(" this.state = reactive({");for(let[M,A]of Y)J.push(` ${M}: ${A},`);J.push(" });");for(let[M,A]of q)if(J.push(""),n$(A)){let w=F$(A.$expression,{eventParam:"e",statePrefix:"s"});J.push(` this.state.${M} = (s, e) => { ${w}; };`)}else if(N6(A)){let w=r$(A.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});J.push(` this.state.${M} = (s, e) => {`,w," };")}else{let D=(A.parameters?H1(A.parameters):A.arguments??["state"]).join(", ");if(A.$src)J.push(` this.state.${M} = (${D}) => ${M}(${D});`);else J.push(` this.state.${M} = (${D}) => {`,` ${typeof A.body==="string"?A.body:""}`," };")}for(let[M,A]of H){J.push("");let w=F$(A.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${M} = ${z9(A,w)};`)}for(let[M,A]of z)if(J.push(""),n$(A)){let w=F$(A.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${M} = computed(() => ${w});`)}else if(A.$src)J.push(` this.state.${M} = computed(() => ${M}(this.state));`);else{J.push(` this.state.${M} = computed(() => {`);let w=(typeof A.body==="string"?A.body:"").replaceAll("state.","this.state.");J.push(` ${w}`," });")}J.push(" }","");let B=[];if(Array.isArray($.children)){let M={n:0};for(let A of $.children)B1(A,B,$.$media??{},"",M,$.tagName)}if(J.push(" template() {"," const s = this.state;"," return html`",y7($.children,$.style," ")," `;"," }",""," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }"),$.style&&typeof $.style==="object"){let M=[];for(let[A,w]of Object.entries($.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(w===null||typeof w==="object")continue;let D=E$(A);if(typeof w==="string"&&w.includes("${"))M.push([D,w])}if(M.length>0){J.push(" effect(() => {");for(let[A,w]of M){let D=w.replaceAll(/\$\{([^}]+)\}/g,(j,E)=>`\${${E.replaceAll("state.","this.state.")}}`);J.push(` this.style['${A}'] = \`${D}\`;`)}J.push(" });")}}let L=lW($.children);if(L)J.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(J.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),L)J.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return J.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${$.tagName}', ${Z});`,""),J.join(`
114
- `)}function y7($,Z,X){if(!$)return"";if(G$($))return uW($,X);if(!Array.isArray($))return"";return $.map((Q)=>G$(Q)?uW(Q,X):mW(Q,X)).join(`
115
- `)}function mW($,Z){if(typeof $==="string"){if($.includes("${"))return`${Z}${k7($)}`;return`${Z}${C0($)}`}if(typeof $==="number"||typeof $==="boolean")return`${Z}${C0(String($))}`;if(!$||typeof $!=="object")return"";let X=$.tagName??"div",Q=[];if($.attributes)for(let[z,q]of Object.entries($.attributes))if(q&&typeof q==="object"&&d$(q))Q.push(`${z}="\${${n6(q.$ref)}}"`);else if(typeof q==="string"&&q.includes("${"))Q.push(`${z}="${l5(q)}"`);else Q.push(`${z}="${q}"`);if($.id)Q.push(`id="${$.id}"`);if($.className)Q.push(`class="${$.className}"`);for(let[z,q]of Object.entries($)){if(V1.has(z)||z.startsWith("$")||z.startsWith("on")||z==="tagName"||z==="id"||z==="className"||z==="style"||z==="children"||z==="textContent"||z==="innerHTML"||z==="attributes")continue;if(q&&typeof q==="object"&&q.$ref)Q.push(`.${z}="\${${n6(q.$ref)}}"`);else if(typeof q==="string"&&q.includes("${"))Q.push(`.${z}="${l5(q)}"`)}if($.$props)for(let[z,q]of Object.entries($.$props))if(q&&typeof q==="object"&&q.$ref)Q.push(`.${z}="\${${n6(q.$ref)}}"`);else Q.push(`.${z}="\${${JSON.stringify(q)}}"`);for(let[z,q]of Object.entries($)){if(!z.startsWith("on")||z==="observedAttributes")continue;let H=z.slice(2).toLowerCase();if(q&&typeof q==="object"&&q.$ref)Q.push(`@${H}="\${(e) => ${n6(q.$ref)}(s, e)}"`);else if(q&&typeof q==="object"&&"$expression"in q){let B=F$(q.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${H}="\${(e) => { ${B}; }}"`)}else if(I6(q))Q.push(`@${H}="\${(e) => { ${YI(q)} }}"`)}let J=dW($.style);if(J)Q.push(`style="${J}"`);let G=Q.length>0?`
116
- ${Z} ${Q.join(`
117
- ${Z} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${Z}<${X}${G}
118
- ${Z}>`;let Y="";if($.$switch){let z=d$($.$switch)?$.$switch.$ref:$.$switch,q=n6(z),H=$.cases??{},B=[];for(let[L,M]of Object.entries(H)){if(!M||d$(M))continue;let A=mW(M,`${Z} `);B.push(` ${JSON.stringify(L)}: html\`
119
- ${A}
120
- \``)}Y=`\${{
121
- ${B.join(`,
115
+ </html>`;return{files:G.files,html:q}}function RI($){if($===null||typeof $!=="object"||Array.isArray($))return JSON.stringify($);if("default"in $)return JSON.stringify($.default);if(V6($))return;if($.$prototype==="LocalStorage"||$.$prototype==="SessionStorage")return JSON.stringify($.default??null);if($.$prototype==="Request")return"null";return JSON.stringify($)}function CI($){let Z=new Set,X=new Set,Q=(G)=>{if(typeof G==="string"&&G.startsWith("#/state/"))Z.add(G.slice(8).split("/")[0])},J=(G)=>{if(typeof G==="string"){for(let Y of G.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))Z.add(Y[1]);return}if(!G||typeof G!=="object"||X.has(G))return;if(X.add(G),Array.isArray(G)){for(let Y of G)J(Y);return}let W=G;if(W.operator==="call"&&U$(W.target))Q(W.target.$ref);for(let[Y,z]of Object.entries(W)){if(Y.startsWith("on")&&Y!=="observedAttributes"&&U$(z))Q(z.$ref);J(z)}};return J($.children),J($.state),Z}function j9($,Z,X,Q){let J=["// Generated by @jxsuite/compiler — do not edit manually"];if($.$id)J.push(`// Source: ${$.$id}`);for(let N of X)J.push(`import '${N}';`);let G=new Map,W=$.state??{};for(let[N,I]of Object.entries(W)){let T=I;if(T&&typeof T==="object"&&!Array.isArray(T)&&T.$prototype==="Function"&&T.$src){let E=T.$src;if(!G.has(E))G.set(E,[]);G.get(E).push(P8(N,T))}}for(let[N,I]of G){let T=Q?Q(N):N;J.push(`import { ${I.join(", ")} } from '${T}';`)}let Y=Object.entries(W).filter(([,N])=>{let I=N;return Boolean(I)&&typeof I==="object"&&!Array.isArray(I)&&I.$prototype==="Request"});J.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${Z} extends HTMLElement {`," #effects = [];",""," constructor() {"," super();");let z=[],q=[],H=[],B=[],F=CI($);for(let[N,I]of Object.entries(W)){let T=I;if(n$(T)){let E=T.$expression;if(u6(T))B.push([N,T]);else if(U6(E.operator))H.push([N,T]);else q.push([N,T])}else if(N1(T))if(T.$src&&typeof T.body!=="string")if(F.has(N)||PI.has(N))H.push([N,T]);else q.push([N,T]);else if(typeof T.body==="string"&&m6(T.body))q.push([N,T]);else H.push([N,T]);else{let E=RI(T);if(E!==void 0)z.push([N,E])}}J.push(" this.state = reactive({");for(let[N,I]of z)J.push(` ${N}: ${I},`);J.push(" });");for(let[N,I]of H)if(J.push(""),n$(I)){let T=L$(I.$expression,{eventParam:"e",statePrefix:"s"});J.push(` this.state.${N} = (s, e) => { ${T}; };`)}else if(D1(I)){let T=r$(I.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});J.push(` this.state.${N} = (s, e) => {`,T," };")}else{let T=I.parameters?l1(I.parameters):I.arguments??["state"],E=T.join(", "),P=typeof I.body==="string"?I.body:"";if(T[0]==="state")if(I.$src)J.push(` this.state.${N} = (${E}) => ${N}(${E});`);else J.push(` this.state.${N} = (${E}) => {`,` ${P}`," };");else{let R=T.map((C)=>C==="state"?"state":"e").join(", ");if(I.$src)J.push(` this.state.${N} = (state, e) => ${N}(${R});`);else J.push(` this.state.${N} = (state, e) => {`,` const _fn = (${E}) => {`,` ${P}`," };",` return _fn(${R});`," };")}}for(let[N,I]of B){J.push("");let T=L$(I.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${N} = ${B9(I,T)};`)}for(let[N,I]of q)if(J.push(""),n$(I)){let T=L$(I.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${N} = computed(() => ${T});`)}else if(I.$src)J.push(` this.state.${N} = computed(() => ${N}(this.state));`);else{J.push(` this.state.${N} = computed(() => {`);let T=(typeof I.body==="string"?I.body:"").replaceAll("state.","this.state.");J.push(` ${T}`," });")}J.push(" }","");let L=[];if(Array.isArray($.children)){let N={n:0};for(let I of $.children)F6(I,L,$.$media??{},"",N,$.tagName)}J.push(" template() {"," const s = this.state;"," return html`",$5($.children,$.style," ")," `;"," }",""," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," const _pn = this.getAttributeNames().filter(n => n.startsWith('props.') && n.length > 6);"," for (const _n of _pn) {"," const _k = _n.slice(6);"," if (_k in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[N,I]of Y)J.push(C8(N,I,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if($.style&&typeof $.style==="object"){let N=[];for(let[I,T]of Object.entries($.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(T===null||typeof T==="object")continue;let E=R$(I);if(typeof T==="string"&&T.includes("${"))N.push([E,T])}if(N.length>0){J.push(" this.#effects.push(effect(() => {");for(let[I,T]of N){let E=T.replaceAll(/\$\{([^}]+)\}/g,(P,R)=>`\${${R.replaceAll("state.","this.state.")}}`);J.push(` this.style['${I}'] = \`${E}\`;`)}J.push(" }));")}}let w=GY($.children);if(w)J.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(J.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#effects.push(effect(() => render(this.template(), this)));"),w)J.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return J.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," for (const _e of this.#effects) { stop(_e); }"," this.#effects.length = 0;"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${$.tagName}', ${Z});`,""),J.join(`
116
+ `)}function $5($,Z,X,Q=!1,J=!1){if(!$)return"";if(G$($))return ZY($,X);if(!Array.isArray($))return"";return $.map((G)=>G$(G)?ZY(G,X):QY(G,Q?"":X,Q,J)).join(Q?"":`
117
+ `)}function QY($,Z,X=!1,Q=!1){if(typeof $==="string"){if($.includes("${"))return`${Z}${n7($)}`;return`${Z}${_0($)}`}if(typeof $==="number"||typeof $==="boolean")return`${Z}${_0(String($))}`;if(!$||typeof $!=="object")return"";let J=$.tagName??"div",G=X||d6.has(J),W=[];if($.attributes)for(let[F,L]of Object.entries($.attributes))if(L&&typeof L==="object"&&U$(L))W.push(`${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`${F}="${z1(L)}"`);else W.push(`${F}="${L}"`);if($.id)W.push(`id="${z1(String($.id))}"`);if($.className)W.push(`class="${z1(String($.className))}"`);for(let[F,L]of Object.entries($)){if(B6.has(F)||F.startsWith("$")||F.startsWith("on")||F==="tagName"||F==="id"||F==="className"||F==="style"||F==="children"||F==="textContent"||F==="innerHTML"||F==="attributes")continue;if(L&&typeof L==="object"&&L.$ref)W.push(`.${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`.${F}="${z1(L)}"`)}if($.$props)for(let[F,L]of Object.entries($.$props))if(L&&typeof L==="object"&&L.$ref)W.push(`.${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`.${F}="${z1(L)}"`);else W.push(`.${F}="\${${JSON.stringify(L)}}"`);let Y=Q?"s.$map = $map; ":"";for(let[F,L]of Object.entries($)){if(!F.startsWith("on")||F==="observedAttributes")continue;let w=F.slice(2).toLowerCase();if(L&&typeof L==="object"&&L.$ref)W.push(Y?`@${w}="\${(e) => { ${Y}${P1(L.$ref)}(s, e); }}"`:`@${w}="\${(e) => ${P1(L.$ref)}(s, e)}"`);else if(L&&typeof L==="object"&&"$expression"in L){let N=L$(L.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${w}="\${(e) => { ${Y}${N}; }}"`)}else if(N1(L))W.push(`@${w}="\${(e) => { ${Y}${SI(L)} }}"`)}let z=JY($.style);if(z)W.push(`style="${z}"`);let q=W.length>0?`
118
+ ${Z} ${W.join(`
119
+ ${Z} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(J))return`${Z}<${J}${q}
120
+ ${Z}>`;let B="";if($.$switch){let F=U$($.$switch)?$.$switch.$ref:$.$switch,L=P1(F),w=$.cases??{},N=[];for(let[I,T]of Object.entries(w)){if(!T||U$(T))continue;let E=QY(T,`${Z} `,!1,Q);N.push(` ${JSON.stringify(I)}: html\`
121
+ ${E}
122
+ \``)}B=`\${{
123
+ ${N.join(`,
122
124
  `)}
123
- }[${q}]}`}else if($.textContent!==void 0)Y=k7($.textContent);else if($.innerHTML!==void 0)Y=$.innerHTML;else if($.children)Y=`
124
- ${y7($.children,$.style,`${Z} `)}
125
- ${Z}`;return`${Z}<${X}${G}
126
- ${Z}>${Y}</${X}>`}function uW($,Z){let X=d$($.items)?n6($.items.$ref):"ITEMS",Q=$.map;if(!Q)return"";let J=Q.tagName??"div",G=[];if(Q.$props)for(let[q,H]of Object.entries(Q.$props))if(d$(H))G.push(`.${q}="\${${WI(H.$ref)}}"`);else G.push(`.${q}="\${${JSON.stringify(H)}}"`);let W=dW(Q.style);if(W)G.push(`style="${W}"`);for(let[q,H]of Object.entries(Q)){if(!q.startsWith("on"))continue;let B=q.slice(2).toLowerCase();if(d$(H))G.push(`@${B}="\${(e) => ${n6(H.$ref)}(s, e)}"`);else if(n$(H)){let L=F$(H.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${L}; }}"`)}}let Y=G.length>0?`
125
+ }[${L}]}`}else if($.textContent!==void 0)B=n7($.textContent);else if($.innerHTML!==void 0)B=$.innerHTML;else if($.children)B=G?$5($.children,$.style,"",!0,Q):`
126
+ ${$5($.children,$.style,`${Z} `,!1,Q)}
127
+ ${Z}`;return G?`<${J}${q}>${B}</${J}>`:`${Z}<${J}${q}
128
+ ${Z}>${B}</${J}>`}function ZY($,Z){let X=U$($.items)?P1($.items.$ref):"ITEMS",Q=$.map;if(!Q)return"";let J=Q.tagName??"div",G=[];if(Q.attributes)for(let[B,F]of Object.entries(Q.attributes))if(F&&typeof F==="object"&&U$(F))G.push(`${B}="\${${XY(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))G.push(`${B}="${z1(F)}"`);else G.push(`${B}="${F}"`);if(Q.id)G.push(`id="${z1(String(Q.id))}"`);if(Q.className)G.push(`class="${z1(String(Q.className))}"`);if(Q.$props)for(let[B,F]of Object.entries(Q.$props))if(U$(F))G.push(`.${B}="\${${XY(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))G.push(`.${B}="${z1(F)}"`);else G.push(`.${B}="\${${JSON.stringify(F)}}"`);let W=JY(Q.style);if(W)G.push(`style="${W}"`);for(let[B,F]of Object.entries(Q)){if(!B.startsWith("on"))continue;let L=B.slice(2).toLowerCase();if(U$(F))G.push(`@${L}="\${(e) => { s.$map = $map; ${P1(F.$ref)}(s, e); }}"`);else if(n$(F)){let w=L$(F.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${L}="\${(e) => { s.$map = $map; ${w}; }}"`)}}let Y=G.length>0?`
127
129
  ${Z} ${G.join(`
128
- ${Z} `)}`:"",z="";if(Q.textContent!==void 0)z=k7(Q.textContent);else if(Q.children)z=`
129
- ${y7(Q.children,null,`${Z} `)}
130
- ${Z} `;return`${Z}\${${X}.map((item, index) => html\`
130
+ ${Z} `)}`:"",z="";if(Q.textContent!==void 0)z=n7(Q.textContent);else if(Q.children)z=`
131
+ ${$5(Q.children,null,`${Z} `,!1,!0)}
132
+ ${Z} `;let q=`html\`
131
133
  ${Z} <${J}${Y}
132
134
  ${Z} >${z}</${J}>
133
- ${Z}\`)}`}function n6($){if($.startsWith("#/state/"))return`s.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return`s.${$}`}function WI($){if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return n6($)}function l5($){return $.replaceAll("state.","s.")}function k7($){if($!==null&&typeof $==="object"&&typeof $.$ref==="string")return`\${${n6($.$ref)}}`;if(typeof $==="string"&&$.includes("${"))return l5($);return String($)}function YI($){if(N6($))return r$($.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});return(typeof $.body==="string"?$.body:"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function dW($){if(!$||typeof $!=="object")return"";let Z=[];for(let[X,Q]of Object.entries($)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let J=E$(X);Z.push(`${J}: ${l5(Q)}`)}}return Z.join("; ")}function lW($){if(!Array.isArray($))return!1;for(let Z of $){if(!Z||typeof Z!=="object")continue;if(Z.tagName==="slot")return!0;if(lW(Z.children))return!0}return!1}var A9=t(()=>{Y9();F1();D6();I1()});function cW($,Z){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=Z,G=V4($,null,$.state??{},$.$media??{}),W=L4($,$.$media??{},Z.projectStyle??null),Y=[],z=pW($,!1,$,G,Y),q=[],H="",B="";if(Y.length>0){for(let A of Y){let w=M9(A.def,A.className,[],Z.rewriteSrc);q.push({content:w,path:`_islands/${A.tagName}.js`,tagName:A.tagName})}H=`<script type="importmap">
135
+ ${Z}\``,H=q.includes("$map")?`(item, index) => { const $map = { item, index }; return ${q}; }`:`(item, index) => ${q}`;return`${Z}\${${X}.map(${H})}`}function P1($){if($.startsWith("#/state/"))return`s.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return`s.${$}`}function XY($){if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return P1($)}function z1($){return $.replaceAll("state.","s.")}function n7($){if($!==null&&typeof $==="object"&&typeof $.$ref==="string")return`\${${P1($.$ref)}}`;if(typeof $==="string"&&$.includes("${"))return z1($);return String($)}function SI($){if(D1($))return r$($.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let Z=typeof $.body==="string"?$.body:"",X=$.parameters?l1($.parameters):$.arguments??[];if(X.length>0){let Q=X.map((J)=>J==="state"?"s":"e").join(", ");return`((${X.join(", ")}) => { ${Z} })(${Q});`}return Z.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function JY($){if(!$||typeof $!=="object")return"";let Z=[];for(let[X,Q]of Object.entries($)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let J=R$(X);Z.push(`${J}: ${z1(Q)}`)}}return Z.join("; ")}function GY($){if(!Array.isArray($))return!1;for(let Z of $){if(!Z||typeof Z!=="object")continue;if(Z.tagName==="slot")return!0;if(GY(Z.children))return!0}return!1}var PI;var O9=s(()=>{V9();L6();w1();N6();PI=new Set(["onMount","onUnmount","onAdopted"])});function WY($,Z){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=Z,G=I4($,null,$.state??{},$.$media??{}),W=w4($,$.$media??{},Z.projectStyle??null),Y=[],z=YY($,!1,$,G,Y),q=[],H="",B="";if(Y.length>0){for(let w of Y){let N=j9(w.def,w.className,[],Z.rewriteSrc);q.push({content:N,path:`_islands/${w.tagName}.js`,tagName:w.tagName})}H=`<script type="importmap">
134
136
  {
135
137
  "imports": {
136
138
  "@vue/reactivity": "${Q}",
137
139
  "lit-html": "${J}"
138
140
  }
139
141
  }
140
- </script>`,B=q.map((A)=>`<script type="module" src="./${A.path}"></script>`).join(`
141
- `)}let L=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((A)=>w6(String(A))!==null)?`<script>${F4()}</script>
142
- `:"",M=`<!DOCTYPE html>
142
+ </script>`,B=q.map((w)=>`<script type="module" src="./${w.path}"></script>`).join(`
143
+ `)}let F=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((w)=>T1(String(w))!==null)?`<script>${D4()}</script>
144
+ `:"",L=`<!DOCTYPE html>
143
145
  <html lang="en">
144
146
  <head>
145
147
  <meta charset="utf-8">
146
148
  <meta name="viewport" content="width=device-width, initial-scale=1">
147
- <title>${C0(X)}</title>
148
- ${L}${H}
149
+ <title>${_0(X)}</title>
150
+ ${F}${H}
149
151
  ${W}
150
152
  </head>
151
153
  <body>
152
154
  ${z}
153
155
  ${B}
154
156
  </body>
155
- </html>`;return{files:q,html:M}}function pW($,Z,X,Q,J){if(typeof $==="string")return C0($);if(typeof $==="number"||typeof $==="boolean")return C0(String($));if(!$||typeof $!=="object")return"";let G=V4(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media);if(Z){let q=J.length,H=`jx-island-${q}`,B=`JxIsland${q}`,L={...X??$,tagName:H};return J.push({className:B,def:L,tagName:H}),`<${H}></${H}>`}let W=$.tagName??"div",Y=U4($,G.scope);if(gZ.has(W))return`<${W}${Y}>`;let z=zI($,X,G,J);return`<${W}${Y}>${z}</${W}>`}function zI($,Z,X,Q){let J=Z??$;if(J.textContent!==void 0){let G=i0(J.textContent,X.scope);return G==null?"":C0(String(G))}if(J.innerHTML)return i0(J.innerHTML,X.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(Z?.children)?Z.children:void 0;return J.children.map((W,Y)=>{let z=W,q=lJ(z),H=G?.[Y]??W;return pW(z,q,H,X,Q)}).join(`
156
- `)}return""}var iW=t(()=>{F1();A9()});function g7($,Z){let{title:X="Jx App",reactivitySrc:Q=K4,litHtmlSrc:J=H4,modulePath:G="app.js"}=Z,W=V4($,null,$.state??{},$.$media??{}),Y=L4($,$.$media??{},Z.projectStyle??null),z={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},q=new Map,H=new Map,B=[],L=[],M=[],A=[],w=[],D=new Map,j=$.state??{};for(let[d,f]of Object.entries(j)){if(f===null||typeof f!=="object"||Array.isArray(f)){if(typeof f==="string"&&I0(f))L.push([d,`() => \`${f}\``]);else B.push([d,f]);continue}if(n$(f)){let a=f.$expression,$0=F$(a,{eventParam:"e",statePrefix:"state"});if(g1(f))w.push(`state[${JSON.stringify(d)}] = ${z9(f,$0)};`);else if(U1(a.operator))A.push([d,{args:["state","e"],body:$0}]);else L.push([d,`() => ${$0}`]);continue}if(I6(f)){let a=f.parameters?H1(f.parameters):f.arguments;if(N6(f)){let $0=r$(f.body,{eventParam:"e",statePrefix:"state"});if(f.parameters&&f.parameters.length>0)w.push(`state[${JSON.stringify(d)}] = ${z9(f,`(() => {
157
- ${$0}
158
- })()`)};`);else A.push([d,{args:["state","e"],body:$0}])}else if(f.$src){if(!D.has(f.$src))D.set(f.$src,new Set);D.get(f.$src).add(d),L.push([d,`() => { return ${d}(state); }`])}else if(typeof f.body==="string"&&f.body.includes("return"))L.push([d,`() => { ${f.body} }`]);else A.push([d,{args:a??["state"],body:f.body}]);continue}if(K1(f))continue;if(fJ(f)){B.push([d,f.default]);continue}if(f1(f)){if(f.$prototype==="LocalStorage"||f.$prototype==="SessionStorage"){let a=f.$prototype==="LocalStorage"?"localStorage":"sessionStorage",$0=f.key??d,u=f.default??null;B.push([d,null]),w.push(KI(d,a,$0,u));continue}if(f.$prototype==="Request"){B.push([d,null]),w.push(UI(d,f));continue}if(f.$prototype==="Cookie"){B.push([d,null]),w.push(HI(d,f.name??d,f.default??null));continue}}B.push([d,f])}let E=nW($,$,W,q,H,z);for(let[d,f]of q)if(!M.some(([a])=>a===d))M.push([d,f]);for(let[d,f]of H)if(!A.some(([a])=>a===d))A.push([d,f]);let P=qI(B,L,M,A,w,D,z,Q,Z.rewriteSrc),R=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],C=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((d)=>w6(String(d))!==null)?`<script>${F4()}</script>
159
- `:"",v=`<!DOCTYPE html>
157
+ </html>`;return{files:q,html:L}}function YY($,Z,X,Q,J){if(typeof $==="string")return _0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(!$||typeof $!=="object")return"";let G=I4(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media);if(Z){let H=J.length,B=`jx-island-${H}`,F=`JxIsland${H}`,L={...X??$,tagName:B};return J.push({className:F,def:L,tagName:B}),`<${B}></${B}>`}let W=$.tagName??"div",Y=L4($,G.scope);if(oZ.has(W))return`<${W}${Y}>`;let z=Q.preformatted===!0||d6.has(W),q=_I($,X,{...G,preformatted:z},J);return`<${W}${Y}>${q}</${W}>`}function _I($,Z,X,Q){let J=Z??$;if(J.textContent!==void 0){let G=r0(J.textContent,X.scope);return G==null?"":_0(String(G))}if(J.innerHTML)return r0(J.innerHTML,X.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(Z?.children)?Z.children:void 0;return J.children.map((W,Y)=>{let z=W,q=QG(z),H=G?.[Y]??W;return YY(z,q,H,X,Q)}).join(F9(X.preformatted))}return""}var zY=s(()=>{L6();O9()});function a7($,Z){let{title:X="Jx App",reactivitySrc:Q=M4,litHtmlSrc:J=A4,modulePath:G="app.js"}=Z,W=I4($,null,$.state??{},$.$media??{}),Y=w4($,$.$media??{},Z.projectStyle??null),z={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},q=new Map,H=new Map,B=[],F=[],L=[],w=[],N=[],I=new Map,T=$.state??{};for(let[v,h]of Object.entries(T)){if(h===null||typeof h!=="object"||Array.isArray(h)){if(typeof h==="string"&&w0(h))F.push([v,`() => \`${h}\``]);else B.push([v,h]);continue}if(n$(h)){let X0=h.$expression,r=L$(X0,{eventParam:"e",statePrefix:"state"});if(u6(h))N.push(`state[${JSON.stringify(v)}] = ${B9(h,r)};`);else if(U6(X0.operator))w.push([v,{args:["state","e"],body:r}]);else F.push([v,`() => ${r}`]);continue}if(N1(h)){let X0=h.parameters?l1(h.parameters):h.arguments;if(D1(h)){let r=r$(h.body,{eventParam:"e",statePrefix:"state"});if(h.parameters&&h.parameters.length>0)N.push(`state[${JSON.stringify(v)}] = ${B9(h,`(() => {
158
+ ${r}
159
+ })()`)};`);else w.push([v,{args:["state","e"],body:r}])}else if(h.$src){if(!I.has(h.$src))I.set(h.$src,new Set);I.get(h.$src).add(P8(v,h)),F.push([v,`() => { return ${v}(state); }`])}else if(typeof h.body==="string"&&m6(h.body))F.push([v,`() => { ${h.body} }`]);else w.push([v,{args:X0??["state"],body:h.body}]);continue}if(V6(h))continue;if(tJ(h)){B.push([v,h.default]);continue}if(H6(h)){if(h.$prototype==="LocalStorage"||h.$prototype==="SessionStorage"){let X0=h.$prototype==="LocalStorage"?"localStorage":"sessionStorage",r=h.key??v,u=h.default??null;B.push([v,null]),N.push(xI(v,X0,r,u));continue}if(h.$prototype==="Request"){B.push([v,null]),N.push(C8(v,h));continue}if(h.$prototype==="Cookie"){B.push([v,null]),N.push(kI(v,h.name??v,h.default??null));continue}}B.push([v,h])}let E=qY($,$,W,q,H,z);for(let[v,h]of q)if(!L.some(([X0])=>X0===v))L.push([v,h]);for(let[v,h]of H)if(!w.some(([X0])=>X0===v))w.push([v,h]);let P=bI(B,F,L,w,N,I,z,Q,Z.rewriteSrc),R=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],C=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((v)=>T1(String(v))!==null)?`<script>${D4()}</script>
160
+ `:"",y=`<!DOCTYPE html>
160
161
  <html lang="en">
161
162
  <head>
162
163
  <meta charset="utf-8">
163
164
  <meta name="viewport" content="width=device-width, initial-scale=1">
164
- <title>${C0(X)}</title>
165
+ <title>${_0(X)}</title>
165
166
  ${C}<script type="importmap">
166
167
  {
167
168
  "imports": {
@@ -176,27 +177,24 @@ ${R.join(`,
176
177
  <body>
177
178
  ${E}
178
179
  </body>
179
- </html>`;return{files:[{content:P,path:G}],html:v}}function nW($,Z,X,Q,J,G){if(typeof $==="string")return C0($);if(typeof $==="number"||typeof $==="boolean")return C0(String($));if(!$||typeof $!=="object")return"";let W=V4(Z,X.scope,Z?.state??X.scopeDefs,Z?.$media??X.media),Y=$.tagName??"div",z=[],q=!1;if($.textContent!==void 0){let D=Z?.textContent??$.textContent;if(W6(D)){let j=N1(D.$ref);z.push(`:text-content="${j}"`),v7(Q,j,D.$ref),q=!0}else if(I0(D)){let j=`_t${G.t}`;G.t+=1,z.push(`:text-content="${j}"`),Q.set(j,`() => \`${D}\``),q=!0}}for(let[D,j]of Object.entries($)){if(!D.startsWith("on")||D==="observedAttributes")continue;let E=D.slice(2).toLowerCase();if(W6(j)){let P=N1(j.$ref);z.push(`@${E}="${P}"`),q=!0}else if(N6(j)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:["state","e"],body:r$(j.body,{eventParam:"e",statePrefix:"state"})}),q=!0}else if(I6(j)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:j.parameters?H1(j.parameters):j.arguments??["state","event"],body:j.body}),q=!0}else if(n$(j)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`);let R=F$(j.$expression,{eventParam:"e",statePrefix:"state"});J.set(P,{args:["state","e"],body:R}),q=!0}}if($.style&&typeof $.style==="object")for(let[D,j]of Object.entries($.style)){if(D.startsWith(":")||D.startsWith(".")||D.startsWith("&")||D.startsWith("[")||D.startsWith("@"))continue;if(j===null||typeof j==="object")continue;if(I0(j)){let E=`_s${G.s}`;G.s+=1,z.push(`:style.${E$(D)}="${E}"`),Q.set(E,`() => \`${j}\``),q=!0}}if($.attributes&&typeof $.attributes==="object"){for(let[D,j]of Object.entries($.attributes))if(W6(j)){let E=N1(j.$ref);z.push(`:attr.${D}="${E}"`),v7(Q,E,j.$ref),q=!0}else if(I0(j)){let E=`_t${G.t}`;G.t+=1,z.push(`:attr.${D}="${E}"`),Q.set(E,`() => \`${j}\``),q=!0}}for(let[D,j]of Object.entries($)){if(V1.has(D)||D.startsWith("on")||D.startsWith("$")||D==="tagName"||D==="id"||D==="className"||D==="style"||D==="children"||D==="textContent"||D==="innerHTML"||D==="attributes")continue;if(W6(j)){let E=N1(j.$ref);z.push(`:${E$(D)}="${E}"`),v7(Q,E,j.$ref),q=!0}else if(I0(j)){let E=`_t${G.t}`;G.t+=1,z.push(`:${E$(D)}="${E}"`),Q.set(E,`() => \`${j}\``),q=!0}}let H=U4($,W.scope),B=q?" data-bind":"",L=z.length>0?` ${z.join(" ")}`:"",M="",A=Z??$;if(A.textContent!==void 0&&!q){let D=i0(A.textContent,W.scope);M=D==null?"":C0(String(D))}else if(A.textContent!==void 0&&q){let D=i0(A.textContent,W.scope);M=D==null?"":C0(String(D))}else if(A.innerHTML)M=i0(A.innerHTML,W.scope)??A.innerHTML;else if(G$(A.children)){G.needsLit=!0;let D=`_list${G.l}`;G.l+=1;let j=A.children,E;if(W6(j.items))E=`state.${N1(j.items.$ref)}`;else E=JSON.stringify(j.items);let P=f7(j.map);Q.set(D,`() => (${E} ?? []).map((item, index) => html\`${P}\`)`),z.push(`:render="${D}"`),q=!0;let R=" data-bind",C=` ${z.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${R}${C}>`;return`<${Y}${H}${R}${C}></${Y}>`}else if(Array.isArray(A.children)&&A.children.some((D)=>G$(D))){G.needsLit=!0;let D=`_children${G.l}`;G.l+=1;let j=A.children.map((P)=>rW(P)).join(`
180
- `);Q.set(D,`() => html\`
181
- ${j}
182
- \``),z.push(`:render="${D}"`),q=!0;let E=` ${z.join(" ")}`;return`<${Y}${H} data-bind${E}></${Y}>`}else if(Array.isArray(A.children)){let D=Array.isArray(Z?.children)?Z.children:void 0;M=A.children.map((j,E)=>{let P=D?.[E]??j;return nW(j,P,W,Q,J,G)}).join(`
183
- `)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${B}${L}>`;return`<${Y}${H}${B}${L}>${M}</${Y}>`}function f7($){if(!$)return"";let Z=$.tagName??"div",X="";if($.id)X+=` id="${$.id}"`;if($.className)X+=` class="${d1($.className)}"`;if($.attributes&&typeof $.attributes==="object")for(let[G,W]of Object.entries($.attributes))X+=typeof W==="string"&&I0(W)?` ${G}="${d1(W)}"`:` ${G}="${C0(String(W))}"`;if($.style&&typeof $.style==="object"){let G=[];for(let[W,Y]of Object.entries($.style)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let z=E$(W);if(I0(String(Y)))G.push(`${z}: ${d1(String(Y))}`);else G.push(`${z}: ${Y}`)}if(G.length>0)X+=` style="${G.join("; ")}"`}for(let[G,W]of Object.entries($)){if(!G.startsWith("on")||G==="observedAttributes")continue;let Y=G.slice(2).toLowerCase();if(W6(W)){let z=N1(W.$ref);X+=` @${Y}=\${(e) => { state.$map = { item, index }; on.${z}(e); }}`}else if(N6(W)){let z=r$(W.body,{eventParam:"e",statePrefix:"state"});X+=` @${Y}=\${(e) => { state.$map = { item, index }; ${z} }}`}else if(W&&typeof W==="object"&&W.$prototype==="Function"){let z=d1(W.body);X+=` @${Y}=\${(e) => { ${z} }}`}else if(W&&typeof W==="object"&&"$expression"in W){let z=F$(W.$expression,{eventParam:"e",statePrefix:"state"});X+=` @${Y}=\${(e) => { state.$map = { item, index }; ${z}; }}`}}if($.contentEditable)X+=` contenteditable="${$.contentEditable}"`;let Q="";if($.textContent!==void 0){let G=String($.textContent);if(I0(G))Q=d1(G);else if(W6($.textContent))Q=`\${state.${N1($.textContent.$ref)}}`;else Q=C0(G)}else if($.innerHTML)Q=d1(String($.innerHTML));else if(G$($.children))Q=`
184
- ${aW($.children)}
185
- `;else if(Array.isArray($.children))Q=`
186
- ${$.children.map((G)=>rW(G)).join(`
180
+ </html>`;return{files:[{content:P,path:G}],html:y}}function qY($,Z,X,Q,J,G){if(typeof $==="string")return _0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(!$||typeof $!=="object")return"";let W=I4(Z,X.scope,Z?.state??X.scopeDefs,Z?.$media??X.media),Y=$.tagName??"div";W.preformatted=X.preformatted===!0||d6.has(Y);let z=[],q=!1;if($.textContent!==void 0){let I=Z?.textContent??$.textContent;if(o$(I)){let T=w6(I.$ref);z.push(`:text-content="${T}"`),r7(Q,T,I.$ref),q=!0}else if(w0(I)){let T=`_t${G.t}`;G.t+=1,z.push(`:text-content="${T}"`),Q.set(T,`() => \`${I}\``),q=!0}}for(let[I,T]of Object.entries($)){if(!I.startsWith("on")||I==="observedAttributes")continue;let E=I.slice(2).toLowerCase();if(o$(T)){let P=w6(T.$ref);z.push(`@${E}="${P}"`),q=!0}else if(D1(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:["state","e"],body:r$(T.body,{eventParam:"e",statePrefix:"state"})}),q=!0}else if(N1(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:T.parameters?l1(T.parameters):T.arguments??["state","event"],body:T.body}),q=!0}else if(n$(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`);let R=L$(T.$expression,{eventParam:"e",statePrefix:"state"});J.set(P,{args:["state","e"],body:R}),q=!0}}if($.style&&typeof $.style==="object")for(let[I,T]of Object.entries($.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(T===null||typeof T==="object")continue;if(w0(T)){let E=`_s${G.s}`;G.s+=1,z.push(`:style.${R$(I)}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}if($.attributes&&typeof $.attributes==="object"){for(let[I,T]of Object.entries($.attributes))if(o$(T)){let E=w6(T.$ref);z.push(`:attr.${I}="${E}"`),r7(Q,E,T.$ref),q=!0}else if(w0(T)){let E=`_t${G.t}`;G.t+=1,z.push(`:attr.${I}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}for(let[I,T]of Object.entries($)){if(B6.has(I)||I.startsWith("on")||I.startsWith("$")||I==="tagName"||I==="id"||I==="className"||I==="style"||I==="children"||I==="textContent"||I==="innerHTML"||I==="attributes")continue;if(o$(T)){let E=w6(T.$ref);z.push(`:${R$(I)}="${E}"`),r7(Q,E,T.$ref),q=!0}else if(w0(T)){let E=`_t${G.t}`;G.t+=1,z.push(`:${R$(I)}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}let H=L4($,W.scope),B=q?" data-bind":"",F=z.length>0?` ${z.join(" ")}`:"",L="",w=Z??$;if(w.textContent!==void 0&&!q){let I=r0(w.textContent,W.scope);L=I==null?"":_0(String(I))}else if(w.textContent!==void 0&&q){let I=r0(w.textContent,W.scope);L=I==null?"":_0(String(I))}else if(w.innerHTML)L=r0(w.innerHTML,W.scope)??w.innerHTML;else if(G$(w.children)){G.needsLit=!0;let I=`_list${G.l}`;G.l+=1;let T=w.children,E;if(o$(T.items))E=`state.${w6(T.items.$ref)}`;else E=JSON.stringify(T.items);let P=o7(T.map);Q.set(I,`() => (${E} ?? []).map((item, index) => html\`${P}\`)`),z.push(`:render="${I}"`),q=!0;let R=" data-bind",C=` ${z.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${R}${C}>`;return`<${Y}${H}${R}${C}></${Y}>`}else if(Array.isArray(w.children)&&w.children.some((I)=>G$(I))){G.needsLit=!0;let I=`_children${G.l}`;G.l+=1;let T=w.children.map((P)=>KY(P,W.preformatted)).join(F9(W.preformatted," "));Q.set(I,W.preformatted?`() => html\`${T}\``:`() => html\`
181
+ ${T}
182
+ \``),z.push(`:render="${I}"`),q=!0;let E=` ${z.join(" ")}`;return`<${Y}${H} data-bind${E}></${Y}>`}else if(Array.isArray(w.children)){let I=Array.isArray(Z?.children)?Z.children:void 0;L=w.children.map((T,E)=>{let P=I?.[E]??T;return qY(T,P,W,Q,J,G)}).join(F9(W.preformatted))}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${B}${F}>`;return`<${Y}${H}${B}${F}>${L}</${Y}>`}function o7($,Z=!1){if(!$)return"";let X=$.tagName??"div",Q=Z||d6.has(X),J="";if($.id)J+=` id="${$.id}"`;if($.className)J+=` class="${D6($.className)}"`;if($.$props&&typeof $.$props==="object")for(let[Y,z]of Object.entries($.$props))if(o$(z))J+=` .${Y}="\${${yI(z.$ref)}}"`;else if(typeof z==="string"&&w0(z))J+=` .${Y}="${D6(z)}"`;else J+=` .${Y}="\${${JSON.stringify(z)}}"`;if($.attributes&&typeof $.attributes==="object")for(let[Y,z]of Object.entries($.attributes))J+=typeof z==="string"&&w0(z)?` ${Y}="${D6(z)}"`:` ${Y}="${_0(String(z))}"`;if($.style&&typeof $.style==="object"){let Y=[];for(let[z,q]of Object.entries($.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;let H=R$(z);if(w0(String(q)))Y.push(`${H}: ${D6(String(q))}`);else Y.push(`${H}: ${q}`)}if(Y.length>0)J+=` style="${Y.join("; ")}"`}for(let[Y,z]of Object.entries($)){if(!Y.startsWith("on")||Y==="observedAttributes")continue;let q=Y.slice(2).toLowerCase();if(o$(z)){let H=w6(z.$ref);J+=` @${q}=\${(e) => { state.$map = { item, index }; on.${H}(e); }}`}else if(D1(z)){let H=r$(z.body,{eventParam:"e",statePrefix:"state"});J+=` @${q}=\${(e) => { state.$map = { item, index }; ${H} }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let H=D6(z.body);J+=` @${q}=\${(e) => { ${H} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let H=L$(z.$expression,{eventParam:"e",statePrefix:"state"});J+=` @${q}=\${(e) => { state.$map = { item, index }; ${H}; }}`}}if($.contentEditable)J+=` contenteditable="${$.contentEditable}"`;let G="";if($.textContent!==void 0){let Y=String($.textContent);if(w0(Y))G=D6(Y);else if(o$($.textContent))G=`\${state.${w6($.textContent.$ref)}}`;else G=_0(Y)}else if($.innerHTML)G=D6(String($.innerHTML));else if(G$($.children))G=`
183
+ ${UY($.children)}
184
+ `;else if(Array.isArray($.children)){let Y=$.children.map((z)=>KY(z,Q));G=Q?Y.join(""):`
185
+ ${Y.join(`
187
186
  `)}
188
- `;if(new Set(["input","br","hr","img","meta","link"]).has(Z))return`<${Z}${X}>`;return`<${Z}${X}>${Q}</${Z}>`}function rW($){if(typeof $==="string")return I0($)?d1($):C0($);if(typeof $==="number"||typeof $==="boolean")return C0(String($));if(G$($))return aW($);return f7($)}function aW($){let{items:Z}=$,X=W6(Z)?`state.${N1(Z.$ref)}`:JSON.stringify(Z??[]),Q=f7($.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function d1($){return $.replaceAll("$map.","")}function qI($,Z,X,Q,J,G,W,Y,z){let q=[],{needsLit:H}=W,B=Z.length>0;q.push("// Generated by @jxsuite/compiler — do not edit manually");let L=["reactive","effect"];if(B)L.push("computed");if(q.push(`import { ${L.join(", ")} } from '@vue/reactivity';`),H)q.push("import { html, render } from 'lit-html';");for(let[M,A]of G){let w=z?z(M):M;q.push(`import { ${[...A].join(", ")} } from '${w}';`)}q.push("","const state = reactive({");for(let[M,A]of $)q.push(` ${M}: ${JSON.stringify(A)},`);if(q.push("});",""),J.length>0){for(let M of J)q.push(M);q.push("")}if(Z.length>0){for(let[M,A]of Z)q.push(`state.${M} = computed(${A});`);q.push("")}if(X.length>0){q.push("const bind = {");for(let[M,A]of X)q.push(` ${M}: ${A},`);q.push("};")}else q.push("const bind = {};");if(q.push(""),Q.length>0){q.push("const on = {");for(let[M,A]of Q){let w=A.args??["state"],D=w.map((j)=>j==="state"?"state":"e").join(", ");q.push(` ${M}: (e) => { const fn = (${w.join(", ")}) => { ${A.body} }; fn(${D}); },`)}q.push("};")}else q.push("const on = {};");if(q.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),H)q.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else q.push(" if (parts[0] === 'style' && parts.length > 1) {");return q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),q.join(`
189
- `)}function UI($,Z){let{url:X}=Z,Q=Z.method??"GET",J=I0(X);if(Z.manual)return`// ${$}: manual Request — fetch triggered by user action`;let G=[`// ${$}: auto-fetch from ${J?"(dynamic URL)":X}`,"effect(() => {"];if(J)G.push(` const url = \`${X}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(X)};`);let W=[];if(Q!=="GET")W.push(`method: ${JSON.stringify(Q)}`);if(Z.headers)W.push(`headers: ${JSON.stringify(Z.headers)}`);if(Z.body){let z=typeof Z.body==="object"?JSON.stringify(JSON.stringify(Z.body)):JSON.stringify(Z.body);W.push(`body: ${z}`)}let Y=W.length>0?`, { ${W.join(", ")} }`:"";return G.push(` fetch(url${Y})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${$} = d; })`,` .catch(e => { state.${$} = { error: String(e) }; });`,"});"),G.join(`
190
- `)}function KI($,Z,X,Q){return[`// ${$}: ${Z} (key: "${X}")`,"try {",` const _s = ${Z}.getItem(${JSON.stringify(X)});`,` state.${$} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${$} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${$};`," try {",` if (v === null) ${Z}.removeItem(${JSON.stringify(X)});`,` else ${Z}.setItem(${JSON.stringify(X)}, JSON.stringify(v));`," } catch {}","});"].join(`
191
- `)}function HI($,Z,X){return[`// ${$}: Cookie (name: "${Z}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${Z}=([^;]*)"));`,` try { state.${$} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(X)}; }`,` catch { state.${$} = _m ? _m[1] : ${JSON.stringify(X)}; }`,"}"].join(`
192
- `)}function N1($){if($.startsWith("#/state/"))return $.slice(8).replaceAll("/","_");return $.replaceAll("/","_")}function v7($,Z,X){if($.has(Z))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");$.set(Z,`() => state.${J.join(".")}`)}else $.set(Z,`() => state.${X}`)}var h7=t(()=>{Y9();F1();D6()});var sW={};h6(sW,{compileClassJson:()=>VI});function VI($,Z={}){let X=$.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=BI($.extends),J=$.$defs,G=J?.fields??{},W=J?.constructor,Y=typeof W==="object"?W:void 0,z=J?.methods??{},q=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if($.$id)q.push(`// Source: ${$.$id}`);q.push("");let H=Q!=="Object"?` extends ${Q}`:"";q.push(`class ${X}${H} {`);for(let[B,L]of Object.entries(G)){if(L.scope!=="static")continue;let M=L.identifier??B,A=L.access==="private"?"#":"",w=L.initializer!==void 0?JSON.stringify(L.initializer):L.default!==void 0?JSON.stringify(L.default):"null";q.push(` static ${A}${M} = ${w};`)}for(let[B,L]of Object.entries(G)){if(L.scope==="static")continue;if(L.access!=="private")continue;let M=L.identifier??B;q.push(` #${M};`)}if(Object.keys(G).length>0)q.push("");if(q.push(" constructor(config = {}) {"),Y?.superCall||Q!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";q.push(` super(${B});`)}for(let[B,L]of Object.entries(G)){if(L.scope==="static")continue;let M=L.identifier??B,A=L.access==="private"?"#":"",w=L.initializer!==void 0?JSON.stringify(L.initializer):L.default!==void 0?JSON.stringify(L.default):"null";q.push(` this.${A}${M} = config.${M} !== undefined ? config.${M} : ${w};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let L of B)q.push(` ${L}`)}q.push(" }");for(let[B,L]of Object.entries(z)){let M=L.identifier??B,A=L.scope==="static",D=L.access==="private"?"#":"",j=A?"static ":"",E=L.returnType?.$ref?.includes("Promise")||LI(L)?"async ":"",P=oW(L.parameters??[]),R=FI(L.body);if(q.push(""),L.role==="accessor"){if(L.getter)q.push(` ${j}get ${D}${M}() {`,` ${L.getter.body}`," }");if(L.setter){let C=oW(L.setter.parameters??[]);q.push(` ${j}set ${D}${M}(${C}) {`,` ${L.setter.body}`," }")}}else{q.push(` ${j}${E}${D}${M}(${P}) {`);for(let C of R)q.push(` ${C}`);q.push(" }")}}return q.push("}","",`export { ${X} };`,`export default ${X};`,""),q.join(`
193
- `)}function BI($){if(!$)return"Object";if(typeof $==="string")return $;if($.$ref){let Z=$.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return Z?Z[1]:"Object"}return"Object"}function oW($){return $.map((Z)=>{if(Z.$ref)return Z.$ref.split("/").pop();let X=Z.identifier??Z.name;return typeof X==="string"?X:"arg"}).join(", ")}function FI($){if(!$)return[""];return Array.isArray($)?$:[$]}function LI($){return(Array.isArray($.body)?$.body.join(`
194
- `):$.body??"").includes("await ")}import{readFileSync as MI}from"node:fs";async function u7($,Z={}){let{title:X="Jx App",reactivitySrc:Q=K4,litHtmlSrc:J=H4,projectStyle:G=null}=Z,W;if(typeof $==="string"){let Y=MI($,"utf8");if($.endsWith(".json"))W=A1(Y,$);else{let{extname:z}=await import("node:path"),q=z($).toLowerCase(),H=Z.formats?.byExtension?.(q,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (i6(),b7));throw B($,q)}W=await H.call("parse",Y)}}else W=$;if(uJ(W)){let{compileClassJson:Y}=await Promise.resolve().then(() => sW),z=Y(W,Z),q=typeof $==="string"?$.replace(/\.class\.json$/,".js"):`${W.title}.js`;return{files:[{content:z,path:q}],html:""}}if(!I5(W))return cW(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X});if(W.tagName&&W.tagName.includes("-")){let{tagName:Y}=W,z=D5(Y),H={content:M9(W,z,[],Z.rewriteSrc),path:`${Y}.js`,tagName:Y},B=L4(W,W.$media??{}),L=`<!DOCTYPE html>
187
+ `}if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${J}>`;return`<${X}${J}>${G}</${X}>`}function KY($,Z=!1){if(typeof $==="string")return w0($)?D6($):_0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(G$($))return UY($);return o7($,Z)}function UY($){let{items:Z}=$,X=o$(Z)?`state.${w6(Z.$ref)}`:JSON.stringify(Z??[]),Q=o7($.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function D6($){return $.replaceAll("$map.","")}function bI($,Z,X,Q,J,G,W,Y,z){let q=[],{needsLit:H}=W,B=Z.length>0;q.push("// Generated by @jxsuite/compiler — do not edit manually");let F=["reactive","effect"];if(B)F.push("computed");if(q.push(`import { ${F.join(", ")} } from '@vue/reactivity';`),H)q.push("import { html, render } from 'lit-html';");for(let[L,w]of G){let N=z?z(L):L;q.push(`import { ${[...w].join(", ")} } from '${N}';`)}q.push("","const state = reactive({");for(let[L,w]of $)q.push(` ${L}: ${JSON.stringify(w)},`);if(q.push("});",""),J.length>0){for(let L of J)q.push(L);q.push("")}if(Z.length>0){for(let[L,w]of Z)q.push(`state.${L} = computed(${w});`);q.push("")}if(X.length>0){q.push("const bind = {");for(let[L,w]of X)q.push(` ${L}: ${w},`);q.push("};")}else q.push("const bind = {};");if(q.push(""),Q.length>0){q.push("const on = {");for(let[L,w]of Q){let N=w.args??["state"],I=N.map((T)=>T==="state"?"state":"e").join(", ");q.push(` ${L}: (e) => { const fn = (${N.join(", ")}) => { ${w.body} }; fn(${I}); },`)}q.push("};")}else q.push("const on = {};");if(q.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),H)q.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else q.push(" if (parts[0] === 'style' && parts.length > 1) {");return q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),q.join(`
188
+ `)}function xI($,Z,X,Q){return[`// ${$}: ${Z} (key: "${X}")`,"try {",` const _s = ${Z}.getItem(${JSON.stringify(X)});`,` state.${$} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${$} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${$};`," try {",` if (v === null) ${Z}.removeItem(${JSON.stringify(X)});`,` else ${Z}.setItem(${JSON.stringify(X)}, JSON.stringify(v));`," } catch {}","});"].join(`
189
+ `)}function kI($,Z,X){return[`// ${$}: Cookie (name: "${Z}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${Z}=([^;]*)"));`,` try { state.${$} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(X)}; }`,` catch { state.${$} = _m ? _m[1] : ${JSON.stringify(X)}; }`,"}"].join(`
190
+ `)}function yI($){if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");if($.startsWith("#/state/"))return`state.${$.slice(8).replaceAll("/",".")}`;return`state.${$.replaceAll("/",".")}`}function w6($){if($.startsWith("#/state/"))return $.slice(8).replaceAll("/","_");return $.replaceAll("/","_")}function r7($,Z,X){if($.has(Z))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");$.set(Z,`() => state.${J.join(".")}`)}else $.set(Z,`() => state.${X}`)}var s7=s(()=>{V9();L6();w1()});var VY={};m1(VY,{compileClassJson:()=>vI});function vI($,Z={}){let X=$.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=gI($.extends),J=$.$defs,G=J?.fields??{},W=J?.constructor,Y=typeof W==="object"?W:void 0,z=J?.methods??{},q=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if($.$id)q.push(`// Source: ${$.$id}`);q.push("");let H=Q!=="Object"?` extends ${Q}`:"";q.push(`class ${X}${H} {`);for(let[B,F]of Object.entries(G)){if(F.scope!=="static")continue;let L=F.identifier??B,w=F.access==="private"?"#":"",N=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";q.push(` static ${w}${L} = ${N};`)}for(let[B,F]of Object.entries(G)){if(F.scope==="static")continue;if(F.access!=="private")continue;let L=F.identifier??B;q.push(` #${L};`)}if(Object.keys(G).length>0)q.push("");if(q.push(" constructor(config = {}) {"),Y?.superCall||Q!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";q.push(` super(${B});`)}for(let[B,F]of Object.entries(G)){if(F.scope==="static")continue;let L=F.identifier??B,w=F.access==="private"?"#":"",N=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";q.push(` this.${w}${L} = config.${L} !== undefined ? config.${L} : ${N};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let F of B)q.push(` ${F}`)}q.push(" }");for(let[B,F]of Object.entries(z)){let L=F.identifier??B,w=F.scope==="static",I=F.access==="private"?"#":"",T=w?"static ":"",E=F.returnType?.$ref?.includes("Promise")||hI(F)?"async ":"",P=HY(F.parameters??[]),R=fI(F.body);if(q.push(""),F.role==="accessor"){if(F.getter)q.push(` ${T}get ${I}${L}() {`,` ${F.getter.body}`," }");if(F.setter){let C=HY(F.setter.parameters??[]);q.push(` ${T}set ${I}${L}(${C}) {`,` ${F.setter.body}`," }")}}else{q.push(` ${T}${E}${I}${L}(${P}) {`);for(let C of R)q.push(` ${C}`);q.push(" }")}}return q.push("}","",`export { ${X} };`,`export default ${X};`,""),q.join(`
191
+ `)}function gI($){if(!$)return"Object";if(typeof $==="string")return $;if($.$ref){let Z=$.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return Z?Z[1]:"Object"}return"Object"}function HY($){return $.map((Z)=>{if(Z.$ref)return Z.$ref.split("/").pop();let X=Z.identifier??Z.name;return typeof X==="string"?X:"arg"}).join(", ")}function fI($){if(!$)return[""];return Array.isArray($)?$:[$]}function hI($){return(Array.isArray($.body)?$.body.join(`
192
+ `):$.body??"").includes("await ")}import{readFileSync as uI}from"node:fs";async function t7($,Z={}){let{title:X="Jx App",reactivitySrc:Q=M4,litHtmlSrc:J=A4,projectStyle:G=null}=Z,W;if(typeof $==="string"){let Y=uI($,"utf8");if($.endsWith(".json"))W=I6(Y,$);else{let{extname:z}=await import("node:path"),q=z($).toLowerCase(),H=Z.formats?.byExtension?.(q,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (r1(),i7));throw B($,q)}W=await H.call("parse",Y)}}else W=$;if($G(W)){let{compileClassJson:Y}=await Promise.resolve().then(() => VY),z=Y(W,Z),q=typeof $==="string"?$.replace(/\.class\.json$/,".js"):`${W.title}.js`;return{files:[{content:z,path:q}],html:""}}if(!S8(W))return WY(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X});if(W.tagName&&W.tagName.includes("-")){let{tagName:Y}=W,z=b8(Y),H={content:j9(W,z,[],Z.rewriteSrc),path:`${Y}.js`,tagName:Y},B=w4(W,W.$media??{}),F=`<!DOCTYPE html>
195
193
  <html lang="en">
196
194
  <head>
197
195
  <meta charset="utf-8">
198
196
  <meta name="viewport" content="width=device-width, initial-scale=1">
199
- <title>${C0(X)}</title>
197
+ <title>${_0(X)}</title>
200
198
  <script type="importmap">
201
199
  {
202
200
  "imports": {
@@ -211,22 +209,22 @@ ${R.join(`,
211
209
  <${Y}></${Y}>
212
210
  <script type="module" src="./${Y}.js"></script>
213
211
  </body>
214
- </html>`;return{files:[H],html:L}}return g7(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X})}async function Dm($,Z){let[X,Q]=await Promise.all([u7($),L9($)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:W,join:Y}=await import("node:path");if(Z){J(Z,X.html,"utf8"),console.error(`Written to ${Z}`);let z=W(Z);for(let q of X.files){let H=Y(z,q.path);G(W(H),{recursive:!0}),J(H,q.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&Z){let z=Z.replace(/(\.[^.]+)?$/,"-server.js");J(z,Q,"utf8"),console.error(`Server handler written to ${z}`)}}var tW=t(()=>{F1();P7();A9();iW();h7();D6();I1();F1();P7();A9();h7()});function eW($,Z){if(Z.length===0)return{content:$??"",patched:!1};let X={};if($)try{X=JSON.parse($)}catch{return{content:$,patched:!1}}for(let Q of Z)$Y(X,Q);return{content:`${JSON.stringify(X,null,"\t")}
215
- `,patched:!0}}function $Y($,Z){for(let[X,Q]of Object.entries(Z)){let J=$[X];if(Array.isArray(Q)){$[X]=AI(Array.isArray(J)?J:[],Q);continue}if(p5(Q)){if(p5(J))$Y(J,Q);else if(J===void 0)$[X]=structuredClone(Q);continue}if(J===void 0)$[X]=Q}}function AI($,Z){let X=[...$];for(let Q of Z){if(!p5(Q)||typeof Q.binding!=="string"){if(!X.some((W)=>JSON.stringify(W)===JSON.stringify(Q)))X.push(structuredClone(Q));continue}let J=X.findIndex((G)=>p5(G)&&G.binding===Q.binding);if(J===-1)X.push(structuredClone(Q));else X[J]={...X[J],...Q}}return X}function p5($){return $!==null&&typeof $==="object"&&!Array.isArray($)}var ZY=()=>{};import{existsSync as II,readFileSync as NI}from"node:fs";import{resolve as XY}from"node:path";function D1($){let Z=XY($,"project.json");if(!II(Z))throw Error(`project.json not found in ${$}`);let X;try{X=SW(NI(Z,"utf8"),Z)}catch(W){throw Error(`Invalid project.json: ${M1(W)}`,{cause:W})}let Q={...i5,...X,build:{...i5.build,...X.build},defaults:{...i5.defaults,...X.defaults},images:{...i5.images,...X.images}};if(X.$head)Q.$head=X.$head;if(X.$media)Q.$media=X.$media;if(X.style)Q.style=X.style;if(X.state)Q.state=X.state;if(X.redirects)Q.redirects=X.redirects;if(X.imports)Q.imports=X.imports;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(Q.build.adapter==="static")delete Q.build.adapter;if(Q.build.adapter&&!J.includes(Q.build.adapter))throw Error(`Unknown build adapter "${Q.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(Q.images.service))throw Error(`Unknown images.service "${Q.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:Q,configPath:Z,projectRoot:XY($)}}var i5;var I9=t(()=>{I1();i5={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});var WY={};h6(WY,{readDevVars:()=>GY,dbPush:()=>wI});import{existsSync as m7,readFileSync as QY,writeFileSync as DI}from"node:fs";import{resolve as JY}from"node:path";async function wI($,Z={}){let{dryRun:X=!1,connection:Q}=Z,{config:J}=D1($),G=await E6($,J),W=J.connections??{},Y=J.data??{},z=Object.keys(W).filter((A)=>!Q||A===Q);if(Q&&z.length===0)throw Error(`Unknown connection "${Q}" (no such connections entry in project.json)`);if(z.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 q={...process.env,...GY($),JX_PROJECT_ROOT:$},H=[],B=[];for(let A of z){let w={...W[A],$name:A},D=String(w.provider??""),j=TI(G.connectors(),D);if(!j)throw Error(`Connection "${A}" names provider "${D}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let E={};for(let[R,C]of Object.entries(Y))if(C.connection===A)E[R]=C;let P=await j.call("deploySchema",E,w,{dryRun:X,env:q});if(H.push({applied:P.applied??!X,connection:A,provider:D,statements:P.statements??[],tables:Object.keys(E),warnings:P.warnings??[]}),j.capabilities.bindings){let R=await j.call("bindings",w);if(R&&Object.keys(R).length>0)B.push(R)}}let L=JY($,"wrangler.jsonc"),M=!1;if(!X&&B.length>0&&m7(L)){let A=QY(L,"utf8"),{content:w,patched:D}=eW(A,B);if(D&&w!==A)DI(L,w,"utf8"),M=!0}return{bindingsPatched:M,results:H,wranglerPath:m7(L)?L:null}}function TI($,Z){return $.find((X)=>X.connector?.provider===Z)}function GY($){let Z=JY($,".dev.vars");if(!m7(Z))return{};let X={};for(let Q of QY(Z,"utf8").split(`
216
- `)){let J=Q.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let W=J.slice(0,G).trim(),Y=J.slice(G+1).trim();if(Y.startsWith('"')&&Y.endsWith('"')||Y.startsWith("'")&&Y.endsWith("'"))Y=Y.slice(1,-1);if(W!=="")X[W]=Y}return X}var YY=t(()=>{ZY();i6();I9()});function l1($){return $.startsWith("npm:")}function qY($){let Z=$;if(l1(Z))Z=Z.slice(4);return Z=Z.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`/assets/${Z}.js`}var zY="npm:";var O9=b((fm,kY)=>{var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",i7=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,OI=Object.getOwnPropertyNames,EI=Object.prototype.hasOwnProperty,RI=($,Z)=>{for(var X in Z)i7($,X,{get:Z[X],enumerable:!0})},PI=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of OI(Z))if(!EI.call($,J)&&J!==X)i7($,J,{get:()=>Z[J],enumerable:!(Q=jI(Z,J))||Q.enumerable})}return $},CI=($)=>PI(i7({},"__esModule",{value:!0}),$),T9={};RI(T9,{analyzeMetafile:()=>WN,analyzeMetafileSync:()=>UN,build:()=>XN,buildSync:()=>YN,context:()=>QN,default:()=>BN,formatMessages:()=>GN,formatMessagesSync:()=>qN,initialize:()=>HN,stop:()=>KN,transform:()=>JN,transformSync:()=>zN,version:()=>ZN});kY.exports=CI(T9);function UY($){let Z=(Q)=>{if(Q===null)X.write8(0);else if(typeof Q==="boolean")X.write8(1),X.write8(+Q);else if(typeof Q==="number")X.write8(2),X.write32(Q|0);else if(typeof Q==="string")X.write8(3),X.write(z6(Q));else if(Q instanceof Uint8Array)X.write8(4),X.write(Q);else if(Q instanceof Array){X.write8(5),X.write32(Q.length);for(let J of Q)Z(J)}else{let J=Object.keys(Q);X.write8(6),X.write32(J.length);for(let G of J)X.write(z6(G)),Z(Q[G])}},X=new NY;return X.write32(0),X.write32($.id<<1|+!$.isRequest),Z($.value),l7(X.buf,X.len-4,0),X.buf.subarray(0,X.len)}function SI($){let Z=()=>{switch(X.read8()){case 0:return null;case 1:return!!X.read8();case 2:return X.read32();case 3:return r1(X.read());case 4:return X.read();case 5:{let W=X.read32(),Y=[];for(let z=0;z<W;z++)Y.push(Z());return Y}case 6:{let W=X.read32(),Y={};for(let z=0;z<W;z++)Y[r1(X.read())]=Z();return Y}default:throw Error("Invalid packet")}},X=new NY($),Q=X.read32(),J=(Q&1)===0;Q>>>=1;let G=Z();if(X.ptr!==$.length)throw Error("Invalid packet");return{id:Q,isRequest:J,value:G}}var NY=class{constructor($=new Uint8Array(1024)){this.buf=$,this.len=0,this.ptr=0}_write($){if(this.len+$>this.buf.length){let Z=new Uint8Array((this.len+$)*2);Z.set(this.buf),this.buf=Z}return this.len+=$,this.len-$}write8($){let Z=this._write(1);this.buf[Z]=$}write32($){let Z=this._write(4);l7(this.buf,$,Z)}write($){let Z=this._write(4+$.length);l7(this.buf,$.length,Z),this.buf.set($,Z+4)}_read($){if(this.ptr+$>this.buf.length)throw Error("Invalid packet");return this.ptr+=$,this.ptr-$}read8(){return this.buf[this._read(1)]}read32(){return DY(this.buf,this._read(4))}read(){let $=this.read32(),Z=new Uint8Array($),X=this._read(Z.length);return Z.set(this.buf.subarray(X,X+$)),Z}},z6,r1,d7;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let $=new TextEncoder,Z=new TextDecoder;z6=(X)=>$.encode(X),r1=(X)=>Z.decode(X),d7='new TextEncoder().encode("")'}else if(typeof Buffer<"u")z6=($)=>Buffer.from($),r1=($)=>{let{buffer:Z,byteOffset:X,byteLength:Q}=$;return Buffer.from(Z,X,Q).toString()},d7='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(z6("")instanceof Uint8Array))throw Error(`Invariant violation: "${d7} instanceof Uint8Array" is incorrectly false
212
+ </html>`;return{files:[H],html:F}}return a7(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X})}async function Wd($,Z){let[X,Q]=await Promise.all([t7($),T9($)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:W,join:Y}=await import("node:path");if(Z){J(Z,X.html,"utf8"),console.error(`Written to ${Z}`);let z=W(Z);for(let q of X.files){let H=Y(z,q.path);G(W(H),{recursive:!0}),J(H,q.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&Z){let z=Z.replace(/(\.[^.]+)?$/,"-server.js");J(z,Q,"utf8"),console.error(`Server handler written to ${z}`)}}var BY=s(()=>{L6();m7();O9();zY();s7();w1();N6();L6();m7();O9();s7()});function FY($,Z){if(Z.length===0)return{content:$??"",patched:!1};let X={};if($)try{X=JSON.parse($)}catch{return{content:$,patched:!1}}for(let Q of Z)LY(X,Q);return{content:`${JSON.stringify(X,null,"\t")}
213
+ `,patched:!0}}function LY($,Z){for(let[X,Q]of Object.entries(Z)){let J=$[X];if(Array.isArray(Q)){$[X]=mI(Array.isArray(J)?J:[],Q);continue}if(X5(Q)){if(X5(J))LY(J,Q);else if(J===void 0)$[X]=structuredClone(Q);continue}if(J===void 0)$[X]=Q}}function mI($,Z){let X=[...$];for(let Q of Z){if(!X5(Q)||typeof Q.binding!=="string"){if(!X.some((W)=>JSON.stringify(W)===JSON.stringify(Q)))X.push(structuredClone(Q));continue}let J=X.findIndex((G)=>X5(G)&&G.binding===Q.binding);if(J===-1)X.push(structuredClone(Q));else X[J]={...X[J],...Q}}return X}function X5($){return $!==null&&typeof $==="object"&&!Array.isArray($)}var MY=()=>{};import{existsSync as dI,readFileSync as lI}from"node:fs";import{resolve as AY}from"node:path";function T6($){let Z=AY($,"project.json");if(!dI(Z))throw Error(`project.json not found in ${$}`);let X;try{X=pW(lI(Z,"utf8"),Z)}catch(W){throw Error(`Invalid project.json: ${A6(W)}`,{cause:W})}let Q={...Q5,...X,build:{...Q5.build,...X.build},defaults:{...Q5.defaults,...X.defaults},images:{...Q5.images,...X.images}};if(X.$head)Q.$head=X.$head;if(X.$media)Q.$media=X.$media;if(X.style)Q.style=X.style;if(X.state)Q.state=X.state;if(X.redirects)Q.redirects=X.redirects;if(X.imports)Q.imports=X.imports;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(Q.build.adapter==="static")delete Q.build.adapter;if(Q.build.adapter&&!J.includes(Q.build.adapter))throw Error(`Unknown build adapter "${Q.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(Q.images.service))throw Error(`Unknown images.service "${Q.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:Q,configPath:Z,projectRoot:AY($)}}var Q5;var E9=s(()=>{N6();Q5={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});var wY={};m1(wY,{readDevVars:()=>DY,dbPush:()=>pI});import{existsSync as e7,readFileSync as IY,writeFileSync as cI}from"node:fs";import{resolve as NY}from"node:path";async function pI($,Z={}){let{dryRun:X=!1,connection:Q}=Z,{config:J}=T6($),G=await R1($,J),W=J.connections??{},Y=J.data??{},z=Object.keys(W).filter((w)=>!Q||w===Q);if(Q&&z.length===0)throw Error(`Unknown connection "${Q}" (no such connections entry in project.json)`);if(z.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 q={...process.env,...DY($),JX_PROJECT_ROOT:$},H=[],B=[];for(let w of z){let N={...W[w],$name:w},I=String(N.provider??""),T=iI(G.connectors(),I);if(!T)throw Error(`Connection "${w}" names provider "${I}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let E={};for(let[R,C]of Object.entries(Y))if(C.connection===w)E[R]=C;let P=await T.call("deploySchema",E,N,{dryRun:X,env:q});if(H.push({applied:P.applied??!X,connection:w,provider:I,statements:P.statements??[],tables:Object.keys(E),warnings:P.warnings??[]}),T.capabilities.bindings){let R=await T.call("bindings",N);if(R&&Object.keys(R).length>0)B.push(R)}}let F=NY($,"wrangler.jsonc"),L=!1;if(!X&&B.length>0&&e7(F)){let w=IY(F,"utf8"),{content:N,patched:I}=FY(w,B);if(I&&N!==w)cI(F,N,"utf8"),L=!0}return{bindingsPatched:L,results:H,wranglerPath:e7(F)?F:null}}function iI($,Z){return $.find((X)=>X.connector?.provider===Z)}function DY($){let Z=NY($,".dev.vars");if(!e7(Z))return{};let X={};for(let Q of IY(Z,"utf8").split(`
214
+ `)){let J=Q.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let W=J.slice(0,G).trim(),Y=J.slice(G+1).trim();if(Y.startsWith('"')&&Y.endsWith('"')||Y.startsWith("'")&&Y.endsWith("'"))Y=Y.slice(1,-1);if(W!=="")X[W]=Y}return X}var TY=s(()=>{MY();r1();E9()});function n6($){return $.startsWith("npm:")}function OY($){let Z=$;if(n6(Z))Z=Z.slice(4);return Z=Z.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`/assets/${Z}.js`}function EY($){let Z=$.replaceAll("\\","/");return Z.length>1&&Z.endsWith("/")?Z.slice(0,-1):Z}function J5($){let Z=EY($);return Z.startsWith("/")?Z:`/${Z}`}function nI($,Z){return[...$].toSorted((X,Q)=>Q[Z].length-X[Z].length)}function G5($,Z){let X=Z.split("#")[0].split("?")[0];if(!X.startsWith("/"))return null;let Q;try{Q=decodeURIComponent(X)}catch{return null}if(/%2e|%2f/i.test(Q))return null;for(let J of nI($,"urlPrefix")){let G=J5(J.urlPrefix);if(!Q.startsWith(`${G}/`))continue;let Y=Q.slice(G.length+1).split("/");if(Y.some((z)=>z===""||z==="."||z===".."))return null;return`${EY(J.dir)}/${Y.join("/")}`}return null}function RY($,Z){let X=new Set;for(let Q of Z){let J=J5(Q.urlPrefix),G=new RegExp(`${J.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${rI}]+`,"g");for(let W of $.matchAll(G)){let Y=W[0].split("#")[0].split("?")[0];if(!Y.endsWith("/"))X.add(Y)}}return[...X].filter(Boolean)}var jY="npm:",rI;var R9=s(()=>{rI=String.raw`"'\s<>()\\`});var x9=b((Td,tY)=>{var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",JX=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,oI=Object.getOwnPropertyNames,sI=Object.prototype.hasOwnProperty,tI=($,Z)=>{for(var X in Z)JX($,X,{get:Z[X],enumerable:!0})},eI=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of oI(Z))if(!sI.call($,J)&&J!==X)JX($,J,{get:()=>Z[J],enumerable:!(Q=aI(Z,J))||Q.enumerable})}return $},$N=($)=>eI(JX({},"__esModule",{value:!0}),$),_9={};tI(_9,{analyzeMetafile:()=>_N,analyzeMetafileSync:()=>yN,build:()=>RN,buildSync:()=>bN,context:()=>PN,default:()=>hN,formatMessages:()=>SN,formatMessagesSync:()=>kN,initialize:()=>gN,stop:()=>vN,transform:()=>CN,transformSync:()=>xN,version:()=>EN});tY.exports=$N(_9);function PY($){let Z=(Q)=>{if(Q===null)X.write8(0);else if(typeof Q==="boolean")X.write8(1),X.write8(+Q);else if(typeof Q==="number")X.write8(2),X.write32(Q|0);else if(typeof Q==="string")X.write8(3),X.write(q1(Q));else if(Q instanceof Uint8Array)X.write8(4),X.write(Q);else if(Q instanceof Array){X.write8(5),X.write32(Q.length);for(let J of Q)Z(J)}else{let J=Object.keys(Q);X.write8(6),X.write32(J.length);for(let G of J)X.write(q1(G)),Z(Q[G])}},X=new fY;return X.write32(0),X.write32($.id<<1|+!$.isRequest),Z($.value),ZX(X.buf,X.len-4,0),X.buf.subarray(0,X.len)}function ZN($){let Z=()=>{switch(X.read8()){case 0:return null;case 1:return!!X.read8();case 2:return X.read32();case 3:return t6(X.read());case 4:return X.read();case 5:{let W=X.read32(),Y=[];for(let z=0;z<W;z++)Y.push(Z());return Y}case 6:{let W=X.read32(),Y={};for(let z=0;z<W;z++)Y[t6(X.read())]=Z();return Y}default:throw Error("Invalid packet")}},X=new fY($),Q=X.read32(),J=(Q&1)===0;Q>>>=1;let G=Z();if(X.ptr!==$.length)throw Error("Invalid packet");return{id:Q,isRequest:J,value:G}}var fY=class{constructor($=new Uint8Array(1024)){this.buf=$,this.len=0,this.ptr=0}_write($){if(this.len+$>this.buf.length){let Z=new Uint8Array((this.len+$)*2);Z.set(this.buf),this.buf=Z}return this.len+=$,this.len-$}write8($){let Z=this._write(1);this.buf[Z]=$}write32($){let Z=this._write(4);ZX(this.buf,$,Z)}write($){let Z=this._write(4+$.length);ZX(this.buf,$.length,Z),this.buf.set($,Z+4)}_read($){if(this.ptr+$>this.buf.length)throw Error("Invalid packet");return this.ptr+=$,this.ptr-$}read8(){return this.buf[this._read(1)]}read32(){return hY(this.buf,this._read(4))}read(){let $=this.read32(),Z=new Uint8Array($),X=this._read(Z.length);return Z.set(this.buf.subarray(X,X+$)),Z}},q1,t6,$X;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let $=new TextEncoder,Z=new TextDecoder;q1=(X)=>$.encode(X),t6=(X)=>Z.decode(X),$X='new TextEncoder().encode("")'}else if(typeof Buffer<"u")q1=($)=>Buffer.from($),t6=($)=>{let{buffer:Z,byteOffset:X,byteLength:Q}=$;return Buffer.from(Z,X,Q).toString()},$X='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(q1("")instanceof Uint8Array))throw Error(`Invariant violation: "${$X} instanceof Uint8Array" is incorrectly false
217
215
 
218
216
  This indicates that your JavaScript environment is broken. You cannot use
219
217
  esbuild in this environment because esbuild relies on this invariant. This
220
218
  is not a problem with esbuild. You need to fix your environment instead.
221
- `);function DY($,Z){return($[Z++]|$[Z++]<<8|$[Z++]<<16|$[Z++]<<24)>>>0}function l7($,Z,X){$[X++]=Z,$[X++]=Z>>8,$[X++]=Z>>16,$[X++]=Z>>24}var r6=String.fromCharCode;function t$($,Z,X){let Q=$[Z],J=1,G=0;for(let W=0;W<Z;W++)if($[W]===10)J++,G=0;else G++;throw SyntaxError(X?X:Z===$.length?"Unexpected end of input while parsing JSON":Q>=32&&Q<=126?`Unexpected character ${r6(Q)} in JSON at position ${Z} (line ${J}, column ${G})`:`Unexpected byte 0x${Q.toString(16)} in JSON at position ${Z} (line ${J}, column ${G})`)}function _I($){if(!($ instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let Z=[],X=[],Q=[],J=$.length,G=null,W=0,Y,z=0;while(z<J){let q=$[z++];if(q<=32)continue;let H;if(W===2&&G===null&&q!==34&&q!==125)t$($,--z);switch(q){case 116:{if($[z++]!==114||$[z++]!==117||$[z++]!==101)t$($,--z);H=!0;break}case 102:{if($[z++]!==97||$[z++]!==108||$[z++]!==115||$[z++]!==101)t$($,--z);H=!1;break}case 110:{if($[z++]!==117||$[z++]!==108||$[z++]!==108)t$($,--z);H=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let B=z;H=r6(q),q=$[z];while(!0){switch(q){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{H+=r6(q),q=$[++z];continue}}break}if(H=+H,isNaN(H))t$($,--B,"Invalid number");break}case 34:{H="";while(!0){if(z>=J)t$($,J);if(q=$[z++],q===34)break;else if(q===92)switch($[z++]){case 34:H+='"';break;case 47:H+="/";break;case 92:H+="\\";break;case 98:H+="\b";break;case 102:H+="\f";break;case 110:H+=`
222
- `;break;case 114:H+="\r";break;case 116:H+="\t";break;case 117:{let B=0;for(let L=0;L<4;L++)if(q=$[z++],B<<=4,q>=48&&q<=57)B|=q-48;else if(q>=97&&q<=102)B|=q+-87;else if(q>=65&&q<=70)B|=q+-55;else t$($,--z);H+=r6(B);break}default:t$($,--z);break}else if(q<=127)H+=r6(q);else if((q&224)===192)H+=r6((q&31)<<6|$[z++]&63);else if((q&240)===224)H+=r6((q&15)<<12|($[z++]&63)<<6|$[z++]&63);else if((q&248)==240){let B=(q&7)<<18|($[z++]&63)<<12|($[z++]&63)<<6|$[z++]&63;if(B>65535)B-=65536,H+=r6(B>>10&1023|55296),B=56320|B&1023;H+=r6(B)}}H[0];break}case 91:{H=[],Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=1;continue}case 123:{H={},Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=2;continue}case 93:{if(W!==1)t$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}case 125:{if(W!==2)t$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}default:t$($,--z)}q=$[z];while(q<=32)q=$[++z];switch(W){case 0:{if(z===J)return H;break}case 1:{if(Y.push(H),q===44){z++;continue}if(q===93)continue;break}case 2:{if(G===null){if(G=H,q===58){z++;continue}}else{if(Y[G]=H,G=null,q===44){z++;continue}if(q===125)continue}break}}break}t$($,z)}var s0=JSON.stringify,KY="warning",HY="silent";function T4($,Z){let X=[];for(let Q of $){if(C$(Q,Z),Q.indexOf(",")>=0)throw Error(`Invalid ${Z}: ${Q}`);X.push(Q)}return X.join(",")}var a5=()=>null,u0=($)=>typeof $==="boolean"?null:"a boolean",H0=($)=>typeof $==="string"?null:"a string",o5=($)=>$ instanceof RegExp?null:"a RegExp object",p1=($)=>typeof $==="number"&&$===($|0)?null:"an integer",xI=($)=>typeof $==="number"&&$===($|0)&&$>=0&&$<=65535?null:"a valid port number",wY=($)=>typeof $==="function"?null:"a function",a6=($)=>Array.isArray($)?null:"an array",S$=($)=>Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"an array of strings",p$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)?null:"an object",bI=($)=>typeof $==="object"&&$!==null?null:"an array or an object",kI=($)=>$ instanceof WebAssembly.Module?null:"a WebAssembly.Module",VY=($)=>typeof $==="object"&&!Array.isArray($)?null:"an object or null",TY=($)=>typeof $==="string"||typeof $==="boolean"?null:"a string or a boolean",yI=($)=>typeof $==="string"||typeof $==="object"&&$!==null&&!Array.isArray($)?null:"a string or an object",jY=($)=>typeof $==="string"||Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"a string or an array of strings",OY=($)=>typeof $==="string"||$ instanceof Uint8Array?null:"a string or a Uint8Array",vI=($)=>typeof $==="string"||$ instanceof URL?null:"a string or a URL";function k($,Z,X,Q){let J=$[X];if(Z[X+""]=!0,J===void 0)return;let G=Q(J);if(G!==null)throw Error(`${s0(X)} must be ${G}`);return J}function a0($,Z,X){for(let Q in $)if(!(Q in Z))throw Error(`Invalid option ${X}: ${s0(Q)}`)}function gI($){let Z=Object.create(null),X=k($,Z,"wasmURL",vI),Q=k($,Z,"wasmModule",kI),J=k($,Z,"worker",u0);return a0($,Z,"in initialize() call"),{wasmURL:X,wasmModule:Q,worker:J}}function EY($){let Z;if($!==void 0){Z=Object.create(null);for(let X in $){let Q=$[X];if(typeof Q==="string"||Q===!1)Z[X]=Q;else throw Error(`Expected ${s0(X)} in mangle cache to map to either a string or false`)}}return Z}function Z8($,Z,X,Q,J){let G=k(Z,X,"color",u0),W=k(Z,X,"logLevel",H0),Y=k(Z,X,"logLimit",p1);if(G!==void 0)$.push(`--color=${G}`);else if(Q)$.push("--color=true");$.push(`--log-level=${W||J}`),$.push(`--log-limit=${Y||0}`)}function C$($,Z,X){if(typeof $!=="string")throw Error(`Expected value for ${Z}${X!==void 0?" "+s0(X):""} to be a string, got ${typeof $} instead`);return $}function RY($,Z,X){let Q=k(Z,X,"legalComments",H0),J=k(Z,X,"sourceRoot",H0),G=k(Z,X,"sourcesContent",u0),W=k(Z,X,"target",jY),Y=k(Z,X,"format",H0),z=k(Z,X,"globalName",H0),q=k(Z,X,"mangleProps",o5),H=k(Z,X,"reserveProps",o5),B=k(Z,X,"mangleQuoted",u0),L=k(Z,X,"minify",u0),M=k(Z,X,"minifySyntax",u0),A=k(Z,X,"minifyWhitespace",u0),w=k(Z,X,"minifyIdentifiers",u0),D=k(Z,X,"lineLimit",p1),j=k(Z,X,"drop",S$),E=k(Z,X,"dropLabels",S$),P=k(Z,X,"charset",H0),R=k(Z,X,"treeShaking",u0),C=k(Z,X,"ignoreAnnotations",u0),v=k(Z,X,"jsx",H0),d=k(Z,X,"jsxFactory",H0),f=k(Z,X,"jsxFragment",H0),a=k(Z,X,"jsxImportSource",H0),$0=k(Z,X,"jsxDev",u0),u=k(Z,X,"jsxSideEffects",u0),e=k(Z,X,"define",p$),Y0=k(Z,X,"logOverride",p$),J0=k(Z,X,"supported",p$),L0=k(Z,X,"pure",S$),_=k(Z,X,"keepNames",u0),p=k(Z,X,"platform",H0),o=k(Z,X,"tsconfigRaw",yI),K0=k(Z,X,"absPaths",S$);if(Q)$.push(`--legal-comments=${Q}`);if(J!==void 0)$.push(`--source-root=${J}`);if(G!==void 0)$.push(`--sources-content=${G}`);if(W)$.push(`--target=${T4(Array.isArray(W)?W:[W],"target")}`);if(Y)$.push(`--format=${Y}`);if(z)$.push(`--global-name=${z}`);if(p)$.push(`--platform=${p}`);if(o)$.push(`--tsconfig-raw=${typeof o==="string"?o:JSON.stringify(o)}`);if(L)$.push("--minify");if(M)$.push("--minify-syntax");if(A)$.push("--minify-whitespace");if(w)$.push("--minify-identifiers");if(D)$.push(`--line-limit=${D}`);if(P)$.push(`--charset=${P}`);if(R!==void 0)$.push(`--tree-shaking=${R}`);if(C)$.push("--ignore-annotations");if(j)for(let i of j)$.push(`--drop:${C$(i,"drop")}`);if(E)$.push(`--drop-labels=${T4(E,"drop label")}`);if(K0)$.push(`--abs-paths=${T4(K0,"abs paths")}`);if(q)$.push(`--mangle-props=${s5(q)}`);if(H)$.push(`--reserve-props=${s5(H)}`);if(B!==void 0)$.push(`--mangle-quoted=${B}`);if(v)$.push(`--jsx=${v}`);if(d)$.push(`--jsx-factory=${d}`);if(f)$.push(`--jsx-fragment=${f}`);if(a)$.push(`--jsx-import-source=${a}`);if($0)$.push("--jsx-dev");if(u)$.push("--jsx-side-effects");if(e)for(let i in e){if(i.indexOf("=")>=0)throw Error(`Invalid define: ${i}`);$.push(`--define:${i}=${C$(e[i],"define",i)}`)}if(Y0)for(let i in Y0){if(i.indexOf("=")>=0)throw Error(`Invalid log override: ${i}`);$.push(`--log-override:${i}=${C$(Y0[i],"log override",i)}`)}if(J0)for(let i in J0){if(i.indexOf("=")>=0)throw Error(`Invalid supported: ${i}`);let G0=J0[i];if(typeof G0!=="boolean")throw Error(`Expected value for supported ${s0(i)} to be a boolean, got ${typeof G0} instead`);$.push(`--supported:${i}=${G0}`)}if(L0)for(let i of L0)$.push(`--pure:${C$(i,"pure")}`);if(_)$.push("--keep-names")}function fI($,Z,X,Q,J){var G;let W=[],Y=[],z=Object.create(null),q=null,H=null;Z8(W,Z,z,X,Q),RY(W,Z,z);let B=k(Z,z,"sourcemap",TY),L=k(Z,z,"bundle",u0),M=k(Z,z,"splitting",u0),A=k(Z,z,"preserveSymlinks",u0),w=k(Z,z,"metafile",u0),D=k(Z,z,"outfile",H0),j=k(Z,z,"outdir",H0),E=k(Z,z,"outbase",H0),P=k(Z,z,"tsconfig",H0),R=k(Z,z,"resolveExtensions",S$),C=k(Z,z,"nodePaths",S$),v=k(Z,z,"mainFields",S$),d=k(Z,z,"conditions",S$),f=k(Z,z,"external",S$),a=k(Z,z,"packages",H0),$0=k(Z,z,"alias",p$),u=k(Z,z,"loader",p$),e=k(Z,z,"outExtension",p$),Y0=k(Z,z,"publicPath",H0),J0=k(Z,z,"entryNames",H0),L0=k(Z,z,"chunkNames",H0),_=k(Z,z,"assetNames",H0),p=k(Z,z,"inject",S$),o=k(Z,z,"banner",p$),K0=k(Z,z,"footer",p$),i=k(Z,z,"entryPoints",bI),G0=k(Z,z,"absWorkingDir",H0),X0=k(Z,z,"stdin",p$),Z0=(G=k(Z,z,"write",u0))!=null?G:J,x0=k(Z,z,"allowOverwrite",u0),j0=k(Z,z,"mangleCache",p$);if(z.plugins=!0,a0(Z,z,`in ${$}() call`),B)W.push(`--sourcemap${B===!0?"":`=${B}`}`);if(L)W.push("--bundle");if(x0)W.push("--allow-overwrite");if(M)W.push("--splitting");if(A)W.push("--preserve-symlinks");if(w)W.push("--metafile");if(D)W.push(`--outfile=${D}`);if(j)W.push(`--outdir=${j}`);if(E)W.push(`--outbase=${E}`);if(P)W.push(`--tsconfig=${P}`);if(a)W.push(`--packages=${a}`);if(R)W.push(`--resolve-extensions=${T4(R,"resolve extension")}`);if(Y0)W.push(`--public-path=${Y0}`);if(J0)W.push(`--entry-names=${J0}`);if(L0)W.push(`--chunk-names=${L0}`);if(_)W.push(`--asset-names=${_}`);if(v)W.push(`--main-fields=${T4(v,"main field")}`);if(d)W.push(`--conditions=${T4(d,"condition")}`);if(f)for(let W0 of f)W.push(`--external:${C$(W0,"external")}`);if($0)for(let W0 in $0){if(W0.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${W0}`);W.push(`--alias:${W0}=${C$($0[W0],"alias",W0)}`)}if(o)for(let W0 in o){if(W0.indexOf("=")>=0)throw Error(`Invalid banner file type: ${W0}`);W.push(`--banner:${W0}=${C$(o[W0],"banner",W0)}`)}if(K0)for(let W0 in K0){if(W0.indexOf("=")>=0)throw Error(`Invalid footer file type: ${W0}`);W.push(`--footer:${W0}=${C$(K0[W0],"footer",W0)}`)}if(p)for(let W0 of p)W.push(`--inject:${C$(W0,"inject")}`);if(u)for(let W0 in u){if(W0.indexOf("=")>=0)throw Error(`Invalid loader extension: ${W0}`);W.push(`--loader:${W0}=${C$(u[W0],"loader",W0)}`)}if(e)for(let W0 in e){if(W0.indexOf("=")>=0)throw Error(`Invalid out extension: ${W0}`);W.push(`--out-extension:${W0}=${C$(e[W0],"out extension",W0)}`)}if(i)if(Array.isArray(i))for(let W0=0,X$=i.length;W0<X$;W0++){let E0=i[W0];if(typeof E0==="object"&&E0!==null){let t0=Object.create(null),y0=k(E0,t0,"in",H0),c0=k(E0,t0,"out",H0);if(a0(E0,t0,"in entry point at index "+W0),y0===void 0)throw Error('Missing property "in" for entry point at index '+W0);if(c0===void 0)throw Error('Missing property "out" for entry point at index '+W0);Y.push([c0,y0])}else Y.push(["",C$(E0,"entry point at index "+W0)])}else for(let W0 in i)Y.push([W0,C$(i[W0],"entry point",W0)]);if(X0){let W0=Object.create(null),X$=k(X0,W0,"contents",OY),E0=k(X0,W0,"resolveDir",H0),t0=k(X0,W0,"sourcefile",H0),y0=k(X0,W0,"loader",H0);if(a0(X0,W0,'in "stdin" object'),t0)W.push(`--sourcefile=${t0}`);if(y0)W.push(`--loader=${y0}`);if(E0)H=E0;if(typeof X$==="string")q=z6(X$);else if(X$ instanceof Uint8Array)q=X$}let m0=[];if(C)for(let W0 of C)W0+="",m0.push(W0);return{entries:Y,flags:W,write:Z0,stdinContents:q,stdinResolveDir:H,absWorkingDir:G0,nodePaths:m0,mangleCache:EY(j0)}}function hI($,Z,X,Q){let J=[],G=Object.create(null);Z8(J,Z,G,X,Q),RY(J,Z,G);let W=k(Z,G,"sourcemap",TY),Y=k(Z,G,"sourcefile",H0),z=k(Z,G,"loader",H0),q=k(Z,G,"banner",H0),H=k(Z,G,"footer",H0),B=k(Z,G,"mangleCache",p$);if(a0(Z,G,`in ${$}() call`),W)J.push(`--sourcemap=${W===!0?"external":W}`);if(Y)J.push(`--sourcefile=${Y}`);if(z)J.push(`--loader=${z}`);if(q)J.push(`--banner=${q}`);if(H)J.push(`--footer=${H}`);return{flags:J,mangleCache:EY(B)}}function PY($){let Z={},X={didClose:!1,reason:""},Q={},J=0,G=0,W=new Uint8Array(16384),Y=0,z=(P)=>{let R=Y+P.length;if(R>W.length){let v=new Uint8Array(R*2);v.set(W),W=v}W.set(P,Y),Y+=P.length;let C=0;while(C+4<=Y){let v=DY(W,C);if(C+4+v>Y)break;C+=4,A(W.subarray(C,C+v)),C+=v}if(C>0)W.copyWithin(0,C,Y),Y-=C},q=(P)=>{if(X.didClose=!0,P)X.reason=": "+(P.message||P);let R="The service was stopped"+X.reason;for(let C in Q)Q[C](R,null);Q={}},H=(P,R,C)=>{if(X.didClose)return C("The service is no longer running"+X.reason,null);let v=J++;if(Q[v]=(d,f)=>{try{C(d,f)}finally{if(P)P.unref()}},P)P.ref();$.writeToStdin(UY({id:v,isRequest:!0,value:R}))},B=(P,R)=>{if(X.didClose)throw Error("The service is no longer running"+X.reason);$.writeToStdin(UY({id:P,isRequest:!1,value:R}))},L=async(P,R)=>{try{if(R.command==="ping"){B(P,{});return}if(typeof R.key==="number"){let C=Z[R.key];if(!C)return;let v=C[R.command];if(v){await v(P,R);return}}throw Error("Invalid command: "+R.command)}catch(C){let v=[c1(C,$,null,void 0,"")];try{B(P,{errors:v})}catch{}}},M=!0,A=(P)=>{if(M){M=!1;let C=String.fromCharCode(...P);if(C!=="0.28.1")throw Error(`Cannot start service: Host version "0.28.1" does not match binary version ${s0(C)}`);return}let R=SI(P);if(R.isRequest)L(R.id,R.value);else{let C=Q[R.id];if(delete Q[R.id],R.value.error)C(R.value.error,{});else C(null,R.value)}};return{readFromStdout:z,afterClose:q,service:{buildOrContext:({callName:P,refs:R,options:C,isTTY:v,defaultWD:d,callback:f})=>{let a=0,$0=G++,u={},e={ref(){if(++a===1){if(R)R.ref()}},unref(){if(--a===0){if(delete Z[$0],R)R.unref()}}};Z[$0]=u,e.ref(),uI(P,$0,H,B,e,$,u,C,v,d,(Y0,J0)=>{try{f(Y0,J0)}finally{e.unref()}})},transform:({callName:P,refs:R,input:C,options:v,isTTY:d,fs:f,callback:a})=>{let $0=CY(),u=(e)=>{try{if(typeof C!=="string"&&!(C instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:Y0,mangleCache:J0}=hI(P,v,d,HY),L0={command:"transform",flags:Y0,inputFS:e!==null,input:e!==null?z6(e):typeof C==="string"?z6(C):C};if(J0)L0.mangleCache=J0;H(R,L0,(_,p)=>{if(_)return a(Error(_),null);let o=j4(p.errors,$0),K0=j4(p.warnings,$0),i=1,G0=()=>{if(--i===0){let X0={warnings:K0,code:p.code,map:p.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in p)X0.legalComments=p==null?void 0:p.legalComments;if(p.mangleCache)X0.mangleCache=p==null?void 0:p.mangleCache;a(null,X0)}};if(o.length>0)return a(D9("Transform failed",o,K0),null);if(p.codeFS)i++,f.readFile(p.code,(X0,Z0)=>{if(X0!==null)a(X0,null);else p.code=Z0,G0()});if(p.mapFS)i++,f.readFile(p.map,(X0,Z0)=>{if(X0!==null)a(X0,null);else p.map=Z0,G0()});G0()})}catch(Y0){let J0=[];try{Z8(J0,v,{},d,HY)}catch{}let L0=c1(Y0,$,$0,void 0,"");H(R,{command:"error",flags:J0,error:L0},()=>{L0.detail=$0.load(L0.detail),a(D9("Transform failed",[L0],[]),null)})}};if((typeof C==="string"||C instanceof Uint8Array)&&C.length>1048576){let e=u;u=()=>f.writeFile(C,e)}u(null)},formatMessages:({callName:P,refs:R,messages:C,options:v,callback:d})=>{if(!v)throw Error(`Missing second argument in ${P}() call`);let f={},a=k(v,f,"kind",H0),$0=k(v,f,"color",u0),u=k(v,f,"terminalWidth",p1);if(a0(v,f,`in ${P}() call`),a===void 0)throw Error(`Missing "kind" in ${P}() call`);if(a!=="error"&&a!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let e={command:"format-msgs",messages:o6(C,"messages",null,"",u),isWarning:a==="warning"};if($0!==void 0)e.color=$0;if(u!==void 0)e.terminalWidth=u;H(R,e,(Y0,J0)=>{if(Y0)return d(Error(Y0),null);d(null,J0.messages)})},analyzeMetafile:({callName:P,refs:R,metafile:C,options:v,callback:d})=>{if(v===void 0)v={};let f={},a=k(v,f,"color",u0),$0=k(v,f,"verbose",u0);a0(v,f,`in ${P}() call`);let u={command:"analyze-metafile",metafile:C};if(a!==void 0)u.color=a;if($0!==void 0)u.verbose=$0;H(R,u,(e,Y0)=>{if(e)return d(Error(e),null);d(null,Y0.result)})}}}}function uI($,Z,X,Q,J,G,W,Y,z,q,H){let B=CY(),L=$==="context",M=(D,j)=>{let E=[];try{Z8(E,Y,{},z,KY)}catch{}let P=c1(D,G,B,void 0,j);X(J,{command:"error",flags:E,error:P},()=>{P.detail=B.load(P.detail),H(D9(L?"Context failed":"Build failed",[P],[]),null)})},A;if(typeof Y==="object"){let D=Y.plugins;if(D!==void 0){if(!Array.isArray(D))return M(Error('"plugins" must be an array'),"");A=D}}if(A&&A.length>0){if(G.isSync)return M(Error("Cannot use plugins in synchronous API calls"),"");mI(Z,X,Q,J,G,W,Y,A,B).then((D)=>{if(!D.ok)return M(D.error,D.pluginName);try{w(D.requestPlugins,D.runOnEndCallbacks,D.scheduleOnDisposeCallbacks)}catch(j){M(j,"")}},(D)=>M(D,""));return}try{w(null,(D,j)=>j([],[]),()=>{})}catch(D){M(D,"")}function w(D,j,E){let P=G.hasFS,{entries:R,flags:C,write:v,stdinContents:d,stdinResolveDir:f,absWorkingDir:a,nodePaths:$0,mangleCache:u}=fI($,Y,z,KY,P);if(v&&!G.hasFS)throw Error('The "write" option is unavailable in this environment');let e={command:"build",key:Z,entries:R,flags:C,write:v,stdinContents:d,stdinResolveDir:f,absWorkingDir:a||q,nodePaths:$0,context:L};if(D)e.plugins=D;if(u)e.mangleCache=u;let Y0=(_,p)=>{let o={errors:j4(_.errors,B),warnings:j4(_.warnings,B),outputFiles:void 0,metafile:void 0,mangleCache:void 0},K0=o.errors.slice(),i=o.warnings.slice();if(_.outputFiles)o.outputFiles=_.outputFiles.map(lI);if(_.metafile&&_.metafile.length)o.metafile=cI(_.metafile);if(_.mangleCache)o.mangleCache=_.mangleCache;if(_.writeToStdout!==void 0)console.log(r1(_.writeToStdout).replace(/\n$/,""));j(o,(G0,X0)=>{if(K0.length>0||G0.length>0){let Z0=D9("Build failed",K0.concat(G0),i.concat(X0));return p(Z0,null,G0,X0)}p(null,o,G0,X0)})},J0,L0;if(L)W["on-end"]=(_,p)=>new Promise((o)=>{Y0(p,(K0,i,G0,X0)=>{let Z0={errors:G0,warnings:X0};if(L0)L0(K0,i);J0=void 0,L0=void 0,Q(_,Z0),o()})});X(J,e,(_,p)=>{if(_)return H(Error(_),null);if(!L)return Y0(p,(i,G0)=>{return E(),H(i,G0)});if(p.errors.length>0)return H(D9("Context failed",p.errors,p.warnings),null);let o=!1,K0={rebuild:()=>{if(!J0)J0=new Promise((i,G0)=>{let X0;L0=(x0,j0)=>{if(!X0)X0=()=>x0?G0(x0):i(j0)};let Z0=()=>{X(J,{command:"rebuild",key:Z},(j0,m0)=>{if(j0)G0(Error(j0));else if(X0)X0();else Z0()})};Z0()});return J0},watch:(i={})=>new Promise((G0,X0)=>{if(!G.hasFS)throw Error('Cannot use the "watch" API in this environment');let Z0={},x0=k(i,Z0,"delay",p1);a0(i,Z0,"in watch() call");let j0={command:"watch",key:Z};if(x0)j0.delay=x0;X(J,j0,(m0)=>{if(m0)X0(Error(m0));else G0(void 0)})}),serve:(i={})=>new Promise((G0,X0)=>{if(!G.hasFS)throw Error('Cannot use the "serve" API in this environment');let Z0={},x0=k(i,Z0,"port",xI),j0=k(i,Z0,"host",H0),m0=k(i,Z0,"servedir",H0),W0=k(i,Z0,"keyfile",H0),X$=k(i,Z0,"certfile",H0),E0=k(i,Z0,"fallback",H0),t0=k(i,Z0,"cors",p$),y0=k(i,Z0,"onRequest",wY);a0(i,Z0,"in serve() call");let c0={command:"serve",key:Z,onRequest:!!y0};if(x0!==void 0)c0.port=x0;if(j0!==void 0)c0.host=j0;if(m0!==void 0)c0.servedir=m0;if(W0!==void 0)c0.keyfile=W0;if(X$!==void 0)c0.certfile=X$;if(E0!==void 0)c0.fallback=E0;if(t0){let j$={},q$=k(t0,j$,"origin",jY);if(a0(t0,j$,'on "cors" object'),Array.isArray(q$))c0.corsOrigin=q$;else if(q$!==void 0)c0.corsOrigin=[q$]}X(J,c0,(j$,q$)=>{if(j$)return X0(Error(j$));if(y0)W["serve-request"]=(L6,M6)=>{y0(M6.args),Q(L6,{})};G0(q$)})}),cancel:()=>new Promise((i)=>{if(o)return i();X(J,{command:"cancel",key:Z},()=>{i()})}),dispose:()=>new Promise((i)=>{if(o)return i();o=!0,X(J,{command:"dispose",key:Z},()=>{i(),E(),J.unref()})})};J.ref(),H(null,K0)})}}var mI=async($,Z,X,Q,J,G,W,Y,z)=>{let q=[],H=[],B={},L={},M=[],A=0,w=0,D=[],j=!1;Y=[...Y];for(let R of Y){let C={};if(typeof R!=="object")throw Error(`Plugin at index ${w} must be an object`);let v=k(R,C,"name",H0);if(typeof v!=="string"||v==="")throw Error(`Plugin at index ${w} is missing a name`);try{let d=k(R,C,"setup",wY);if(typeof d!=="function")throw Error("Plugin is missing a setup function");a0(R,C,`on plugin ${s0(v)}`);let f={name:v,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};w++;let $0=d({initialOptions:W,resolve:(u,e={})=>{if(!j)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!=="string")throw Error("The path to resolve must be a string");let Y0=Object.create(null),J0=k(e,Y0,"pluginName",H0),L0=k(e,Y0,"importer",H0),_=k(e,Y0,"namespace",H0),p=k(e,Y0,"resolveDir",H0),o=k(e,Y0,"kind",H0),K0=k(e,Y0,"pluginData",a5),i=k(e,Y0,"with",p$);return a0(e,Y0,"in resolve() call"),new Promise((G0,X0)=>{let Z0={command:"resolve",path:u,key:$,pluginName:v};if(J0!=null)Z0.pluginName=J0;if(L0!=null)Z0.importer=L0;if(_!=null)Z0.namespace=_;if(p!=null)Z0.resolveDir=p;if(o!=null)Z0.kind=o;else throw Error('Must specify "kind" when calling "resolve"');if(K0!=null)Z0.pluginData=z.store(K0);if(i!=null)Z0.with=dI(i,"with");Z(Q,Z0,(x0,j0)=>{if(x0!==null)X0(Error(x0));else G0({errors:j4(j0.errors,z),warnings:j4(j0.warnings,z),path:j0.path,external:j0.external,sideEffects:j0.sideEffects,namespace:j0.namespace,suffix:j0.suffix,pluginData:z.load(j0.pluginData)})})})},onStart(u){let Y0=n5(Error('This error came from the "onStart" callback registered here:'),J,"onStart");q.push({name:v,callback:u,note:Y0}),f.onStart=!0},onEnd(u){let Y0=n5(Error('This error came from the "onEnd" callback registered here:'),J,"onEnd");H.push({name:v,callback:u,note:Y0}),f.onEnd=!0},onResolve(u,e){let J0=n5(Error('This error came from the "onResolve" callback registered here:'),J,"onResolve"),L0={},_=k(u,L0,"filter",o5),p=k(u,L0,"namespace",H0);if(a0(u,L0,`in onResolve() call for plugin ${s0(v)}`),_==null)throw Error("onResolve() call is missing a filter");let o=A++;B[o]={name:v,callback:e,note:J0},f.onResolve.push({id:o,filter:s5(_),namespace:p||""})},onLoad(u,e){let J0=n5(Error('This error came from the "onLoad" callback registered here:'),J,"onLoad"),L0={},_=k(u,L0,"filter",o5),p=k(u,L0,"namespace",H0);if(a0(u,L0,`in onLoad() call for plugin ${s0(v)}`),_==null)throw Error("onLoad() call is missing a filter");let o=A++;L[o]={name:v,callback:e,note:J0},f.onLoad.push({id:o,filter:s5(_),namespace:p||""})},onDispose(u){M.push(u)},esbuild:J.esbuild});if($0)await $0;D.push(f)}catch(d){return{ok:!1,error:d,pluginName:v}}}G["on-start"]=async(R,C)=>{z.clear();let v={errors:[],warnings:[]};await Promise.all(q.map(async({name:d,callback:f,note:a})=>{try{let $0=await f();if($0!=null){if(typeof $0!=="object")throw Error(`Expected onStart() callback in plugin ${s0(d)} to return an object`);let u={},e=k($0,u,"errors",a6),Y0=k($0,u,"warnings",a6);if(a0($0,u,`from onStart() callback in plugin ${s0(d)}`),e!=null)v.errors.push(...o6(e,"errors",z,d,void 0));if(Y0!=null)v.warnings.push(...o6(Y0,"warnings",z,d,void 0))}}catch($0){v.errors.push(c1($0,J,z,a&&a(),d))}})),X(R,v)},G["on-resolve"]=async(R,C)=>{let v={},d="",f,a;for(let $0 of C.ids)try{({name:d,callback:f,note:a}=B[$0]);let u=await f({path:C.path,importer:C.importer,namespace:C.namespace,resolveDir:C.resolveDir,kind:C.kind,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onResolve() callback in plugin ${s0(d)} to return an object`);let e={},Y0=k(u,e,"pluginName",H0),J0=k(u,e,"path",H0),L0=k(u,e,"namespace",H0),_=k(u,e,"suffix",H0),p=k(u,e,"external",u0),o=k(u,e,"sideEffects",u0),K0=k(u,e,"pluginData",a5),i=k(u,e,"errors",a6),G0=k(u,e,"warnings",a6),X0=k(u,e,"watchFiles",S$),Z0=k(u,e,"watchDirs",S$);if(a0(u,e,`from onResolve() callback in plugin ${s0(d)}`),v.id=$0,Y0!=null)v.pluginName=Y0;if(J0!=null)v.path=J0;if(L0!=null)v.namespace=L0;if(_!=null)v.suffix=_;if(p!=null)v.external=p;if(o!=null)v.sideEffects=o;if(K0!=null)v.pluginData=z.store(K0);if(i!=null)v.errors=o6(i,"errors",z,d,void 0);if(G0!=null)v.warnings=o6(G0,"warnings",z,d,void 0);if(X0!=null)v.watchFiles=r5(X0,"watchFiles");if(Z0!=null)v.watchDirs=r5(Z0,"watchDirs");break}}catch(u){v={id:$0,errors:[c1(u,J,z,a&&a(),d)]};break}X(R,v)},G["on-load"]=async(R,C)=>{let v={},d="",f,a;for(let $0 of C.ids)try{({name:d,callback:f,note:a}=L[$0]);let u=await f({path:C.path,namespace:C.namespace,suffix:C.suffix,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onLoad() callback in plugin ${s0(d)} to return an object`);let e={},Y0=k(u,e,"pluginName",H0),J0=k(u,e,"contents",OY),L0=k(u,e,"resolveDir",H0),_=k(u,e,"pluginData",a5),p=k(u,e,"loader",H0),o=k(u,e,"errors",a6),K0=k(u,e,"warnings",a6),i=k(u,e,"watchFiles",S$),G0=k(u,e,"watchDirs",S$);if(a0(u,e,`from onLoad() callback in plugin ${s0(d)}`),v.id=$0,Y0!=null)v.pluginName=Y0;if(J0 instanceof Uint8Array)v.contents=J0;else if(J0!=null)v.contents=z6(J0);if(L0!=null)v.resolveDir=L0;if(_!=null)v.pluginData=z.store(_);if(p!=null)v.loader=p;if(o!=null)v.errors=o6(o,"errors",z,d,void 0);if(K0!=null)v.warnings=o6(K0,"warnings",z,d,void 0);if(i!=null)v.watchFiles=r5(i,"watchFiles");if(G0!=null)v.watchDirs=r5(G0,"watchDirs");break}}catch(u){v={id:$0,errors:[c1(u,J,z,a&&a(),d)]};break}X(R,v)};let E=(R,C)=>C([],[]);if(H.length>0)E=(R,C)=>{(async()=>{let v=[],d=[];for(let{name:f,callback:a,note:$0}of H){let u,e;try{let Y0=await a(R);if(Y0!=null){if(typeof Y0!=="object")throw Error(`Expected onEnd() callback in plugin ${s0(f)} to return an object`);let J0={},L0=k(Y0,J0,"errors",a6),_=k(Y0,J0,"warnings",a6);if(a0(Y0,J0,`from onEnd() callback in plugin ${s0(f)}`),L0!=null)u=o6(L0,"errors",z,f,void 0);if(_!=null)e=o6(_,"warnings",z,f,void 0)}}catch(Y0){u=[c1(Y0,J,z,$0&&$0(),f)]}if(u){v.push(...u);try{R.errors.push(...u)}catch{}}if(e){d.push(...e);try{R.warnings.push(...e)}catch{}}}C(v,d)})()};let P=()=>{for(let R of M)setTimeout(()=>R(),0)};return j=!0,{ok:!0,requestPlugins:D,runOnEndCallbacks:E,scheduleOnDisposeCallbacks:P}};function CY(){let $=new Map,Z=0;return{clear(){$.clear()},load(X){return $.get(X)},store(X){if(X===void 0)return-1;let Q=Z++;return $.set(Q,X),Q}}}function n5($,Z,X){let Q,J=!1;return()=>{if(J)return Q;J=!0;try{let G=($.stack+"").split(`
223
- `);G.splice(1,1);let W=SY(Z,G,X);if(W)return Q={text:$.message,location:W},Q}catch{}}}function c1($,Z,X,Q,J){let G="Internal error",W=null;try{G=($&&$.message||$)+""}catch{}try{W=SY(Z,($.stack+"").split(`
224
- `),"")}catch{}return{id:"",pluginName:J,text:G,location:W,notes:Q?[Q]:[],detail:X?X.store($):-1}}function SY($,Z,X){let Q=" at ";if($.readFileSync&&!Z[0].startsWith(Q)&&Z[1].startsWith(Q))for(let J=1;J<Z.length;J++){let G=Z[J];if(!G.startsWith(Q))continue;G=G.slice(Q.length);while(!0){let W=/^(?:new |async )?\S+ \((.*)\)$/.exec(G);if(W){G=W[1];continue}if(W=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(G),W){G=W[1];continue}if(W=/^(\S+):(\d+):(\d+)$/.exec(G),W){let Y;try{Y=$.readFileSync(W[1],"utf8")}catch{break}let z=Y.split(/\r\n|\r|\n|\u2028|\u2029/)[+W[2]-1]||"",q=+W[3]-1,H=z.slice(q,q+X.length)===X?X.length:0;return{file:W[1],namespace:"file",line:+W[2],column:z6(z.slice(0,q)).length,length:z6(z.slice(q,q+H)).length,lineText:z+`
219
+ `);function hY($,Z){return($[Z++]|$[Z++]<<8|$[Z++]<<16|$[Z++]<<24)>>>0}function ZX($,Z,X){$[X++]=Z,$[X++]=Z>>8,$[X++]=Z>>16,$[X++]=Z>>24}var a1=String.fromCharCode;function e$($,Z,X){let Q=$[Z],J=1,G=0;for(let W=0;W<Z;W++)if($[W]===10)J++,G=0;else G++;throw SyntaxError(X?X:Z===$.length?"Unexpected end of input while parsing JSON":Q>=32&&Q<=126?`Unexpected character ${a1(Q)} in JSON at position ${Z} (line ${J}, column ${G})`:`Unexpected byte 0x${Q.toString(16)} in JSON at position ${Z} (line ${J}, column ${G})`)}function XN($){if(!($ instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let Z=[],X=[],Q=[],J=$.length,G=null,W=0,Y,z=0;while(z<J){let q=$[z++];if(q<=32)continue;let H;if(W===2&&G===null&&q!==34&&q!==125)e$($,--z);switch(q){case 116:{if($[z++]!==114||$[z++]!==117||$[z++]!==101)e$($,--z);H=!0;break}case 102:{if($[z++]!==97||$[z++]!==108||$[z++]!==115||$[z++]!==101)e$($,--z);H=!1;break}case 110:{if($[z++]!==117||$[z++]!==108||$[z++]!==108)e$($,--z);H=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let B=z;H=a1(q),q=$[z];while(!0){switch(q){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{H+=a1(q),q=$[++z];continue}}break}if(H=+H,isNaN(H))e$($,--B,"Invalid number");break}case 34:{H="";while(!0){if(z>=J)e$($,J);if(q=$[z++],q===34)break;else if(q===92)switch($[z++]){case 34:H+='"';break;case 47:H+="/";break;case 92:H+="\\";break;case 98:H+="\b";break;case 102:H+="\f";break;case 110:H+=`
220
+ `;break;case 114:H+="\r";break;case 116:H+="\t";break;case 117:{let B=0;for(let F=0;F<4;F++)if(q=$[z++],B<<=4,q>=48&&q<=57)B|=q-48;else if(q>=97&&q<=102)B|=q+-87;else if(q>=65&&q<=70)B|=q+-55;else e$($,--z);H+=a1(B);break}default:e$($,--z);break}else if(q<=127)H+=a1(q);else if((q&224)===192)H+=a1((q&31)<<6|$[z++]&63);else if((q&240)===224)H+=a1((q&15)<<12|($[z++]&63)<<6|$[z++]&63);else if((q&248)==240){let B=(q&7)<<18|($[z++]&63)<<12|($[z++]&63)<<6|$[z++]&63;if(B>65535)B-=65536,H+=a1(B>>10&1023|55296),B=56320|B&1023;H+=a1(B)}}H[0];break}case 91:{H=[],Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=1;continue}case 123:{H={},Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=2;continue}case 93:{if(W!==1)e$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}case 125:{if(W!==2)e$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}default:e$($,--z)}q=$[z];while(q<=32)q=$[++z];switch(W){case 0:{if(z===J)return H;break}case 1:{if(Y.push(H),q===44){z++;continue}if(q===93)continue;break}case 2:{if(G===null){if(G=H,q===58){z++;continue}}else{if(Y[G]=H,G=null,q===44){z++;continue}if(q===125)continue}break}}break}e$($,z)}var $$=JSON.stringify,CY="warning",SY="silent";function C4($,Z){let X=[];for(let Q of $){if(S$(Q,Z),Q.indexOf(",")>=0)throw Error(`Invalid ${Z}: ${Q}`);X.push(Q)}return X.join(",")}var z5=()=>null,m0=($)=>typeof $==="boolean"?null:"a boolean",H0=($)=>typeof $==="string"?null:"a string",q5=($)=>$ instanceof RegExp?null:"a RegExp object",a6=($)=>typeof $==="number"&&$===($|0)?null:"an integer",QN=($)=>typeof $==="number"&&$===($|0)&&$>=0&&$<=65535?null:"a valid port number",uY=($)=>typeof $==="function"?null:"a function",o1=($)=>Array.isArray($)?null:"an array",_$=($)=>Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"an array of strings",p$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)?null:"an object",JN=($)=>typeof $==="object"&&$!==null?null:"an array or an object",GN=($)=>$ instanceof WebAssembly.Module?null:"a WebAssembly.Module",_Y=($)=>typeof $==="object"&&!Array.isArray($)?null:"an object or null",mY=($)=>typeof $==="string"||typeof $==="boolean"?null:"a string or a boolean",WN=($)=>typeof $==="string"||typeof $==="object"&&$!==null&&!Array.isArray($)?null:"a string or an object",dY=($)=>typeof $==="string"||Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"a string or an array of strings",lY=($)=>typeof $==="string"||$ instanceof Uint8Array?null:"a string or a Uint8Array",YN=($)=>typeof $==="string"||$ instanceof URL?null:"a string or a URL";function x($,Z,X,Q){let J=$[X];if(Z[X+""]=!0,J===void 0)return;let G=Q(J);if(G!==null)throw Error(`${$$(X)} must be ${G}`);return J}function s0($,Z,X){for(let Q in $)if(!(Q in Z))throw Error(`Invalid option ${X}: ${$$(Q)}`)}function zN($){let Z=Object.create(null),X=x($,Z,"wasmURL",YN),Q=x($,Z,"wasmModule",GN),J=x($,Z,"worker",m0);return s0($,Z,"in initialize() call"),{wasmURL:X,wasmModule:Q,worker:J}}function cY($){let Z;if($!==void 0){Z=Object.create(null);for(let X in $){let Q=$[X];if(typeof Q==="string"||Q===!1)Z[X]=Q;else throw Error(`Expected ${$$(X)} in mangle cache to map to either a string or false`)}}return Z}function B5($,Z,X,Q,J){let G=x(Z,X,"color",m0),W=x(Z,X,"logLevel",H0),Y=x(Z,X,"logLimit",a6);if(G!==void 0)$.push(`--color=${G}`);else if(Q)$.push("--color=true");$.push(`--log-level=${W||J}`),$.push(`--log-limit=${Y||0}`)}function S$($,Z,X){if(typeof $!=="string")throw Error(`Expected value for ${Z}${X!==void 0?" "+$$(X):""} to be a string, got ${typeof $} instead`);return $}function pY($,Z,X){let Q=x(Z,X,"legalComments",H0),J=x(Z,X,"sourceRoot",H0),G=x(Z,X,"sourcesContent",m0),W=x(Z,X,"target",dY),Y=x(Z,X,"format",H0),z=x(Z,X,"globalName",H0),q=x(Z,X,"mangleProps",q5),H=x(Z,X,"reserveProps",q5),B=x(Z,X,"mangleQuoted",m0),F=x(Z,X,"minify",m0),L=x(Z,X,"minifySyntax",m0),w=x(Z,X,"minifyWhitespace",m0),N=x(Z,X,"minifyIdentifiers",m0),I=x(Z,X,"lineLimit",a6),T=x(Z,X,"drop",_$),E=x(Z,X,"dropLabels",_$),P=x(Z,X,"charset",H0),R=x(Z,X,"treeShaking",m0),C=x(Z,X,"ignoreAnnotations",m0),y=x(Z,X,"jsx",H0),v=x(Z,X,"jsxFactory",H0),h=x(Z,X,"jsxFragment",H0),X0=x(Z,X,"jsxImportSource",H0),r=x(Z,X,"jsxDev",m0),u=x(Z,X,"jsxSideEffects",m0),t=x(Z,X,"define",p$),Y0=x(Z,X,"logOverride",p$),G0=x(Z,X,"supported",p$),A0=x(Z,X,"pure",_$),l=x(Z,X,"keepNames",m0),K0=x(Z,X,"platform",H0),V0=x(Z,X,"tsconfigRaw",WN),o=x(Z,X,"absPaths",_$);if(Q)$.push(`--legal-comments=${Q}`);if(J!==void 0)$.push(`--source-root=${J}`);if(G!==void 0)$.push(`--sources-content=${G}`);if(W)$.push(`--target=${C4(Array.isArray(W)?W:[W],"target")}`);if(Y)$.push(`--format=${Y}`);if(z)$.push(`--global-name=${z}`);if(K0)$.push(`--platform=${K0}`);if(V0)$.push(`--tsconfig-raw=${typeof V0==="string"?V0:JSON.stringify(V0)}`);if(F)$.push("--minify");if(L)$.push("--minify-syntax");if(w)$.push("--minify-whitespace");if(N)$.push("--minify-identifiers");if(I)$.push(`--line-limit=${I}`);if(P)$.push(`--charset=${P}`);if(R!==void 0)$.push(`--tree-shaking=${R}`);if(C)$.push("--ignore-annotations");if(T)for(let f of T)$.push(`--drop:${S$(f,"drop")}`);if(E)$.push(`--drop-labels=${C4(E,"drop label")}`);if(o)$.push(`--abs-paths=${C4(o,"abs paths")}`);if(q)$.push(`--mangle-props=${K5(q)}`);if(H)$.push(`--reserve-props=${K5(H)}`);if(B!==void 0)$.push(`--mangle-quoted=${B}`);if(y)$.push(`--jsx=${y}`);if(v)$.push(`--jsx-factory=${v}`);if(h)$.push(`--jsx-fragment=${h}`);if(X0)$.push(`--jsx-import-source=${X0}`);if(r)$.push("--jsx-dev");if(u)$.push("--jsx-side-effects");if(t)for(let f in t){if(f.indexOf("=")>=0)throw Error(`Invalid define: ${f}`);$.push(`--define:${f}=${S$(t[f],"define",f)}`)}if(Y0)for(let f in Y0){if(f.indexOf("=")>=0)throw Error(`Invalid log override: ${f}`);$.push(`--log-override:${f}=${S$(Y0[f],"log override",f)}`)}if(G0)for(let f in G0){if(f.indexOf("=")>=0)throw Error(`Invalid supported: ${f}`);let Z0=G0[f];if(typeof Z0!=="boolean")throw Error(`Expected value for supported ${$$(f)} to be a boolean, got ${typeof Z0} instead`);$.push(`--supported:${f}=${Z0}`)}if(A0)for(let f of A0)$.push(`--pure:${S$(f,"pure")}`);if(l)$.push("--keep-names")}function qN($,Z,X,Q,J){var G;let W=[],Y=[],z=Object.create(null),q=null,H=null;B5(W,Z,z,X,Q),pY(W,Z,z);let B=x(Z,z,"sourcemap",mY),F=x(Z,z,"bundle",m0),L=x(Z,z,"splitting",m0),w=x(Z,z,"preserveSymlinks",m0),N=x(Z,z,"metafile",m0),I=x(Z,z,"outfile",H0),T=x(Z,z,"outdir",H0),E=x(Z,z,"outbase",H0),P=x(Z,z,"tsconfig",H0),R=x(Z,z,"resolveExtensions",_$),C=x(Z,z,"nodePaths",_$),y=x(Z,z,"mainFields",_$),v=x(Z,z,"conditions",_$),h=x(Z,z,"external",_$),X0=x(Z,z,"packages",H0),r=x(Z,z,"alias",p$),u=x(Z,z,"loader",p$),t=x(Z,z,"outExtension",p$),Y0=x(Z,z,"publicPath",H0),G0=x(Z,z,"entryNames",H0),A0=x(Z,z,"chunkNames",H0),l=x(Z,z,"assetNames",H0),K0=x(Z,z,"inject",_$),V0=x(Z,z,"banner",p$),o=x(Z,z,"footer",p$),f=x(Z,z,"entryPoints",JN),Z0=x(Z,z,"absWorkingDir",H0),J0=x(Z,z,"stdin",p$),$0=(G=x(Z,z,"write",m0))!=null?G:J,F0=x(Z,z,"allowOverwrite",m0),U0=x(Z,z,"mangleCache",p$);if(z.plugins=!0,s0(Z,z,`in ${$}() call`),B)W.push(`--sourcemap${B===!0?"":`=${B}`}`);if(F)W.push("--bundle");if(F0)W.push("--allow-overwrite");if(L)W.push("--splitting");if(w)W.push("--preserve-symlinks");if(N)W.push("--metafile");if(I)W.push(`--outfile=${I}`);if(T)W.push(`--outdir=${T}`);if(E)W.push(`--outbase=${E}`);if(P)W.push(`--tsconfig=${P}`);if(X0)W.push(`--packages=${X0}`);if(R)W.push(`--resolve-extensions=${C4(R,"resolve extension")}`);if(Y0)W.push(`--public-path=${Y0}`);if(G0)W.push(`--entry-names=${G0}`);if(A0)W.push(`--chunk-names=${A0}`);if(l)W.push(`--asset-names=${l}`);if(y)W.push(`--main-fields=${C4(y,"main field")}`);if(v)W.push(`--conditions=${C4(v,"condition")}`);if(h)for(let e of h)W.push(`--external:${S$(e,"external")}`);if(r)for(let e in r){if(e.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${e}`);W.push(`--alias:${e}=${S$(r[e],"alias",e)}`)}if(V0)for(let e in V0){if(e.indexOf("=")>=0)throw Error(`Invalid banner file type: ${e}`);W.push(`--banner:${e}=${S$(V0[e],"banner",e)}`)}if(o)for(let e in o){if(e.indexOf("=")>=0)throw Error(`Invalid footer file type: ${e}`);W.push(`--footer:${e}=${S$(o[e],"footer",e)}`)}if(K0)for(let e of K0)W.push(`--inject:${S$(e,"inject")}`);if(u)for(let e in u){if(e.indexOf("=")>=0)throw Error(`Invalid loader extension: ${e}`);W.push(`--loader:${e}=${S$(u[e],"loader",e)}`)}if(t)for(let e in t){if(e.indexOf("=")>=0)throw Error(`Invalid out extension: ${e}`);W.push(`--out-extension:${e}=${S$(t[e],"out extension",e)}`)}if(f)if(Array.isArray(f))for(let e=0,d0=f.length;e<d0;e++){let R0=f[e];if(typeof R0==="object"&&R0!==null){let p0=Object.create(null),v0=x(R0,p0,"in",H0),i0=x(R0,p0,"out",H0);if(s0(R0,p0,"in entry point at index "+e),v0===void 0)throw Error('Missing property "in" for entry point at index '+e);if(i0===void 0)throw Error('Missing property "out" for entry point at index '+e);Y.push([i0,v0])}else Y.push(["",S$(R0,"entry point at index "+e)])}else for(let e in f)Y.push([e,S$(f[e],"entry point",e)]);if(J0){let e=Object.create(null),d0=x(J0,e,"contents",lY),R0=x(J0,e,"resolveDir",H0),p0=x(J0,e,"sourcefile",H0),v0=x(J0,e,"loader",H0);if(s0(J0,e,'in "stdin" object'),p0)W.push(`--sourcefile=${p0}`);if(v0)W.push(`--loader=${v0}`);if(R0)H=R0;if(typeof d0==="string")q=q1(d0);else if(d0 instanceof Uint8Array)q=d0}let D0=[];if(C)for(let e of C)e+="",D0.push(e);return{entries:Y,flags:W,write:$0,stdinContents:q,stdinResolveDir:H,absWorkingDir:Z0,nodePaths:D0,mangleCache:cY(U0)}}function KN($,Z,X,Q){let J=[],G=Object.create(null);B5(J,Z,G,X,Q),pY(J,Z,G);let W=x(Z,G,"sourcemap",mY),Y=x(Z,G,"sourcefile",H0),z=x(Z,G,"loader",H0),q=x(Z,G,"banner",H0),H=x(Z,G,"footer",H0),B=x(Z,G,"mangleCache",p$);if(s0(Z,G,`in ${$}() call`),W)J.push(`--sourcemap=${W===!0?"external":W}`);if(Y)J.push(`--sourcefile=${Y}`);if(z)J.push(`--loader=${z}`);if(q)J.push(`--banner=${q}`);if(H)J.push(`--footer=${H}`);return{flags:J,mangleCache:cY(B)}}function iY($){let Z={},X={didClose:!1,reason:""},Q={},J=0,G=0,W=new Uint8Array(16384),Y=0,z=(P)=>{let R=Y+P.length;if(R>W.length){let y=new Uint8Array(R*2);y.set(W),W=y}W.set(P,Y),Y+=P.length;let C=0;while(C+4<=Y){let y=hY(W,C);if(C+4+y>Y)break;C+=4,w(W.subarray(C,C+y)),C+=y}if(C>0)W.copyWithin(0,C,Y),Y-=C},q=(P)=>{if(X.didClose=!0,P)X.reason=": "+(P.message||P);let R="The service was stopped"+X.reason;for(let C in Q)Q[C](R,null);Q={}},H=(P,R,C)=>{if(X.didClose)return C("The service is no longer running"+X.reason,null);let y=J++;if(Q[y]=(v,h)=>{try{C(v,h)}finally{if(P)P.unref()}},P)P.ref();$.writeToStdin(PY({id:y,isRequest:!0,value:R}))},B=(P,R)=>{if(X.didClose)throw Error("The service is no longer running"+X.reason);$.writeToStdin(PY({id:P,isRequest:!1,value:R}))},F=async(P,R)=>{try{if(R.command==="ping"){B(P,{});return}if(typeof R.key==="number"){let C=Z[R.key];if(!C)return;let y=C[R.command];if(y){await y(P,R);return}}throw Error("Invalid command: "+R.command)}catch(C){let y=[r6(C,$,null,void 0,"")];try{B(P,{errors:y})}catch{}}},L=!0,w=(P)=>{if(L){L=!1;let C=String.fromCharCode(...P);if(C!=="0.28.1")throw Error(`Cannot start service: Host version "0.28.1" does not match binary version ${$$(C)}`);return}let R=ZN(P);if(R.isRequest)F(R.id,R.value);else{let C=Q[R.id];if(delete Q[R.id],R.value.error)C(R.value.error,{});else C(null,R.value)}};return{readFromStdout:z,afterClose:q,service:{buildOrContext:({callName:P,refs:R,options:C,isTTY:y,defaultWD:v,callback:h})=>{let X0=0,r=G++,u={},t={ref(){if(++X0===1){if(R)R.ref()}},unref(){if(--X0===0){if(delete Z[r],R)R.unref()}}};Z[r]=u,t.ref(),UN(P,r,H,B,t,$,u,C,y,v,(Y0,G0)=>{try{h(Y0,G0)}finally{t.unref()}})},transform:({callName:P,refs:R,input:C,options:y,isTTY:v,fs:h,callback:X0})=>{let r=nY(),u=(t)=>{try{if(typeof C!=="string"&&!(C instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:Y0,mangleCache:G0}=KN(P,y,v,SY),A0={command:"transform",flags:Y0,inputFS:t!==null,input:t!==null?q1(t):typeof C==="string"?q1(C):C};if(G0)A0.mangleCache=G0;H(R,A0,(l,K0)=>{if(l)return X0(Error(l),null);let V0=S4(K0.errors,r),o=S4(K0.warnings,r),f=1,Z0=()=>{if(--f===0){let J0={warnings:o,code:K0.code,map:K0.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in K0)J0.legalComments=K0==null?void 0:K0.legalComments;if(K0.mangleCache)J0.mangleCache=K0==null?void 0:K0.mangleCache;X0(null,J0)}};if(V0.length>0)return X0(C9("Transform failed",V0,o),null);if(K0.codeFS)f++,h.readFile(K0.code,(J0,$0)=>{if(J0!==null)X0(J0,null);else K0.code=$0,Z0()});if(K0.mapFS)f++,h.readFile(K0.map,(J0,$0)=>{if(J0!==null)X0(J0,null);else K0.map=$0,Z0()});Z0()})}catch(Y0){let G0=[];try{B5(G0,y,{},v,SY)}catch{}let A0=r6(Y0,$,r,void 0,"");H(R,{command:"error",flags:G0,error:A0},()=>{A0.detail=r.load(A0.detail),X0(C9("Transform failed",[A0],[]),null)})}};if((typeof C==="string"||C instanceof Uint8Array)&&C.length>1048576){let t=u;u=()=>h.writeFile(C,t)}u(null)},formatMessages:({callName:P,refs:R,messages:C,options:y,callback:v})=>{if(!y)throw Error(`Missing second argument in ${P}() call`);let h={},X0=x(y,h,"kind",H0),r=x(y,h,"color",m0),u=x(y,h,"terminalWidth",a6);if(s0(y,h,`in ${P}() call`),X0===void 0)throw Error(`Missing "kind" in ${P}() call`);if(X0!=="error"&&X0!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let t={command:"format-msgs",messages:s1(C,"messages",null,"",u),isWarning:X0==="warning"};if(r!==void 0)t.color=r;if(u!==void 0)t.terminalWidth=u;H(R,t,(Y0,G0)=>{if(Y0)return v(Error(Y0),null);v(null,G0.messages)})},analyzeMetafile:({callName:P,refs:R,metafile:C,options:y,callback:v})=>{if(y===void 0)y={};let h={},X0=x(y,h,"color",m0),r=x(y,h,"verbose",m0);s0(y,h,`in ${P}() call`);let u={command:"analyze-metafile",metafile:C};if(X0!==void 0)u.color=X0;if(r!==void 0)u.verbose=r;H(R,u,(t,Y0)=>{if(t)return v(Error(t),null);v(null,Y0.result)})}}}}function UN($,Z,X,Q,J,G,W,Y,z,q,H){let B=nY(),F=$==="context",L=(I,T)=>{let E=[];try{B5(E,Y,{},z,CY)}catch{}let P=r6(I,G,B,void 0,T);X(J,{command:"error",flags:E,error:P},()=>{P.detail=B.load(P.detail),H(C9(F?"Context failed":"Build failed",[P],[]),null)})},w;if(typeof Y==="object"){let I=Y.plugins;if(I!==void 0){if(!Array.isArray(I))return L(Error('"plugins" must be an array'),"");w=I}}if(w&&w.length>0){if(G.isSync)return L(Error("Cannot use plugins in synchronous API calls"),"");HN(Z,X,Q,J,G,W,Y,w,B).then((I)=>{if(!I.ok)return L(I.error,I.pluginName);try{N(I.requestPlugins,I.runOnEndCallbacks,I.scheduleOnDisposeCallbacks)}catch(T){L(T,"")}},(I)=>L(I,""));return}try{N(null,(I,T)=>T([],[]),()=>{})}catch(I){L(I,"")}function N(I,T,E){let P=G.hasFS,{entries:R,flags:C,write:y,stdinContents:v,stdinResolveDir:h,absWorkingDir:X0,nodePaths:r,mangleCache:u}=qN($,Y,z,CY,P);if(y&&!G.hasFS)throw Error('The "write" option is unavailable in this environment');let t={command:"build",key:Z,entries:R,flags:C,write:y,stdinContents:v,stdinResolveDir:h,absWorkingDir:X0||q,nodePaths:r,context:F};if(I)t.plugins=I;if(u)t.mangleCache=u;let Y0=(l,K0)=>{let V0={errors:S4(l.errors,B),warnings:S4(l.warnings,B),outputFiles:void 0,metafile:void 0,mangleCache:void 0},o=V0.errors.slice(),f=V0.warnings.slice();if(l.outputFiles)V0.outputFiles=l.outputFiles.map(BN);if(l.metafile&&l.metafile.length)V0.metafile=FN(l.metafile);if(l.mangleCache)V0.mangleCache=l.mangleCache;if(l.writeToStdout!==void 0)console.log(t6(l.writeToStdout).replace(/\n$/,""));T(V0,(Z0,J0)=>{if(o.length>0||Z0.length>0){let $0=C9("Build failed",o.concat(Z0),f.concat(J0));return K0($0,null,Z0,J0)}K0(null,V0,Z0,J0)})},G0,A0;if(F)W["on-end"]=(l,K0)=>new Promise((V0)=>{Y0(K0,(o,f,Z0,J0)=>{let $0={errors:Z0,warnings:J0};if(A0)A0(o,f);G0=void 0,A0=void 0,Q(l,$0),V0()})});X(J,t,(l,K0)=>{if(l)return H(Error(l),null);if(!F)return Y0(K0,(f,Z0)=>{return E(),H(f,Z0)});if(K0.errors.length>0)return H(C9("Context failed",K0.errors,K0.warnings),null);let V0=!1,o={rebuild:()=>{if(!G0)G0=new Promise((f,Z0)=>{let J0;A0=(F0,U0)=>{if(!J0)J0=()=>F0?Z0(F0):f(U0)};let $0=()=>{X(J,{command:"rebuild",key:Z},(U0,D0)=>{if(U0)Z0(Error(U0));else if(J0)J0();else $0()})};$0()});return G0},watch:(f={})=>new Promise((Z0,J0)=>{if(!G.hasFS)throw Error('Cannot use the "watch" API in this environment');let $0={},F0=x(f,$0,"delay",a6);s0(f,$0,"in watch() call");let U0={command:"watch",key:Z};if(F0)U0.delay=F0;X(J,U0,(D0)=>{if(D0)J0(Error(D0));else Z0(void 0)})}),serve:(f={})=>new Promise((Z0,J0)=>{if(!G.hasFS)throw Error('Cannot use the "serve" API in this environment');let $0={},F0=x(f,$0,"port",QN),U0=x(f,$0,"host",H0),D0=x(f,$0,"servedir",H0),e=x(f,$0,"keyfile",H0),d0=x(f,$0,"certfile",H0),R0=x(f,$0,"fallback",H0),p0=x(f,$0,"cors",p$),v0=x(f,$0,"onRequest",uY);s0(f,$0,"in serve() call");let i0={command:"serve",key:Z,onRequest:!!v0};if(F0!==void 0)i0.port=F0;if(U0!==void 0)i0.host=U0;if(D0!==void 0)i0.servedir=D0;if(e!==void 0)i0.keyfile=e;if(d0!==void 0)i0.certfile=d0;if(R0!==void 0)i0.fallback=R0;if(p0){let O$={},q$=x(p0,O$,"origin",dY);if(s0(p0,O$,'on "cors" object'),Array.isArray(q$))i0.corsOrigin=q$;else if(q$!==void 0)i0.corsOrigin=[q$]}X(J,i0,(O$,q$)=>{if(O$)return J0(Error(O$));if(v0)W["serve-request"]=(M1,A1)=>{v0(A1.args),Q(M1,{})};Z0(q$)})}),cancel:()=>new Promise((f)=>{if(V0)return f();X(J,{command:"cancel",key:Z},()=>{f()})}),dispose:()=>new Promise((f)=>{if(V0)return f();V0=!0,X(J,{command:"dispose",key:Z},()=>{f(),E(),J.unref()})})};J.ref(),H(null,o)})}}var HN=async($,Z,X,Q,J,G,W,Y,z)=>{let q=[],H=[],B={},F={},L=[],w=0,N=0,I=[],T=!1;Y=[...Y];for(let R of Y){let C={};if(typeof R!=="object")throw Error(`Plugin at index ${N} must be an object`);let y=x(R,C,"name",H0);if(typeof y!=="string"||y==="")throw Error(`Plugin at index ${N} is missing a name`);try{let v=x(R,C,"setup",uY);if(typeof v!=="function")throw Error("Plugin is missing a setup function");s0(R,C,`on plugin ${$$(y)}`);let h={name:y,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};N++;let r=v({initialOptions:W,resolve:(u,t={})=>{if(!T)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!=="string")throw Error("The path to resolve must be a string");let Y0=Object.create(null),G0=x(t,Y0,"pluginName",H0),A0=x(t,Y0,"importer",H0),l=x(t,Y0,"namespace",H0),K0=x(t,Y0,"resolveDir",H0),V0=x(t,Y0,"kind",H0),o=x(t,Y0,"pluginData",z5),f=x(t,Y0,"with",p$);return s0(t,Y0,"in resolve() call"),new Promise((Z0,J0)=>{let $0={command:"resolve",path:u,key:$,pluginName:y};if(G0!=null)$0.pluginName=G0;if(A0!=null)$0.importer=A0;if(l!=null)$0.namespace=l;if(K0!=null)$0.resolveDir=K0;if(V0!=null)$0.kind=V0;else throw Error('Must specify "kind" when calling "resolve"');if(o!=null)$0.pluginData=z.store(o);if(f!=null)$0.with=VN(f,"with");Z(Q,$0,(F0,U0)=>{if(F0!==null)J0(Error(F0));else Z0({errors:S4(U0.errors,z),warnings:S4(U0.warnings,z),path:U0.path,external:U0.external,sideEffects:U0.sideEffects,namespace:U0.namespace,suffix:U0.suffix,pluginData:z.load(U0.pluginData)})})})},onStart(u){let Y0=W5(Error('This error came from the "onStart" callback registered here:'),J,"onStart");q.push({name:y,callback:u,note:Y0}),h.onStart=!0},onEnd(u){let Y0=W5(Error('This error came from the "onEnd" callback registered here:'),J,"onEnd");H.push({name:y,callback:u,note:Y0}),h.onEnd=!0},onResolve(u,t){let G0=W5(Error('This error came from the "onResolve" callback registered here:'),J,"onResolve"),A0={},l=x(u,A0,"filter",q5),K0=x(u,A0,"namespace",H0);if(s0(u,A0,`in onResolve() call for plugin ${$$(y)}`),l==null)throw Error("onResolve() call is missing a filter");let V0=w++;B[V0]={name:y,callback:t,note:G0},h.onResolve.push({id:V0,filter:K5(l),namespace:K0||""})},onLoad(u,t){let G0=W5(Error('This error came from the "onLoad" callback registered here:'),J,"onLoad"),A0={},l=x(u,A0,"filter",q5),K0=x(u,A0,"namespace",H0);if(s0(u,A0,`in onLoad() call for plugin ${$$(y)}`),l==null)throw Error("onLoad() call is missing a filter");let V0=w++;F[V0]={name:y,callback:t,note:G0},h.onLoad.push({id:V0,filter:K5(l),namespace:K0||""})},onDispose(u){L.push(u)},esbuild:J.esbuild});if(r)await r;I.push(h)}catch(v){return{ok:!1,error:v,pluginName:y}}}G["on-start"]=async(R,C)=>{z.clear();let y={errors:[],warnings:[]};await Promise.all(q.map(async({name:v,callback:h,note:X0})=>{try{let r=await h();if(r!=null){if(typeof r!=="object")throw Error(`Expected onStart() callback in plugin ${$$(v)} to return an object`);let u={},t=x(r,u,"errors",o1),Y0=x(r,u,"warnings",o1);if(s0(r,u,`from onStart() callback in plugin ${$$(v)}`),t!=null)y.errors.push(...s1(t,"errors",z,v,void 0));if(Y0!=null)y.warnings.push(...s1(Y0,"warnings",z,v,void 0))}}catch(r){y.errors.push(r6(r,J,z,X0&&X0(),v))}})),X(R,y)},G["on-resolve"]=async(R,C)=>{let y={},v="",h,X0;for(let r of C.ids)try{({name:v,callback:h,note:X0}=B[r]);let u=await h({path:C.path,importer:C.importer,namespace:C.namespace,resolveDir:C.resolveDir,kind:C.kind,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onResolve() callback in plugin ${$$(v)} to return an object`);let t={},Y0=x(u,t,"pluginName",H0),G0=x(u,t,"path",H0),A0=x(u,t,"namespace",H0),l=x(u,t,"suffix",H0),K0=x(u,t,"external",m0),V0=x(u,t,"sideEffects",m0),o=x(u,t,"pluginData",z5),f=x(u,t,"errors",o1),Z0=x(u,t,"warnings",o1),J0=x(u,t,"watchFiles",_$),$0=x(u,t,"watchDirs",_$);if(s0(u,t,`from onResolve() callback in plugin ${$$(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0!=null)y.path=G0;if(A0!=null)y.namespace=A0;if(l!=null)y.suffix=l;if(K0!=null)y.external=K0;if(V0!=null)y.sideEffects=V0;if(o!=null)y.pluginData=z.store(o);if(f!=null)y.errors=s1(f,"errors",z,v,void 0);if(Z0!=null)y.warnings=s1(Z0,"warnings",z,v,void 0);if(J0!=null)y.watchFiles=Y5(J0,"watchFiles");if($0!=null)y.watchDirs=Y5($0,"watchDirs");break}}catch(u){y={id:r,errors:[r6(u,J,z,X0&&X0(),v)]};break}X(R,y)},G["on-load"]=async(R,C)=>{let y={},v="",h,X0;for(let r of C.ids)try{({name:v,callback:h,note:X0}=F[r]);let u=await h({path:C.path,namespace:C.namespace,suffix:C.suffix,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onLoad() callback in plugin ${$$(v)} to return an object`);let t={},Y0=x(u,t,"pluginName",H0),G0=x(u,t,"contents",lY),A0=x(u,t,"resolveDir",H0),l=x(u,t,"pluginData",z5),K0=x(u,t,"loader",H0),V0=x(u,t,"errors",o1),o=x(u,t,"warnings",o1),f=x(u,t,"watchFiles",_$),Z0=x(u,t,"watchDirs",_$);if(s0(u,t,`from onLoad() callback in plugin ${$$(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0 instanceof Uint8Array)y.contents=G0;else if(G0!=null)y.contents=q1(G0);if(A0!=null)y.resolveDir=A0;if(l!=null)y.pluginData=z.store(l);if(K0!=null)y.loader=K0;if(V0!=null)y.errors=s1(V0,"errors",z,v,void 0);if(o!=null)y.warnings=s1(o,"warnings",z,v,void 0);if(f!=null)y.watchFiles=Y5(f,"watchFiles");if(Z0!=null)y.watchDirs=Y5(Z0,"watchDirs");break}}catch(u){y={id:r,errors:[r6(u,J,z,X0&&X0(),v)]};break}X(R,y)};let E=(R,C)=>C([],[]);if(H.length>0)E=(R,C)=>{(async()=>{let y=[],v=[];for(let{name:h,callback:X0,note:r}of H){let u,t;try{let Y0=await X0(R);if(Y0!=null){if(typeof Y0!=="object")throw Error(`Expected onEnd() callback in plugin ${$$(h)} to return an object`);let G0={},A0=x(Y0,G0,"errors",o1),l=x(Y0,G0,"warnings",o1);if(s0(Y0,G0,`from onEnd() callback in plugin ${$$(h)}`),A0!=null)u=s1(A0,"errors",z,h,void 0);if(l!=null)t=s1(l,"warnings",z,h,void 0)}}catch(Y0){u=[r6(Y0,J,z,r&&r(),h)]}if(u){y.push(...u);try{R.errors.push(...u)}catch{}}if(t){v.push(...t);try{R.warnings.push(...t)}catch{}}}C(y,v)})()};let P=()=>{for(let R of L)setTimeout(()=>R(),0)};return T=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:E,scheduleOnDisposeCallbacks:P}};function nY(){let $=new Map,Z=0;return{clear(){$.clear()},load(X){return $.get(X)},store(X){if(X===void 0)return-1;let Q=Z++;return $.set(Q,X),Q}}}function W5($,Z,X){let Q,J=!1;return()=>{if(J)return Q;J=!0;try{let G=($.stack+"").split(`
221
+ `);G.splice(1,1);let W=rY(Z,G,X);if(W)return Q={text:$.message,location:W},Q}catch{}}}function r6($,Z,X,Q,J){let G="Internal error",W=null;try{G=($&&$.message||$)+""}catch{}try{W=rY(Z,($.stack+"").split(`
222
+ `),"")}catch{}return{id:"",pluginName:J,text:G,location:W,notes:Q?[Q]:[],detail:X?X.store($):-1}}function rY($,Z,X){let Q=" at ";if($.readFileSync&&!Z[0].startsWith(Q)&&Z[1].startsWith(Q))for(let J=1;J<Z.length;J++){let G=Z[J];if(!G.startsWith(Q))continue;G=G.slice(Q.length);while(!0){let W=/^(?:new |async )?\S+ \((.*)\)$/.exec(G);if(W){G=W[1];continue}if(W=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(G),W){G=W[1];continue}if(W=/^(\S+):(\d+):(\d+)$/.exec(G),W){let Y;try{Y=$.readFileSync(W[1],"utf8")}catch{break}let z=Y.split(/\r\n|\r|\n|\u2028|\u2029/)[+W[2]-1]||"",q=+W[3]-1,H=z.slice(q,q+X.length)===X?X.length:0;return{file:W[1],namespace:"file",line:+W[2],column:q1(z.slice(0,q)).length,length:q1(z.slice(q,q+H)).length,lineText:z+`
225
223
  `+Z.slice(1).join(`
226
- `),suggestion:""}}break}}return null}function D9($,Z,X){let Q=5;$+=Z.length<1?"":` with ${Z.length} error${Z.length<2?"":"s"}:`+Z.slice(0,Q+1).map((G,W)=>{if(W===Q)return`
224
+ `),suggestion:""}}break}}return null}function C9($,Z,X){let Q=5;$+=Z.length<1?"":` with ${Z.length} error${Z.length<2?"":"s"}:`+Z.slice(0,Q+1).map((G,W)=>{if(W===Q)return`
227
225
  ...`;if(!G.location)return`
228
226
  error: ${G.text}`;let{file:Y,line:z,column:q}=G.location,H=G.pluginName?`[plugin: ${G.pluginName}] `:"";return`
229
- ${Y}:${z}:${q}: ERROR: ${H}${G.text}`}).join("");let J=Error($);for(let[G,W]of[["errors",Z],["warnings",X]])Object.defineProperty(J,G,{configurable:!0,enumerable:!0,get:()=>W,set:(Y)=>Object.defineProperty(J,G,{configurable:!0,enumerable:!0,value:Y})});return J}function j4($,Z){for(let X of $)X.detail=Z.load(X.detail);return $}function BY($,Z,X){if($==null)return null;let Q={},J=k($,Q,"file",H0),G=k($,Q,"namespace",H0),W=k($,Q,"line",p1),Y=k($,Q,"column",p1),z=k($,Q,"length",p1),q=k($,Q,"lineText",H0),H=k($,Q,"suggestion",H0);if(a0($,Q,Z),q){let B=q.slice(0,(Y&&Y>0?Y:0)+(z&&z>0?z:0)+(X&&X>0?X:80));if(!/[\x7F-\uFFFF]/.test(B)&&!/\n/.test(q))q=B}return{file:J||"",namespace:G||"",line:W||0,column:Y||0,length:z||0,lineText:q||"",suggestion:H||""}}function o6($,Z,X,Q,J){let G=[],W=0;for(let Y of $){let z={},q=k(Y,z,"id",H0),H=k(Y,z,"pluginName",H0),B=k(Y,z,"text",H0),L=k(Y,z,"location",VY),M=k(Y,z,"notes",a6),A=k(Y,z,"detail",a5),w=`in element ${W} of "${Z}"`;a0(Y,z,w);let D=[];if(M)for(let j of M){let E={},P=k(j,E,"text",H0),R=k(j,E,"location",VY);a0(j,E,w),D.push({text:P||"",location:BY(R,w,J)})}G.push({id:q||"",pluginName:H||Q,text:B||"",location:BY(L,w,J),notes:D,detail:X?X.store(A):-1}),W++}return G}function r5($,Z){let X=[];for(let Q of $){if(typeof Q!=="string")throw Error(`${s0(Z)} must be an array of strings`);X.push(Q)}return X}function dI($,Z){let X=Object.create(null);for(let Q in $){let J=$[Q];if(typeof J!=="string")throw Error(`key ${s0(Q)} in object ${s0(Z)} must be a string`);X[Q]=J}return X}function lI({path:$,contents:Z,hash:X}){let Q=null;return{path:$,contents:Z,hash:X,get text(){let J=this.contents;if(Q===null||J!==Z)Z=J,Q=r1(J);return Q}}}function s5($){let Z=$.source;if($.flags)Z=`(?${$.flags})${Z}`;return Z}function cI($){let Z;try{Z=r1($)}catch{return _I($)}return JSON.parse(Z)}var w1=w0("fs"),FY=w0("os"),e$=w0("path"),w4=process.env.ESBUILD_BINARY_PATH||w4,pI=($)=>!!$&&$!=="/usr/bin/esbuild",LY="@esbuild/darwin-arm64",MY="@esbuild/darwin-x64",t5={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},e5={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},AY={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function iI(){let $,Z,X=!1,Q=`${process.platform} ${FY.arch()} ${FY.endianness()}`;if(Q in t5)$=t5[Q],Z="esbuild.exe";else if(Q in e5)$=e5[Q],Z="bin/esbuild";else if(Q in AY)$=AY[Q],Z="bin/esbuild",X=!0;else throw Error(`Unsupported platform: ${Q}`);return{pkg:$,subpath:Z,isWASM:X}}function nI(){let $=w0.resolve("esbuild"),Z=e$.dirname(e$.dirname(e$.dirname($)));if(e$.basename(Z)==="node_modules"){for(let X in e5)try{let Q=e5[X];if(w1.existsSync(e$.join(Z,Q)))return Q}catch{}for(let X in t5)try{let Q=t5[X];if(w1.existsSync(e$.join(Z,Q)))return Q}catch{}}return null}function rI($,Z){let X=e$.dirname(w0.resolve("esbuild"));return e$.join(X,`downloaded-${$.replace("/","-")}-${e$.basename(Z)}`)}function aI(){if(pI(w4))if(!w1.existsSync(w4))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${w4}`);else return{binPath:w4,isWASM:!1};let{pkg:$,subpath:Z,isWASM:X}=iI(),Q;try{Q=w0.resolve(`${$}/${Z}`)}catch(J){if(Q=rI($,Z),!w1.existsSync(Q)){try{w0.resolve($)}catch{let G=nI();if(G){let W=`
227
+ ${Y}:${z}:${q}: ERROR: ${H}${G.text}`}).join("");let J=Error($);for(let[G,W]of[["errors",Z],["warnings",X]])Object.defineProperty(J,G,{configurable:!0,enumerable:!0,get:()=>W,set:(Y)=>Object.defineProperty(J,G,{configurable:!0,enumerable:!0,value:Y})});return J}function S4($,Z){for(let X of $)X.detail=Z.load(X.detail);return $}function bY($,Z,X){if($==null)return null;let Q={},J=x($,Q,"file",H0),G=x($,Q,"namespace",H0),W=x($,Q,"line",a6),Y=x($,Q,"column",a6),z=x($,Q,"length",a6),q=x($,Q,"lineText",H0),H=x($,Q,"suggestion",H0);if(s0($,Q,Z),q){let B=q.slice(0,(Y&&Y>0?Y:0)+(z&&z>0?z:0)+(X&&X>0?X:80));if(!/[\x7F-\uFFFF]/.test(B)&&!/\n/.test(q))q=B}return{file:J||"",namespace:G||"",line:W||0,column:Y||0,length:z||0,lineText:q||"",suggestion:H||""}}function s1($,Z,X,Q,J){let G=[],W=0;for(let Y of $){let z={},q=x(Y,z,"id",H0),H=x(Y,z,"pluginName",H0),B=x(Y,z,"text",H0),F=x(Y,z,"location",_Y),L=x(Y,z,"notes",o1),w=x(Y,z,"detail",z5),N=`in element ${W} of "${Z}"`;s0(Y,z,N);let I=[];if(L)for(let T of L){let E={},P=x(T,E,"text",H0),R=x(T,E,"location",_Y);s0(T,E,N),I.push({text:P||"",location:bY(R,N,J)})}G.push({id:q||"",pluginName:H||Q,text:B||"",location:bY(F,N,J),notes:I,detail:X?X.store(w):-1}),W++}return G}function Y5($,Z){let X=[];for(let Q of $){if(typeof Q!=="string")throw Error(`${$$(Z)} must be an array of strings`);X.push(Q)}return X}function VN($,Z){let X=Object.create(null);for(let Q in $){let J=$[Q];if(typeof J!=="string")throw Error(`key ${$$(Q)} in object ${$$(Z)} must be a string`);X[Q]=J}return X}function BN({path:$,contents:Z,hash:X}){let Q=null;return{path:$,contents:Z,hash:X,get text(){let J=this.contents;if(Q===null||J!==Z)Z=J,Q=t6(J);return Q}}}function K5($){let Z=$.source;if($.flags)Z=`(?${$.flags})${Z}`;return Z}function FN($){let Z;try{Z=t6($)}catch{return XN($)}return JSON.parse(Z)}var j6=O0("fs"),xY=O0("os"),$1=O0("path"),P4=process.env.ESBUILD_BINARY_PATH||P4,LN=($)=>!!$&&$!=="/usr/bin/esbuild",kY="@esbuild/darwin-arm64",yY="@esbuild/darwin-x64",U5={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},H5={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},vY={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function MN(){let $,Z,X=!1,Q=`${process.platform} ${xY.arch()} ${xY.endianness()}`;if(Q in U5)$=U5[Q],Z="esbuild.exe";else if(Q in H5)$=H5[Q],Z="bin/esbuild";else if(Q in vY)$=vY[Q],Z="bin/esbuild",X=!0;else throw Error(`Unsupported platform: ${Q}`);return{pkg:$,subpath:Z,isWASM:X}}function AN(){let $=O0.resolve("esbuild"),Z=$1.dirname($1.dirname($1.dirname($)));if($1.basename(Z)==="node_modules"){for(let X in H5)try{let Q=H5[X];if(j6.existsSync($1.join(Z,Q)))return Q}catch{}for(let X in U5)try{let Q=U5[X];if(j6.existsSync($1.join(Z,Q)))return Q}catch{}}return null}function IN($,Z){let X=$1.dirname(O0.resolve("esbuild"));return $1.join(X,`downloaded-${$.replace("/","-")}-${$1.basename(Z)}`)}function NN(){if(LN(P4))if(!j6.existsSync(P4))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${P4}`);else return{binPath:P4,isWASM:!1};let{pkg:$,subpath:Z,isWASM:X}=MN(),Q;try{Q=O0.resolve(`${$}/${Z}`)}catch(J){if(Q=IN($,Z),!j6.existsSync(Q)){try{O0.resolve($)}catch{let G=AN();if(G){let W=`
230
228
  Specifically the "${G}" package is present but this platform
231
229
  needs the "${$}" package instead. People often get into this
232
230
  situation by installing esbuild on Windows or macOS and copying "node_modules"
@@ -243,7 +241,7 @@ If you are installing with yarn, you can try listing both this platform and the
243
241
  other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
244
242
  feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
245
243
  Keep in mind that this means multiple copies of esbuild will be present.
246
- `;if($===MY&&G===LY||$===LY&&G===MY)W=`
244
+ `;if($===yY&&G===kY||$===kY&&G===yY)W=`
247
245
  Specifically the "${G}" package is present but this platform
248
246
  needs the "${$}" package instead. People often get into this
249
247
  situation by installing esbuild with npm running inside of Rosetta 2 and then
@@ -275,125 +273,126 @@ want to do that.
275
273
  If you are installing esbuild with npm, make sure that you don't specify the
276
274
  "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
277
275
  of "package.json" is used by esbuild to install the correct binary executable
278
- for your current platform.`)}throw J}}if(/\.zip\//.test(Q)){let J;try{J=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(G){}if(J){let G=J.getPackageInformation(J.topLevel).packageLocation,W=e$.join(G,"node_modules",".cache","esbuild",`pnpapi-${$.replace("/","-")}-0.28.1-${e$.basename(Z)}`);if(!w1.existsSync(W))w1.mkdirSync(e$.dirname(W),{recursive:!0}),w1.copyFileSync(Q,W),w1.chmodSync(W,493);return{binPath:W,isWASM:X}}}return{binPath:Q,isWASM:X}}var _Y=w0("child_process"),oI=w0("crypto"),c7=w0("path"),i1=w0("fs"),sI=w0("os"),tI=w0("tty"),I$;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{I$=w0("worker_threads")}catch{}let[$,Z]=process.versions.node.split(".");if(+$<12||+$===12&&+Z<17||+$===13&&+Z<13)I$=void 0}var IY,j9=((IY=I$==null?void 0:I$.workerData)==null?void 0:IY.esbuildVersion)==="0.28.1",xY=()=>{if((!w4||!1)&&(c7.basename(__filename)!=="main.js"||c7.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
276
+ for your current platform.`)}throw J}}if(/\.zip\//.test(Q)){let J;try{J=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(G){}if(J){let G=J.getPackageInformation(J.topLevel).packageLocation,W=$1.join(G,"node_modules",".cache","esbuild",`pnpapi-${$.replace("/","-")}-0.28.1-${$1.basename(Z)}`);if(!j6.existsSync(W))j6.mkdirSync($1.dirname(W),{recursive:!0}),j6.copyFileSync(Q,W),j6.chmodSync(W,493);return{binPath:W,isWASM:X}}}return{binPath:Q,isWASM:X}}var aY=O0("child_process"),DN=O0("crypto"),XX=O0("path"),o6=O0("fs"),wN=O0("os"),TN=O0("tty"),N$;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{N$=O0("worker_threads")}catch{}let[$,Z]=process.versions.node.split(".");if(+$<12||+$===12&&+Z<17||+$===13&&+Z<13)N$=void 0}var gY,b9=((gY=N$==null?void 0:N$.workerData)==null?void 0:gY.esbuildVersion)==="0.28.1",oY=()=>{if((!P4||!1)&&(XX.basename(__filename)!=="main.js"||XX.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
279
277
 
280
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:$,isWASM:Z}=aI();if(Z)return["node",[$]];else return[$,[]]}},w9=()=>tI.isatty(2),eI={readFile($,Z){try{let X=i1.readFileSync($,"utf8");try{i1.unlinkSync($)}catch{}Z(null,X)}catch(X){Z(X,null)}},writeFile($,Z){try{let X=bY();i1.writeFileSync(X,$),Z(X)}catch{Z(null)}}},$N={readFile($,Z){try{i1.readFile($,"utf8",(X,Q)=>{try{i1.unlink($,()=>Z(X,Q))}catch{Z(X,Q)}})}catch(X){Z(X,null)}},writeFile($,Z){try{let X=bY();i1.writeFile(X,$,(Q)=>Q!==null?Z(null):Z(X))}catch{Z(null)}}},ZN="0.28.1",XN=($)=>a1().build($),QN=($)=>a1().context($),JN=($,Z)=>a1().transform($,Z),GN=($,Z)=>a1().formatMessages($,Z),WN=($,Z)=>a1().analyzeMetafile($,Z),YN=($)=>{if(I$&&!j9){if(!N$)N$=Q8(I$);return N$.buildSync($)}let Z;return X8((X)=>X.buildOrContext({callName:"buildSync",refs:null,options:$,isTTY:w9(),defaultWD:n1,callback:(Q,J)=>{if(Q)throw Q;Z=J}})),Z},zN=($,Z)=>{if(I$&&!j9){if(!N$)N$=Q8(I$);return N$.transformSync($,Z)}let X;return X8((Q)=>Q.transform({callName:"transformSync",refs:null,input:$,options:Z||{},isTTY:w9(),fs:eI,callback:(J,G)=>{if(J)throw J;X=G}})),X},qN=($,Z)=>{if(I$&&!j9){if(!N$)N$=Q8(I$);return N$.formatMessagesSync($,Z)}let X;return X8((Q)=>Q.formatMessages({callName:"formatMessagesSync",refs:null,messages:$,options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},UN=($,Z)=>{if(I$&&!j9){if(!N$)N$=Q8(I$);return N$.analyzeMetafileSync($,Z)}let X;return X8((Q)=>Q.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof $==="string"?$:JSON.stringify($),options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},KN=()=>{if($8)$8();if(N$)N$.stop();return Promise.resolve()},p7=!1,HN=($)=>{if($=gI($||{}),$.wasmURL)throw Error('The "wasmURL" option only works in the browser');if($.wasmModule)throw Error('The "wasmModule" option only works in the browser');if($.worker)throw Error('The "worker" option only works in the browser');if(p7)throw Error('Cannot call "initialize" more than once');return a1(),p7=!0,Promise.resolve()},n1=process.cwd(),N9,$8,a1=()=>{if(N9)return N9;let[$,Z]=xY(),X=_Y.spawn($,Z.concat("--service=0.28.1","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:n1}),{readFromStdout:Q,afterClose:J,service:G}=PY({writeToStdin(H){X.stdin.write(H,(B)=>{if(B)J(B)})},readFileSync:i1.readFileSync,isSync:!1,hasFS:!0,esbuild:T9});X.stdin.on("error",J),X.on("error",J);let{stdin:W,stdout:Y}=X;Y.on("data",Q),Y.on("end",J),$8=()=>{W.destroy(),Y.destroy(),X.kill(),p7=!1,N9=void 0,$8=void 0};let z=0;if(X.unref(),W.unref)W.unref();if(Y.unref)Y.unref();let q={ref(){if(++z===1)X.ref()},unref(){if(--z===0)X.unref()}};return N9={build:(H)=>new Promise((B,L)=>{G.buildOrContext({callName:"build",refs:q,options:H,isTTY:w9(),defaultWD:n1,callback:(M,A)=>M?L(M):B(A)})}),context:(H)=>new Promise((B,L)=>G.buildOrContext({callName:"context",refs:q,options:H,isTTY:w9(),defaultWD:n1,callback:(M,A)=>M?L(M):B(A)})),transform:(H,B)=>new Promise((L,M)=>G.transform({callName:"transform",refs:q,input:H,options:B||{},isTTY:w9(),fs:$N,callback:(A,w)=>A?M(A):L(w)})),formatMessages:(H,B)=>new Promise((L,M)=>G.formatMessages({callName:"formatMessages",refs:q,messages:H,options:B,callback:(A,w)=>A?M(A):L(w)})),analyzeMetafile:(H,B)=>new Promise((L,M)=>G.analyzeMetafile({callName:"analyzeMetafile",refs:q,metafile:typeof H==="string"?H:JSON.stringify(H),options:B,callback:(A,w)=>A?M(A):L(w)}))},N9},X8=($)=>{let[Z,X]=xY(),Q=new Uint8Array,{readFromStdout:J,afterClose:G,service:W}=PY({writeToStdin(z){if(Q.length!==0)throw Error("Must run at most one command");Q=z},isSync:!0,hasFS:!0,esbuild:T9});$(W);let Y=_Y.execFileSync(Z,X.concat("--service=0.28.1"),{cwd:n1,windowsHide:!0,input:Q,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});J(Y),G(null)},bY=()=>{return c7.join(sI.tmpdir(),`esbuild-${oI.randomBytes(32).toString("hex")}`)},N$=null,Q8=($)=>{let{port1:Z,port2:X}=new $.MessageChannel,Q=new $.Worker(__filename,{workerData:{workerPort:X,defaultWD:n1,esbuildVersion:"0.28.1"},transferList:[X],execArgv:[]}),J=0,G=(q)=>{let H=Error(`Build failed with 1 error:
281
- error: ${q}`),B=[{id:"",pluginName:"",text:q,location:null,notes:[],detail:void 0}];return H.errors=B,H.warnings=[],H},W=(q)=>{if(!q)return;let H=q.plugins;if(H&&H.length>0)throw G("Cannot use plugins in synchronous API calls")},Y=(q,H)=>{for(let B in H)q[B]=H[B]},z=(q,H)=>{let B=J++,L=new SharedArrayBuffer(8),M=new Int32Array(L),A={sharedBuffer:L,id:B,command:q,args:H};Q.postMessage(A);let w=Atomics.wait(M,0,0);if(w!=="ok"&&w!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+w);let{message:{id:D,resolve:j,reject:E,properties:P}}=$.receiveMessageOnPort(Z);if(B!==D)throw Error(`Internal error: Expected id ${B} but got id ${D}`);if(E)throw Y(E,P),E;return j};return Q.unref(),{buildSync(q){return W(q),z("build",[q])},transformSync(q,H){return z("transform",[q,H])},formatMessagesSync(q,H){return z("formatMessages",[q,H])},analyzeMetafileSync(q,H){return z("analyzeMetafile",[q,H])},stop(){Q.terminate(),N$=null}}},VN=()=>{let $=I$.workerData.workerPort,Z=I$.parentPort,X=(Q)=>{let J={};if(Q&&typeof Q==="object")for(let G in Q)J[G]=Q[G];return J};try{let Q=a1();n1=I$.workerData.defaultWD,Z.on("message",(J)=>{(async()=>{let{sharedBuffer:G,id:W,command:Y,args:z}=J,q=new Int32Array(G);try{switch(Y){case"build":$.postMessage({id:W,resolve:await Q.build(z[0])});break;case"transform":$.postMessage({id:W,resolve:await Q.transform(z[0],z[1])});break;case"formatMessages":$.postMessage({id:W,resolve:await Q.formatMessages(z[0],z[1])});break;case"analyzeMetafile":$.postMessage({id:W,resolve:await Q.analyzeMetafile(z[0],z[1])});break;default:throw Error(`Invalid command: ${Y}`)}}catch(H){$.postMessage({id:W,reject:H,properties:X(H)})}Atomics.add(q,0,1),Atomics.notify(q,0,1/0)})()})}catch(Q){Z.on("message",(J)=>{let{sharedBuffer:G,id:W}=J,Y=new Int32Array(G);$.postMessage({id:W,reject:Q,properties:X(Q)}),Atomics.add(Y,0,1),Atomics.notify(Y,0,1/0)})}};if(j9)VN();var BN=T9});import{rmSync as FN,writeFileSync as yY}from"node:fs";import{createRequire as LN}from"node:module";import{join as vY,resolve as MN}from"node:path";function fY($){return l1($)||$.startsWith("./")||$.startsWith("../")}function n7(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function hY($,Z,X){if(l1($)){let Q=$.slice(zY.length);if(n7())return LN(vY(X,"package.json")).resolve(Q);return Bun.resolveSync(Q,X)}return MN(Z,$)}function AN($){if($==="cloudflare-workers"||$==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:$==="bun"?"bun":"node"}}function uY($){return $==="node"||$==="bun"?"node":"browser"}function IN($){if($==="workerd")return"browser";return $}async function r7($,Z){let X=Z.external??[];if(n7()){await(await Promise.resolve().then(() => B$(O9(),1))).build({bundle:!0,...Z.conditions?{conditions:Z.conditions}:{},entryPoints:[$.entryPath],external:X,format:"esm",logLevel:"silent",minify:!1,outfile:$.outfile,platform:uY(Z.target)});return}let Q=await Bun.build({...Z.conditions?{conditions:Z.conditions}:{},entrypoints:[$.entryPath],external:X,format:"esm",minify:!1,target:IN(Z.target),throw:!1});if(!Q.success||Q.outputs.length===0){let J=Q.logs.map(String).join(`
278
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:$,isWASM:Z}=NN();if(Z)return["node",[$]];else return[$,[]]}},S9=()=>TN.isatty(2),jN={readFile($,Z){try{let X=o6.readFileSync($,"utf8");try{o6.unlinkSync($)}catch{}Z(null,X)}catch(X){Z(X,null)}},writeFile($,Z){try{let X=sY();o6.writeFileSync(X,$),Z(X)}catch{Z(null)}}},ON={readFile($,Z){try{o6.readFile($,"utf8",(X,Q)=>{try{o6.unlink($,()=>Z(X,Q))}catch{Z(X,Q)}})}catch(X){Z(X,null)}},writeFile($,Z){try{let X=sY();o6.writeFile(X,$,(Q)=>Q!==null?Z(null):Z(X))}catch{Z(null)}}},EN="0.28.1",RN=($)=>e6().build($),PN=($)=>e6().context($),CN=($,Z)=>e6().transform($,Z),SN=($,Z)=>e6().formatMessages($,Z),_N=($,Z)=>e6().analyzeMetafile($,Z),bN=($)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.buildSync($)}let Z;return F5((X)=>X.buildOrContext({callName:"buildSync",refs:null,options:$,isTTY:S9(),defaultWD:s6,callback:(Q,J)=>{if(Q)throw Q;Z=J}})),Z},xN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.transformSync($,Z)}let X;return F5((Q)=>Q.transform({callName:"transformSync",refs:null,input:$,options:Z||{},isTTY:S9(),fs:jN,callback:(J,G)=>{if(J)throw J;X=G}})),X},kN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.formatMessagesSync($,Z)}let X;return F5((Q)=>Q.formatMessages({callName:"formatMessagesSync",refs:null,messages:$,options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},yN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.analyzeMetafileSync($,Z)}let X;return F5((Q)=>Q.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof $==="string"?$:JSON.stringify($),options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},vN=()=>{if(V5)V5();if(D$)D$.stop();return Promise.resolve()},QX=!1,gN=($)=>{if($=zN($||{}),$.wasmURL)throw Error('The "wasmURL" option only works in the browser');if($.wasmModule)throw Error('The "wasmModule" option only works in the browser');if($.worker)throw Error('The "worker" option only works in the browser');if(QX)throw Error('Cannot call "initialize" more than once');return e6(),QX=!0,Promise.resolve()},s6=process.cwd(),P9,V5,e6=()=>{if(P9)return P9;let[$,Z]=oY(),X=aY.spawn($,Z.concat("--service=0.28.1","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:s6}),{readFromStdout:Q,afterClose:J,service:G}=iY({writeToStdin(H){X.stdin.write(H,(B)=>{if(B)J(B)})},readFileSync:o6.readFileSync,isSync:!1,hasFS:!0,esbuild:_9});X.stdin.on("error",J),X.on("error",J);let{stdin:W,stdout:Y}=X;Y.on("data",Q),Y.on("end",J),V5=()=>{W.destroy(),Y.destroy(),X.kill(),QX=!1,P9=void 0,V5=void 0};let z=0;if(X.unref(),W.unref)W.unref();if(Y.unref)Y.unref();let q={ref(){if(++z===1)X.ref()},unref(){if(--z===0)X.unref()}};return P9={build:(H)=>new Promise((B,F)=>{G.buildOrContext({callName:"build",refs:q,options:H,isTTY:S9(),defaultWD:s6,callback:(L,w)=>L?F(L):B(w)})}),context:(H)=>new Promise((B,F)=>G.buildOrContext({callName:"context",refs:q,options:H,isTTY:S9(),defaultWD:s6,callback:(L,w)=>L?F(L):B(w)})),transform:(H,B)=>new Promise((F,L)=>G.transform({callName:"transform",refs:q,input:H,options:B||{},isTTY:S9(),fs:ON,callback:(w,N)=>w?L(w):F(N)})),formatMessages:(H,B)=>new Promise((F,L)=>G.formatMessages({callName:"formatMessages",refs:q,messages:H,options:B,callback:(w,N)=>w?L(w):F(N)})),analyzeMetafile:(H,B)=>new Promise((F,L)=>G.analyzeMetafile({callName:"analyzeMetafile",refs:q,metafile:typeof H==="string"?H:JSON.stringify(H),options:B,callback:(w,N)=>w?L(w):F(N)}))},P9},F5=($)=>{let[Z,X]=oY(),Q=new Uint8Array,{readFromStdout:J,afterClose:G,service:W}=iY({writeToStdin(z){if(Q.length!==0)throw Error("Must run at most one command");Q=z},isSync:!0,hasFS:!0,esbuild:_9});$(W);let Y=aY.execFileSync(Z,X.concat("--service=0.28.1"),{cwd:s6,windowsHide:!0,input:Q,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});J(Y),G(null)},sY=()=>{return XX.join(wN.tmpdir(),`esbuild-${DN.randomBytes(32).toString("hex")}`)},D$=null,L5=($)=>{let{port1:Z,port2:X}=new $.MessageChannel,Q=new $.Worker(__filename,{workerData:{workerPort:X,defaultWD:s6,esbuildVersion:"0.28.1"},transferList:[X],execArgv:[]}),J=0,G=(q)=>{let H=Error(`Build failed with 1 error:
279
+ error: ${q}`),B=[{id:"",pluginName:"",text:q,location:null,notes:[],detail:void 0}];return H.errors=B,H.warnings=[],H},W=(q)=>{if(!q)return;let H=q.plugins;if(H&&H.length>0)throw G("Cannot use plugins in synchronous API calls")},Y=(q,H)=>{for(let B in H)q[B]=H[B]},z=(q,H)=>{let B=J++,F=new SharedArrayBuffer(8),L=new Int32Array(F),w={sharedBuffer:F,id:B,command:q,args:H};Q.postMessage(w);let N=Atomics.wait(L,0,0);if(N!=="ok"&&N!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+N);let{message:{id:I,resolve:T,reject:E,properties:P}}=$.receiveMessageOnPort(Z);if(B!==I)throw Error(`Internal error: Expected id ${B} but got id ${I}`);if(E)throw Y(E,P),E;return T};return Q.unref(),{buildSync(q){return W(q),z("build",[q])},transformSync(q,H){return z("transform",[q,H])},formatMessagesSync(q,H){return z("formatMessages",[q,H])},analyzeMetafileSync(q,H){return z("analyzeMetafile",[q,H])},stop(){Q.terminate(),D$=null}}},fN=()=>{let $=N$.workerData.workerPort,Z=N$.parentPort,X=(Q)=>{let J={};if(Q&&typeof Q==="object")for(let G in Q)J[G]=Q[G];return J};try{let Q=e6();s6=N$.workerData.defaultWD,Z.on("message",(J)=>{(async()=>{let{sharedBuffer:G,id:W,command:Y,args:z}=J,q=new Int32Array(G);try{switch(Y){case"build":$.postMessage({id:W,resolve:await Q.build(z[0])});break;case"transform":$.postMessage({id:W,resolve:await Q.transform(z[0],z[1])});break;case"formatMessages":$.postMessage({id:W,resolve:await Q.formatMessages(z[0],z[1])});break;case"analyzeMetafile":$.postMessage({id:W,resolve:await Q.analyzeMetafile(z[0],z[1])});break;default:throw Error(`Invalid command: ${Y}`)}}catch(H){$.postMessage({id:W,reject:H,properties:X(H)})}Atomics.add(q,0,1),Atomics.notify(q,0,1/0)})()})}catch(Q){Z.on("message",(J)=>{let{sharedBuffer:G,id:W}=J,Y=new Int32Array(G);$.postMessage({id:W,reject:Q,properties:X(Q)}),Atomics.add(Y,0,1),Atomics.notify(Y,0,1/0)})}};if(b9)fN();var hN=_9});import{rmSync as uN,writeFileSync as eY}from"node:fs";import{createRequire as mN}from"node:module";import{join as $z,resolve as dN}from"node:path";function Xz($){return n6($)||$.startsWith("./")||$.startsWith("../")}function GX(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function Qz($,Z,X){if(n6($)){let Q=$.slice(jY.length);if(GX())return mN($z(X,"package.json")).resolve(Q);return Bun.resolveSync(Q,X)}return dN(Z,$)}function lN($){if($==="cloudflare-workers"||$==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:$==="bun"?"bun":"node"}}function Jz($){return $==="node"||$==="bun"?"node":"browser"}function cN($){if($==="workerd")return"browser";return $}async function WX($,Z){let X=Z.external??[];if(GX()){await(await Promise.resolve().then(() => F$(x9(),1))).build({bundle:!0,...Z.conditions?{conditions:Z.conditions}:{},entryPoints:[$.entryPath],external:X,format:"esm",logLevel:"silent",minify:!1,outfile:$.outfile,platform:Jz(Z.target)});return}let Q=await Bun.build({...Z.conditions?{conditions:Z.conditions}:{},entrypoints:[$.entryPath],external:X,format:"esm",minify:!1,target:cN(Z.target),throw:!1});if(!Q.success||Q.outputs.length===0){let J=Q.logs.map(String).join(`
282
280
  `);throw Error(`Bun.build failed for ${$.entryPath}:
283
- ${J}`)}yY($.outfile,await Q.outputs[0].text(),"utf8")}async function mY($,{projectRoot:Z,outfile:X,adapter:Q}){let J=AN(Q);if(n7()){await(await Promise.resolve().then(() => B$(O9(),1))).build({bundle:!0,...J.conditions?{conditions:J.conditions}:{},external:J.external??[],format:"esm",logLevel:"silent",minify:!1,outfile:X,platform:uY(J.target),stdin:{contents:$,loader:"js",resolveDir:Z,sourcefile:"jx-worker-entry.js"}});return}let G=vY(Z,".jx-worker-entry.mjs");yY(G,$,"utf8");try{await r7({entryPath:G,outfile:X},J)}finally{FN(G,{force:!0})}}var gY;var dY=t(()=>{gY=["@vue/reactivity","lit-html"]});import{readFileSync as lY,readdirSync as NN}from"node:fs";import{extname as a7,join as DN,relative as wN,resolve as TN}from"node:path";async function E9($,Z){let X=lY($,"utf8");if($.endsWith(".json"))return A1(X,$);let Q=a7($).toLowerCase(),J=Z?.byExtension(Q,"parse");if(!J)throw Error(`No format class registered for "${Q}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await J.call("parse",X)}async function cY($,Z){let X=[],Q=new Set([".json",...Z?.documentExtensions("page")??[]]);return await pY($,$,X,Q,Z),X.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),X}async function pY($,Z,X,Q,J){let G=NN($,{withFileTypes:!0});for(let W of G){let Y=DN($,W.name);if(W.isDirectory()){if(W.name.startsWith("_"))continue;await pY(Y,Z,X,Q,J);continue}let z=a7(W.name).toLowerCase();if(!Q.has(z))continue;if(W.name.startsWith("_"))continue;let q=wN(Z,Y),H=await jN(q,Y,J);if(H)X.push(H)}}async function jN($,Z,X){let Q=a7($),J=Q?$.slice(0,-Q.length):$;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],W=!1,Y=!1,z=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,L)=>{if(B)return Y=!0,W=!0,G.push(B),"*";return W=!0,G.push(L),`:${L}`}),q=null;try{let B=(await E9(Z,X)).$layout;if(typeof B==="string")q=B}catch{}return{$layout:q,isCatchAll:Y,isDynamic:W,params:G,relativePath:$,sourcePath:Z,urlPattern:z}}async function iY($,Z,X={},Q,J){let G=[];for(let W of $){if(!W.isDynamic){G.push(W);continue}let Y;try{Y=await E9(W.sourcePath,Q?.formats)}catch{G.push(W);continue}if(!Y.$paths){console.warn(`Warning: dynamic route ${W.urlPattern} has no $paths — skipping`);continue}let z=await ON(Y.$paths,Z,X,Q,J);for(let q of z){let H=W.urlPattern,B={};for(let[L,M]of Object.entries(q))B[L]=String(M),H=H.replace(`:${L}`,B[L]),H=H.replace("*",B[L]);G.push({...W,_pathParams:B,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:H})}}return G}async function ON($,Z,X,Q,J){if(Array.isArray($))return $;if("values"in $&&Array.isArray($.values)){let G=typeof $.param==="string"?$.param:"value";return $.values.map((W)=>({[G]:W}))}if("$ref"in $&&typeof $.$ref==="string"&&$.$ref){let G=$.$ref,W=TN(Z,G),Y;try{Y=JSON.parse(lY(W,"utf8"))}catch(H){return console.warn(`Warning: $paths.$ref could not load "${G}": ${H.message}`),[]}if(!Array.isArray(Y))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let z=typeof $.param==="string"?$.param:"id",q=typeof $.field==="string"?$.field:"id";return Y.map((H)=>({[z]:H[q]??H.id??String(H)}))}for(let G of Object.keys($)){let W=Q?.byPathsDiscriminator(G);if(!W?.project)continue;return await W.call("resolvePaths",$,{data:X[W.project.key],projectConfig:J,root:Z})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var nY=t(()=>{I1()});async function rY($,Z,X){let Q={},J=d5($);for(let G of X.projectContributions()){let W=G.project?.key;if(!W||!G.capabilities.projectData)continue;if(!Z||!(W in Z))continue;Q[W]=await G.call("projectData",Z[W],{io:J,projectConfig:Z,registry:X,root:$})}return Q}var aY=t(()=>{i6()});import{existsSync as EN,readFileSync as RN}from"node:fs";import{resolve as PN}from"node:path";function o7($,Z,X){let Q=$.$layout??Z.defaults?.layout??null;if(!Q)return $;let J=PN(X,Q);if(!EN(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=A1(RN(J,"utf8"),J)}catch(q){throw Error(`Invalid layout JSON at ${J}: ${q.message}`,{cause:q})}if(G.$layout)G=o7(G,Z,X);let W=$.children??[],Y=typeof W==="string"?[W]:Array.isArray(W)?W:[],z=SN(G);if(CN(z,Y),$.state)z.state={...z.state,...$.state};if($.$media)z.$media={...z.$media,...$.$media};if($.style)z.style={...z.style,...$.style};if($.attributes)z.attributes={...z.attributes,...$.attributes};if($.$head)z._pageHead=$.$head;if($.title)z._pageTitle=$.title;return delete z.$layout,z}function CN($,Z){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let X=new Map,Q=[];for(let J of Z)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!X.has(G))X.set(G,[]);X.get(G).push(J)}else Q.push(J);oY($,X,Q)}function oY($,Z,X){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let Q=[];for(let J of $.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&Z.has(G))Q.push(...Z.get(G)),Z.delete(G);else if(!G&&X.length>0)Q.push(...X);else if(Array.isArray(J.children))Q.push(...J.children)}else oY(J,Z,X),Q.push(J);$.children=Q}function SN($){return structuredClone($)}var sY=t(()=>{I1()});function tY($=[],Z=[],X=[],Q={}){let J=[{attributes:{charset:Q.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let Y of[...J,...$,...Z,...X]){let z=_N(Y);G.set(z,Y)}let W=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[W],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let Y=new URL(Q.pageUrl,Q.siteUrl).href;if(G.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"}),!G.has("meta:og:url"))G.set("meta:og:url",{attributes:{content:Y,property:"og:url"},tagName:"meta"})}if(Q.siteName&&!G.has("meta:og:site_name"))G.set("meta:og:site_name",{attributes:{content:Q.siteName,property:"og:site_name"},tagName:"meta"});return[...G.values()]}function _N($){if(!$||typeof $!=="object")return String($);let Z=$.tagName??"unknown",X=$.attributes??{};if(Z==="title")return"title";if(X.charset)return"meta:charset";if(Z==="meta"&&X.name)return`meta:${X.name}`;if(Z==="meta"&&X.property)return`meta:${X.property}`;if(Z==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(Z==="script"&&X.src)return`script:${X.src}`;if(Z==="style"){let Q=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`style:${xN(Q)}`}return`${Z}:${JSON.stringify($)}`}function xN($){let Z=0;for(let X=0;X<$.length;X++)Z=Math.trunc((Z<<5)-Z+($.codePointAt(X)??0));return Z.toString(36)}function eY($){return $.map((Z)=>bN(Z)).join(`
284
- `)}function bN($){if(typeof $==="string")return $;if(!$||typeof $!=="object")return"";let Z=$.tagName,X=$.attributes??{},Q=Object.entries(X).map(([Y,z])=>z===!0?Y:`${Y}="${kN(z)}"`).join(" "),J=Q?`<${Z} ${Q}>`:`<${Z}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(Z))return J;let W=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`${J}${W}</${Z}>`}function kN($){return String($).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as yN,relative as vN,resolve as gN}from"node:path";function $z($,Z,X,Q=null){if(!$.state)$.state={};if($.state.$site={name:Z.name??"Jx Site",url:Z.url??"",...Z.state},$.state.$page={params:X._pathParams??{},title:$.title??$._pageTitle??Z.name??"",url:X.urlPattern},Z.state){for(let[J,G]of Object.entries(Z.state))if(J!=="$site"&&J!=="$page"&&!(J in $.state))$.state[J]=G}if(Z.$media)$.$media={...Z.$media,...$.$media};if(Z.imports&&Object.keys(Z.imports).length>0){if(!$.imports)$.imports={};for(let[J,G]of Object.entries(Z.imports))if(!(J in $.imports)){let W=G;if(Q&&X.sourcePath&&(W.startsWith("./")||W.startsWith("../"))){let Y=gN(Q,W);$.imports[J]=`./${vN(yN(X.sourcePath),Y)}`}else $.imports[J]=W}}if(Z.$elements?.length)if(!$.$elements?.length)$.$elements=[...Z.$elements];else{let J=new Set,G=[];for(let W of[...Z.$elements,...$.$elements]){let Y=typeof W==="string"?W:W?.$ref;if(Y&&!J.has(Y))J.add(Y),G.push(W)}$.$elements=G}return $}var Zz=()=>{};import{readFileSync as fN}from"node:fs";import{dirname as s7,resolve as J8}from"node:path";import{createRequire as hN}from"node:module";async function Xz($,Z,X,Q={}){let J=$.imports??{},{state:G}=$;if(!G)return;for(let[W,Y]of Object.entries(G)){if(!f1(Y))continue;if(uN.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler"){let z=Q.registry?.byName(Y.$prototype);if(z?.capabilities.lower)try{let q=await z.call("lower",Y,{projectConfig:Q.config,root:X,route:Z});if(q&&typeof q==="object"&&!Array.isArray(q)){let H=q.$bundle;if(Array.isArray(H)){for(let B of H)if(typeof B==="string")Q.registerBundle?.(B)}delete q.$bundle}G[W]=q}catch(q){console.warn(`prototype-resolver: failed to lower "${W}" ($prototype: "${Y.$prototype}"):`,M1(q))}continue}if(!Y.$src){let z=J[Y.$prototype]??dN(Q,Y.$prototype);if(!z)continue;Y.$src=z}try{let z=await lN(Y,Z,X,G,Q);if(Y.timing&&z&&typeof z==="object"&&!Array.isArray(z))z.timing=Y.timing;G[W]=z}catch(z){console.warn(`prototype-resolver: failed to resolve "${W}" ($prototype: "${Y.$prototype}"):`,M1(z))}}}function dN($,Z){return $.registry?.byName(Z)?.classPath}async function lN($,Z,X,Q,J){let G=$.$src;if(!G)throw Error(`$prototype "${$.$prototype}" has no $src to resolve`);let W;if(G.startsWith("./")||G.startsWith("../"))W=Z.sourcePath?J8(s7(Z.sourcePath),G):J8(X,G);else W=hN(J8(X,"package.json")).resolve(G);let Y=fN(W,"utf8"),z=_W(Y,W);if(!z.$implementation)throw Error(`${G} has no $implementation field`);let q=J8(s7(W),z.$implementation),H=await m5(q),B=$.$export??z.title??$.$prototype,L=H[B]??H.default?.[B];if(!L)throw Error(`Module ${z.$implementation} does not export "${B}"`);let M={};for(let[w,D]of Object.entries($))if(!mN.has(w))M[w]=D;if(M.src&&!M.basePath&&Z.sourcePath)M.basePath=s7(Z.sourcePath);M._project={config:J.config??null,root:X,...J.sections},M._document={route:Z,state:Q};let A=new L(M);if(typeof A.resolve==="function")return await A.resolve();return A}var uN,mN;var Qz=t(()=>{i6();D6();I1();uN=new Set(["Function","LocalStorage","SessionStorage","Array"]),mN=new Set(["$prototype","$src","$export","timing","default","description"])});var Jz=($)=>typeof $<"u"&&$!==null,cN=($)=>typeof $==="object",pN=($)=>Object.prototype.toString.call($)==="[object Object]",iN=($)=>typeof $==="function",nN=($)=>typeof $==="boolean",rN=($)=>$ instanceof Buffer,aN=($)=>{if(Jz($))switch($.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},oN=($)=>$ instanceof ArrayBuffer,sN=($)=>typeof $==="string"&&$.length>0,tN=($)=>typeof $==="number"&&Number.isFinite($),eN=($)=>Number.isInteger($),$D=($,Z,X)=>$>=Z&&$<=X,ZD=($,Z)=>Z.includes($),XD=($,Z,X)=>Error(`Expected ${Z} for ${$} but received ${X} of type ${typeof X}`),QD=($,Z)=>{return Z.message=$.message,Z},K;var R6=t(()=>{/*!
281
+ ${J}`)}eY($.outfile,await Q.outputs[0].text(),"utf8")}async function Gz($,{projectRoot:Z,outfile:X,adapter:Q}){let J=lN(Q);if(GX()){await(await Promise.resolve().then(() => F$(x9(),1))).build({bundle:!0,...J.conditions?{conditions:J.conditions}:{},external:J.external??[],format:"esm",logLevel:"silent",minify:!1,outfile:X,platform:Jz(J.target),stdin:{contents:$,loader:"js",resolveDir:Z,sourcefile:"jx-worker-entry.js"}});return}let G=$z(Z,".jx-worker-entry.mjs");eY(G,$,"utf8");try{await WX({entryPath:G,outfile:X},J)}finally{uN(G,{force:!0})}}var Zz;var Wz=s(()=>{R9();Zz=["@vue/reactivity","lit-html"]});import{readFileSync as Yz,readdirSync as pN}from"node:fs";import{extname as YX,join as iN,relative as nN,resolve as rN}from"node:path";async function _4($,Z){let X=Yz($,"utf8");if($.endsWith(".json"))return I6(X,$);let Q=YX($).toLowerCase(),J=Z?.byExtension(Q,"parse");if(!J)throw Error(`No format class registered for "${Q}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await J.call("parse",X)}async function zz($,Z){let X=[],Q=new Set([".json",...Z?.documentExtensions("page")??[]]);return await qz($,$,X,Q,Z),X.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),X}async function qz($,Z,X,Q,J){let G=pN($,{withFileTypes:!0});for(let W of G){let Y=iN($,W.name);if(W.isDirectory()){if(W.name.startsWith("_"))continue;await qz(Y,Z,X,Q,J);continue}let z=YX(W.name).toLowerCase();if(!Q.has(z))continue;if(W.name.startsWith("_"))continue;let q=nN(Z,Y),H=await aN(q,Y,J);if(H)X.push(H)}}async function aN($,Z,X){let Q=YX($),J=Q?$.slice(0,-Q.length):$;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],W=!1,Y=!1,z=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,F)=>{if(B)return Y=!0,W=!0,G.push(B),"*";return W=!0,G.push(F),`:${F}`}),q=null;try{let B=(await _4(Z,X)).$layout;if(typeof B==="string")q=B}catch{}return{$layout:q,isCatchAll:Y,isDynamic:W,params:G,relativePath:$,sourcePath:Z,urlPattern:z}}async function Kz($,Z,X={},Q,J){let G=[];for(let W of $){if(!W.isDynamic){G.push(W);continue}let Y;try{Y=await _4(W.sourcePath,Q?.formats)}catch{G.push(W);continue}if(!Y.$paths){console.warn(`Warning: dynamic route ${W.urlPattern} has no $paths — skipping`);continue}let z=await oN(Y.$paths,Z,X,Q,J);for(let q of z){let H=W.urlPattern,B={};for(let[F,L]of Object.entries(q))B[F]=String(L),H=H.replace(`:${F}`,B[F]),H=H.replace("*",B[F]);G.push({...W,_pathParams:B,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:H})}}return G}async function oN($,Z,X,Q,J){if(Array.isArray($))return $;if("values"in $&&Array.isArray($.values)){let G=typeof $.param==="string"?$.param:"value";return $.values.map((W)=>({[G]:W}))}if("$ref"in $&&typeof $.$ref==="string"&&$.$ref){let G=$.$ref,W=rN(Z,G),Y;try{Y=JSON.parse(Yz(W,"utf8"))}catch(H){return console.warn(`Warning: $paths.$ref could not load "${G}": ${H.message}`),[]}if(!Array.isArray(Y))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let z=typeof $.param==="string"?$.param:"id",q=typeof $.field==="string"?$.field:"id";return Y.map((H)=>({[z]:H[q]??H.id??String(H)}))}for(let G of Object.keys($)){let W=Q?.byPathsDiscriminator(G);if(!W?.project)continue;return await W.call("resolvePaths",$,{data:X[W.project.key],projectConfig:J,root:Z})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var Uz=s(()=>{N6()});async function Hz($,Z,X){let Q={},J=e8($);for(let G of X.projectContributions()){let W=G.project?.key;if(!W||!G.capabilities.projectData)continue;if(!Z||!(W in Z))continue;Q[W]=await G.call("projectData",Z[W],{io:J,projectConfig:Z,registry:X,root:$})}return Q}var Vz=s(()=>{r1()});import{cpSync as sN,existsSync as tN,mkdirSync as eN}from"node:fs";import{dirname as $D,resolve as ZD}from"node:path";async function Bz($,Z,X){let Q=[],J=[],G=new Map;for(let W of $.assetProviders()){let Y=W.project?.key,z=Y?Z[Y]:void 0;if(Y&&(z==null||typeof z==="object"&&Object.keys(z).length===0))continue;try{let q=await W.call("assets",z??null,{projectConfig:Z,root:X});for(let H of q??[]){if(!H?.urlPrefix||!H.dir)continue;let B={dir:H.dir,urlPrefix:J5(H.urlPrefix)},F=G.get(B.urlPrefix);if(F){if(F.dir!==B.dir)J.push(`Asset mount conflict: "${B.urlPrefix}" is claimed by both "${F.dir}" and "${B.dir}"`);continue}G.set(B.urlPrefix,B),Q.push(B)}}catch(q){J.push(`Error in ${W.name}.assets: ${q.message}`)}}return{errors:J,mounts:Q}}function zX($,Z,X){if(Z.length===0||!$)return;for(let Q of RY($,Z))X.add(Q)}function Fz($,Z,X){let Q=0,J=[];for(let G of $){let W=G5(Z,G);if(!W||!tN(W)){J.push(G);continue}let Y=ZD(X,decodeURIComponent(G).replace(/^\//,""));eN($D(Y),{recursive:!0}),sN(W,Y),Q+=1}return{copied:Q,missing:J}}var Lz=s(()=>{R9()});import{existsSync as XD,readFileSync as QD}from"node:fs";import{resolve as JD}from"node:path";function qX($,Z,X){let Q=$.$layout??Z.defaults?.layout??null;if(!Q)return $;let J=JD(X,Q);if(!XD(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=I6(QD(J,"utf8"),J)}catch(q){throw Error(`Invalid layout JSON at ${J}: ${q.message}`,{cause:q})}if(G.$layout)G=qX(G,Z,X);let W=$.children??[],Y=typeof W==="string"?[W]:Array.isArray(W)?W:[],z=WD(G);if(GD(z,Y),$.state)z.state={...z.state,...$.state};if($.$media)z.$media={...z.$media,...$.$media};if($.style)z.style={...z.style,...$.style};if($.attributes)z.attributes={...z.attributes,...$.attributes};if($.$head)z._pageHead=$.$head;if($.title)z._pageTitle=$.title;return delete z.$layout,z}function GD($,Z){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let X=new Map,Q=[];for(let J of Z)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!X.has(G))X.set(G,[]);X.get(G).push(J)}else Q.push(J);Mz($,X,Q)}function Mz($,Z,X){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let Q=[];for(let J of $.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&Z.has(G))Q.push(...Z.get(G)),Z.delete(G);else if(!G&&X.length>0)Q.push(...X);else if(Array.isArray(J.children))Q.push(...J.children)}else Mz(J,Z,X),Q.push(J);$.children=Q}function WD($){return structuredClone($)}var Az=s(()=>{N6()});function Iz($=[],Z=[],X=[],Q={}){let J=[{attributes:{charset:Q.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let Y of[...J,...$,...Z,...X]){let z=YD(Y);G.set(z,Y)}let W=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[W],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let Y=new URL(Q.pageUrl,Q.siteUrl).href;if(G.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"}),!G.has("meta:og:url"))G.set("meta:og:url",{attributes:{content:Y,property:"og:url"},tagName:"meta"})}if(Q.siteName&&!G.has("meta:og:site_name"))G.set("meta:og:site_name",{attributes:{content:Q.siteName,property:"og:site_name"},tagName:"meta"});return[...G.values()]}function YD($){if(!$||typeof $!=="object")return String($);let Z=$.tagName??"unknown",X=$.attributes??{};if(Z==="title")return"title";if(X.charset)return"meta:charset";if(Z==="meta"&&X.name)return`meta:${X.name}`;if(Z==="meta"&&X.property)return`meta:${X.property}`;if(Z==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(Z==="script"&&X.src)return`script:${X.src}`;if(Z==="style"){let Q=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`style:${zD(Q)}`}return`${Z}:${JSON.stringify($)}`}function zD($){let Z=0;for(let X=0;X<$.length;X++)Z=Math.trunc((Z<<5)-Z+($.codePointAt(X)??0));return Z.toString(36)}function Nz($){return $.map((Z)=>qD(Z)).join(`
282
+ `)}function qD($){if(typeof $==="string")return $;if(!$||typeof $!=="object")return"";let Z=$.tagName,X=$.attributes??{},Q=Object.entries(X).map(([Y,z])=>z===!0?Y:`${Y}="${KD(z)}"`).join(" "),J=Q?`<${Z} ${Q}>`:`<${Z}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(Z))return J;let W=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`${J}${W}</${Z}>`}function KD($){return String($).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as UD,relative as HD,resolve as VD}from"node:path";function Dz($,Z,X,Q=null){if(!$.state)$.state={};if($.state.$site={name:Z.name??"Jx Site",url:Z.url??"",...Z.state},$.state.$page={params:X._pathParams??{},title:$.title??$._pageTitle??Z.name??"",url:X.urlPattern},Z.state){for(let[J,G]of Object.entries(Z.state))if(J!=="$site"&&J!=="$page"&&!(J in $.state))$.state[J]=G}if(Z.$media)$.$media={...Z.$media,...$.$media};if(Z.imports&&Object.keys(Z.imports).length>0){if(!$.imports)$.imports={};for(let[J,G]of Object.entries(Z.imports))if(!(J in $.imports)){let W=G;if(Q&&X.sourcePath&&(W.startsWith("./")||W.startsWith("../"))){let Y=VD(Q,W);$.imports[J]=`./${HD(UD(X.sourcePath),Y)}`}else $.imports[J]=W}}if(Z.$elements?.length)if(!$.$elements?.length)$.$elements=[...Z.$elements];else{let J=new Set,G=[];for(let W of[...Z.$elements,...$.$elements]){let Y=typeof W==="string"?W:W?.$ref;if(Y&&!J.has(Y))J.add(Y),G.push(W)}$.$elements=G}return $}var wz=()=>{};import{readFileSync as BD}from"node:fs";import{dirname as KX,resolve as M5}from"node:path";import{createRequire as FD}from"node:module";async function Tz($,Z,X,Q={}){let J=$.imports??{},{state:G}=$;if(!G)return;for(let[W,Y]of Object.entries(G)){if(!H6(Y))continue;if(LD.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler"){let z=Q.registry?.byName(Y.$prototype);if(z?.capabilities.lower)try{let q=await z.call("lower",Y,{projectConfig:Q.config,root:X,route:Z});if(q&&typeof q==="object"&&!Array.isArray(q)){let H=q.$bundle;if(Array.isArray(H)){for(let B of H)if(typeof B==="string")Q.registerBundle?.(B)}delete q.$bundle}G[W]=q}catch(q){console.warn(`prototype-resolver: failed to lower "${W}" ($prototype: "${Y.$prototype}"):`,A6(q))}continue}if(!Y.$src){let z=J[Y.$prototype]??AD(Q,Y.$prototype);if(!z)continue;Y.$src=z}try{let z=await ID(Y,Z,X,G,Q);if(Y.timing&&z&&typeof z==="object"&&!Array.isArray(z))z.timing=Y.timing;G[W]=z}catch(z){console.warn(`prototype-resolver: failed to resolve "${W}" ($prototype: "${Y.$prototype}"):`,A6(z))}}}function AD($,Z){return $.registry?.byName(Z)?.classPath}async function ID($,Z,X,Q,J){let G=$.$src;if(!G)throw Error(`$prototype "${$.$prototype}" has no $src to resolve`);let W;if(G.startsWith("./")||G.startsWith("../"))W=Z.sourcePath?M5(KX(Z.sourcePath),G):M5(X,G);else W=FD(M5(X,"package.json")).resolve(G);let Y=BD(W,"utf8"),z=iW(Y,W);if(!z.$implementation)throw Error(`${G} has no $implementation field`);let q=M5(KX(W),z.$implementation),H=await t8(q),B=$.$export??z.title??$.$prototype,F=H[B]??H.default?.[B];if(!F)throw Error(`Module ${z.$implementation} does not export "${B}"`);let L={};for(let[N,I]of Object.entries($))if(!MD.has(N))L[N]=I;if(L.src&&!L.basePath&&Z.sourcePath)L.basePath=KX(Z.sourcePath);L._project={config:J.config??null,root:X,...J.sections},L._document={route:Z,state:Q};let w=new F(L);if(typeof w.resolve==="function")return await w.resolve();return w}var LD,MD;var jz=s(()=>{r1();w1();N6();LD=new Set(["Function","LocalStorage","SessionStorage","Array"]),MD=new Set(["$prototype","$src","$export","timing","default","description"])});var Oz=($)=>typeof $<"u"&&$!==null,ND=($)=>typeof $==="object",DD=($)=>Object.prototype.toString.call($)==="[object Object]",wD=($)=>typeof $==="function",TD=($)=>typeof $==="boolean",jD=($)=>$ instanceof Buffer,OD=($)=>{if(Oz($))switch($.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},ED=($)=>$ instanceof ArrayBuffer,RD=($)=>typeof $==="string"&&$.length>0,PD=($)=>typeof $==="number"&&Number.isFinite($),CD=($)=>Number.isInteger($),SD=($,Z,X)=>$>=Z&&$<=X,_D=($,Z)=>Z.includes($),bD=($,Z,X)=>Error(`Expected ${Z} for ${$} but received ${X} of type ${typeof X}`),xD=($,Z)=>{return Z.message=$.message,Z},U;var C1=s(()=>{/*!
285
283
  Copyright 2013 Lovell Fuller and others.
286
284
  SPDX-License-Identifier: Apache-2.0
287
- */K={defined:Jz,object:cN,plainObject:pN,fn:iN,bool:nN,buffer:rN,typedArray:aN,arrayBuffer:oN,string:sN,number:tN,integer:eN,inRange:$D,inArray:ZD,invalidParameterError:XD,nativeError:QD}});var Yz=b((Vd,Wz)=>{var Gz=()=>process.platform==="linux",G8=null,JD=()=>{if(!G8)if(Gz()&&process.report){let $=process.report.excludeNetwork;process.report.excludeNetwork=!0,G8=process.report.getReport(),process.report.excludeNetwork=$}else G8={};return G8};Wz.exports={isLinux:Gz,getReport:JD}});var qz=b((Bd,zz)=>{var O4=w0("fs"),GD=($)=>{let Z=O4.openSync($,"r"),X=Buffer.alloc(2048),Q=O4.readSync(Z,X,0,2048,0);return O4.close(Z,()=>{}),X.subarray(0,Q)},WD=($)=>new Promise((Z,X)=>{O4.open($,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);O4.read(J,G,0,2048,0,(W,Y)=>{Z(G.subarray(0,Y)),O4.close(J,()=>{})})}})});zz.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:GD,readFile:WD}});var Kz=b((Fd,Uz)=>{var YD=($)=>{if($.length<64)return null;if($.readUInt32BE(0)!==2135247942)return null;if($.readUInt8(4)!==2)return null;if($.readUInt8(5)!==1)return null;let Z=$.readUInt32LE(32),X=$.readUInt16LE(54),Q=$.readUInt16LE(56);for(let J=0;J<Q;J++){let G=Z+J*X;if($.readUInt32LE(G)===3){let Y=$.readUInt32LE(G+8),z=$.readUInt32LE(G+32);return $.subarray(Y,Y+z).toString().replace(/\0.*$/g,"")}}return null};Uz.exports={interpreterPath:YD}});var Y8=b((Ld,Pz)=>{var Vz=w0("child_process"),{isLinux:E4,getReport:Bz}=Yz(),{LDD_PATH:W8,SELF_PATH:Fz,readFile:t7,readFileSync:e7}=qz(),{interpreterPath:Lz}=Kz(),P6,C6,S6,T1="",Mz=()=>{if(!T1)return new Promise(($)=>{Vz.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(Z,X)=>{T1=Z?" ":X,$(T1)})});return T1},Az=()=>{if(!T1)try{T1=Vz.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch($){T1=" "}return T1},s6="glibc",Iz=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,o1="musl",zD=($)=>$.includes("libc.musl-")||$.includes("ld-musl-"),Nz=()=>{let $=Bz();if($.header&&$.header.glibcVersionRuntime)return s6;if(Array.isArray($.sharedObjects)){if($.sharedObjects.some(zD))return o1}return null},Dz=($)=>{let[Z,X]=$.split(/[\r\n]+/);if(Z&&Z.includes(s6))return s6;if(X&&X.includes(o1))return o1;return null},wz=($)=>{if($){if($.includes("/ld-musl-"))return o1;else if($.includes("/ld-linux-"))return s6}return null},Tz=($)=>{if($=$.toString(),$.includes("musl"))return o1;if($.includes("GNU C Library"))return s6;return null},qD=async()=>{if(C6!==void 0)return C6;C6=null;try{let $=await t7(W8);C6=Tz($)}catch($){}return C6},UD=()=>{if(C6!==void 0)return C6;C6=null;try{let $=e7(W8);C6=Tz($)}catch($){}return C6},KD=async()=>{if(P6!==void 0)return P6;P6=null;try{let $=await t7(Fz),Z=Lz($);P6=wz(Z)}catch($){}return P6},HD=()=>{if(P6!==void 0)return P6;P6=null;try{let $=e7(Fz),Z=Lz($);P6=wz(Z)}catch($){}return P6},jz=async()=>{let $=null;if(E4()){if($=await KD(),!$){if($=await qD(),!$)$=Nz();if(!$){let Z=await Mz();$=Dz(Z)}}}return $},Oz=()=>{let $=null;if(E4()){if($=HD(),!$){if($=UD(),!$)$=Nz();if(!$){let Z=Az();$=Dz(Z)}}}return $},VD=async()=>E4()&&await jz()!==s6,BD=()=>E4()&&Oz()!==s6,FD=async()=>{if(S6!==void 0)return S6;S6=null;try{let Z=(await t7(W8)).match(Iz);if(Z)S6=Z[1]}catch($){}return S6},LD=()=>{if(S6!==void 0)return S6;S6=null;try{let Z=e7(W8).match(Iz);if(Z)S6=Z[1]}catch($){}return S6},Ez=()=>{let $=Bz();if($.header&&$.header.glibcVersionRuntime)return $.header.glibcVersionRuntime;return null},Hz=($)=>$.trim().split(/\s+/)[1],Rz=($)=>{let[Z,X,Q]=$.split(/[\r\n]+/);if(Z&&Z.includes(s6))return Hz(Z);if(X&&Q&&X.includes(o1))return Hz(Q);return null},MD=async()=>{let $=null;if(E4()){if($=await FD(),!$)$=Ez();if(!$){let Z=await Mz();$=Rz(Z)}}return $},AD=()=>{let $=null;if(E4()){if($=LD(),!$)$=Ez();if(!$){let Z=Az();$=Rz(Z)}}return $};Pz.exports={GLIBC:s6,MUSL:o1,family:jz,familySync:Oz,isNonGlibcLinux:VD,isNonGlibcLinuxSync:BD,version:MD,versionSync:AD}});var R4=b((Md,Cz)=>{var ID=Number.MAX_SAFE_INTEGER||9007199254740991,ND=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Cz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:ID,RELEASE_TYPES:ND,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var R9=b((Ad,Sz)=>{var DD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};Sz.exports=DD});var P4=b((_6,_z)=>{var{MAX_SAFE_COMPONENT_LENGTH:$X,MAX_SAFE_BUILD_LENGTH:wD,MAX_LENGTH:TD}=R4(),jD=R9();_6=_z.exports={};var OD=_6.re=[],ED=_6.safeRe=[],q0=_6.src=[],RD=_6.safeSrc=[],U0=_6.t={},PD=0,ZX="[a-zA-Z0-9-]",CD=[["\\s",1],["\\d",TD],[ZX,wD]],SD=($)=>{for(let[Z,X]of CD)$=$.split(`${Z}*`).join(`${Z}{0,${X}}`).split(`${Z}+`).join(`${Z}{1,${X}}`);return $},N0=($,Z,X)=>{let Q=SD(Z),J=PD++;jD($,J,Z),U0[$]=J,q0[J]=Z,RD[J]=Q,OD[J]=new RegExp(Z,X?"g":void 0),ED[J]=new RegExp(Q,X?"g":void 0)};N0("NUMERICIDENTIFIER","0|[1-9]\\d*");N0("NUMERICIDENTIFIERLOOSE","\\d+");N0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ZX}*`);N0("MAINVERSION",`(${q0[U0.NUMERICIDENTIFIER]})\\.(${q0[U0.NUMERICIDENTIFIER]})\\.(${q0[U0.NUMERICIDENTIFIER]})`);N0("MAINVERSIONLOOSE",`(${q0[U0.NUMERICIDENTIFIERLOOSE]})\\.(${q0[U0.NUMERICIDENTIFIERLOOSE]})\\.(${q0[U0.NUMERICIDENTIFIERLOOSE]})`);N0("PRERELEASEIDENTIFIER",`(?:${q0[U0.NONNUMERICIDENTIFIER]}|${q0[U0.NUMERICIDENTIFIER]})`);N0("PRERELEASEIDENTIFIERLOOSE",`(?:${q0[U0.NONNUMERICIDENTIFIER]}|${q0[U0.NUMERICIDENTIFIERLOOSE]})`);N0("PRERELEASE",`(?:-(${q0[U0.PRERELEASEIDENTIFIER]}(?:\\.${q0[U0.PRERELEASEIDENTIFIER]})*))`);N0("PRERELEASELOOSE",`(?:-?(${q0[U0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${q0[U0.PRERELEASEIDENTIFIERLOOSE]})*))`);N0("BUILDIDENTIFIER",`${ZX}+`);N0("BUILD",`(?:\\+(${q0[U0.BUILDIDENTIFIER]}(?:\\.${q0[U0.BUILDIDENTIFIER]})*))`);N0("FULLPLAIN",`v?${q0[U0.MAINVERSION]}${q0[U0.PRERELEASE]}?${q0[U0.BUILD]}?`);N0("FULL",`^${q0[U0.FULLPLAIN]}$`);N0("LOOSEPLAIN",`[v=\\s]*${q0[U0.MAINVERSIONLOOSE]}${q0[U0.PRERELEASELOOSE]}?${q0[U0.BUILD]}?`);N0("LOOSE",`^${q0[U0.LOOSEPLAIN]}$`);N0("GTLT","((?:<|>)?=?)");N0("XRANGEIDENTIFIERLOOSE",`${q0[U0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);N0("XRANGEIDENTIFIER",`${q0[U0.NUMERICIDENTIFIER]}|x|X|\\*`);N0("XRANGEPLAIN",`[v=\\s]*(${q0[U0.XRANGEIDENTIFIER]})(?:\\.(${q0[U0.XRANGEIDENTIFIER]})(?:\\.(${q0[U0.XRANGEIDENTIFIER]})(?:${q0[U0.PRERELEASE]})?${q0[U0.BUILD]}?)?)?`);N0("XRANGEPLAINLOOSE",`[v=\\s]*(${q0[U0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q0[U0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q0[U0.XRANGEIDENTIFIERLOOSE]})(?:${q0[U0.PRERELEASELOOSE]})?${q0[U0.BUILD]}?)?)?`);N0("XRANGE",`^${q0[U0.GTLT]}\\s*${q0[U0.XRANGEPLAIN]}$`);N0("XRANGELOOSE",`^${q0[U0.GTLT]}\\s*${q0[U0.XRANGEPLAINLOOSE]}$`);N0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$X}})(?:\\.(\\d{1,${$X}}))?(?:\\.(\\d{1,${$X}}))?`);N0("COERCE",`${q0[U0.COERCEPLAIN]}(?:$|[^\\d])`);N0("COERCEFULL",q0[U0.COERCEPLAIN]+`(?:${q0[U0.PRERELEASE]})?(?:${q0[U0.BUILD]})?(?:$|[^\\d])`);N0("COERCERTL",q0[U0.COERCE],!0);N0("COERCERTLFULL",q0[U0.COERCEFULL],!0);N0("LONETILDE","(?:~>?)");N0("TILDETRIM",`(\\s*)${q0[U0.LONETILDE]}\\s+`,!0);_6.tildeTrimReplace="$1~";N0("TILDE",`^${q0[U0.LONETILDE]}${q0[U0.XRANGEPLAIN]}$`);N0("TILDELOOSE",`^${q0[U0.LONETILDE]}${q0[U0.XRANGEPLAINLOOSE]}$`);N0("LONECARET","(?:\\^)");N0("CARETTRIM",`(\\s*)${q0[U0.LONECARET]}\\s+`,!0);_6.caretTrimReplace="$1^";N0("CARET",`^${q0[U0.LONECARET]}${q0[U0.XRANGEPLAIN]}$`);N0("CARETLOOSE",`^${q0[U0.LONECARET]}${q0[U0.XRANGEPLAINLOOSE]}$`);N0("COMPARATORLOOSE",`^${q0[U0.GTLT]}\\s*(${q0[U0.LOOSEPLAIN]})$|^$`);N0("COMPARATOR",`^${q0[U0.GTLT]}\\s*(${q0[U0.FULLPLAIN]})$|^$`);N0("COMPARATORTRIM",`(\\s*)${q0[U0.GTLT]}\\s*(${q0[U0.LOOSEPLAIN]}|${q0[U0.XRANGEPLAIN]})`,!0);_6.comparatorTrimReplace="$1$2$3";N0("HYPHENRANGE",`^\\s*(${q0[U0.XRANGEPLAIN]})\\s+-\\s+(${q0[U0.XRANGEPLAIN]})\\s*$`);N0("HYPHENRANGELOOSE",`^\\s*(${q0[U0.XRANGEPLAINLOOSE]})\\s+-\\s+(${q0[U0.XRANGEPLAINLOOSE]})\\s*$`);N0("STAR","(<|>)?=?\\s*\\*");N0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");N0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var z8=b((Id,xz)=>{var _D=Object.freeze({loose:!0}),xD=Object.freeze({}),bD=($)=>{if(!$)return xD;if(typeof $!=="object")return _D;return $};xz.exports=bD});var XX=b((Nd,yz)=>{var bz=/^[0-9]+$/,kz=($,Z)=>{if(typeof $==="number"&&typeof Z==="number")return $===Z?0:$<Z?-1:1;let X=bz.test($),Q=bz.test(Z);if(X&&Q)$=+$,Z=+Z;return $===Z?0:X&&!Q?-1:Q&&!X?1:$<Z?-1:1},kD=($,Z)=>kz(Z,$);yz.exports={compareIdentifiers:kz,rcompareIdentifiers:kD}});var W$=b((Dd,gz)=>{var q8=R9(),{MAX_LENGTH:vz,MAX_SAFE_INTEGER:U8}=R4(),{safeRe:K8,t:H8}=P4(),yD=z8(),{compareIdentifiers:QX}=XX(),vD=($,Z)=>{let X=Z.split(".");if(X.length>$.length)return!1;for(let Q=0;Q<X.length;Q++)if(QX($[Q],X[Q])!==0)return!1;return!0};class q6{constructor($,Z){if(Z=yD(Z),$ instanceof q6)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>vz)throw TypeError(`version is longer than ${vz} characters`);q8("SemVer",$,Z),this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease;let X=$.trim().match(Z.loose?K8[H8.LOOSE]:K8[H8.FULL]);if(!X)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>U8||this.major<0)throw TypeError("Invalid major version");if(this.minor>U8||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>U8||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<U8)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(q8("SemVer.compare",this.version,this.options,$),!($ instanceof q6)){if(typeof $==="string"&&$===this.version)return 0;$=new q6($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof q6))$=new q6($,this.options);if(this.major<$.major)return-1;if(this.major>$.major)return 1;if(this.minor<$.minor)return-1;if(this.minor>$.minor)return 1;if(this.patch<$.patch)return-1;if(this.patch>$.patch)return 1;return 0}comparePre($){if(!($ instanceof q6))$=new q6($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let Z=0;do{let X=this.prerelease[Z],Q=$.prerelease[Z];if(q8("prerelease compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return QX(X,Q)}while(++Z)}compareBuild($){if(!($ instanceof q6))$=new q6($,this.options);let Z=0;do{let X=this.build[Z],Q=$.build[Z];if(q8("build compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return QX(X,Q)}while(++Z)}inc($,Z,X){if($.startsWith("pre")){if(!Z&&X===!1)throw Error("invalid increment argument: identifier is empty");if(Z){let Q=`-${Z}`.match(this.options.loose?K8[H8.PRERELEASELOOSE]:K8[H8.PRERELEASE]);if(!Q||Q[1]!==Z)throw Error(`invalid identifier: ${Z}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Z,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Z,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Z,X),this.inc("pre",Z,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",Z,X);this.inc("pre",Z,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(Z===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(Z){let J=[Z,Q];if(X===!1)J=[Z];if(vD(this.prerelease,Z)){let G=this.prerelease[Z.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}gz.exports=q6});var j1=b((wd,hz)=>{var fz=W$(),gD=($,Z,X=!1)=>{if($ instanceof fz)return $;try{return new fz($,Z)}catch(Q){if(!X)return null;throw Q}};hz.exports=gD});var mz=b((Td,uz)=>{var fD=j1(),hD=($,Z)=>{let X=fD($,Z);return X?X.version:null};uz.exports=hD});var lz=b((jd,dz)=>{var uD=j1(),mD=($,Z)=>{let X=uD($.trim().replace(/^[=v]+/,""),Z);return X?X.version:null};dz.exports=mD});var iz=b((Od,pz)=>{var cz=W$(),dD=($,Z,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new cz($ instanceof cz?$.version:$,X).inc(Z,Q,J).version}catch(G){return null}};pz.exports=dD});var az=b((Ed,rz)=>{var nz=j1(),lD=($,Z)=>{let X=nz($,null,!0),Q=nz(Z,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,W=G?X:Q,Y=G?Q:X,z=!!W.prerelease.length;if(!!Y.prerelease.length&&!z){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(W)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let H=z?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};rz.exports=lD});var sz=b((Rd,oz)=>{var cD=W$(),pD=($,Z)=>new cD($,Z).major;oz.exports=pD});var ez=b((Pd,tz)=>{var iD=W$(),nD=($,Z)=>new iD($,Z).minor;tz.exports=nD});var Zq=b((Cd,$q)=>{var rD=W$(),aD=($,Z)=>new rD($,Z).patch;$q.exports=aD});var Qq=b((Sd,Xq)=>{var oD=j1(),sD=($,Z)=>{let X=oD($,Z);return X&&X.prerelease.length?X.prerelease:null};Xq.exports=sD});var $6=b((_d,Gq)=>{var Jq=W$(),tD=($,Z,X)=>new Jq($,X).compare(new Jq(Z,X));Gq.exports=tD});var Yq=b((xd,Wq)=>{var eD=$6(),$w=($,Z,X)=>eD(Z,$,X);Wq.exports=$w});var qq=b((bd,zq)=>{var Zw=$6(),Xw=($,Z)=>Zw($,Z,!0);zq.exports=Xw});var V8=b((kd,Kq)=>{var Uq=W$(),Qw=($,Z,X)=>{let Q=new Uq($,X),J=new Uq(Z,X);return Q.compare(J)||Q.compareBuild(J)};Kq.exports=Qw});var Vq=b((yd,Hq)=>{var Jw=V8(),Gw=($,Z)=>$.sort((X,Q)=>Jw(X,Q,Z));Hq.exports=Gw});var Fq=b((vd,Bq)=>{var Ww=V8(),Yw=($,Z)=>$.sort((X,Q)=>Ww(Q,X,Z));Bq.exports=Yw});var P9=b((gd,Lq)=>{var zw=$6(),qw=($,Z,X)=>zw($,Z,X)>0;Lq.exports=qw});var B8=b((fd,Mq)=>{var Uw=$6(),Kw=($,Z,X)=>Uw($,Z,X)<0;Mq.exports=Kw});var JX=b((hd,Aq)=>{var Hw=$6(),Vw=($,Z,X)=>Hw($,Z,X)===0;Aq.exports=Vw});var GX=b((ud,Iq)=>{var Bw=$6(),Fw=($,Z,X)=>Bw($,Z,X)!==0;Iq.exports=Fw});var F8=b((md,Nq)=>{var Lw=$6(),Mw=($,Z,X)=>Lw($,Z,X)>=0;Nq.exports=Mw});var L8=b((dd,Dq)=>{var Aw=$6(),Iw=($,Z,X)=>Aw($,Z,X)<=0;Dq.exports=Iw});var WX=b((ld,wq)=>{var Nw=JX(),Dw=GX(),ww=P9(),Tw=F8(),jw=B8(),Ow=L8(),Ew=($,Z,X,Q)=>{switch(Z){case"===":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $===X;case"!==":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $!==X;case"":case"=":case"==":return Nw($,X,Q);case"!=":return Dw($,X,Q);case">":return ww($,X,Q);case">=":return Tw($,X,Q);case"<":return jw($,X,Q);case"<=":return Ow($,X,Q);default:throw TypeError(`Invalid operator: ${Z}`)}};wq.exports=Ew});var jq=b((cd,Tq)=>{var Rw=W$(),Pw=j1(),{safeRe:M8,t:A8}=P4(),Cw=($,Z)=>{if($ instanceof Rw)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;Z=Z||{};let X=null;if(!Z.rtl)X=$.match(Z.includePrerelease?M8[A8.COERCEFULL]:M8[A8.COERCE]);else{let z=Z.includePrerelease?M8[A8.COERCERTLFULL]:M8[A8.COERCERTL],q;while((q=z.exec($))&&(!X||X.index+X[0].length!==$.length)){if(!X||q.index+q[0].length!==X.index+X[0].length)X=q;z.lastIndex=q.index+q[1].length+q[2].length}z.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",W=Z.includePrerelease&&X[5]?`-${X[5]}`:"",Y=Z.includePrerelease&&X[6]?`+${X[6]}`:"";return Pw(`${Q}.${J}.${G}${W}${Y}`,Z)};Tq.exports=Cw});var Eq=b((pd,Oq)=>{var Sw=j1(),_w=R4(),xw=W$(),bw=($,Z,X)=>{if(!_w.RELEASE_TYPES.includes(Z))return null;let Q=kw($,X);return Q&&yw(Q,Z)},kw=($,Z)=>{let X=$ instanceof xw?$.version:$;return Sw(X,Z)},yw=($,Z)=>{if(vw(Z))return $.version;switch($.prerelease=[],Z){case"major":$.minor=0,$.patch=0;break;case"minor":$.patch=0;break}return $.format()},vw=($)=>{return $.startsWith("pre")};Oq.exports=bw});var Cq=b((id,Pq)=>{class Rq{constructor(){this.max=1000,this.map=new Map}get($){let Z=this.map.get($);if(Z===void 0)return;else return this.map.delete($),this.map.set($,Z),Z}delete($){return this.map.delete($)}set($,Z){if(!this.delete($)&&Z!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set($,Z)}return this}}Pq.exports=Rq});var Z6=b((nd,bq)=>{var gw=/\s+/g;class C9{constructor($,Z){if(Z=hw(Z),$ instanceof C9)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else return new C9($.raw,Z);if($ instanceof YX)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease,this.raw=$.trim().replace(gw," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!_q(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&rw(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let Z=this.set[$];for(let X=0;X<Z.length;X++){if(X>0)this.formatted+=" ";this.formatted+=Z[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){$=$.replace(nw,"");let X=((this.options.includePrerelease&&pw)|(this.options.loose&&iw))+":"+$,Q=Sq.get(X);if(Q)return Q;let J=this.options.loose,G=J?D$[Y$.HYPHENRANGELOOSE]:D$[Y$.HYPHENRANGE];$=$.replace(G,GT(this.options.includePrerelease)),g0("hyphen replace",$),$=$.replace(D$[Y$.COMPARATORTRIM],dw),g0("comparator trim",$),$=$.replace(D$[Y$.TILDETRIM],lw),g0("tilde trim",$),$=$.replace(D$[Y$.CARETTRIM],cw),g0("caret trim",$);let W=$.split(" ").map((H)=>aw(H,this.options)).join(" ").split(/\s+/).map((H)=>JT(H,this.options));if(J)W=W.filter((H)=>{return g0("loose invalid filter",H,this.options),!!H.match(D$[Y$.COMPARATORLOOSE])});g0("range list",W);let Y=new Map,z=W.map((H)=>new YX(H,this.options));for(let H of z){if(_q(H))return[H];Y.set(H.value,H)}if(Y.size>1&&Y.has(""))Y.delete("");let q=[...Y.values()];return Sq.set(X,q),q}intersects($,Z){if(!($ instanceof C9))throw TypeError("a Range is required");return this.set.some((X)=>{return xq(X,Z)&&$.set.some((Q)=>{return xq(Q,Z)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,Z)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new uw($,this.options)}catch(Z){return!1}for(let Z=0;Z<this.set.length;Z++)if(WT(this.set[Z],$,this.options))return!0;return!1}}bq.exports=C9;var fw=Cq(),Sq=new fw,hw=z8(),YX=S9(),g0=R9(),uw=W$(),{safeRe:D$,src:mw,t:Y$,comparatorTrimReplace:dw,tildeTrimReplace:lw,caretTrimReplace:cw}=P4(),{FLAG_INCLUDE_PRERELEASE:pw,FLAG_LOOSE:iw}=R4(),nw=new RegExp(mw[Y$.BUILD],"g"),_q=($)=>$.value==="<0.0.0-0",rw=($)=>$.value==="",xq=($,Z)=>{let X=!0,Q=$.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,Z)}),J=Q.pop();return X},aw=($,Z)=>{return $=$.replace(D$[Y$.BUILD],""),g0("comp",$,Z),$=ew($,Z),g0("caret",$),$=sw($,Z),g0("tildes",$),$=ZT($,Z),g0("xrange",$),$=QT($,Z),g0("stars",$),$},e0=($)=>!$||$.toLowerCase()==="x"||$==="*",ow=($,Z,X)=>e0($)&&!e0(Z)||e0(Z)&&X&&!e0(X),sw=($,Z)=>{return $.trim().split(/\s+/).map((X)=>tw(X,Z)).join(" ")},tw=($,Z)=>{let X=Z.loose?D$[Y$.TILDELOOSE]:D$[Y$.TILDE],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{g0("tilde",$,J,G,W,Y,z);let q;if(e0(G))q="";else if(e0(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(e0(Y))q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else if(z)g0("replaceTilde pr",z),q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;return g0("tilde return",q),q})},ew=($,Z)=>{return $.trim().split(/\s+/).map((X)=>$T(X,Z)).join(" ")},$T=($,Z)=>{g0("caret",$,Z);let X=Z.loose?D$[Y$.CARETLOOSE]:D$[Y$.CARET],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{g0("caret",$,J,G,W,Y,z);let q;if(e0(G))q="";else if(e0(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(e0(Y))if(G==="0")q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.0${Q} <${+G+1}.0.0-0`;else if(z)if(g0("replaceCaret pr",z),G==="0")if(W==="0")q=`>=${G}.${W}.${Y}-${z} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y}-${z} <${+G+1}.0.0-0`;else if(g0("no pr"),G==="0")if(W==="0")q=`>=${G}.${W}.${Y} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${+G+1}.0.0-0`;return g0("caret return",q),q})},ZT=($,Z)=>{return g0("replaceXRanges",$,Z),$.split(/\s+/).map((X)=>XT(X,Z)).join(" ")},XT=($,Z)=>{$=$.trim();let X=Z.loose?D$[Y$.XRANGELOOSE]:D$[Y$.XRANGE];return $.replace(X,(Q,J,G,W,Y,z)=>{if(g0("xRange",$,Q,J,G,W,Y,z),ow(G,W,Y))return $;let q=e0(G),H=q||e0(W),B=H||e0(Y),L=B;if(J==="="&&L)J="";if(z=Z.includePrerelease?"-0":"",q)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&L){if(H)W=0;if(Y=0,J===">")if(J=">=",H)G=+G+1,W=0,Y=0;else W=+W+1,Y=0;else if(J==="<=")if(J="<",H)G=+G+1;else W=+W+1;if(J==="<")z="-0";Q=`${J+G}.${W}.${Y}${z}`}else if(H)Q=`>=${G}.0.0${z} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${W}.0${z} <${G}.${+W+1}.0-0`;return g0("xRange return",Q),Q})},QT=($,Z)=>{return g0("replaceStars",$,Z),$.trim().replace(D$[Y$.STAR],"")},JT=($,Z)=>{return g0("replaceGTE0",$,Z),$.trim().replace(D$[Z.includePrerelease?Y$.GTE0PRE:Y$.GTE0],"")},GT=($)=>(Z,X,Q,J,G,W,Y,z,q,H,B,L)=>{if(e0(Q))X="";else if(e0(J))X=`>=${Q}.0.0${$?"-0":""}`;else if(e0(G))X=`>=${Q}.${J}.0${$?"-0":""}`;else if(W)X=`>=${X}`;else X=`>=${X}${$?"-0":""}`;if(e0(q))z="";else if(e0(H))z=`<${+q+1}.0.0-0`;else if(e0(B))z=`<${q}.${+H+1}.0-0`;else if(L)z=`<=${q}.${H}.${B}-${L}`;else if($)z=`<${q}.${H}.${+B+1}-0`;else z=`<=${z}`;return`${X} ${z}`.trim()},WT=($,Z,X)=>{for(let Q=0;Q<$.length;Q++)if(!$[Q].test(Z))return!1;if(Z.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<$.length;Q++){if(g0($[Q].semver),$[Q].semver===YX.ANY)continue;if($[Q].semver.prerelease.length>0){let J=$[Q].semver;if(J.major===Z.major&&J.minor===Z.minor&&J.patch===Z.patch)return!0}}return!1}return!0}});var S9=b((rd,hq)=>{var _9=Symbol("SemVer ANY");class I8{static get ANY(){return _9}constructor($,Z){if(Z=kq(Z),$ instanceof I8)if($.loose===!!Z.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),qX("comparator",$,Z),this.options=Z,this.loose=!!Z.loose,this.parse($),this.semver===_9)this.value="";else this.value=this.operator+this.semver.version;qX("comp",this)}parse($){let Z=this.options.loose?yq[vq.COMPARATORLOOSE]:yq[vq.COMPARATOR],X=$.match(Z);if(!X)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=_9;else this.semver=new gq(X[2],this.options.loose)}toString(){return this.value}test($){if(qX("Comparator.test",$,this.options.loose),this.semver===_9||$===_9)return!0;if(typeof $==="string")try{$=new gq($,this.options)}catch(Z){return!1}return zX($,this.operator,this.semver,this.options)}intersects($,Z){if(!($ instanceof I8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new fq($.value,Z).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new fq(this.value,Z).test($.semver)}if(Z=kq(Z),Z.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!Z.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(zX(this.semver,"<",$.semver,Z)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(zX(this.semver,">",$.semver,Z)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}hq.exports=I8;var kq=z8(),{safeRe:yq,t:vq}=P4(),zX=WX(),qX=R9(),gq=W$(),fq=Z6()});var x9=b((ad,uq)=>{var YT=Z6(),zT=($,Z,X)=>{try{Z=new YT(Z,X)}catch(Q){return!1}return Z.test($)};uq.exports=zT});var dq=b((od,mq)=>{var qT=Z6(),UT=($,Z)=>new qT($,Z).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));mq.exports=UT});var cq=b((sd,lq)=>{var KT=W$(),HT=Z6(),VT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new HT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===-1)Q=W,J=new KT(Q,X)}}),Q};lq.exports=VT});var iq=b((td,pq)=>{var BT=W$(),FT=Z6(),LT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new FT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===1)Q=W,J=new BT(Q,X)}}),Q};pq.exports=LT});var aq=b((ed,rq)=>{var UX=W$(),MT=Z6(),nq=P9(),AT=($,Z)=>{$=new MT($,Z);let X=new UX("0.0.0");if($.test(X))return X;if(X=new UX("0.0.0-0"),$.test(X))return X;X=null;for(let Q=0;Q<$.set.length;++Q){let J=$.set[Q],G=null;if(J.forEach((W)=>{let Y=new UX(W.semver.version);switch(W.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!G||nq(Y,G))G=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${W.operator}`)}}),G&&(!X||nq(X,G)))X=G}if(X&&$.test(X))return X;return null};rq.exports=AT});var sq=b(($l,oq)=>{var IT=Z6(),NT=($,Z)=>{try{return new IT($,Z).range||"*"}catch(X){return null}};oq.exports=NT});var N8=b((Zl,ZU)=>{var DT=W$(),$U=S9(),{ANY:wT}=$U,TT=Z6(),jT=x9(),tq=P9(),eq=B8(),OT=L8(),ET=F8(),RT=($,Z,X,Q)=>{$=new DT($,Q),Z=new TT(Z,Q);let J,G,W,Y,z;switch(X){case">":J=tq,G=OT,W=eq,Y=">",z=">=";break;case"<":J=eq,G=ET,W=tq,Y="<",z="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(jT($,Z,Q))return!1;for(let q=0;q<Z.set.length;++q){let H=Z.set[q],B=null,L=null;if(H.forEach((M)=>{if(M.semver===wT)M=new $U(">=0.0.0");if(B=B||M,L=L||M,J(M.semver,B.semver,Q))B=M;else if(W(M.semver,L.semver,Q))L=M}),B.operator===Y||B.operator===z)return!1;if((!L.operator||L.operator===Y)&&G($,L.semver))return!1;else if(L.operator===z&&W($,L.semver))return!1}return!0};ZU.exports=RT});var QU=b((Xl,XU)=>{var PT=N8(),CT=($,Z,X)=>PT($,Z,">",X);XU.exports=CT});var GU=b((Ql,JU)=>{var ST=N8(),_T=($,Z,X)=>ST($,Z,"<",X);JU.exports=_T});var zU=b((Jl,YU)=>{var WU=Z6(),xT=($,Z,X)=>{return $=new WU($,X),Z=new WU(Z,X),$.intersects(Z,X)};YU.exports=xT});var UU=b((Gl,qU)=>{var bT=x9(),kT=$6();qU.exports=($,Z,X)=>{let Q=[],J=null,G=null,W=$.sort((H,B)=>kT(H,B,X));for(let H of W)if(bT(H,Z,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let Y=[];for(let[H,B]of Q)if(H===B)Y.push(H);else if(!B&&H===W[0])Y.push("*");else if(!B)Y.push(`>=${H}`);else if(H===W[0])Y.push(`<=${B}`);else Y.push(`${H} - ${B}`);let z=Y.join(" || "),q=typeof Z.raw==="string"?Z.raw:String(Z);return z.length<q.length?z:Z}});var LU=b((Wl,FU)=>{var KU=Z6(),VX=S9(),{ANY:KX}=VX,HX=x9(),BX=$6(),yT=($,Z,X={})=>{if($===Z)return!0;$=new KU($,X),Z=new KU(Z,X);let Q=!1;$:for(let J of $.set){for(let G of Z.set){let W=gT(J,G,X);if(Q=Q||W!==null,W)continue $}if(Q)return!1}return!0},vT=[new VX(">=0.0.0-0")],HU=[new VX(">=0.0.0")],gT=($,Z,X)=>{if($===Z)return!0;if($.length===1&&$[0].semver===KX)if(Z.length===1&&Z[0].semver===KX)return!0;else if(X.includePrerelease)$=vT;else $=HU;if(Z.length===1&&Z[0].semver===KX)if(X.includePrerelease)return!0;else Z=HU;let Q=new Set,J,G;for(let M of $)if(M.operator===">"||M.operator===">=")J=VU(J,M,X);else if(M.operator==="<"||M.operator==="<=")G=BU(G,M,X);else Q.add(M.semver);if(Q.size>1)return null;let W;if(J&&G){if(W=BX(J.semver,G.semver,X),W>0)return null;else if(W===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let M of Q){if(J&&!HX(M,String(J),X))return null;if(G&&!HX(M,String(G),X))return null;for(let A of Z)if(!HX(M,String(A),X))return!1;return!0}let Y,z,q,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,L=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let M of Z){if(H=H||M.operator===">"||M.operator===">=",q=q||M.operator==="<"||M.operator==="<=",J){if(L){if(M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===L.major&&M.semver.minor===L.minor&&M.semver.patch===L.patch)L=!1}if(M.operator===">"||M.operator===">="){if(Y=VU(J,M,X),Y===M&&Y!==J)return!1}else if(J.operator===">="&&!M.test(J.semver))return!1}if(G){if(B){if(M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===B.major&&M.semver.minor===B.minor&&M.semver.patch===B.patch)B=!1}if(M.operator==="<"||M.operator==="<="){if(z=BU(G,M,X),z===M&&z!==G)return!1}else if(G.operator==="<="&&!M.test(G.semver))return!1}if(!M.operator&&(G||J)&&W!==0)return!1}if(J&&q&&!G&&W!==0)return!1;if(G&&H&&!J&&W!==0)return!1;if(L||B)return!1;return!0},VU=($,Z,X)=>{if(!$)return Z;let Q=BX($.semver,Z.semver,X);return Q>0?$:Q<0?Z:Z.operator===">"&&$.operator===">="?Z:$},BU=($,Z,X)=>{if(!$)return Z;let Q=BX($.semver,Z.semver,X);return Q<0?$:Q>0?Z:Z.operator==="<"&&$.operator==="<="?Z:$};FU.exports=yT});var NU=b((Yl,IU)=>{var FX=P4(),MU=R4(),fT=W$(),AU=XX(),hT=j1(),uT=mz(),mT=lz(),dT=iz(),lT=az(),cT=sz(),pT=ez(),iT=Zq(),nT=Qq(),rT=$6(),aT=Yq(),oT=qq(),sT=V8(),tT=Vq(),eT=Fq(),$j=P9(),Zj=B8(),Xj=JX(),Qj=GX(),Jj=F8(),Gj=L8(),Wj=WX(),Yj=jq(),zj=Eq(),qj=S9(),Uj=Z6(),Kj=x9(),Hj=dq(),Vj=cq(),Bj=iq(),Fj=aq(),Lj=sq(),Mj=N8(),Aj=QU(),Ij=GU(),Nj=zU(),Dj=UU(),wj=LU();IU.exports={parse:hT,valid:uT,clean:mT,inc:dT,diff:lT,major:cT,minor:pT,patch:iT,prerelease:nT,compare:rT,rcompare:aT,compareLoose:oT,compareBuild:sT,sort:tT,rsort:eT,gt:$j,lt:Zj,eq:Xj,neq:Qj,gte:Jj,lte:Gj,cmp:Wj,coerce:Yj,truncate:zj,Comparator:qj,Range:Uj,satisfies:Kj,toComparators:Hj,maxSatisfying:Vj,minSatisfying:Bj,minVersion:Fj,validRange:Lj,outside:Mj,gtr:Aj,ltr:Ij,intersects:Nj,simplifyRange:Dj,subset:wj,SemVer:fT,re:FX.re,src:FX.src,tokens:FX.t,SEMVER_SPEC_VERSION:MU.SEMVER_SPEC_VERSION,RELEASE_TYPES:MU.RELEASE_TYPES,compareIdentifiers:AU.compareIdentifiers,rcompareIdentifiers:AU.rcompareIdentifiers}});var t6;var D8=t(()=>{t6={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as b9}from"node:child_process";import{createHash as jj}from"node:crypto";var k9,MX,Oj,wU,Ej,AX,Rj=($)=>{if($ instanceof Error)console.error(`sharp: Installation error: ${$.message}`);else console.log(`sharp: ${$}`)},TU=()=>MX.default.isNonGlibcLinuxSync()?MX.default.familySync():"",Pj=()=>`${process.platform}${TU()}-${process.arch}`,C4=()=>{if(jU())return"wasm32";let{npm_config_arch:$,npm_config_platform:Z,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:TU();return`${Z||process.platform}${Q}-${$||process.arch}`},Cj=()=>{try{return w0(`@img/sharp-libvips-dev-${C4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},Sj=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},_j=()=>{try{return w0(`@img/sharp-libvips-dev-${C4()}/lib`)}catch{try{return w0(`@img/sharp-libvips-${C4()}/lib`)}catch{}}return""},xj=()=>{if(process.release?.name==="node"&&process.versions){if(!k9.default.satisfies(process.versions.node,t6.engines.node))return{found:process.versions.node,expected:t6.engines.node}}},jU=()=>{let{CC:$}=process.env;return Boolean($?.endsWith("/emcc"))},bj=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(b9("sysctl sysctl.proc_translated",AX).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},DU=($)=>jj("sha512").update($).digest("hex"),kj=()=>{try{let $=DU(`imgsharp-libvips-${C4()}`),Z=k9.default.coerce(t6.optionalDependencies[`@img/sharp-libvips-${C4()}`],{includePrerelease:!0}).version;return DU(`${$}npm:${Z}`).slice(0,10)}catch{}return""},yj=()=>b9(`node-gyp rebuild --directory=src ${jU()?"--nodedir=emscripten":""}`,{...AX,stdio:"inherit"}).status,OU=()=>{if(process.platform!=="win32")return(b9("pkg-config --modversion vips-cpp",{...AX,env:{...process.env,PKG_CONFIG_PATH:EU()}}).stdout||"").trim();else return""},vj=()=>{try{let $=(b9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if($)return`${$}/lib/pkgconfig`}catch($){}return},gj=()=>{try{let $=(b9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if($)return $}catch($){}return},EU=()=>{if(process.platform!=="win32")return[vj(),gj(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},LX=($,Z,X)=>{if(X)X(`Detected ${Z}, skipping search for globally-installed libvips`);return $},fj=($)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return LX(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",$);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return LX(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",$);if(bj())return LX(!1,"Rosetta",$);let Z=OU();return!!Z&&k9.default.gte(Z,wU)},w8;var IX=t(()=>{D8();k9=B$(NU(),1),MX=B$(Y8(),1);/*!
285
+ */U={defined:Oz,object:ND,plainObject:DD,fn:wD,bool:TD,buffer:jD,typedArray:OD,arrayBuffer:ED,string:RD,number:PD,integer:CD,inRange:SD,inArray:_D,invalidParameterError:bD,nativeError:xD}});var Pz=b((Xl,Rz)=>{var Ez=()=>process.platform==="linux",A5=null,kD=()=>{if(!A5)if(Ez()&&process.report){let $=process.report.excludeNetwork;process.report.excludeNetwork=!0,A5=process.report.getReport(),process.report.excludeNetwork=$}else A5={};return A5};Rz.exports={isLinux:Ez,getReport:kD}});var Sz=b((Ql,Cz)=>{var b4=O0("fs"),yD=($)=>{let Z=b4.openSync($,"r"),X=Buffer.alloc(2048),Q=b4.readSync(Z,X,0,2048,0);return b4.close(Z,()=>{}),X.subarray(0,Q)},vD=($)=>new Promise((Z,X)=>{b4.open($,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);b4.read(J,G,0,2048,0,(W,Y)=>{Z(G.subarray(0,Y)),b4.close(J,()=>{})})}})});Cz.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:yD,readFile:vD}});var bz=b((Jl,_z)=>{var gD=($)=>{if($.length<64)return null;if($.readUInt32BE(0)!==2135247942)return null;if($.readUInt8(4)!==2)return null;if($.readUInt8(5)!==1)return null;let Z=$.readUInt32LE(32),X=$.readUInt16LE(54),Q=$.readUInt16LE(56);for(let J=0;J<Q;J++){let G=Z+J*X;if($.readUInt32LE(G)===3){let Y=$.readUInt32LE(G+8),z=$.readUInt32LE(G+32);return $.subarray(Y,Y+z).toString().replace(/\0.*$/g,"")}}return null};_z.exports={interpreterPath:gD}});var N5=b((Gl,az)=>{var kz=O0("child_process"),{isLinux:x4,getReport:yz}=Pz(),{LDD_PATH:I5,SELF_PATH:vz,readFile:UX,readFileSync:HX}=Sz(),{interpreterPath:gz}=bz(),S1,_1,b1,O6="",fz=()=>{if(!O6)return new Promise(($)=>{kz.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(Z,X)=>{O6=Z?" ":X,$(O6)})});return O6},hz=()=>{if(!O6)try{O6=kz.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch($){O6=" "}return O6},t1="glibc",uz=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,$4="musl",fD=($)=>$.includes("libc.musl-")||$.includes("ld-musl-"),mz=()=>{let $=yz();if($.header&&$.header.glibcVersionRuntime)return t1;if(Array.isArray($.sharedObjects)){if($.sharedObjects.some(fD))return $4}return null},dz=($)=>{let[Z,X]=$.split(/[\r\n]+/);if(Z&&Z.includes(t1))return t1;if(X&&X.includes($4))return $4;return null},lz=($)=>{if($){if($.includes("/ld-musl-"))return $4;else if($.includes("/ld-linux-"))return t1}return null},cz=($)=>{if($=$.toString(),$.includes("musl"))return $4;if($.includes("GNU C Library"))return t1;return null},hD=async()=>{if(_1!==void 0)return _1;_1=null;try{let $=await UX(I5);_1=cz($)}catch($){}return _1},uD=()=>{if(_1!==void 0)return _1;_1=null;try{let $=HX(I5);_1=cz($)}catch($){}return _1},mD=async()=>{if(S1!==void 0)return S1;S1=null;try{let $=await UX(vz),Z=gz($);S1=lz(Z)}catch($){}return S1},dD=()=>{if(S1!==void 0)return S1;S1=null;try{let $=HX(vz),Z=gz($);S1=lz(Z)}catch($){}return S1},pz=async()=>{let $=null;if(x4()){if($=await mD(),!$){if($=await hD(),!$)$=mz();if(!$){let Z=await fz();$=dz(Z)}}}return $},iz=()=>{let $=null;if(x4()){if($=dD(),!$){if($=uD(),!$)$=mz();if(!$){let Z=hz();$=dz(Z)}}}return $},lD=async()=>x4()&&await pz()!==t1,cD=()=>x4()&&iz()!==t1,pD=async()=>{if(b1!==void 0)return b1;b1=null;try{let Z=(await UX(I5)).match(uz);if(Z)b1=Z[1]}catch($){}return b1},iD=()=>{if(b1!==void 0)return b1;b1=null;try{let Z=HX(I5).match(uz);if(Z)b1=Z[1]}catch($){}return b1},nz=()=>{let $=yz();if($.header&&$.header.glibcVersionRuntime)return $.header.glibcVersionRuntime;return null},xz=($)=>$.trim().split(/\s+/)[1],rz=($)=>{let[Z,X,Q]=$.split(/[\r\n]+/);if(Z&&Z.includes(t1))return xz(Z);if(X&&Q&&X.includes($4))return xz(Q);return null},nD=async()=>{let $=null;if(x4()){if($=await pD(),!$)$=nz();if(!$){let Z=await fz();$=rz(Z)}}return $},rD=()=>{let $=null;if(x4()){if($=iD(),!$)$=nz();if(!$){let Z=hz();$=rz(Z)}}return $};az.exports={GLIBC:t1,MUSL:$4,family:pz,familySync:iz,isNonGlibcLinux:lD,isNonGlibcLinuxSync:cD,version:nD,versionSync:rD}});var k4=b((Wl,oz)=>{var aD=Number.MAX_SAFE_INTEGER||9007199254740991,oD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];oz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:aD,RELEASE_TYPES:oD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var k9=b((Yl,sz)=>{var sD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};sz.exports=sD});var y4=b((x1,tz)=>{var{MAX_SAFE_COMPONENT_LENGTH:VX,MAX_SAFE_BUILD_LENGTH:tD,MAX_LENGTH:eD}=k4(),$w=k9();x1=tz.exports={};var Zw=x1.re=[],Xw=x1.safeRe=[],z0=x1.src=[],Qw=x1.safeSrc=[],q0=x1.t={},Jw=0,BX="[a-zA-Z0-9-]",Gw=[["\\s",1],["\\d",eD],[BX,tD]],Ww=($)=>{for(let[Z,X]of Gw)$=$.split(`${Z}*`).join(`${Z}{0,${X}}`).split(`${Z}+`).join(`${Z}{1,${X}}`);return $},T0=($,Z,X)=>{let Q=Ww(Z),J=Jw++;$w($,J,Z),q0[$]=J,z0[J]=Z,Qw[J]=Q,Zw[J]=new RegExp(Z,X?"g":void 0),Xw[J]=new RegExp(Q,X?"g":void 0)};T0("NUMERICIDENTIFIER","0|[1-9]\\d*");T0("NUMERICIDENTIFIERLOOSE","\\d+");T0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${BX}*`);T0("MAINVERSION",`(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})`);T0("MAINVERSIONLOOSE",`(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASEIDENTIFIER",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIER]})`);T0("PRERELEASEIDENTIFIERLOOSE",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASE",`(?:-(${z0[q0.PRERELEASEIDENTIFIER]}(?:\\.${z0[q0.PRERELEASEIDENTIFIER]})*))`);T0("PRERELEASELOOSE",`(?:-?(${z0[q0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z0[q0.PRERELEASEIDENTIFIERLOOSE]})*))`);T0("BUILDIDENTIFIER",`${BX}+`);T0("BUILD",`(?:\\+(${z0[q0.BUILDIDENTIFIER]}(?:\\.${z0[q0.BUILDIDENTIFIER]})*))`);T0("FULLPLAIN",`v?${z0[q0.MAINVERSION]}${z0[q0.PRERELEASE]}?${z0[q0.BUILD]}?`);T0("FULL",`^${z0[q0.FULLPLAIN]}$`);T0("LOOSEPLAIN",`[v=\\s]*${z0[q0.MAINVERSIONLOOSE]}${z0[q0.PRERELEASELOOSE]}?${z0[q0.BUILD]}?`);T0("LOOSE",`^${z0[q0.LOOSEPLAIN]}$`);T0("GTLT","((?:<|>)?=?)");T0("XRANGEIDENTIFIERLOOSE",`${z0[q0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T0("XRANGEIDENTIFIER",`${z0[q0.NUMERICIDENTIFIER]}|x|X|\\*`);T0("XRANGEPLAIN",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:${z0[q0.PRERELEASE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGEPLAINLOOSE",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:${z0[q0.PRERELEASELOOSE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAIN]}$`);T0("XRANGELOOSE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${VX}})(?:\\.(\\d{1,${VX}}))?(?:\\.(\\d{1,${VX}}))?`);T0("COERCE",`${z0[q0.COERCEPLAIN]}(?:$|[^\\d])`);T0("COERCEFULL",z0[q0.COERCEPLAIN]+`(?:${z0[q0.PRERELEASE]})?(?:${z0[q0.BUILD]})?(?:$|[^\\d])`);T0("COERCERTL",z0[q0.COERCE],!0);T0("COERCERTLFULL",z0[q0.COERCEFULL],!0);T0("LONETILDE","(?:~>?)");T0("TILDETRIM",`(\\s*)${z0[q0.LONETILDE]}\\s+`,!0);x1.tildeTrimReplace="$1~";T0("TILDE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAIN]}$`);T0("TILDELOOSE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("LONECARET","(?:\\^)");T0("CARETTRIM",`(\\s*)${z0[q0.LONECARET]}\\s+`,!0);x1.caretTrimReplace="$1^";T0("CARET",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAIN]}$`);T0("CARETLOOSE",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COMPARATORLOOSE",`^${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]})$|^$`);T0("COMPARATOR",`^${z0[q0.GTLT]}\\s*(${z0[q0.FULLPLAIN]})$|^$`);T0("COMPARATORTRIM",`(\\s*)${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]}|${z0[q0.XRANGEPLAIN]})`,!0);x1.comparatorTrimReplace="$1$2$3";T0("HYPHENRANGE",`^\\s*(${z0[q0.XRANGEPLAIN]})\\s+-\\s+(${z0[q0.XRANGEPLAIN]})\\s*$`);T0("HYPHENRANGELOOSE",`^\\s*(${z0[q0.XRANGEPLAINLOOSE]})\\s+-\\s+(${z0[q0.XRANGEPLAINLOOSE]})\\s*$`);T0("STAR","(<|>)?=?\\s*\\*");T0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var D5=b((zl,ez)=>{var Yw=Object.freeze({loose:!0}),zw=Object.freeze({}),qw=($)=>{if(!$)return zw;if(typeof $!=="object")return Yw;return $};ez.exports=qw});var FX=b((ql,Xq)=>{var $q=/^[0-9]+$/,Zq=($,Z)=>{if(typeof $==="number"&&typeof Z==="number")return $===Z?0:$<Z?-1:1;let X=$q.test($),Q=$q.test(Z);if(X&&Q)$=+$,Z=+Z;return $===Z?0:X&&!Q?-1:Q&&!X?1:$<Z?-1:1},Kw=($,Z)=>Zq(Z,$);Xq.exports={compareIdentifiers:Zq,rcompareIdentifiers:Kw}});var W$=b((Kl,Jq)=>{var w5=k9(),{MAX_LENGTH:Qq,MAX_SAFE_INTEGER:T5}=k4(),{safeRe:j5,t:O5}=y4(),Uw=D5(),{compareIdentifiers:LX}=FX(),Hw=($,Z)=>{let X=Z.split(".");if(X.length>$.length)return!1;for(let Q=0;Q<X.length;Q++)if(LX($[Q],X[Q])!==0)return!1;return!0};class K1{constructor($,Z){if(Z=Uw(Z),$ instanceof K1)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>Qq)throw TypeError(`version is longer than ${Qq} characters`);w5("SemVer",$,Z),this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease;let X=$.trim().match(Z.loose?j5[O5.LOOSE]:j5[O5.FULL]);if(!X)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>T5||this.major<0)throw TypeError("Invalid major version");if(this.minor>T5||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>T5||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<T5)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(w5("SemVer.compare",this.version,this.options,$),!($ instanceof K1)){if(typeof $==="string"&&$===this.version)return 0;$=new K1($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof K1))$=new K1($,this.options);if(this.major<$.major)return-1;if(this.major>$.major)return 1;if(this.minor<$.minor)return-1;if(this.minor>$.minor)return 1;if(this.patch<$.patch)return-1;if(this.patch>$.patch)return 1;return 0}comparePre($){if(!($ instanceof K1))$=new K1($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let Z=0;do{let X=this.prerelease[Z],Q=$.prerelease[Z];if(w5("prerelease compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return LX(X,Q)}while(++Z)}compareBuild($){if(!($ instanceof K1))$=new K1($,this.options);let Z=0;do{let X=this.build[Z],Q=$.build[Z];if(w5("build compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return LX(X,Q)}while(++Z)}inc($,Z,X){if($.startsWith("pre")){if(!Z&&X===!1)throw Error("invalid increment argument: identifier is empty");if(Z){let Q=`-${Z}`.match(this.options.loose?j5[O5.PRERELEASELOOSE]:j5[O5.PRERELEASE]);if(!Q||Q[1]!==Z)throw Error(`invalid identifier: ${Z}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Z,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Z,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Z,X),this.inc("pre",Z,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",Z,X);this.inc("pre",Z,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(Z===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(Z){let J=[Z,Q];if(X===!1)J=[Z];if(Hw(this.prerelease,Z)){let G=this.prerelease[Z.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Jq.exports=K1});var E6=b((Ul,Wq)=>{var Gq=W$(),Vw=($,Z,X=!1)=>{if($ instanceof Gq)return $;try{return new Gq($,Z)}catch(Q){if(!X)return null;throw Q}};Wq.exports=Vw});var zq=b((Hl,Yq)=>{var Bw=E6(),Fw=($,Z)=>{let X=Bw($,Z);return X?X.version:null};Yq.exports=Fw});var Kq=b((Vl,qq)=>{var Lw=E6(),Mw=($,Z)=>{let X=Lw($.trim().replace(/^[=v]+/,""),Z);return X?X.version:null};qq.exports=Mw});var Vq=b((Bl,Hq)=>{var Uq=W$(),Aw=($,Z,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new Uq($ instanceof Uq?$.version:$,X).inc(Z,Q,J).version}catch(G){return null}};Hq.exports=Aw});var Lq=b((Fl,Fq)=>{var Bq=E6(),Iw=($,Z)=>{let X=Bq($,null,!0),Q=Bq(Z,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,W=G?X:Q,Y=G?Q:X,z=!!W.prerelease.length;if(!!Y.prerelease.length&&!z){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(W)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let H=z?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};Fq.exports=Iw});var Aq=b((Ll,Mq)=>{var Nw=W$(),Dw=($,Z)=>new Nw($,Z).major;Mq.exports=Dw});var Nq=b((Ml,Iq)=>{var ww=W$(),Tw=($,Z)=>new ww($,Z).minor;Iq.exports=Tw});var wq=b((Al,Dq)=>{var jw=W$(),Ow=($,Z)=>new jw($,Z).patch;Dq.exports=Ow});var jq=b((Il,Tq)=>{var Ew=E6(),Rw=($,Z)=>{let X=Ew($,Z);return X&&X.prerelease.length?X.prerelease:null};Tq.exports=Rw});var Z1=b((Nl,Eq)=>{var Oq=W$(),Pw=($,Z,X)=>new Oq($,X).compare(new Oq(Z,X));Eq.exports=Pw});var Pq=b((Dl,Rq)=>{var Cw=Z1(),Sw=($,Z,X)=>Cw(Z,$,X);Rq.exports=Sw});var Sq=b((wl,Cq)=>{var _w=Z1(),bw=($,Z)=>_w($,Z,!0);Cq.exports=bw});var E5=b((Tl,bq)=>{var _q=W$(),xw=($,Z,X)=>{let Q=new _q($,X),J=new _q(Z,X);return Q.compare(J)||Q.compareBuild(J)};bq.exports=xw});var kq=b((jl,xq)=>{var kw=E5(),yw=($,Z)=>$.sort((X,Q)=>kw(X,Q,Z));xq.exports=yw});var vq=b((Ol,yq)=>{var vw=E5(),gw=($,Z)=>$.sort((X,Q)=>vw(Q,X,Z));yq.exports=gw});var y9=b((El,gq)=>{var fw=Z1(),hw=($,Z,X)=>fw($,Z,X)>0;gq.exports=hw});var R5=b((Rl,fq)=>{var uw=Z1(),mw=($,Z,X)=>uw($,Z,X)<0;fq.exports=mw});var MX=b((Pl,hq)=>{var dw=Z1(),lw=($,Z,X)=>dw($,Z,X)===0;hq.exports=lw});var AX=b((Cl,uq)=>{var cw=Z1(),pw=($,Z,X)=>cw($,Z,X)!==0;uq.exports=pw});var P5=b((Sl,mq)=>{var iw=Z1(),nw=($,Z,X)=>iw($,Z,X)>=0;mq.exports=nw});var C5=b((_l,dq)=>{var rw=Z1(),aw=($,Z,X)=>rw($,Z,X)<=0;dq.exports=aw});var IX=b((bl,lq)=>{var ow=MX(),sw=AX(),tw=y9(),ew=P5(),$T=R5(),ZT=C5(),XT=($,Z,X,Q)=>{switch(Z){case"===":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $===X;case"!==":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $!==X;case"":case"=":case"==":return ow($,X,Q);case"!=":return sw($,X,Q);case">":return tw($,X,Q);case">=":return ew($,X,Q);case"<":return $T($,X,Q);case"<=":return ZT($,X,Q);default:throw TypeError(`Invalid operator: ${Z}`)}};lq.exports=XT});var pq=b((xl,cq)=>{var QT=W$(),JT=E6(),{safeRe:S5,t:_5}=y4(),GT=($,Z)=>{if($ instanceof QT)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;Z=Z||{};let X=null;if(!Z.rtl)X=$.match(Z.includePrerelease?S5[_5.COERCEFULL]:S5[_5.COERCE]);else{let z=Z.includePrerelease?S5[_5.COERCERTLFULL]:S5[_5.COERCERTL],q;while((q=z.exec($))&&(!X||X.index+X[0].length!==$.length)){if(!X||q.index+q[0].length!==X.index+X[0].length)X=q;z.lastIndex=q.index+q[1].length+q[2].length}z.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",W=Z.includePrerelease&&X[5]?`-${X[5]}`:"",Y=Z.includePrerelease&&X[6]?`+${X[6]}`:"";return JT(`${Q}.${J}.${G}${W}${Y}`,Z)};cq.exports=GT});var nq=b((kl,iq)=>{var WT=E6(),YT=k4(),zT=W$(),qT=($,Z,X)=>{if(!YT.RELEASE_TYPES.includes(Z))return null;let Q=KT($,X);return Q&&UT(Q,Z)},KT=($,Z)=>{let X=$ instanceof zT?$.version:$;return WT(X,Z)},UT=($,Z)=>{if(HT(Z))return $.version;switch($.prerelease=[],Z){case"major":$.minor=0,$.patch=0;break;case"minor":$.patch=0;break}return $.format()},HT=($)=>{return $.startsWith("pre")};iq.exports=qT});var oq=b((yl,aq)=>{class rq{constructor(){this.max=1000,this.map=new Map}get($){let Z=this.map.get($);if(Z===void 0)return;else return this.map.delete($),this.map.set($,Z),Z}delete($){return this.map.delete($)}set($,Z){if(!this.delete($)&&Z!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set($,Z)}return this}}aq.exports=rq});var X1=b((vl,$K)=>{var VT=/\s+/g;class v9{constructor($,Z){if(Z=FT(Z),$ instanceof v9)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else return new v9($.raw,Z);if($ instanceof NX)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease,this.raw=$.trim().replace(VT," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!tq(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&jT(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let Z=this.set[$];for(let X=0;X<Z.length;X++){if(X>0)this.formatted+=" ";this.formatted+=Z[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){$=$.replace(TT,"");let X=((this.options.includePrerelease&&DT)|(this.options.loose&&wT))+":"+$,Q=sq.get(X);if(Q)return Q;let J=this.options.loose,G=J?w$[Y$.HYPHENRANGELOOSE]:w$[Y$.HYPHENRANGE];$=$.replace(G,yT(this.options.includePrerelease)),f0("hyphen replace",$),$=$.replace(w$[Y$.COMPARATORTRIM],AT),f0("comparator trim",$),$=$.replace(w$[Y$.TILDETRIM],IT),f0("tilde trim",$),$=$.replace(w$[Y$.CARETTRIM],NT),f0("caret trim",$);let W=$.split(" ").map((H)=>OT(H,this.options)).join(" ").split(/\s+/).map((H)=>kT(H,this.options));if(J)W=W.filter((H)=>{return f0("loose invalid filter",H,this.options),!!H.match(w$[Y$.COMPARATORLOOSE])});f0("range list",W);let Y=new Map,z=W.map((H)=>new NX(H,this.options));for(let H of z){if(tq(H))return[H];Y.set(H.value,H)}if(Y.size>1&&Y.has(""))Y.delete("");let q=[...Y.values()];return sq.set(X,q),q}intersects($,Z){if(!($ instanceof v9))throw TypeError("a Range is required");return this.set.some((X)=>{return eq(X,Z)&&$.set.some((Q)=>{return eq(Q,Z)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,Z)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new LT($,this.options)}catch(Z){return!1}for(let Z=0;Z<this.set.length;Z++)if(vT(this.set[Z],$,this.options))return!0;return!1}}$K.exports=v9;var BT=oq(),sq=new BT,FT=D5(),NX=g9(),f0=k9(),LT=W$(),{safeRe:w$,src:MT,t:Y$,comparatorTrimReplace:AT,tildeTrimReplace:IT,caretTrimReplace:NT}=y4(),{FLAG_INCLUDE_PRERELEASE:DT,FLAG_LOOSE:wT}=k4(),TT=new RegExp(MT[Y$.BUILD],"g"),tq=($)=>$.value==="<0.0.0-0",jT=($)=>$.value==="",eq=($,Z)=>{let X=!0,Q=$.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,Z)}),J=Q.pop();return X},OT=($,Z)=>{return $=$.replace(w$[Y$.BUILD],""),f0("comp",$,Z),$=CT($,Z),f0("caret",$),$=RT($,Z),f0("tildes",$),$=_T($,Z),f0("xrange",$),$=xT($,Z),f0("stars",$),$},Z$=($)=>!$||$.toLowerCase()==="x"||$==="*",ET=($,Z,X)=>Z$($)&&!Z$(Z)||Z$(Z)&&X&&!Z$(X),RT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>PT(X,Z)).join(" ")},PT=($,Z)=>{let X=Z.loose?w$[Y$.TILDELOOSE]:w$[Y$.TILDE],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("tilde",$,J,G,W,Y,z);let q;if(Z$(G))q="";else if(Z$(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(Z$(Y))q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else if(z)f0("replaceTilde pr",z),q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;return f0("tilde return",q),q})},CT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>ST(X,Z)).join(" ")},ST=($,Z)=>{f0("caret",$,Z);let X=Z.loose?w$[Y$.CARETLOOSE]:w$[Y$.CARET],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("caret",$,J,G,W,Y,z);let q;if(Z$(G))q="";else if(Z$(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(Z$(Y))if(G==="0")q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.0${Q} <${+G+1}.0.0-0`;else if(z)if(f0("replaceCaret pr",z),G==="0")if(W==="0")q=`>=${G}.${W}.${Y}-${z} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y}-${z} <${+G+1}.0.0-0`;else if(f0("no pr"),G==="0")if(W==="0")q=`>=${G}.${W}.${Y} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${+G+1}.0.0-0`;return f0("caret return",q),q})},_T=($,Z)=>{return f0("replaceXRanges",$,Z),$.split(/\s+/).map((X)=>bT(X,Z)).join(" ")},bT=($,Z)=>{$=$.trim();let X=Z.loose?w$[Y$.XRANGELOOSE]:w$[Y$.XRANGE];return $.replace(X,(Q,J,G,W,Y,z)=>{if(f0("xRange",$,Q,J,G,W,Y,z),ET(G,W,Y))return $;let q=Z$(G),H=q||Z$(W),B=H||Z$(Y),F=B;if(J==="="&&F)J="";if(z=Z.includePrerelease?"-0":"",q)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&F){if(H)W=0;if(Y=0,J===">")if(J=">=",H)G=+G+1,W=0,Y=0;else W=+W+1,Y=0;else if(J==="<=")if(J="<",H)G=+G+1;else W=+W+1;if(J==="<")z="-0";Q=`${J+G}.${W}.${Y}${z}`}else if(H)Q=`>=${G}.0.0${z} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${W}.0${z} <${G}.${+W+1}.0-0`;return f0("xRange return",Q),Q})},xT=($,Z)=>{return f0("replaceStars",$,Z),$.trim().replace(w$[Y$.STAR],"")},kT=($,Z)=>{return f0("replaceGTE0",$,Z),$.trim().replace(w$[Z.includePrerelease?Y$.GTE0PRE:Y$.GTE0],"")},yT=($)=>(Z,X,Q,J,G,W,Y,z,q,H,B,F)=>{if(Z$(Q))X="";else if(Z$(J))X=`>=${Q}.0.0${$?"-0":""}`;else if(Z$(G))X=`>=${Q}.${J}.0${$?"-0":""}`;else if(W)X=`>=${X}`;else X=`>=${X}${$?"-0":""}`;if(Z$(q))z="";else if(Z$(H))z=`<${+q+1}.0.0-0`;else if(Z$(B))z=`<${q}.${+H+1}.0-0`;else if(F)z=`<=${q}.${H}.${B}-${F}`;else if($)z=`<${q}.${H}.${+B+1}-0`;else z=`<=${z}`;return`${X} ${z}`.trim()},vT=($,Z,X)=>{for(let Q=0;Q<$.length;Q++)if(!$[Q].test(Z))return!1;if(Z.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<$.length;Q++){if(f0($[Q].semver),$[Q].semver===NX.ANY)continue;if($[Q].semver.prerelease.length>0){let J=$[Q].semver;if(J.major===Z.major&&J.minor===Z.minor&&J.patch===Z.patch)return!0}}return!1}return!0}});var g9=b((gl,WK)=>{var f9=Symbol("SemVer ANY");class b5{static get ANY(){return f9}constructor($,Z){if(Z=ZK(Z),$ instanceof b5)if($.loose===!!Z.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),wX("comparator",$,Z),this.options=Z,this.loose=!!Z.loose,this.parse($),this.semver===f9)this.value="";else this.value=this.operator+this.semver.version;wX("comp",this)}parse($){let Z=this.options.loose?XK[QK.COMPARATORLOOSE]:XK[QK.COMPARATOR],X=$.match(Z);if(!X)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=f9;else this.semver=new JK(X[2],this.options.loose)}toString(){return this.value}test($){if(wX("Comparator.test",$,this.options.loose),this.semver===f9||$===f9)return!0;if(typeof $==="string")try{$=new JK($,this.options)}catch(Z){return!1}return DX($,this.operator,this.semver,this.options)}intersects($,Z){if(!($ instanceof b5))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new GK($.value,Z).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new GK(this.value,Z).test($.semver)}if(Z=ZK(Z),Z.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!Z.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(DX(this.semver,"<",$.semver,Z)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(DX(this.semver,">",$.semver,Z)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}WK.exports=b5;var ZK=D5(),{safeRe:XK,t:QK}=y4(),DX=IX(),wX=k9(),JK=W$(),GK=X1()});var h9=b((fl,YK)=>{var gT=X1(),fT=($,Z,X)=>{try{Z=new gT(Z,X)}catch(Q){return!1}return Z.test($)};YK.exports=fT});var qK=b((hl,zK)=>{var hT=X1(),uT=($,Z)=>new hT($,Z).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));zK.exports=uT});var UK=b((ul,KK)=>{var mT=W$(),dT=X1(),lT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new dT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===-1)Q=W,J=new mT(Q,X)}}),Q};KK.exports=lT});var VK=b((ml,HK)=>{var cT=W$(),pT=X1(),iT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new pT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===1)Q=W,J=new cT(Q,X)}}),Q};HK.exports=iT});var LK=b((dl,FK)=>{var TX=W$(),nT=X1(),BK=y9(),rT=($,Z)=>{$=new nT($,Z);let X=new TX("0.0.0");if($.test(X))return X;if(X=new TX("0.0.0-0"),$.test(X))return X;X=null;for(let Q=0;Q<$.set.length;++Q){let J=$.set[Q],G=null;if(J.forEach((W)=>{let Y=new TX(W.semver.version);switch(W.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!G||BK(Y,G))G=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${W.operator}`)}}),G&&(!X||BK(X,G)))X=G}if(X&&$.test(X))return X;return null};FK.exports=rT});var AK=b((ll,MK)=>{var aT=X1(),oT=($,Z)=>{try{return new aT($,Z).range||"*"}catch(X){return null}};MK.exports=oT});var x5=b((cl,wK)=>{var sT=W$(),DK=g9(),{ANY:tT}=DK,eT=X1(),$j=h9(),IK=y9(),NK=R5(),Zj=C5(),Xj=P5(),Qj=($,Z,X,Q)=>{$=new sT($,Q),Z=new eT(Z,Q);let J,G,W,Y,z;switch(X){case">":J=IK,G=Zj,W=NK,Y=">",z=">=";break;case"<":J=NK,G=Xj,W=IK,Y="<",z="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if($j($,Z,Q))return!1;for(let q=0;q<Z.set.length;++q){let H=Z.set[q],B=null,F=null;if(H.forEach((L)=>{if(L.semver===tT)L=new DK(">=0.0.0");if(B=B||L,F=F||L,J(L.semver,B.semver,Q))B=L;else if(W(L.semver,F.semver,Q))F=L}),B.operator===Y||B.operator===z)return!1;if((!F.operator||F.operator===Y)&&G($,F.semver))return!1;else if(F.operator===z&&W($,F.semver))return!1}return!0};wK.exports=Qj});var jK=b((pl,TK)=>{var Jj=x5(),Gj=($,Z,X)=>Jj($,Z,">",X);TK.exports=Gj});var EK=b((il,OK)=>{var Wj=x5(),Yj=($,Z,X)=>Wj($,Z,"<",X);OK.exports=Yj});var CK=b((nl,PK)=>{var RK=X1(),zj=($,Z,X)=>{return $=new RK($,X),Z=new RK(Z,X),$.intersects(Z,X)};PK.exports=zj});var _K=b((rl,SK)=>{var qj=h9(),Kj=Z1();SK.exports=($,Z,X)=>{let Q=[],J=null,G=null,W=$.sort((H,B)=>Kj(H,B,X));for(let H of W)if(qj(H,Z,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let Y=[];for(let[H,B]of Q)if(H===B)Y.push(H);else if(!B&&H===W[0])Y.push("*");else if(!B)Y.push(`>=${H}`);else if(H===W[0])Y.push(`<=${B}`);else Y.push(`${H} - ${B}`);let z=Y.join(" || "),q=typeof Z.raw==="string"?Z.raw:String(Z);return z.length<q.length?z:Z}});var gK=b((al,vK)=>{var bK=X1(),EX=g9(),{ANY:jX}=EX,OX=h9(),RX=Z1(),Uj=($,Z,X={})=>{if($===Z)return!0;$=new bK($,X),Z=new bK(Z,X);let Q=!1;$:for(let J of $.set){for(let G of Z.set){let W=Vj(J,G,X);if(Q=Q||W!==null,W)continue $}if(Q)return!1}return!0},Hj=[new EX(">=0.0.0-0")],xK=[new EX(">=0.0.0")],Vj=($,Z,X)=>{if($===Z)return!0;if($.length===1&&$[0].semver===jX)if(Z.length===1&&Z[0].semver===jX)return!0;else if(X.includePrerelease)$=Hj;else $=xK;if(Z.length===1&&Z[0].semver===jX)if(X.includePrerelease)return!0;else Z=xK;let Q=new Set,J,G;for(let L of $)if(L.operator===">"||L.operator===">=")J=kK(J,L,X);else if(L.operator==="<"||L.operator==="<=")G=yK(G,L,X);else Q.add(L.semver);if(Q.size>1)return null;let W;if(J&&G){if(W=RX(J.semver,G.semver,X),W>0)return null;else if(W===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let L of Q){if(J&&!OX(L,String(J),X))return null;if(G&&!OX(L,String(G),X))return null;for(let w of Z)if(!OX(L,String(w),X))return!1;return!0}let Y,z,q,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,F=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let L of Z){if(H=H||L.operator===">"||L.operator===">=",q=q||L.operator==="<"||L.operator==="<=",J){if(F){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===F.major&&L.semver.minor===F.minor&&L.semver.patch===F.patch)F=!1}if(L.operator===">"||L.operator===">="){if(Y=kK(J,L,X),Y===L&&Y!==J)return!1}else if(J.operator===">="&&!L.test(J.semver))return!1}if(G){if(B){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===B.major&&L.semver.minor===B.minor&&L.semver.patch===B.patch)B=!1}if(L.operator==="<"||L.operator==="<="){if(z=yK(G,L,X),z===L&&z!==G)return!1}else if(G.operator==="<="&&!L.test(G.semver))return!1}if(!L.operator&&(G||J)&&W!==0)return!1}if(J&&q&&!G&&W!==0)return!1;if(G&&H&&!J&&W!==0)return!1;if(F||B)return!1;return!0},kK=($,Z,X)=>{if(!$)return Z;let Q=RX($.semver,Z.semver,X);return Q>0?$:Q<0?Z:Z.operator===">"&&$.operator===">="?Z:$},yK=($,Z,X)=>{if(!$)return Z;let Q=RX($.semver,Z.semver,X);return Q<0?$:Q>0?Z:Z.operator==="<"&&$.operator==="<="?Z:$};vK.exports=Uj});var mK=b((ol,uK)=>{var PX=y4(),fK=k4(),Bj=W$(),hK=FX(),Fj=E6(),Lj=zq(),Mj=Kq(),Aj=Vq(),Ij=Lq(),Nj=Aq(),Dj=Nq(),wj=wq(),Tj=jq(),jj=Z1(),Oj=Pq(),Ej=Sq(),Rj=E5(),Pj=kq(),Cj=vq(),Sj=y9(),_j=R5(),bj=MX(),xj=AX(),kj=P5(),yj=C5(),vj=IX(),gj=pq(),fj=nq(),hj=g9(),uj=X1(),mj=h9(),dj=qK(),lj=UK(),cj=VK(),pj=LK(),ij=AK(),nj=x5(),rj=jK(),aj=EK(),oj=CK(),sj=_K(),tj=gK();uK.exports={parse:Fj,valid:Lj,clean:Mj,inc:Aj,diff:Ij,major:Nj,minor:Dj,patch:wj,prerelease:Tj,compare:jj,rcompare:Oj,compareLoose:Ej,compareBuild:Rj,sort:Pj,rsort:Cj,gt:Sj,lt:_j,eq:bj,neq:xj,gte:kj,lte:yj,cmp:vj,coerce:gj,truncate:fj,Comparator:hj,Range:uj,satisfies:mj,toComparators:dj,maxSatisfying:lj,minSatisfying:cj,minVersion:pj,validRange:ij,outside:nj,gtr:rj,ltr:aj,intersects:oj,simplifyRange:sj,subset:tj,SemVer:Bj,re:PX.re,src:PX.src,tokens:PX.t,SEMVER_SPEC_VERSION:fK.SEMVER_SPEC_VERSION,RELEASE_TYPES:fK.RELEASE_TYPES,compareIdentifiers:hK.compareIdentifiers,rcompareIdentifiers:hK.rcompareIdentifiers}});var e1;var k5=s(()=>{e1={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as u9}from"node:child_process";import{createHash as $O}from"node:crypto";var m9,SX,ZO,lK,XO,_X,QO=($)=>{if($ instanceof Error)console.error(`sharp: Installation error: ${$.message}`);else console.log(`sharp: ${$}`)},cK=()=>SX.default.isNonGlibcLinuxSync()?SX.default.familySync():"",JO=()=>`${process.platform}${cK()}-${process.arch}`,v4=()=>{if(pK())return"wasm32";let{npm_config_arch:$,npm_config_platform:Z,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:cK();return`${Z||process.platform}${Q}-${$||process.arch}`},GO=()=>{try{return O0(`@img/sharp-libvips-dev-${v4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},WO=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},YO=()=>{try{return O0(`@img/sharp-libvips-dev-${v4()}/lib`)}catch{try{return O0(`@img/sharp-libvips-${v4()}/lib`)}catch{}}return""},zO=()=>{if(process.release?.name==="node"&&process.versions){if(!m9.default.satisfies(process.versions.node,e1.engines.node))return{found:process.versions.node,expected:e1.engines.node}}},pK=()=>{let{CC:$}=process.env;return Boolean($?.endsWith("/emcc"))},qO=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(u9("sysctl sysctl.proc_translated",_X).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},dK=($)=>$O("sha512").update($).digest("hex"),KO=()=>{try{let $=dK(`imgsharp-libvips-${v4()}`),Z=m9.default.coerce(e1.optionalDependencies[`@img/sharp-libvips-${v4()}`],{includePrerelease:!0}).version;return dK(`${$}npm:${Z}`).slice(0,10)}catch{}return""},UO=()=>u9(`node-gyp rebuild --directory=src ${pK()?"--nodedir=emscripten":""}`,{..._X,stdio:"inherit"}).status,iK=()=>{if(process.platform!=="win32")return(u9("pkg-config --modversion vips-cpp",{..._X,env:{...process.env,PKG_CONFIG_PATH:nK()}}).stdout||"").trim();else return""},HO=()=>{try{let $=(u9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if($)return`${$}/lib/pkgconfig`}catch($){}return},VO=()=>{try{let $=(u9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if($)return $}catch($){}return},nK=()=>{if(process.platform!=="win32")return[HO(),VO(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},CX=($,Z,X)=>{if(X)X(`Detected ${Z}, skipping search for globally-installed libvips`);return $},BO=($)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return CX(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",$);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return CX(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",$);if(qO())return CX(!1,"Rosetta",$);let Z=iK();return!!Z&&m9.default.gte(Z,lK)},y5;var bX=s(()=>{k5();m9=F$(mK(),1),SX=F$(N5(),1);/*!
288
286
  Copyright 2013 Lovell Fuller and others.
289
287
  SPDX-License-Identifier: Apache-2.0
290
- */Oj=process.env.npm_package_config_libvips||t6.config.libvips,wU=k9.default.coerce(Oj).version,Ej=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],AX={encoding:"utf8",shell:!0},w8={minimumLibvipsVersion:wU,prebuiltPlatforms:Ej,buildPlatformArch:C4,buildSharpLibvipsIncludeDir:Cj,buildSharpLibvipsCPlusPlusDir:Sj,buildSharpLibvipsLibDir:_j,isUnsupportedNodeRuntime:xj,runtimePlatformArch:Pj,log:Rj,yarnLocator:kj,spawnRebuild:yj,globalLibvipsVersion:OU,pkgConfigPath:EU,useGlobalLibvips:fj}});import{createRequire as hj}from"node:module";var T8,$$,PU,uj,RU,mj,dj,e6,b0,O1,_0;var y9=t(()=>{IX();D8();T8=B$(Y8(),1);/*!
288
+ */ZO=process.env.npm_package_config_libvips||e1.config.libvips,lK=m9.default.coerce(ZO).version,XO=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],_X={encoding:"utf8",shell:!0},y5={minimumLibvipsVersion:lK,prebuiltPlatforms:XO,buildPlatformArch:v4,buildSharpLibvipsIncludeDir:GO,buildSharpLibvipsCPlusPlusDir:WO,buildSharpLibvipsLibDir:YO,isUnsupportedNodeRuntime:zO,runtimePlatformArch:JO,log:QO,yarnLocator:KO,spawnRebuild:UO,globalLibvipsVersion:iK,pkgConfigPath:nK,useGlobalLibvips:BO}});import{createRequire as FO}from"node:module";var v5,X$,aK,LO,rK,MO,AO,$6,k0,R6,x0;var d9=s(()=>{bX();k5();v5=F$(N5(),1);/*!
291
289
  Copyright 2013 Lovell Fuller and others.
292
290
  SPDX-License-Identifier: Apache-2.0
293
- */$$=hj(import.meta.url),{version:PU}=t6,{runtimePlatformArch:uj,isUnsupportedNodeRuntime:RU,prebuiltPlatforms:mj,minimumLibvipsVersion:dj}=w8,e6=uj(),O1=[];try{b0=$$(`../src/build/Release/sharp-${e6}-${PU}.node`)}catch($){O1.push($)}if(!b0)try{b0=$$(`../src/build/Release/sharp-wasm32-${PU}.node`)}catch($){O1.push($)}if(!b0)try{switch(e6){case"darwin-arm64":b0=$$("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":b0=$$("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":b0=$$("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":b0=$$("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":b0=$$("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":b0=$$("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":b0=$$("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":b0=$$("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":b0=$$("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":b0=$$("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":b0=$$("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":b0=$$("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":b0=$$("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":b0=$$("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":b0=$$("@img/sharp-webcontainers-wasm32/sharp.node");break}if(b0&&["linux-x64","linuxmusl-x64"].includes(e6)&&!b0._isUsingX64V2()){let $=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");$.code="Unsupported CPU",O1.push($),b0=null}if(b0&&process.versions.electron&&e6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch($){O1.push($)}if(!b0)try{b0=$$("@img/sharp-wasm32/sharp.node")}catch($){O1.push($)}if(!b0){let[$,Z,X]=["linux","darwin","win32"].map((G)=>e6.startsWith(G)),Q=[`Could not load the "sharp" module using the ${e6} runtime`];O1.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=O1.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),RU()){let{found:G,expected:W}=RU();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${W}`)}else if(mj.includes(e6)){let[G,W]=e6.split("-"),Y=G.endsWith("musl")?" --libc=musl":"";Q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${G.replace("musl","")}${Y} --cpu=${W} sharp`)}else Q.push(`- Manually install libvips >= ${dj}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if($&&/(symbol not found|CXXABI_)/i.test(J))try{let{config:G}=$$(`@img/sharp-libvips-${e6}/package`),W=`${T8.familySync()} ${T8.versionSync()}`,Y=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${W}`,` Requires ${Y}`)}catch(G){}if($&&/\/snap\/core[0-9]{2}/.test(J))Q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(Z&&/Incompatible library version/.test(J))Q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(O1.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))Q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(J))Q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw Q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(Q.join(`
294
- `))}_0=b0});import lj from"node:util";import NX from"node:stream";function ij(){let $=this.constructor.call(),{debuglog:Z,queueListener:X,...Q}=this.options;if($.options=structuredClone(Q),$.options.debuglog=Z,$.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),$.options.input.buffer=this.options.input.buffer,$.emit("finish")});return $}var cj,pj=($)=>{s1.queue.emit("change",$)},s1=function($,Z){if(arguments.length===1&&!K.defined($))throw Error("Invalid input");if(!(this instanceof s1))return new s1($,Z);return NX.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),cj(X)},queueListener:pj},this.options.input=this._createInputDescriptor($,Z,{allowStream:!0}),this},x6;var CU=t(()=>{R6();y9();/*!
291
+ */X$=FO(import.meta.url),{version:aK}=e1,{runtimePlatformArch:LO,isUnsupportedNodeRuntime:rK,prebuiltPlatforms:MO,minimumLibvipsVersion:AO}=y5,$6=LO(),R6=[];try{k0=X$(`../src/build/Release/sharp-${$6}-${aK}.node`)}catch($){R6.push($)}if(!k0)try{k0=X$(`../src/build/Release/sharp-wasm32-${aK}.node`)}catch($){R6.push($)}if(!k0)try{switch($6){case"darwin-arm64":k0=X$("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":k0=X$("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":k0=X$("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":k0=X$("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":k0=X$("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":k0=X$("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":k0=X$("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":k0=X$("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":k0=X$("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":k0=X$("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":k0=X$("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":k0=X$("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":k0=X$("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":k0=X$("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":k0=X$("@img/sharp-webcontainers-wasm32/sharp.node");break}if(k0&&["linux-x64","linuxmusl-x64"].includes($6)&&!k0._isUsingX64V2()){let $=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");$.code="Unsupported CPU",R6.push($),k0=null}if(k0&&process.versions.electron&&$6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch($){R6.push($)}if(!k0)try{k0=X$("@img/sharp-wasm32/sharp.node")}catch($){R6.push($)}if(!k0){let[$,Z,X]=["linux","darwin","win32"].map((G)=>$6.startsWith(G)),Q=[`Could not load the "sharp" module using the ${$6} runtime`];R6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=R6.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),rK()){let{found:G,expected:W}=rK();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${W}`)}else if(MO.includes($6)){let[G,W]=$6.split("-"),Y=G.endsWith("musl")?" --libc=musl":"";Q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${G.replace("musl","")}${Y} --cpu=${W} sharp`)}else Q.push(`- Manually install libvips >= ${AO}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if($&&/(symbol not found|CXXABI_)/i.test(J))try{let{config:G}=X$(`@img/sharp-libvips-${$6}/package`),W=`${v5.familySync()} ${v5.versionSync()}`,Y=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${W}`,` Requires ${Y}`)}catch(G){}if($&&/\/snap\/core[0-9]{2}/.test(J))Q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(Z&&/Incompatible library version/.test(J))Q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(R6.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))Q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(J))Q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw Q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(Q.join(`
292
+ `))}x0=k0});import IO from"node:util";import xX from"node:stream";function wO(){let $=this.constructor.call(),{debuglog:Z,queueListener:X,...Q}=this.options;if($.options=structuredClone(Q),$.options.debuglog=Z,$.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),$.options.input.buffer=this.options.input.buffer,$.emit("finish")});return $}var NO,DO=($)=>{Z4.queue.emit("change",$)},Z4=function($,Z){if(arguments.length===1&&!U.defined($))throw Error("Invalid input");if(!(this instanceof Z4))return new Z4($,Z);return xX.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),NO(X)},queueListener:DO},this.options.input=this._createInputDescriptor($,Z,{allowStream:!0}),this},k1;var oK=s(()=>{C1();d9();/*!
295
293
  Copyright 2013 Lovell Fuller and others.
296
294
  SPDX-License-Identifier: Apache-2.0
297
- */cj=lj.debuglog("sharp");Object.setPrototypeOf(s1.prototype,NX.Duplex.prototype);Object.setPrototypeOf(s1,NX.Duplex);Object.assign(s1.prototype,{clone:ij});x6=s1});function SU($){let Z=rj.filter((X)=>K.defined($[X])).map((X)=>[X,$[X]]);return Z.length?Object.fromEntries(Z):void 0}function aj($,Z,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(K.string($))Q.file=$;else if(K.buffer($)){if($.length===0)throw Error("Input Buffer is empty");Q.buffer=$}else if(K.arrayBuffer($)){if($.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from($,0,$.byteLength)}else if(K.typedArray($)){if($.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from($.buffer,$.byteOffset,$.byteLength)}else if(K.plainObject($)&&!K.defined(Z)){if(Z=$,SU(Z))Q.buffer=[]}else if(!K.defined($)&&!K.defined(Z)&&K.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray($))if($.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=$.map((J)=>this._createInputDescriptor(J));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${$}' of type ${typeof $}${K.defined(Z)?` when also providing options of type ${typeof Z}`:""}`);if(K.object(Z)){if(K.defined(Z.failOn))if(K.string(Z.failOn)&&K.inArray(Z.failOn,["none","truncated","error","warning"]))Q.failOn=Z.failOn;else throw K.invalidParameterError("failOn","one of: none, truncated, error, warning",Z.failOn);if(K.defined(Z.autoOrient))if(K.bool(Z.autoOrient))Q.autoOrient=Z.autoOrient;else throw K.invalidParameterError("autoOrient","boolean",Z.autoOrient);if(K.defined(Z.density))if(K.number(Z.density)&&K.inRange(Z.density,1,1e5))Q.density=Z.density;else throw K.invalidParameterError("density","number between 1 and 100000",Z.density);if(K.defined(Z.ignoreIcc))if(K.bool(Z.ignoreIcc))Q.ignoreIcc=Z.ignoreIcc;else throw K.invalidParameterError("ignoreIcc","boolean",Z.ignoreIcc);if(K.defined(Z.limitInputPixels))if(K.bool(Z.limitInputPixels))Q.limitInputPixels=Z.limitInputPixels?268402689:0;else if(K.integer(Z.limitInputPixels)&&K.inRange(Z.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=Z.limitInputPixels;else throw K.invalidParameterError("limitInputPixels","positive integer",Z.limitInputPixels);if(K.defined(Z.limitInputChannels))if(K.bool(Z.limitInputChannels))Q.limitInputChannels=Z.limitInputChannels?5:0;else if(K.integer(Z.limitInputChannels)&&K.inRange(Z.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=Z.limitInputChannels;else throw K.invalidParameterError("limitInputChannels","positive integer",Z.limitInputChannels);if(K.defined(Z.unlimited))if(K.bool(Z.unlimited))Q.unlimited=Z.unlimited;else throw K.invalidParameterError("unlimited","boolean",Z.unlimited);if(K.defined(Z.sequentialRead))if(K.bool(Z.sequentialRead))Q.sequentialRead=Z.sequentialRead;else throw K.invalidParameterError("sequentialRead","boolean",Z.sequentialRead);if(K.defined(Z.raw)){if(K.object(Z.raw)&&K.integer(Z.raw.width)&&K.inRange(Z.raw.width,1,1e8)&&K.integer(Z.raw.height)&&K.inRange(Z.raw.height,1,1e8)&&K.integer(Z.raw.channels)&&K.inRange(Z.raw.channels,1,4))switch(Q.rawWidth=Z.raw.width,Q.rawHeight=Z.raw.height,Q.rawChannels=Z.raw.channels,$.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,K.defined(Z.raw.premultiplied))if(K.bool(Z.raw.premultiplied))Q.rawPremultiplied=Z.raw.premultiplied;else throw K.invalidParameterError("raw.premultiplied","boolean",Z.raw.premultiplied);if(Q.rawPageHeight=0,K.defined(Z.raw.pageHeight))if(K.integer(Z.raw.pageHeight)&&Z.raw.pageHeight>0&&Z.raw.pageHeight<=Z.raw.height){if(Z.raw.height%Z.raw.pageHeight!==0)throw Error(`Expected raw.height ${Z.raw.height} to be a multiple of raw.pageHeight ${Z.raw.pageHeight}`);Q.rawPageHeight=Z.raw.pageHeight}else throw K.invalidParameterError("raw.pageHeight","positive integer",Z.raw.pageHeight)}if(K.defined(Z.animated))if(K.bool(Z.animated))Q.pages=Z.animated?-1:1;else throw K.invalidParameterError("animated","boolean",Z.animated);if(K.defined(Z.pages))if(K.integer(Z.pages)&&K.inRange(Z.pages,-1,1e5))Q.pages=Z.pages;else throw K.invalidParameterError("pages","integer between -1 and 100000",Z.pages);if(K.defined(Z.page))if(K.integer(Z.page)&&K.inRange(Z.page,0,1e5))Q.page=Z.page;else throw K.invalidParameterError("page","integer between 0 and 100000",Z.page);if(K.object(Z.openSlide)&&K.defined(Z.openSlide.level))if(K.integer(Z.openSlide.level)&&K.inRange(Z.openSlide.level,0,256))Q.openSlideLevel=Z.openSlide.level;else throw K.invalidParameterError("openSlide.level","integer between 0 and 256",Z.openSlide.level);else if(K.defined(Z.level))if(K.integer(Z.level)&&K.inRange(Z.level,0,256))Q.openSlideLevel=Z.level;else throw K.invalidParameterError("level","integer between 0 and 256",Z.level);if(K.object(Z.tiff)&&K.defined(Z.tiff.subifd))if(K.integer(Z.tiff.subifd)&&K.inRange(Z.tiff.subifd,-1,1e5))Q.tiffSubifd=Z.tiff.subifd;else throw K.invalidParameterError("tiff.subifd","integer between -1 and 100000",Z.tiff.subifd);else if(K.defined(Z.subifd))if(K.integer(Z.subifd)&&K.inRange(Z.subifd,-1,1e5))Q.tiffSubifd=Z.subifd;else throw K.invalidParameterError("subifd","integer between -1 and 100000",Z.subifd);if(K.object(Z.svg)){if(K.defined(Z.svg.stylesheet))if(K.string(Z.svg.stylesheet))Q.svgStylesheet=Z.svg.stylesheet;else throw K.invalidParameterError("svg.stylesheet","string",Z.svg.stylesheet);if(K.defined(Z.svg.highBitdepth))if(K.bool(Z.svg.highBitdepth))Q.svgHighBitdepth=Z.svg.highBitdepth;else throw K.invalidParameterError("svg.highBitdepth","boolean",Z.svg.highBitdepth)}if(K.object(Z.pdf)&&K.defined(Z.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(Z.pdf.background);else if(K.defined(Z.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(Z.pdfBackground);if(K.object(Z.jp2)&&K.defined(Z.jp2.oneshot))if(K.bool(Z.jp2.oneshot))Q.jp2Oneshot=Z.jp2.oneshot;else throw K.invalidParameterError("jp2.oneshot","boolean",Z.jp2.oneshot);if(K.defined(Z.create))if(K.object(Z.create)&&K.integer(Z.create.width)&&K.inRange(Z.create.width,1,1e8)&&K.integer(Z.create.height)&&K.inRange(Z.create.height,1,1e8)&&K.integer(Z.create.channels)){if(Q.createWidth=Z.create.width,Q.createHeight=Z.create.height,Q.createChannels=Z.create.channels,Q.createPageHeight=0,K.defined(Z.create.pageHeight))if(K.integer(Z.create.pageHeight)&&Z.create.pageHeight>0&&Z.create.pageHeight<=Z.create.height){if(Z.create.height%Z.create.pageHeight!==0)throw Error(`Expected create.height ${Z.create.height} to be a multiple of create.pageHeight ${Z.create.pageHeight}`);Q.createPageHeight=Z.create.pageHeight}else throw K.invalidParameterError("create.pageHeight","positive integer",Z.create.pageHeight);if(K.defined(Z.create.noise)){if(!K.object(Z.create.noise))throw Error("Expected noise to be an object");if(Z.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=Z.create.noise.type,!K.inRange(Z.create.channels,1,4))throw K.invalidParameterError("create.channels","number between 1 and 4",Z.create.channels);if(Q.createNoiseMean=128,K.defined(Z.create.noise.mean))if(K.number(Z.create.noise.mean)&&K.inRange(Z.create.noise.mean,0,1e4))Q.createNoiseMean=Z.create.noise.mean;else throw K.invalidParameterError("create.noise.mean","number between 0 and 10000",Z.create.noise.mean);if(Q.createNoiseSigma=30,K.defined(Z.create.noise.sigma))if(K.number(Z.create.noise.sigma)&&K.inRange(Z.create.noise.sigma,0,1e4))Q.createNoiseSigma=Z.create.noise.sigma;else throw K.invalidParameterError("create.noise.sigma","number between 0 and 10000",Z.create.noise.sigma)}else if(K.defined(Z.create.background)){if(!K.inRange(Z.create.channels,3,4))throw K.invalidParameterError("create.channels","number between 3 and 4",Z.create.channels);Q.createBackground=this._getBackgroundColourOption(Z.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(K.defined(Z.text))if(K.object(Z.text)&&K.string(Z.text.text)){if(Q.textValue=Z.text.text,K.defined(Z.text.height)&&K.defined(Z.text.dpi))throw Error("Expected only one of dpi or height");if(K.defined(Z.text.font))if(K.string(Z.text.font))Q.textFont=Z.text.font;else throw K.invalidParameterError("text.font","string",Z.text.font);if(K.defined(Z.text.fontfile))if(K.string(Z.text.fontfile))Q.textFontfile=Z.text.fontfile;else throw K.invalidParameterError("text.fontfile","string",Z.text.fontfile);if(K.defined(Z.text.width))if(K.integer(Z.text.width)&&K.inRange(Z.text.width,1,1e6))Q.textWidth=Z.text.width;else throw K.invalidParameterError("text.width","integer between 1 and 1000000",Z.text.width);if(K.defined(Z.text.height))if(K.integer(Z.text.height)&&K.inRange(Z.text.height,1,1e6))Q.textHeight=Z.text.height;else throw K.invalidParameterError("text.height","integer between 1 and 1000000",Z.text.height);if(K.defined(Z.text.align))if(K.string(Z.text.align)&&K.string(this.constructor.align[Z.text.align]))Q.textAlign=this.constructor.align[Z.text.align];else throw K.invalidParameterError("text.align","valid alignment",Z.text.align);if(K.defined(Z.text.justify))if(K.bool(Z.text.justify))Q.textJustify=Z.text.justify;else throw K.invalidParameterError("text.justify","boolean",Z.text.justify);if(K.defined(Z.text.dpi))if(K.integer(Z.text.dpi)&&K.inRange(Z.text.dpi,1,1e6))Q.textDpi=Z.text.dpi;else throw K.invalidParameterError("text.dpi","integer between 1 and 1000000",Z.text.dpi);if(K.defined(Z.text.rgba))if(K.bool(Z.text.rgba))Q.textRgba=Z.text.rgba;else throw K.invalidParameterError("text.rgba","bool",Z.text.rgba);if(K.defined(Z.text.spacing))if(K.integer(Z.text.spacing)&&K.inRange(Z.text.spacing,-1e6,1e6))Q.textSpacing=Z.text.spacing;else throw K.invalidParameterError("text.spacing","integer between -1000000 and 1000000",Z.text.spacing);if(K.defined(Z.text.wrap))if(K.string(Z.text.wrap)&&K.inArray(Z.text.wrap,["word","char","word-char","none"]))Q.textWrap=Z.text.wrap;else throw K.invalidParameterError("text.wrap","one of: word, char, word-char, none",Z.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(K.defined(Z.join))if(K.defined(this.options.join)){if(K.defined(Z.join.animated))if(K.bool(Z.join.animated))Q.joinAnimated=Z.join.animated;else throw K.invalidParameterError("join.animated","boolean",Z.join.animated);if(K.defined(Z.join.across))if(K.integer(Z.join.across)&&K.inRange(Z.join.across,1,1e6))Q.joinAcross=Z.join.across;else throw K.invalidParameterError("join.across","integer between 1 and 100000",Z.join.across);if(K.defined(Z.join.shim))if(K.integer(Z.join.shim)&&K.inRange(Z.join.shim,0,1e6))Q.joinShim=Z.join.shim;else throw K.invalidParameterError("join.shim","integer between 0 and 100000",Z.join.shim);if(K.defined(Z.join.background))Q.joinBackground=this._getBackgroundColourOption(Z.join.background);if(K.defined(Z.join.halign))if(K.string(Z.join.halign)&&K.string(this.constructor.align[Z.join.halign]))Q.joinHalign=this.constructor.align[Z.join.halign];else throw K.invalidParameterError("join.halign","valid alignment",Z.join.halign);if(K.defined(Z.join.valign))if(K.string(Z.join.valign)&&K.string(this.constructor.align[Z.join.valign]))Q.joinValign=this.constructor.align[Z.join.valign];else throw K.invalidParameterError("join.valign","valid alignment",Z.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(K.defined(Z))throw Error(`Invalid input options ${Z}`);return Q}function oj($,Z,X){if(Array.isArray(this.options.input.buffer))if(K.buffer($)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push($),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function sj(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function tj(){return Array.isArray(this.options.input.buffer)}function ej($){let Z=Error();if(K.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),_0.metadata(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)})});else _0.metadata(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),_0.metadata(this.options,(G,W)=>{if(G)Q(K.nativeError(G,Z));else X(W)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{_0.metadata(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})}function $O($){let Z=Error();if(K.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),_0.stats(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)})});else _0.stats(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),_0.stats(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})});else return new Promise((X,Q)=>{_0.stats(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})}var nj,rj,_U=($)=>{Object.assign($.prototype,{_inputOptionsFromObject:SU,_createInputDescriptor:aj,_write:oj,_flattenBufferIn:sj,_isStreamInput:tj,metadata:ej,stats:$O}),$.align=nj};var xU=t(()=>{R6();y9();/*!
295
+ */NO=IO.debuglog("sharp");Object.setPrototypeOf(Z4.prototype,xX.Duplex.prototype);Object.setPrototypeOf(Z4,xX.Duplex);Object.assign(Z4.prototype,{clone:wO});k1=Z4});function sK($){let Z=jO.filter((X)=>U.defined($[X])).map((X)=>[X,$[X]]);return Z.length?Object.fromEntries(Z):void 0}function OO($,Z,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(U.string($))Q.file=$;else if(U.buffer($)){if($.length===0)throw Error("Input Buffer is empty");Q.buffer=$}else if(U.arrayBuffer($)){if($.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from($,0,$.byteLength)}else if(U.typedArray($)){if($.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from($.buffer,$.byteOffset,$.byteLength)}else if(U.plainObject($)&&!U.defined(Z)){if(Z=$,sK(Z))Q.buffer=[]}else if(!U.defined($)&&!U.defined(Z)&&U.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray($))if($.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=$.map((J)=>this._createInputDescriptor(J));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${$}' of type ${typeof $}${U.defined(Z)?` when also providing options of type ${typeof Z}`:""}`);if(U.object(Z)){if(U.defined(Z.failOn))if(U.string(Z.failOn)&&U.inArray(Z.failOn,["none","truncated","error","warning"]))Q.failOn=Z.failOn;else throw U.invalidParameterError("failOn","one of: none, truncated, error, warning",Z.failOn);if(U.defined(Z.autoOrient))if(U.bool(Z.autoOrient))Q.autoOrient=Z.autoOrient;else throw U.invalidParameterError("autoOrient","boolean",Z.autoOrient);if(U.defined(Z.density))if(U.number(Z.density)&&U.inRange(Z.density,1,1e5))Q.density=Z.density;else throw U.invalidParameterError("density","number between 1 and 100000",Z.density);if(U.defined(Z.ignoreIcc))if(U.bool(Z.ignoreIcc))Q.ignoreIcc=Z.ignoreIcc;else throw U.invalidParameterError("ignoreIcc","boolean",Z.ignoreIcc);if(U.defined(Z.limitInputPixels))if(U.bool(Z.limitInputPixels))Q.limitInputPixels=Z.limitInputPixels?268402689:0;else if(U.integer(Z.limitInputPixels)&&U.inRange(Z.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=Z.limitInputPixels;else throw U.invalidParameterError("limitInputPixels","positive integer",Z.limitInputPixels);if(U.defined(Z.limitInputChannels))if(U.bool(Z.limitInputChannels))Q.limitInputChannels=Z.limitInputChannels?5:0;else if(U.integer(Z.limitInputChannels)&&U.inRange(Z.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=Z.limitInputChannels;else throw U.invalidParameterError("limitInputChannels","positive integer",Z.limitInputChannels);if(U.defined(Z.unlimited))if(U.bool(Z.unlimited))Q.unlimited=Z.unlimited;else throw U.invalidParameterError("unlimited","boolean",Z.unlimited);if(U.defined(Z.sequentialRead))if(U.bool(Z.sequentialRead))Q.sequentialRead=Z.sequentialRead;else throw U.invalidParameterError("sequentialRead","boolean",Z.sequentialRead);if(U.defined(Z.raw)){if(U.object(Z.raw)&&U.integer(Z.raw.width)&&U.inRange(Z.raw.width,1,1e8)&&U.integer(Z.raw.height)&&U.inRange(Z.raw.height,1,1e8)&&U.integer(Z.raw.channels)&&U.inRange(Z.raw.channels,1,4))switch(Q.rawWidth=Z.raw.width,Q.rawHeight=Z.raw.height,Q.rawChannels=Z.raw.channels,$.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,U.defined(Z.raw.premultiplied))if(U.bool(Z.raw.premultiplied))Q.rawPremultiplied=Z.raw.premultiplied;else throw U.invalidParameterError("raw.premultiplied","boolean",Z.raw.premultiplied);if(Q.rawPageHeight=0,U.defined(Z.raw.pageHeight))if(U.integer(Z.raw.pageHeight)&&Z.raw.pageHeight>0&&Z.raw.pageHeight<=Z.raw.height){if(Z.raw.height%Z.raw.pageHeight!==0)throw Error(`Expected raw.height ${Z.raw.height} to be a multiple of raw.pageHeight ${Z.raw.pageHeight}`);Q.rawPageHeight=Z.raw.pageHeight}else throw U.invalidParameterError("raw.pageHeight","positive integer",Z.raw.pageHeight)}if(U.defined(Z.animated))if(U.bool(Z.animated))Q.pages=Z.animated?-1:1;else throw U.invalidParameterError("animated","boolean",Z.animated);if(U.defined(Z.pages))if(U.integer(Z.pages)&&U.inRange(Z.pages,-1,1e5))Q.pages=Z.pages;else throw U.invalidParameterError("pages","integer between -1 and 100000",Z.pages);if(U.defined(Z.page))if(U.integer(Z.page)&&U.inRange(Z.page,0,1e5))Q.page=Z.page;else throw U.invalidParameterError("page","integer between 0 and 100000",Z.page);if(U.object(Z.openSlide)&&U.defined(Z.openSlide.level))if(U.integer(Z.openSlide.level)&&U.inRange(Z.openSlide.level,0,256))Q.openSlideLevel=Z.openSlide.level;else throw U.invalidParameterError("openSlide.level","integer between 0 and 256",Z.openSlide.level);else if(U.defined(Z.level))if(U.integer(Z.level)&&U.inRange(Z.level,0,256))Q.openSlideLevel=Z.level;else throw U.invalidParameterError("level","integer between 0 and 256",Z.level);if(U.object(Z.tiff)&&U.defined(Z.tiff.subifd))if(U.integer(Z.tiff.subifd)&&U.inRange(Z.tiff.subifd,-1,1e5))Q.tiffSubifd=Z.tiff.subifd;else throw U.invalidParameterError("tiff.subifd","integer between -1 and 100000",Z.tiff.subifd);else if(U.defined(Z.subifd))if(U.integer(Z.subifd)&&U.inRange(Z.subifd,-1,1e5))Q.tiffSubifd=Z.subifd;else throw U.invalidParameterError("subifd","integer between -1 and 100000",Z.subifd);if(U.object(Z.svg)){if(U.defined(Z.svg.stylesheet))if(U.string(Z.svg.stylesheet))Q.svgStylesheet=Z.svg.stylesheet;else throw U.invalidParameterError("svg.stylesheet","string",Z.svg.stylesheet);if(U.defined(Z.svg.highBitdepth))if(U.bool(Z.svg.highBitdepth))Q.svgHighBitdepth=Z.svg.highBitdepth;else throw U.invalidParameterError("svg.highBitdepth","boolean",Z.svg.highBitdepth)}if(U.object(Z.pdf)&&U.defined(Z.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(Z.pdf.background);else if(U.defined(Z.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(Z.pdfBackground);if(U.object(Z.jp2)&&U.defined(Z.jp2.oneshot))if(U.bool(Z.jp2.oneshot))Q.jp2Oneshot=Z.jp2.oneshot;else throw U.invalidParameterError("jp2.oneshot","boolean",Z.jp2.oneshot);if(U.defined(Z.create))if(U.object(Z.create)&&U.integer(Z.create.width)&&U.inRange(Z.create.width,1,1e8)&&U.integer(Z.create.height)&&U.inRange(Z.create.height,1,1e8)&&U.integer(Z.create.channels)){if(Q.createWidth=Z.create.width,Q.createHeight=Z.create.height,Q.createChannels=Z.create.channels,Q.createPageHeight=0,U.defined(Z.create.pageHeight))if(U.integer(Z.create.pageHeight)&&Z.create.pageHeight>0&&Z.create.pageHeight<=Z.create.height){if(Z.create.height%Z.create.pageHeight!==0)throw Error(`Expected create.height ${Z.create.height} to be a multiple of create.pageHeight ${Z.create.pageHeight}`);Q.createPageHeight=Z.create.pageHeight}else throw U.invalidParameterError("create.pageHeight","positive integer",Z.create.pageHeight);if(U.defined(Z.create.noise)){if(!U.object(Z.create.noise))throw Error("Expected noise to be an object");if(Z.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=Z.create.noise.type,!U.inRange(Z.create.channels,1,4))throw U.invalidParameterError("create.channels","number between 1 and 4",Z.create.channels);if(Q.createNoiseMean=128,U.defined(Z.create.noise.mean))if(U.number(Z.create.noise.mean)&&U.inRange(Z.create.noise.mean,0,1e4))Q.createNoiseMean=Z.create.noise.mean;else throw U.invalidParameterError("create.noise.mean","number between 0 and 10000",Z.create.noise.mean);if(Q.createNoiseSigma=30,U.defined(Z.create.noise.sigma))if(U.number(Z.create.noise.sigma)&&U.inRange(Z.create.noise.sigma,0,1e4))Q.createNoiseSigma=Z.create.noise.sigma;else throw U.invalidParameterError("create.noise.sigma","number between 0 and 10000",Z.create.noise.sigma)}else if(U.defined(Z.create.background)){if(!U.inRange(Z.create.channels,3,4))throw U.invalidParameterError("create.channels","number between 3 and 4",Z.create.channels);Q.createBackground=this._getBackgroundColourOption(Z.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(U.defined(Z.text))if(U.object(Z.text)&&U.string(Z.text.text)){if(Q.textValue=Z.text.text,U.defined(Z.text.height)&&U.defined(Z.text.dpi))throw Error("Expected only one of dpi or height");if(U.defined(Z.text.font))if(U.string(Z.text.font))Q.textFont=Z.text.font;else throw U.invalidParameterError("text.font","string",Z.text.font);if(U.defined(Z.text.fontfile))if(U.string(Z.text.fontfile))Q.textFontfile=Z.text.fontfile;else throw U.invalidParameterError("text.fontfile","string",Z.text.fontfile);if(U.defined(Z.text.width))if(U.integer(Z.text.width)&&U.inRange(Z.text.width,1,1e6))Q.textWidth=Z.text.width;else throw U.invalidParameterError("text.width","integer between 1 and 1000000",Z.text.width);if(U.defined(Z.text.height))if(U.integer(Z.text.height)&&U.inRange(Z.text.height,1,1e6))Q.textHeight=Z.text.height;else throw U.invalidParameterError("text.height","integer between 1 and 1000000",Z.text.height);if(U.defined(Z.text.align))if(U.string(Z.text.align)&&U.string(this.constructor.align[Z.text.align]))Q.textAlign=this.constructor.align[Z.text.align];else throw U.invalidParameterError("text.align","valid alignment",Z.text.align);if(U.defined(Z.text.justify))if(U.bool(Z.text.justify))Q.textJustify=Z.text.justify;else throw U.invalidParameterError("text.justify","boolean",Z.text.justify);if(U.defined(Z.text.dpi))if(U.integer(Z.text.dpi)&&U.inRange(Z.text.dpi,1,1e6))Q.textDpi=Z.text.dpi;else throw U.invalidParameterError("text.dpi","integer between 1 and 1000000",Z.text.dpi);if(U.defined(Z.text.rgba))if(U.bool(Z.text.rgba))Q.textRgba=Z.text.rgba;else throw U.invalidParameterError("text.rgba","bool",Z.text.rgba);if(U.defined(Z.text.spacing))if(U.integer(Z.text.spacing)&&U.inRange(Z.text.spacing,-1e6,1e6))Q.textSpacing=Z.text.spacing;else throw U.invalidParameterError("text.spacing","integer between -1000000 and 1000000",Z.text.spacing);if(U.defined(Z.text.wrap))if(U.string(Z.text.wrap)&&U.inArray(Z.text.wrap,["word","char","word-char","none"]))Q.textWrap=Z.text.wrap;else throw U.invalidParameterError("text.wrap","one of: word, char, word-char, none",Z.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(U.defined(Z.join))if(U.defined(this.options.join)){if(U.defined(Z.join.animated))if(U.bool(Z.join.animated))Q.joinAnimated=Z.join.animated;else throw U.invalidParameterError("join.animated","boolean",Z.join.animated);if(U.defined(Z.join.across))if(U.integer(Z.join.across)&&U.inRange(Z.join.across,1,1e6))Q.joinAcross=Z.join.across;else throw U.invalidParameterError("join.across","integer between 1 and 100000",Z.join.across);if(U.defined(Z.join.shim))if(U.integer(Z.join.shim)&&U.inRange(Z.join.shim,0,1e6))Q.joinShim=Z.join.shim;else throw U.invalidParameterError("join.shim","integer between 0 and 100000",Z.join.shim);if(U.defined(Z.join.background))Q.joinBackground=this._getBackgroundColourOption(Z.join.background);if(U.defined(Z.join.halign))if(U.string(Z.join.halign)&&U.string(this.constructor.align[Z.join.halign]))Q.joinHalign=this.constructor.align[Z.join.halign];else throw U.invalidParameterError("join.halign","valid alignment",Z.join.halign);if(U.defined(Z.join.valign))if(U.string(Z.join.valign)&&U.string(this.constructor.align[Z.join.valign]))Q.joinValign=this.constructor.align[Z.join.valign];else throw U.invalidParameterError("join.valign","valid alignment",Z.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(U.defined(Z))throw Error(`Invalid input options ${Z}`);return Q}function EO($,Z,X){if(Array.isArray(this.options.input.buffer))if(U.buffer($)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push($),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function RO(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function PO(){return Array.isArray(this.options.input.buffer)}function CO($){let Z=Error();if(U.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.metadata(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)})});else x0.metadata(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),x0.metadata(this.options,(G,W)=>{if(G)Q(U.nativeError(G,Z));else X(W)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{x0.metadata(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})}function SO($){let Z=Error();if(U.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.stats(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)})});else x0.stats(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),x0.stats(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})});else return new Promise((X,Q)=>{x0.stats(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})}var TO,jO,tK=($)=>{Object.assign($.prototype,{_inputOptionsFromObject:sK,_createInputDescriptor:OO,_write:EO,_flattenBufferIn:RO,_isStreamInput:PO,metadata:CO,stats:SO}),$.align=TO};var eK=s(()=>{C1();d9();/*!
298
296
  Copyright 2013 Lovell Fuller and others.
299
297
  SPDX-License-Identifier: Apache-2.0
300
- */nj={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},rj=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function wX($){return $.angle%360!==0||$.rotationAngle!==0}function j8($){return $.width!==-1||$.height!==-1}function QO($,Z,X){if(j8(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(K.defined($))if(K.object($)&&!K.defined(X))X=$;else if(K.integer($)&&$>0)this.options.width=$;else throw K.invalidParameterError("width","positive integer",$);else this.options.width=-1;if(K.defined(Z))if(K.integer(Z)&&Z>0)this.options.height=Z;else throw K.invalidParameterError("height","positive integer",Z);else this.options.height=-1;if(K.object(X)){if(K.defined(X.width))if(K.integer(X.width)&&X.width>0)this.options.width=X.width;else throw K.invalidParameterError("width","positive integer",X.width);if(K.defined(X.height))if(K.integer(X.height)&&X.height>0)this.options.height=X.height;else throw K.invalidParameterError("height","positive integer",X.height);if(K.defined(X.fit)){let Q=XO[X.fit];if(K.string(Q))this.options.canvas=Q;else throw K.invalidParameterError("fit","valid fit",X.fit)}if(K.defined(X.position)){let Q=K.integer(X.position)?X.position:vU[X.position]||yU[X.position]||kU[X.position];if(K.integer(Q)&&(K.inRange(Q,0,8)||K.inRange(Q,16,17)))this.options.position=Q;else throw K.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),K.defined(X.kernel))if(K.string(DX[X.kernel]))this.options.kernel=DX[X.kernel];else throw K.invalidParameterError("kernel","valid kernel name",X.kernel);if(K.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(K.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(K.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(wX(this.options)&&j8(this.options))this.options.rotateBefore=!0;return this}function JO($){if(K.integer($))if(K.inRange($,1,1e4))this.options.extendTop=$,this.options.extendBottom=$,this.options.extendLeft=$,this.options.extendRight=$;else throw K.invalidParameterError("extend","integer between 1 and 10000",$);else if(K.object($)){if(K.defined($.top))if(K.integer($.top)&&K.inRange($.top,0,1e4))this.options.extendTop=$.top;else throw K.invalidParameterError("top","integer between 0 and 10000",$.top);if(K.defined($.bottom))if(K.integer($.bottom)&&K.inRange($.bottom,0,1e4))this.options.extendBottom=$.bottom;else throw K.invalidParameterError("bottom","integer between 0 and 10000",$.bottom);if(K.defined($.left))if(K.integer($.left)&&K.inRange($.left,0,1e4))this.options.extendLeft=$.left;else throw K.invalidParameterError("left","integer between 0 and 10000",$.left);if(K.defined($.right))if(K.integer($.right)&&K.inRange($.right,0,1e4))this.options.extendRight=$.right;else throw K.invalidParameterError("right","integer between 0 and 10000",$.right);if(this._setBackgroundColourOption("extendBackground",$.background),K.defined($.extendWith))if(K.string(bU[$.extendWith]))this.options.extendWith=bU[$.extendWith];else throw K.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",$.extendWith)}else throw K.invalidParameterError("extend","integer or object",$);return this}function GO($){let Z=j8(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${Z}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let Q=$[X];if(K.integer(Q)&&K.inRange(Q,0,1e8))this.options[X+(X==="left"||X==="top"?"Offset":"")+Z]=Q;else throw K.invalidParameterError(X,"integer between 0 and 100000000",Q)},this),wX(this.options)&&!j8(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function WO($){if(this.options.trimThreshold=10,K.defined($))if(K.object($)){if(K.defined($.background))this._setBackgroundColourOption("trimBackground",$.background);if(K.defined($.threshold))if(K.number($.threshold)&&$.threshold>=0)this.options.trimThreshold=$.threshold;else throw K.invalidParameterError("threshold","positive number",$.threshold);if(K.defined($.lineArt))this._setBooleanOption("trimLineArt",$.lineArt);if(K.defined($.margin))if(K.integer($.margin)&&K.inRange($.margin,0,1e7))this.options.trimMargin=$.margin;else throw K.invalidParameterError("margin","integer between 0 and 10000000",$.margin)}else throw K.invalidParameterError("trim","object",$);if(wX(this.options))this.options.rotateBefore=!0;return this}var kU,yU,bU,vU,DX,ZO,XO,gU=($)=>{Object.assign($.prototype,{resize:QO,extend:JO,extract:GO,trim:WO}),$.gravity=kU,$.strategy=vU,$.kernel=DX,$.fit=ZO,$.position=yU};var fU=t(()=>{R6();/*!
298
+ */TO={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},jO=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function yX($){return $.angle%360!==0||$.rotationAngle!==0}function g5($){return $.width!==-1||$.height!==-1}function xO($,Z,X){if(g5(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(U.defined($))if(U.object($)&&!U.defined(X))X=$;else if(U.integer($)&&$>0)this.options.width=$;else throw U.invalidParameterError("width","positive integer",$);else this.options.width=-1;if(U.defined(Z))if(U.integer(Z)&&Z>0)this.options.height=Z;else throw U.invalidParameterError("height","positive integer",Z);else this.options.height=-1;if(U.object(X)){if(U.defined(X.width))if(U.integer(X.width)&&X.width>0)this.options.width=X.width;else throw U.invalidParameterError("width","positive integer",X.width);if(U.defined(X.height))if(U.integer(X.height)&&X.height>0)this.options.height=X.height;else throw U.invalidParameterError("height","positive integer",X.height);if(U.defined(X.fit)){let Q=bO[X.fit];if(U.string(Q))this.options.canvas=Q;else throw U.invalidParameterError("fit","valid fit",X.fit)}if(U.defined(X.position)){let Q=U.integer(X.position)?X.position:QU[X.position]||XU[X.position]||ZU[X.position];if(U.integer(Q)&&(U.inRange(Q,0,8)||U.inRange(Q,16,17)))this.options.position=Q;else throw U.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),U.defined(X.kernel))if(U.string(kX[X.kernel]))this.options.kernel=kX[X.kernel];else throw U.invalidParameterError("kernel","valid kernel name",X.kernel);if(U.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(U.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(U.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(yX(this.options)&&g5(this.options))this.options.rotateBefore=!0;return this}function kO($){if(U.integer($))if(U.inRange($,1,1e4))this.options.extendTop=$,this.options.extendBottom=$,this.options.extendLeft=$,this.options.extendRight=$;else throw U.invalidParameterError("extend","integer between 1 and 10000",$);else if(U.object($)){if(U.defined($.top))if(U.integer($.top)&&U.inRange($.top,0,1e4))this.options.extendTop=$.top;else throw U.invalidParameterError("top","integer between 0 and 10000",$.top);if(U.defined($.bottom))if(U.integer($.bottom)&&U.inRange($.bottom,0,1e4))this.options.extendBottom=$.bottom;else throw U.invalidParameterError("bottom","integer between 0 and 10000",$.bottom);if(U.defined($.left))if(U.integer($.left)&&U.inRange($.left,0,1e4))this.options.extendLeft=$.left;else throw U.invalidParameterError("left","integer between 0 and 10000",$.left);if(U.defined($.right))if(U.integer($.right)&&U.inRange($.right,0,1e4))this.options.extendRight=$.right;else throw U.invalidParameterError("right","integer between 0 and 10000",$.right);if(this._setBackgroundColourOption("extendBackground",$.background),U.defined($.extendWith))if(U.string($U[$.extendWith]))this.options.extendWith=$U[$.extendWith];else throw U.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",$.extendWith)}else throw U.invalidParameterError("extend","integer or object",$);return this}function yO($){let Z=g5(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${Z}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let Q=$[X];if(U.integer(Q)&&U.inRange(Q,0,1e8))this.options[X+(X==="left"||X==="top"?"Offset":"")+Z]=Q;else throw U.invalidParameterError(X,"integer between 0 and 100000000",Q)},this),yX(this.options)&&!g5(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function vO($){if(this.options.trimThreshold=10,U.defined($))if(U.object($)){if(U.defined($.background))this._setBackgroundColourOption("trimBackground",$.background);if(U.defined($.threshold))if(U.number($.threshold)&&$.threshold>=0)this.options.trimThreshold=$.threshold;else throw U.invalidParameterError("threshold","positive number",$.threshold);if(U.defined($.lineArt))this._setBooleanOption("trimLineArt",$.lineArt);if(U.defined($.margin))if(U.integer($.margin)&&U.inRange($.margin,0,1e7))this.options.trimMargin=$.margin;else throw U.invalidParameterError("margin","integer between 0 and 10000000",$.margin)}else throw U.invalidParameterError("trim","object",$);if(yX(this.options))this.options.rotateBefore=!0;return this}var ZU,XU,$U,QU,kX,_O,bO,JU=($)=>{Object.assign($.prototype,{resize:xO,extend:kO,extract:yO,trim:vO}),$.gravity=ZU,$.strategy=QU,$.kernel=kX,$.fit=_O,$.position=XU};var GU=s(()=>{C1();/*!
301
299
  Copyright 2013 Lovell Fuller and others.
302
300
  SPDX-License-Identifier: Apache-2.0
303
- */kU={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},yU={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},bU={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},vU={entropy:16,attention:17},DX={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},ZO={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},XO={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function YO($){if(!Array.isArray($))throw K.invalidParameterError("images to composite","array",$);return this.options.composite=$.map((Z)=>{if(!K.object(Z))throw K.invalidParameterError("image to composite","object",Z);let X=this._inputOptionsFromObject(Z),Q={input:this._createInputDescriptor(Z.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(K.defined(Z.blend))if(K.string(TX[Z.blend]))Q.blend=TX[Z.blend];else throw K.invalidParameterError("blend","valid blend name",Z.blend);if(K.defined(Z.tile))if(K.bool(Z.tile))Q.tile=Z.tile;else throw K.invalidParameterError("tile","boolean",Z.tile);if(K.defined(Z.left))if(K.integer(Z.left))Q.left=Z.left;else throw K.invalidParameterError("left","integer",Z.left);if(K.defined(Z.top))if(K.integer(Z.top))Q.top=Z.top;else throw K.invalidParameterError("top","integer",Z.top);if(K.defined(Z.top)!==K.defined(Z.left))throw Error("Expected both left and top to be set");else Q.hasOffset=K.integer(Z.top)&&K.integer(Z.left);if(K.defined(Z.gravity))if(K.integer(Z.gravity)&&K.inRange(Z.gravity,0,8))Q.gravity=Z.gravity;else if(K.string(Z.gravity)&&K.integer(this.constructor.gravity[Z.gravity]))Q.gravity=this.constructor.gravity[Z.gravity];else throw K.invalidParameterError("gravity","valid gravity",Z.gravity);if(K.defined(Z.premultiplied))if(K.bool(Z.premultiplied))Q.premultiplied=Z.premultiplied;else throw K.invalidParameterError("premultiplied","boolean",Z.premultiplied);return Q}),this}var TX,hU=($)=>{$.prototype.composite=YO,$.blend=TX};var uU=t(()=>{R6();/*!
301
+ */ZU={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},XU={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},$U={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},QU={entropy:16,attention:17},kX={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},_O={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},bO={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function gO($){if(!Array.isArray($))throw U.invalidParameterError("images to composite","array",$);return this.options.composite=$.map((Z)=>{if(!U.object(Z))throw U.invalidParameterError("image to composite","object",Z);let X=this._inputOptionsFromObject(Z),Q={input:this._createInputDescriptor(Z.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(U.defined(Z.blend))if(U.string(vX[Z.blend]))Q.blend=vX[Z.blend];else throw U.invalidParameterError("blend","valid blend name",Z.blend);if(U.defined(Z.tile))if(U.bool(Z.tile))Q.tile=Z.tile;else throw U.invalidParameterError("tile","boolean",Z.tile);if(U.defined(Z.left))if(U.integer(Z.left))Q.left=Z.left;else throw U.invalidParameterError("left","integer",Z.left);if(U.defined(Z.top))if(U.integer(Z.top))Q.top=Z.top;else throw U.invalidParameterError("top","integer",Z.top);if(U.defined(Z.top)!==U.defined(Z.left))throw Error("Expected both left and top to be set");else Q.hasOffset=U.integer(Z.top)&&U.integer(Z.left);if(U.defined(Z.gravity))if(U.integer(Z.gravity)&&U.inRange(Z.gravity,0,8))Q.gravity=Z.gravity;else if(U.string(Z.gravity)&&U.integer(this.constructor.gravity[Z.gravity]))Q.gravity=this.constructor.gravity[Z.gravity];else throw U.invalidParameterError("gravity","valid gravity",Z.gravity);if(U.defined(Z.premultiplied))if(U.bool(Z.premultiplied))Q.premultiplied=Z.premultiplied;else throw U.invalidParameterError("premultiplied","boolean",Z.premultiplied);return Q}),this}var vX,WU=($)=>{$.prototype.composite=gO,$.blend=vX};var YU=s(()=>{C1();/*!
304
302
  Copyright 2013 Lovell Fuller and others.
305
303
  SPDX-License-Identifier: Apache-2.0
306
- */TX={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function zO($,Z){if(!K.defined($))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(K.integer($)&&!($%90))this.options.angle=$;else if(K.number($)){if(this.options.rotationAngle=$,K.object(Z)&&Z.background)this._setBackgroundColourOption("rotationBackground",Z.background)}else throw K.invalidParameterError("angle","numeric",$);return this}function qO(){return this.options.input.autoOrient=!0,this}function UO($){return this.options.flip=K.bool($)?$:!0,this}function KO($){return this.options.flop=K.bool($)?$:!0,this}function HO($,Z){let Q=Array.isArray($)&&($.length===4&&$.every(K.number)||$.length===2&&$.every((J)=>Array.isArray(J)&&J.length===2))?$.flat():[];if(Q.length===4&&Q.every(K.number))this.options.affineMatrix=Q;else throw K.invalidParameterError("matrix","1x4 or 2x2 array",$);if(K.defined(Z))if(K.object(Z)){if(this._setBackgroundColourOption("affineBackground",Z.background),K.defined(Z.idx))if(K.number(Z.idx))this.options.affineIdx=Z.idx;else throw K.invalidParameterError("options.idx","number",Z.idx);if(K.defined(Z.idy))if(K.number(Z.idy))this.options.affineIdy=Z.idy;else throw K.invalidParameterError("options.idy","number",Z.idy);if(K.defined(Z.odx))if(K.number(Z.odx))this.options.affineOdx=Z.odx;else throw K.invalidParameterError("options.odx","number",Z.odx);if(K.defined(Z.ody))if(K.number(Z.ody))this.options.affineOdy=Z.ody;else throw K.invalidParameterError("options.ody","number",Z.ody);if(K.defined(Z.interpolator))if(K.inArray(Z.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=Z.interpolator;else throw K.invalidParameterError("options.interpolator","valid interpolator name",Z.interpolator)}else throw K.invalidParameterError("options","object",Z);return this}function VO($){if(K.plainObject($)){if(K.number($.sigma)&&K.inRange($.sigma,0.000001,10))this.options.sharpenSigma=$.sigma;else throw K.invalidParameterError("options.sigma","number between 0.000001 and 10",$.sigma);if(K.defined($.m1))if(K.number($.m1)&&K.inRange($.m1,0,1e6))this.options.sharpenM1=$.m1;else throw K.invalidParameterError("options.m1","number between 0 and 1000000",$.m1);if(K.defined($.m2))if(K.number($.m2)&&K.inRange($.m2,0,1e6))this.options.sharpenM2=$.m2;else throw K.invalidParameterError("options.m2","number between 0 and 1000000",$.m2);if(K.defined($.x1))if(K.number($.x1)&&K.inRange($.x1,0,1e6))this.options.sharpenX1=$.x1;else throw K.invalidParameterError("options.x1","number between 0 and 1000000",$.x1);if(K.defined($.y2))if(K.number($.y2)&&K.inRange($.y2,0,1e6))this.options.sharpenY2=$.y2;else throw K.invalidParameterError("options.y2","number between 0 and 1000000",$.y2);if(K.defined($.y3))if(K.number($.y3)&&K.inRange($.y3,0,1e6))this.options.sharpenY3=$.y3;else throw K.invalidParameterError("options.y3","number between 0 and 1000000",$.y3)}else this.options.sharpenSigma=-1;return this}function BO($){if(!K.defined($))this.options.medianSize=3;else if(K.integer($)&&K.inRange($,1,1000))this.options.medianSize=$;else throw K.invalidParameterError("size","integer between 1 and 1000",$);return this}function FO($){let Z;if(K.number($))Z=$;else if(K.plainObject($)){if(!K.number($.sigma))throw K.invalidParameterError("options.sigma","number between 0.3 and 1000",Z);if(Z=$.sigma,"precision"in $)if(K.string(mU[$.precision]))this.options.precision=mU[$.precision];else throw K.invalidParameterError("precision","one of: integer, float, approximate",$.precision);if("minAmplitude"in $)if(K.number($.minAmplitude)&&K.inRange($.minAmplitude,0.001,1))this.options.minAmpl=$.minAmplitude;else throw K.invalidParameterError("minAmplitude","number between 0.001 and 1",$.minAmplitude)}if(!K.defined($))this.options.blurSigma=-1;else if(K.bool($))this.options.blurSigma=$?-1:0;else if(K.number(Z)&&K.inRange(Z,0.3,1000))this.options.blurSigma=Z;else throw K.invalidParameterError("sigma","number between 0.3 and 1000",Z);return this}function LO($){if(!K.defined($))this.options.dilateWidth=1;else if(K.integer($)&&K.inRange($,1,65536))this.options.dilateWidth=$;else throw K.invalidParameterError("width","integer between 1 and 65536",$);return this}function MO($){if(!K.defined($))this.options.erodeWidth=1;else if(K.integer($)&&K.inRange($,1,65536))this.options.erodeWidth=$;else throw K.invalidParameterError("width","integer between 1 and 65536",$);return this}function AO($){if(this.options.flatten=K.bool($)?$:!0,K.object($))this._setBackgroundColourOption("flattenBackground",$.background);return this}function IO(){return this.options.unflatten=!0,this}function NO($,Z){if(!K.defined($))this.options.gamma=2.2;else if(K.number($)&&K.inRange($,1,3))this.options.gamma=$;else throw K.invalidParameterError("gamma","number between 1.0 and 3.0",$);if(!K.defined(Z))this.options.gammaOut=this.options.gamma;else if(K.number(Z)&&K.inRange(Z,1,3))this.options.gammaOut=Z;else throw K.invalidParameterError("gammaOut","number between 1.0 and 3.0",Z);return this}function DO($){if(this.options.negate=K.bool($)?$:!0,K.plainObject($)&&"alpha"in $)if(!K.bool($.alpha))throw K.invalidParameterError("alpha","should be boolean value",$.alpha);else this.options.negateAlpha=$.alpha;return this}function wO($){if(K.plainObject($)){if(K.defined($.lower))if(K.number($.lower)&&K.inRange($.lower,0,99))this.options.normaliseLower=$.lower;else throw K.invalidParameterError("lower","number between 0 and 99",$.lower);if(K.defined($.upper))if(K.number($.upper)&&K.inRange($.upper,1,100))this.options.normaliseUpper=$.upper;else throw K.invalidParameterError("upper","number between 1 and 100",$.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw K.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function TO($){return this.normalise($)}function jO($){if(K.plainObject($)){if(K.integer($.width)&&K.inRange($.width,1,65536))this.options.claheWidth=$.width;else throw K.invalidParameterError("width","integer between 1 and 65536",$.width);if(K.integer($.height)&&K.inRange($.height,1,65536))this.options.claheHeight=$.height;else throw K.invalidParameterError("height","integer between 1 and 65536",$.height);if(K.defined($.maxSlope))if(K.integer($.maxSlope)&&K.inRange($.maxSlope,0,100))this.options.claheMaxSlope=$.maxSlope;else throw K.invalidParameterError("maxSlope","integer between 0 and 100",$.maxSlope)}else throw K.invalidParameterError("options","plain object",$);return this}function OO($){if(!K.object($)||!Array.isArray($.kernel)||!K.integer($.width)||!K.integer($.height)||!K.inRange($.width,3,1001)||!K.inRange($.height,3,1001)||$.height*$.width!==$.kernel.length||!$.kernel.every(K.number))throw Error("Invalid convolution kernel");if(!K.integer($.scale))$.scale=$.kernel.reduce((Z,X)=>Z+X,0);if($.scale<1)$.scale=1;if(!K.integer($.offset))$.offset=0;return this.options.convKernel=$,this}function EO($,Z){if(!K.defined($))this.options.threshold=128;else if(K.bool($))this.options.threshold=$?128:0;else if(K.integer($)&&K.inRange($,0,255))this.options.threshold=$;else throw K.invalidParameterError("threshold","integer between 0 and 255",$);if(!K.object(Z)||Z.greyscale===!0||Z.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function RO($,Z,X){if(this.options.boolean=this._createInputDescriptor($,X),K.string(Z)&&K.inArray(Z,["and","or","eor"]))this.options.booleanOp=Z;else throw K.invalidParameterError("operator","one of: and, or, eor",Z);return this}function PO($,Z){if(!K.defined($)&&K.number(Z))$=1;else if(K.number($)&&!K.defined(Z))Z=0;if(!K.defined($))this.options.linearA=[];else if(K.number($))this.options.linearA=[$];else if(Array.isArray($)&&$.length&&$.every(K.number))this.options.linearA=$;else throw K.invalidParameterError("a","number or array of numbers",$);if(!K.defined(Z))this.options.linearB=[];else if(K.number(Z))this.options.linearB=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(K.number))this.options.linearB=Z;else throw K.invalidParameterError("b","number or array of numbers",Z);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function CO($){if(!Array.isArray($))throw K.invalidParameterError("inputMatrix","array",$);let Z=$.length;if(Z!==3&&Z!==4)throw K.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z);if(!$.every((Q)=>Array.isArray(Q)&&Q.length===Z))throw K.invalidParameterError("inputMatrix",`array of ${Z} arrays of length ${Z}`,$);let X=$.flat();if(!X.every(K.number))throw K.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function SO($){if(!K.plainObject($))throw K.invalidParameterError("options","plain object",$);if("brightness"in $)if(K.number($.brightness)&&$.brightness>=0)this.options.brightness=$.brightness;else throw K.invalidParameterError("brightness","number above zero",$.brightness);if("saturation"in $)if(K.number($.saturation)&&$.saturation>=0)this.options.saturation=$.saturation;else throw K.invalidParameterError("saturation","number above zero",$.saturation);if("hue"in $)if(K.integer($.hue))this.options.hue=$.hue%360;else throw K.invalidParameterError("hue","number",$.hue);if("lightness"in $)if(K.number($.lightness))this.options.lightness=$.lightness;else throw K.invalidParameterError("lightness","number",$.lightness);return this}var mU,dU=($)=>{Object.assign($.prototype,{autoOrient:qO,rotate:zO,flip:UO,flop:KO,affine:HO,sharpen:VO,erode:MO,dilate:LO,median:BO,blur:FO,flatten:AO,unflatten:IO,gamma:NO,negate:DO,normalise:wO,normalize:TO,clahe:jO,convolve:OO,threshold:EO,boolean:RO,linear:PO,recomb:CO,modulate:SO})};var lU=t(()=>{R6();/*!
304
+ */vX={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function fO($,Z){if(!U.defined($))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(U.integer($)&&!($%90))this.options.angle=$;else if(U.number($)){if(this.options.rotationAngle=$,U.object(Z)&&Z.background)this._setBackgroundColourOption("rotationBackground",Z.background)}else throw U.invalidParameterError("angle","numeric",$);return this}function hO(){return this.options.input.autoOrient=!0,this}function uO($){return this.options.flip=U.bool($)?$:!0,this}function mO($){return this.options.flop=U.bool($)?$:!0,this}function dO($,Z){let Q=Array.isArray($)&&($.length===4&&$.every(U.number)||$.length===2&&$.every((J)=>Array.isArray(J)&&J.length===2))?$.flat():[];if(Q.length===4&&Q.every(U.number))this.options.affineMatrix=Q;else throw U.invalidParameterError("matrix","1x4 or 2x2 array",$);if(U.defined(Z))if(U.object(Z)){if(this._setBackgroundColourOption("affineBackground",Z.background),U.defined(Z.idx))if(U.number(Z.idx))this.options.affineIdx=Z.idx;else throw U.invalidParameterError("options.idx","number",Z.idx);if(U.defined(Z.idy))if(U.number(Z.idy))this.options.affineIdy=Z.idy;else throw U.invalidParameterError("options.idy","number",Z.idy);if(U.defined(Z.odx))if(U.number(Z.odx))this.options.affineOdx=Z.odx;else throw U.invalidParameterError("options.odx","number",Z.odx);if(U.defined(Z.ody))if(U.number(Z.ody))this.options.affineOdy=Z.ody;else throw U.invalidParameterError("options.ody","number",Z.ody);if(U.defined(Z.interpolator))if(U.inArray(Z.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=Z.interpolator;else throw U.invalidParameterError("options.interpolator","valid interpolator name",Z.interpolator)}else throw U.invalidParameterError("options","object",Z);return this}function lO($){if(U.plainObject($)){if(U.number($.sigma)&&U.inRange($.sigma,0.000001,10))this.options.sharpenSigma=$.sigma;else throw U.invalidParameterError("options.sigma","number between 0.000001 and 10",$.sigma);if(U.defined($.m1))if(U.number($.m1)&&U.inRange($.m1,0,1e6))this.options.sharpenM1=$.m1;else throw U.invalidParameterError("options.m1","number between 0 and 1000000",$.m1);if(U.defined($.m2))if(U.number($.m2)&&U.inRange($.m2,0,1e6))this.options.sharpenM2=$.m2;else throw U.invalidParameterError("options.m2","number between 0 and 1000000",$.m2);if(U.defined($.x1))if(U.number($.x1)&&U.inRange($.x1,0,1e6))this.options.sharpenX1=$.x1;else throw U.invalidParameterError("options.x1","number between 0 and 1000000",$.x1);if(U.defined($.y2))if(U.number($.y2)&&U.inRange($.y2,0,1e6))this.options.sharpenY2=$.y2;else throw U.invalidParameterError("options.y2","number between 0 and 1000000",$.y2);if(U.defined($.y3))if(U.number($.y3)&&U.inRange($.y3,0,1e6))this.options.sharpenY3=$.y3;else throw U.invalidParameterError("options.y3","number between 0 and 1000000",$.y3)}else this.options.sharpenSigma=-1;return this}function cO($){if(!U.defined($))this.options.medianSize=3;else if(U.integer($)&&U.inRange($,1,1000))this.options.medianSize=$;else throw U.invalidParameterError("size","integer between 1 and 1000",$);return this}function pO($){let Z;if(U.number($))Z=$;else if(U.plainObject($)){if(!U.number($.sigma))throw U.invalidParameterError("options.sigma","number between 0.3 and 1000",Z);if(Z=$.sigma,"precision"in $)if(U.string(zU[$.precision]))this.options.precision=zU[$.precision];else throw U.invalidParameterError("precision","one of: integer, float, approximate",$.precision);if("minAmplitude"in $)if(U.number($.minAmplitude)&&U.inRange($.minAmplitude,0.001,1))this.options.minAmpl=$.minAmplitude;else throw U.invalidParameterError("minAmplitude","number between 0.001 and 1",$.minAmplitude)}if(!U.defined($))this.options.blurSigma=-1;else if(U.bool($))this.options.blurSigma=$?-1:0;else if(U.number(Z)&&U.inRange(Z,0.3,1000))this.options.blurSigma=Z;else throw U.invalidParameterError("sigma","number between 0.3 and 1000",Z);return this}function iO($){if(!U.defined($))this.options.dilateWidth=1;else if(U.integer($)&&U.inRange($,1,65536))this.options.dilateWidth=$;else throw U.invalidParameterError("width","integer between 1 and 65536",$);return this}function nO($){if(!U.defined($))this.options.erodeWidth=1;else if(U.integer($)&&U.inRange($,1,65536))this.options.erodeWidth=$;else throw U.invalidParameterError("width","integer between 1 and 65536",$);return this}function rO($){if(this.options.flatten=U.bool($)?$:!0,U.object($))this._setBackgroundColourOption("flattenBackground",$.background);return this}function aO(){return this.options.unflatten=!0,this}function oO($,Z){if(!U.defined($))this.options.gamma=2.2;else if(U.number($)&&U.inRange($,1,3))this.options.gamma=$;else throw U.invalidParameterError("gamma","number between 1.0 and 3.0",$);if(!U.defined(Z))this.options.gammaOut=this.options.gamma;else if(U.number(Z)&&U.inRange(Z,1,3))this.options.gammaOut=Z;else throw U.invalidParameterError("gammaOut","number between 1.0 and 3.0",Z);return this}function sO($){if(this.options.negate=U.bool($)?$:!0,U.plainObject($)&&"alpha"in $)if(!U.bool($.alpha))throw U.invalidParameterError("alpha","should be boolean value",$.alpha);else this.options.negateAlpha=$.alpha;return this}function tO($){if(U.plainObject($)){if(U.defined($.lower))if(U.number($.lower)&&U.inRange($.lower,0,99))this.options.normaliseLower=$.lower;else throw U.invalidParameterError("lower","number between 0 and 99",$.lower);if(U.defined($.upper))if(U.number($.upper)&&U.inRange($.upper,1,100))this.options.normaliseUpper=$.upper;else throw U.invalidParameterError("upper","number between 1 and 100",$.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw U.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function eO($){return this.normalise($)}function $E($){if(U.plainObject($)){if(U.integer($.width)&&U.inRange($.width,1,65536))this.options.claheWidth=$.width;else throw U.invalidParameterError("width","integer between 1 and 65536",$.width);if(U.integer($.height)&&U.inRange($.height,1,65536))this.options.claheHeight=$.height;else throw U.invalidParameterError("height","integer between 1 and 65536",$.height);if(U.defined($.maxSlope))if(U.integer($.maxSlope)&&U.inRange($.maxSlope,0,100))this.options.claheMaxSlope=$.maxSlope;else throw U.invalidParameterError("maxSlope","integer between 0 and 100",$.maxSlope)}else throw U.invalidParameterError("options","plain object",$);return this}function ZE($){if(!U.object($)||!Array.isArray($.kernel)||!U.integer($.width)||!U.integer($.height)||!U.inRange($.width,3,1001)||!U.inRange($.height,3,1001)||$.height*$.width!==$.kernel.length||!$.kernel.every(U.number))throw Error("Invalid convolution kernel");if(!U.integer($.scale))$.scale=$.kernel.reduce((Z,X)=>Z+X,0);if($.scale<1)$.scale=1;if(!U.integer($.offset))$.offset=0;return this.options.convKernel=$,this}function XE($,Z){if(!U.defined($))this.options.threshold=128;else if(U.bool($))this.options.threshold=$?128:0;else if(U.integer($)&&U.inRange($,0,255))this.options.threshold=$;else throw U.invalidParameterError("threshold","integer between 0 and 255",$);if(!U.object(Z)||Z.greyscale===!0||Z.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function QE($,Z,X){if(this.options.boolean=this._createInputDescriptor($,X),U.string(Z)&&U.inArray(Z,["and","or","eor"]))this.options.booleanOp=Z;else throw U.invalidParameterError("operator","one of: and, or, eor",Z);return this}function JE($,Z){if(!U.defined($)&&U.number(Z))$=1;else if(U.number($)&&!U.defined(Z))Z=0;if(!U.defined($))this.options.linearA=[];else if(U.number($))this.options.linearA=[$];else if(Array.isArray($)&&$.length&&$.every(U.number))this.options.linearA=$;else throw U.invalidParameterError("a","number or array of numbers",$);if(!U.defined(Z))this.options.linearB=[];else if(U.number(Z))this.options.linearB=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(U.number))this.options.linearB=Z;else throw U.invalidParameterError("b","number or array of numbers",Z);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function GE($){if(!Array.isArray($))throw U.invalidParameterError("inputMatrix","array",$);let Z=$.length;if(Z!==3&&Z!==4)throw U.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z);if(!$.every((Q)=>Array.isArray(Q)&&Q.length===Z))throw U.invalidParameterError("inputMatrix",`array of ${Z} arrays of length ${Z}`,$);let X=$.flat();if(!X.every(U.number))throw U.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function WE($){if(!U.plainObject($))throw U.invalidParameterError("options","plain object",$);if("brightness"in $)if(U.number($.brightness)&&$.brightness>=0)this.options.brightness=$.brightness;else throw U.invalidParameterError("brightness","number above zero",$.brightness);if("saturation"in $)if(U.number($.saturation)&&$.saturation>=0)this.options.saturation=$.saturation;else throw U.invalidParameterError("saturation","number above zero",$.saturation);if("hue"in $)if(U.integer($.hue))this.options.hue=$.hue%360;else throw U.invalidParameterError("hue","number",$.hue);if("lightness"in $)if(U.number($.lightness))this.options.lightness=$.lightness;else throw U.invalidParameterError("lightness","number",$.lightness);return this}var zU,qU=($)=>{Object.assign($.prototype,{autoOrient:hO,rotate:fO,flip:uO,flop:mO,affine:dO,sharpen:lO,erode:nO,dilate:iO,median:cO,blur:pO,flatten:rO,unflatten:aO,gamma:oO,negate:sO,normalise:tO,normalize:eO,clahe:$E,convolve:ZE,threshold:XE,boolean:QE,linear:JE,recomb:GE,modulate:WE})};var KU=s(()=>{C1();/*!
307
305
  Copyright 2013 Lovell Fuller and others.
308
306
  SPDX-License-Identifier: Apache-2.0
309
- */mU={integer:"integer",float:"float",approximate:"approximate"}});var aU=b((xl,rU)=>{var{defineProperty:PX,getOwnPropertyDescriptor:_O,getOwnPropertyNames:xO}=Object,bO=Object.prototype.hasOwnProperty,kO=($,Z)=>{for(var X in Z)PX($,X,{get:Z[X],enumerable:!0})},yO=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of xO(Z))if(!bO.call($,J)&&J!==X)PX($,J,{get:()=>Z[J],enumerable:!(Q=_O(Z,J))||Q.enumerable})}return $},vO=($)=>yO(PX({},"__esModule",{value:!0}),$),cU={};kO(cU,{default:()=>oO});rU.exports=vO(cU);var jX={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let $ in jX)Object.freeze(jX[$]);var b6=Object.freeze(jX),pU=Object.create(null);for(let $ in b6)if(Object.hasOwn(b6,$))pU[b6[$]]=$;var _$={to:{},get:{}};_$.get=function($){let Z=$.slice(0,3).toLowerCase(),X,Q;switch(Z){case"hsl":{X=_$.get.hsl($),Q="hsl";break}case"hwb":{X=_$.get.hwb($),Q="hwb";break}default:{X=_$.get.rgb($),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};_$.get.rgb=function($){if(!$)return null;let Z=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,W=[0,0,0,1],Y,z,q;if(Y=$.match(X)){q=Y[2],Y=Y[1];for(z=0;z<3;z++){let H=z*2;W[z]=Number.parseInt(Y.slice(H,H+2),16)}if(q)W[3]=Number.parseInt(q,16)/255}else if(Y=$.match(Z)){Y=Y[1],q=Y[3];for(z=0;z<3;z++)W[z]=Number.parseInt(Y[z]+Y[z],16);if(q)W[3]=Number.parseInt(q+q,16)/255}else if(Y=$.match(Q)){for(z=0;z<3;z++)W[z]=Number.parseFloat(Y[z+1]);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.match(J)){for(z=0;z<3;z++)W[z]=Math.round(Number.parseFloat(Y[z+1])*2.55);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.toLowerCase().match(G)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(b6,Y[1]))return null;return W=b6[Y[1]].slice(),W[3]=1,W}else return null;for(z=0;z<3;z++)W[z]=E1(W[z],0,255);return W[3]=E1(W[3],0,1),W};_$.get.hsl=function($){if(!$)return null;let Z=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=E1(Number.parseFloat(X[2]),0,100),W=E1(Number.parseFloat(X[3]),0,100),Y=E1(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};_$.get.hwb=function($){if(!$)return null;let Z=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=E1(Number.parseFloat(X[2]),0,100),W=E1(Number.parseFloat(X[3]),0,100),Y=E1(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};_$.to.hex=function(...$){return"#"+O8($[0])+O8($[1])+O8($[2])+($[3]<1?O8(Math.round($[3]*255)):"")};_$.to.rgb=function(...$){return $.length<4||$[3]===1?"rgb("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+")":"rgba("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+", "+$[3]+")"};_$.to.rgb.percent=function(...$){let Z=Math.round($[0]/255*100),X=Math.round($[1]/255*100),Q=Math.round($[2]/255*100);return $.length<4||$[3]===1?"rgb("+Z+"%, "+X+"%, "+Q+"%)":"rgba("+Z+"%, "+X+"%, "+Q+"%, "+$[3]+")"};_$.to.hsl=function(...$){return $.length<4||$[3]===1?"hsl("+$[0]+", "+$[1]+"%, "+$[2]+"%)":"hsla("+$[0]+", "+$[1]+"%, "+$[2]+"%, "+$[3]+")"};_$.to.hwb=function(...$){let Z="";if($.length>=4&&$[3]!==1)Z=", "+$[3];return"hwb("+$[0]+", "+$[1]+"%, "+$[2]+"%"+Z+")"};_$.to.keyword=function(...$){return pU[$.slice(0,3)]};function E1($,Z,X){return Math.min(Math.max(Z,$),X)}function O8($){let Z=Math.round($).toString(16).toUpperCase();return Z.length<2?"0"+Z:Z}var S4=_$,iU={};for(let $ of Object.keys(b6))iU[b6[$]]=$;var z0={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},t1=z0,$1=0.008856451679035631;function x4($){let Z=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92;return Math.min(Math.max(0,Z),1)}function b4($){return $>0.04045?(($+0.055)/1.055)**2.4:$/12.92}for(let $ of Object.keys(z0)){if(!("channels"in z0[$]))throw Error("missing channels property: "+$);if(!("labels"in z0[$]))throw Error("missing channel labels property: "+$);if(z0[$].labels.length!==z0[$].channels)throw Error("channel and label counts mismatch: "+$);let{channels:Z,labels:X}=z0[$];delete z0[$].channels,delete z0[$].labels,Object.defineProperty(z0[$],"channels",{value:Z}),Object.defineProperty(z0[$],"labels",{value:X})}z0.rgb.hsl=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(Z,X,Q),G=Math.max(Z,X,Q),W=G-J,Y,z;switch(G){case J:{Y=0;break}case Z:{Y=(X-Q)/W;break}case X:{Y=2+(Q-Z)/W;break}case Q:{Y=4+(Z-X)/W;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let q=(J+G)/2;if(G===J)z=0;else if(q<=0.5)z=W/(G+J);else z=W/(2-G-J);return[Y,z*100,q*100]};z0.rgb.hsv=function($){let Z,X,Q,J,G,W=$[0]/255,Y=$[1]/255,z=$[2]/255,q=Math.max(W,Y,z),H=q-Math.min(W,Y,z),B=function(L){return(q-L)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/q,Z=B(W),X=B(Y),Q=B(z),q){case W:{J=Q-X;break}case Y:{J=0.3333333333333333+Z-Q;break}case z:{J=0.6666666666666666+X-Z;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,q*100]};z0.rgb.hwb=function($){let Z=$[0],X=$[1],Q=$[2],J=z0.rgb.hsl($)[0],G=0.00392156862745098*Math.min(Z,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(Z,Math.max(X,Q)),[J,G*100,Q*100]};z0.rgb.oklab=function($){let Z=b4($[0]/255),X=b4($[1]/255),Q=b4($[2]/255),J=Math.cbrt(0.4122214708*Z+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*Z+0.6806995451*X+0.1073969566*Q),W=Math.cbrt(0.0883024619*Z+0.2817188376*X+0.6299787005*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};z0.rgb.cmyk=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(1-Z,1-X,1-Q),G=(1-Z-J)/(1-J)||0,W=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0;return[G*100,W*100,Y*100,J*100]};function gO($,Z){return($[0]-Z[0])**2+($[1]-Z[1])**2+($[2]-Z[2])**2}z0.rgb.keyword=function($){let Z=iU[$];if(Z)return Z;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(b6)){let G=b6[J],W=gO($,G);if(W<X)X=W,Q=J}return Q};z0.keyword.rgb=function($){return[...b6[$]]};z0.rgb.xyz=function($){let Z=b4($[0]/255),X=b4($[1]/255),Q=b4($[2]/255),J=Z*0.4124564+X*0.3575761+Q*0.1804375,G=Z*0.2126729+X*0.7151522+Q*0.072175,W=Z*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,W*100]};z0.rgb.lab=function($){let Z=z0.rgb.xyz($),X=Z[0],Q=Z[1],J=Z[2];X/=95.047,Q/=100,J/=108.883,X=X>$1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>$1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>$1?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,W=500*(X-Q),Y=200*(Q-J);return[G,W,Y]};z0.hsl.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let W=Q<0.5?Q*(1+X):Q+X-Q*X,Y=2*Q-W,z=[0,0,0];for(let q=0;q<3;q++){if(J=Z+0.3333333333333333*-(q-1),J<0)J++;if(J>1)J--;if(6*J<1)G=Y+(W-Y)*6*J;else if(2*J<1)G=W;else if(3*J<2)G=Y+(W-Y)*(0.6666666666666666-J)*6;else G=Y;z[q]=G*255}return z};z0.hsl.hsv=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let W=(Q+X)/2,Y=Q===0?2*J/(G+J):2*X/(Q+X);return[Z,Y*100,W*100]};z0.hsv.rgb=function($){let Z=$[0]/60,X=$[1]/100,Q=$[2]/100,J=Math.floor(Z)%6,G=Z-Math.floor(Z),W=255*Q*(1-X),Y=255*Q*(1-X*G),z=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,z,W];case 1:return[Y,Q,W];case 2:return[W,Q,z];case 3:return[W,Y,Q];case 4:return[z,W,Q];case 5:return[Q,W,Y]}};z0.hsv.hsl=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=Math.max(Q,0.01),G,W;W=(2-X)*Q;let Y=(2-X)*J;return G=X*J,G/=Y<=1?Y:2-Y,G=G||0,W/=2,[Z,G*100,W*100]};z0.hwb.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let W=Math.floor(6*Z),Y=1-Q;if(G=6*Z-W,(W&1)!==0)G=1-G;let z=X+G*(Y-X),q,H,B;switch(W){default:case 6:case 0:{q=Y,H=z,B=X;break}case 1:{q=z,H=Y,B=X;break}case 2:{q=X,H=Y,B=z;break}case 3:{q=X,H=z,B=Y;break}case 4:{q=z,H=X,B=Y;break}case 5:{q=Y,H=X,B=z;break}}return[q*255,H*255,B*255]};z0.cmyk.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=$[3]/100,G=1-Math.min(1,Z*(1-J)+J),W=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J);return[G*255,W*255,Y*255]};z0.xyz.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J,G,W;return J=Z*3.2404542+X*-1.5371385+Q*-0.4985314,G=Z*-0.969266+X*1.8760108+Q*0.041556,W=Z*0.0556434+X*-0.2040259+Q*1.0572252,J=x4(J),G=x4(G),W=x4(W),[J*255,G*255,W*255]};z0.xyz.lab=function($){let Z=$[0],X=$[1],Q=$[2];Z/=95.047,X/=100,Q/=108.883,Z=Z>$1?Z**0.3333333333333333:7.787*Z+0.13793103448275862,X=X>$1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>$1?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(Z-X),W=200*(X-Q);return[J,G,W]};z0.xyz.oklab=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=Math.cbrt(0.8189330101*Z+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*Z+0.9293118715*X+0.0361456387*Q),W=Math.cbrt(0.0482003018*Z+0.2643662691*X+0.633851707*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};z0.oklab.oklch=function($){return z0.lab.lch($)};z0.oklab.xyz=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(0.999999998*Z+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*Z-0.105561342*X-0.063854175*Q)**3,W=(1.000000055*Z-0.089484182*X-1.291485538*Q)**3,Y=1.227013851*J-0.55779998*G+0.281256149*W,z=-0.040580178*J+1.11225687*G-0.071676679*W,q=-0.076381285*J-0.421481978*G+1.58616322*W;return[Y*100,z*100,q*100]};z0.oklab.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(Z+0.3963377774*X+0.2158037573*Q)**3,G=(Z-0.1055613458*X-0.0638541728*Q)**3,W=(Z-0.0894841775*X-1.291485548*Q)**3,Y=x4(4.0767416621*J-3.3077115913*G+0.2309699292*W),z=x4(-1.2684380046*J+2.6097574011*G-0.3413193965*W),q=x4(-0.0041960863*J-0.7034186147*G+1.707614701*W);return[Y*255,z*255,q*255]};z0.oklch.oklab=function($){return z0.lch.lab($)};z0.lab.xyz=function($){let Z=$[0],X=$[1],Q=$[2],J,G,W;G=(Z+16)/116,J=X/500+G,W=G-Q/200;let Y=G**3,z=J**3,q=W**3;return G=Y>$1?Y:(G-0.13793103448275862)/7.787,J=z>$1?z:(J-0.13793103448275862)/7.787,W=q>$1?q:(W-0.13793103448275862)/7.787,J*=95.047,G*=100,W*=108.883,[J,G,W]};z0.lab.lch=function($){let Z=$[0],X=$[1],Q=$[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let W=Math.sqrt(X*X+Q*Q);return[Z,W,J]};z0.lch.lab=function($){let Z=$[0],X=$[1],J=$[2]/360*2*Math.PI,G=X*Math.cos(J),W=X*Math.sin(J);return[Z,G,W]};z0.rgb.ansi16=function($,Z=null){let[X,Q,J]=$,G=Z===null?z0.rgb.hsv($)[2]:Z;if(G=Math.round(G/50),G===0)return 30;let W=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)W+=60;return W};z0.hsv.ansi16=function($){return z0.rgb.ansi16(z0.hsv.rgb($),$[2])};z0.rgb.ansi256=function($){let Z=$[0],X=$[1],Q=$[2];if(Z>>4===X>>4&&X>>4===Q>>4){if(Z<8)return 16;if(Z>248)return 231;return Math.round((Z-8)/247*24)+232}return 16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};z0.ansi16.rgb=function($){$=$[0];let Z=$%10;if(Z===0||Z===7){if($>50)Z+=3.5;return Z=Z/10.5*255,[Z,Z,Z]}let X=(Math.trunc($>50)+1)*0.5,Q=(Z&1)*X*255,J=(Z>>1&1)*X*255,G=(Z>>2&1)*X*255;return[Q,J,G]};z0.ansi256.rgb=function($){if($=$[0],$>=232){let G=($-232)*10+8;return[G,G,G]}$-=16;let Z,X=Math.floor($/36)/5*255,Q=Math.floor((Z=$%36)/6)/5*255,J=Z%6/5*255;return[X,Q,J]};z0.rgb.hex=function($){let X=(((Math.round($[0])&255)<<16)+((Math.round($[1])&255)<<8)+(Math.round($[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};z0.hex.rgb=function($){let Z=$.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!Z)return[0,0,0];let X=Z[0];if(Z[0].length===3)X=[...X].map((Y)=>Y+Y).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,W=Q&255;return[J,G,W]};z0.rgb.hcg=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.max(Math.max(Z,X),Q),G=Math.min(Math.min(Z,X),Q),W=J-G,Y,z=W<1?G/(1-W):0;if(W<=0)Y=0;else if(J===Z)Y=(X-Q)/W%6;else if(J===X)Y=2+(Q-Z)/W;else Y=4+(Z-X)/W;return Y/=6,Y%=1,[Y*360,W*100,z*100]};z0.hsl.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=X<0.5?2*Z*X:2*Z*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[$[0],Q*100,J*100]};z0.hsv.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=Z*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[$[0],Q*100,J*100]};z0.hcg.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=Z%1*6,W=G%1,Y=1-W,z=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=W,J[2]=0;break}case 1:{J[0]=Y,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=W;break}case 3:{J[0]=0,J[1]=Y,J[2]=1;break}case 4:{J[0]=W,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=Y}return z=(1-X)*Q,[(X*J[0]+z)*255,(X*J[1]+z)*255,(X*J[2]+z)*255]};z0.hcg.hsv=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z),J=0;if(Q>0)J=Z/Q;return[$[0],J*100,Q*100]};z0.hcg.hsl=function($){let Z=$[1]/100,Q=$[2]/100*(1-Z)+0.5*Z,J=0;if(Q>0&&Q<0.5)J=Z/(2*Q);else if(Q>=0.5&&Q<1)J=Z/(2*(1-Q));return[$[0],J*100,Q*100]};z0.hcg.hwb=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z);return[$[0],(Q-Z)*100,(1-Q)*100]};z0.hwb.hcg=function($){let Z=$[1]/100,Q=1-$[2]/100,J=Q-Z,G=0;if(J<1)G=(Q-J)/(1-J);return[$[0],J*100,G*100]};z0.apple.rgb=function($){return[$[0]/65535*255,$[1]/65535*255,$[2]/65535*255]};z0.rgb.apple=function($){return[$[0]/255*65535,$[1]/255*65535,$[2]/255*65535]};z0.gray.rgb=function($){return[$[0]/100*255,$[0]/100*255,$[0]/100*255]};z0.gray.hsl=function($){return[0,0,$[0]]};z0.gray.hsv=z0.gray.hsl;z0.gray.hwb=function($){return[0,100,$[0]]};z0.gray.cmyk=function($){return[0,0,0,$[0]]};z0.gray.lab=function($){return[$[0],0,0]};z0.gray.hex=function($){let Z=Math.round($[0]/100*255)&255,Q=((Z<<16)+(Z<<8)+Z).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};z0.rgb.gray=function($){return[($[0]+$[1]+$[2])/3/255*100]};function fO(){let $={},Z=Object.keys(t1);for(let{length:X}=Z,Q=0;Q<X;Q++)$[Z[Q]]={distance:-1,parent:null};return $}function hO($){let Z=fO(),X=[$];Z[$].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(t1[Q]);for(let{length:G}=J,W=0;W<G;W++){let Y=J[W],z=Z[Y];if(z.distance===-1)z.distance=Z[Q].distance+1,z.parent=Q,X.unshift(Y)}}return Z}function uO($,Z){return function(X){return Z($(X))}}function mO($,Z){let X=[Z[$].parent,$],Q=t1[Z[$].parent][$],J=Z[$].parent;while(Z[J].parent)X.unshift(Z[J].parent),Q=uO(t1[Z[J].parent][J],Q),J=Z[J].parent;return Q.conversion=X,Q}function dO($){let Z=hO($),X={},Q=Object.keys(Z);for(let{length:J}=Q,G=0;G<J;G++){let W=Q[G];if(Z[W].parent===null)continue;X[W]=mO(W,Z)}return X}var lO=dO,_4={},cO=Object.keys(t1);function pO($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return $(X)};if("conversion"in $)Z.conversion=$.conversion;return Z}function iO($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=$(X);if(typeof J==="object")for(let{length:G}=J,W=0;W<G;W++)J[W]=Math.round(J[W]);return J};if("conversion"in $)Z.conversion=$.conversion;return Z}for(let $ of cO){_4[$]={},Object.defineProperty(_4[$],"channels",{value:t1[$].channels}),Object.defineProperty(_4[$],"labels",{value:t1[$].labels});let Z=lO($),X=Object.keys(Z);for(let Q of X){let J=Z[Q];_4[$][Q]=iO(J),_4[$][Q].raw=pO(J)}}var i$=_4,nU=["keyword","gray","hex"],OX={};for(let $ of Object.keys(i$))OX[[...i$[$].labels].sort().join("")]=$;var EX={};function Q$($,Z){if(!(this instanceof Q$))return new Q$($,Z);if(Z&&Z in nU)Z=null;if(Z&&!(Z in i$))throw Error("Unknown model: "+Z);let X,Q;if($==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if($ instanceof Q$)this.model=$.model,this.color=[...$.color],this.valpha=$.valpha;else if(typeof $==="string"){let J=S4.get($);if(J===null)throw Error("Unable to parse color from string: "+$);this.model=J.model,Q=i$[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if($.length>0){this.model=Z||"rgb",Q=i$[this.model].channels;let J=Array.prototype.slice.call($,0,Q);this.color=RX(J,Q),this.valpha=typeof $[Q]==="number"?$[Q]:1}else if(typeof $==="number")this.model="rgb",this.color=[$>>16&255,$>>8&255,$&255],this.valpha=1;else{this.valpha=1;let J=Object.keys($);if("alpha"in $)J.splice(J.indexOf("alpha"),1),this.valpha=typeof $.alpha==="number"?$.alpha:0;let G=J.sort().join("");if(!(G in OX))throw Error("Unable to parse color from object: "+JSON.stringify($));this.model=OX[G];let{labels:W}=i$[this.model],Y=[];for(X=0;X<W.length;X++)Y.push($[W[X]]);this.color=RX(Y)}if(EX[this.model]){Q=i$[this.model].channels;for(X=0;X<Q;X++){let J=EX[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}Q$.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string($){let Z=this.model in S4.to?this:this.rgb();Z=Z.round(typeof $==="number"?$:1);let X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return S4.to[Z.model](...X)},percentString($){let Z=this.rgb().round(typeof $==="number"?$:1),X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return S4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let $={},{channels:Z}=i$[this.model],{labels:X}=i$[this.model];for(let Q=0;Q<Z;Q++)$[X[Q]]=this.color[Q];if(this.valpha!==1)$.alpha=this.valpha;return $},unitArray(){let $=this.rgb().color;if($[0]/=255,$[1]/=255,$[2]/=255,this.valpha!==1)$.push(this.valpha);return $},unitObject(){let $=this.rgb().object();if($.r/=255,$.g/=255,$.b/=255,this.valpha!==1)$.alpha=this.valpha;return $},round($){return $=Math.max($||0,0),new Q$([...this.color.map(rO($)),this.valpha],this.model)},alpha($){if($!==void 0)return new Q$([...this.color,Math.max(0,Math.min(1,$))],this.model);return this.valpha},red:p0("rgb",0,Z$(255)),green:p0("rgb",1,Z$(255)),blue:p0("rgb",2,Z$(255)),hue:p0(["hsl","hsv","hsl","hwb","hcg"],0,($)=>($%360+360)%360),saturationl:p0("hsl",1,Z$(100)),lightness:p0("hsl",2,Z$(100)),saturationv:p0("hsv",1,Z$(100)),value:p0("hsv",2,Z$(100)),chroma:p0("hcg",1,Z$(100)),gray:p0("hcg",2,Z$(100)),white:p0("hwb",1,Z$(100)),wblack:p0("hwb",2,Z$(100)),cyan:p0("cmyk",0,Z$(100)),magenta:p0("cmyk",1,Z$(100)),yellow:p0("cmyk",2,Z$(100)),black:p0("cmyk",3,Z$(100)),x:p0("xyz",0,Z$(95.047)),y:p0("xyz",1,Z$(100)),z:p0("xyz",2,Z$(108.833)),l:p0("lab",0,Z$(100)),a:p0("lab",1),b:p0("lab",2),keyword($){if($!==void 0)return new Q$($);return i$[this.model].keyword(this.color)},hex($){if($!==void 0)return new Q$($);return S4.to.hex(...this.rgb().round().color)},hexa($){if($!==void 0)return new Q$($);let Z=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return S4.to.hex(...Z)+X},rgbNumber(){let $=this.rgb().color;return($[0]&255)<<16|($[1]&255)<<8|$[2]&255},luminosity(){let $=this.rgb().color,Z=[];for(let[X,Q]of $.entries()){let J=Q/255;Z[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*Z[0]+0.7152*Z[1]+0.0722*Z[2]},contrast($){let Z=this.luminosity(),X=$.luminosity();if(Z>X)return(Z+0.05)/(X+0.05);return(X+0.05)/(Z+0.05)},level($){let Z=this.contrast($);if(Z>=7)return"AAA";return Z>=4.5?"AA":""},isDark(){let $=this.rgb().color;return($[0]*2126+$[1]*7152+$[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let $=this.rgb();for(let Z=0;Z<3;Z++)$.color[Z]=255-$.color[Z];return $},lighten($){let Z=this.hsl();return Z.color[2]+=Z.color[2]*$,Z},darken($){let Z=this.hsl();return Z.color[2]-=Z.color[2]*$,Z},saturate($){let Z=this.hsl();return Z.color[1]+=Z.color[1]*$,Z},desaturate($){let Z=this.hsl();return Z.color[1]-=Z.color[1]*$,Z},whiten($){let Z=this.hwb();return Z.color[1]+=Z.color[1]*$,Z},blacken($){let Z=this.hwb();return Z.color[2]+=Z.color[2]*$,Z},grayscale(){let $=this.rgb().color,Z=$[0]*0.3+$[1]*0.59+$[2]*0.11;return Q$.rgb(Z,Z,Z)},fade($){return this.alpha(this.valpha-this.valpha*$)},opaquer($){return this.alpha(this.valpha+this.valpha*$)},rotate($){let Z=this.hsl(),X=Z.color[0];return X=(X+$)%360,X=X<0?360+X:X,Z.color[0]=X,Z},mix($,Z){if(!$||!$.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof $);let X=$.rgb(),Q=this.rgb(),J=Z===void 0?0.5:Z,G=2*J-1,W=X.alpha()-Q.alpha(),Y=((G*W===-1?G:(G+W)/(1+G*W))+1)/2,z=1-Y;return Q$.rgb(Y*X.red()+z*Q.red(),Y*X.green()+z*Q.green(),Y*X.blue()+z*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let $ of Object.keys(i$)){if(nU.includes($))continue;let{channels:Z}=i$[$];Q$.prototype[$]=function(...X){if(this.model===$)return new Q$(this);if(X.length>0)return new Q$(X,$);return new Q$([...aO(i$[this.model][$].raw(this.color)),this.valpha],$)},Q$[$]=function(...X){let Q=X[0];if(typeof Q==="number")Q=RX(X,Z);return new Q$(Q,$)}}function nO($,Z){return Number($.toFixed(Z))}function rO($){return function(Z){return nO(Z,$)}}function p0($,Z,X){$=Array.isArray($)?$:[$];for(let Q of $)(EX[Q]||=[])[Z]=X;return $=$[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[$](),J.color[Z]=Q,J}if(J=this[$]().color[Z],X)J=X(J);return J}}function Z$($){return function(Z){return Math.max(0,Math.min($,Z))}}function aO($){return Array.isArray($)?$:[$]}function RX($,Z){for(let X=0;X<Z;X++)if(typeof $[X]!=="number")$[X]=0;return $}var oO=Q$});var sU=b((bl,oU)=>{oU.exports=aU().default});function sO($){return this._setBackgroundColourOption("tint",$),this}function tO($){return this.options.greyscale=K.bool($)?$:!0,this}function eO($){return this.greyscale($)}function $E($){if(!K.string($))throw K.invalidParameterError("colourspace","string",$);return this.options.colourspacePipeline=$,this}function ZE($){return this.pipelineColourspace($)}function XE($){if(!K.string($))throw K.invalidParameterError("colourspace","string",$);return this.options.colourspace=$,this}function QE($){return this.toColourspace($)}function $K($){if(K.object($)||K.string($)&&$.length>=3&&$.length<=200){let Z=eU.default($),X=Z.red(),Q=Z.green(),J=Z.blue(),G=Math.round(Z.alpha()*255);for(let[W,Y]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!K.number(Y))throw K.invalidParameterError(`background.${W}`,"number",Y);return[X,Q,J,G]}else throw K.invalidParameterError("background","object or string",$)}function JE($,Z){if(K.defined(Z))this.options[$]=$K(Z)}var eU,tU,ZK=($)=>{Object.assign($.prototype,{tint:sO,greyscale:tO,grayscale:eO,pipelineColourspace:$E,pipelineColorspace:ZE,toColourspace:XE,toColorspace:QE,_getBackgroundColourOption:$K,_setBackgroundColourOption:JE}),$.colourspace=tU,$.colorspace=tU};var XK=t(()=>{R6();eU=B$(sU(),1);/*!
307
+ */zU={integer:"integer",float:"float",approximate:"approximate"}});var LU=b((Dc,FU)=>{var{defineProperty:mX,getOwnPropertyDescriptor:YE,getOwnPropertyNames:zE}=Object,qE=Object.prototype.hasOwnProperty,KE=($,Z)=>{for(var X in Z)mX($,X,{get:Z[X],enumerable:!0})},UE=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of zE(Z))if(!qE.call($,J)&&J!==X)mX($,J,{get:()=>Z[J],enumerable:!(Q=YE(Z,J))||Q.enumerable})}return $},HE=($)=>UE(mX({},"__esModule",{value:!0}),$),UU={};KE(UU,{default:()=>EE});FU.exports=HE(UU);var gX={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let $ in gX)Object.freeze(gX[$]);var y1=Object.freeze(gX),HU=Object.create(null);for(let $ in y1)if(Object.hasOwn(y1,$))HU[y1[$]]=$;var b$={to:{},get:{}};b$.get=function($){let Z=$.slice(0,3).toLowerCase(),X,Q;switch(Z){case"hsl":{X=b$.get.hsl($),Q="hsl";break}case"hwb":{X=b$.get.hwb($),Q="hwb";break}default:{X=b$.get.rgb($),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};b$.get.rgb=function($){if(!$)return null;let Z=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,W=[0,0,0,1],Y,z,q;if(Y=$.match(X)){q=Y[2],Y=Y[1];for(z=0;z<3;z++){let H=z*2;W[z]=Number.parseInt(Y.slice(H,H+2),16)}if(q)W[3]=Number.parseInt(q,16)/255}else if(Y=$.match(Z)){Y=Y[1],q=Y[3];for(z=0;z<3;z++)W[z]=Number.parseInt(Y[z]+Y[z],16);if(q)W[3]=Number.parseInt(q+q,16)/255}else if(Y=$.match(Q)){for(z=0;z<3;z++)W[z]=Number.parseFloat(Y[z+1]);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.match(J)){for(z=0;z<3;z++)W[z]=Math.round(Number.parseFloat(Y[z+1])*2.55);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.toLowerCase().match(G)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(y1,Y[1]))return null;return W=y1[Y[1]].slice(),W[3]=1,W}else return null;for(z=0;z<3;z++)W[z]=P6(W[z],0,255);return W[3]=P6(W[3],0,1),W};b$.get.hsl=function($){if(!$)return null;let Z=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=P6(Number.parseFloat(X[2]),0,100),W=P6(Number.parseFloat(X[3]),0,100),Y=P6(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};b$.get.hwb=function($){if(!$)return null;let Z=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=P6(Number.parseFloat(X[2]),0,100),W=P6(Number.parseFloat(X[3]),0,100),Y=P6(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};b$.to.hex=function(...$){return"#"+f5($[0])+f5($[1])+f5($[2])+($[3]<1?f5(Math.round($[3]*255)):"")};b$.to.rgb=function(...$){return $.length<4||$[3]===1?"rgb("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+")":"rgba("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+", "+$[3]+")"};b$.to.rgb.percent=function(...$){let Z=Math.round($[0]/255*100),X=Math.round($[1]/255*100),Q=Math.round($[2]/255*100);return $.length<4||$[3]===1?"rgb("+Z+"%, "+X+"%, "+Q+"%)":"rgba("+Z+"%, "+X+"%, "+Q+"%, "+$[3]+")"};b$.to.hsl=function(...$){return $.length<4||$[3]===1?"hsl("+$[0]+", "+$[1]+"%, "+$[2]+"%)":"hsla("+$[0]+", "+$[1]+"%, "+$[2]+"%, "+$[3]+")"};b$.to.hwb=function(...$){let Z="";if($.length>=4&&$[3]!==1)Z=", "+$[3];return"hwb("+$[0]+", "+$[1]+"%, "+$[2]+"%"+Z+")"};b$.to.keyword=function(...$){return HU[$.slice(0,3)]};function P6($,Z,X){return Math.min(Math.max(Z,$),X)}function f5($){let Z=Math.round($).toString(16).toUpperCase();return Z.length<2?"0"+Z:Z}var g4=b$,VU={};for(let $ of Object.keys(y1))VU[y1[$]]=$;var W0={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},X4=W0,Z6=0.008856451679035631;function h4($){let Z=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92;return Math.min(Math.max(0,Z),1)}function u4($){return $>0.04045?(($+0.055)/1.055)**2.4:$/12.92}for(let $ of Object.keys(W0)){if(!("channels"in W0[$]))throw Error("missing channels property: "+$);if(!("labels"in W0[$]))throw Error("missing channel labels property: "+$);if(W0[$].labels.length!==W0[$].channels)throw Error("channel and label counts mismatch: "+$);let{channels:Z,labels:X}=W0[$];delete W0[$].channels,delete W0[$].labels,Object.defineProperty(W0[$],"channels",{value:Z}),Object.defineProperty(W0[$],"labels",{value:X})}W0.rgb.hsl=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(Z,X,Q),G=Math.max(Z,X,Q),W=G-J,Y,z;switch(G){case J:{Y=0;break}case Z:{Y=(X-Q)/W;break}case X:{Y=2+(Q-Z)/W;break}case Q:{Y=4+(Z-X)/W;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let q=(J+G)/2;if(G===J)z=0;else if(q<=0.5)z=W/(G+J);else z=W/(2-G-J);return[Y,z*100,q*100]};W0.rgb.hsv=function($){let Z,X,Q,J,G,W=$[0]/255,Y=$[1]/255,z=$[2]/255,q=Math.max(W,Y,z),H=q-Math.min(W,Y,z),B=function(F){return(q-F)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/q,Z=B(W),X=B(Y),Q=B(z),q){case W:{J=Q-X;break}case Y:{J=0.3333333333333333+Z-Q;break}case z:{J=0.6666666666666666+X-Z;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,q*100]};W0.rgb.hwb=function($){let Z=$[0],X=$[1],Q=$[2],J=W0.rgb.hsl($)[0],G=0.00392156862745098*Math.min(Z,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(Z,Math.max(X,Q)),[J,G*100,Q*100]};W0.rgb.oklab=function($){let Z=u4($[0]/255),X=u4($[1]/255),Q=u4($[2]/255),J=Math.cbrt(0.4122214708*Z+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*Z+0.6806995451*X+0.1073969566*Q),W=Math.cbrt(0.0883024619*Z+0.2817188376*X+0.6299787005*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.rgb.cmyk=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(1-Z,1-X,1-Q),G=(1-Z-J)/(1-J)||0,W=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0;return[G*100,W*100,Y*100,J*100]};function VE($,Z){return($[0]-Z[0])**2+($[1]-Z[1])**2+($[2]-Z[2])**2}W0.rgb.keyword=function($){let Z=VU[$];if(Z)return Z;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(y1)){let G=y1[J],W=VE($,G);if(W<X)X=W,Q=J}return Q};W0.keyword.rgb=function($){return[...y1[$]]};W0.rgb.xyz=function($){let Z=u4($[0]/255),X=u4($[1]/255),Q=u4($[2]/255),J=Z*0.4124564+X*0.3575761+Q*0.1804375,G=Z*0.2126729+X*0.7151522+Q*0.072175,W=Z*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,W*100]};W0.rgb.lab=function($){let Z=W0.rgb.xyz($),X=Z[0],Q=Z[1],J=Z[2];X/=95.047,Q/=100,J/=108.883,X=X>Z6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Z6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>Z6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,W=500*(X-Q),Y=200*(Q-J);return[G,W,Y]};W0.hsl.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let W=Q<0.5?Q*(1+X):Q+X-Q*X,Y=2*Q-W,z=[0,0,0];for(let q=0;q<3;q++){if(J=Z+0.3333333333333333*-(q-1),J<0)J++;if(J>1)J--;if(6*J<1)G=Y+(W-Y)*6*J;else if(2*J<1)G=W;else if(3*J<2)G=Y+(W-Y)*(0.6666666666666666-J)*6;else G=Y;z[q]=G*255}return z};W0.hsl.hsv=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let W=(Q+X)/2,Y=Q===0?2*J/(G+J):2*X/(Q+X);return[Z,Y*100,W*100]};W0.hsv.rgb=function($){let Z=$[0]/60,X=$[1]/100,Q=$[2]/100,J=Math.floor(Z)%6,G=Z-Math.floor(Z),W=255*Q*(1-X),Y=255*Q*(1-X*G),z=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,z,W];case 1:return[Y,Q,W];case 2:return[W,Q,z];case 3:return[W,Y,Q];case 4:return[z,W,Q];case 5:return[Q,W,Y]}};W0.hsv.hsl=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=Math.max(Q,0.01),G,W;W=(2-X)*Q;let Y=(2-X)*J;return G=X*J,G/=Y<=1?Y:2-Y,G=G||0,W/=2,[Z,G*100,W*100]};W0.hwb.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let W=Math.floor(6*Z),Y=1-Q;if(G=6*Z-W,(W&1)!==0)G=1-G;let z=X+G*(Y-X),q,H,B;switch(W){default:case 6:case 0:{q=Y,H=z,B=X;break}case 1:{q=z,H=Y,B=X;break}case 2:{q=X,H=Y,B=z;break}case 3:{q=X,H=z,B=Y;break}case 4:{q=z,H=X,B=Y;break}case 5:{q=Y,H=X,B=z;break}}return[q*255,H*255,B*255]};W0.cmyk.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=$[3]/100,G=1-Math.min(1,Z*(1-J)+J),W=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J);return[G*255,W*255,Y*255]};W0.xyz.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J,G,W;return J=Z*3.2404542+X*-1.5371385+Q*-0.4985314,G=Z*-0.969266+X*1.8760108+Q*0.041556,W=Z*0.0556434+X*-0.2040259+Q*1.0572252,J=h4(J),G=h4(G),W=h4(W),[J*255,G*255,W*255]};W0.xyz.lab=function($){let Z=$[0],X=$[1],Q=$[2];Z/=95.047,X/=100,Q/=108.883,Z=Z>Z6?Z**0.3333333333333333:7.787*Z+0.13793103448275862,X=X>Z6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Z6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(Z-X),W=200*(X-Q);return[J,G,W]};W0.xyz.oklab=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=Math.cbrt(0.8189330101*Z+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*Z+0.9293118715*X+0.0361456387*Q),W=Math.cbrt(0.0482003018*Z+0.2643662691*X+0.633851707*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.oklab.oklch=function($){return W0.lab.lch($)};W0.oklab.xyz=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(0.999999998*Z+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*Z-0.105561342*X-0.063854175*Q)**3,W=(1.000000055*Z-0.089484182*X-1.291485538*Q)**3,Y=1.227013851*J-0.55779998*G+0.281256149*W,z=-0.040580178*J+1.11225687*G-0.071676679*W,q=-0.076381285*J-0.421481978*G+1.58616322*W;return[Y*100,z*100,q*100]};W0.oklab.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(Z+0.3963377774*X+0.2158037573*Q)**3,G=(Z-0.1055613458*X-0.0638541728*Q)**3,W=(Z-0.0894841775*X-1.291485548*Q)**3,Y=h4(4.0767416621*J-3.3077115913*G+0.2309699292*W),z=h4(-1.2684380046*J+2.6097574011*G-0.3413193965*W),q=h4(-0.0041960863*J-0.7034186147*G+1.707614701*W);return[Y*255,z*255,q*255]};W0.oklch.oklab=function($){return W0.lch.lab($)};W0.lab.xyz=function($){let Z=$[0],X=$[1],Q=$[2],J,G,W;G=(Z+16)/116,J=X/500+G,W=G-Q/200;let Y=G**3,z=J**3,q=W**3;return G=Y>Z6?Y:(G-0.13793103448275862)/7.787,J=z>Z6?z:(J-0.13793103448275862)/7.787,W=q>Z6?q:(W-0.13793103448275862)/7.787,J*=95.047,G*=100,W*=108.883,[J,G,W]};W0.lab.lch=function($){let Z=$[0],X=$[1],Q=$[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let W=Math.sqrt(X*X+Q*Q);return[Z,W,J]};W0.lch.lab=function($){let Z=$[0],X=$[1],J=$[2]/360*2*Math.PI,G=X*Math.cos(J),W=X*Math.sin(J);return[Z,G,W]};W0.rgb.ansi16=function($,Z=null){let[X,Q,J]=$,G=Z===null?W0.rgb.hsv($)[2]:Z;if(G=Math.round(G/50),G===0)return 30;let W=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)W+=60;return W};W0.hsv.ansi16=function($){return W0.rgb.ansi16(W0.hsv.rgb($),$[2])};W0.rgb.ansi256=function($){let Z=$[0],X=$[1],Q=$[2];if(Z>>4===X>>4&&X>>4===Q>>4){if(Z<8)return 16;if(Z>248)return 231;return Math.round((Z-8)/247*24)+232}return 16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};W0.ansi16.rgb=function($){$=$[0];let Z=$%10;if(Z===0||Z===7){if($>50)Z+=3.5;return Z=Z/10.5*255,[Z,Z,Z]}let X=(Math.trunc($>50)+1)*0.5,Q=(Z&1)*X*255,J=(Z>>1&1)*X*255,G=(Z>>2&1)*X*255;return[Q,J,G]};W0.ansi256.rgb=function($){if($=$[0],$>=232){let G=($-232)*10+8;return[G,G,G]}$-=16;let Z,X=Math.floor($/36)/5*255,Q=Math.floor((Z=$%36)/6)/5*255,J=Z%6/5*255;return[X,Q,J]};W0.rgb.hex=function($){let X=(((Math.round($[0])&255)<<16)+((Math.round($[1])&255)<<8)+(Math.round($[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};W0.hex.rgb=function($){let Z=$.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!Z)return[0,0,0];let X=Z[0];if(Z[0].length===3)X=[...X].map((Y)=>Y+Y).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,W=Q&255;return[J,G,W]};W0.rgb.hcg=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.max(Math.max(Z,X),Q),G=Math.min(Math.min(Z,X),Q),W=J-G,Y,z=W<1?G/(1-W):0;if(W<=0)Y=0;else if(J===Z)Y=(X-Q)/W%6;else if(J===X)Y=2+(Q-Z)/W;else Y=4+(Z-X)/W;return Y/=6,Y%=1,[Y*360,W*100,z*100]};W0.hsl.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=X<0.5?2*Z*X:2*Z*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hsv.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=Z*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hcg.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=Z%1*6,W=G%1,Y=1-W,z=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=W,J[2]=0;break}case 1:{J[0]=Y,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=W;break}case 3:{J[0]=0,J[1]=Y,J[2]=1;break}case 4:{J[0]=W,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=Y}return z=(1-X)*Q,[(X*J[0]+z)*255,(X*J[1]+z)*255,(X*J[2]+z)*255]};W0.hcg.hsv=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z),J=0;if(Q>0)J=Z/Q;return[$[0],J*100,Q*100]};W0.hcg.hsl=function($){let Z=$[1]/100,Q=$[2]/100*(1-Z)+0.5*Z,J=0;if(Q>0&&Q<0.5)J=Z/(2*Q);else if(Q>=0.5&&Q<1)J=Z/(2*(1-Q));return[$[0],J*100,Q*100]};W0.hcg.hwb=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z);return[$[0],(Q-Z)*100,(1-Q)*100]};W0.hwb.hcg=function($){let Z=$[1]/100,Q=1-$[2]/100,J=Q-Z,G=0;if(J<1)G=(Q-J)/(1-J);return[$[0],J*100,G*100]};W0.apple.rgb=function($){return[$[0]/65535*255,$[1]/65535*255,$[2]/65535*255]};W0.rgb.apple=function($){return[$[0]/255*65535,$[1]/255*65535,$[2]/255*65535]};W0.gray.rgb=function($){return[$[0]/100*255,$[0]/100*255,$[0]/100*255]};W0.gray.hsl=function($){return[0,0,$[0]]};W0.gray.hsv=W0.gray.hsl;W0.gray.hwb=function($){return[0,100,$[0]]};W0.gray.cmyk=function($){return[0,0,0,$[0]]};W0.gray.lab=function($){return[$[0],0,0]};W0.gray.hex=function($){let Z=Math.round($[0]/100*255)&255,Q=((Z<<16)+(Z<<8)+Z).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};W0.rgb.gray=function($){return[($[0]+$[1]+$[2])/3/255*100]};function BE(){let $={},Z=Object.keys(X4);for(let{length:X}=Z,Q=0;Q<X;Q++)$[Z[Q]]={distance:-1,parent:null};return $}function FE($){let Z=BE(),X=[$];Z[$].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(X4[Q]);for(let{length:G}=J,W=0;W<G;W++){let Y=J[W],z=Z[Y];if(z.distance===-1)z.distance=Z[Q].distance+1,z.parent=Q,X.unshift(Y)}}return Z}function LE($,Z){return function(X){return Z($(X))}}function ME($,Z){let X=[Z[$].parent,$],Q=X4[Z[$].parent][$],J=Z[$].parent;while(Z[J].parent)X.unshift(Z[J].parent),Q=LE(X4[Z[J].parent][J],Q),J=Z[J].parent;return Q.conversion=X,Q}function AE($){let Z=FE($),X={},Q=Object.keys(Z);for(let{length:J}=Q,G=0;G<J;G++){let W=Q[G];if(Z[W].parent===null)continue;X[W]=ME(W,Z)}return X}var IE=AE,f4={},NE=Object.keys(X4);function DE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return $(X)};if("conversion"in $)Z.conversion=$.conversion;return Z}function wE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=$(X);if(typeof J==="object")for(let{length:G}=J,W=0;W<G;W++)J[W]=Math.round(J[W]);return J};if("conversion"in $)Z.conversion=$.conversion;return Z}for(let $ of NE){f4[$]={},Object.defineProperty(f4[$],"channels",{value:X4[$].channels}),Object.defineProperty(f4[$],"labels",{value:X4[$].labels});let Z=IE($),X=Object.keys(Z);for(let Q of X){let J=Z[Q];f4[$][Q]=wE(J),f4[$][Q].raw=DE(J)}}var i$=f4,BU=["keyword","gray","hex"],fX={};for(let $ of Object.keys(i$))fX[[...i$[$].labels].sort().join("")]=$;var hX={};function J$($,Z){if(!(this instanceof J$))return new J$($,Z);if(Z&&Z in BU)Z=null;if(Z&&!(Z in i$))throw Error("Unknown model: "+Z);let X,Q;if($==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if($ instanceof J$)this.model=$.model,this.color=[...$.color],this.valpha=$.valpha;else if(typeof $==="string"){let J=g4.get($);if(J===null)throw Error("Unable to parse color from string: "+$);this.model=J.model,Q=i$[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if($.length>0){this.model=Z||"rgb",Q=i$[this.model].channels;let J=Array.prototype.slice.call($,0,Q);this.color=uX(J,Q),this.valpha=typeof $[Q]==="number"?$[Q]:1}else if(typeof $==="number")this.model="rgb",this.color=[$>>16&255,$>>8&255,$&255],this.valpha=1;else{this.valpha=1;let J=Object.keys($);if("alpha"in $)J.splice(J.indexOf("alpha"),1),this.valpha=typeof $.alpha==="number"?$.alpha:0;let G=J.sort().join("");if(!(G in fX))throw Error("Unable to parse color from object: "+JSON.stringify($));this.model=fX[G];let{labels:W}=i$[this.model],Y=[];for(X=0;X<W.length;X++)Y.push($[W[X]]);this.color=uX(Y)}if(hX[this.model]){Q=i$[this.model].channels;for(X=0;X<Q;X++){let J=hX[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}J$.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string($){let Z=this.model in g4.to?this:this.rgb();Z=Z.round(typeof $==="number"?$:1);let X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return g4.to[Z.model](...X)},percentString($){let Z=this.rgb().round(typeof $==="number"?$:1),X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return g4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let $={},{channels:Z}=i$[this.model],{labels:X}=i$[this.model];for(let Q=0;Q<Z;Q++)$[X[Q]]=this.color[Q];if(this.valpha!==1)$.alpha=this.valpha;return $},unitArray(){let $=this.rgb().color;if($[0]/=255,$[1]/=255,$[2]/=255,this.valpha!==1)$.push(this.valpha);return $},unitObject(){let $=this.rgb().object();if($.r/=255,$.g/=255,$.b/=255,this.valpha!==1)$.alpha=this.valpha;return $},round($){return $=Math.max($||0,0),new J$([...this.color.map(jE($)),this.valpha],this.model)},alpha($){if($!==void 0)return new J$([...this.color,Math.max(0,Math.min(1,$))],this.model);return this.valpha},red:n0("rgb",0,Q$(255)),green:n0("rgb",1,Q$(255)),blue:n0("rgb",2,Q$(255)),hue:n0(["hsl","hsv","hsl","hwb","hcg"],0,($)=>($%360+360)%360),saturationl:n0("hsl",1,Q$(100)),lightness:n0("hsl",2,Q$(100)),saturationv:n0("hsv",1,Q$(100)),value:n0("hsv",2,Q$(100)),chroma:n0("hcg",1,Q$(100)),gray:n0("hcg",2,Q$(100)),white:n0("hwb",1,Q$(100)),wblack:n0("hwb",2,Q$(100)),cyan:n0("cmyk",0,Q$(100)),magenta:n0("cmyk",1,Q$(100)),yellow:n0("cmyk",2,Q$(100)),black:n0("cmyk",3,Q$(100)),x:n0("xyz",0,Q$(95.047)),y:n0("xyz",1,Q$(100)),z:n0("xyz",2,Q$(108.833)),l:n0("lab",0,Q$(100)),a:n0("lab",1),b:n0("lab",2),keyword($){if($!==void 0)return new J$($);return i$[this.model].keyword(this.color)},hex($){if($!==void 0)return new J$($);return g4.to.hex(...this.rgb().round().color)},hexa($){if($!==void 0)return new J$($);let Z=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return g4.to.hex(...Z)+X},rgbNumber(){let $=this.rgb().color;return($[0]&255)<<16|($[1]&255)<<8|$[2]&255},luminosity(){let $=this.rgb().color,Z=[];for(let[X,Q]of $.entries()){let J=Q/255;Z[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*Z[0]+0.7152*Z[1]+0.0722*Z[2]},contrast($){let Z=this.luminosity(),X=$.luminosity();if(Z>X)return(Z+0.05)/(X+0.05);return(X+0.05)/(Z+0.05)},level($){let Z=this.contrast($);if(Z>=7)return"AAA";return Z>=4.5?"AA":""},isDark(){let $=this.rgb().color;return($[0]*2126+$[1]*7152+$[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let $=this.rgb();for(let Z=0;Z<3;Z++)$.color[Z]=255-$.color[Z];return $},lighten($){let Z=this.hsl();return Z.color[2]+=Z.color[2]*$,Z},darken($){let Z=this.hsl();return Z.color[2]-=Z.color[2]*$,Z},saturate($){let Z=this.hsl();return Z.color[1]+=Z.color[1]*$,Z},desaturate($){let Z=this.hsl();return Z.color[1]-=Z.color[1]*$,Z},whiten($){let Z=this.hwb();return Z.color[1]+=Z.color[1]*$,Z},blacken($){let Z=this.hwb();return Z.color[2]+=Z.color[2]*$,Z},grayscale(){let $=this.rgb().color,Z=$[0]*0.3+$[1]*0.59+$[2]*0.11;return J$.rgb(Z,Z,Z)},fade($){return this.alpha(this.valpha-this.valpha*$)},opaquer($){return this.alpha(this.valpha+this.valpha*$)},rotate($){let Z=this.hsl(),X=Z.color[0];return X=(X+$)%360,X=X<0?360+X:X,Z.color[0]=X,Z},mix($,Z){if(!$||!$.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof $);let X=$.rgb(),Q=this.rgb(),J=Z===void 0?0.5:Z,G=2*J-1,W=X.alpha()-Q.alpha(),Y=((G*W===-1?G:(G+W)/(1+G*W))+1)/2,z=1-Y;return J$.rgb(Y*X.red()+z*Q.red(),Y*X.green()+z*Q.green(),Y*X.blue()+z*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let $ of Object.keys(i$)){if(BU.includes($))continue;let{channels:Z}=i$[$];J$.prototype[$]=function(...X){if(this.model===$)return new J$(this);if(X.length>0)return new J$(X,$);return new J$([...OE(i$[this.model][$].raw(this.color)),this.valpha],$)},J$[$]=function(...X){let Q=X[0];if(typeof Q==="number")Q=uX(X,Z);return new J$(Q,$)}}function TE($,Z){return Number($.toFixed(Z))}function jE($){return function(Z){return TE(Z,$)}}function n0($,Z,X){$=Array.isArray($)?$:[$];for(let Q of $)(hX[Q]||=[])[Z]=X;return $=$[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[$](),J.color[Z]=Q,J}if(J=this[$]().color[Z],X)J=X(J);return J}}function Q$($){return function(Z){return Math.max(0,Math.min($,Z))}}function OE($){return Array.isArray($)?$:[$]}function uX($,Z){for(let X=0;X<Z;X++)if(typeof $[X]!=="number")$[X]=0;return $}var EE=J$});var AU=b((wc,MU)=>{MU.exports=LU().default});function RE($){return this._setBackgroundColourOption("tint",$),this}function PE($){return this.options.greyscale=U.bool($)?$:!0,this}function CE($){return this.greyscale($)}function SE($){if(!U.string($))throw U.invalidParameterError("colourspace","string",$);return this.options.colourspacePipeline=$,this}function _E($){return this.pipelineColourspace($)}function bE($){if(!U.string($))throw U.invalidParameterError("colourspace","string",$);return this.options.colourspace=$,this}function xE($){return this.toColourspace($)}function DU($){if(U.object($)||U.string($)&&$.length>=3&&$.length<=200){let Z=NU.default($),X=Z.red(),Q=Z.green(),J=Z.blue(),G=Math.round(Z.alpha()*255);for(let[W,Y]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!U.number(Y))throw U.invalidParameterError(`background.${W}`,"number",Y);return[X,Q,J,G]}else throw U.invalidParameterError("background","object or string",$)}function kE($,Z){if(U.defined(Z))this.options[$]=DU(Z)}var NU,IU,wU=($)=>{Object.assign($.prototype,{tint:RE,greyscale:PE,grayscale:CE,pipelineColourspace:SE,pipelineColorspace:_E,toColourspace:bE,toColorspace:xE,_getBackgroundColourOption:DU,_setBackgroundColourOption:kE}),$.colourspace=IU,$.colorspace=IU};var TU=s(()=>{C1();NU=F$(AU(),1);/*!
310
308
  Copyright 2013 Lovell Fuller and others.
311
309
  SPDX-License-Identifier: Apache-2.0
312
- */tU={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function WE(){return this.options.removeAlpha=!0,this}function YE($){if(K.defined($))if(K.number($)&&K.inRange($,0,1))this.options.ensureAlpha=$;else throw K.invalidParameterError("alpha","number between 0 and 1",$);else this.options.ensureAlpha=1;return this}function zE($){let Z={red:0,green:1,blue:2,alpha:3};if(Object.keys(Z).includes($))$=Z[$];if(K.integer($)&&K.inRange($,0,4))this.options.extractChannel=$;else throw K.invalidParameterError("channel","integer or one of: red, green, blue, alpha",$);return this}function qE($,Z){if(Array.isArray($))$.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,Z))},this);else this.options.joinChannelIn.push(this._createInputDescriptor($,Z));return this}function UE($){if(K.string($)&&K.inArray($,["and","or","eor"]))this.options.bandBoolOp=$;else throw K.invalidParameterError("boolOp","one of: and, or, eor",$);return this}var GE,QK=($)=>{Object.assign($.prototype,{removeAlpha:WE,ensureAlpha:YE,extractChannel:zE,joinChannel:qE,bandbool:UE}),$.bool=GE};var JK=t(()=>{R6();/*!
310
+ */IU={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function vE(){return this.options.removeAlpha=!0,this}function gE($){if(U.defined($))if(U.number($)&&U.inRange($,0,1))this.options.ensureAlpha=$;else throw U.invalidParameterError("alpha","number between 0 and 1",$);else this.options.ensureAlpha=1;return this}function fE($){let Z={red:0,green:1,blue:2,alpha:3};if(Object.keys(Z).includes($))$=Z[$];if(U.integer($)&&U.inRange($,0,4))this.options.extractChannel=$;else throw U.invalidParameterError("channel","integer or one of: red, green, blue, alpha",$);return this}function hE($,Z){if(Array.isArray($))$.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,Z))},this);else this.options.joinChannelIn.push(this._createInputDescriptor($,Z));return this}function uE($){if(U.string($)&&U.inArray($,["and","or","eor"]))this.options.bandBoolOp=$;else throw U.invalidParameterError("boolOp","one of: and, or, eor",$);return this}var yE,jU=($)=>{Object.assign($.prototype,{removeAlpha:vE,ensureAlpha:gE,extractChannel:fE,joinChannel:hE,bandbool:uE}),$.bool=yE};var OU=s(()=>{C1();/*!
313
311
  Copyright 2013 Lovell Fuller and others.
314
312
  SPDX-License-Identifier: Apache-2.0
315
- */GE={and:"and",or:"or",eor:"eor"}});import CX from"node:path";function HE($,Z){let X;if(!K.string($))X=Error("Missing output file path");else if(K.string(this.options.input.file)&&CX.resolve(this.options.input.file)===CX.resolve($))X=Error("Cannot use same file for input and output");else if(KE.test(CX.extname($))&&!this.constructor.format.jp2.output.file)X=WK();if(X)if(K.fn(Z))Z(X);else return Promise.reject(X);else{this.options.fileOut=$;let Q=Error();return this._pipeline(Z,Q)}return this}function VE($,Z){if(K.object($))this._setBooleanOption("resolveWithObject",$.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(K.fn($)?$:Z,X)}function BE(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let $=Error();return this._pipeline(null,$)}function FE($){if(K.number($)&&$>0)this.options.withMetadataDensity=$;else throw K.invalidParameterError("density","positive number",$);return this.keepExif()}function LE(){return this.options.keepMetadata|=1,this}function ME($){if(K.object($))for(let[Z,X]of Object.entries($))if(K.object(X))for(let[Q,J]of Object.entries(X))if(K.string(J))this.options.withExif[`exif-${Z.toLowerCase()}-${Q}`]=J;else throw K.invalidParameterError(`${Z}.${Q}`,"string",J);else throw K.invalidParameterError(Z,"object",X);else throw K.invalidParameterError("exif","object",$);return this.options.withExifMerge=!1,this.keepExif()}function AE($){return this.withExif($),this.options.withExifMerge=!0,this}function IE(){return this.options.keepMetadata|=8,this}function NE($,Z){if(K.string($))this.options.withIccProfile=$;else throw K.invalidParameterError("icc","string",$);if(this.keepIccProfile(),K.object(Z)){if(K.defined(Z.attach))if(K.bool(Z.attach)){if(!Z.attach)this.options.keepMetadata&=-9}else throw K.invalidParameterError("attach","boolean",Z.attach)}return this}function DE(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function wE(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function TE(){return this.options.keepMetadata|=2,this}function jE($){if(K.string($)&&$.length>0)this.options.withXmp=$,this.options.keepMetadata|=2;else throw K.invalidParameterError("xmp","non-empty string",$);return this}function OE(){return this.options.keepMetadata|=31,this}function EE($){if(this.keepMetadata(),this.withIccProfile("srgb"),K.object($)){if(K.defined($.orientation))if(K.integer($.orientation)&&K.inRange($.orientation,1,8))this.options.withMetadataOrientation=$.orientation;else throw K.invalidParameterError("orientation","integer between 1 and 8",$.orientation);if(K.defined($.density))if(K.number($.density)&&$.density>0)this.options.withMetadataDensity=$.density;else throw K.invalidParameterError("density","positive number",$.density);if(K.defined($.icc))this.withIccProfile($.icc);if(K.defined($.exif))this.withExifMerge($.exif)}return this}function RE($,Z){let X=GK.get((K.object($)&&K.string($.id)?$.id:$).toLowerCase());if(!X)throw K.invalidParameterError("format",`one of: ${[...GK.keys()].join(", ")}`,$);return this[X](Z)}function PE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jpegQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.progressive))this._setBooleanOption("jpegProgressive",$.progressive);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);let Z=K.bool($.optimizeCoding)?$.optimizeCoding:$.optimiseCoding;if(K.defined(Z))this._setBooleanOption("jpegOptimiseCoding",Z);if(K.defined($.mozjpeg))if(K.bool($.mozjpeg)){if($.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw K.invalidParameterError("mozjpeg","boolean",$.mozjpeg);let X=K.bool($.trellisQuantization)?$.trellisQuantization:$.trellisQuantisation;if(K.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(K.defined($.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",$.overshootDeringing);let Q=K.bool($.optimizeScans)?$.optimizeScans:$.optimiseScans;if(K.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=K.number($.quantizationTable)?$.quantizationTable:$.quantisationTable;if(K.defined(J))if(K.integer(J)&&K.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw K.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",$)}function CE($){if(K.object($)){if(K.defined($.progressive))this._setBooleanOption("pngProgressive",$.progressive);if(K.defined($.compressionLevel))if(K.integer($.compressionLevel)&&K.inRange($.compressionLevel,0,9))this.options.pngCompressionLevel=$.compressionLevel;else throw K.invalidParameterError("compressionLevel","integer between 0 and 9",$.compressionLevel);if(K.defined($.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",$.adaptiveFiltering);let Z=$.colours||$.colors;if(K.defined(Z))if(K.integer(Z)&&K.inRange(Z,2,256))this.options.pngBitdepth=YK(Z);else throw K.invalidParameterError("colours","integer between 2 and 256",Z);if(K.defined($.palette))this._setBooleanOption("pngPalette",$.palette);else if([$.quality,$.effort,$.colours,$.colors,$.dither].some(K.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,0,100))this.options.pngQuality=$.quality;else throw K.invalidParameterError("quality","integer between 0 and 100",$.quality);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,10))this.options.pngEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",$.effort);if(K.defined($.dither))if(K.number($.dither)&&K.inRange($.dither,0,1))this.options.pngDither=$.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",$.dither)}}return this._updateFormatOut("png",$)}function SE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.webpQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.alphaQuality))if(K.integer($.alphaQuality)&&K.inRange($.alphaQuality,0,100))this.options.webpAlphaQuality=$.alphaQuality;else throw K.invalidParameterError("alphaQuality","integer between 0 and 100",$.alphaQuality);if(K.defined($.lossless))this._setBooleanOption("webpLossless",$.lossless);if(K.defined($.nearLossless))this._setBooleanOption("webpNearLossless",$.nearLossless);if(K.defined($.smartSubsample))this._setBooleanOption("webpSmartSubsample",$.smartSubsample);if(K.defined($.smartDeblock))this._setBooleanOption("webpSmartDeblock",$.smartDeblock);if(K.defined($.preset))if(K.string($.preset)&&K.inArray($.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=$.preset;else throw K.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",$.preset);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,0,6))this.options.webpEffort=$.effort;else throw K.invalidParameterError("effort","integer between 0 and 6",$.effort);if(K.defined($.minSize))this._setBooleanOption("webpMinSize",$.minSize);if(K.defined($.mixed))this._setBooleanOption("webpMixed",$.mixed);if(K.defined($.exact))this._setBooleanOption("webpExact",$.exact)}return SX($,this.options),this._updateFormatOut("webp",$)}function _E($){if(K.object($)){if(K.defined($.reuse))this._setBooleanOption("gifReuse",$.reuse);if(K.defined($.progressive))this._setBooleanOption("gifProgressive",$.progressive);let Z=$.colours||$.colors;if(K.defined(Z))if(K.integer(Z)&&K.inRange(Z,2,256))this.options.gifBitdepth=YK(Z);else throw K.invalidParameterError("colours","integer between 2 and 256",Z);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,10))this.options.gifEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",$.effort);if(K.defined($.dither))if(K.number($.dither)&&K.inRange($.dither,0,1))this.options.gifDither=$.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",$.dither);if(K.defined($.interFrameMaxError))if(K.number($.interFrameMaxError)&&K.inRange($.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=$.interFrameMaxError;else throw K.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",$.interFrameMaxError);if(K.defined($.interPaletteMaxError))if(K.number($.interPaletteMaxError)&&K.inRange($.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=$.interPaletteMaxError;else throw K.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",$.interPaletteMaxError);if(K.defined($.keepDuplicateFrames))if(K.bool($.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",$.keepDuplicateFrames);else throw K.invalidParameterError("keepDuplicateFrames","boolean",$.keepDuplicateFrames)}return SX($,this.options),this._updateFormatOut("gif",$)}function xE($){if(!this.constructor.format.jp2.output.buffer)throw WK();if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jp2Quality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.lossless))if(K.bool($.lossless))this.options.jp2Lossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.tileWidth))if(K.integer($.tileWidth)&&K.inRange($.tileWidth,1,32768))this.options.jp2TileWidth=$.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(K.defined($.tileHeight))if(K.integer($.tileHeight)&&K.inRange($.tileHeight,1,32768))this.options.jp2TileHeight=$.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling)}return this._updateFormatOut("jp2",$)}function SX($,Z){if(K.object($)&&K.defined($.loop))if(K.integer($.loop)&&K.inRange($.loop,0,65535))Z.loop=$.loop;else throw K.invalidParameterError("loop","integer between 0 and 65535",$.loop);if(K.object($)&&K.defined($.delay))if(K.integer($.delay)&&K.inRange($.delay,0,65535))Z.delay=[$.delay];else if(Array.isArray($.delay)&&$.delay.every(K.integer)&&$.delay.every((X)=>K.inRange(X,0,65535)))Z.delay=$.delay;else throw K.invalidParameterError("delay","integer or an array of integers between 0 and 65535",$.delay)}function bE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.tiffQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.bitdepth))if(K.integer($.bitdepth)&&K.inArray($.bitdepth,[1,2,4]))this.options.tiffBitdepth=$.bitdepth;else throw K.invalidParameterError("bitdepth","1, 2 or 4",$.bitdepth);if(K.defined($.tile))this._setBooleanOption("tiffTile",$.tile);if(K.defined($.tileWidth))if(K.integer($.tileWidth)&&K.inRange($.tileWidth,1,32768))this.options.tiffTileWidth=$.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(K.defined($.tileHeight))if(K.integer($.tileHeight)&&K.inRange($.tileHeight,1,32768))this.options.tiffTileHeight=$.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(K.defined($.miniswhite))this._setBooleanOption("tiffMiniswhite",$.miniswhite);if(K.defined($.pyramid))this._setBooleanOption("tiffPyramid",$.pyramid);if(K.defined($.xres))if(K.number($.xres)&&K.inRange($.xres,0.001,1e6))this.options.tiffXres=$.xres;else throw K.invalidParameterError("xres","number between 0.001 and 1000000",$.xres);if(K.defined($.yres))if(K.number($.yres)&&K.inRange($.yres,0.001,1e6))this.options.tiffYres=$.yres;else throw K.invalidParameterError("yres","number between 0.001 and 1000000",$.yres);if(K.defined($.compression))if(K.string($.compression)&&K.inArray($.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=$.compression;else throw K.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",$.compression);if(K.defined($.bigtiff))this._setBooleanOption("tiffBigtiff",$.bigtiff);if(K.defined($.predictor))if(K.string($.predictor)&&K.inArray($.predictor,["none","horizontal","float"]))this.options.tiffPredictor=$.predictor;else throw K.invalidParameterError("predictor","one of: none, horizontal, float",$.predictor);if(K.defined($.resolutionUnit))if(K.string($.resolutionUnit)&&K.inArray($.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=$.resolutionUnit;else throw K.invalidParameterError("resolutionUnit","one of: inch, cm",$.resolutionUnit)}return this._updateFormatOut("tiff",$)}function kE($){return this.heif({...$,compression:"av1"})}function yE($){if(K.object($)){if(K.string($.compression)&&K.inArray($.compression,["av1","hevc"]))this.options.heifCompression=$.compression;else throw K.invalidParameterError("compression","one of: av1, hevc",$.compression);if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.heifQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.lossless))if(K.bool($.lossless))this.options.heifLossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,0,9))this.options.heifEffort=$.effort;else throw K.invalidParameterError("effort","integer between 0 and 9",$.effort);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);if(K.defined($.bitdepth))if(K.integer($.bitdepth)&&K.inArray($.bitdepth,[8,10,12]))this.options.heifBitdepth=$.bitdepth;else throw K.invalidParameterError("bitdepth","8, 10 or 12",$.bitdepth);if(K.defined($.tune))if(K.string($.tune)&&K.inArray($.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&$.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=$.tune;else throw K.invalidParameterError("tune","one of: auto, iq, psnr, ssim",$.tune)}else throw K.invalidParameterError("options","Object",$);return this._updateFormatOut("heif",$)}function vE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jxlDistance=$.quality>=30?0.1+(100-$.quality)*0.09:0.017666666666666667*$.quality*$.quality-1.15*$.quality+25;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);else if(K.defined($.distance))if(K.number($.distance)&&K.inRange($.distance,0,15))this.options.jxlDistance=$.distance;else throw K.invalidParameterError("distance","number between 0.0 and 15.0",$.distance);if(K.defined($.decodingTier))if(K.integer($.decodingTier)&&K.inRange($.decodingTier,0,4))this.options.jxlDecodingTier=$.decodingTier;else throw K.invalidParameterError("decodingTier","integer between 0 and 4",$.decodingTier);if(K.defined($.lossless))if(K.bool($.lossless))this.options.jxlLossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,9))this.options.jxlEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 9",$.effort)}return SX($,this.options),this._updateFormatOut("jxl",$)}function gE($){if(K.object($)){if(K.defined($.depth))if(K.string($.depth)&&K.inArray($.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=$.depth;else throw K.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",$.depth)}return this._updateFormatOut("raw")}function fE($){if(K.object($)){if(K.defined($.size))if(K.integer($.size)&&K.inRange($.size,1,8192))this.options.tileSize=$.size;else throw K.invalidParameterError("size","integer between 1 and 8192",$.size);if(K.defined($.overlap))if(K.integer($.overlap)&&K.inRange($.overlap,0,8192)){if($.overlap>this.options.tileSize)throw K.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,$.overlap);this.options.tileOverlap=$.overlap}else throw K.invalidParameterError("overlap","integer between 0 and 8192",$.overlap);if(K.defined($.container))if(K.string($.container)&&K.inArray($.container,["fs","zip"]))this.options.tileContainer=$.container;else throw K.invalidParameterError("container","one of: fs, zip",$.container);if(K.defined($.layout))if(K.string($.layout)&&K.inArray($.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=$.layout;else throw K.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",$.layout);if(K.defined($.angle))if(K.integer($.angle)&&!($.angle%90))this.options.tileAngle=$.angle;else throw K.invalidParameterError("angle","positive/negative multiple of 90",$.angle);if(this._setBackgroundColourOption("tileBackground",$.background),K.defined($.depth))if(K.string($.depth)&&K.inArray($.depth,["onepixel","onetile","one"]))this.options.tileDepth=$.depth;else throw K.invalidParameterError("depth","one of: onepixel, onetile, one",$.depth);if(K.defined($.skipBlanks))if(K.integer($.skipBlanks)&&K.inRange($.skipBlanks,-1,65535))this.options.tileSkipBlanks=$.skipBlanks;else throw K.invalidParameterError("skipBlanks","integer between -1 and 255/65535",$.skipBlanks);else if(K.defined($.layout)&&$.layout==="google")this.options.tileSkipBlanks=5;let Z=K.bool($.center)?$.center:$.centre;if(K.defined(Z))this._setBooleanOption("tileCentre",Z);if(K.defined($.id))if(K.string($.id))this.options.tileId=$.id;else throw K.invalidParameterError("id","string",$.id);if(K.defined($.basename))if(K.string($.basename))this.options.tileBasename=$.basename;else throw K.invalidParameterError("basename","string",$.basename)}if(K.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw K.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function hE($){if(!K.plainObject($))throw K.invalidParameterError("options","object",$);if(K.integer($.seconds)&&K.inRange($.seconds,0,3600))this.options.timeoutSeconds=$.seconds;else throw K.invalidParameterError("seconds","integer between 0 and 3600",$.seconds);return this}function uE($,Z){if(!(K.object(Z)&&Z.force===!1))this.options.formatOut=$;return this}function mE($,Z){if(K.bool(Z))this.options[$]=Z;else throw K.invalidParameterError($,"boolean",Z)}function dE(){if(!this.options.streamOut){this.options.streamOut=!0;let $=Error();this._pipeline(void 0,$)}}function lE($,Z){if(typeof $==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),_0.pipeline(this.options,(X,Q,J)=>{if(X)$(K.nativeError(X,Z));else $(null,Q,J)})});else _0.pipeline(this.options,(X,Q,J)=>{if(X)$(K.nativeError(X,Z));else $(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),_0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",K.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else _0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",K.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),_0.pipeline(this.options,(J,G,W)=>{if(J)Q(K.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})});else return new Promise((X,Q)=>{_0.pipeline(this.options,(J,G,W)=>{if(J)Q(K.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})}var GK,KE,WK=()=>Error("JP2 output requires libvips with support for OpenJPEG"),YK=($)=>1<<31-Math.clz32(Math.ceil(Math.log2($))),zK=($)=>{Object.assign($.prototype,{toFile:HE,toBuffer:VE,toUint8Array:BE,withDensity:FE,keepExif:LE,withExif:ME,withExifMerge:AE,keepIccProfile:IE,withIccProfile:NE,keepGainMap:DE,withGainMap:wE,keepXmp:TE,withXmp:jE,keepMetadata:OE,withMetadata:EE,toFormat:RE,jpeg:PE,jp2:xE,png:CE,webp:SE,tiff:bE,avif:kE,heif:yE,jxl:vE,gif:_E,raw:gE,tile:fE,timeout:hE,_updateFormatOut:uE,_setBooleanOption:mE,_read:dE,_pipeline:lE})};var qK=t(()=>{R6();y9();/*!
313
+ */yE={and:"and",or:"or",eor:"eor"}});import dX from"node:path";function dE($,Z){let X;if(!U.string($))X=Error("Missing output file path");else if(U.string(this.options.input.file)&&dX.resolve(this.options.input.file)===dX.resolve($))X=Error("Cannot use same file for input and output");else if(mE.test(dX.extname($))&&!this.constructor.format.jp2.output.file)X=RU();if(X)if(U.fn(Z))Z(X);else return Promise.reject(X);else{this.options.fileOut=$;let Q=Error();return this._pipeline(Z,Q)}return this}function lE($,Z){if(U.object($))this._setBooleanOption("resolveWithObject",$.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(U.fn($)?$:Z,X)}function cE(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let $=Error();return this._pipeline(null,$)}function pE($){if(U.number($)&&$>0)this.options.withMetadataDensity=$;else throw U.invalidParameterError("density","positive number",$);return this.keepExif()}function iE(){return this.options.keepMetadata|=1,this}function nE($){if(U.object($))for(let[Z,X]of Object.entries($))if(U.object(X))for(let[Q,J]of Object.entries(X))if(U.string(J))this.options.withExif[`exif-${Z.toLowerCase()}-${Q}`]=J;else throw U.invalidParameterError(`${Z}.${Q}`,"string",J);else throw U.invalidParameterError(Z,"object",X);else throw U.invalidParameterError("exif","object",$);return this.options.withExifMerge=!1,this.keepExif()}function rE($){return this.withExif($),this.options.withExifMerge=!0,this}function aE(){return this.options.keepMetadata|=8,this}function oE($,Z){if(U.string($))this.options.withIccProfile=$;else throw U.invalidParameterError("icc","string",$);if(this.keepIccProfile(),U.object(Z)){if(U.defined(Z.attach))if(U.bool(Z.attach)){if(!Z.attach)this.options.keepMetadata&=-9}else throw U.invalidParameterError("attach","boolean",Z.attach)}return this}function sE(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function tE(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function eE(){return this.options.keepMetadata|=2,this}function $R($){if(U.string($)&&$.length>0)this.options.withXmp=$,this.options.keepMetadata|=2;else throw U.invalidParameterError("xmp","non-empty string",$);return this}function ZR(){return this.options.keepMetadata|=31,this}function XR($){if(this.keepMetadata(),this.withIccProfile("srgb"),U.object($)){if(U.defined($.orientation))if(U.integer($.orientation)&&U.inRange($.orientation,1,8))this.options.withMetadataOrientation=$.orientation;else throw U.invalidParameterError("orientation","integer between 1 and 8",$.orientation);if(U.defined($.density))if(U.number($.density)&&$.density>0)this.options.withMetadataDensity=$.density;else throw U.invalidParameterError("density","positive number",$.density);if(U.defined($.icc))this.withIccProfile($.icc);if(U.defined($.exif))this.withExifMerge($.exif)}return this}function QR($,Z){let X=EU.get((U.object($)&&U.string($.id)?$.id:$).toLowerCase());if(!X)throw U.invalidParameterError("format",`one of: ${[...EU.keys()].join(", ")}`,$);return this[X](Z)}function JR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jpegQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.progressive))this._setBooleanOption("jpegProgressive",$.progressive);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);let Z=U.bool($.optimizeCoding)?$.optimizeCoding:$.optimiseCoding;if(U.defined(Z))this._setBooleanOption("jpegOptimiseCoding",Z);if(U.defined($.mozjpeg))if(U.bool($.mozjpeg)){if($.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw U.invalidParameterError("mozjpeg","boolean",$.mozjpeg);let X=U.bool($.trellisQuantization)?$.trellisQuantization:$.trellisQuantisation;if(U.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(U.defined($.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",$.overshootDeringing);let Q=U.bool($.optimizeScans)?$.optimizeScans:$.optimiseScans;if(U.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=U.number($.quantizationTable)?$.quantizationTable:$.quantisationTable;if(U.defined(J))if(U.integer(J)&&U.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw U.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",$)}function GR($){if(U.object($)){if(U.defined($.progressive))this._setBooleanOption("pngProgressive",$.progressive);if(U.defined($.compressionLevel))if(U.integer($.compressionLevel)&&U.inRange($.compressionLevel,0,9))this.options.pngCompressionLevel=$.compressionLevel;else throw U.invalidParameterError("compressionLevel","integer between 0 and 9",$.compressionLevel);if(U.defined($.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",$.adaptiveFiltering);let Z=$.colours||$.colors;if(U.defined(Z))if(U.integer(Z)&&U.inRange(Z,2,256))this.options.pngBitdepth=PU(Z);else throw U.invalidParameterError("colours","integer between 2 and 256",Z);if(U.defined($.palette))this._setBooleanOption("pngPalette",$.palette);else if([$.quality,$.effort,$.colours,$.colors,$.dither].some(U.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,0,100))this.options.pngQuality=$.quality;else throw U.invalidParameterError("quality","integer between 0 and 100",$.quality);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,10))this.options.pngEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 10",$.effort);if(U.defined($.dither))if(U.number($.dither)&&U.inRange($.dither,0,1))this.options.pngDither=$.dither;else throw U.invalidParameterError("dither","number between 0.0 and 1.0",$.dither)}}return this._updateFormatOut("png",$)}function WR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.webpQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.alphaQuality))if(U.integer($.alphaQuality)&&U.inRange($.alphaQuality,0,100))this.options.webpAlphaQuality=$.alphaQuality;else throw U.invalidParameterError("alphaQuality","integer between 0 and 100",$.alphaQuality);if(U.defined($.lossless))this._setBooleanOption("webpLossless",$.lossless);if(U.defined($.nearLossless))this._setBooleanOption("webpNearLossless",$.nearLossless);if(U.defined($.smartSubsample))this._setBooleanOption("webpSmartSubsample",$.smartSubsample);if(U.defined($.smartDeblock))this._setBooleanOption("webpSmartDeblock",$.smartDeblock);if(U.defined($.preset))if(U.string($.preset)&&U.inArray($.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=$.preset;else throw U.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",$.preset);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,0,6))this.options.webpEffort=$.effort;else throw U.invalidParameterError("effort","integer between 0 and 6",$.effort);if(U.defined($.minSize))this._setBooleanOption("webpMinSize",$.minSize);if(U.defined($.mixed))this._setBooleanOption("webpMixed",$.mixed);if(U.defined($.exact))this._setBooleanOption("webpExact",$.exact)}return lX($,this.options),this._updateFormatOut("webp",$)}function YR($){if(U.object($)){if(U.defined($.reuse))this._setBooleanOption("gifReuse",$.reuse);if(U.defined($.progressive))this._setBooleanOption("gifProgressive",$.progressive);let Z=$.colours||$.colors;if(U.defined(Z))if(U.integer(Z)&&U.inRange(Z,2,256))this.options.gifBitdepth=PU(Z);else throw U.invalidParameterError("colours","integer between 2 and 256",Z);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,10))this.options.gifEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 10",$.effort);if(U.defined($.dither))if(U.number($.dither)&&U.inRange($.dither,0,1))this.options.gifDither=$.dither;else throw U.invalidParameterError("dither","number between 0.0 and 1.0",$.dither);if(U.defined($.interFrameMaxError))if(U.number($.interFrameMaxError)&&U.inRange($.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=$.interFrameMaxError;else throw U.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",$.interFrameMaxError);if(U.defined($.interPaletteMaxError))if(U.number($.interPaletteMaxError)&&U.inRange($.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=$.interPaletteMaxError;else throw U.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",$.interPaletteMaxError);if(U.defined($.keepDuplicateFrames))if(U.bool($.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",$.keepDuplicateFrames);else throw U.invalidParameterError("keepDuplicateFrames","boolean",$.keepDuplicateFrames)}return lX($,this.options),this._updateFormatOut("gif",$)}function zR($){if(!this.constructor.format.jp2.output.buffer)throw RU();if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jp2Quality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.lossless))if(U.bool($.lossless))this.options.jp2Lossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.tileWidth))if(U.integer($.tileWidth)&&U.inRange($.tileWidth,1,32768))this.options.jp2TileWidth=$.tileWidth;else throw U.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(U.defined($.tileHeight))if(U.integer($.tileHeight)&&U.inRange($.tileHeight,1,32768))this.options.jp2TileHeight=$.tileHeight;else throw U.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling)}return this._updateFormatOut("jp2",$)}function lX($,Z){if(U.object($)&&U.defined($.loop))if(U.integer($.loop)&&U.inRange($.loop,0,65535))Z.loop=$.loop;else throw U.invalidParameterError("loop","integer between 0 and 65535",$.loop);if(U.object($)&&U.defined($.delay))if(U.integer($.delay)&&U.inRange($.delay,0,65535))Z.delay=[$.delay];else if(Array.isArray($.delay)&&$.delay.every(U.integer)&&$.delay.every((X)=>U.inRange(X,0,65535)))Z.delay=$.delay;else throw U.invalidParameterError("delay","integer or an array of integers between 0 and 65535",$.delay)}function qR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.tiffQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.bitdepth))if(U.integer($.bitdepth)&&U.inArray($.bitdepth,[1,2,4]))this.options.tiffBitdepth=$.bitdepth;else throw U.invalidParameterError("bitdepth","1, 2 or 4",$.bitdepth);if(U.defined($.tile))this._setBooleanOption("tiffTile",$.tile);if(U.defined($.tileWidth))if(U.integer($.tileWidth)&&U.inRange($.tileWidth,1,32768))this.options.tiffTileWidth=$.tileWidth;else throw U.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(U.defined($.tileHeight))if(U.integer($.tileHeight)&&U.inRange($.tileHeight,1,32768))this.options.tiffTileHeight=$.tileHeight;else throw U.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(U.defined($.miniswhite))this._setBooleanOption("tiffMiniswhite",$.miniswhite);if(U.defined($.pyramid))this._setBooleanOption("tiffPyramid",$.pyramid);if(U.defined($.xres))if(U.number($.xres)&&U.inRange($.xres,0.001,1e6))this.options.tiffXres=$.xres;else throw U.invalidParameterError("xres","number between 0.001 and 1000000",$.xres);if(U.defined($.yres))if(U.number($.yres)&&U.inRange($.yres,0.001,1e6))this.options.tiffYres=$.yres;else throw U.invalidParameterError("yres","number between 0.001 and 1000000",$.yres);if(U.defined($.compression))if(U.string($.compression)&&U.inArray($.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=$.compression;else throw U.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",$.compression);if(U.defined($.bigtiff))this._setBooleanOption("tiffBigtiff",$.bigtiff);if(U.defined($.predictor))if(U.string($.predictor)&&U.inArray($.predictor,["none","horizontal","float"]))this.options.tiffPredictor=$.predictor;else throw U.invalidParameterError("predictor","one of: none, horizontal, float",$.predictor);if(U.defined($.resolutionUnit))if(U.string($.resolutionUnit)&&U.inArray($.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=$.resolutionUnit;else throw U.invalidParameterError("resolutionUnit","one of: inch, cm",$.resolutionUnit)}return this._updateFormatOut("tiff",$)}function KR($){return this.heif({...$,compression:"av1"})}function UR($){if(U.object($)){if(U.string($.compression)&&U.inArray($.compression,["av1","hevc"]))this.options.heifCompression=$.compression;else throw U.invalidParameterError("compression","one of: av1, hevc",$.compression);if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.heifQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.lossless))if(U.bool($.lossless))this.options.heifLossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,0,9))this.options.heifEffort=$.effort;else throw U.invalidParameterError("effort","integer between 0 and 9",$.effort);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);if(U.defined($.bitdepth))if(U.integer($.bitdepth)&&U.inArray($.bitdepth,[8,10,12]))this.options.heifBitdepth=$.bitdepth;else throw U.invalidParameterError("bitdepth","8, 10 or 12",$.bitdepth);if(U.defined($.tune))if(U.string($.tune)&&U.inArray($.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&$.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=$.tune;else throw U.invalidParameterError("tune","one of: auto, iq, psnr, ssim",$.tune)}else throw U.invalidParameterError("options","Object",$);return this._updateFormatOut("heif",$)}function HR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jxlDistance=$.quality>=30?0.1+(100-$.quality)*0.09:0.017666666666666667*$.quality*$.quality-1.15*$.quality+25;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);else if(U.defined($.distance))if(U.number($.distance)&&U.inRange($.distance,0,15))this.options.jxlDistance=$.distance;else throw U.invalidParameterError("distance","number between 0.0 and 15.0",$.distance);if(U.defined($.decodingTier))if(U.integer($.decodingTier)&&U.inRange($.decodingTier,0,4))this.options.jxlDecodingTier=$.decodingTier;else throw U.invalidParameterError("decodingTier","integer between 0 and 4",$.decodingTier);if(U.defined($.lossless))if(U.bool($.lossless))this.options.jxlLossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,9))this.options.jxlEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 9",$.effort)}return lX($,this.options),this._updateFormatOut("jxl",$)}function VR($){if(U.object($)){if(U.defined($.depth))if(U.string($.depth)&&U.inArray($.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=$.depth;else throw U.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",$.depth)}return this._updateFormatOut("raw")}function BR($){if(U.object($)){if(U.defined($.size))if(U.integer($.size)&&U.inRange($.size,1,8192))this.options.tileSize=$.size;else throw U.invalidParameterError("size","integer between 1 and 8192",$.size);if(U.defined($.overlap))if(U.integer($.overlap)&&U.inRange($.overlap,0,8192)){if($.overlap>this.options.tileSize)throw U.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,$.overlap);this.options.tileOverlap=$.overlap}else throw U.invalidParameterError("overlap","integer between 0 and 8192",$.overlap);if(U.defined($.container))if(U.string($.container)&&U.inArray($.container,["fs","zip"]))this.options.tileContainer=$.container;else throw U.invalidParameterError("container","one of: fs, zip",$.container);if(U.defined($.layout))if(U.string($.layout)&&U.inArray($.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=$.layout;else throw U.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",$.layout);if(U.defined($.angle))if(U.integer($.angle)&&!($.angle%90))this.options.tileAngle=$.angle;else throw U.invalidParameterError("angle","positive/negative multiple of 90",$.angle);if(this._setBackgroundColourOption("tileBackground",$.background),U.defined($.depth))if(U.string($.depth)&&U.inArray($.depth,["onepixel","onetile","one"]))this.options.tileDepth=$.depth;else throw U.invalidParameterError("depth","one of: onepixel, onetile, one",$.depth);if(U.defined($.skipBlanks))if(U.integer($.skipBlanks)&&U.inRange($.skipBlanks,-1,65535))this.options.tileSkipBlanks=$.skipBlanks;else throw U.invalidParameterError("skipBlanks","integer between -1 and 255/65535",$.skipBlanks);else if(U.defined($.layout)&&$.layout==="google")this.options.tileSkipBlanks=5;let Z=U.bool($.center)?$.center:$.centre;if(U.defined(Z))this._setBooleanOption("tileCentre",Z);if(U.defined($.id))if(U.string($.id))this.options.tileId=$.id;else throw U.invalidParameterError("id","string",$.id);if(U.defined($.basename))if(U.string($.basename))this.options.tileBasename=$.basename;else throw U.invalidParameterError("basename","string",$.basename)}if(U.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw U.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function FR($){if(!U.plainObject($))throw U.invalidParameterError("options","object",$);if(U.integer($.seconds)&&U.inRange($.seconds,0,3600))this.options.timeoutSeconds=$.seconds;else throw U.invalidParameterError("seconds","integer between 0 and 3600",$.seconds);return this}function LR($,Z){if(!(U.object(Z)&&Z.force===!1))this.options.formatOut=$;return this}function MR($,Z){if(U.bool(Z))this.options[$]=Z;else throw U.invalidParameterError($,"boolean",Z)}function AR(){if(!this.options.streamOut){this.options.streamOut=!0;let $=Error();this._pipeline(void 0,$)}}function IR($,Z){if(typeof $==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(X,Q,J)=>{if(X)$(U.nativeError(X,Z));else $(null,Q,J)})});else x0.pipeline(this.options,(X,Q,J)=>{if(X)$(U.nativeError(X,Z));else $(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",U.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else x0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",U.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(J,G,W)=>{if(J)Q(U.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})});else return new Promise((X,Q)=>{x0.pipeline(this.options,(J,G,W)=>{if(J)Q(U.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})}var EU,mE,RU=()=>Error("JP2 output requires libvips with support for OpenJPEG"),PU=($)=>1<<31-Math.clz32(Math.ceil(Math.log2($))),CU=($)=>{Object.assign($.prototype,{toFile:dE,toBuffer:lE,toUint8Array:cE,withDensity:pE,keepExif:iE,withExif:nE,withExifMerge:rE,keepIccProfile:aE,withIccProfile:oE,keepGainMap:sE,withGainMap:tE,keepXmp:eE,withXmp:$R,keepMetadata:ZR,withMetadata:XR,toFormat:QR,jpeg:JR,jp2:zR,png:GR,webp:WR,tiff:qR,avif:KR,heif:UR,jxl:HR,gif:YR,raw:VR,tile:BR,timeout:FR,_updateFormatOut:LR,_setBooleanOption:MR,_read:AR,_pipeline:IR})};var SU=s(()=>{C1();d9();/*!
316
314
  Copyright 2013 Lovell Fuller and others.
317
315
  SPDX-License-Identifier: Apache-2.0
318
- */GK=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),KE=/\.(jp[2x]|j2[kc])$/i});import cE from"node:events";import{createRequire as pE}from"node:module";import{availableParallelism as iE}from"node:os";function KK($){if(K.bool($))if($)return _0.cache(50,20,100);else return _0.cache(0,0,0);else if(K.object($)){for(let Z of["memory","files","items"]){let X=$[Z];if(K.defined(X)&&!(K.integer(X)&&X>=0))throw K.invalidParameterError(Z,"a positive integer",X)}return _0.cache($.memory,$.files,$.items)}else return _0.cache()}function rE($){return _0.concurrency(K.integer($)?$:null)}function oE(){return _0.counters()}function sE($){return _0.simd(K.bool($)?$:null)}function tE($){if(K.object($))if(Array.isArray($.operation)&&$.operation.every(K.string))_0.block($.operation,!0);else throw K.invalidParameterError("operation","Array<string>",$.operation);else throw K.invalidParameterError("options","object",$)}function eE($){if(K.object($))if(Array.isArray($.operation)&&$.operation.every(K.string))_0.block($.operation,!1);else throw K.invalidParameterError("operation","Array<string>",$.operation);else throw K.invalidParameterError("options","object",$)}var v9,_X,UK,xX,R1,nE,k4,aE,HK=($)=>{$.cache=KK,$.concurrency=rE,$.counters=oE,$.simd=sE,$.format=R1,$.interpolators=nE,$.versions=k4,$.queue=aE,$.block=tE,$.unblock=eE};var VK=t(()=>{R6();IX();y9();D8();v9=B$(Y8(),1);/*!
316
+ */EU=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),mE=/\.(jp[2x]|j2[kc])$/i});import NR from"node:events";import{createRequire as DR}from"node:module";import{availableParallelism as wR}from"node:os";function bU($){if(U.bool($))if($)return x0.cache(50,20,100);else return x0.cache(0,0,0);else if(U.object($)){for(let Z of["memory","files","items"]){let X=$[Z];if(U.defined(X)&&!(U.integer(X)&&X>=0))throw U.invalidParameterError(Z,"a positive integer",X)}return x0.cache($.memory,$.files,$.items)}else return x0.cache()}function jR($){return x0.concurrency(U.integer($)?$:null)}function ER(){return x0.counters()}function RR($){return x0.simd(U.bool($)?$:null)}function PR($){if(U.object($))if(Array.isArray($.operation)&&$.operation.every(U.string))x0.block($.operation,!0);else throw U.invalidParameterError("operation","Array<string>",$.operation);else throw U.invalidParameterError("options","object",$)}function CR($){if(U.object($))if(Array.isArray($.operation)&&$.operation.every(U.string))x0.block($.operation,!1);else throw U.invalidParameterError("operation","Array<string>",$.operation);else throw U.invalidParameterError("options","object",$)}var l9,cX,_U,pX,C6,TR,m4,OR,xU=($)=>{$.cache=bU,$.concurrency=jR,$.counters=ER,$.simd=RR,$.format=C6,$.interpolators=TR,$.versions=m4,$.queue=OR,$.block=PR,$.unblock=CR};var kU=s(()=>{C1();bX();d9();k5();l9=F$(N5(),1);/*!
319
317
  Copyright 2013 Lovell Fuller and others.
320
318
  SPDX-License-Identifier: Apache-2.0
321
- */_X=pE(import.meta.url),UK=w8.runtimePlatformArch(),xX=_0.libvipsVersion(),R1=_0.format();R1.heif.output.alias=["avif","heic"];R1.jpeg.output.alias=["jpe","jpg"];R1.tiff.output.alias=["tif"];R1.jp2.output.alias=["j2c","j2k","jp2","jpx"];nE={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},k4={vips:xX.semver};if(!xX.isGlobal)if(!xX.isWasm)try{k4=_X(`@img/sharp-${UK}/versions`)}catch($){try{k4=_X(`@img/sharp-libvips-${UK}/versions`)}catch(Z){}}else try{k4=_X("@img/sharp-wasm32/versions")}catch($){}k4.sharp=t6.version;if(k4.heif&&R1.heif)R1.heif.input.fileSuffix=[".avif"],R1.heif.output.alias=["avif"];KK(!0);if(!process.env.MALLOC_ARENA_MAX&&v9.default.familySync()===v9.default.GLIBC&&!_0._isUsingJemalloc())_0.concurrency(1);else if(v9.default.familySync()===v9.default.MUSL&&_0.concurrency()===1024)_0.concurrency(iE());aE=new cE.EventEmitter});var bX={};h6(bX,{default:()=>$R});var $R;var kX=t(()=>{CU();xU();fU();uU();lU();XK();JK();qK();VK();/*!
319
+ */cX=DR(import.meta.url),_U=y5.runtimePlatformArch(),pX=x0.libvipsVersion(),C6=x0.format();C6.heif.output.alias=["avif","heic"];C6.jpeg.output.alias=["jpe","jpg"];C6.tiff.output.alias=["tif"];C6.jp2.output.alias=["j2c","j2k","jp2","jpx"];TR={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},m4={vips:pX.semver};if(!pX.isGlobal)if(!pX.isWasm)try{m4=cX(`@img/sharp-${_U}/versions`)}catch($){try{m4=cX(`@img/sharp-libvips-${_U}/versions`)}catch(Z){}}else try{m4=cX("@img/sharp-wasm32/versions")}catch($){}m4.sharp=e1.version;if(m4.heif&&C6.heif)C6.heif.input.fileSuffix=[".avif"],C6.heif.output.alias=["avif"];bU(!0);if(!process.env.MALLOC_ARENA_MAX&&l9.default.familySync()===l9.default.GLIBC&&!x0._isUsingJemalloc())x0.concurrency(1);else if(l9.default.familySync()===l9.default.MUSL&&x0.concurrency()===1024)x0.concurrency(wR());OR=new NR.EventEmitter});var iX={};m1(iX,{default:()=>SR});var SR;var nX=s(()=>{oK();eK();GU();YU();KU();TU();OU();SU();kU();/*!
322
320
  Copyright 2013 Lovell Fuller and others.
323
321
  SPDX-License-Identifier: Apache-2.0
324
- */_U(x6);gU(x6);hU(x6);dU(x6);ZK(x6);QK(x6);zK(x6);HK(x6);$R=x6});import{createHash as BK}from"node:crypto";import{existsSync as ZR,mkdirSync as XR,readFileSync as QR}from"node:fs";import{basename as JR,extname as GR,resolve as yX}from"node:path";import{createRequire as WR}from"node:module";async function FK(){if(y4)return y4;try{return y4=(await Promise.resolve().then(() => (kX(),bX))).default,y4}catch{}try{return y4=WR(yX(process.cwd(),"package.json"))("sharp"),y4}catch($){throw Error(`Sharp is required for image optimization but failed to load: ${M1($)}`,{cause:$})}}async function vX($){let X=await(await FK())($).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function g9($){let Z=QR($);return BK("md5").update(Z).digest("hex").slice(0,8)}function gX($){let Z=JSON.stringify({formats:$.formats,quality:$.quality,widths:$.widths});return BK("md5").update(Z).digest("hex").slice(0,8)}function zR($,Z,X,Q){return`${$}-${Z}-${X}.${Q}`}async function LK($,Z,X){let Q=await FK(),J=await vX($),G=g9($),W=JR($,GR($)),Y=yX(Z,"_optimized");XR(Y,{recursive:!0});let z=[],q=X.widths.filter((L)=>L<=J.width);if(q.length===0||!q.includes(J.width))q.push(J.width);q.sort((L,M)=>L-M);let H=[];for(let L of q)for(let M of X.formats){let A=zR(W,L,G,M),w=`/${YR}/${A}`,D=yX(Y,A);if(z.push({absolutePath:D,format:M,outputPath:w,width:L}),ZR(D))continue;let j=X.quality[M]??80,E=Q($).resize(L).toFormat(M,{quality:j}).toFile(D).then(()=>{});H.push(E)}let B=4;for(let L=0;L<H.length;L+=B)await Promise.all(H.slice(L,L+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:z}}function fX($,Z){return $.filter((X)=>X.format===Z).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var y4=null,YR="images/_optimized";var hX=t(()=>{I1()});import{existsSync as qR,mkdirSync as UR,readFileSync as KR,rmSync as HR,writeFileSync as VR}from"node:fs";import{basename as BR,resolve as E8}from"node:path";import{execSync as FR}from"node:child_process";import{tmpdir as LR}from"node:os";function v4($){if(f9===void 0)try{let Z=FR("npm config get cache",{cwd:LR(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();f9=Z&&Z!=="undefined"?Z:null}catch{f9=null}if(f9)return E8(f9,"jxsuite-images",BR($));return E8($,".cache/images")}function MK($){let Z=E8(v4($),"manifest.json");if(!qR(Z))return{entries:{},touched:new Set,version:1};try{let X=JSON.parse(KR(Z,"utf8"));return X.touched=new Set,X}catch{return{entries:{},touched:new Set,version:1}}}function AK($,Z,X={}){if(X.prune&&Z.touched)MR(Z,Z.touched);let Q=v4($);UR(Q,{recursive:!0}),VR(E8(Q,"manifest.json"),JSON.stringify({entries:Z.entries,version:Z.version},null,2),"utf8")}function MR($,Z){let X=new Set;for(let[Q,J]of Object.entries($.entries))if(Z.has(Q))for(let G of J.manifest.variants??[])X.add(G.absolutePath);for(let[Q,J]of Object.entries($.entries)){if(Z.has(Q))continue;for(let G of J.manifest.variants??[])if(!X.has(G.absolutePath))HR(G.absolutePath,{force:!0});delete $.entries[Q]}}function IK($,Z){$.touched?.add(Z);let X=$.entries[Z];if(!X)return null;return X.manifest}function NK($,Z,X,Q){$.touched?.add(Z),$.entries[Z]={manifest:Q,source:X,timestamp:Date.now()}}var f9;var uX=t(()=>{hX()});import{existsSync as mX}from"node:fs";import{basename as AR,extname as TK,resolve as DK}from"node:path";async function OK($,Z){let X=Z.get($);if(!X){let Q=g9($);try{let J=await vX($);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!wK)wK=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}Z.set($,X)}return X}function R8($,Z,X,Q){let J=Z.quality?.webp??80,G=$.startsWith("/")?"":"/",W=Q?`?v=${Q}`:"";return Z.widths.filter((Y)=>Y<=X).toSorted((Y,z)=>Y-z).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${J},fit=scale-down,format=auto${G}${$}${W} ${Y}w`).join(", ")}async function EK($,Z,X,Q,J){let G=`${g9($)}:${gX(X)}`,W=IK(J,G);if(W){if(W.variants.every((q)=>mX(q.absolutePath)))return W}if(!W)console.log(` Optimizing ${AR($)}...`);let Y=await LK($,v4(Q),X);return NK(J,G,Z,Y),Y}function RK($){if(typeof $!=="string")return!0;if(!$)return!0;if($.includes("${"))return!0;if(IR.some((Z)=>$.startsWith(Z)))return!0;if(jK.has(TK($).toLowerCase()))return!0;return!1}function PK($,Z){if(Z.service!=="cloudflare")return!1;if(!Z.remoteDomains?.length)return!1;if(typeof $!=="string"||!$.startsWith("https://"))return!1;if($.includes("${"))return!1;try{let X=new URL($);if(jK.has(TK(X.pathname).toLowerCase()))return!1;return Z.remoteDomains.includes(X.hostname)}catch{return!1}}function CK($,Z){if($.startsWith("/"))return DK(Z,"public",$.slice(1));return DK(Z,$)}async function SK($,Z,X,Q,J){let G=new Map;if(!Z.optimize)return{imageRefs:G};return await _K($,Z,X,Q,J??new Map,G),{imageRefs:G}}async function _K($,Z,X,Q,J,G){if(!$||typeof $!=="object")return;if($.tagName==="img")await NR($,Z,X,Q,J,G);if(typeof $.innerHTML==="string"&&$.innerHTML.includes("<img"))$.innerHTML=await OR($.innerHTML,Z,X,Q,J,G);if(Array.isArray($.children))for(let W of $.children){if(typeof W==="string")continue;await _K(W,Z,X,Q,J,G)}}async function NR($,Z,X,Q,J,G){if(!$.attributes)$.attributes={};let W=$.attributes.src??$.src;if(typeof W!=="string")return;let Y=PK(W,Z);if(!Y&&RK(W))return;if($.attributes["data-no-optimize"]!==void 0)return;let z,q=null;if(Y)z=R8(W,Z,1/0,null);else{let H=CK(W,X);if(!mX(H))return;if(Z.service==="cloudflare"){let B=await OK(H,J);z=R8(W,Z,B.width??1/0,B.hash),q=B.width&&B.height?{height:B.height,width:B.width}:null}else{let B=G.get(H);if(!B)B=await EK(H,W,Z,X,Q),G.set(H,B);let L=Z.formats.includes("avif")?"avif":Z.formats[0];z=fX(B.variants,L),q=B.original?.width&&B.original.height?{height:B.original.height,width:B.original.width}:null}}if(z)$.attributes.srcset=z,$.attributes.sizes??=Z.sizes;if(q&&$.attributes.width===void 0&&$.attributes.height===void 0)$.attributes.width=String(q.width),$.attributes.height=String(q.height);if(Z.lazyLoad&&$.attributes.loading!=="eager")$.attributes.loading="lazy",$.attributes.decoding="async"}async function OR($,Z,X,Q,J,G){let W=[];for(let z of $.matchAll(DR)){let q=z[0],H=z[1];if(TR.test(H))continue;if(jR.test(H))continue;let B=H.match(wR);if(!B)continue;let L=B[1].replaceAll("&amp;","&"),M=PK(L,Z);if(!M&&RK(L))continue;let A=M?null:CK(L,X);if(A&&!mX(A))continue;let w,D=null;if(M)w=R8(L,Z,1/0,null);else if(Z.service==="cloudflare"){let E=await OK(A,J);w=R8(L,Z,E.width??1/0,E.hash),D=E.width&&E.height?{height:E.height,width:E.width}:null}else{let E=G.get(A);if(!E)E=await EK(A,L,Z,X,Q),G.set(A,E);let P=Z.formats.includes("avif")?"avif":Z.formats[0];w=fX(E.variants,P),D=E.original?.width&&E.original.height?{height:E.original.height,width:E.original.width}:null}if(!w)continue;let j=` srcset="${w}" sizes="${Z.sizes}"`;if(D&&!/\bwidth=/.test(H)&&!/\bheight=/.test(H))j+=` width="${D.width}" height="${D.height}"`;if(Z.lazyLoad&&!/\bloading="eager"/.test(H)){if(!/\bloading=/.test(H))j+=' loading="lazy"';if(!/\bdecoding=/.test(H))j+=' decoding="async"'}W.push({match:q,replacement:`<img${H}${j}>`})}let Y=$;for(let{match:z,replacement:q}of W)Y=Y.replace(z,q);return Y}var jK,IR,wK=!1,DR,wR,TR,jR;var xK=t(()=>{hX();uX();jK=new Set([".svg",".gif"]),IR=["http://","https://","data:","//"];DR=/<img\b([^>]*)>/gi,wR=/\bsrc="([^"]*)"/,TR=/\bsrcset="/,jR=/\bdata-no-optimize\b/});var gK={};h6(gK,{buildSite:()=>bR});import{cpSync as dX,existsSync as e1,mkdirSync as Z1,readFileSync as ER,readdirSync as RR,rmSync as PR,statSync as CR,writeFileSync as X6}from"node:fs";import{basename as SR,dirname as X1,join as g4,relative as _R,resolve as J$,sep as xR}from"node:path";async function bR($,Z={}){let{clean:X=!0,verbose:Q=!1}=Z,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:W}=D1($);if("contentTypes"in W)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let Y=J$($,W.build.outDir),z=J$($,"pages"),q=J$($,"public"),H=W.build.trailingSlash??"always",B=new Map,L=(_,p)=>{if(!fY(_))return _;try{let o=hY(_,p??$,$);if(!l1(_)&&!e1(o))return console.warn(`Sidecar "${_}" not found at ${o} — emitting unbundled`),_;let K0=l1(_)?_:`./${_R($,o)}`,i=qY(K0),G0=B.get(i);if(G0&&G0.entryPath!==o)throw Error(`"${_}" and "${G0.specifier}" both bundle to ${i} — rename one`);return B.set(i,{entryPath:o,specifier:_}),i}catch(o){return J.push(`Sidecar "${_}": ${o.message}`),_}},M=await E6($,W),A=M.formats;if(A.entries.length>0)G(` Registered ${A.entries.length} format(s): ${A.entries.map((_)=>_.name).join(", ")}`);let w=M.serverMounts().filter((_)=>{if(!_.project)return!0;let p=W[_.project.key];return p!==void 0&&typeof p==="object"&&Object.keys(p).length>0});if(w.length>0&&!W.build.adapter){let _=w.map((p)=>p.project?`"${p.project.key}"`:`"${p.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${_} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(X&&e1(Y))PR(Y,{force:!0,recursive:!0});if(Z1(Y,{recursive:!0}),!e1(z))throw Error(`pages/ directory not found in ${$}`);G("Discovering pages...");let D=await cY(z,A);G(` Found ${D.length} page(s)`),G("Loading project sections...");let j=await rY($,W,M),E=Object.keys(j);if(E.length>0)G(` Loaded ${E.length} section(s): ${E.join(", ")}`);let P=await iY(D,$,j,M,W);G(` ${P.length} route(s) after expansion`);let R=0,C=J$($,"components"),v=[],d=new Map,f=new Map;if(e1(C)){G("Compiling components...");let _=[".json",...A.documentExtensions("component")],p=RR(C).filter((K0)=>_.some((i)=>K0.endsWith(i))),o=J$(Y,"components");Z1(o,{recursive:!0});for(let K0 of p)try{let i=J$(C,K0),G0=await c5(i,{...W.$media?{$media:W.$media}:{},formats:A,rewriteSrc:L});for(let Z0 of G0.files){let x0=SR(Z0.path);if(X6(J$(o,x0),Z0.content,"utf8"),Z0.tagName)v.push(Z0.tagName);R+=1}let X0=await E9(i,A);if(X0.tagName){f.set(X0.tagName,X0);let Z0=rJ(X0.tagName,X0.style,X0,W.$media??{});if(Z0)d.set(X0.tagName,Z0),X6(J$(o,`${X0.tagName}.css`),Z0,"utf8"),R+=1}}catch(i){let G0=i;J.push(`Error compiling component ${K0}: ${G0.message}`),console.error(`Error compiling component ${K0}: ${G0.message}`)}G(` Compiled ${v.length} component(s): ${v.join(", ")}`)}let a=[];if(W.build.adapter)for(let[,_]of f){let p=w5(_);for(let o of p){let K0=`./components/${o.src.replace(/^\.\//,"")}`;a.push({exportName:o.exportName,src:K0})}}let $0=W.images.optimize&&W.images.service==="cloudflare",u=W.images.optimize&&!$0?MK($):null,e=$0?new Map:null;if($0)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let Y0=W.url,J0=Boolean(Y0)&&W.build.sitemap!==!1,L0=[];for(let _ of P)try{G(` Compiling ${_.urlPattern} ...`);let p=await kR(_,W,$,j,u,f,e,A,M,L),o=new Set;for(let[G0,X0]of f)if(fZ(X0))o.add(G0);if(v.length>0)p.html=fR(p.html,v,d,o);let K0=vK(_.urlPattern,Y,H);Z1(X1(K0),{recursive:!0}),X6(K0,p.html,"utf8"),R+=1;let i=!_.urlPattern.includes(":")&&!_.urlPattern.includes("*");if(J0&&!p.excludeFromSitemap&&i)L0.push({lastmod:CR(_.sourcePath).mtime,loc:new URL(_.urlPattern,Y0).href});for(let G0 of A.withCapability("serialize")){if(!G0.exportTarget)continue;try{let X0=await G0.call("serialize",p.doc,{buildScope:(Z0)=>B4(Z0,null),componentDefs:f,evaluateTemplate:(Z0,x0)=>{if(!I0(Z0))return;return L$(Z0,x0)??Z0},mode:"export"});if(X0){let Z0=K0.replace(/\.html$/,G0.extensions[0]);X6(Z0,X0,"utf8"),R+=1}}catch(X0){let Z0=X0;J.push(`Error exporting ${G0.name} for ${_.urlPattern}: ${Z0.message}`)}}for(let G0 of p.files){let X0=J$(X1(K0),G0.path);Z1(X1(X0),{recursive:!0}),X6(X0,G0.content,"utf8"),R+=1}if(p.serverHandler){let G0=J$(X1(K0),"_server.js");X6(G0,p.serverHandler,"utf8"),R+=1}}catch(p){let o=p,K0=`Error compiling ${_.urlPattern}: ${o.message}`;J.push(K0),console.error(K0)}if(u&&W.images.optimize){AK($,u,{prune:J.length===0});let _=J$(v4($),"_optimized");if(e1(_)){let o=J$(Y,"images/_optimized");Z1(o,{recursive:!0}),dX(_,o,{recursive:!0})}let p=Object.keys(u.entries).length;if(p>0)G(` Optimized ${p} image(s)`)}if(W.build.adapter){let{adapter:_}=W.build;G("Generating site-wide server worker...");let p=new Map;for(let X0 of a)if(!p.has(X0.exportName))p.set(X0.exportName,X0);let{mounts:o,connectors:K0}=yR(w,M,W);if(o.length>0)G(` Mounting ${o.length} extension route(s): ${o.map((X0)=>X0.basePath).join(", ")}`);let G0=_==="cloudflare-pages"&&p.size===0&&o.length===0?null:R7([...p.values()],{adapter:_,connectors:K0,mounts:o});if(G0){let X0=_==="cloudflare-pages"?"_worker.js":"worker.js";try{await mY(G0,{adapter:_,outfile:J$(Y,X0),projectRoot:$}),R+=1,G(` Generated dist/${X0} (bundled, ${p.size} server function(s))`)}catch(Z0){let x0=`Error bundling dist/${X0}: ${Z0.message}`;J.push(x0),console.error(x0)}if(_==="cloudflare-pages")X6(J$(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
325
- `,"utf8"),R+=1}}if(B.size>0){G(`Bundling ${B.size} client sidecar module(s)...`);for(let[_,p]of B)try{let o=J$(Y,_.replace(/^\//,""));Z1(X1(o),{recursive:!0}),await r7({entryPath:p.entryPath,outfile:o},{external:gY,target:"browser"}),R+=1,G(` ${p.specifier} → ${_}`)}catch(o){let K0=`Error bundling sidecar "${p.specifier}": ${o.message}`;J.push(K0),console.error(K0)}}for(let _ of M.emitters()){let p=_.project?.key,o=p?W[p]:void 0;if(p&&(o==null||typeof o==="object"&&Object.keys(o).length===0))continue;try{let K0=await _.call("emit",o??null,{projectConfig:W,root:$,routes:P,sections:j});for(let i of K0??[]){let G0=J$(Y,i.path.replace(/^\//,""));if(!G0.startsWith(Y+xR))throw Error(`emit path escapes outDir: ${i.path}`);Z1(X1(G0),{recursive:!0}),X6(G0,i.content),R+=1,G(` ${_.name} emitted ${i.path}`)}}catch(K0){let i=`Error in ${_.name}.emit: ${K0.message}`;J.push(i),console.error(i)}}if(W.redirects&&Object.keys(W.redirects).length>0){G("Generating redirects...");let _=new Set(P.map((o)=>o.urlPattern)),p=mR(W.redirects,Y,_);R+=p}if(J0)G(`Generating sitemap (${L0.length} URL(s))...`),R+=cR(L0,Y);else if(!Y0&&W.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(e1(q))G("Copying public/ assets..."),dX(q,Y,{recursive:!0});if(J0)R+=pR(Y,Y0);if(W.copy){G("Copying mapped files...");for(let[_,p]of Object.entries(W.copy)){let o=J$($,_),K0=J$(Y,p);Z1(X1(K0),{recursive:!0}),dX(o,K0)}}if(G(`
326
- Build complete: ${P.length} routes, ${R} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:R,routes:P.length}}async function kR($,Z,X,Q={},J=null,G=new Map,W=null,Y,z,q){let H=await E9($.sourcePath,Y),B=o7(H,Z,X),L=H.$head??B._pageHead??[],M=B.$head??[],A=H.title??B._pageTitle??null;delete B._pageHead,delete B._pageTitle,$z(B,Z,$,X),await Xz(B,$,X,{config:Z,sections:Q,...z===void 0?{}:{registry:z},...q===void 0?{}:{registerBundle:(a)=>{q(a,null)}}});let w=B4(B.state??{}),D=A??Z.name??"Jx Site";if(typeof D==="string"&&I0(D))D=L$(D,w)??D;let j=bK(L,w),E=bK(M,w);h9(B,w);let P={counter:{n:0},media:{...Z.$media,...B.$media},rules:[]};if(cX(B,G,P),B.state)for(let[a,$0]of Object.entries(B.state)){if(a==="$site"||a==="$page")continue;if($0&&typeof $0==="object"&&!Array.isArray($0)&&$0.timing==="compiler")delete B.state[a];else if(Array.isArray($0))delete B.state[a]}let R=vR(Z.$head??[]),C=tY(R,E,j,{title:D,charset:Z.defaults?.charset??"utf8",...Z.name!=null&&{siteName:Z.name},...Z.url!=null&&{siteUrl:Z.url},pageUrl:$.urlPattern});if(Z.$media)B.$media={...Z.$media,...B.$media};if(Object.values(B.$media??{}).some((a)=>w6(String(a))!==null))C.splice(2,0,{tagName:"script",textContent:F4()});if(Z.images?.optimize&&(J||W))await SK(B,Z.images,X,J,W??void 0);let v=await u7(B,{lang:Z.defaults?.lang??"en",prePaintScheme:!1,projectStyle:Z.style??null,...q===void 0?{}:{rewriteSrc:(a)=>q(a,X1($.sourcePath))},title:D});if(P.rules.length>0)v.html=v.html.replace("</head>",`<style>
327
- ${P.rules.join(`
322
+ */tK(k1);JU(k1);WU(k1);qU(k1);wU(k1);jU(k1);CU(k1);xU(k1);SR=k1});import{createHash as yU}from"node:crypto";import{existsSync as _R,mkdirSync as bR,readFileSync as xR}from"node:fs";import{basename as kR,extname as yR,resolve as rX}from"node:path";import{createRequire as vR}from"node:module";async function vU(){if(d4)return d4;try{return d4=(await Promise.resolve().then(() => (nX(),iX))).default,d4}catch{}try{return d4=vR(rX(process.cwd(),"package.json"))("sharp"),d4}catch($){throw Error(`Sharp is required for image optimization but failed to load: ${A6($)}`,{cause:$})}}async function aX($){let X=await(await vU())($).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function c9($){let Z=xR($);return yU("md5").update(Z).digest("hex").slice(0,8)}function oX($){let Z=JSON.stringify({formats:$.formats,quality:$.quality,widths:$.widths});return yU("md5").update(Z).digest("hex").slice(0,8)}function fR($,Z,X,Q){return`${$}-${Z}-${X}.${Q}`}async function gU($,Z,X){let Q=await vU(),J=await aX($),G=c9($),W=kR($,yR($)),Y=rX(Z,"_optimized");bR(Y,{recursive:!0});let z=[],q=X.widths.filter((F)=>F<=J.width);if(q.length===0||!q.includes(J.width))q.push(J.width);q.sort((F,L)=>F-L);let H=[];for(let F of q)for(let L of X.formats){let w=fR(W,F,G,L),N=`/${gR}/${w}`,I=rX(Y,w);if(z.push({absolutePath:I,format:L,outputPath:N,width:F}),_R(I))continue;let T=X.quality[L]??80,E=Q($).resize(F).toFormat(L,{quality:T}).toFile(I).then(()=>{});H.push(E)}let B=4;for(let F=0;F<H.length;F+=B)await Promise.all(H.slice(F,F+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:z}}function sX($,Z){return $.filter((X)=>X.format===Z).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var d4=null,gR="images/_optimized";var tX=s(()=>{N6()});import{existsSync as hR,mkdirSync as uR,readFileSync as mR,rmSync as dR,writeFileSync as lR}from"node:fs";import{basename as cR,resolve as h5}from"node:path";import{execSync as pR}from"node:child_process";import{tmpdir as iR}from"node:os";function l4($){if(p9===void 0)try{let Z=pR("npm config get cache",{cwd:iR(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();p9=Z&&Z!=="undefined"?Z:null}catch{p9=null}if(p9)return h5(p9,"jxsuite-images",cR($));return h5($,".cache/images")}function fU($){let Z=h5(l4($),"manifest.json");if(!hR(Z))return{entries:{},touched:new Set,version:1};try{let X=JSON.parse(mR(Z,"utf8"));return X.touched=new Set,X}catch{return{entries:{},touched:new Set,version:1}}}function hU($,Z,X={}){if(X.prune&&Z.touched)nR(Z,Z.touched);let Q=l4($);uR(Q,{recursive:!0}),lR(h5(Q,"manifest.json"),JSON.stringify({entries:Z.entries,version:Z.version},null,2),"utf8")}function nR($,Z){let X=new Set;for(let[Q,J]of Object.entries($.entries))if(Z.has(Q))for(let G of J.manifest.variants??[])X.add(G.absolutePath);for(let[Q,J]of Object.entries($.entries)){if(Z.has(Q))continue;for(let G of J.manifest.variants??[])if(!X.has(G.absolutePath))dR(G.absolutePath,{force:!0});delete $.entries[Q]}}function uU($,Z){$.touched?.add(Z);let X=$.entries[Z];if(!X)return null;return X.manifest}function mU($,Z,X,Q){$.touched?.add(Z),$.entries[Z]={manifest:Q,source:X,timestamp:Date.now()}}var p9;var eX=s(()=>{tX()});import{existsSync as $Q}from"node:fs";import{basename as rR,extname as cU,resolve as dU}from"node:path";async function iU($,Z){let X=Z.get($);if(!X){let Q=c9($);try{let J=await aX($);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!lU)lU=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}Z.set($,X)}return X}function u5($,Z,X,Q){let J=Z.quality?.webp??80,G=$.startsWith("/")?"":"/",W=Q?`?v=${Q}`:"";return Z.widths.filter((Y)=>Y<=X).toSorted((Y,z)=>Y-z).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${J},fit=scale-down,format=auto${G}${$}${W} ${Y}w`).join(", ")}async function nU($,Z,X,Q,J){let G=`${c9($)}:${oX(X)}`,W=uU(J,G);if(W){if(W.variants.every((q)=>$Q(q.absolutePath)))return W}if(!W)console.log(` Optimizing ${rR($)}...`);let Y=await gU($,l4(Q),X);return mU(J,G,Z,Y),Y}function rU($){if(typeof $!=="string")return!0;if(!$)return!0;if($.includes("${"))return!0;if(aR.some((Z)=>$.startsWith(Z)))return!0;if(pU.has(cU($).toLowerCase()))return!0;return!1}function aU($,Z){if(Z.service!=="cloudflare")return!1;if(!Z.remoteDomains?.length)return!1;if(typeof $!=="string"||!$.startsWith("https://"))return!1;if($.includes("${"))return!1;try{let X=new URL($);if(pU.has(cU(X.pathname).toLowerCase()))return!1;return Z.remoteDomains.includes(X.hostname)}catch{return!1}}function oU($,Z,X){let Q=X?.length?G5(X,$):null;if(Q)return Q;if($.startsWith("/"))return dU(Z,"public",$.slice(1));return dU(Z,$)}async function sU($,Z,X,Q,J,G=[]){let W=new Map;if(!Z.optimize)return{imageRefs:W};return await tU($,Z,X,Q,J??new Map,W,G),{imageRefs:W}}async function tU($,Z,X,Q,J,G,W){if(!$||typeof $!=="object")return;if($.tagName==="img")await oR($,Z,X,Q,J,G,W);if(typeof $.innerHTML==="string"&&$.innerHTML.includes("<img"))$.innerHTML=await ZP($.innerHTML,Z,X,Q,J,G,W);if(Array.isArray($.children))for(let Y of $.children){if(typeof Y==="string")continue;await tU(Y,Z,X,Q,J,G,W)}}async function oR($,Z,X,Q,J,G,W){if(!$.attributes)$.attributes={};let Y=$.attributes.src??$.src;if(typeof Y!=="string")return;let z=aU(Y,Z);if(!z&&rU(Y))return;if($.attributes["data-no-optimize"]!==void 0)return;let q,H=null;if(z)q=u5(Y,Z,1/0,null);else{let B=oU(Y,X,W);if(!$Q(B))return;if(Z.service==="cloudflare"){let F=await iU(B,J);q=u5(Y,Z,F.width??1/0,F.hash),H=F.width&&F.height?{height:F.height,width:F.width}:null}else{let F=G.get(B);if(!F)F=await nU(B,Y,Z,X,Q),G.set(B,F);let L=Z.formats.includes("avif")?"avif":Z.formats[0];q=sX(F.variants,L),H=F.original?.width&&F.original.height?{height:F.original.height,width:F.original.width}:null}}if(q)$.attributes.srcset=q,$.attributes.sizes??=Z.sizes;if(H&&$.attributes.width===void 0&&$.attributes.height===void 0)$.attributes.width=String(H.width),$.attributes.height=String(H.height);if(Z.lazyLoad&&$.attributes.loading!=="eager")$.attributes.loading="lazy",$.attributes.decoding="async"}async function ZP($,Z,X,Q,J,G,W){let Y=[];for(let q of $.matchAll(sR)){let H=q[0],B=q[1];if(eR.test(B))continue;if($P.test(B))continue;let F=B.match(tR);if(!F)continue;let L=F[1].replaceAll("&amp;","&"),w=aU(L,Z);if(!w&&rU(L))continue;let N=w?null:oU(L,X,W);if(N&&!$Q(N))continue;let I,T=null;if(w)I=u5(L,Z,1/0,null);else if(Z.service==="cloudflare"){let P=await iU(N,J);I=u5(L,Z,P.width??1/0,P.hash),T=P.width&&P.height?{height:P.height,width:P.width}:null}else{let P=G.get(N);if(!P)P=await nU(N,L,Z,X,Q),G.set(N,P);let R=Z.formats.includes("avif")?"avif":Z.formats[0];I=sX(P.variants,R),T=P.original?.width&&P.original.height?{height:P.original.height,width:P.original.width}:null}if(!I)continue;let E=` srcset="${I}" sizes="${Z.sizes}"`;if(T&&!/\bwidth=/.test(B)&&!/\bheight=/.test(B))E+=` width="${T.width}" height="${T.height}"`;if(Z.lazyLoad&&!/\bloading="eager"/.test(B)){if(!/\bloading=/.test(B))E+=' loading="lazy"';if(!/\bdecoding=/.test(B))E+=' decoding="async"'}Y.push({match:H,replacement:`<img${B}${E}>`})}let z=$;for(let{match:q,replacement:H}of Y)z=z.replace(q,H);return z}var pU,aR,lU=!1,sR,tR,eR,$P;var eU=s(()=>{tX();eX();R9();pU=new Set([".svg",".gif"]),aR=["http://","https://","data:","//"];sR=/<img\b([^>]*)>/gi,tR=/\bsrc="([^"]*)"/,eR=/\bsrcset="/,$P=/\bdata-no-optimize\b/});var JH={};m1(JH,{buildSite:()=>qP});import{cpSync as ZQ,existsSync as Q4,mkdirSync as X6,readFileSync as XP,readdirSync as QP,rmSync as JP,statSync as GP,writeFileSync as Q1}from"node:fs";import{basename as WP,dirname as Q6,join as c4,relative as YP,resolve as t0,sep as zP}from"node:path";async function qP($,Z={}){let{clean:X=!0,verbose:Q=!1}=Z,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:W}=T6($);if("contentTypes"in W)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let Y=t0($,W.build.outDir),z=t0($,"pages"),q=t0($,"public"),H=W.build.trailingSlash??"always",B=new Map,F=(o,f)=>{if(!Xz(o))return o;try{let Z0=Qz(o,f??$,$);if(!n6(o)&&!Q4(Z0))return console.warn(`Sidecar "${o}" not found at ${Z0} — emitting unbundled`),o;let J0=n6(o)?o:`./${YP($,Z0)}`,$0=OY(J0),F0=B.get($0);if(F0&&F0.entryPath!==Z0)throw Error(`"${o}" and "${F0.specifier}" both bundle to ${$0} — rename one`);return B.set($0,{entryPath:Z0,specifier:o}),$0}catch(Z0){return J.push(`Sidecar "${o}": ${Z0.message}`),o}},L=await R1($,W),w=L.formats;if(w.entries.length>0)G(` Registered ${w.entries.length} format(s): ${w.entries.map((o)=>o.name).join(", ")}`);let N=L.serverMounts().filter((o)=>{if(!o.project)return!0;let f=W[o.project.key];return f!==void 0&&typeof f==="object"&&Object.keys(f).length>0});if(N.length>0&&!W.build.adapter){let o=N.map((f)=>f.project?`"${f.project.key}"`:`"${f.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${o} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(X&&Q4(Y))JP(Y,{force:!0,recursive:!0});if(X6(Y,{recursive:!0}),!Q4(z))throw Error(`pages/ directory not found in ${$}`);G("Discovering pages...");let I=await zz(z,w);G(` Found ${I.length} page(s)`),G("Loading project sections...");let T=await Hz($,W,L),E=Object.keys(T);if(E.length>0)G(` Loaded ${E.length} section(s): ${E.join(", ")}`);let{errors:P,mounts:R}=await Bz(L,W,$);J.push(...P);for(let o of P)console.error(o);if(R.length>0)G(` Mounted ${R.length} asset dir(s): ${R.map((o)=>o.urlPrefix).join(", ")}`);let C=new Set,y=await Kz(I,$,T,L,W);G(` ${y.length} route(s) after expansion`);let v=0,h=t0($,"components"),X0=[],r=new Map,u=new Map;if(Q4(h)){G("Compiling components...");let o=[".json",...w.documentExtensions("component")],f=QP(h).filter(($0)=>o.some((F0)=>$0.endsWith(F0))),Z0=t0(Y,"components");X6(Z0,{recursive:!0});let J0=new Map;for(let $0 of f){let F0=t0(h,$0);try{let{tagName:U0}=await _4(F0,w);if(U0)J0.set(F0,U0)}catch{}}for(let $0 of f)try{let F0=t0(h,$0),U0=await Z5(F0,{...W.$media?{$media:W.$media}:{},formats:w,resolveElementPath:(e,d0)=>{let R0=d0?t0(d0,e):t0(e),p0=J0.get(R0);return p0?`./${p0}.js`:e.replace(/\.json$/,".js")},rewriteSrc:F});for(let e of U0.files){let d0=e.tagName?`${e.tagName}.js`:WP(e.path);if(Q1(t0(Z0,d0),e.content,"utf8"),e.tagName)X0.push(e.tagName);v+=1}let D0=await _4(F0,w);if(D0.tagName){u.set(D0.tagName,D0);let e=qG(D0.tagName,D0.style,D0,W.$media??{});if(e)r.set(D0.tagName,e),zX(e,R,C),Q1(t0(Z0,`${D0.tagName}.css`),e,"utf8"),v+=1}}catch(F0){let U0=F0;J.push(`Error compiling component ${$0}: ${U0.message}`),console.error(`Error compiling component ${$0}: ${U0.message}`)}G(` Compiled ${X0.length} component(s): ${X0.join(", ")}`)}let t=[];if(W.build.adapter)for(let[,o]of u){let f=x8(o);for(let Z0 of f){let J0=`./components/${Z0.src.replace(/^\.\//,"")}`;t.push({exportName:Z0.exportName,src:J0})}}let Y0=W.images.optimize&&W.images.service==="cloudflare",G0=W.images.optimize&&!Y0?fU($):null,A0=Y0?new Map:null;if(Y0)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let l=W.url,K0=Boolean(l)&&W.build.sitemap!==!1,V0=[];for(let o of y)try{G(` Compiling ${o.urlPattern} ...`);let f=await KP(o,W,$,T,G0,u,A0,w,L,F,R),Z0=new Set;for(let[F0,U0]of u)if(sZ(U0))Z0.add(F0);if(X0.length>0)f.html=BP(f.html,X0,r,Z0,f.files.map((F0)=>F0.content).join(`
323
+ `));zX(f.html,R,C);let J0=QH(o.urlPattern,Y,H);X6(Q6(J0),{recursive:!0}),Q1(J0,f.html,"utf8"),v+=1;let $0=!o.urlPattern.includes(":")&&!o.urlPattern.includes("*");if(K0&&!f.excludeFromSitemap&&$0)V0.push({lastmod:GP(o.sourcePath).mtime,loc:new URL(o.urlPattern,l).href});for(let F0 of w.withCapability("serialize")){if(!F0.exportTarget)continue;try{let U0=await F0.call("serialize",f.doc,{buildScope:(D0)=>N4(D0,null),componentDefs:u,evaluateTemplate:(D0,e)=>{if(!w0(D0))return;return M$(D0,e)??D0},mode:"export"});if(U0){let D0=J0.replace(/\.html$/,F0.extensions[0]);Q1(D0,U0,"utf8"),v+=1}}catch(U0){let D0=U0;J.push(`Error exporting ${F0.name} for ${o.urlPattern}: ${D0.message}`)}}for(let F0 of f.files){let U0=t0(Q6(J0),F0.path);X6(Q6(U0),{recursive:!0}),Q1(U0,F0.content,"utf8"),v+=1}if(f.serverHandler){let F0=t0(Q6(J0),"_server.js");Q1(F0,f.serverHandler,"utf8"),v+=1}}catch(f){let Z0=f,J0=`Error compiling ${o.urlPattern}: ${Z0.message}`;J.push(J0),console.error(J0)}if(G0&&W.images.optimize){hU($,G0,{prune:J.length===0});let o=t0(l4($),"_optimized");if(Q4(o)){let Z0=t0(Y,"images/_optimized");X6(Z0,{recursive:!0}),ZQ(o,Z0,{recursive:!0})}let f=Object.keys(G0.entries).length;if(f>0)G(` Optimized ${f} image(s)`)}if(W.build.adapter){let{adapter:o}=W.build;G("Generating site-wide server worker...");let f=new Map;for(let U0 of t)if(!f.has(U0.exportName))f.set(U0.exportName,U0);let{mounts:Z0,connectors:J0}=UP(N,L,W);if(Z0.length>0)G(` Mounting ${Z0.length} extension route(s): ${Z0.map((U0)=>U0.basePath).join(", ")}`);let F0=o==="cloudflare-pages"&&f.size===0&&Z0.length===0?null:u7([...f.values()],{adapter:o,connectors:J0,mounts:Z0});if(F0){let U0=o==="cloudflare-pages"?"_worker.js":"worker.js";try{await Gz(F0,{adapter:o,outfile:t0(Y,U0),projectRoot:$}),v+=1,G(` Generated dist/${U0} (bundled, ${f.size} server function(s))`)}catch(D0){let e=`Error bundling dist/${U0}: ${D0.message}`;J.push(e),console.error(e)}if(o==="cloudflare-pages")Q1(t0(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
324
+ `,"utf8"),v+=1}}if(B.size>0){G(`Bundling ${B.size} client sidecar module(s)...`);for(let[o,f]of B)try{let Z0=t0(Y,o.replace(/^\//,""));X6(Q6(Z0),{recursive:!0}),await WX({entryPath:f.entryPath,outfile:Z0},{external:Zz,target:"browser"}),v+=1,G(` ${f.specifier} → ${o}`)}catch(Z0){let J0=`Error bundling sidecar "${f.specifier}": ${Z0.message}`;J.push(J0),console.error(J0)}}for(let o of L.emitters()){let f=o.project?.key,Z0=f?W[f]:void 0;if(f&&(Z0==null||typeof Z0==="object"&&Object.keys(Z0).length===0))continue;try{let J0=await o.call("emit",Z0??null,{projectConfig:W,root:$,routes:y,sections:T});for(let $0 of J0??[]){let F0=t0(Y,$0.path.replace(/^\//,""));if(!F0.startsWith(Y+zP))throw Error(`emit path escapes outDir: ${$0.path}`);X6(Q6(F0),{recursive:!0}),Q1(F0,$0.content),v+=1,G(` ${o.name} emitted ${$0.path}`)}}catch(J0){let $0=`Error in ${o.name}.emit: ${J0.message}`;J.push($0),console.error($0)}}if(W.redirects&&Object.keys(W.redirects).length>0){G("Generating redirects...");let o=new Set(y.map((Z0)=>Z0.urlPattern)),f=MP(W.redirects,Y,o);v+=f}if(K0)G(`Generating sitemap (${V0.length} URL(s))...`),v+=NP(V0,Y);else if(!l&&W.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(C.size>0){let{copied:o,missing:f}=Fz(C,R,Y);v+=o,G(`Copying ${o} mounted asset(s)...`);for(let Z0 of f)console.warn(`Referenced asset not found: ${Z0}`)}if(Q4(q))G("Copying public/ assets..."),ZQ(q,Y,{recursive:!0});if(K0)v+=DP(Y,l);if(W.copy){G("Copying mapped files...");for(let[o,f]of Object.entries(W.copy)){let Z0=t0($,o),J0=t0(Y,f);X6(Q6(J0),{recursive:!0}),ZQ(Z0,J0)}}if(G(`
325
+ Build complete: ${y.length} routes, ${v} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:v,routes:y.length}}async function KP($,Z,X,Q={},J=null,G=new Map,W=null,Y,z,q,H=[]){let B=await _4($.sourcePath,Y),F=qX(B,Z,X),L=B.$head??F._pageHead??[],w=F.$head??[],N=B.title??F._pageTitle??null;delete F._pageHead,delete F._pageTitle,Dz(F,Z,$,X),await Tz(F,$,X,{config:Z,sections:Q,...z===void 0?{}:{registry:z},...q===void 0?{}:{registerBundle:(r)=>{q(r,null)}}});let I=N4(F.state??{}),T=N??Z.name??"Jx Site";if(typeof T==="string"&&w0(T))T=M$(T,I)??T;let E=$H(L,I),P=$H(w,I);i9(F,I);let R={counter:{n:0},media:{...Z.$media,...F.$media},rules:[]};if(QQ(F,G,R),F.state)for(let[r,u]of Object.entries(F.state)){if(r==="$site"||r==="$page")continue;if(u&&typeof u==="object"&&!Array.isArray(u)&&u.timing==="compiler")delete F.state[r];else if(Array.isArray(u))delete F.state[r]}let C=HP(Z.$head??[]),y=Iz(C,P,E,{title:T,charset:Z.defaults?.charset??"utf8",...Z.name!=null&&{siteName:Z.name},...Z.url!=null&&{siteUrl:Z.url},pageUrl:$.urlPattern});if(Z.$media)F.$media={...Z.$media,...F.$media};if(Object.values(F.$media??{}).some((r)=>T1(String(r))!==null))y.splice(2,0,{tagName:"script",textContent:D4()});if(Z.images?.optimize&&(J||W))await sU(F,Z.images,X,J,W??void 0,H);let v=await t7(F,{lang:Z.defaults?.lang??"en",prePaintScheme:!1,projectStyle:Z.style??null,...q===void 0?{}:{rewriteSrc:(r)=>q(r,Q6($.sourcePath))},title:T});if(R.rules.length>0)v.html=v.html.replace("</head>",`<style>
326
+ ${R.rules.join(`
328
327
  `)}
329
328
  </style>
330
- </head>`);v.html=uR(v.html,C,Z.defaults?.lang??"en");let d=(B.$elements??[]).filter((a)=>typeof a==="string"&&!a.startsWith("./")&&!a.startsWith("../"));if(d.length>0)v.html=hR(v.html,d);let f=null;if(!Z.build?.adapter)try{let a=await L9($.sourcePath);if(a)f=a}catch{}return{doc:B,excludeFromSitemap:H.$sitemap===!1,files:v.files,html:v.html,serverHandler:f}}function yR($,Z,X){if($.length===0)return{connectors:[],mounts:[]};let Q={};for(let Y of Z.projectContributions()){let{key:z}=Y.project;if(z in X)Q[z]=X[z]}let J=$.map((Y)=>{let z=Y.server,{module:q}=z;if(typeof q!=="string"||q==="")throw Error(`Extension class "${Y.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:z.basePath,className:Y.classDef.title??Y.name,module:q,options:{basePath:z.basePath,sections:Q},order:z.order??100}}),G=new Set;for(let Y of Object.values(Q)){if(!Y||typeof Y!=="object"||Array.isArray(Y))continue;for(let z of Object.values(Y)){let q=z?.provider;if(typeof q==="string")G.add(q)}}let W=[];for(let Y of Z.connectors()){let z=String(Y.connector.provider);if(!G.has(z))continue;let{module:q}=Y.connector;if(typeof q!=="string"||q==="")throw Error(`Connector class "${Y.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);W.push({className:Y.classDef.title??Y.name,module:q,provider:z})}return{connectors:W,mounts:J}}function bK($,Z){return $.map((X)=>{if(!X||typeof X!=="object")return X;let Q={...X};if(Q.attributes){Q.attributes={...Q.attributes};for(let[J,G]of Object.entries(Q.attributes))if(typeof G==="string"&&I0(G))Q.attributes[J]=L$(G,Z)??G}if(typeof Q.textContent==="string"&&I0(Q.textContent))Q.textContent=L$(Q.textContent,Z)??Q.textContent;return Q})}function vR($){return $.map((Z)=>{if(!Z||typeof Z!=="object"||!Z.attributes)return Z;let X={...Z,attributes:{...Z.attributes}};for(let Q of["href","src"]){let J=X.attributes[Q];if(typeof J==="string"&&gR(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function gR($){return!$.startsWith("/")&&!$.startsWith("./")&&!$.startsWith("../")&&!$.startsWith("http")&&!$.startsWith("data:")}function yK($,Z){if(!$||typeof $!=="object")return $;let X={};for(let[Q,J]of Object.entries($))if(Q==="children"&&Array.isArray(J))X.children=J.map((G)=>{if(typeof G==="string")return G;return yK(G,Z)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(I0(Y))G[W]=P8(Y,Z)??Y;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(I0(Y))G[W]=P8(Y,Z)??Y;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(I0(Y)){let z=P8(Y,Z);G[W]=z!==null?z??null:Y}X.$props=G}else if(typeof J==="string"&&I0(J))X[Q]=P8(J,Z)??J;else X[Q]=J;return X}function P8($,Z){try{let X=Z.$map?.item,Q=Z.$map?.index,J=$.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(Z,Z.$map,X,Q);return Function("state","$map","item","index",`return \`${$}\``)(Z,Z.$map,X,Q)}catch{return null}}function h9($,Z){if(!$||typeof $!=="object")return;if(typeof $.innerHTML==="string"&&I0($.innerHTML)){let Q=L$($.innerHTML,Z);if(Q!=null)$.innerHTML=String(Q).replaceAll("${","&#36;{")}if(typeof $.textContent==="string"&&I0($.textContent))$.textContent=L$($.textContent,Z)??$.textContent;if($.style&&typeof $.style==="object"){for(let[Q,J]of Object.entries($.style))if(typeof J==="string"&&I0(J))$.style[Q]=L$(J,Z)??J}if($.attributes&&typeof $.attributes==="object"){for(let[Q,J]of Object.entries($.attributes))if(typeof J==="string"&&I0(J))$.attributes[Q]=L$(J,Z)??J}if($.$props&&typeof $.$props==="object"){for(let[Q,J]of Object.entries($.$props))if(typeof J==="string"&&I0(J))$.$props[Q]=L$(J,Z)??J}let X=$.children;if(G$(X)){let Q=kK(X,Z);if(Q){$.children=Q;return}}if(typeof X==="string"&&I0(X)){let Q=L$(X,Z);if(Array.isArray(Q)){let J=Q;$.children=J;for(let G of J)h9(G,Z)}}else if(Array.isArray($.children)){let Q=0;while(Q<$.children.length){let J=$.children[Q];if(typeof J==="string"&&I0(J)){let G=L$(J,Z);if(Array.isArray(G)){let W=G;$.children.splice(Q,1,...W);for(let Y of W)h9(Y,Z);Q+=W.length;continue}}if(G$(J)){let G=kK(J,Z);if(G){$.children.splice(Q,1,...G),Q+=G.length;continue}}h9(J,Z),Q+=1}}}function kK($,Z){let X=$.items,Q=null;if(d$(X))Q=vZ(X.$ref,Z);else if(Array.isArray(X))Q=X;let J=$.map;if(!Array.isArray(Q)||!J)return null;return Q.map((G,W)=>{let Y=Object.create(Z);Y.$map={index:W,item:G},Y["$map/item"]=G,Y["$map/index"]=W;let z=yK(J,Y);return h9(z,Y),z})}function cX($,Z,X){if(!$||typeof $!=="object")return;if(Array.isArray($)){for(let J of $)cX(J,Z,X);return}if(Array.isArray($.children))for(let J of $.children)cX(J,Z,X);let Q=Z.get($.tagName);if(Q){if($.attributes){let Y=null;for(let[z,q]of Object.entries($.attributes))if(z.startsWith("props.")&&z.length>6)Y??={},Y[z.slice(6)]=q,delete $.attributes[z];if(Y)$.$props={...Y,...$.$props}}let J=Array.isArray($.children)&&$.children.length>0?$.children.map((Y)=>{if(X&&Y&&typeof Y==="object")B1(Y,X.rules,X.media,"",X.counter,"jxs");return q4(Y,{},null)}).join(`
331
- `):null,G=nJ(Q,$.$props||null,J),W=fZ(Q);if($.innerHTML=G,delete $.children,Q.style&&$.$props){let Y={...Q.state};for(let[H,B]of Object.entries($.$props))Y[H]=H in Y?B:B;let z=B4(Y,null),q={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&I0(B)){let L=i0(B,z);if(L!=null)q[H]=L}if(Object.keys(q).length>0)$.style={...$.style,...q}}if(delete $.$props,W)$.$static=!0;else $.$prerendered=!0}}function fR($,Z,X=new Map,Q=new Set){let J=Z.filter((L)=>$.includes(`<${L}`));if(J.length===0)return $;let G=J.filter((L)=>X.has(L)).map((L)=>`<link rel="stylesheet" href="/components/${L}.css">`).join(`
332
- `),W=$;if(G)W=W.replace("</head>",` ${G}
333
- </head>`);let Y=J.filter((L)=>!Q.has(L));if(Y.length===0)return W;let z=`<script type="importmap">
329
+ </head>`);v.html=LP(v.html,y,Z.defaults?.lang??"en");let h=(F.$elements??[]).filter((r)=>typeof r==="string"&&!r.startsWith("./")&&!r.startsWith("../"));if(h.length>0)v.html=FP(v.html,h);let X0=null;if(!Z.build?.adapter)try{let r=await T9($.sourcePath);if(r)X0=r}catch{}return{doc:F,excludeFromSitemap:B.$sitemap===!1,files:v.files,html:v.html,serverHandler:X0}}function UP($,Z,X){if($.length===0)return{connectors:[],mounts:[]};let Q={};for(let Y of Z.projectContributions()){let{key:z}=Y.project;if(z in X)Q[z]=X[z]}let J=$.map((Y)=>{let z=Y.server,{module:q}=z;if(typeof q!=="string"||q==="")throw Error(`Extension class "${Y.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:z.basePath,className:Y.classDef.title??Y.name,module:q,options:{basePath:z.basePath,sections:Q},order:z.order??100}}),G=new Set;for(let Y of Object.values(Q)){if(!Y||typeof Y!=="object"||Array.isArray(Y))continue;for(let z of Object.values(Y)){let q=z?.provider;if(typeof q==="string")G.add(q)}}let W=[];for(let Y of Z.connectors()){let z=String(Y.connector.provider);if(!G.has(z))continue;let{module:q}=Y.connector;if(typeof q!=="string"||q==="")throw Error(`Connector class "${Y.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);W.push({className:Y.classDef.title??Y.name,module:q,provider:z})}return{connectors:W,mounts:J}}function $H($,Z){return $.map((X)=>{if(!X||typeof X!=="object")return X;let Q={...X};if(Q.attributes){Q.attributes={...Q.attributes};for(let[J,G]of Object.entries(Q.attributes))if(typeof G==="string"&&w0(G))Q.attributes[J]=M$(G,Z)??G}if(typeof Q.textContent==="string"&&w0(Q.textContent))Q.textContent=M$(Q.textContent,Z)??Q.textContent;return Q})}function HP($){return $.map((Z)=>{if(!Z||typeof Z!=="object"||!Z.attributes)return Z;let X={...Z,attributes:{...Z.attributes}};for(let Q of["href","src"]){let J=X.attributes[Q];if(typeof J==="string"&&VP(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function VP($){return!$.startsWith("/")&&!$.startsWith("./")&&!$.startsWith("../")&&!$.startsWith("http")&&!$.startsWith("data:")}function XH($,Z){if(!$||typeof $!=="object")return $;let X={};for(let[Q,J]of Object.entries($))if(Q==="children"&&Array.isArray(J))X.children=J.map((G)=>{if(typeof G==="string")return G;return XH(G,Z)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y))G[W]=m5(Y,Z)??Y;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y))G[W]=m5(Y,Z)??Y;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y)){let z=m5(Y,Z);G[W]=z!==null?z??null:Y}X.$props=G}else if(typeof J==="string"&&w0(J))X[Q]=m5(J,Z)??J;else X[Q]=J;return X}function m5($,Z){try{let X=Z.$map?.item,Q=Z.$map?.index,J=$.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(Z,Z.$map,X,Q);return Function("state","$map","item","index",`return \`${$}\``)(Z,Z.$map,X,Q)}catch{return null}}function i9($,Z){if(!$||typeof $!=="object")return;if(typeof $.innerHTML==="string"&&w0($.innerHTML)){let Q=M$($.innerHTML,Z);if(Q!=null)$.innerHTML=String(Q).replaceAll("${","&#36;{")}if(typeof $.textContent==="string"&&w0($.textContent))$.textContent=M$($.textContent,Z)??$.textContent;if($.style&&typeof $.style==="object"){for(let[Q,J]of Object.entries($.style))if(typeof J==="string"&&w0(J))$.style[Q]=M$(J,Z)??J}if($.attributes&&typeof $.attributes==="object"){for(let[Q,J]of Object.entries($.attributes))if(typeof J==="string"&&w0(J))$.attributes[Q]=M$(J,Z)??J}if($.$props&&typeof $.$props==="object"){for(let[Q,J]of Object.entries($.$props))if(typeof J==="string"&&w0(J))$.$props[Q]=M$(J,Z)??J}let X=$.children;if(G$(X)){let Q=ZH(X,Z);if(Q&&Q.length>0){$.children=Q;return}}if(typeof X==="string"&&w0(X)){let Q=M$(X,Z);if(Array.isArray(Q)){let J=Q;$.children=J;for(let G of J)i9(G,Z)}}else if(Array.isArray($.children)){let Q=0;while(Q<$.children.length){let J=$.children[Q];if(typeof J==="string"&&w0(J)){let G=M$(J,Z);if(Array.isArray(G)){let W=G;$.children.splice(Q,1,...W);for(let Y of W)i9(Y,Z);Q+=W.length;continue}}if(G$(J)){let G=ZH(J,Z);if(G&&G.length>0){$.children.splice(Q,1,...G),Q+=G.length;continue}}i9(J,Z),Q+=1}}}function ZH($,Z){let X=$.items,Q=null;if(U$(X))Q=aZ(X.$ref,Z);else if(Array.isArray(X))Q=X;let J=$.map;if(!Array.isArray(Q)||!J)return null;return Q.map((G,W)=>{let Y=Object.create(Z);Y.$map={index:W,item:G},Y["$map/item"]=G,Y["$map/index"]=W;let z=XH(J,Y);return i9(z,Y),z})}function QQ($,Z,X){if(!$||typeof $!=="object")return;if(Array.isArray($)){for(let J of $)QQ(J,Z,X);return}if(Array.isArray($.children))for(let J of $.children)QQ(J,Z,X);let Q=Z.get($.tagName);if(Q){if($.attributes){let Y=null;for(let[z,q]of Object.entries($.attributes))if(z.startsWith("props.")&&z.length>6)Y??={},Y[z.slice(6)]=q,delete $.attributes[z];if(Y)$.$props={...Y,...$.$props}}let J=Array.isArray($.children)&&$.children.length>0?$.children.map((Y)=>{if(X&&Y&&typeof Y==="object")F6(Y,X.rules,X.media,"",X.counter,"jxs");return F4(Y,{},null)}).join(`
330
+ `):null,G=zG(Q,$.$props||null,J),W=sZ(Q);if($.innerHTML=G,delete $.children,Q.style&&$.$props){let Y={...Q.state};for(let[H,B]of Object.entries($.$props))Y[H]=H in Y?B:B;let z=N4(Y,null),q={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&w0(B)){let F=r0(B,z);if(F!=null)q[H]=F}if(Object.keys(q).length>0)$.style={...$.style,...q}}if(delete $.$props,W)$.$static=!0;else $.$prerendered=!0}}function BP($,Z,X=new Map,Q=new Set,J=""){let G=(N)=>$.includes(`<${N}`),W=(N)=>J.includes(`<${N}`),Y=Z.filter((N)=>G(N)||W(N));if(Y.length===0)return $;let z=Y.filter((N)=>X.has(N)).map((N)=>`<link rel="stylesheet" href="/components/${N}.css">`).join(`
331
+ `),q=$;if(z)q=q.replace("</head>",` ${z}
332
+ </head>`);let H=Y.filter((N)=>W(N)||!Q.has(N));if(H.length===0)return q;let B=`<script type="importmap">
334
333
  {
335
334
  "imports": {
336
- "@vue/reactivity": "${K4}",
337
- "lit-html": "${H4}"
335
+ "@vue/reactivity": "${M4}",
336
+ "lit-html": "${A4}"
338
337
  }
339
338
  }
340
- </script>`,q=Y.map((L)=>`<script type="module" src="/components/${L}.js"></script>`).join(`
341
- `),B=(W.includes('<script type="importmap">')?"":`${z}
342
- `)+q;return W.replace("</body>",` ${B}
343
- </body>`)}function hR($,Z){let X=Z.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
339
+ </script>`,F=H.map((N)=>`<script type="module" src="/components/${N}.js"></script>`).join(`
340
+ `),w=(q.includes('<script type="importmap">')?"":`${B}
341
+ `)+F;return q.replace("</body>",` ${w}
342
+ </body>`)}function FP($,Z){let X=Z.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
344
343
  `);return $.replace("</body>",` ${X}
345
- </body>`)}function uR($,Z,X){let Q=eY(Z),J=/<head>([\s\S]*?)<\/head>/i,G=$.match(J),W="";if(G){let z=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)W+=`
344
+ </body>`)}function LP($,Z,X){let Q=Nz(Z),J=/<head>([\s\S]*?)<\/head>/i,G=$.match(J),W="";if(G){let z=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)W+=`
346
345
  ${z.join(`
347
346
  `)}`;let q=G[1].match(/<script[\s\S]*?<\/script>/gi);if(q)W+=`
348
347
  ${q.join(`
349
348
  `)}`}let Y=$;if(J.test(Y))Y=Y.replace(J,`<head>
350
349
  ${Q}${W}
351
- </head>`);return Y=Y.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Y}function vK($,Z,X){if($==="/")return g4(Z,"index.html");let Q=$.replace(/^\//,"");if(X==="always")return g4(Z,Q,"index.html");return g4(Z,`${Q}.html`)}function mR($,Z,X=new Set){let Q=0,J=[],G=(Y)=>Y.length>1&&Y.endsWith("/")?Y.slice(0,-1):Y,W=new Set([...X].map((Y)=>G(Y)));for(let[Y,z]of Object.entries($)){let q=typeof z==="object"?z.destination:z,H=typeof z==="object"?z.status??301:301;if(Y.includes(":")||Y.includes("*")){J.push(`${Y} ${q} ${H}`);continue}if(W.has(G(Y)))console.warn(`Redirect "${Y}" overwrites a compiled page at the same route — `+"remove the redirect or the page.");let B=vK(Y,Z,"always"),L=`<!DOCTYPE html>
350
+ </head>`);return Y=Y.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Y}function QH($,Z,X){if($==="/")return c4(Z,"index.html");let Q=$.replace(/^\//,"");if(X==="always")return c4(Z,Q,"index.html");return c4(Z,`${Q}.html`)}function MP($,Z,X=new Set){let Q=0,J=[],G=(Y)=>Y.length>1&&Y.endsWith("/")?Y.slice(0,-1):Y,W=new Set([...X].map((Y)=>G(Y)));for(let[Y,z]of Object.entries($)){let q=typeof z==="object"?z.destination:z,H=typeof z==="object"?z.status??301:301;if(Y.includes(":")||Y.includes("*")){J.push(`${Y} ${q} ${H}`);continue}if(W.has(G(Y)))console.warn(`Redirect "${Y}" overwrites a compiled page at the same route — `+"remove the redirect or the page.");let B=QH(Y,Z,"always"),F=`<!DOCTYPE html>
352
351
  <html>
353
352
  <head>
354
353
  <meta charset="utf-8">
355
- <meta http-equiv="refresh" content="0;url=${lX(q)}">
356
- <link rel="canonical" href="${lX(q)}">
354
+ <meta http-equiv="refresh" content="0;url=${XQ(q)}">
355
+ <link rel="canonical" href="${XQ(q)}">
357
356
  <title>Redirecting...</title>
358
357
  </head>
359
358
  <body>
360
- <p>Redirecting to <a href="${lX(q)}">${dR(q)}</a>...</p>
359
+ <p>Redirecting to <a href="${XQ(q)}">${AP(q)}</a>...</p>
361
360
  </body>
362
- </html>`;Z1(X1(B),{recursive:!0}),X6(B,L,"utf8"),Q+=1,J.push(`${Y} ${q} ${H}`)}if(J.length>0)X6(g4(Z,"_redirects"),`${J.join(`
361
+ </html>`;X6(Q6(B),{recursive:!0}),Q1(B,F,"utf8"),Q+=1,J.push(`${Y} ${q} ${H}`)}if(J.length>0)Q1(c4(Z,"_redirects"),`${J.join(`
363
362
  `)}
364
- `,"utf8"),Q+=1;return Q}function dR($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function lX($){return String($).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function lR($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function cR($,Z){if($.length===0)return 0;let Q=`<?xml version="1.0" encoding="UTF-8"?>
363
+ `,"utf8"),Q+=1;return Q}function AP($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function XQ($){return String($).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function IP($){return String($).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function NP($,Z){if($.length===0)return 0;let Q=`<?xml version="1.0" encoding="UTF-8"?>
365
364
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
366
365
  ${$.map((J)=>` <url>
367
- <loc>${lR(J.loc)}</loc>
366
+ <loc>${IP(J.loc)}</loc>
368
367
  <lastmod>${J.lastmod.toISOString().slice(0,10)}</lastmod>
369
368
  </url>`).join(`
370
369
  `)}
371
370
  </urlset>
372
- `;return X6(g4(Z,"sitemap.xml"),Q,"utf8"),1}function pR($,Z){let X=g4($,"robots.txt"),Q=e1(X),J=Q?ER(X,"utf8"):`User-agent: *
371
+ `;return Q1(c4(Z,"sitemap.xml"),Q,"utf8"),1}function DP($,Z){let X=c4($,"robots.txt"),Q=Q4(X),J=Q?XP(X,"utf8"):`User-agent: *
373
372
  Allow: /
374
373
  `;if(/^Sitemap:/im.test(J))return 0;if(!J.endsWith(`
375
374
  `))J+=`
376
375
  `;return J+=`
377
376
  Sitemap: ${new URL("/sitemap.xml",Z).href}
378
- `,X6(X,J,"utf8"),Q?0:1}var fK=t(()=>{D6();dY();I9();nY();i6();aY();sY();Zz();tW();A9();F1();Qz();xK();uX()});var uK={};h6(uK,{runDev:()=>aR,resolveDevEntry:()=>hK});import{createRequire as iR}from"node:module";import{join as nR}from"node:path";import{spawn as rR}from"node:child_process";function hK($){try{return iR(nR($,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${$}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function aR($,Z,X=rR,Q=process){let G=[hK($),"--root",$];if(Z!==void 0)G.push("--port",String(Z));let W=X("bun",G,{stdio:"inherit"});return W.on("error",(Y)=>{if(Y.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${Y.message}`);Q.exitCode=1}),Q.on("SIGINT",()=>{W.kill("SIGINT")}),Q.on("SIGTERM",()=>{W.kill("SIGTERM")}),W.on("exit",(Y)=>{Q.exitCode=Y??0}),W}var mK=()=>{};var pK={};h6(pK,{startPreviewServer:()=>XP,resolvePreviewFile:()=>cK});import{createServer as oR}from"node:http";import{existsSync as C8,readFileSync as dK,statSync as sR}from"node:fs";import{extname as tR,join as pX,normalize as eR,resolve as lK,sep as $P}from"node:path";function cK($,Z){let X=eR(Z).replaceAll("\\","/"),Q=lK($,`.${X.startsWith("/")?X:`/${X}`}`);if(Q!==$&&!Q.startsWith($+$P))return null;if(C8(Q)){if(sR(Q).isDirectory()){let G=pX(Q,"index.html");return C8(G)?G:null}return Q}let J=pX(Q,"index.html");return C8(J)?J:null}function XP($,Z){let X=lK($),Q=oR((J,G)=>{let W=new URL(J.url??"/","http://localhost"),Y=cK(X,decodeURIComponent(W.pathname));if(Y){G.writeHead(200,{"Content-Type":ZP[tR(Y).toLowerCase()]??"application/octet-stream"}),G.end(dK(Y));return}let z=pX(X,"404.html");if(C8(z)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(dK(z));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return Q.listen(Z),Q}var ZP;var iK=t(()=>{ZP={".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".md":"text/markdown; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8"}});var u9="https://jxsuite.com/schema/project/fields/v2",f4="https://jxsuite.com/schema/document/paths/v2",nK,rK;var S8=t(()=>{nK={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"},rK={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"}});function tK($){let{corePath:Z,fragments:X,fieldSchemaRefs:Q=[]}=$;return{$comment:sK,$defs:{Fields:{$id:u9,anyOf:[{$ref:`${aK}#/$defs/JxFieldSchema`},{$ref:`${aK}#/$defs/RelationshipRef`},...Q.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z},...X.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function m9($,Z,X){let Q=structuredClone($),J=new Map,G=new Set;iX(Q,G);let W=0,Y=async(q)=>{let H=oK(q),B=J.get(H);if(B!==void 0)return B;let L;try{L=structuredClone(await Z(H))}catch(D){throw Error(`bundleSchema: cannot load $ref target "${H}": ${JP(D)}`,{cause:D})}let M=typeof L.$id==="string"&&_8(L.$id)?L.$id:null;W+=M===null?1:0;let A=M??`urn:jx:bundled:${W}`;if(J.set(H,A),G.has(A))return A;G.add(A),L.$id=A,await z(L,QP(H),!0);let w=Q.$defs??={};return w[A]=L,A},z=async(q,H,B=!1)=>{if(Array.isArray(q)){for(let w of q)await z(w,H);return}if(q===null||typeof q!=="object")return;let L=q,M=H;if(!B&&typeof L.$id==="string"&&_8(L.$id))M=null;let A=L.$ref;if(typeof A==="string"&&M!==null&&!A.startsWith("#")&&!_8(A)){let w=A.indexOf("#"),D=w===-1?A:A.slice(0,w),j=w===-1?"":A.slice(w);if(D){let E=await Y(`${M}/${D}`);L.$ref=`${E}${j}`}}for(let w of Object.values(L))await z(w,M)};return await z(Q,oK(X),!0),Q}function iX($,Z){if(Array.isArray($)){for(let Q of $)iX(Q,Z);return}if($===null||typeof $!=="object")return;let X=$;if(typeof X.$id==="string"&&_8(X.$id))Z.add(X.$id);for(let Q of Object.values(X))iX(Q,Z)}function _8($){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test($)}function oK($){let Z=$.replaceAll("\\","/"),X=Z.startsWith("/"),Q=[];for(let J of Z.split("/")){if(J===""||J===".")continue;if(J===".."){if(Q.length>0&&Q.at(-1)!=="..")Q.pop();else if(!X)Q.push("..");continue}Q.push(J)}return(X?"/":"")+Q.join("/")}function QP($){let Z=$.lastIndexOf("/");if(Z===-1)return".";return Z===0?"/":$.slice(0,Z)}function JP($){return $ instanceof Error?$.message:String($)}function eK($){let{corePath:Z,pathsValueRefs:X}=$;return{$comment:sK,$defs:{PathsValue:X.length>0?{$id:f4,anyOf:X.map((Q)=>({$ref:Q}))}:{$id:f4}},$ref:Z,$schema:"https://json-schema.org/draft/2020-12/schema"}}var aK="https://jxsuite.com/schema/project/core/v2",sK="Generated by `jx schema` from project.json#/extensions — do not edit.";var $H=t(()=>{S8();S8()});var UH={};h6(UH,{writeProjectSchemas:()=>YH,readBundledProjectSchemas:()=>aX});import{existsSync as WH,readFileSync as d9,statSync as ZH,writeFileSync as XH}from"node:fs";import{createRequire as x8}from"node:module";import{dirname as GP,isAbsolute as WP,relative as nX,resolve as k6,sep as rX}from"node:path";async function YH($){let{config:Z}=D1($),X=await E6($,Z),Q=QH($,YP),J=[],G=[],W=[];for(let M of X.extensions){let A=M.schemas.project;if(A)J.push(JH($,M,A));let w=M.schemas.document;if(w)G.push(...GH(w));let D=M.schemas.fields;if(D)W.push(...GH(D)),J.push(JH($,M,D))}let Y=k6($),z=zH(Y),q=await m9(tK({corePath:Q,fieldSchemaRefs:W,fragments:J}),z,Y),H=await m9(eK({corePath:QH($,zP),pathsValueRefs:G}),z,Y),B=k6($,"project.schema.json"),L=k6($,"document.schema.json");return XH(B,`${JSON.stringify(q,null,2)}
379
- `,"utf8"),XH(L,`${JSON.stringify(H,null,2)}
380
- `,"utf8"),{documentSchemaPath:L,projectSchemaPath:B}}async function aX($){let Z=k6($),X=k6(Z,"project.json"),Q=k6(Z,"project.schema.json"),J=k6(Z,"document.schema.json"),G=(q)=>{if(!WH(q))return!0;try{return ZH(X).mtimeMs>ZH(q).mtimeMs}catch{return!1}};if(G(Q)||G(J))await YH(Z);let W=zH(Z),Y=await m9(JSON.parse(d9(Q,"utf8")),W,Z);return{document:await m9(JSON.parse(d9(J,"utf8")),W,Z),project:Y}}function zH($){return async(Z)=>{let X=k6(Z),Q=nX($,X);if(Q.startsWith("..")||WP(Q))throw Error(`Schema ref "${Z}" escapes the project root ${$}`);if(WH(X))return JSON.parse(d9(X,"utf8"));let J=Q.split(rX).join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${Z}" does not exist`);let Y=J.slice(W+G.length),z;try{z=x8(k6($,"package.json")).resolve(Y)}catch{try{z=x8(import.meta.url).resolve(Y)}catch(q){throw Error(`Schema ref "${Z}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(d9(z,"utf8"))}}function QH($,Z){let X=null;try{X=x8(k6($,"package.json")).resolve(Z)}catch{try{X=x8(import.meta.url).resolve(Z)}catch{X=null}}let Q=`./node_modules/${Z}`;return X?qH($,X,Q):Q}function JH($,Z,X){let Q=nX(GP(Z.manifestPath),X).split(rX).join("/"),J=`./node_modules/${Z.specifier}/${Q}`;return qH($,X,J)}function qH($,Z,X){let Q=nX($,Z).split(rX).join("/");if(Q.startsWith(".."))return X;return Q.startsWith("./")?Q:`./${Q}`}function GH($){let Z;try{Z=JSON.parse(d9($,"utf8"))}catch{return[]}let{$id:X}=Z;if(typeof X!=="string"||!Z.$defs)return[];return Object.keys(Z.$defs).map((Q)=>`${X}#/$defs/${Q}`)}var YP="@jxsuite/schema/schemas/project.core.schema.json",zP="@jxsuite/schema/schema.json";var oX=t(()=>{$H();i6();I9()});var BH=b((Xp,VH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",KH=w0("fs").promises,HH=w0("path");async function qP({folder:$=__dirname}={}){let Z={},X=await KH.readdir($);for(let Q of X)if(Q.endsWith(".json")&&Q!=="package.json"){let J=await KH.readFile(HH.join($,Q),"utf8");Z[HH.basename(Q,".json")]=JSON.parse(J)}return Z}VH.exports={listAll:qP}});var MH=b((Qp,LH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",UP=w0("fs").promises,KP=w0("path");async function FH({folder:$=__dirname}={}){let Z=await UP.readFile(KP.join($,"css.json"),"utf8");return JSON.parse(Z)}async function HP({folder:$=__dirname}={}){let Z=await FH($),X={};for(let[Q,J]of Object.entries(Z)){X[Q]={};for(let G of J){let W=G.name,Y=null;if(G.for)Y=J.find((z)=>z!==G&&z.name===G.name);if(Y)W+=" for "+G.for[0];if(X[Q][W]=G,G.descriptors){let z=G.descriptors;G.descriptors={};for(let q of z)G.descriptors[q.name]=q}}}return X}LH.exports={listAll:FH,index:HP}});var AH=b((b8,sX)=>{(function($,Z){typeof b8=="object"&&typeof sX=="object"?sX.exports=Z():typeof define=="function"&&define.amd?define([],Z):typeof b8=="object"?b8.WebIDL2=Z():$.WebIDL2=Z()})(globalThis,()=>(()=>{var $={d:(U,F)=>{for(var N in F)$.o(F,N)&&!$.o(U,N)&&Object.defineProperty(U,N,{enumerable:!0,get:F[N]})},o:(U,F)=>Object.prototype.hasOwnProperty.call(U,F),r:(U)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})}},Z={};function X(U,F,N,T,O,{level:g="error",autofix:n,ruleName:Q0}={}){function B0(h$){return h$>0?U.slice(F,F+h$):U.slice(Math.max(F+h$,0),F)}function F0(h$,{precedes:v1}={}){let f6=h$.map((G9)=>G9.trivia+G9.value).join(""),J9=U[F];return J9.type==="eof"?f6:v1?f6+J9.trivia:f6.slice(J9.trivia.length)}let D0=U[F].type!=="eof"?U[F].line:U.length>1?U[F-1].line:1,S0=function(h$){let v1=h$.split(`
381
- `);return v1[v1.length-1]}(F0(B0(-5),{precedes:!0})),V$=B0(5),O$=F0(V$),Q9=S0+O$.split(`
377
+ `,Q1(X,J,"utf8"),Q?0:1}var GH=s(()=>{w1();R9();Wz();E9();Uz();r1();Vz();Lz();Az();wz();BY();O9();L6();jz();eU();eX()});var YH={};m1(YH,{runDev:()=>OP,resolveDevEntry:()=>WH});import{createRequire as wP}from"node:module";import{join as TP}from"node:path";import{spawn as jP}from"node:child_process";function WH($){try{return wP(TP($,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${$}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function OP($,Z,X=jP,Q=process){let G=[WH($),"--root",$];if(Z!==void 0)G.push("--port",String(Z));let W=X("bun",G,{stdio:"inherit"});return W.on("error",(Y)=>{if(Y.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${Y.message}`);Q.exitCode=1}),Q.on("SIGINT",()=>{W.kill("SIGINT")}),Q.on("SIGTERM",()=>{W.kill("SIGTERM")}),W.on("exit",(Y)=>{Q.exitCode=Y??0}),W}var zH=()=>{};var HH={};m1(HH,{startPreviewServer:()=>bP,resolvePreviewFile:()=>UH});import{createServer as EP}from"node:http";import{existsSync as d5,readFileSync as qH,statSync as RP}from"node:fs";import{extname as PP,join as JQ,normalize as CP,resolve as KH,sep as SP}from"node:path";function UH($,Z){let X=CP(Z).replaceAll("\\","/"),Q=KH($,`.${X.startsWith("/")?X:`/${X}`}`);if(Q!==$&&!Q.startsWith($+SP))return null;if(d5(Q)){if(RP(Q).isDirectory()){let G=JQ(Q,"index.html");return d5(G)?G:null}return Q}let J=JQ(Q,"index.html");return d5(J)?J:null}function bP($,Z){let X=KH($),Q=EP((J,G)=>{let W=new URL(J.url??"/","http://localhost"),Y=UH(X,decodeURIComponent(W.pathname));if(Y){G.writeHead(200,{"Content-Type":_P[PP(Y).toLowerCase()]??"application/octet-stream"}),G.end(qH(Y));return}let z=JQ(X,"404.html");if(d5(z)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(qH(z));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return Q.listen(Z),Q}var _P;var VH=s(()=>{_P={".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".md":"text/markdown; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8"}});var n9="https://jxsuite.com/schema/project/fields/v2",J4="https://jxsuite.com/schema/document/paths/v2",BH,FH,r9,GQ;var l5=s(()=>{BH={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"},FH={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"},r9=[{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"},{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"}],GQ={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"}});function xP($){let{corePath:Z,fragments:X,fieldSchemaRefs:Q=[]}=$;return{$comment:IH,$defs:{Fields:{$id:n9,anyOf:[{$ref:`${LH}#/$defs/JxFieldSchema`},{$ref:`${LH}#/$defs/RelationshipRef`},...Q.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z},...X.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function o9($,Z,X,Q=[]){let J=structuredClone($),G=new Map,W=new Set;WQ(J,W);let Y=0,z=async(H)=>{let B=a9(H),F=G.get(B);if(F!==void 0)return F;let L;try{L=structuredClone(await Z(B))}catch(T){throw Error(`bundleSchema: cannot load $ref target "${B}": ${uP(T)}`,{cause:T})}let w=typeof L.$id==="string"&&S6(L.$id)?L.$id:null;Y+=w===null?1:0;let N=w??`urn:jx:bundled:${Y}`;if(G.set(B,N),W.has(N))return N;W.add(N),L.$id=N,await q(L,hP(B),!0);let I=J.$defs??={};return I[N]=L,N},q=async(H,B,F=!1)=>{if(Array.isArray(H)){for(let I of H)await q(I,B);return}if(H===null||typeof H!=="object")return;let L=H,w=B;if(!F&&typeof L.$id==="string"&&S6(L.$id))w=null;let N=L.$ref;if(typeof N==="string"&&w!==null&&!N.startsWith("#")&&!S6(N)){let I=N.indexOf("#"),T=I===-1?N:N.slice(0,I),E=I===-1?"":N.slice(I);if(T){let P=await z(`${w}/${T}`);L.$ref=`${P}${E}`}}for(let I of Object.values(L))await q(I,w)};await q(J,a9(X),!0);for(let H of Q)await z(`${a9(X)}/${H}`);return J}function G4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function gP($){return $.replaceAll("~","~0").replaceAll("/","~1")}function*MH($,Z){for(let X of kP){let Q=$[X];if(Array.isArray(Q)){for(let[J,G]of Q.entries())if(G4(G))yield[G,`${Z}/${X}/${J}`]}else if(G4(Q))yield[Q,`${Z}/${X}`]}for(let X of yP){let Q=$[X];if(!G4(Q))continue;for(let[J,G]of Object.entries(Q))if(G4(G))yield[G,`${Z}/${X}/${gP(J)}`]}for(let X of vP){let Q=$[X];if(!Array.isArray(Q))continue;for(let[J,G]of Q.entries())if(G4(G))yield[G,`${Z}/${X}/${J}`]}}function fP($,Z){let X=$.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(X.startsWith("//")){let G=X.indexOf("/",2);X=G===-1?"":X.slice(G+1)}X=X.replace(/^schema\//,"");let Q=X.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",J=Q;for(let G=2;Z.has(J);G+=1)J=`${Q}-${G}`;return Z.add(J),J}function s9($){let Z=structuredClone($);if(G4(Z.$defs)){let G=new Set(Object.keys(Z.$defs).filter((Y)=>!S6(Y))),W={};for(let[Y,z]of Object.entries(Z.$defs)){let q=G4(z)&&typeof z.$id==="string"?z.$id:Y;W[S6(Y)?fP(q,G):Y]=z}Z.$defs=W}let X=new Map,Q=(G,W)=>{let{$id:Y}=G;if(typeof Y==="string"&&S6(Y)&&!X.has(Y))X.set(Y,W);for(let[z,q]of MH(G,W))Q(z,q)};Q(Z,"#");let J=(G,W)=>{let Y=W,{$id:z}=G;if(typeof z==="string"&&S6(z)){if(Y=X.get(z)??W,Y!=="#")delete G.$id}let q=G.$ref;if(typeof q==="string"){let H=q.indexOf("#"),B=H===-1?q:q.slice(0,H),F=H===-1?"":q.slice(H+1);if(B===""){if(F.startsWith("/"))G.$ref=`${Y}${F}`}else{let L=X.get(B);if(L!==void 0)G.$ref=F?`${L}${F}`:L}}for(let[H]of MH(G,Y))J(H,Y)};return J(Z,"#"),Z}function WQ($,Z){if(Array.isArray($)){for(let Q of $)WQ(Q,Z);return}if($===null||typeof $!=="object")return;let X=$;if(typeof X.$id==="string"&&S6(X.$id))Z.add(X.$id);for(let Q of Object.values(X))WQ(Q,Z)}function S6($){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test($)}function a9($){let Z=$.replaceAll("\\","/"),X=Z.startsWith("/"),Q=[];for(let J of Z.split("/")){if(J===""||J===".")continue;if(J===".."){if(Q.length>0&&Q.at(-1)!=="..")Q.pop();else if(!X)Q.push("..");continue}Q.push(J)}return(X?"/":"")+Q.join("/")}function hP($){let Z=$.lastIndexOf("/");if(Z===-1)return".";return Z===0?"/":$.slice(0,Z)}function uP($){return $ instanceof Error?$.message:String($)}function mP($){let{corePath:Z,pathsValueRefs:X}=$;return{$comment:IH,$defs:{PathsValue:{$id:J4,anyOf:[...r9,...X.map((Q)=>({$ref:Q}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z}]}}async function NH($){let{baseDir:Z,coreDocumentRef:X,coreProjectRef:Q,extensions:J,loadJson:G}=$,W=[],Y=[],z=[],q=[];for(let F of J){if(F.project)W.push(F.project);if(F.document){let L=await AH(F.document,G,Z);if(Y.push(...L),L.length>0)z.push(F.document)}if(F.fields)q.push(...await AH(F.fields,G,Z)),W.push(F.fields)}let H=xP({corePath:Q,fieldSchemaRefs:q,fragments:W}),B=mP({corePath:X,pathsValueRefs:Y});return{document:s9(await o9(B,G,Z,z)),project:s9(await o9(H,G,Z))}}async function AH($,Z,X){let Q;try{Q=await Z(a9(`${a9(X)}/${$}`))}catch{return[]}let{$id:J}=Q;if(typeof J!=="string"||!Q.$defs)return[];return Object.keys(Q.$defs).map((G)=>`${J}#/$defs/${G}`)}var LH="https://jxsuite.com/schema/project/core/v2",IH="Generated by `jx schema` from project.json#/extensions — do not edit.",kP,yP,vP;var DH=s(()=>{l5();l5();kP=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],yP=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],vP=["allOf","anyOf","oneOf","prefixItems"]});var CH={};m1(CH,{writeProjectSchemas:()=>EH,readBundledProjectSchemas:()=>KQ});import{existsSync as OH,readFileSync as c5,statSync as wH,writeFileSync as TH}from"node:fs";import{createRequire as p5}from"node:module";import{dirname as dP,isAbsolute as lP,relative as zQ,resolve as v1,sep as qQ}from"node:path";async function EH($){let{config:Z}=T6($),X=await R1($,Z),Q=v1($),{document:J,project:G}=await NH({baseDir:Q,coreDocumentRef:jH($,pP),coreProjectRef:jH($,cP),extensions:X.extensions.map((z)=>({document:z.schemas.document&&YQ($,z,z.schemas.document),fields:z.schemas.fields&&YQ($,z,z.schemas.fields),project:z.schemas.project&&YQ($,z,z.schemas.project)})),loadJson:RH(Q)}),W=v1($,"project.schema.json"),Y=v1($,"document.schema.json");return TH(W,`${JSON.stringify(G,null,2)}
378
+ `,"utf8"),TH(Y,`${JSON.stringify(J,null,2)}
379
+ `,"utf8"),{documentSchemaPath:Y,projectSchemaPath:W}}async function KQ($){let Z=v1($),X=v1(Z,"project.json"),Q=v1(Z,"project.schema.json"),J=v1(Z,"document.schema.json"),G=(B)=>{if(!OH(B))return!0;try{return wH(X).mtimeMs>wH(B).mtimeMs}catch{return!1}};if(G(Q)||G(J))await EH(Z);let W=RH(Z),Y=JSON.parse(c5(Q,"utf8")),z=JSON.parse(c5(J,"utf8")),q=s9(await o9(Y,W,Z));return{document:s9(await o9(z,W,Z)),project:q}}function RH($){return async(Z)=>{let X=v1(Z),Q=zQ($,X);if(Q.startsWith("..")||lP(Q))throw Error(`Schema ref "${Z}" escapes the project root ${$}`);if(OH(X))return JSON.parse(c5(X,"utf8"));let J=Q.split(qQ).join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${Z}" does not exist`);let Y=J.slice(W+G.length),z;try{z=p5(v1($,"package.json")).resolve(Y)}catch{try{z=p5(import.meta.url).resolve(Y)}catch(q){throw Error(`Schema ref "${Z}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(c5(z,"utf8"))}}function jH($,Z){let X=null;try{X=p5(v1($,"package.json")).resolve(Z)}catch{try{X=p5(import.meta.url).resolve(Z)}catch{X=null}}let Q=`./node_modules/${Z}`;return X?PH($,X,Q):Q}function YQ($,Z,X){let Q=zQ(dP(Z.manifestPath),X).split(qQ).join("/"),J=`./node_modules/${Z.specifier}/${Q}`;return PH($,X,J)}function PH($,Z,X){let Q=zQ($,Z).split(qQ).join("/");if(Q.startsWith(".."))return X;return Q.startsWith("./")?Q:`./${Q}`}var cP="@jxsuite/schema/schemas/project.core.schema.json",pP="@jxsuite/schema/schema.json";var UQ=s(()=>{DH();r1();E9()});var xH=b((np,bH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",SH=O0("fs").promises,_H=O0("path");async function iP({folder:$=__dirname}={}){let Z={},X=await SH.readdir($);for(let Q of X)if(Q.endsWith(".json")&&Q!=="package.json"){let J=await SH.readFile(_H.join($,Q),"utf8");Z[_H.basename(Q,".json")]=JSON.parse(J)}return Z}bH.exports={listAll:iP}});var vH=b((rp,yH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",nP=O0("fs").promises,rP=O0("path");async function kH({folder:$=__dirname}={}){let Z=await nP.readFile(rP.join($,"css.json"),"utf8");return JSON.parse(Z)}async function aP({folder:$=__dirname}={}){let Z=await kH($),X={};for(let[Q,J]of Object.entries(Z)){X[Q]={};for(let G of J){let W=G.name,Y=null;if(G.for)Y=J.find((z)=>z!==G&&z.name===G.name);if(Y)W+=" for "+G.for[0];if(X[Q][W]=G,G.descriptors){let z=G.descriptors;G.descriptors={};for(let q of z)G.descriptors[q.name]=q}}}return X}yH.exports={listAll:kH,index:aP}});var gH=b((i5,HQ)=>{(function($,Z){typeof i5=="object"&&typeof HQ=="object"?HQ.exports=Z():typeof define=="function"&&define.amd?define([],Z):typeof i5=="object"?i5.WebIDL2=Z():$.WebIDL2=Z()})(globalThis,()=>(()=>{var $={d:(K,M)=>{for(var D in M)$.o(M,D)&&!$.o(K,D)&&Object.defineProperty(K,D,{enumerable:!0,get:M[D]})},o:(K,M)=>Object.prototype.hasOwnProperty.call(K,M),r:(K)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})}},Z={};function X(K,M,D,j,O,{level:g="error",autofix:i,ruleName:Q0}={}){function L0(u$){return u$>0?K.slice(M,M+u$):K.slice(Math.max(M+u$,0),M)}function M0(u$,{precedes:h6}={}){let u1=u$.map((U9)=>U9.trivia+U9.value).join(""),K9=K[M];return K9.type==="eof"?u1:h6?u1+K9.trivia:u1.slice(K9.trivia.length)}let j0=K[M].type!=="eof"?K[M].line:K.length>1?K[M-1].line:1,b0=function(u$){let h6=u$.split(`
380
+ `);return h6[h6.length-1]}(M0(L0(-5),{precedes:!0})),B$=L0(5),E$=M0(B$),q9=b0+E$.split(`
382
381
  `)[0]+`
383
- `+(" ".repeat(S0.length)+"^"),NZ=O==="Syntax"?"since":"inside",CJ=`${O} error at line ${D0}${U.name?` in ${U.name}`:""}${N&&N.name?`, ${NZ} \`${N.partial?"partial ":""}${function(h$){let v1=[h$];for(;h$&&h$.parent;){let{parent:f6}=h$;v1.unshift(f6),h$=f6}return v1.map((f6)=>function(J9,G9){let SJ=J9;return G9&&(SJ+=` ${G9}`),SJ}(f6.type,f6.name)).join(" -> ")}(N)}\``:""}:
384
- ${Q9}`;return{message:`${CJ} ${T}`,bareMessage:T,context:CJ,line:D0,sourceName:U.name,level:g,ruleName:Q0,autofix:n,input:O$,tokens:V$}}function Q(U,F,N,T){return X(U,F,N,T,"Syntax")}function J(U,F,N,T,O={}){return O.ruleName=N,X(F.source,U.index,F,T,"Validation",O)}$.r(Z),$.d(Z,{WebIDLParseError:()=>c0,parse:()=>c,validate:()=>l,write:()=>x});class G{constructor({source:U,tokens:F}){Object.defineProperties(this,{source:{value:U},tokens:{value:F,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let U={type:void 0,name:void 0,inheritance:void 0},F=this;for(;F!==Object.prototype;){let N=Object.getOwnPropertyDescriptors(F);for(let[T,O]of Object.entries(N))(O.enumerable||O.get)&&(U[T]=this[T]);F=Object.getPrototypeOf(F)}return U}}function W(U,F,{useNullableInner:N}={}){if(!U.union){let T=F.unique.get(U.idlType);if(!T)return;if(T.type==="typedef"){let{typedefIncludesDictionary:O}=F.cache;if(O.has(T))return O.get(T);F.cache.typedefIncludesDictionary.set(T,void 0);let g=W(T.idlType,F);if(F.cache.typedefIncludesDictionary.set(T,g),g)return{reference:U,dictionary:g.dictionary}}if(T.type==="dictionary"&&(N||!U.nullable))return{reference:U,dictionary:T}}for(let T of U.subtype){let O=W(T,F);if(O)return T.union?O:{reference:T,dictionary:O.dictionary}}}function Y(U,F){if(F.cache.dictionaryIncludesRequiredField.has(U))return F.cache.dictionaryIncludesRequiredField.get(U);F.cache.dictionaryIncludesRequiredField.set(U,void 0);let N=U.members.some((T)=>T.required);if(!N&&U.inheritance){let T=F.unique.get(U.inheritance);T?Y(T,F)&&(N=!0):N=!0}return F.cache.dictionaryIncludesRequiredField.set(U,N),N}class z extends Array{constructor({source:U,tokens:F}){super(),Object.defineProperties(this,{source:{value:U},tokens:{value:F},parent:{value:null,writable:!0}})}}class q extends G{static parser(U,F){return()=>{let N=U.consumeKind(F);if(N)return new q({source:U.source,tokens:{value:N}})}}get value(){return u(this.tokens.value.value)}write(U){return U.ts.wrap([U.token(this.tokens.value),U.token(this.tokens.separator)])}}class H extends q{static parse(U){let F=U.consumeKind("eof");if(F)return new H({source:U.source,tokens:{value:F}})}get type(){return"eof"}}function B(U,F){return e(U,{parser:q.parser(U,F),listName:F+" list"})}let L=["identifier","decimal","integer","string"],M=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((U)=>[U,`Legacy${U}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function A(U){for(let F of L){let N=B(U,F);if(N.length)return N}U.error("Expected identifiers, strings, decimals, or integers but none found")}class w extends G{static parse(U){let F={assign:U.consume("=")},N=Z0(new w({source:U.source,tokens:F}));if(N.list=[],F.assign){if(F.asterisk=U.consume("*"),F.asterisk)return N.this;F.secondaryName=U.consumeKind(...L)}return F.open=U.consume("("),F.open?(N.list=N.rhsIsList?A(U):_(U),F.close=U.consume(")")||U.error("Unexpected token in extended attribute argument list")):F.assign&&!F.secondaryName&&U.error("No right hand side to extended attribute assignment"),N.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(U){let{rhsType:F}=this;return U.ts.wrap([U.token(this.tokens.assign),U.token(this.tokens.asterisk),U.reference_token(this.tokens.secondaryName,this.parent),U.token(this.tokens.open),...this.list.map((N)=>F==="identifier-list"?U.identifier(N,this.parent):N.write(U)),U.token(this.tokens.close)])}}class D extends G{static parse(U){let F=U.consumeKind("identifier");if(F)return new D({source:U.source,tokens:{name:F},params:w.parse(U)})}constructor({source:U,tokens:F,params:N}){super({source:U,tokens:F}),N.parent=this,Object.defineProperty(this,"params",{value:N})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:U,tokens:F,list:N}=this.params;if(!U)return null;return{type:U,value:this.params.rhsIsList?N:this.params.tokens.secondaryName?u(F.secondaryName.value):null}}get arguments(){let{rhsIsList:U,list:F}=this.params;return!F||U?[]:F}*validate(U){let{name:F}=this;if(F==="LegacyNoInterfaceObject")yield J(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(M.has(F)){let T=`\`[${F}]\` extended attribute is a legacy feature that is now renamed to \`[${M.get(F)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield J(this.tokens.name,this,"renamed-legacy",T,{level:"warning",autofix:(N=this,()=>{let{name:O}=N;N.tokens.name.value=M.get(O),O==="TreatNullAs"&&(N.params.tokens={})})})}var N;for(let T of this.arguments)yield*T.validate(U)}write(U){return U.ts.wrap([U.ts.trivia(this.tokens.name.trivia),U.ts.extendedAttribute(U.ts.wrap([U.ts.extendedAttributeReference(this.name),this.params.write(U)])),U.token(this.tokens.separator)])}}class j extends z{static parse(U){let F={};F.open=U.consume("[");let N=new j({source:U.source,tokens:F});return F.open?(N.push(...e(U,{parser:D.parse,listName:"extended attribute"})),F.close=U.consume("]")||U.error("Expected a closing token for the extended attribute list"),N.length||(U.unconsume(F.close.index),U.error("An extended attribute list must not be empty")),U.probe("[")&&U.error("Illegal double extended attribute lists, consider merging them"),N):N}*validate(U){for(let F of this)yield*F.validate(U)}write(U){return this.length?U.ts.wrap([U.token(this.tokens.open),...this.map((F)=>F.write(U)),U.token(this.tokens.close)]):""}}function E(U,F){let N=U.consume("?");N&&(F.tokens.nullable=N),U.probe("?")&&U.error("Can't nullable more than once")}function P(U,F){let N=function(T,O){let g=T.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!g)return;let n=Z0(new R({source:T.source,tokens:{base:g}}));switch(n.tokens.open=T.consume("<")||T.error(`No opening bracket after ${g.value}`),g.value){case"Promise":{T.probe("[")&&T.error("Promise type cannot have extended attribute");let Q0=o(T,O)||T.error("Missing Promise subtype");n.subtype.push(Q0);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let Q0=p(T,O)||T.error(`Missing ${g.value} subtype`);n.subtype.push(Q0);break}case"record":{T.probe("[")&&T.error("Record key cannot have extended attribute");let Q0=T.consume(...m0)||T.error(`Record key must be one of: ${m0.join(", ")}`),B0=new R({source:T.source,tokens:{base:Q0}});B0.tokens.separator=T.consume(",")||T.error("Missing comma after record key type"),B0.type=O;let F0=p(T,O)||T.error("Error parsing generic type record");n.subtype.push(B0,F0);break}}return n.idlType||T.error(`Error parsing generic type ${g.value}`),n.tokens.close=T.consume(">")||T.error(`Missing closing bracket after ${g.value}`),n.this}(U,F)||L0(U);if(!N){let T=U.consumeKind("identifier")||U.consume(...m0,...j0);if(!T)return;N=new R({source:U.source,tokens:{base:T}}),U.probe("<")&&U.error(`Unsupported generic type ${T.value}`)}return N.generic==="Promise"&&U.probe("?")&&U.error("Promise type cannot be nullable"),N.type=F||null,E(U,N),N.nullable&&N.idlType==="any"&&U.error("Type `any` cannot be made nullable"),N}class R extends G{static parse(U,F){return P(U,F)||function(N,T){let O={};if(O.open=N.consume("("),!O.open)return;let g=Z0(new R({source:N.source,tokens:O}));for(g.type=T||null;;){let n=p(N,T)||N.error("No type after open parenthesis or 'or' in union type");n.idlType==="any"&&N.error("Type `any` cannot be included in a union type"),n.generic==="Promise"&&N.error("Type `Promise` cannot be included in a union type"),g.subtype.push(n);let Q0=N.consume("or");if(!Q0)break;n.tokens.separator=Q0}return g.idlType.length<2&&N.error("At least two types are expected in a union type but found less"),O.close=N.consume(")")||N.error("Unterminated union type"),E(N,g),g.this}(U,F)}constructor({source:U,tokens:F}){super({source:U,tokens:F}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new j({source:U,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return u([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((U)=>U).map((U)=>U.value).join(" "))}*validate(U){if(yield*this.extAttrs.validate(U),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let g of O){if(g.name!=="AllowShared")continue;let n="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield J(this.tokens.base,this,"migrate-allowshared",n,{autofix:C(this,g,O)})}if(this.idlType==="void")yield J(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(F=this,()=>{F.tokens.base.value="undefined"})});var F;let N=!this.union&&U.unique.get(this.idlType),T=this.union?this:N&&N.type==="typedef"?N.idlType:void 0;if(T&&this.nullable){let{reference:O}=W(T,U)||{};if(O){let g=(this.union?O:this).tokens.base;yield J(g,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(U)}write(U){return U.ts.wrap([this.extAttrs.write(U),(()=>{if(this.union||this.generic)return U.ts.wrap([U.token(this.tokens.base,U.ts.generic),U.token(this.tokens.open),...this.subtype.map((O)=>O.write(U)),U.token(this.tokens.close)]);let F=this.tokens.prefix||this.tokens.base,N=this.tokens.prefix?[this.tokens.prefix.value,U.ts.trivia(this.tokens.base.trivia)]:[],T=U.reference(U.ts.wrap([...N,this.tokens.base.value,U.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return U.ts.wrap([U.ts.trivia(F.trivia),T])})(),U.token(this.tokens.nullable),U.token(this.tokens.separator)])}}function C(U,F,N){return()=>{let T=N.indexOf(F);N.splice(T,1),!N.length&&U.tokens.base.trivia.match(/^\s$/)&&(U.tokens.base.trivia=""),U.tokens.base.value="AllowSharedBufferSource"}}class v extends G{static parse(U){let F=U.consume("=");if(!F)return null;let N=Y0(U)||U.consumeKind("string")||U.consume("null","[","{")||U.error("No value for default"),T=[N];if(N.value==="["){let O=U.consume("]")||U.error("Default sequence value must be empty");T.push(O)}else if(N.value==="{"){let O=U.consume("}")||U.error("Default dictionary value must be empty");T.push(O)}return new v({source:U.source,tokens:{assign:F},expression:T})}constructor({source:U,tokens:F,expression:N}){super({source:U,tokens:F}),N.parent=this,Object.defineProperty(this,"expression",{value:N})}get type(){return J0(this.expression[0]).type}get value(){return J0(this.expression[0]).value}get negative(){return J0(this.expression[0]).negative}write(U){return U.ts.wrap([U.token(this.tokens.assign),...this.expression.map((F)=>U.token(F))])}}class d extends G{static parse(U){let F=U.position,N={},T=Z0(new d({source:U.source,tokens:N}));return T.extAttrs=j.parse(U),N.optional=U.consume("optional"),T.idlType=p(U,"argument-type"),T.idlType?(N.optional||(N.variadic=U.consume("...")),N.name=U.consumeKind("identifier")||U.consume(...W0),N.name?(T.default=N.optional?v.parse(U):null,T.this):U.unconsume(F)):U.unconsume(F)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return u(this.tokens.name.value)}*validate(U){yield*this.extAttrs.validate(U),yield*this.idlType.validate(U);let F=W(this.idlType,U,{useNullableInner:!0});if(F){if(this.idlType.nullable)yield J(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield J(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:f(this)})}else if(this.parent&&!Y(F.dictionary,U)&&function(T){let O=T.parent.arguments||T.parent.list,g=O.indexOf(T);return!O.slice(g+1).some((Q0)=>!Q0.optional)}(this))yield J(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(N=this,()=>{let O=X0(N.idlType);N.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",f(N)()})})}var N}write(U){return U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.optional),U.ts.type(this.idlType.write(U)),U.token(this.tokens.variadic),U.name_token(this.tokens.name,{data:this}),this.default?this.default.write(U):"",U.token(this.tokens.separator)])}}function f(U){return()=>{U.default=v.parse(new y0(" = {}"))}}class a extends G{static parse(U,{special:F,regular:N}={}){let T={special:F},O=Z0(new a({source:U.source,tokens:T}));return F&&F.value==="stringifier"&&(T.termination=U.consume(";"),T.termination)?(O.arguments=[],O):(F||N||(T.special=U.consume("getter","setter","deleter")),O.idlType=o(U)||U.error("Missing return type"),T.name=U.consumeKind("identifier")||U.consume("includes"),T.open=U.consume("(")||U.error("Invalid operation"),O.arguments=_(U),T.close=U.consume(")")||U.error("Unterminated operation"),T.termination=U.consume(";")||U.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:U}=this.tokens;return U?u(U.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(U){if(yield*this.extAttrs.validate(U),!this.name&&["","static"].includes(this.special))yield J(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield J(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(U)}for(let F of this.arguments)yield*F.validate(U)}write(U){let{parent:F}=this,N=this.idlType?[U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:F}),U.token(this.tokens.open),U.ts.wrap(this.arguments.map((T)=>T.write(U))),U.token(this.tokens.close)]:[];return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),this.tokens.name?U.token(this.tokens.special):U.token(this.tokens.special,U.ts.nameless,{data:this,parent:F}),...N,U.token(this.tokens.termination)]),{data:this,parent:F})}}class $0 extends G{static parse(U,{special:F,noInherit:N=!1,readonly:T=!1}={}){let O=U.position,g={special:F},n=Z0(new $0({source:U.source,tokens:g}));if(F||N||(g.special=U.consume("inherit")),n.special==="inherit"&&U.probe("readonly")&&U.error("Inherited attributes cannot be read-only"),g.readonly=U.consume("readonly"),T&&!g.readonly&&U.probe("attribute")&&U.error("Attributes must be readonly in this context"),g.base=U.consume("attribute"),g.base)return n.idlType=p(U,"attribute-type")||U.error("Attribute lacks a type"),g.name=U.consumeKind("identifier")||U.consume("async","required")||U.error("Attribute lacks a name"),g.termination=U.consume(";")||U.error("Unterminated attribute, expected `;`"),n.this;U.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return u(this.tokens.name.value)}*validate(U){if(yield*this.extAttrs.validate(U),yield*this.idlType.validate(U),["async_sequence","sequence","record"].includes(this.idlType.generic)){let F=`Attributes cannot accept ${this.idlType.generic} types.`;yield J(this.tokens.name,this,"attr-invalid-type",F)}{let{reference:F}=W(this.idlType,U)||{};if(F){let N=(this.idlType.union?F:this.idlType).tokens.base;yield J(N,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(F,N){if(F.union)return!1;if(F.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let T=N.unique.get(F.idlType);return T?.type==="typedef"&&T.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,U)){let F=this.idlType.tokens.base;yield J(F,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(U){let{parent:F}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.special),U.token(this.tokens.readonly),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:F}),U.token(this.tokens.termination)]),{data:this,parent:F})}}function u(U){return U.startsWith("_")?U.slice(1):U}function e(U,{parser:F,allowDangler:N,listName:T="list"}){let O=F(U);if(!O)return[];O.tokens.separator=U.consume(",");let g=[O];for(;O.tokens.separator;){let n=F(U);if(!n){N||U.error(`Trailing comma in ${T}`);break}if(n.tokens.separator=U.consume(","),g.push(n),!n.tokens.separator)break}return g}function Y0(U){return U.consumeKind("decimal","integer")||U.consume("true","false","Infinity","-Infinity","NaN")}function J0({type:U,value:F}){switch(U){case"decimal":case"integer":return{type:"number",value:F};case"string":return{type:"string",value:F.slice(1,-1)}}switch(F){case"true":case"false":return{type:"boolean",value:F==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:F.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:F}}}function L0(U){let{source:F}=U,N=function(){let O=U.consume("unsigned"),g=U.consume("short","long");if(g){let n=U.consume("long");return new R({source:F,tokens:{prefix:O,base:g,postfix:n}})}O&&U.error("Failed to parse integer type")}()||function(){let O=U.consume("unrestricted"),g=U.consume("float","double");if(g)return new R({source:F,tokens:{prefix:O,base:g}});O&&U.error("Failed to parse float type")}();if(N)return N;let T=U.consume("bigint","boolean","byte","octet","undefined");return T?new R({source:F,tokens:{base:T}}):void 0}function _(U){return e(U,{parser:d.parse,listName:"arguments list"})}function p(U,F){let N=j.parse(U),T=R.parse(U,F);return T&&(Z0(T).extAttrs=N),T}function o(U,F){let N=R.parse(U,F||"return-type");if(N)return N;let T=U.consume("void");if(T){let O=new R({source:U.source,tokens:{base:T}});return O.type="return-type",O}}function K0(U){let F=U.consume("stringifier");if(!F)return;return $0.parse(U,{special:F})||a.parse(U,{special:F})||U.error("Unterminated stringifier")}function i(U){let F=U.split(`
385
- `);if(F.length){let N=F[F.length-1].match(/^\s+/);if(N)return N[0]}return""}function G0(U){return()=>{if(U.extAttrs.length){let F=new y0("Exposed=Window,"),N=D.parse(F);N.tokens.separator=F.consume(",");let T=U.extAttrs[0];/^\s/.test(T.tokens.name.trivia)||(T.tokens.name.trivia=` ${T.tokens.name.trivia}`),U.extAttrs.unshift(N)}else{Z0(U).extAttrs=j.parse(new y0("[Exposed=Window]"));let F=U.tokens.base.trivia;U.extAttrs.tokens.open.trivia=F,U.tokens.base.trivia=`
386
- ${i(F)}`}}}function X0(U){if(U.extAttrs.length)return U.extAttrs.tokens.open;if(U.type==="operation"&&!U.special)return X0(U.idlType);return Object.values(U.tokens).sort((F,N)=>F.index-N.index)[0]}function Z0(U,F){if(F||(F=U),!U)return U;return new Proxy(U,{get(N,T){let O=N[T];return Array.isArray(O)&&T!=="source"?Z0(O,N):O},set(N,T,O){if(N[T]=O,!O)return!0;if(Array.isArray(O))for(let g of O)g.parent!==void 0&&(g.parent=F);else O.parent!==void 0&&(O.parent=F);return!0}})}let x0={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},j0=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],m0=["ByteString","DOMString","USVString"],W0=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],X$=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(W0,m0,j0),E0=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],t0=["_constructor","toString","_toString"];class y0{constructor(U){this.source=function(F){let N=[],T=0,O="",g=1,n=0;for(;T<F.length;){let B0=F.charAt(T),F0=-1;if(/[\t\n\r ]/.test(B0)?F0=Q0("whitespace",{noFlushTrivia:!0}):B0==="/"&&(F0=Q0("comment",{noFlushTrivia:!0})),F0!==-1){let D0=N.pop().value;g+=(D0.match(/\n/g)||[]).length,O+=D0,n-=1}else if(/[-0-9.A-Z_a-z]/.test(B0)){if(F0=Q0("decimal"),F0===-1&&(F0=Q0("integer")),F0===-1){F0=Q0("identifier");let D0=N.length-1,S0=N[D0];if(F0!==-1){if(t0.includes(S0.value)){let V$=`${u(S0.value)} is a reserved identifier and must not be used.`;throw new c0(Q(N,D0,null,V$))}X$.includes(S0.value)&&(S0.type="inline")}}}else B0==='"'&&(F0=Q0("string"));for(let D0 of E0)if(F.startsWith(D0,T)){N.push({type:"inline",value:D0,trivia:O,line:g,index:n}),O="",T+=D0.length,F0=T;break}if(F0===-1&&(F0=Q0("other")),F0===-1)throw Error("Token stream not progressing");T=F0,n+=1}return N.push({type:"eof",value:"",trivia:O,line:g,index:n}),N;function Q0(B0,{noFlushTrivia:F0}={}){let D0=x0[B0];D0.lastIndex=T;let S0=D0.exec(F);return S0?(N.push({type:B0,value:S0[0],trivia:O,line:g,index:n}),F0||(O=""),D0.lastIndex):-1}}(U),this.position=0}error(U){throw new c0(Q(this.source,this.position,this.current,U))}probeKind(U){return this.source.length>this.position&&this.source[this.position].type===U}probe(U){return this.probeKind("inline")&&this.source[this.position].value===U}consumeKind(...U){for(let F of U){if(!this.probeKind(F))continue;let N=this.source[this.position];return this.position++,N}}consume(...U){if(!this.probeKind("inline"))return;let F=this.source[this.position];for(let N of U)if(F.value===N)return this.position++,F}consumeIdentifier(U){if(this.probeKind("identifier")&&this.source[this.position].value===U)return this.consumeKind("identifier")}unconsume(U){this.position=U}}class c0 extends Error{constructor({message:U,bareMessage:F,context:N,line:T,sourceName:O,input:g,tokens:n}){super(U),this.name="WebIDLParseError",this.bareMessage=F,this.context=N,this.line=T,this.sourceName=O,this.input=g,this.tokens=n}}class j$ extends q{static parse(U){let F=U.consumeKind("string");if(F)return new j$({source:U.source,tokens:{value:F}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(U){let{parent:F}=this;return U.ts.wrap([U.ts.trivia(this.tokens.value.trivia),U.ts.definition(U.ts.wrap(['"',U.ts.name(this.value,{data:this,parent:F}),'"']),{data:this,parent:F}),U.token(this.tokens.separator)])}}class q$ extends G{static parse(U){let F={};if(F.base=U.consume("enum"),!F.base)return;F.name=U.consumeKind("identifier")||U.error("No name for enum");let N=Z0(new q$({source:U.source,tokens:F}));return U.current=N.this,F.open=U.consume("{")||U.error("Bodyless enum"),N.values=e(U,{parser:j$.parse,allowDangler:!0,listName:"enumeration"}),U.probeKind("string")&&U.error("No comma between enum values"),F.close=U.consume("}")||U.error("Unexpected value in enum"),N.values.length||U.error("No value in enum"),F.termination=U.consume(";")||U.error("No semicolon after enum"),N.this}get type(){return"enum"}get name(){return u(this.tokens.name.value)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.open),U.ts.wrap(this.values.map((F)=>F.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class L6 extends G{static parse(U){let F=U.consumeKind("identifier");if(!F)return;let N={target:F};if(N.includes=U.consume("includes"),N.includes)return N.mixin=U.consumeKind("identifier")||U.error("Incomplete includes statement"),N.termination=U.consume(";")||U.error("No terminating ; for includes statement"),new L6({source:U.source,tokens:N});U.unconsume(F.index)}get type(){return"includes"}get target(){return u(this.tokens.target.value)}get includes(){return u(this.tokens.mixin.value)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.reference_token(this.tokens.target,this),U.token(this.tokens.includes),U.reference_token(this.tokens.mixin,this),U.token(this.tokens.termination)]),{data:this})}}class M6 extends G{static parse(U){let F={},N=Z0(new M6({source:U.source,tokens:F}));if(F.base=U.consume("typedef"),F.base)return N.idlType=p(U,"typedef-type")||U.error("Typedef lacks a type"),F.name=U.consumeKind("identifier")||U.error("Typedef lacks a name"),U.current=N.this,F.termination=U.consume(";")||U.error("Unterminated typedef, expected `;`"),N.this}get type(){return"typedef"}get name(){return u(this.tokens.name.value)}*validate(U){yield*this.idlType.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.termination)]),{data:this})}}class g$ extends G{static parse(U,F){let N={base:F},T=Z0(new g$({source:U.source,tokens:N}));return N.name=U.consumeKind("identifier")||U.error("Callback lacks a name"),U.current=T.this,N.assign=U.consume("=")||U.error("Callback lacks an assignment"),T.idlType=o(U)||U.error("Callback lacks a return type"),N.open=U.consume("(")||U.error("Callback lacks parentheses for arguments"),T.arguments=_(U),N.close=U.consume(")")||U.error("Unterminated callback"),N.termination=U.consume(";")||U.error("Unterminated callback, expected `;`"),T.this}get type(){return"callback"}get name(){return u(this.tokens.name.value)}*validate(U){yield*this.extAttrs.validate(U);for(let F of this.arguments)if(yield*F.validate(U),F.idlType.generic==="async_sequence")yield J(F.tokens.name,F,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.assign),U.ts.type(this.idlType.write(U)),U.token(this.tokens.open),...this.arguments.map((F)=>F.write(U)),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class U$ extends G{static parse(U,F,{inheritable:N,allowedMembers:T}){let{tokens:O,type:g}=F;for(O.name=U.consumeKind("identifier")||U.error(`Missing name in ${g}`),U.current=F,F=Z0(F),N&&Object.assign(O,function(n){let Q0=n.consume(":");return Q0?{colon:Q0,inheritance:n.consumeKind("identifier")||n.error("Inheritance lacks a type")}:{}}(U)),O.open=U.consume("{")||U.error(`Bodyless ${g}`),F.members=[];;){if(O.close=U.consume("}"),O.close)return O.termination=U.consume(";")||U.error(`Missing semicolon after ${g}`),F.this;let n=j.parse(U),Q0;for(let[B0,...F0]of T)if(Q0=Z0(B0(U,...F0)),Q0)break;Q0||U.error("Unknown member"),Q0.extAttrs=n,F.members.push(Q0.this)}}get partial(){return!!this.tokens.partial}get name(){return u(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?u(this.tokens.inheritance.value):null}*validate(U){for(let F of this.members)F.validate&&(yield*F.validate(U))}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.callback),U.token(this.tokens.partial),U.token(this.tokens.base),U.token(this.tokens.mixin),U.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?U.ts.wrap([U.token(this.tokens.colon),U.ts.trivia(this.tokens.inheritance.trivia),U.ts.inheritance(U.reference(this.tokens.inheritance.value,{context:this}))]):"")(),U.token(this.tokens.open),U.ts.wrap(this.members.map((F)=>F.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class A6 extends G{static parse(U){let F={};if(F.base=U.consume("const"),!F.base)return;let N=L0(U);if(!N){let O=U.consumeKind("identifier")||U.error("Const lacks a type");N=new R({source:U.source,tokens:{base:O}})}U.probe("?")&&U.error("Unexpected nullable constant type"),N.type="const-type",F.name=U.consumeKind("identifier")||U.error("Const lacks a name"),F.assign=U.consume("=")||U.error("Const lacks value assignment"),F.value=Y0(U)||U.error("Const lacks a value"),F.termination=U.consume(";")||U.error("Unterminated const, expected `;`");let T=new A6({source:U.source,tokens:F});return Z0(T).idlType=N,T}get type(){return"const"}get name(){return u(this.tokens.name.value)}get value(){return J0(this.tokens.value)}write(U){let{parent:F}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:F}),U.token(this.tokens.assign),U.token(this.tokens.value),U.token(this.tokens.termination)]),{data:this,parent:F})}}class W1 extends G{static parse(U){let F=U.position,N=Z0(new W1({source:U.source,tokens:{}})),{tokens:T}=N;if(T.readonly=U.consume("readonly"),T.readonly||(T.async=U.consume("async")),T.base=T.readonly?U.consume("maplike","setlike"):T.async?U.consume("iterable"):U.consume("iterable","async_iterable","maplike","setlike"),!T.base)return void U.unconsume(F);let{type:O}=N,g=O==="maplike",n=g||O==="iterable"||O==="async_iterable",Q0=O==="async_iterable"||N.async&&O==="iterable";T.open=U.consume("<")||U.error(`Missing less-than sign \`<\` in ${O} declaration`);let B0=p(U)||U.error(`Missing a type argument in ${O} declaration`);return N.idlType=[B0],N.arguments=[],n&&(B0.tokens.separator=U.consume(","),B0.tokens.separator?N.idlType.push(p(U)):g&&U.error(`Missing second type argument in ${O} declaration`)),T.close=U.consume(">")||U.error(`Missing greater-than sign \`>\` in ${O} declaration`),U.probe("(")&&(Q0?(T.argsOpen=U.consume("("),N.arguments.push(..._(U)),T.argsClose=U.consume(")")||U.error("Unterminated async iterable argument list")):U.error("Arguments are only allowed for `async iterable`")),T.termination=U.consume(";")||U.error(`Missing semicolon after ${O} declaration`),N.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(U){if(this.async&&this.type==="iterable")yield J(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(F=this,()=>{let T=F.tokens.async;F.tokens.base={...T,type:"async_iterable",value:"async_iterable"},delete F.tokens.async})});var F;for(let N of this.idlType)yield*N.validate(U);for(let N of this.arguments)yield*N.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.readonly),U.token(this.tokens.async),U.token(this.tokens.base,U.ts.generic),U.token(this.tokens.open),U.ts.wrap(this.idlType.map((F)=>F.write(U))),U.token(this.tokens.close),U.token(this.tokens.argsOpen),U.ts.wrap(this.arguments.map((F)=>F.write(U))),U.token(this.tokens.argsClose),U.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class g6 extends G{static parse(U){let F=U.consume("constructor");if(!F)return;let N={base:F};N.open=U.consume("(")||U.error("No argument list in constructor");let T=_(U);N.close=U.consume(")")||U.error("Unterminated constructor"),N.termination=U.consume(";")||U.error("No semicolon after constructor");let O=new g6({source:U.source,tokens:N});return Z0(O).arguments=T,O}get type(){return"constructor"}*validate(U){for(let F of this.arguments)yield*F.validate(U)}write(U){let{parent:F}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base,U.ts.nameless,{data:this,parent:F}),U.token(this.tokens.open),U.ts.wrap(this.arguments.map((N)=>N.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this,parent:F})}}function Z9(U){let F=U.consume("static");if(!F)return;return $0.parse(U,{special:F})||a.parse(U,{special:F})||U.error("No body in static member")}class f$ extends U${static parse(U,F,{extMembers:N=[],partial:T=null}={}){let O={partial:T,base:F};return U$.parse(U,new f$({source:U.source,tokens:O}),{inheritable:!T,allowedMembers:[...N,[A6.parse],[g6.parse],[Z9],[K0],[W1.parse],[$0.parse],[a.parse]]})}get type(){return"interface"}*validate(U){if(yield*this.extAttrs.validate(U),!this.partial&&this.extAttrs.every((N)=>N.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:G0(this)});let F=this.extAttrs.filter((N)=>N.name==="Constructor");for(let N of F)yield J(N.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:X9(this,N)});if(this.extAttrs.some((N)=>N.name==="Global")){let N=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of N)yield J(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let T=this.members.filter((O)=>O.type==="constructor");for(let O of T)yield J(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(U),this.partial||(yield*function*(N,T){let O=function(F0){let D0=B0(F0);return{statics:new Set(D0.filter((S0)=>S0.special==="static").map((S0)=>S0.name)),nonstatics:new Set(D0.filter((S0)=>S0.special!=="static").map((S0)=>S0.name))}}(T),g=N.partials.get(T.name)||[],n=N.mixinMap.get(T.name)||[];for(let F0 of[...g,...n]){let D0=B0(F0),S0=D0.filter((O$)=>O$.special==="static"),V$=D0.filter((O$)=>O$.special!=="static");yield*Q0(S0,O.statics,F0,T),yield*Q0(V$,O.nonstatics,F0,T),S0.forEach((O$)=>O.statics.add(O$.name)),V$.forEach((O$)=>O.nonstatics.add(O$.name))}function*Q0(F0,D0,S0,V$){for(let O$ of F0){let{name:Q9}=O$;if(Q9&&D0.has(Q9)){let NZ=`The ${O$.special==="static"?"static ":""}operation "${Q9}" has already been defined for the base interface "${V$.name}" either in itself or in a mixin`;yield J(O$.tokens.name,S0,"no-cross-overload",NZ)}}}function B0(F0){return F0.members.filter(({type:D0})=>D0==="operation")}}(U,this))}}function X9(U,F){return U=Z0(U),()=>{let N=i(U.extAttrs.tokens.open.trivia),T=U.members.length?i(X0(U.members[0]).trivia):function(D0){let S0=i(D0),V$=S0.includes("\t")?"\t":" ";return S0+V$}(N),O=g6.parse(new y0(`
387
- ${T}constructor();`));O.extAttrs=new j({source:U.source,tokens:{}}),Z0(O).arguments=F.arguments;let g=function(D0,S0){let V$=D0.slice().reverse().findIndex(S0);return V$===-1?V$:D0.length-V$-1}(U.members,(D0)=>D0.type==="constructor");U.members.splice(g+1,0,O);let{close:n}=U.tokens;n.trivia.includes(`
388
- `)||(n.trivia+=`
389
- ${N}`);let{extAttrs:Q0}=U,B0=Q0.indexOf(F),F0=Q0.splice(B0,1);Q0.length?Q0.length===B0?Q0[B0-1].tokens.separator=void 0:Q0[B0].tokens.name.trivia.trim()||(Q0[B0].tokens.name.trivia=F0[0].tokens.name.trivia):Q0.tokens.open=Q0.tokens.close=void 0}}class Y1 extends U${static parse(U,F,{extMembers:N=[],partial:T}={}){let O={partial:T,base:F};if(O.mixin=U.consume("mixin"),O.mixin)return U$.parse(U,new Y1({source:U.source,tokens:O}),{allowedMembers:[...N,[A6.parse],[K0],[$0.parse,{noInherit:!0}],[a.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class z1 extends G{static parse(U){let F={},N=Z0(new z1({source:U.source,tokens:F}));return N.extAttrs=j.parse(U),F.required=U.consume("required"),N.idlType=p(U,"dictionary-type")||U.error("Dictionary member lacks a type"),F.name=U.consumeKind("identifier")||U.error("Dictionary member lacks a name"),N.default=v.parse(U),F.required&&N.default&&U.error("Required member must not have a default"),F.termination=U.consume(";")||U.error("Unterminated dictionary member, expected `;`"),N.this}get type(){return"field"}get name(){return u(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(U){yield*this.idlType.validate(U)}write(U){let{parent:F}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.required),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:F}),this.default?this.default.write(U):"",U.token(this.tokens.termination)]),{data:this,parent:F})}}class q1 extends U${static parse(U,{extMembers:F=[],partial:N}={}){let T={partial:N};if(T.base=U.consume("dictionary"),T.base)return U$.parse(U,new q1({source:U.source,tokens:T}),{inheritable:!N,allowedMembers:[...F,[z1.parse]]})}get type(){return"dictionary"}}class V extends U${static parse(U,{extMembers:F=[],partial:N}={}){let T={partial:N};if(T.base=U.consume("namespace"),T.base)return U$.parse(U,new V({source:U.source,tokens:T}),{allowedMembers:[...F,[$0.parse,{noInherit:!0,readonly:!0}],[A6.parse],[a.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(U){if(!this.partial&&this.extAttrs.every((F)=>F.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:G0(this)});yield*super.validate(U)}}class S extends U${static parse(U,F,{extMembers:N=[]}={}){let T={callback:F};if(T.base=U.consume("interface"),T.base)return U$.parse(U,new S({source:U.source,tokens:T}),{allowedMembers:[...N,[A6.parse],[a.parse,{regular:!0}]]})}get type(){return"callback interface"}}function h(U,F){let N=U.source;function T(B0){U.error(B0)}function O(...B0){return U.consume(...B0)}function g(B0){let F0=O("interface");if(F0)return Y1.parse(U,F0,{...B0,...F?.extensions?.mixin})||f$.parse(U,F0,{...B0,...F?.extensions?.interface})||T("Interface has no proper body")}function n(){if(F.productions)for(let B0 of F.productions){let F0=B0(U);if(F0)return F0}return function(){let B0=O("callback");if(B0)return U.probe("interface")?S.parse(U,B0,{...F?.extensions?.callbackInterface}):g$.parse(U,B0)}()||g()||function(){let B0=O("partial");if(B0)return q1.parse(U,{partial:B0,...F?.extensions?.dictionary})||g({partial:B0})||V.parse(U,{partial:B0,...F?.extensions?.namespace})||T("Partial doesn't apply to anything")}()||q1.parse(U,F?.extensions?.dictionary)||q$.parse(U)||M6.parse(U)||L6.parse(U)||V.parse(U,F?.extensions?.namespace)}let Q0=function(){if(!N.length)return[];let B0=[];for(;;){let D0=j.parse(U),S0=n();if(!S0){D0.length&&T("Stray extended attributes");break}Z0(S0).extAttrs=D0,B0.push(S0)}let F0=H.parse(U);return F.concrete&&B0.push(F0),B0}();return U.position<N.length&&T("Unrecognised tokens"),Q0}function c(U,F={}){let N=new y0(U);return F.sourceName!==void 0&&(N.source.name=F.sourceName),h(N,F)}function y(U){return U}let s={wrap:(U)=>U.join(""),trivia:y,name:y,reference:y,type:y,generic:y,nameless:y,inheritance:y,definition:y,extendedAttribute:y,extendedAttributeReference:y};class I{constructor(U){this.ts=Object.assign({},s,U)}reference(U,{unescaped:F,context:N}){return F||(F=U.startsWith("_")?U.slice(1):U),this.ts.reference(U,F,N)}token(U,F=y,...N){if(!U)return"";let T=F(U.value,...N);return this.ts.wrap([this.ts.trivia(U.trivia),T])}reference_token(U,F){return this.token(U,this.reference.bind(this),{context:F})}name_token(U,F){return this.token(U,this.ts.name,F)}identifier(U,F){return this.ts.wrap([this.reference_token(U.tokens.value,F),this.token(U.tokens.separator)])}}function x(U,{templates:F=s}={}){F=Object.assign({},s,F);let N=new I(F);return F.wrap(U.map((T)=>T.write(N)))}function r(U,F){let N=new Map,T=U.filter((O)=>O.type==="includes");for(let O of T){let g=F.get(O.includes);if(!g)continue;let n=N.get(O.target);n?n.push(g):N.set(O.target,[g])}return N}function*m(U){let F=function(N){let T=new Map,O=new Set,g=new Map;for(let n of N)if(n.partial){let Q0=g.get(n.name);Q0?Q0.push(n):g.set(n.name,[n])}else n.name&&(T.has(n.name)?O.add(n):T.set(n.name,n));return{all:N,unique:T,partials:g,duplicates:O,mixinMap:r(N,T),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(U);for(let N of F.all)N.validate&&(yield*N.validate(F));yield*function*({unique:N,duplicates:T}){for(let O of T){let{name:g}=O,n=`The name "${g}" of type "${N.get(g).type}" was already seen`;yield J(O.tokens.name,O,"no-duplicate",n)}}(F)}function l(U){return[...m((F=U,F.flat?F.flat():[].concat(...F)))];var F}return Z})())});var jH=b((Jp,TH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",NH=w0("fs").promises,IH=w0("path"),VP=AH();class DH{constructor($,Z){this.filename=Z,this.shortname=IH.basename(Z,".idl"),this.path=IH.join($,Z)}async text(){return await NH.readFile(this.path,"utf8")}async parse(){let $=await this.text();return VP.parse($)}}async function wH({folder:$=__dirname}={}){let Z={},X=await NH.readdir($);for(let Q of X)if(Q.endsWith(".idl")){let J=new DH($,Q);Z[J.shortname]=J}return Z}async function BP($){let Z=await wH($);for(let[X,Q]of Object.entries(Z))Z[X]=await Q.parse();return Z}TH.exports={listAll:wH,parseAll:BP}});var OH;var EH=t(()=>{OH={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec).",minLength:1,type:"string"}});var RH,PH,CH;var SH=t(()=>{RH={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},PH={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},CH={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var _H;var xH=t(()=>{_H={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:{type:"string"}},required:["tagName"],type:"object"}});var bH,kH;var yH=t(()=>{bH={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"},kH={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 vH;var gH=t(()=>{vH={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var fH,hH,uH,mH,dH,lH,cH,pH,iH;var nH=t(()=>{fH={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:"^#/\\$defs/",type:"string"},hH={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},uH={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:"^(\\./|\\.\\./).*\\.json$|^https?://",type:"string"},mH={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},dH={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},lH={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:"^\\$map/(item|index)(/.*)?$",type:"string"},cH={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},pH={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"},iH={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var k8;var rH=t(()=>{k8={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$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.",properties:{},type:"object"}});var aH,oH;var sH=t(()=>{aH={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"}]},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},oH={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:{oneOf:[{$ref:"#/$defs/ElementDef"},{$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:"\\$\\{",type:"string"}]}});var tH,eH,$V,ZV,XV,tX;var QV=t(()=>{tH={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},eH={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"},$V={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},ZV={additionalProperties:!1,description:"Reactive $ref that drives which case to render.",properties:{$ref:{$ref:"#/$defs/StateRef"}},required:["$ref"],type:"object"},XV={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"},tX={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/TagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var JV;var GV=t(()=>{JV={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 WV;var YV=t(()=>{WV={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$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: an opaque JS source string (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 → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{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 zV,qV;var UV=t(()=>{zV={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), or a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed).",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"}]},qV={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 KV;var HV=t(()=>{KV={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"},expires:{type:"string"},filter:{$ref:"#/$defs/RefObject"},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 VV;var BV=t(()=>{VV={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 FV,LV,MV,AV,IV,NV,DV,wV,TV,jV,OV,EV,RV,PV,CV,SV,_V;var xV=t(()=>{FV={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:"^(\\$map/|\\$reduce/|\\$args/|event#/|#/|parent#/|window#/|document#/)",type:"string"}},required:["$ref"],type:"object"},LV={anyOf:[{not:{pattern:"\\$\\{"},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."},MV={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."},AV={enum:["!","-"]},IV={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},NV={const:"?:"},DV={const:"switch"},wV={const:"call"},TV={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"]},jV={enum:["=","+=","-=","*=","/="]},OV={enum:["pop","shift"]},EV={enum:["push","unshift"]},RV={const:"splice"},PV={const:"reduce"},CV={enum:["map","filter"]},SV={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 the Intl helpers Intl/formatNumber, Intl/formatDate, Intl/formatRelativeTime) — 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"},_V={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 bV,kV,yV,vV;var gV=t(()=>{bV={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"}]},kV={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},yV={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},vV={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 FP,eX,$Q,ZQ,XQ,QQ,JQ,GQ,WQ,YQ,fV;var hV=t(()=>{FP=["method","accessor","parse","serialize","discover","load","projectData","resolvePaths","lower","emit","mount","dialect","deploySchema","bindings","testConnection"],eX={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"},$Q={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"},ZQ={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{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"},XQ={description:"A class method or accessor definition. Capability roles (parse, serialize, 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:{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:FP,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"},QQ={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:"^\\.",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"},JQ={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"},GQ={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"},WQ={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"},YQ={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"},fV={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"}});var uV;var mV=t(()=>{uV={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 y8;var dV=t(()=>{y8={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},quality:{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" runs Sharp 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 zQ;var lV=t(()=>{zQ={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:"Global type definitions available to all pages.",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"},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:"utf8",description:"Default charset for the page.",type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element.",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"}]}},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"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale code.",examples:["en"],type:"string"},locales:{description:"Available locale codes.",examples:[["en","fr","de"]],items:{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:{type:"string"},description:"Static redirect rules. Maps source paths to destination paths.",examples:[{"/old-about":"/about"}],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"}});function LP(){return cV??=MP(),cV}async function MP(){let[$,Z,X]=await Promise.all([pV.listAll(),iV.default.listAll(),nV.default.parseAll()]),Q=new Set;for(let{elements:q}of Object.values($))for(let H of q)if(!H.obsolete)Q.add(H.name);let J=[...Q].toSorted(),G=new Set;for(let q of Z.properties)for(let H of q.styleDeclaration??[])G.add(H);let W=[...G].toSorted(),Y=new Set;for(let q of Object.values(X))for(let H of q){if(H.type!=="interface"&&H.type!=="interface mixin")continue;if(!H.members)continue;for(let B of H.members)if(B.type==="attribute"&&B.name?.startsWith("on")&&typeof B.idlType?.idlType==="string"&&B.idlType.idlType==="EventHandler")Y.add(B.name)}let z=[...Y].toSorted();return{cssProps:W,eventHandlers:z,tagExamples:J}}function AP($){let Z={};for(let X of $)Z[X]={description:`Event handler for the "${X.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return Z}function IP($){let Z={};for(let X of $)Z[X]={oneOf:[{type:"string"},{type:"number"}]};return Z}async function NP(){let{tagExamples:$,cssProps:Z,eventHandlers:X}=await LP();return{$defs:{DefsMap:yV,TypeDefEntry:vV,StateMap:kV,StateEntry:bV,TypedStateDef:JV,PureTypeDef:VV,FunctionDef:WV,ClassDef:fV,ClassParameterDef:eX,ClassFieldDef:$Q,ClassConstructorDef:ZQ,ClassMethodDef:XQ,FormatDef:QQ,ProjectBlockDef:JQ,ServerBlockDef:GQ,ConnectorBlockDef:WQ,StudioHints:YQ,ExternalClassDef:KV,ExpressionPointer:FV,ExpressionLiteral:LV,ExpressionOperand:MV,UnaryOperator:AV,BinaryOperator:IV,ConditionalOperator:NV,SwitchOperator:DV,CallOperator:wV,PureMethod:TV,AssignmentOperator:jV,NoArgMethod:OV,OneArgMethod:EV,SpliceMethod:RV,ReduceMethod:PV,MapFilterMethod:CV,ExpressionNode:SV,ExpressionEntry:_V,Statement:zV,StatementList:qV,ElementDef:{...tX,properties:{...tX.properties,...AP(X)}},ChildrenValue:oH,ArrayNamespace:aH,SwitchDef:ZV,SwitchNode:XV,StyleObject:{...k8,properties:IP(Z)},AttributesObject:tH,PropsObject:eH,RefObject:pH,AnyRef:cH,InternalRef:fH,StateRef:hH,ExternalRef:uH,ExternalComponentRef:iH,GlobalRef:mH,ParentRef:dH,MapRef:lH,ElementPropertyValue:$V,StringOrRef:RH,BoolOrRef:PH,NumberOrRef:CH,CemParameter:bH,CemEvent:kH,TagName:{...OH,examples:[...$,"my-counter","todo-app","user-card"]},JsonSchemaType:vH,HeadEntry:_H,ImageConfig:y8},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of element definitions for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/ElementDef"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{description:"Dynamic route parameters. Maps parameter names to data sources for generating one page per entry at build time.",type:"object"},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function DP(){return{$defs:{ImageConfig:y8,StyleObject:k8},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",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 are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:zQ.properties,title:"Jx Project",type:"object"}}function wP(){return{$defs:{ImageConfig:y8,JxFieldSchema:nK,RelationshipRef:rK,StyleObject:k8},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:zQ.properties,title:"Jx Project Core",type:"object"}}function TP(){return{$id:u9,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function jP(){return{$id:f4,$schema:"https://json-schema.org/draft/2020-12/schema",description:"Default $paths-value union for documents. Per-project entry documents override this resource with the union of extension-contributed paths shapes.",title:"Jx Document Paths Union"}}function OP(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...uV}}function qQ(){return{$defs:{ClassConstructorDef:ZQ,ClassFieldDef:$Q,ClassMethodDef:XQ,ClassParameterDef:eX,ConnectorBlockDef:WQ,FormatDef:QQ,ProjectBlockDef:JQ,ServerBlockDef:GQ,StudioHints:YQ},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. 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.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',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"},{additionalProperties:!1,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.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function EP(){let{mkdirSync:$,writeFileSync:Z}=await import("node:fs"),{resolve:X,dirname:Q}=await import("node:path"),J=Q(X(process.argv[1],"..")),G=await NP(),W=DP(),Y=qQ(),z=wP(),q=OP(),H=TP(),B=jP(),L=JSON.stringify(G,null,2),M=JSON.stringify(W,null,2),A=JSON.stringify(Y,null,2),w=JSON.stringify(z,null,2),D=JSON.stringify(q,null,2),j=JSON.stringify(H,null,2),E=JSON.stringify(B,null,2),[P]=process.argv.slice(2);if(P)Z(P,L,"utf8"),console.error(`Jx component schema written to ${P}`);else{Z(X(J,"schema.json"),L,"utf8"),Z(X(J,"project-schema.json"),M,"utf8"),Z(X(J,"class-schema.json"),A,"utf8"),$(X(J,"schemas"),{recursive:!0}),Z(X(J,"schemas","project.core.schema.json"),w,"utf8"),Z(X(J,"schemas","project.fields.schema.json"),j,"utf8"),Z(X(J,"schemas","document.paths.schema.json"),E,"utf8"),Z(X(J,"extension-manifest.schema.json"),D,"utf8");let R=Bun.spawnSync(["bunx","oxfmt",X(J,"schemas","project.core.schema.json"),X(J,"schemas","project.fields.schema.json"),X(J,"schemas","document.paths.schema.json")],{cwd:J});if(R.exitCode!==0){let C=R.stderr.toString()||R.stdout.toString()||`exit ${R.exitCode??"null"}${R.signalCode?`, signal ${R.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${C})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var pV,iV,nV,cV=null,ip;var rV=t(()=>{EH();SH();xH();yH();gH();nH();rH();sH();QV();GV();YV();UV();HV();BV();xV();gV();hV();mV();S8();dV();lV();pV=B$(BH(),1),iV=B$(MH(),1),nV=B$(jH(),1);ip=process.argv[1]?.endsWith("schema.ts")?EP():void 0});var c9=b((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});sV.regexpCode=sV.getEsmExportName=sV.getProperty=sV.safeStringify=sV.stringify=sV.strConcat=sV.addCodeArg=sV.str=sV._=sV.nil=sV._Code=sV.Name=sV.IDENTIFIER=sV._CodeOrName=void 0;class v8{}sV._CodeOrName=v8;sV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class h4 extends v8{constructor($){super();if(!sV.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}sV.Name=h4;class U6 extends v8{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((Z,X)=>`${Z}${X}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((Z,X)=>{if(X instanceof h4)Z[X.str]=(Z[X.str]||0)+1;return Z},{})}}sV._Code=U6;sV.nil=new U6("");function aV($,...Z){let X=[$[0]],Q=0;while(Q<Z.length)KQ(X,Z[Q]),X.push($[++Q]);return new U6(X)}sV._=aV;var UQ=new U6("+");function oV($,...Z){let X=[l9($[0])],Q=0;while(Q<Z.length)X.push(UQ),KQ(X,Z[Q]),X.push(UQ,l9($[++Q]));return RP(X),new U6(X)}sV.str=oV;function KQ($,Z){if(Z instanceof U6)$.push(...Z._items);else if(Z instanceof h4)$.push(Z);else $.push(SP(Z))}sV.addCodeArg=KQ;function RP($){let Z=1;while(Z<$.length-1){if($[Z]===UQ){let X=PP($[Z-1],$[Z+1]);if(X!==void 0){$.splice(Z-1,3,X);continue}$[Z++]="+"}Z++}}function PP($,Z){if(Z==='""')return $;if($==='""')return Z;if(typeof $=="string"){if(Z instanceof h4||$[$.length-1]!=='"')return;if(typeof Z!="string")return`${$.slice(0,-1)}${Z}"`;if(Z[0]==='"')return $.slice(0,-1)+Z.slice(1);return}if(typeof Z=="string"&&Z[0]==='"'&&!($ instanceof h4))return`"${$}${Z.slice(1)}`;return}function CP($,Z){return Z.emptyStr()?$:$.emptyStr()?Z:oV`${$}${Z}`}sV.strConcat=CP;function SP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:l9(Array.isArray($)?$.join(","):$)}function _P($){return new U6(l9($))}sV.stringify=_P;function l9($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}sV.safeStringify=l9;function xP($){return typeof $=="string"&&sV.IDENTIFIER.test($)?new U6(`.${$}`):aV`[${$}]`}sV.getProperty=xP;function bP($){if(typeof $=="string"&&sV.IDENTIFIER.test($))return new U6(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}sV.getEsmExportName=bP;function kP($){return new U6($.toString())}sV.regexpCode=kP});var FQ=b((Z3)=>{Object.defineProperty(Z3,"__esModule",{value:!0});Z3.ValueScope=Z3.ValueScopeName=Z3.Scope=Z3.varKinds=Z3.UsedValueState=void 0;var x$=c9();class eV extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var f8;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(f8||(Z3.UsedValueState=f8={}));Z3.varKinds={const:new x$.Name("const"),let:new x$.Name("let"),var:new x$.Name("var")};class VQ{constructor({prefixes:$,parent:Z}={}){this._names={},this._prefixes=$,this._parent=Z}toName($){return $ instanceof x$.Name?$:this.name($)}name($){return new x$.Name(this._newName($))}_newName($){let Z=this._names[$]||this._nameGroup($);return`${$}${Z.index++}`}_nameGroup($){var Z,X;if(((X=(Z=this._parent)===null||Z===void 0?void 0:Z._prefixes)===null||X===void 0?void 0:X.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}Z3.Scope=VQ;class BQ extends x$.Name{constructor($,Z){super(Z);this.prefix=$}setValue($,{property:Z,itemIndex:X}){this.value=$,this.scopePath=x$._`.${new x$.Name(Z)}[${X}]`}}Z3.ValueScopeName=BQ;var nP=x$._`\n`;class $3 extends VQ{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?nP:x$.nil}}get(){return this._scope}name($){return new BQ($,this._newName($))}value($,Z){var X;if(Z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:J}=Q,G=(X=Z.key)!==null&&X!==void 0?X:Z.ref,W=this._values[J];if(W){let q=W.get(G);if(q)return q}else W=this._values[J]=new Map;W.set(G,Q);let Y=this._scope[J]||(this._scope[J]=[]),z=Y.length;return Y[z]=Z.ref,Q.setValue(Z,{property:J,itemIndex:z}),Q}getValue($,Z){let X=this._values[$];if(!X)return;return X.get(Z)}scopeRefs($,Z=this._values){return this._reduceValues(Z,(X)=>{if(X.scopePath===void 0)throw Error(`CodeGen: name "${X}" has no value`);return x$._`${$}${X.scopePath}`})}scopeCode($=this._values,Z,X){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},Z,X)}_reduceValues($,Z,X={},Q){let J=x$.nil;for(let G in $){let W=$[G];if(!W)continue;let Y=X[G]=X[G]||new Map;W.forEach((z)=>{if(Y.has(z))return;Y.set(z,f8.Started);let q=Z(z);if(q){let H=this.opts.es5?Z3.varKinds.var:Z3.varKinds.const;J=x$._`${J}${H} ${z} = ${q};${this.opts._n}`}else if(q=Q===null||Q===void 0?void 0:Q(z))J=x$._`${J}${q}${this.opts._n}`;else throw new eV(z);Y.set(z,f8.Completed)})}return J}}Z3.ValueScope=$3});var A0=b((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.or=b$.and=b$.not=b$.CodeGen=b$.operators=b$.varKinds=b$.ValueScopeName=b$.ValueScope=b$.Scope=b$.Name=b$.regexpCode=b$.stringify=b$.getProperty=b$.nil=b$.strConcat=b$.str=b$._=void 0;var R0=c9(),K6=FQ(),P1=c9();Object.defineProperty(b$,"_",{enumerable:!0,get:function(){return P1._}});Object.defineProperty(b$,"str",{enumerable:!0,get:function(){return P1.str}});Object.defineProperty(b$,"strConcat",{enumerable:!0,get:function(){return P1.strConcat}});Object.defineProperty(b$,"nil",{enumerable:!0,get:function(){return P1.nil}});Object.defineProperty(b$,"getProperty",{enumerable:!0,get:function(){return P1.getProperty}});Object.defineProperty(b$,"stringify",{enumerable:!0,get:function(){return P1.stringify}});Object.defineProperty(b$,"regexpCode",{enumerable:!0,get:function(){return P1.regexpCode}});Object.defineProperty(b$,"Name",{enumerable:!0,get:function(){return P1.Name}});var c8=FQ();Object.defineProperty(b$,"Scope",{enumerable:!0,get:function(){return c8.Scope}});Object.defineProperty(b$,"ValueScope",{enumerable:!0,get:function(){return c8.ValueScope}});Object.defineProperty(b$,"ValueScopeName",{enumerable:!0,get:function(){return c8.ValueScopeName}});Object.defineProperty(b$,"varKinds",{enumerable:!0,get:function(){return c8.varKinds}});b$.operators={GT:new R0._Code(">"),GTE:new R0._Code(">="),LT:new R0._Code("<"),LTE:new R0._Code("<="),EQ:new R0._Code("==="),NEQ:new R0._Code("!=="),NOT:new R0._Code("!"),OR:new R0._Code("||"),AND:new R0._Code("&&"),ADD:new R0._Code("+")};class C1{optimizeNodes(){return this}optimizeNames($,Z){return this}}class Q3 extends C1{constructor($,Z,X){super();this.varKind=$,this.name=Z,this.rhs=X}render({es5:$,_n:Z}){let X=$?K6.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${Q};`+Z}optimizeNames($,Z){if(!$[this.name.str])return;if(this.rhs)this.rhs=m4(this.rhs,$,Z);return this}get names(){return this.rhs instanceof R0._CodeOrName?this.rhs.names:{}}}class AQ extends C1{constructor($,Z,X){super();this.lhs=$,this.rhs=Z,this.sideEffects=X}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,Z){if(this.lhs instanceof R0.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=m4(this.rhs,$,Z),this}get names(){let $=this.lhs instanceof R0.Name?{}:{...this.lhs.names};return l8($,this.rhs)}}class J3 extends AQ{constructor($,Z,X,Q){super($,X,Q);this.op=Z}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class G3 extends C1{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class W3 extends C1{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class Y3 extends C1{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class z3 extends C1{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,Z){return this.code=m4(this.code,$,Z),this}get names(){return this.code instanceof R0._CodeOrName?this.code.names:{}}}class p8 extends C1{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((Z,X)=>Z+X.render($),"")}optimizeNodes(){let{nodes:$}=this,Z=$.length;while(Z--){let X=$[Z].optimizeNodes();if(Array.isArray(X))$.splice(Z,1,...X);else if(X)$[Z]=X;else $.splice(Z,1)}return $.length>0?this:void 0}optimizeNames($,Z){let{nodes:X}=this,Q=X.length;while(Q--){let J=X[Q];if(J.optimizeNames($,Z))continue;sP($,J.names),X.splice(Q,1)}return X.length>0?this:void 0}get names(){return this.nodes.reduce(($,Z)=>$4($,Z.names),{})}}class S1 extends p8{render($){return"{"+$._n+super.render($)+"}"+$._n}}class q3 extends p8{}class p9 extends S1{}p9.kind="else";class Q1 extends S1{constructor($,Z){super(Z);this.condition=$}render($){let Z=`if(${this.condition})`+super.render($);if(this.else)Z+="else "+this.else.render($);return Z}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let Z=this.else;if(Z){let X=Z.optimizeNodes();Z=this.else=Array.isArray(X)?new p9(X):X}if(Z){if($===!1)return Z instanceof Q1?Z:Z.nodes;if(this.nodes.length)return this;return new Q1(B3($),Z instanceof Q1?[Z]:Z.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,Z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames($,Z),!(super.optimizeNames($,Z)||this.else))return;return this.condition=m4(this.condition,$,Z),this}get names(){let $=super.names;if(l8($,this.condition),this.else)$4($,this.else.names);return $}}Q1.kind="if";class u4 extends S1{}u4.kind="for";class U3 extends u4{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iteration=m4(this.iteration,$,Z),this}get names(){return $4(super.names,this.iteration.names)}}class K3 extends u4{constructor($,Z,X,Q){super();this.varKind=$,this.name=Z,this.from=X,this.to=Q}render($){let Z=$.es5?K6.varKinds.var:this.varKind,{name:X,from:Q,to:J}=this;return`for(${Z} ${X}=${Q}; ${X}<${J}; ${X}++)`+super.render($)}get names(){let $=l8(super.names,this.from);return l8($,this.to)}}class LQ extends u4{constructor($,Z,X,Q){super();this.loop=$,this.varKind=Z,this.name=X,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iterable=m4(this.iterable,$,Z),this}get names(){return $4(super.names,this.iterable.names)}}class h8 extends S1{constructor($,Z,X){super();this.name=$,this.args=Z,this.async=X}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}h8.kind="func";class u8 extends p8{render($){return"return "+super.render($)}}u8.kind="return";class H3 extends S1{render($){let Z="try"+super.render($);if(this.catch)Z+=this.catch.render($);if(this.finally)Z+=this.finally.render($);return Z}optimizeNodes(){var $,Z;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(Z=this.finally)===null||Z===void 0||Z.optimizeNodes(),this}optimizeNames($,Z){var X,Q;return super.optimizeNames($,Z),(X=this.catch)===null||X===void 0||X.optimizeNames($,Z),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,Z),this}get names(){let $=super.names;if(this.catch)$4($,this.catch.names);if(this.finally)$4($,this.finally.names);return $}}class m8 extends S1{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}m8.kind="catch";class d8 extends S1{render($){return"finally"+super.render($)}}d8.kind="finally";class V3{constructor($,Z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Z,_n:Z.lines?`
390
- `:""},this._extScope=$,this._scope=new K6.Scope({parent:$}),this._nodes=[new q3]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,Z){let X=this._extScope.value($,Z);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue($,Z){return this._extScope.getValue($,Z)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,Z,X,Q){let J=this._scope.toName(Z);if(X!==void 0&&Q)this._constants[J.str]=X;return this._leafNode(new Q3($,J,X)),J}const($,Z,X){return this._def(K6.varKinds.const,$,Z,X)}let($,Z,X){return this._def(K6.varKinds.let,$,Z,X)}var($,Z,X){return this._def(K6.varKinds.var,$,Z,X)}assign($,Z,X){return this._leafNode(new AQ($,Z,X))}add($,Z){return this._leafNode(new J3($,b$.operators.ADD,Z))}code($){if(typeof $=="function")$();else if($!==R0.nil)this._leafNode(new z3($));return this}object(...$){let Z=["{"];for(let[X,Q]of $){if(Z.length>1)Z.push(",");if(Z.push(X),X!==Q||this.opts.es5)Z.push(":"),(0,R0.addCodeArg)(Z,Q)}return Z.push("}"),new R0._Code(Z)}if($,Z,X){if(this._blockNode(new Q1($)),Z&&X)this.code(Z).else().code(X).endIf();else if(Z)this.code(Z).endIf();else if(X)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new Q1($))}else(){return this._elseNode(new p9)}endIf(){return this._endBlockNode(Q1,p9)}_for($,Z){if(this._blockNode($),Z)this.code(Z).endFor();return this}for($,Z){return this._for(new U3($),Z)}forRange($,Z,X,Q,J=this.opts.es5?K6.varKinds.var:K6.varKinds.let){let G=this._scope.toName($);return this._for(new K3(J,G,Z,X),()=>Q(G))}forOf($,Z,X,Q=K6.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=Z instanceof R0.Name?Z:this.var("_arr",Z);return this.forRange("_i",0,R0._`${G}.length`,(W)=>{this.var(J,R0._`${G}[${W}]`),X(J)})}return this._for(new LQ("of",Q,J,Z),()=>X(J))}forIn($,Z,X,Q=this.opts.es5?K6.varKinds.var:K6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,R0._`Object.keys(${Z})`,X);let J=this._scope.toName($);return this._for(new LQ("in",Q,J,Z),()=>X(J))}endFor(){return this._endBlockNode(u4)}label($){return this._leafNode(new G3($))}break($){return this._leafNode(new W3($))}return($){let Z=new u8;if(this._blockNode(Z),this.code($),Z.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(u8)}try($,Z,X){if(!Z&&!X)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new H3;if(this._blockNode(Q),this.code($),Z){let J=this.name("e");this._currNode=Q.catch=new m8(J),Z(J)}if(X)this._currNode=Q.finally=new d8,this.code(X);return this._endBlockNode(m8,d8)}throw($){return this._leafNode(new Y3($))}block($,Z){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(Z);return this}endBlock($){let Z=this._blockStarts.pop();if(Z===void 0)throw Error("CodeGen: not in self-balancing block");let X=this._nodes.length-Z;if(X<0||$!==void 0&&X!==$)throw Error(`CodeGen: wrong number of nodes: ${X} vs ${$} expected`);return this._nodes.length=Z,this}func($,Z=R0.nil,X,Q){if(this._blockNode(new h8($,Z,X)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(h8)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,Z){let X=this._currNode;if(X instanceof $||Z&&X instanceof Z)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Z?`${$.kind}/${Z.kind}`:$.kind}"`)}_elseNode($){let Z=this._currNode;if(!(Z instanceof Q1))throw Error('CodeGen: "else" without "if"');return this._currNode=Z.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let Z=this._nodes;Z[Z.length-1]=$}}b$.CodeGen=V3;function $4($,Z){for(let X in Z)$[X]=($[X]||0)+(Z[X]||0);return $}function l8($,Z){return Z instanceof R0._CodeOrName?$4($,Z.names):$}function m4($,Z,X){if($ instanceof R0.Name)return Q($);if(!J($))return $;return new R0._Code($._items.reduce((G,W)=>{if(W instanceof R0.Name)W=Q(W);if(W instanceof R0._Code)G.push(...W._items);else G.push(W);return G},[]));function Q(G){let W=X[G.str];if(W===void 0||Z[G.str]!==1)return G;return delete Z[G.str],W}function J(G){return G instanceof R0._Code&&G._items.some((W)=>W instanceof R0.Name&&Z[W.str]===1&&X[W.str]!==void 0)}}function sP($,Z){for(let X in Z)$[X]=($[X]||0)-(Z[X]||0)}function B3($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:R0._`!${MQ($)}`}b$.not=B3;var tP=F3(b$.operators.AND);function eP(...$){return $.reduce(tP)}b$.and=eP;var $C=F3(b$.operators.OR);function ZC(...$){return $.reduce($C)}b$.or=ZC;function F3($){return(Z,X)=>Z===R0.nil?X:X===R0.nil?Z:R0._`${MQ(Z)} ${$} ${MQ(X)}`}function MQ($){return $ instanceof R0.Name?$:R0._`(${$})`}});var O0=b((j3)=>{Object.defineProperty(j3,"__esModule",{value:!0});j3.checkStrictMode=j3.getErrorPath=j3.Type=j3.useFunc=j3.setEvaluated=j3.evaluatedPropsToName=j3.mergeEvaluated=j3.eachItem=j3.unescapeJsonPointer=j3.escapeJsonPointer=j3.escapeFragment=j3.unescapeFragment=j3.schemaRefOrVal=j3.schemaHasRulesButRef=j3.schemaHasRules=j3.checkUnknownRules=j3.alwaysValidSchema=j3.toHash=void 0;var k0=A0(),GC=c9();function WC($){let Z={};for(let X of $)Z[X]=!0;return Z}j3.toHash=WC;function YC($,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return I3($,Z),!N3(Z,$.self.RULES.all)}j3.alwaysValidSchema=YC;function I3($,Z=$.schema){let{opts:X,self:Q}=$;if(!X.strictSchema)return;if(typeof Z==="boolean")return;let J=Q.RULES.keywords;for(let G in Z)if(!J[G])T3($,`unknown keyword: "${G}"`)}j3.checkUnknownRules=I3;function N3($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(Z[X])return!0;return!1}j3.schemaHasRules=N3;function zC($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(X!=="$ref"&&Z.all[X])return!0;return!1}j3.schemaHasRulesButRef=zC;function qC({topSchemaRef:$,schemaPath:Z},X,Q,J){if(!J){if(typeof X=="number"||typeof X=="boolean")return X;if(typeof X=="string")return k0._`${X}`}return k0._`${$}${Z}${(0,k0.getProperty)(Q)}`}j3.schemaRefOrVal=qC;function UC($){return D3(decodeURIComponent($))}j3.unescapeFragment=UC;function KC($){return encodeURIComponent(NQ($))}j3.escapeFragment=KC;function NQ($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}j3.escapeJsonPointer=NQ;function D3($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}j3.unescapeJsonPointer=D3;function HC($,Z){if(Array.isArray($))for(let X of $)Z(X);else Z($)}j3.eachItem=HC;function M3({mergeNames:$,mergeToName:Z,mergeValues:X,resultToName:Q}){return(J,G,W,Y)=>{let z=W===void 0?G:W instanceof k0.Name?(G instanceof k0.Name?$(J,G,W):Z(J,G,W),W):G instanceof k0.Name?(Z(J,W,G),G):X(G,W);return Y===k0.Name&&!(z instanceof k0.Name)?Q(J,z):z}}j3.mergeEvaluated={props:M3({mergeNames:($,Z,X)=>$.if(k0._`${X} !== true && ${Z} !== undefined`,()=>{$.if(k0._`${Z} === true`,()=>$.assign(X,!0),()=>$.assign(X,k0._`${X} || {}`).code(k0._`Object.assign(${X}, ${Z})`))}),mergeToName:($,Z,X)=>$.if(k0._`${X} !== true`,()=>{if(Z===!0)$.assign(X,!0);else $.assign(X,k0._`${X} || {}`),DQ($,X,Z)}),mergeValues:($,Z)=>$===!0?!0:{...$,...Z},resultToName:w3}),items:M3({mergeNames:($,Z,X)=>$.if(k0._`${X} !== true && ${Z} !== undefined`,()=>$.assign(X,k0._`${Z} === true ? true : ${X} > ${Z} ? ${X} : ${Z}`)),mergeToName:($,Z,X)=>$.if(k0._`${X} !== true`,()=>$.assign(X,Z===!0?!0:k0._`${X} > ${Z} ? ${X} : ${Z}`)),mergeValues:($,Z)=>$===!0?!0:Math.max($,Z),resultToName:($,Z)=>$.var("items",Z)})};function w3($,Z){if(Z===!0)return $.var("props",!0);let X=$.var("props",k0._`{}`);if(Z!==void 0)DQ($,X,Z);return X}j3.evaluatedPropsToName=w3;function DQ($,Z,X){Object.keys(X).forEach((Q)=>$.assign(k0._`${Z}${(0,k0.getProperty)(Q)}`,!0))}j3.setEvaluated=DQ;var A3={};function VC($,Z){return $.scopeValue("func",{ref:Z,code:A3[Z.code]||(A3[Z.code]=new GC._Code(Z.code))})}j3.useFunc=VC;var IQ;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(IQ||(j3.Type=IQ={}));function BC($,Z,X){if($ instanceof k0.Name){let Q=Z===IQ.Num;return X?Q?k0._`"[" + ${$} + "]"`:k0._`"['" + ${$} + "']"`:Q?k0._`"/" + ${$}`:k0._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return X?(0,k0.getProperty)($).toString():"/"+NQ($)}j3.getErrorPath=BC;function T3($,Z,X=$.opts.strictSchema){if(!X)return;if(Z=`strict mode: ${Z}`,X===!0)throw Error(Z);$.self.logger.warn(Z)}j3.checkStrictMode=T3});var Q6=b((E3)=>{Object.defineProperty(E3,"__esModule",{value:!0});var H$=A0(),xC={data:new H$.Name("data"),valCxt:new H$.Name("valCxt"),instancePath:new H$.Name("instancePath"),parentData:new H$.Name("parentData"),parentDataProperty:new H$.Name("parentDataProperty"),rootData:new H$.Name("rootData"),dynamicAnchors:new H$.Name("dynamicAnchors"),vErrors:new H$.Name("vErrors"),errors:new H$.Name("errors"),this:new H$.Name("this"),self:new H$.Name("self"),scope:new H$.Name("scope"),json:new H$.Name("json"),jsonPos:new H$.Name("jsonPos"),jsonLen:new H$.Name("jsonLen"),jsonPart:new H$.Name("jsonPart")};E3.default=xC});var i9=b((S3)=>{Object.defineProperty(S3,"__esModule",{value:!0});S3.extendErrors=S3.resetErrorsCount=S3.reportExtraError=S3.reportError=S3.keyword$DataError=S3.keywordError=void 0;var P0=A0(),n8=O0(),w$=Q6();S3.keywordError={message:({keyword:$})=>P0.str`must pass "${$}" keyword validation`};S3.keyword$DataError={message:({keyword:$,schemaType:Z})=>Z?P0.str`"${$}" keyword must be ${Z} ($data)`:P0.str`"${$}" keyword is invalid ($data)`};function kC($,Z=S3.keywordError,X,Q){let{it:J}=$,{gen:G,compositeRule:W,allErrors:Y}=J,z=C3($,Z,X);if(Q!==null&&Q!==void 0?Q:W||Y)R3(G,z);else P3(J,P0._`[${z}]`)}S3.reportError=kC;function yC($,Z=S3.keywordError,X){let{it:Q}=$,{gen:J,compositeRule:G,allErrors:W}=Q,Y=C3($,Z,X);if(R3(J,Y),!(G||W))P3(Q,w$.default.vErrors)}S3.reportExtraError=yC;function vC($,Z){$.assign(w$.default.errors,Z),$.if(P0._`${w$.default.vErrors} !== null`,()=>$.if(Z,()=>$.assign(P0._`${w$.default.vErrors}.length`,Z),()=>$.assign(w$.default.vErrors,null)))}S3.resetErrorsCount=vC;function gC({gen:$,keyword:Z,schemaValue:X,data:Q,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",J,w$.default.errors,(Y)=>{if($.const(W,P0._`${w$.default.vErrors}[${Y}]`),$.if(P0._`${W}.instancePath === undefined`,()=>$.assign(P0._`${W}.instancePath`,(0,P0.strConcat)(w$.default.instancePath,G.errorPath))),$.assign(P0._`${W}.schemaPath`,P0.str`${G.errSchemaPath}/${Z}`),G.opts.verbose)$.assign(P0._`${W}.schema`,X),$.assign(P0._`${W}.data`,Q)})}S3.extendErrors=gC;function R3($,Z){let X=$.const("err",Z);$.if(P0._`${w$.default.vErrors} === null`,()=>$.assign(w$.default.vErrors,P0._`[${X}]`),P0._`${w$.default.vErrors}.push(${X})`),$.code(P0._`${w$.default.errors}++`)}function P3($,Z){let{gen:X,validateName:Q,schemaEnv:J}=$;if(J.$async)X.throw(P0._`new ${$.ValidationError}(${Z})`);else X.assign(P0._`${Q}.errors`,Z),X.return(!1)}var Z4={keyword:new P0.Name("keyword"),schemaPath:new P0.Name("schemaPath"),params:new P0.Name("params"),propertyName:new P0.Name("propertyName"),message:new P0.Name("message"),schema:new P0.Name("schema"),parentSchema:new P0.Name("parentSchema")};function C3($,Z,X){let{createErrors:Q}=$.it;if(Q===!1)return P0._`{}`;return fC($,Z,X)}function fC($,Z,X={}){let{gen:Q,it:J}=$,G=[hC(J,X),uC($,X)];return mC($,Z,G),Q.object(...G)}function hC({errorPath:$},{instancePath:Z}){let X=Z?P0.str`${$}${(0,n8.getErrorPath)(Z,n8.Type.Str)}`:$;return[w$.default.instancePath,(0,P0.strConcat)(w$.default.instancePath,X)]}function uC({keyword:$,it:{errSchemaPath:Z}},{schemaPath:X,parentSchema:Q}){let J=Q?Z:P0.str`${Z}/${$}`;if(X)J=P0.str`${J}${(0,n8.getErrorPath)(X,n8.Type.Str)}`;return[Z4.schemaPath,J]}function mC($,{params:Z,message:X},Q){let{keyword:J,data:G,schemaValue:W,it:Y}=$,{opts:z,propertyName:q,topSchemaRef:H,schemaPath:B}=Y;if(Q.push([Z4.keyword,J],[Z4.params,typeof Z=="function"?Z($):Z||P0._`{}`]),z.messages)Q.push([Z4.message,typeof X=="function"?X($):X]);if(z.verbose)Q.push([Z4.schema,W],[Z4.parentSchema,P0._`${H}${B}`],[w$.default.data,G]);if(q)Q.push([Z4.propertyName,q])}});var y3=b((b3)=>{Object.defineProperty(b3,"__esModule",{value:!0});b3.boolOrEmptySchema=b3.topBoolOrEmptySchema=void 0;var iC=i9(),nC=A0(),rC=Q6(),aC={message:"boolean schema is false"};function oC($){let{gen:Z,schema:X,validateName:Q}=$;if(X===!1)x3($,!1);else if(typeof X=="object"&&X.$async===!0)Z.return(rC.default.data);else Z.assign(nC._`${Q}.errors`,null),Z.return(!0)}b3.topBoolOrEmptySchema=oC;function sC($,Z){let{gen:X,schema:Q}=$;if(Q===!1)X.var(Z,!1),x3($);else X.var(Z,!0)}b3.boolOrEmptySchema=sC;function x3($,Z){let{gen:X,data:Q}=$,J={gen:X,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,iC.reportError)(J,aC,void 0,Z)}});var TQ=b((v3)=>{Object.defineProperty(v3,"__esModule",{value:!0});v3.getRules=v3.isJSONType=void 0;var eC=["string","number","integer","boolean","null","object","array"],$S=new Set(eC);function ZS($){return typeof $=="string"&&$S.has($)}v3.isJSONType=ZS;function XS(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}v3.getRules=XS});var jQ=b((u3)=>{Object.defineProperty(u3,"__esModule",{value:!0});u3.shouldUseRule=u3.shouldUseGroup=u3.schemaHasRulesForType=void 0;function JS({schema:$,self:Z},X){let Q=Z.RULES.types[X];return Q&&Q!==!0&&f3($,Q)}u3.schemaHasRulesForType=JS;function f3($,Z){return Z.rules.some((X)=>h3($,X))}u3.shouldUseGroup=f3;function h3($,Z){var X;return $[Z.keyword]!==void 0||((X=Z.definition.implements)===null||X===void 0?void 0:X.some((Q)=>$[Q]!==void 0))}u3.shouldUseRule=h3});var n9=b((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});p3.reportTypeError=p3.checkDataTypes=p3.checkDataType=p3.coerceAndCheckDataType=p3.getJSONTypes=p3.getSchemaTypes=p3.DataType=void 0;var YS=TQ(),zS=jQ(),qS=i9(),T0=A0(),d3=O0(),d4;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(d4||(p3.DataType=d4={}));function US($){let Z=l3($.type);if(Z.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!Z.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)Z.push("null")}return Z}p3.getSchemaTypes=US;function l3($){let Z=Array.isArray($)?$:$?[$]:[];if(Z.every(YS.isJSONType))return Z;throw Error("type must be JSONType or JSONType[]: "+Z.join(","))}p3.getJSONTypes=l3;function KS($,Z){let{gen:X,data:Q,opts:J}=$,G=HS(Z,J.coerceTypes),W=Z.length>0&&!(G.length===0&&Z.length===1&&(0,zS.schemaHasRulesForType)($,Z[0]));if(W){let Y=EQ(Z,Q,J.strictNumbers,d4.Wrong);X.if(Y,()=>{if(G.length)VS($,Z,G);else RQ($)})}return W}p3.coerceAndCheckDataType=KS;var c3=new Set(["string","number","integer","boolean","null"]);function HS($,Z){return Z?$.filter((X)=>c3.has(X)||Z==="array"&&X==="array"):[]}function VS($,Z,X){let{gen:Q,data:J,opts:G}=$,W=Q.let("dataType",T0._`typeof ${J}`),Y=Q.let("coerced",T0._`undefined`);if(G.coerceTypes==="array")Q.if(T0._`${W} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Q.assign(J,T0._`${J}[0]`).assign(W,T0._`typeof ${J}`).if(EQ(Z,J,G.strictNumbers),()=>Q.assign(Y,J)));Q.if(T0._`${Y} !== undefined`);for(let q of X)if(c3.has(q)||q==="array"&&G.coerceTypes==="array")z(q);Q.else(),RQ($),Q.endIf(),Q.if(T0._`${Y} !== undefined`,()=>{Q.assign(J,Y),BS($,Y)});function z(q){switch(q){case"string":Q.elseIf(T0._`${W} == "number" || ${W} == "boolean"`).assign(Y,T0._`"" + ${J}`).elseIf(T0._`${J} === null`).assign(Y,T0._`""`);return;case"number":Q.elseIf(T0._`${W} == "boolean" || ${J} === null
391
- || (${W} == "string" && ${J} && ${J} == +${J})`).assign(Y,T0._`+${J}`);return;case"integer":Q.elseIf(T0._`${W} === "boolean" || ${J} === null
392
- || (${W} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(Y,T0._`+${J}`);return;case"boolean":Q.elseIf(T0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(Y,!1).elseIf(T0._`${J} === "true" || ${J} === 1`).assign(Y,!0);return;case"null":Q.elseIf(T0._`${J} === "" || ${J} === 0 || ${J} === false`),Q.assign(Y,null);return;case"array":Q.elseIf(T0._`${W} === "string" || ${W} === "number"
393
- || ${W} === "boolean" || ${J} === null`).assign(Y,T0._`[${J}]`)}}}function BS({gen:$,parentData:Z,parentDataProperty:X},Q){$.if(T0._`${Z} !== undefined`,()=>$.assign(T0._`${Z}[${X}]`,Q))}function OQ($,Z,X,Q=d4.Correct){let J=Q===d4.Correct?T0.operators.EQ:T0.operators.NEQ,G;switch($){case"null":return T0._`${Z} ${J} null`;case"array":G=T0._`Array.isArray(${Z})`;break;case"object":G=T0._`${Z} && typeof ${Z} == "object" && !Array.isArray(${Z})`;break;case"integer":G=W(T0._`!(${Z} % 1) && !isNaN(${Z})`);break;case"number":G=W();break;default:return T0._`typeof ${Z} ${J} ${$}`}return Q===d4.Correct?G:(0,T0.not)(G);function W(Y=T0.nil){return(0,T0.and)(T0._`typeof ${Z} == "number"`,Y,X?T0._`isFinite(${Z})`:T0.nil)}}p3.checkDataType=OQ;function EQ($,Z,X,Q){if($.length===1)return OQ($[0],Z,X,Q);let J,G=(0,d3.toHash)($);if(G.array&&G.object){let W=T0._`typeof ${Z} != "object"`;J=G.null?W:T0._`!${Z} || ${W}`,delete G.null,delete G.array,delete G.object}else J=T0.nil;if(G.number)delete G.integer;for(let W in G)J=(0,T0.and)(J,OQ(W,Z,X,Q));return J}p3.checkDataTypes=EQ;var FS={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:Z})=>typeof $=="string"?T0._`{type: ${$}}`:T0._`{type: ${Z}}`};function RQ($){let Z=LS($);(0,qS.reportError)(Z,FS)}p3.reportTypeError=RQ;function LS($){let{gen:Z,data:X,schema:Q}=$,J=(0,d3.schemaRefOrVal)($,Q,"type");return{gen:Z,keyword:"type",data:X,schema:Q.type,schemaCode:J,schemaValue:J,parentSchema:Q,params:{},it:$}}});var o3=b((r3)=>{Object.defineProperty(r3,"__esModule",{value:!0});r3.assignDefaults=void 0;var l4=A0(),TS=O0();function jS($,Z){let{properties:X,items:Q}=$.schema;if(Z==="object"&&X)for(let J in X)n3($,J,X[J].default);else if(Z==="array"&&Array.isArray(Q))Q.forEach((J,G)=>n3($,G,J.default))}r3.assignDefaults=jS;function n3($,Z,X){let{gen:Q,compositeRule:J,data:G,opts:W}=$;if(X===void 0)return;let Y=l4._`${G}${(0,l4.getProperty)(Z)}`;if(J){(0,TS.checkStrictMode)($,`default is ignored for: ${Y}`);return}let z=l4._`${Y} === undefined`;if(W.useDefaults==="empty")z=l4._`${z} || ${Y} === null || ${Y} === ""`;Q.if(z,l4._`${Y} = ${(0,l4.stringify)(X)}`)}});var J6=b((e3)=>{Object.defineProperty(e3,"__esModule",{value:!0});e3.validateUnion=e3.validateArray=e3.usePattern=e3.callValidateCode=e3.schemaProperties=e3.allSchemaProperties=e3.noPropertyInData=e3.propertyInData=e3.isOwnProperty=e3.hasPropFunc=e3.reportMissingProp=e3.checkMissingProp=e3.checkReportMissingProp=void 0;var f0=A0(),PQ=O0(),_1=Q6(),OS=O0();function ES($,Z){let{gen:X,data:Q,it:J}=$;X.if(SQ(X,Q,Z,J.opts.ownProperties),()=>{$.setParams({missingProperty:f0._`${Z}`},!0),$.error()})}e3.checkReportMissingProp=ES;function RS({gen:$,data:Z,it:{opts:X}},Q,J){return(0,f0.or)(...Q.map((G)=>(0,f0.and)(SQ($,Z,G,X.ownProperties),f0._`${J} = ${G}`)))}e3.checkMissingProp=RS;function PS($,Z){$.setParams({missingProperty:Z},!0),$.error()}e3.reportMissingProp=PS;function s3($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:f0._`Object.prototype.hasOwnProperty`})}e3.hasPropFunc=s3;function CQ($,Z,X){return f0._`${s3($)}.call(${Z}, ${X})`}e3.isOwnProperty=CQ;function CS($,Z,X,Q){let J=f0._`${Z}${(0,f0.getProperty)(X)} !== undefined`;return Q?f0._`${J} && ${CQ($,Z,X)}`:J}e3.propertyInData=CS;function SQ($,Z,X,Q){let J=f0._`${Z}${(0,f0.getProperty)(X)} === undefined`;return Q?(0,f0.or)(J,(0,f0.not)(CQ($,Z,X))):J}e3.noPropertyInData=SQ;function t3($){return $?Object.keys($).filter((Z)=>Z!=="__proto__"):[]}e3.allSchemaProperties=t3;function SS($,Z){return t3(Z).filter((X)=>!(0,PQ.alwaysValidSchema)($,Z[X]))}e3.schemaProperties=SS;function _S({schemaCode:$,data:Z,it:{gen:X,topSchemaRef:Q,schemaPath:J,errorPath:G},it:W},Y,z,q){let H=q?f0._`${$}, ${Z}, ${Q}${J}`:Z,B=[[_1.default.instancePath,(0,f0.strConcat)(_1.default.instancePath,G)],[_1.default.parentData,W.parentData],[_1.default.parentDataProperty,W.parentDataProperty],[_1.default.rootData,_1.default.rootData]];if(W.opts.dynamicRef)B.push([_1.default.dynamicAnchors,_1.default.dynamicAnchors]);let L=f0._`${H}, ${X.object(...B)}`;return z!==f0.nil?f0._`${Y}.call(${z}, ${L})`:f0._`${Y}(${L})`}e3.callValidateCode=_S;var xS=f0._`new RegExp`;function bS({gen:$,it:{opts:Z}},X){let Q=Z.unicodeRegExp?"u":"",{regExp:J}=Z.code,G=J(X,Q);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:f0._`${J.code==="new RegExp"?xS:(0,OS.useFunc)($,J)}(${X}, ${Q})`})}e3.usePattern=bS;function kS($){let{gen:Z,data:X,keyword:Q,it:J}=$,G=Z.name("valid");if(J.allErrors){let Y=Z.let("valid",!0);return W(()=>Z.assign(Y,!1)),Y}return Z.var(G,!0),W(()=>Z.break()),G;function W(Y){let z=Z.const("len",f0._`${X}.length`);Z.forRange("i",0,z,(q)=>{$.subschema({keyword:Q,dataProp:q,dataPropType:PQ.Type.Num},G),Z.if((0,f0.not)(G),Y)})}}e3.validateArray=kS;function yS($){let{gen:Z,schema:X,keyword:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(X.some((z)=>(0,PQ.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let W=Z.let("valid",!1),Y=Z.name("_valid");Z.block(()=>X.forEach((z,q)=>{let H=$.subschema({keyword:Q,schemaProp:q,compositeRule:!0},Y);if(Z.assign(W,f0._`${W} || ${Y}`),!$.mergeValidEvaluated(H,Y))Z.if((0,f0.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}e3.validateUnion=yS});var GB=b((QB)=>{Object.defineProperty(QB,"__esModule",{value:!0});QB.validateKeywordUsage=QB.validSchemaType=QB.funcKeywordCode=QB.macroKeywordCode=void 0;var T$=A0(),X4=Q6(),rS=J6(),aS=i9();function oS($,Z){let{gen:X,keyword:Q,schema:J,parentSchema:G,it:W}=$,Y=Z.macro.call(W.self,J,G,W),z=XB(X,Q,Y);if(W.opts.validateSchema!==!1)W.self.validateSchema(Y,!0);let q=X.name("valid");$.subschema({schema:Y,schemaPath:T$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:z,compositeRule:!0},q),$.pass(q,()=>$.error(!0))}QB.macroKeywordCode=oS;function sS($,Z){var X;let{gen:Q,keyword:J,schema:G,parentSchema:W,$data:Y,it:z}=$;eS(z,Z);let q=!Y&&Z.compile?Z.compile.call(z.self,G,W,z):Z.validate,H=XB(Q,J,q),B=Q.let("valid");$.block$data(B,L),$.ok((X=Z.valid)!==null&&X!==void 0?X:B);function L(){if(Z.errors===!1){if(w(),Z.modifying)ZB($);D(()=>$.error())}else{let j=Z.async?M():A();if(Z.modifying)ZB($);D(()=>tS($,j))}}function M(){let j=Q.let("ruleErrs",null);return Q.try(()=>w(T$._`await `),(E)=>Q.assign(B,!1).if(T$._`${E} instanceof ${z.ValidationError}`,()=>Q.assign(j,T$._`${E}.errors`),()=>Q.throw(E))),j}function A(){let j=T$._`${H}.errors`;return Q.assign(j,null),w(T$.nil),j}function w(j=Z.async?T$._`await `:T$.nil){let E=z.opts.passContext?X4.default.this:X4.default.self,P=!(("compile"in Z)&&!Y||Z.schema===!1);Q.assign(B,T$._`${j}${(0,rS.callValidateCode)($,H,E,P)}`,Z.modifying)}function D(j){var E;Q.if((0,T$.not)((E=Z.valid)!==null&&E!==void 0?E:B),j)}}QB.funcKeywordCode=sS;function ZB($){let{gen:Z,data:X,it:Q}=$;Z.if(Q.parentData,()=>Z.assign(X,T$._`${Q.parentData}[${Q.parentDataProperty}]`))}function tS($,Z){let{gen:X}=$;X.if(T$._`Array.isArray(${Z})`,()=>{X.assign(X4.default.vErrors,T$._`${X4.default.vErrors} === null ? ${Z} : ${X4.default.vErrors}.concat(${Z})`).assign(X4.default.errors,T$._`${X4.default.vErrors}.length`),(0,aS.extendErrors)($)},()=>$.error())}function eS({schemaEnv:$},Z){if(Z.async&&!$.$async)throw Error("async keyword in sync schema")}function XB($,Z,X){if(X===void 0)throw Error(`keyword "${Z}" failed to compile`);return $.scopeValue("keyword",typeof X=="function"?{ref:X}:{ref:X,code:(0,T$.stringify)(X)})}function $_($,Z,X=!1){return!Z.length||Z.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||X&&typeof $>"u")}QB.validSchemaType=$_;function Z_({schema:$,opts:Z,self:X,errSchemaPath:Q},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let W=J.dependencies;if(W===null||W===void 0?void 0:W.some((Y)=>!Object.prototype.hasOwnProperty.call($,Y)))throw Error(`parent schema must have dependencies of ${G}: ${W.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Q}": `+X.errorsText(J.validateSchema.errors);if(Z.validateSchema==="log")X.logger.error(z);else throw Error(z)}}}QB.validateKeywordUsage=Z_});var qB=b((YB)=>{Object.defineProperty(YB,"__esModule",{value:!0});YB.extendSubschemaMode=YB.extendSubschemaData=YB.getSubschema=void 0;var y6=A0(),WB=O0();function G_($,{keyword:Z,schemaProp:X,schema:Q,schemaPath:J,errSchemaPath:G,topSchemaRef:W}){if(Z!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(Z!==void 0){let Y=$.schema[Z];return X===void 0?{schema:Y,schemaPath:y6._`${$.schemaPath}${(0,y6.getProperty)(Z)}`,errSchemaPath:`${$.errSchemaPath}/${Z}`}:{schema:Y[X],schemaPath:y6._`${$.schemaPath}${(0,y6.getProperty)(Z)}${(0,y6.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${Z}/${(0,WB.escapeFragment)(X)}`}}if(Q!==void 0){if(J===void 0||G===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:J,topSchemaRef:W,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}YB.getSubschema=G_;function W_($,Z,{dataProp:X,dataPropType:Q,data:J,dataTypes:G,propertyName:W}){if(J!==void 0&&X!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=Z;if(X!==void 0){let{errorPath:q,dataPathArr:H,opts:B}=Z,L=Y.let("data",y6._`${Z.data}${(0,y6.getProperty)(X)}`,!0);z(L),$.errorPath=y6.str`${q}${(0,WB.getErrorPath)(X,Q,B.jsPropertySyntax)}`,$.parentDataProperty=y6._`${X}`,$.dataPathArr=[...H,$.parentDataProperty]}if(J!==void 0){let q=J instanceof y6.Name?J:Y.let("data",J,!0);if(z(q),W!==void 0)$.propertyName=W}if(G)$.dataTypes=G;function z(q){$.data=q,$.dataLevel=Z.dataLevel+1,$.dataTypes=[],Z.definedProperties=new Set,$.parentData=Z.data,$.dataNames=[...Z.dataNames,q]}}YB.extendSubschemaData=W_;function Y_($,{jtdDiscriminator:Z,jtdMetadata:X,compositeRule:Q,createErrors:J,allErrors:G}){if(Q!==void 0)$.compositeRule=Q;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=Z,$.jtdMetadata=X}YB.extendSubschemaMode=Y_});var _Q=b((Ni,UB)=>{UB.exports=function $(Z,X){if(Z===X)return!0;if(Z&&X&&typeof Z=="object"&&typeof X=="object"){if(Z.constructor!==X.constructor)return!1;var Q,J,G;if(Array.isArray(Z)){if(Q=Z.length,Q!=X.length)return!1;for(J=Q;J--!==0;)if(!$(Z[J],X[J]))return!1;return!0}if(Z.constructor===RegExp)return Z.source===X.source&&Z.flags===X.flags;if(Z.valueOf!==Object.prototype.valueOf)return Z.valueOf()===X.valueOf();if(Z.toString!==Object.prototype.toString)return Z.toString()===X.toString();if(G=Object.keys(Z),Q=G.length,Q!==Object.keys(X).length)return!1;for(J=Q;J--!==0;)if(!Object.prototype.hasOwnProperty.call(X,G[J]))return!1;for(J=Q;J--!==0;){var W=G[J];if(!$(Z[W],X[W]))return!1}return!0}return Z!==Z&&X!==X}});var HB=b((Di,KB)=>{var x1=KB.exports=function($,Z,X){if(typeof Z=="function")X=Z,Z={};X=Z.cb||X;var Q=typeof X=="function"?X:X.pre||function(){},J=X.post||function(){};r8(Z,Q,J,$,"",$)};x1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};x1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};x1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};x1.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r8($,Z,X,Q,J,G,W,Y,z,q){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Z(Q,J,G,W,Y,z,q);for(var H in Q){var B=Q[H];if(Array.isArray(B)){if(H in x1.arrayKeywords)for(var L=0;L<B.length;L++)r8($,Z,X,B[L],J+"/"+H+"/"+L,G,J,H,Q,L)}else if(H in x1.propsKeywords){if(B&&typeof B=="object")for(var M in B)r8($,Z,X,B[M],J+"/"+H+"/"+U_(M),G,J,H,Q,M)}else if(H in x1.keywords||$.allKeys&&!(H in x1.skipKeywords))r8($,Z,X,B,J+"/"+H,G,J,H,Q)}X(Q,J,G,W,Y,z,q)}}function U_($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var r9=b((LB)=>{Object.defineProperty(LB,"__esModule",{value:!0});LB.getSchemaRefs=LB.resolveUrl=LB.normalizeId=LB._getFullPath=LB.getFullPath=LB.inlineRef=void 0;var K_=O0(),H_=_Q(),V_=HB(),B_=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function F_($,Z=!0){if(typeof $=="boolean")return!0;if(Z===!0)return!xQ($);if(!Z)return!1;return VB($)<=Z}LB.inlineRef=F_;var L_=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function xQ($){for(let Z in $){if(L_.has(Z))return!0;let X=$[Z];if(Array.isArray(X)&&X.some(xQ))return!0;if(typeof X=="object"&&xQ(X))return!0}return!1}function VB($){let Z=0;for(let X in $){if(X==="$ref")return 1/0;if(Z++,B_.has(X))continue;if(typeof $[X]=="object")(0,K_.eachItem)($[X],(Q)=>Z+=VB(Q));if(Z===1/0)return 1/0}return Z}function BB($,Z="",X){if(X!==!1)Z=c4(Z);let Q=$.parse(Z);return FB($,Q)}LB.getFullPath=BB;function FB($,Z){return $.serialize(Z).split("#")[0]+"#"}LB._getFullPath=FB;var M_=/#\/?$/;function c4($){return $?$.replace(M_,""):""}LB.normalizeId=c4;function A_($,Z,X){return X=c4(X),$.resolve(Z,X)}LB.resolveUrl=A_;var I_=/^[a-z_][-a-z0-9._]*$/i;function N_($,Z){if(typeof $=="boolean")return{};let{schemaId:X,uriResolver:Q}=this.opts,J=c4($[X]||Z),G={"":J},W=BB(Q,J,!1),Y={},z=new Set;return V_($,{allKeys:!0},(B,L,M,A)=>{if(A===void 0)return;let w=W+L,D=G[A];if(typeof B[X]=="string")D=j.call(this,B[X]);E.call(this,B.$anchor),E.call(this,B.$dynamicAnchor),G[L]=D;function j(P){let R=this.opts.uriResolver.resolve;if(P=c4(D?R(D,P):P),z.has(P))throw H(P);z.add(P);let C=this.refs[P];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")q(B,C.schema,P);else if(P!==c4(w))if(P[0]==="#")q(B,Y[P],P),Y[P]=B;else this.refs[P]=w;return P}function E(P){if(typeof P=="string"){if(!I_.test(P))throw Error(`invalid anchor "${P}"`);j.call(this,`#${P}`)}}}),Y;function q(B,L,M){if(L!==void 0&&!H_(B,L))throw H(M)}function H(B){return Error(`reference "${B}" resolves to more than one schema`)}}LB.getSchemaRefs=N_});var p4=b((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});xB.getData=xB.KeywordCxt=xB.validateFunctionCode=void 0;var wB=y3(),AB=n9(),kQ=jQ(),a8=n9(),E_=o3(),o9=GB(),bQ=qB(),V0=A0(),M0=Q6(),R_=r9(),J1=O0(),a9=i9();function P_($){if(OB($)){if(EB($),jB($)){__($);return}}TB($,()=>(0,wB.topBoolOrEmptySchema)($))}xB.validateFunctionCode=P_;function TB({gen:$,validateName:Z,schema:X,schemaEnv:Q,opts:J},G){if(J.code.es5)$.func(Z,V0._`${M0.default.data}, ${M0.default.valCxt}`,Q.$async,()=>{$.code(V0._`"use strict"; ${IB(X,J)}`),S_($,J),$.code(G)});else $.func(Z,V0._`${M0.default.data}, ${C_(J)}`,Q.$async,()=>$.code(IB(X,J)).code(G))}function C_($){return V0._`{${M0.default.instancePath}="", ${M0.default.parentData}, ${M0.default.parentDataProperty}, ${M0.default.rootData}=${M0.default.data}${$.dynamicRef?V0._`, ${M0.default.dynamicAnchors}={}`:V0.nil}}={}`}function S_($,Z){$.if(M0.default.valCxt,()=>{if($.var(M0.default.instancePath,V0._`${M0.default.valCxt}.${M0.default.instancePath}`),$.var(M0.default.parentData,V0._`${M0.default.valCxt}.${M0.default.parentData}`),$.var(M0.default.parentDataProperty,V0._`${M0.default.valCxt}.${M0.default.parentDataProperty}`),$.var(M0.default.rootData,V0._`${M0.default.valCxt}.${M0.default.rootData}`),Z.dynamicRef)$.var(M0.default.dynamicAnchors,V0._`${M0.default.valCxt}.${M0.default.dynamicAnchors}`)},()=>{if($.var(M0.default.instancePath,V0._`""`),$.var(M0.default.parentData,V0._`undefined`),$.var(M0.default.parentDataProperty,V0._`undefined`),$.var(M0.default.rootData,M0.default.data),Z.dynamicRef)$.var(M0.default.dynamicAnchors,V0._`{}`)})}function __($){let{schema:Z,opts:X,gen:Q}=$;TB($,()=>{if(X.$comment&&Z.$comment)PB($);if(v_($),Q.let(M0.default.vErrors,null),Q.let(M0.default.errors,0),X.unevaluated)x_($);RB($),h_($)});return}function x_($){let{gen:Z,validateName:X}=$;$.evaluated=Z.const("evaluated",V0._`${X}.evaluated`),Z.if(V0._`${$.evaluated}.dynamicProps`,()=>Z.assign(V0._`${$.evaluated}.props`,V0._`undefined`)),Z.if(V0._`${$.evaluated}.dynamicItems`,()=>Z.assign(V0._`${$.evaluated}.items`,V0._`undefined`))}function IB($,Z){let X=typeof $=="object"&&$[Z.schemaId];return X&&(Z.code.source||Z.code.process)?V0._`/*# sourceURL=${X} */`:V0.nil}function b_($,Z){if(OB($)){if(EB($),jB($)){k_($,Z);return}}(0,wB.boolOrEmptySchema)($,Z)}function jB({schema:$,self:Z}){if(typeof $=="boolean")return!$;for(let X in $)if(Z.RULES.all[X])return!0;return!1}function OB($){return typeof $.schema!="boolean"}function k_($,Z){let{schema:X,gen:Q,opts:J}=$;if(J.$comment&&X.$comment)PB($);g_($),f_($);let G=Q.const("_errs",M0.default.errors);RB($,G),Q.var(Z,V0._`${G} === ${M0.default.errors}`)}function EB($){(0,J1.checkUnknownRules)($),y_($)}function RB($,Z){if($.opts.jtd)return NB($,[],!1,Z);let X=(0,AB.getSchemaTypes)($.schema),Q=(0,AB.coerceAndCheckDataType)($,X);NB($,X,!Q,Z)}function y_($){let{schema:Z,errSchemaPath:X,opts:Q,self:J}=$;if(Z.$ref&&Q.ignoreKeywordsWithRef&&(0,J1.schemaHasRulesButRef)(Z,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function v_($){let{schema:Z,opts:X}=$;if(Z.default!==void 0&&X.useDefaults&&X.strictSchema)(0,J1.checkStrictMode)($,"default is ignored in the schema root")}function g_($){let Z=$.schema[$.opts.schemaId];if(Z)$.baseId=(0,R_.resolveUrl)($.opts.uriResolver,$.baseId,Z)}function f_($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function PB({gen:$,schemaEnv:Z,schema:X,errSchemaPath:Q,opts:J}){let G=X.$comment;if(J.$comment===!0)$.code(V0._`${M0.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let W=V0.str`${Q}/$comment`,Y=$.scopeValue("root",{ref:Z.root});$.code(V0._`${M0.default.self}.opts.$comment(${G}, ${W}, ${Y}.schema)`)}}function h_($){let{gen:Z,schemaEnv:X,validateName:Q,ValidationError:J,opts:G}=$;if(X.$async)Z.if(V0._`${M0.default.errors} === 0`,()=>Z.return(M0.default.data),()=>Z.throw(V0._`new ${J}(${M0.default.vErrors})`));else{if(Z.assign(V0._`${Q}.errors`,M0.default.vErrors),G.unevaluated)u_($);Z.return(V0._`${M0.default.errors} === 0`)}}function u_({gen:$,evaluated:Z,props:X,items:Q}){if(X instanceof V0.Name)$.assign(V0._`${Z}.props`,X);if(Q instanceof V0.Name)$.assign(V0._`${Z}.items`,Q)}function NB($,Z,X,Q){let{gen:J,schema:G,data:W,allErrors:Y,opts:z,self:q}=$,{RULES:H}=q;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,J1.schemaHasRulesButRef)(G,H))){J.block(()=>SB($,"$ref",H.all.$ref.definition));return}if(!z.jtd)m_($,Z);J.block(()=>{for(let L of H.rules)B(L);B(H.post)});function B(L){if(!(0,kQ.shouldUseGroup)(G,L))return;if(L.type){if(J.if((0,a8.checkDataType)(L.type,W,z.strictNumbers)),DB($,L),Z.length===1&&Z[0]===L.type&&X)J.else(),(0,a8.reportTypeError)($);J.endIf()}else DB($,L);if(!Y)J.if(V0._`${M0.default.errors} === ${Q||0}`)}}function DB($,Z){let{gen:X,schema:Q,opts:{useDefaults:J}}=$;if(J)(0,E_.assignDefaults)($,Z.type);X.block(()=>{for(let G of Z.rules)if((0,kQ.shouldUseRule)(Q,G))SB($,G.keyword,G.definition,Z.type)})}function m_($,Z){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(d_($,Z),!$.opts.allowUnionTypes)l_($,Z);c_($,$.dataTypes)}function d_($,Z){if(!Z.length)return;if(!$.dataTypes.length){$.dataTypes=Z;return}Z.forEach((X)=>{if(!CB($.dataTypes,X))yQ($,`type "${X}" not allowed by context "${$.dataTypes.join(",")}"`)}),i_($,Z)}function l_($,Z){if(Z.length>1&&!(Z.length===2&&Z.includes("null")))yQ($,"use allowUnionTypes to allow union type keyword")}function c_($,Z){let X=$.self.RULES.all;for(let Q in X){let J=X[Q];if(typeof J=="object"&&(0,kQ.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((W)=>p_(Z,W)))yQ($,`missing type "${G.join(",")}" for keyword "${Q}"`)}}}function p_($,Z){return $.includes(Z)||Z==="number"&&$.includes("integer")}function CB($,Z){return $.includes(Z)||Z==="integer"&&$.includes("number")}function i_($,Z){let X=[];for(let Q of $.dataTypes)if(CB(Z,Q))X.push(Q);else if(Z.includes("integer")&&Q==="number")X.push("integer");$.dataTypes=X}function yQ($,Z){let X=$.schemaEnv.baseId+$.errSchemaPath;Z+=` at "${X}" (strictTypes)`,(0,J1.checkStrictMode)($,Z,$.opts.strictTypes)}class vQ{constructor($,Z,X){if((0,o9.validateKeywordUsage)($,Z,X),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=X,this.data=$.data,this.schema=$.schema[X],this.$data=Z.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,J1.schemaRefOrVal)($,this.schema,X,this.$data),this.schemaType=Z.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=Z,this.$data)this.schemaCode=$.gen.const("vSchema",_B(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,o9.validSchemaType)(this.schema,Z.schemaType,Z.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(Z.schemaType)}`);if("code"in Z?Z.trackErrors:Z.errors!==!1)this.errsCount=$.gen.const("_errs",M0.default.errors)}result($,Z,X){this.failResult((0,V0.not)($),Z,X)}failResult($,Z,X){if(this.gen.if($),X)X();else this.error();if(Z){if(this.gen.else(),Z(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,Z){this.failResult((0,V0.not)($),void 0,Z)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:Z}=this;this.fail(V0._`${Z} !== undefined && (${(0,V0.or)(this.invalid$data(),$)})`)}error($,Z,X){if(Z){this.setParams(Z),this._error($,X),this.setParams({});return}this._error($,X)}_error($,Z){($?a9.reportExtraError:a9.reportError)(this,this.def.error,Z)}$dataError(){(0,a9.reportError)(this,this.def.$dataError||a9.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,a9.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,Z){if(Z)Object.assign(this.params,$);else this.params=$}block$data($,Z,X=V0.nil){this.gen.block(()=>{this.check$data($,X),Z()})}check$data($=V0.nil,Z=V0.nil){if(!this.$data)return;let{gen:X,schemaCode:Q,schemaType:J,def:G}=this;if(X.if((0,V0.or)(V0._`${Q} === undefined`,Z)),$!==V0.nil)X.assign($,!0);if(J.length||G.validateSchema){if(X.elseIf(this.invalid$data()),this.$dataError(),$!==V0.nil)X.assign($,!1)}X.else()}invalid$data(){let{gen:$,schemaCode:Z,schemaType:X,def:Q,it:J}=this;return(0,V0.or)(G(),W());function G(){if(X.length){if(!(Z instanceof V0.Name))throw Error("ajv implementation error");let Y=Array.isArray(X)?X:[X];return V0._`${(0,a8.checkDataTypes)(Y,Z,J.opts.strictNumbers,a8.DataType.Wrong)}`}return V0.nil}function W(){if(Q.validateSchema){let Y=$.scopeValue("validate$data",{ref:Q.validateSchema});return V0._`!${Y}(${Z})`}return V0.nil}}subschema($,Z){let X=(0,bQ.getSubschema)(this.it,$);(0,bQ.extendSubschemaData)(X,this.it,$),(0,bQ.extendSubschemaMode)(X,$);let Q={...this.it,...X,items:void 0,props:void 0};return b_(Q,Z),Q}mergeEvaluated($,Z){let{it:X,gen:Q}=this;if(!X.opts.unevaluated)return;if(X.props!==!0&&$.props!==void 0)X.props=J1.mergeEvaluated.props(Q,$.props,X.props,Z);if(X.items!==!0&&$.items!==void 0)X.items=J1.mergeEvaluated.items(Q,$.items,X.items,Z)}mergeValidEvaluated($,Z){let{it:X,gen:Q}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Q.if(Z,()=>this.mergeEvaluated($,V0.Name)),!0}}xB.KeywordCxt=vQ;function SB($,Z,X,Q){let J=new vQ($,X,Z);if("code"in X)X.code(J,Q);else if(J.$data&&X.validate)(0,o9.funcKeywordCode)(J,X);else if("macro"in X)(0,o9.macroKeywordCode)(J,X);else if(X.compile||X.validate)(0,o9.funcKeywordCode)(J,X)}var n_=/^\/(?:[^~]|~0|~1)*$/,r_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _B($,{dataLevel:Z,dataNames:X,dataPathArr:Q}){let J,G;if($==="")return M0.default.rootData;if($[0]==="/"){if(!n_.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=M0.default.rootData}else{let q=r_.exec($);if(!q)throw Error(`Invalid JSON-pointer: ${$}`);let H=+q[1];if(J=q[2],J==="#"){if(H>=Z)throw Error(z("property/index",H));return Q[Z-H]}if(H>Z)throw Error(z("data",H));if(G=X[Z-H],!J)return G}let W=G,Y=J.split("/");for(let q of Y)if(q)G=V0._`${G}${(0,V0.getProperty)((0,J1.unescapeJsonPointer)(q))}`,W=V0._`${W} && ${G}`;return W;function z(q,H){return`Cannot access ${q} ${H} levels up, current level is ${Z}`}}xB.getData=_B});var s9=b((yB)=>{Object.defineProperty(yB,"__esModule",{value:!0});class kB extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}yB.default=kB});var i4=b((gB)=>{Object.defineProperty(gB,"__esModule",{value:!0});var gQ=r9();class vB extends Error{constructor($,Z,X,Q){super(Q||`can't resolve reference ${X} from id ${Z}`);this.missingRef=(0,gQ.resolveUrl)($,Z,X),this.missingSchema=(0,gQ.normalizeId)((0,gQ.getFullPath)($,this.missingRef))}}gB.default=vB});var e9=b((uB)=>{Object.defineProperty(uB,"__esModule",{value:!0});uB.resolveSchema=uB.getCompilingSchema=uB.resolveRef=uB.compileSchema=uB.SchemaEnv=void 0;var H6=A0(),e_=s9(),Q4=Q6(),V6=r9(),fB=O0(),$x=p4();class t9{constructor($){var Z;this.refs={},this.dynamicAnchors={};let X;if(typeof $.schema=="object")X=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(Z=$.baseId)!==null&&Z!==void 0?Z:(0,V6.normalizeId)(X===null||X===void 0?void 0:X[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=X===null||X===void 0?void 0:X.$async,this.refs={}}}uB.SchemaEnv=t9;function hQ($){let Z=hB.call(this,$);if(Z)return Z;let X=(0,V6.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:J}=this.opts.code,{ownProperties:G}=this.opts,W=new H6.CodeGen(this.scope,{es5:Q,lines:J,ownProperties:G}),Y;if($.$async)Y=W.scopeValue("Error",{ref:e_.default,code:H6._`require("ajv/dist/runtime/validation_error").default`});let z=W.scopeName("validate");$.validateName=z;let q={gen:W,allErrors:this.opts.allErrors,data:Q4.default.data,parentData:Q4.default.parentData,parentDataProperty:Q4.default.parentDataProperty,dataNames:[Q4.default.data],dataPathArr:[H6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,H6.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Y,schema:$.schema,schemaEnv:$,rootId:X,baseId:$.baseId||X,schemaPath:H6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:H6._`""`,opts:this.opts,self:this},H;try{this._compilations.add($),(0,$x.validateFunctionCode)(q),W.optimize(this.opts.code.optimize);let B=W.toString();if(H=`${W.scopeRefs(Q4.default.scope)}return ${B}`,this.opts.code.process)H=this.opts.code.process(H,$);let M=Function(`${Q4.default.self}`,`${Q4.default.scope}`,H)(this,this.scope.get());if(this.scope.value(z,{ref:M}),M.errors=null,M.schema=$.schema,M.schemaEnv=$,$.$async)M.$async=!0;if(this.opts.code.source===!0)M.source={validateName:z,validateCode:B,scopeValues:W._values};if(this.opts.unevaluated){let{props:A,items:w}=q;if(M.evaluated={props:A instanceof H6.Name?void 0:A,items:w instanceof H6.Name?void 0:w,dynamicProps:A instanceof H6.Name,dynamicItems:w instanceof H6.Name},M.source)M.source.evaluated=(0,H6.stringify)(M.evaluated)}return $.validate=M,$}catch(B){if(delete $.validate,delete $.validateName,H)this.logger.error("Error compiling schema, function code:",H);throw B}finally{this._compilations.delete($)}}uB.compileSchema=hQ;function Zx($,Z,X){var Q;X=(0,V6.resolveUrl)(this.opts.uriResolver,Z,X);let J=$.refs[X];if(J)return J;let G=Jx.call(this,$,X);if(G===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[X],{schemaId:Y}=this.opts;if(W)G=new t9({schema:W,schemaId:Y,root:$,baseId:Z})}if(G===void 0)return;return $.refs[X]=Xx.call(this,G)}uB.resolveRef=Zx;function Xx($){if((0,V6.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:hQ.call(this,$)}function hB($){for(let Z of this._compilations)if(Qx(Z,$))return Z}uB.getCompilingSchema=hB;function Qx($,Z){return $.schema===Z.schema&&$.root===Z.root&&$.baseId===Z.baseId}function Jx($,Z){let X;while(typeof(X=this.refs[Z])=="string")Z=X;return X||this.schemas[Z]||o8.call(this,$,Z)}function o8($,Z){let X=this.opts.uriResolver.parse(Z),Q=(0,V6._getFullPath)(this.opts.uriResolver,X),J=(0,V6.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===J)return fQ.call(this,X,$);let G=(0,V6.normalizeId)(Q),W=this.refs[G]||this.schemas[G];if(typeof W=="string"){let Y=o8.call(this,$,W);if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;return fQ.call(this,X,Y)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)hQ.call(this,W);if(G===(0,V6.normalizeId)(Z)){let{schema:Y}=W,{schemaId:z}=this.opts,q=Y[z];if(q)J=(0,V6.resolveUrl)(this.opts.uriResolver,J,q);return new t9({schema:Y,schemaId:z,root:$,baseId:J})}return fQ.call(this,X,W)}uB.resolveSchema=o8;var Gx=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function fQ($,{baseId:Z,schema:X,root:Q}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Y of $.fragment.slice(1).split("/")){if(typeof X==="boolean")return;let z=X[(0,fB.unescapeFragment)(Y)];if(z===void 0)return;X=z;let q=typeof X==="object"&&X[this.opts.schemaId];if(!Gx.has(Y)&&q)Z=(0,V6.resolveUrl)(this.opts.uriResolver,Z,q)}let G;if(typeof X!="boolean"&&X.$ref&&!(0,fB.schemaHasRulesButRef)(X,this.RULES)){let Y=(0,V6.resolveUrl)(this.opts.uriResolver,Z,X.$ref);G=o8.call(this,Q,Y)}let{schemaId:W}=this.opts;if(G=G||new t9({schema:X,schemaId:W,root:Q,baseId:Z}),G.schema!==G.root.schema)return G;return}});var dB=b((Ri,Ux)=>{Ux.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var dQ=b((Pi,rB)=>{var Kx=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),cB=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),uQ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),pB=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Hx=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function mQ($){let Z="",X=0,Q=0;for(Q=0;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),X===48)continue;if(!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q];break}for(Q+=1;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q]}return Z}var Vx=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lB($){return $.length=0,!0}function Bx($,Z,X){if($.length){let Q=mQ($);if(Q!=="")Z.push(Q);else return X.error=!0,!1;$.length=0}return!0}function Fx($){let Z=0,X={error:!1,address:"",zone:""},Q=[],J=[],G=!1,W=!1,Y=Bx;for(let z=0;z<$.length;z++){let q=$[z];if(q==="["||q==="]")continue;if(q===":"){if(G===!0)W=!0;if(!Y(J,Q,X))break;if(++Z>7){X.error=!0;break}if(z>0&&$[z-1]===":")G=!0;Q.push(":");continue}else if(q==="%"){if(!Y(J,Q,X))break;Y=lB}else{J.push(q);continue}}if(J.length)if(Y===lB)X.zone=J.join("");else if(W)Q.push(J.join(""));else Q.push(mQ(J));return X.address=Q.join(""),X}function iB($){if(Lx($,":")<2)return{host:$,isIPV6:!1};let Z=Fx($);if(!Z.error){let{address:X,address:Q}=Z;if(Z.zone)X+="%"+Z.zone,Q+="%25"+Z.zone;return{host:X,isIPV6:!0,escapedHost:Q}}else return{host:$,isIPV6:!1}}function Lx($,Z){let X=0;for(let Q=0;Q<$.length;Q++)if($[Q]===Z)X++;return X}function Mx($){let Z=$,X=[],Q=-1,J=0;while(J=Z.length){if(J===1)if(Z===".")break;else if(Z==="/"){X.push("/");break}else{X.push(Z);break}else if(J===2){if(Z[0]==="."){if(Z[1]===".")break;else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."||Z[1]==="/"){X.push("/");break}}}else if(J===3){if(Z==="/.."){if(X.length!==0)X.pop();X.push("/");break}}if(Z[0]==="."){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(3);continue}}else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(2);continue}else if(Z[2]==="."){if(Z[3]==="/"){if(Z=Z.slice(3),X.length!==0)X.pop();continue}}}}if((Q=Z.indexOf("/",1))===-1){X.push(Z);break}else X.push(Z.slice(0,Q)),Z=Z.slice(Q)}return X.join("")}var Ax={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Ix=/[@/?#:]/g,Nx=/[@/?#]/g;function nB($,Z){let X=Z?Nx:Ix;return X.lastIndex=0,$.replace(X,(Q)=>Ax[Q])}function Dx($,Z=!1){if($.indexOf("%")===-1)return $;let X="";for(let Q=0;Q<$.length;Q++){if($[Q]==="%"&&Q+2<$.length){let J=$.slice(Q+1,Q+3);if(uQ(J)){let G=J.toUpperCase(),W=String.fromCharCode(parseInt(G,16));if(Z&&pB(W))X+=W;else X+="%"+G;Q+=2;continue}}X+=$[Q]}return X}function wx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(uQ(Q)){let J=Q.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&pB(G))Z+=G;else Z+="%"+J;X+=2;continue}}if(Hx($[X]))Z+=$[X];else Z+=escape($[X])}return Z}function Tx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(uQ(Q)){Z+="%"+Q.toUpperCase(),X+=2;continue}}Z+=escape($[X])}return Z}function jx($){let Z=[];if($.userinfo!==void 0)Z.push($.userinfo),Z.push("@");if($.host!==void 0){let X=unescape($.host);if(!cB(X)){let Q=iB(X);if(Q.isIPV6===!0)X=`[${Q.escapedHost}]`;else X=nB(X,!1)}Z.push(X)}if(typeof $.port==="number"||typeof $.port==="string")Z.push(":"),Z.push(String($.port));return Z.length?Z.join(""):void 0}rB.exports={nonSimpleDomain:Vx,recomposeAuthority:jx,reescapeHostDelimiters:nB,normalizePercentEncoding:Dx,normalizePathEncoding:wx,escapePreservingEscapes:Tx,removeDotSegments:Mx,isIPv4:cB,isUUID:Kx,normalizeIPv6:iB,stringArrayToHexStripped:mQ}});var eB=b((Ci,tB)=>{var{isUUID:Ox}=dQ(),Ex=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Rx=["http","https","ws","wss","urn","urn:uuid"];function Px($){return Rx.indexOf($)!==-1}function lQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function aB($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function oB($){let Z=String($.scheme).toLowerCase()==="https";if($.port===(Z?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function Cx($){return $.secure=lQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function Sx($){if($.port===(lQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[Z,X]=$.resourceName.split("?");$.path=Z&&Z!=="/"?Z:void 0,$.query=X,$.resourceName=void 0}return $.fragment=void 0,$}function _x($,Z){if(!$.path)return $.error="URN can not be parsed",$;let X=$.path.match(Ex);if(X){let Q=Z.scheme||$.scheme||"urn";$.nid=X[1].toLowerCase(),$.nss=X[2];let J=`${Q}:${Z.nid||$.nid}`,G=cQ(J);if($.path=void 0,G)$=G.parse($,Z)}else $.error=$.error||"URN can not be parsed.";return $}function xx($,Z){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let X=Z.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),J=`${X}:${Z.nid||Q}`,G=cQ(J);if(G)$=G.serialize($,Z);let W=$,Y=$.nss;return W.path=`${Q||Z.nid}:${Y}`,Z.skipEscape=!0,W}function bx($,Z){let X=$;if(X.uuid=X.nss,X.nss=void 0,!Z.tolerant&&(!X.uuid||!Ox(X.uuid)))X.error=X.error||"UUID is not valid.";return X}function kx($){let Z=$;return Z.nss=($.uuid||"").toLowerCase(),Z}var sB={scheme:"http",domainHost:!0,parse:aB,serialize:oB},yx={scheme:"https",domainHost:sB.domainHost,parse:aB,serialize:oB},s8={scheme:"ws",domainHost:!0,parse:Cx,serialize:Sx},vx={scheme:"wss",domainHost:s8.domainHost,parse:s8.parse,serialize:s8.serialize},gx={scheme:"urn",parse:_x,serialize:xx,skipNormalize:!0},fx={scheme:"urn:uuid",parse:bx,serialize:kx,skipNormalize:!0},t8={http:sB,https:yx,ws:s8,wss:vx,urn:gx,"urn:uuid":fx};Object.setPrototypeOf(t8,null);function cQ($){return $&&(t8[$]||t8[$.toLowerCase()])||void 0}tB.exports={wsIsSecure:lQ,SCHEMES:t8,isValidSchemeName:Px,getSchemeHandler:cQ}});var GF=b((Si,e8)=>{var{normalizeIPv6:hx,removeDotSegments:$5,recomposeAuthority:ux,normalizePercentEncoding:mx,normalizePathEncoding:dx,escapePreservingEscapes:lx,reescapeHostDelimiters:cx,isIPv4:px,nonSimpleDomain:ix}=dQ(),{SCHEMES:nx,getSchemeHandler:ZF}=eB();function rx($,Z){if(typeof $==="string")$=ex($,Z);else if(typeof $==="object")$=n4(J4($,Z),Z);return $}function ax($,Z,X){let Q=X?Object.assign({scheme:"null"},X):{scheme:"null"},J=XF(n4($,Q),n4(Z,Q),Q,!0);return Q.skipEscape=!0,J4(J,Q)}function XF($,Z,X,Q){let J={};if(!Q)$=n4(J4($,X),X),Z=n4(J4(Z,X),X);if(X=X||{},!X.tolerant&&Z.scheme)J.scheme=Z.scheme,J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=$5(Z.path||""),J.query=Z.query;else{if(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=$5(Z.path||""),J.query=Z.query;else{if(!Z.path)if(J.path=$.path,Z.query!==void 0)J.query=Z.query;else J.query=$.query;else{if(Z.path[0]==="/")J.path=$5(Z.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+Z.path;else if(!$.path)J.path=Z.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+Z.path;J.path=$5(J.path)}J.query=Z.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=Z.fragment,J}function ox($,Z,X){let Q=$F($,X),J=$F(Z,X);return Q!==void 0&&J!==void 0&&Q.toLowerCase()===J.toLowerCase()}function J4($,Z){let X={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},Z),J=[],G=ZF(Q.scheme||X.scheme);if(G&&G.serialize)G.serialize(X,Q);if(X.path!==void 0)if(!Q.skipEscape){if(X.path=lx(X.path),X.scheme!==void 0)X.path=X.path.split("%3A").join(":")}else X.path=mx(X.path);if(Q.reference!=="suffix"&&X.scheme)J.push(X.scheme,":");let W=ux(X);if(W!==void 0){if(Q.reference!=="suffix")J.push("//");if(J.push(W),X.path&&X.path[0]!=="/")J.push("/")}if(X.path!==void 0){let Y=X.path;if(!Q.absolutePath&&(!G||!G.absolutePath))Y=$5(Y);if(W===void 0&&Y[0]==="/"&&Y[1]==="/")Y="/%2F"+Y.slice(2);J.push(Y)}if(X.query!==void 0)J.push("?",X.query);if(X.fragment!==void 0)J.push("#",X.fragment);return J.join("")}var sx=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function tx($,Z){if(Z[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function QF($,Z){let X=Object.assign({},Z),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(X.reference==="suffix")if(X.scheme)$=X.scheme+":"+$;else $="//"+$;let W=$.match(sx);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];let Y=tx(Q,W);if(Y!==void 0)Q.error=Q.error||Y,J=!0;if(Q.host)if(px(Q.host)===!1){let H=hx(Q.host);Q.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(X.reference&&X.reference!=="suffix"&&X.reference!==Q.reference)Q.error=Q.error||"URI is not a "+X.reference+" reference.";let z=ZF(X.scheme||Q.scheme);if(!X.unicodeSupport&&(!z||!z.unicodeSupport)){if(Q.host&&(X.domainHost||z&&z.domainHost)&&G===!1&&ix(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(q){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+q}}if(!z||z&&!z.skipNormalize){if($.indexOf("%")!==-1){if(Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(Q.host!==void 0)Q.host=cx(unescape(Q.host),G)}if(Q.path)Q.path=dx(Q.path);if(Q.fragment)try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}}if(z&&z.parse)z.parse(Q,X)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:J}}function n4($,Z){return QF($,Z).parsed}function ex($,Z){return JF($,Z).normalized}function JF($,Z){let{parsed:X,malformedAuthorityOrPort:Q}=QF($,Z);return{normalized:Q?$:J4(X,Z),malformedAuthorityOrPort:Q}}function $F($,Z){if(typeof $==="string"){let{normalized:X,malformedAuthorityOrPort:Q}=JF($,Z);return Q?void 0:X}if(typeof $==="object")return J4($,Z)}var pQ={SCHEMES:nx,normalize:rx,resolve:ax,resolveComponent:XF,equal:ox,serialize:J4,parse:n4};e8.exports=pQ;e8.exports.default=pQ;e8.exports.fastUri=pQ});var zF=b((YF)=>{Object.defineProperty(YF,"__esModule",{value:!0});var WF=GF();WF.code='require("ajv/dist/runtime/uri").default';YF.default=WF});var rQ=b((G1)=>{Object.defineProperty(G1,"__esModule",{value:!0});G1.CodeGen=G1.Name=G1.nil=G1.stringify=G1.str=G1._=G1.KeywordCxt=void 0;var Zb=p4();Object.defineProperty(G1,"KeywordCxt",{enumerable:!0,get:function(){return Zb.KeywordCxt}});var r4=A0();Object.defineProperty(G1,"_",{enumerable:!0,get:function(){return r4._}});Object.defineProperty(G1,"str",{enumerable:!0,get:function(){return r4.str}});Object.defineProperty(G1,"stringify",{enumerable:!0,get:function(){return r4.stringify}});Object.defineProperty(G1,"nil",{enumerable:!0,get:function(){return r4.nil}});Object.defineProperty(G1,"Name",{enumerable:!0,get:function(){return r4.Name}});Object.defineProperty(G1,"CodeGen",{enumerable:!0,get:function(){return r4.CodeGen}});var Xb=s9(),VF=i4(),Qb=TQ(),Z5=e9(),Jb=A0(),X5=r9(),$Z=n9(),nQ=O0(),qF=dB(),Gb=zF(),BF=($,Z)=>new RegExp($,Z);BF.code="new RegExp";var Wb=["removeAdditional","useDefaults","coerceTypes"],Yb=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),zb={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},qb={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},UF=200;function Ub($){var Z,X,Q,J,G,W,Y,z,q,H,B,L,M,A,w,D,j,E,P,R,C,v,d,f,a;let $0=$.strict,u=(Z=$.code)===null||Z===void 0?void 0:Z.optimize,e=u===!0||u===void 0?1:u||0,Y0=(Q=(X=$.code)===null||X===void 0?void 0:X.regExp)!==null&&Q!==void 0?Q:BF,J0=(J=$.uriResolver)!==null&&J!==void 0?J:Gb.default;return{strictSchema:(W=(G=$.strictSchema)!==null&&G!==void 0?G:$0)!==null&&W!==void 0?W:!0,strictNumbers:(z=(Y=$.strictNumbers)!==null&&Y!==void 0?Y:$0)!==null&&z!==void 0?z:!0,strictTypes:(H=(q=$.strictTypes)!==null&&q!==void 0?q:$0)!==null&&H!==void 0?H:"log",strictTuples:(L=(B=$.strictTuples)!==null&&B!==void 0?B:$0)!==null&&L!==void 0?L:"log",strictRequired:(A=(M=$.strictRequired)!==null&&M!==void 0?M:$0)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:e,regExp:Y0}:{optimize:e,regExp:Y0},loopRequired:(w=$.loopRequired)!==null&&w!==void 0?w:UF,loopEnum:(D=$.loopEnum)!==null&&D!==void 0?D:UF,meta:(j=$.meta)!==null&&j!==void 0?j:!0,messages:(E=$.messages)!==null&&E!==void 0?E:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(R=$.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=$.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(v=$.validateSchema)!==null&&v!==void 0?v:!0,validateFormats:(d=$.validateFormats)!==null&&d!==void 0?d:!0,unicodeRegExp:(f=$.unicodeRegExp)!==null&&f!==void 0?f:!0,int32range:(a=$.int32range)!==null&&a!==void 0?a:!0,uriResolver:J0}}class ZZ{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Ub($)};let{es5:Z,lines:X}=this.opts.code;this.scope=new Jb.ValueScope({scope:{},prefixes:Yb,es5:Z,lines:X}),this.logger=Lb($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,Qb.getRules)(),KF.call(this,zb,$,"NOT SUPPORTED"),KF.call(this,qb,$,"DEPRECATED","warn"),this._metaOpts=Bb.call(this),$.formats)Hb.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Vb.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Kb.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:Z,schemaId:X}=this.opts,Q=qF;if(X==="id")Q={...qF},Q.id=Q.$id,delete Q.$id;if(Z&&$)this.addMetaSchema(Q,Q[X],!1)}defaultMeta(){let{meta:$,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[Z]||$:void 0}validate($,Z){let X;if(typeof $=="string"){if(X=this.getSchema($),!X)throw Error(`no schema with key or ref "${$}"`)}else X=this.compile($);let Q=X(Z);if(!("$async"in X))this.errors=X.errors;return Q}compile($,Z){let X=this._addSchema($,Z);return X.validate||this._compileSchemaEnv(X)}compileAsync($,Z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:X}=this.opts;return Q.call(this,$,Z);async function Q(q,H){await J.call(this,q.$schema);let B=this._addSchema(q,H);return B.validate||G.call(this,B)}async function J(q){if(q&&!this.getSchema(q))await Q.call(this,{$ref:q},!0)}async function G(q){try{return this._compileSchemaEnv(q)}catch(H){if(!(H instanceof VF.default))throw H;return W.call(this,H),await Y.call(this,H.missingSchema),G.call(this,q)}}function W({missingSchema:q,missingRef:H}){if(this.refs[q])throw Error(`AnySchema ${q} is loaded but ${H} cannot be resolved`)}async function Y(q){let H=await z.call(this,q);if(!this.refs[q])await J.call(this,H.$schema);if(!this.refs[q])this.addSchema(H,q,Z)}async function z(q){let H=this._loading[q];if(H)return H;try{return await(this._loading[q]=X(q))}finally{delete this._loading[q]}}}addSchema($,Z,X,Q=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,X,Q);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return Z=(0,X5.normalizeId)(Z||J),this._checkUnique(Z),this.schemas[Z]=this._addSchema($,X,Z,Q,!0),this}addMetaSchema($,Z,X=this.opts.validateSchema){return this.addSchema($,Z,!0,X),this}validateSchema($,Z){if(typeof $=="boolean")return!0;let X;if(X=$.$schema,X!==void 0&&typeof X!="string")throw Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(X,$);if(!Q&&Z){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Q}getSchema($){let Z;while(typeof(Z=HF.call(this,$))=="string")$=Z;if(Z===void 0){let{schemaId:X}=this.opts,Q=new Z5.SchemaEnv({schema:{},schemaId:X});if(Z=Z5.resolveSchema.call(this,Q,$),!Z)return;this.refs[$]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Z=HF.call(this,$);if(typeof Z=="object")this._cache.delete(Z.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let Z=$;this._cache.delete(Z);let X=$[this.opts.schemaId];if(X)X=(0,X5.normalizeId)(X),delete this.schemas[X],delete this.refs[X];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let Z of $)this.addKeyword(Z);return this}addKeyword($,Z){let X;if(typeof $=="string"){if(X=$,typeof Z=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=X}else if(typeof $=="object"&&Z===void 0){if(Z=$,X=Z.keyword,Array.isArray(X)&&!X.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Ab.call(this,X,Z),!Z)return(0,nQ.eachItem)(X,(J)=>iQ.call(this,J)),this;Nb.call(this,Z);let Q={...Z,type:(0,$Z.getJSONTypes)(Z.type),schemaType:(0,$Z.getJSONTypes)(Z.schemaType)};return(0,nQ.eachItem)(X,Q.type.length===0?(J)=>iQ.call(this,J,Q):(J)=>Q.type.forEach((G)=>iQ.call(this,J,Q,G))),this}getKeyword($){let Z=this.RULES.all[$];return typeof Z=="object"?Z.definition:!!Z}removeKeyword($){let{RULES:Z}=this;delete Z.keywords[$],delete Z.all[$];for(let X of Z.rules){let Q=X.rules.findIndex((J)=>J.keyword===$);if(Q>=0)X.rules.splice(Q,1)}return this}addFormat($,Z){if(typeof Z=="string")Z=new RegExp(Z);return this.formats[$]=Z,this}errorsText($=this.errors,{separator:Z=", ",dataVar:X="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${X}${Q.instancePath} ${Q.message}`).reduce((Q,J)=>Q+Z+J)}$dataMetaSchema($,Z){let X=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of Z){let J=Q.split("/").slice(1),G=$;for(let W of J)G=G[W];for(let W in X){let Y=X[W];if(typeof Y!="object")continue;let{$data:z}=Y.definition,q=G[W];if(z&&q)G[W]=FF(q)}}return $}_removeAllSchemas($,Z){for(let X in $){let Q=$[X];if(!Z||Z.test(X)){if(typeof Q=="string")delete $[X];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[X]}}}_addSchema($,Z,X,Q=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:W}=this.opts;if(typeof $=="object")G=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Y=this._cache.get($);if(Y!==void 0)return Y;X=(0,X5.normalizeId)(G||X);let z=X5.getSchemaRefs.call(this,$,X);if(Y=new Z5.SchemaEnv({schema:$,schemaId:W,meta:Z,baseId:X,localRefs:z}),this._cache.set(Y.schema,Y),J&&!X.startsWith("#")){if(X)this._checkUnique(X);this.refs[X]=Y}if(Q)this.validateSchema($,!0);return Y}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else Z5.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let Z=this.opts;this.opts=this._metaOpts;try{Z5.compileSchema.call(this,$)}finally{this.opts=Z}}}ZZ.ValidationError=Xb.default;ZZ.MissingRefError=VF.default;G1.default=ZZ;function KF($,Z,X,Q="error"){for(let J in $){let G=J;if(G in Z)this.logger[Q](`${X}: option ${J}. ${$[G]}`)}}function HF($){return $=(0,X5.normalizeId)($),this.schemas[$]||this.refs[$]}function Kb(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let Z in $)this.addSchema($[Z],Z)}function Hb(){for(let $ in this.opts.formats){let Z=this.opts.formats[$];if(Z)this.addFormat($,Z)}}function Vb($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Z in $){let X=$[Z];if(!X.keyword)X.keyword=Z;this.addKeyword(X)}}function Bb(){let $={...this.opts};for(let Z of Wb)delete $[Z];return $}var Fb={log(){},warn(){},error(){}};function Lb($){if($===!1)return Fb;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var Mb=/^[a-z_$][a-z0-9_$:-]*$/i;function Ab($,Z){let{RULES:X}=this;if((0,nQ.eachItem)($,(Q)=>{if(X.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!Mb.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!Z)return;if(Z.$data&&!(("code"in Z)||("validate"in Z)))throw Error('$data keyword must have "code" or "validate" function')}function iQ($,Z,X){var Q;let J=Z===null||Z===void 0?void 0:Z.post;if(X&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,W=J?G.post:G.rules.find(({type:z})=>z===X);if(!W)W={type:X,rules:[]},G.rules.push(W);if(G.keywords[$]=!0,!Z)return;let Y={keyword:$,definition:{...Z,type:(0,$Z.getJSONTypes)(Z.type),schemaType:(0,$Z.getJSONTypes)(Z.schemaType)}};if(Z.before)Ib.call(this,W,Y,Z.before);else W.rules.push(Y);G.all[$]=Y,(Q=Z.implements)===null||Q===void 0||Q.forEach((z)=>this.addKeyword(z))}function Ib($,Z,X){let Q=$.rules.findIndex((J)=>J.keyword===X);if(Q>=0)$.rules.splice(Q,0,Z);else $.rules.push(Z),this.logger.warn(`rule ${X} is not defined`)}function Nb($){let{metaSchema:Z}=$;if(Z===void 0)return;if($.$data&&this.opts.$data)Z=FF(Z);$.validateSchema=this.compile(Z,!0)}var Db={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function FF($){return{anyOf:[$,Db]}}});var MF=b((LF)=>{Object.defineProperty(LF,"__esModule",{value:!0});var jb={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};LF.default=jb});var JZ=b((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.callRef=DF.getValidate=void 0;var Eb=i4(),AF=J6(),k$=A0(),a4=Q6(),IF=e9(),XZ=O0(),Rb={keyword:"$ref",schemaType:"string",code($){let{gen:Z,schema:X,it:Q}=$,{baseId:J,schemaEnv:G,validateName:W,opts:Y,self:z}=Q,{root:q}=G;if((X==="#"||X==="#/")&&J===q.baseId)return B();let H=IF.resolveRef.call(z,q,J,X);if(H===void 0)throw new Eb.default(Q.opts.uriResolver,J,X);if(H instanceof IF.SchemaEnv)return L(H);return M(H);function B(){if(G===q)return QZ($,W,G,G.$async);let A=Z.scopeValue("root",{ref:q});return QZ($,k$._`${A}.validate`,q,q.$async)}function L(A){let w=NF($,A);QZ($,w,A,A.$async)}function M(A){let w=Z.scopeValue("schema",Y.code.source===!0?{ref:A,code:(0,k$.stringify)(A)}:{ref:A}),D=Z.name("valid"),j=$.subschema({schema:A,dataTypes:[],schemaPath:k$.nil,topSchemaRef:w,errSchemaPath:X},D);$.mergeEvaluated(j),$.ok(D)}}};function NF($,Z){let{gen:X}=$;return Z.validate?X.scopeValue("validate",{ref:Z.validate}):k$._`${X.scopeValue("wrapper",{ref:Z})}.validate`}DF.getValidate=NF;function QZ($,Z,X,Q){let{gen:J,it:G}=$,{allErrors:W,schemaEnv:Y,opts:z}=G,q=z.passContext?a4.default.this:k$.nil;if(Q)H();else B();function H(){if(!Y.$async)throw Error("async schema referenced by sync schema");let A=J.let("valid");J.try(()=>{if(J.code(k$._`await ${(0,AF.callValidateCode)($,Z,q)}`),M(Z),!W)J.assign(A,!0)},(w)=>{if(J.if(k$._`!(${w} instanceof ${G.ValidationError})`,()=>J.throw(w)),L(w),!W)J.assign(A,!1)}),$.ok(A)}function B(){$.result((0,AF.callValidateCode)($,Z,q),()=>M(Z),()=>L(Z))}function L(A){let w=k$._`${A}.errors`;J.assign(a4.default.vErrors,k$._`${a4.default.vErrors} === null ? ${w} : ${a4.default.vErrors}.concat(${w})`),J.assign(a4.default.errors,k$._`${a4.default.vErrors}.length`)}function M(A){var w;if(!G.opts.unevaluated)return;let D=(w=X===null||X===void 0?void 0:X.validate)===null||w===void 0?void 0:w.evaluated;if(G.props!==!0)if(D&&!D.dynamicProps){if(D.props!==void 0)G.props=XZ.mergeEvaluated.props(J,D.props,G.props)}else{let j=J.var("props",k$._`${A}.evaluated.props`);G.props=XZ.mergeEvaluated.props(J,j,G.props,k$.Name)}if(G.items!==!0)if(D&&!D.dynamicItems){if(D.items!==void 0)G.items=XZ.mergeEvaluated.items(J,D.items,G.items)}else{let j=J.var("items",k$._`${A}.evaluated.items`);G.items=XZ.mergeEvaluated.items(J,j,G.items,k$.Name)}}}DF.callRef=QZ;DF.default=Rb});var aQ=b((TF)=>{Object.defineProperty(TF,"__esModule",{value:!0});var Sb=MF(),_b=JZ(),xb=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Sb.default,_b.default];TF.default=xb});var OF=b((jF)=>{Object.defineProperty(jF,"__esModule",{value:!0});var GZ=A0(),b1=GZ.operators,WZ={maximum:{okStr:"<=",ok:b1.LTE,fail:b1.GT},minimum:{okStr:">=",ok:b1.GTE,fail:b1.LT},exclusiveMaximum:{okStr:"<",ok:b1.LT,fail:b1.GTE},exclusiveMinimum:{okStr:">",ok:b1.GT,fail:b1.LTE}},kb={message:({keyword:$,schemaCode:Z})=>GZ.str`must be ${WZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>GZ._`{comparison: ${WZ[$].okStr}, limit: ${Z}}`},yb={keyword:Object.keys(WZ),type:"number",schemaType:"number",$data:!0,error:kb,code($){let{keyword:Z,data:X,schemaCode:Q}=$;$.fail$data(GZ._`${X} ${WZ[Z].fail} ${Q} || isNaN(${X})`)}};jF.default=yb});var RF=b((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});var Q5=A0(),gb={message:({schemaCode:$})=>Q5.str`must be multiple of ${$}`,params:({schemaCode:$})=>Q5._`{multipleOf: ${$}}`},fb={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gb,code($){let{gen:Z,data:X,schemaCode:Q,it:J}=$,G=J.opts.multipleOfPrecision,W=Z.let("res"),Y=G?Q5._`Math.abs(Math.round(${W}) - ${W}) > 1e-${G}`:Q5._`${W} !== parseInt(${W})`;$.fail$data(Q5._`(${Q} === 0 || (${W} = ${X}/${Q}, ${Y}))`)}};EF.default=fb});var SF=b((CF)=>{Object.defineProperty(CF,"__esModule",{value:!0});function PF($){let Z=$.length,X=0,Q=0,J;while(Q<Z)if(X++,J=$.charCodeAt(Q++),J>=55296&&J<=56319&&Q<Z){if(J=$.charCodeAt(Q),(J&64512)===56320)Q++}return X}CF.default=PF;PF.code='require("ajv/dist/runtime/ucs2length").default'});var xF=b((_F)=>{Object.defineProperty(_F,"__esModule",{value:!0});var G4=A0(),mb=O0(),db=SF(),lb={message({keyword:$,schemaCode:Z}){let X=$==="maxLength"?"more":"fewer";return G4.str`must NOT have ${X} than ${Z} characters`},params:({schemaCode:$})=>G4._`{limit: ${$}}`},cb={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:lb,code($){let{keyword:Z,data:X,schemaCode:Q,it:J}=$,G=Z==="maxLength"?G4.operators.GT:G4.operators.LT,W=J.opts.unicode===!1?G4._`${X}.length`:G4._`${(0,mb.useFunc)($.gen,db.default)}(${X})`;$.fail$data(G4._`${W} ${G} ${Q}`)}};_F.default=cb});var kF=b((bF)=>{Object.defineProperty(bF,"__esModule",{value:!0});var ib=J6(),nb=O0(),o4=A0(),rb={message:({schemaCode:$})=>o4.str`must match pattern "${$}"`,params:({schemaCode:$})=>o4._`{pattern: ${$}}`},ab={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:rb,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$,Y=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:z}=W.opts.code,q=z.code==="new RegExp"?o4._`new RegExp`:(0,nb.useFunc)(Z,z),H=Z.let("valid");Z.try(()=>Z.assign(H,o4._`${q}(${G}, ${Y}).test(${X})`),()=>Z.assign(H,!1)),$.fail$data(o4._`!${H}`)}else{let z=(0,ib.usePattern)($,J);$.fail$data(o4._`!${z}.test(${X})`)}}};bF.default=ab});var vF=b((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});var J5=A0(),sb={message({keyword:$,schemaCode:Z}){let X=$==="maxProperties"?"more":"fewer";return J5.str`must NOT have ${X} than ${Z} properties`},params:({schemaCode:$})=>J5._`{limit: ${$}}`},tb={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:sb,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxProperties"?J5.operators.GT:J5.operators.LT;$.fail$data(J5._`Object.keys(${X}).length ${J} ${Q}`)}};yF.default=tb});var fF=b((gF)=>{Object.defineProperty(gF,"__esModule",{value:!0});var G5=J6(),W5=A0(),$k=O0(),Zk={message:({params:{missingProperty:$}})=>W5.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>W5._`{missingProperty: ${$}}`},Xk={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Zk,code($){let{gen:Z,schema:X,schemaCode:Q,data:J,$data:G,it:W}=$,{opts:Y}=W;if(!G&&X.length===0)return;let z=X.length>=Y.loopRequired;if(W.allErrors)q();else H();if(Y.strictRequired){let M=$.parentSchema.properties,{definedProperties:A}=$.it;for(let w of X)if((M===null||M===void 0?void 0:M[w])===void 0&&!A.has(w)){let D=W.schemaEnv.baseId+W.errSchemaPath,j=`required property "${w}" is not defined at "${D}" (strictRequired)`;(0,$k.checkStrictMode)(W,j,W.opts.strictRequired)}}function q(){if(z||G)$.block$data(W5.nil,B);else for(let M of X)(0,G5.checkReportMissingProp)($,M)}function H(){let M=Z.let("missing");if(z||G){let A=Z.let("valid",!0);$.block$data(A,()=>L(M,A)),$.ok(A)}else Z.if((0,G5.checkMissingProp)($,X,M)),(0,G5.reportMissingProp)($,M),Z.else()}function B(){Z.forOf("prop",Q,(M)=>{$.setParams({missingProperty:M}),Z.if((0,G5.noPropertyInData)(Z,J,M,Y.ownProperties),()=>$.error())})}function L(M,A){$.setParams({missingProperty:M}),Z.forOf(M,Q,()=>{Z.assign(A,(0,G5.propertyInData)(Z,J,M,Y.ownProperties)),Z.if((0,W5.not)(A),()=>{$.error(),Z.break()})},W5.nil)}}};gF.default=Xk});var uF=b((hF)=>{Object.defineProperty(hF,"__esModule",{value:!0});var Y5=A0(),Jk={message({keyword:$,schemaCode:Z}){let X=$==="maxItems"?"more":"fewer";return Y5.str`must NOT have ${X} than ${Z} items`},params:({schemaCode:$})=>Y5._`{limit: ${$}}`},Gk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Jk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxItems"?Y5.operators.GT:Y5.operators.LT;$.fail$data(Y5._`${X}.length ${J} ${Q}`)}};hF.default=Gk});var YZ=b((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});var mF=_Q();mF.code='require("ajv/dist/runtime/equal").default';dF.default=mF});var cF=b((lF)=>{Object.defineProperty(lF,"__esModule",{value:!0});var oQ=n9(),z$=A0(),zk=O0(),qk=YZ(),Uk={message:({params:{i:$,j:Z}})=>z$.str`must NOT have duplicate items (items ## ${Z} and ${$} are identical)`,params:({params:{i:$,j:Z}})=>z$._`{i: ${$}, j: ${Z}}`},Kk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Uk,code($){let{gen:Z,data:X,$data:Q,schema:J,parentSchema:G,schemaCode:W,it:Y}=$;if(!Q&&!J)return;let z=Z.let("valid"),q=G.items?(0,oQ.getSchemaTypes)(G.items):[];$.block$data(z,H,z$._`${W} === false`),$.ok(z);function H(){let A=Z.let("i",z$._`${X}.length`),w=Z.let("j");$.setParams({i:A,j:w}),Z.assign(z,!0),Z.if(z$._`${A} > 1`,()=>(B()?L:M)(A,w))}function B(){return q.length>0&&!q.some((A)=>A==="object"||A==="array")}function L(A,w){let D=Z.name("item"),j=(0,oQ.checkDataTypes)(q,D,Y.opts.strictNumbers,oQ.DataType.Wrong),E=Z.const("indices",z$._`{}`);Z.for(z$._`;${A}--;`,()=>{if(Z.let(D,z$._`${X}[${A}]`),Z.if(j,z$._`continue`),q.length>1)Z.if(z$._`typeof ${D} == "string"`,z$._`${D} += "_"`);Z.if(z$._`typeof ${E}[${D}] == "number"`,()=>{Z.assign(w,z$._`${E}[${D}]`),$.error(),Z.assign(z,!1).break()}).code(z$._`${E}[${D}] = ${A}`)})}function M(A,w){let D=(0,zk.useFunc)(Z,qk.default),j=Z.name("outer");Z.label(j).for(z$._`;${A}--;`,()=>Z.for(z$._`${w} = ${A}; ${w}--;`,()=>Z.if(z$._`${D}(${X}[${A}], ${X}[${w}])`,()=>{$.error(),Z.assign(z,!1).break(j)})))}}};lF.default=Kk});var iF=b((pF)=>{Object.defineProperty(pF,"__esModule",{value:!0});var sQ=A0(),Vk=O0(),Bk=YZ(),Fk={message:"must be equal to constant",params:({schemaCode:$})=>sQ._`{allowedValue: ${$}}`},Lk={keyword:"const",$data:!0,error:Fk,code($){let{gen:Z,data:X,$data:Q,schemaCode:J,schema:G}=$;if(Q||G&&typeof G=="object")$.fail$data(sQ._`!${(0,Vk.useFunc)(Z,Bk.default)}(${X}, ${J})`);else $.fail(sQ._`${G} !== ${X}`)}};pF.default=Lk});var rF=b((nF)=>{Object.defineProperty(nF,"__esModule",{value:!0});var z5=A0(),Ak=O0(),Ik=YZ(),Nk={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>z5._`{allowedValues: ${$}}`},Dk={keyword:"enum",schemaType:"array",$data:!0,error:Nk,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$;if(!Q&&J.length===0)throw Error("enum must have non-empty array");let Y=J.length>=W.opts.loopEnum,z,q=()=>z!==null&&z!==void 0?z:z=(0,Ak.useFunc)(Z,Ik.default),H;if(Y||Q)H=Z.let("valid"),$.block$data(H,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let M=Z.const("vSchema",G);H=(0,z5.or)(...J.map((A,w)=>L(M,w)))}$.pass(H);function B(){Z.assign(H,!1),Z.forOf("v",G,(M)=>Z.if(z5._`${q()}(${X}, ${M})`,()=>Z.assign(H,!0).break()))}function L(M,A){let w=J[A];return typeof w==="object"&&w!==null?z5._`${q()}(${X}, ${M}[${A}])`:z5._`${X} === ${w}`}}};nF.default=Dk});var tQ=b((aF)=>{Object.defineProperty(aF,"__esModule",{value:!0});var Tk=OF(),jk=RF(),Ok=xF(),Ek=kF(),Rk=vF(),Pk=fF(),Ck=uF(),Sk=cF(),_k=iF(),xk=rF(),bk=[Tk.default,jk.default,Ok.default,Ek.default,Rk.default,Pk.default,Ck.default,Sk.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_k.default,xk.default];aF.default=bk});var $J=b((sF)=>{Object.defineProperty(sF,"__esModule",{value:!0});sF.validateAdditionalItems=void 0;var W4=A0(),eQ=O0(),yk={message:({params:{len:$}})=>W4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>W4._`{limit: ${$}}`},vk={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:yk,code($){let{parentSchema:Z,it:X}=$,{items:Q}=Z;if(!Array.isArray(Q)){(0,eQ.checkStrictMode)(X,'"additionalItems" is ignored when "items" is not an array of schemas');return}oF($,Q)}};function oF($,Z){let{gen:X,schema:Q,data:J,keyword:G,it:W}=$;W.items=!0;let Y=X.const("len",W4._`${J}.length`);if(Q===!1)$.setParams({len:Z.length}),$.pass(W4._`${Y} <= ${Z.length}`);else if(typeof Q=="object"&&!(0,eQ.alwaysValidSchema)(W,Q)){let q=X.var("valid",W4._`${Y} <= ${Z.length}`);X.if((0,W4.not)(q),()=>z(q)),$.ok(q)}function z(q){X.forRange("i",Z.length,Y,(H)=>{if($.subschema({keyword:G,dataProp:H,dataPropType:eQ.Type.Num},q),!W.allErrors)X.if((0,W4.not)(q),()=>X.break())})}}sF.validateAdditionalItems=oF;sF.default=vk});var ZJ=b((ZL)=>{Object.defineProperty(ZL,"__esModule",{value:!0});ZL.validateTuple=void 0;var eF=A0(),zZ=O0(),fk=J6(),hk={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:Z,it:X}=$;if(Array.isArray(Z))return $L($,"additionalItems",Z);if(X.items=!0,(0,zZ.alwaysValidSchema)(X,Z))return;$.ok((0,fk.validateArray)($))}};function $L($,Z,X=$.schema){let{gen:Q,parentSchema:J,data:G,keyword:W,it:Y}=$;if(H(J),Y.opts.unevaluated&&X.length&&Y.items!==!0)Y.items=zZ.mergeEvaluated.items(Q,X.length,Y.items);let z=Q.name("valid"),q=Q.const("len",eF._`${G}.length`);X.forEach((B,L)=>{if((0,zZ.alwaysValidSchema)(Y,B))return;Q.if(eF._`${q} > ${L}`,()=>$.subschema({keyword:W,schemaProp:L,dataProp:L},z)),$.ok(z)});function H(B){let{opts:L,errSchemaPath:M}=Y,A=X.length,w=A===B.minItems&&(A===B.maxItems||B[Z]===!1);if(L.strictTuples&&!w){let D=`"${W}" is ${A}-tuple, but minItems or maxItems/${Z} are not specified or different at path "${M}"`;(0,zZ.checkStrictMode)(Y,D,L.strictTuples)}}}ZL.validateTuple=$L;ZL.default=hk});var JL=b((QL)=>{Object.defineProperty(QL,"__esModule",{value:!0});var mk=ZJ(),dk={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,mk.validateTuple)($,"items")};QL.default=dk});var YL=b((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});var GL=A0(),ck=O0(),pk=J6(),ik=$J(),nk={message:({params:{len:$}})=>GL.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>GL._`{limit: ${$}}`},rk={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:nk,code($){let{schema:Z,parentSchema:X,it:Q}=$,{prefixItems:J}=X;if(Q.items=!0,(0,ck.alwaysValidSchema)(Q,Z))return;if(J)(0,ik.validateAdditionalItems)($,J);else $.ok((0,pk.validateArray)($))}};WL.default=rk});var qL=b((zL)=>{Object.defineProperty(zL,"__esModule",{value:!0});var G6=A0(),qZ=O0(),ok={message:({params:{min:$,max:Z}})=>Z===void 0?G6.str`must contain at least ${$} valid item(s)`:G6.str`must contain at least ${$} and no more than ${Z} valid item(s)`,params:({params:{min:$,max:Z}})=>Z===void 0?G6._`{minContains: ${$}}`:G6._`{minContains: ${$}, maxContains: ${Z}}`},sk={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ok,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$,W,Y,{minContains:z,maxContains:q}=Q;if(G.opts.next)W=z===void 0?1:z,Y=q;else W=1;let H=Z.const("len",G6._`${J}.length`);if($.setParams({min:W,max:Y}),Y===void 0&&W===0){(0,qZ.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Y!==void 0&&W>Y){(0,qZ.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,qZ.alwaysValidSchema)(G,X)){let w=G6._`${H} >= ${W}`;if(Y!==void 0)w=G6._`${w} && ${H} <= ${Y}`;$.pass(w);return}G.items=!0;let B=Z.name("valid");if(Y===void 0&&W===1)M(B,()=>Z.if(B,()=>Z.break()));else if(W===0){if(Z.let(B,!0),Y!==void 0)Z.if(G6._`${J}.length > 0`,L)}else Z.let(B,!1),L();$.result(B,()=>$.reset());function L(){let w=Z.name("_valid"),D=Z.let("count",0);M(w,()=>Z.if(w,()=>A(D)))}function M(w,D){Z.forRange("i",0,H,(j)=>{$.subschema({keyword:"contains",dataProp:j,dataPropType:qZ.Type.Num,compositeRule:!0},w),D()})}function A(w){if(Z.code(G6._`${w}++`),Y===void 0)Z.if(G6._`${w} >= ${W}`,()=>Z.assign(B,!0).break());else if(Z.if(G6._`${w} > ${Y}`,()=>Z.assign(B,!1).break()),W===1)Z.assign(B,!0);else Z.if(G6._`${w} >= ${W}`,()=>Z.assign(B,!0))}}};zL.default=sk});var UZ=b((HL)=>{Object.defineProperty(HL,"__esModule",{value:!0});HL.validateSchemaDeps=HL.validatePropertyDeps=HL.error=void 0;var XJ=A0(),ek=O0(),q5=J6();HL.error={message:({params:{property:$,depsCount:Z,deps:X}})=>{let Q=Z===1?"property":"properties";return XJ.str`must have ${Q} ${X} when property ${$} is present`},params:({params:{property:$,depsCount:Z,deps:X,missingProperty:Q}})=>XJ._`{property: ${$},
382
+ `+(" ".repeat(b0.length)+"^"),xZ=O==="Syntax"?"since":"inside",lJ=`${O} error at line ${j0}${K.name?` in ${K.name}`:""}${D&&D.name?`, ${xZ} \`${D.partial?"partial ":""}${function(u$){let h6=[u$];for(;u$&&u$.parent;){let{parent:u1}=u$;h6.unshift(u1),u$=u1}return h6.map((u1)=>function(K9,U9){let cJ=K9;return U9&&(cJ+=` ${U9}`),cJ}(u1.type,u1.name)).join(" -> ")}(D)}\``:""}:
383
+ ${q9}`;return{message:`${lJ} ${j}`,bareMessage:j,context:lJ,line:j0,sourceName:K.name,level:g,ruleName:Q0,autofix:i,input:E$,tokens:B$}}function Q(K,M,D,j){return X(K,M,D,j,"Syntax")}function J(K,M,D,j,O={}){return O.ruleName=D,X(M.source,K.index,M,j,"Validation",O)}$.r(Z),$.d(Z,{WebIDLParseError:()=>i0,parse:()=>p,validate:()=>c,write:()=>_});class G{constructor({source:K,tokens:M}){Object.defineProperties(this,{source:{value:K},tokens:{value:M,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let K={type:void 0,name:void 0,inheritance:void 0},M=this;for(;M!==Object.prototype;){let D=Object.getOwnPropertyDescriptors(M);for(let[j,O]of Object.entries(D))(O.enumerable||O.get)&&(K[j]=this[j]);M=Object.getPrototypeOf(M)}return K}}function W(K,M,{useNullableInner:D}={}){if(!K.union){let j=M.unique.get(K.idlType);if(!j)return;if(j.type==="typedef"){let{typedefIncludesDictionary:O}=M.cache;if(O.has(j))return O.get(j);M.cache.typedefIncludesDictionary.set(j,void 0);let g=W(j.idlType,M);if(M.cache.typedefIncludesDictionary.set(j,g),g)return{reference:K,dictionary:g.dictionary}}if(j.type==="dictionary"&&(D||!K.nullable))return{reference:K,dictionary:j}}for(let j of K.subtype){let O=W(j,M);if(O)return j.union?O:{reference:j,dictionary:O.dictionary}}}function Y(K,M){if(M.cache.dictionaryIncludesRequiredField.has(K))return M.cache.dictionaryIncludesRequiredField.get(K);M.cache.dictionaryIncludesRequiredField.set(K,void 0);let D=K.members.some((j)=>j.required);if(!D&&K.inheritance){let j=M.unique.get(K.inheritance);j?Y(j,M)&&(D=!0):D=!0}return M.cache.dictionaryIncludesRequiredField.set(K,D),D}class z extends Array{constructor({source:K,tokens:M}){super(),Object.defineProperties(this,{source:{value:K},tokens:{value:M},parent:{value:null,writable:!0}})}}class q extends G{static parser(K,M){return()=>{let D=K.consumeKind(M);if(D)return new q({source:K.source,tokens:{value:D}})}}get value(){return u(this.tokens.value.value)}write(K){return K.ts.wrap([K.token(this.tokens.value),K.token(this.tokens.separator)])}}class H extends q{static parse(K){let M=K.consumeKind("eof");if(M)return new H({source:K.source,tokens:{value:M}})}get type(){return"eof"}}function B(K,M){return t(K,{parser:q.parser(K,M),listName:M+" list"})}let F=["identifier","decimal","integer","string"],L=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((K)=>[K,`Legacy${K}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function w(K){for(let M of F){let D=B(K,M);if(D.length)return D}K.error("Expected identifiers, strings, decimals, or integers but none found")}class N extends G{static parse(K){let M={assign:K.consume("=")},D=$0(new N({source:K.source,tokens:M}));if(D.list=[],M.assign){if(M.asterisk=K.consume("*"),M.asterisk)return D.this;M.secondaryName=K.consumeKind(...F)}return M.open=K.consume("("),M.open?(D.list=D.rhsIsList?w(K):l(K),M.close=K.consume(")")||K.error("Unexpected token in extended attribute argument list")):M.assign&&!M.secondaryName&&K.error("No right hand side to extended attribute assignment"),D.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(K){let{rhsType:M}=this;return K.ts.wrap([K.token(this.tokens.assign),K.token(this.tokens.asterisk),K.reference_token(this.tokens.secondaryName,this.parent),K.token(this.tokens.open),...this.list.map((D)=>M==="identifier-list"?K.identifier(D,this.parent):D.write(K)),K.token(this.tokens.close)])}}class I extends G{static parse(K){let M=K.consumeKind("identifier");if(M)return new I({source:K.source,tokens:{name:M},params:N.parse(K)})}constructor({source:K,tokens:M,params:D}){super({source:K,tokens:M}),D.parent=this,Object.defineProperty(this,"params",{value:D})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:K,tokens:M,list:D}=this.params;if(!K)return null;return{type:K,value:this.params.rhsIsList?D:this.params.tokens.secondaryName?u(M.secondaryName.value):null}}get arguments(){let{rhsIsList:K,list:M}=this.params;return!M||K?[]:M}*validate(K){let{name:M}=this;if(M==="LegacyNoInterfaceObject")yield J(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(L.has(M)){let j=`\`[${M}]\` extended attribute is a legacy feature that is now renamed to \`[${L.get(M)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield J(this.tokens.name,this,"renamed-legacy",j,{level:"warning",autofix:(D=this,()=>{let{name:O}=D;D.tokens.name.value=L.get(O),O==="TreatNullAs"&&(D.params.tokens={})})})}var D;for(let j of this.arguments)yield*j.validate(K)}write(K){return K.ts.wrap([K.ts.trivia(this.tokens.name.trivia),K.ts.extendedAttribute(K.ts.wrap([K.ts.extendedAttributeReference(this.name),this.params.write(K)])),K.token(this.tokens.separator)])}}class T extends z{static parse(K){let M={};M.open=K.consume("[");let D=new T({source:K.source,tokens:M});return M.open?(D.push(...t(K,{parser:I.parse,listName:"extended attribute"})),M.close=K.consume("]")||K.error("Expected a closing token for the extended attribute list"),D.length||(K.unconsume(M.close.index),K.error("An extended attribute list must not be empty")),K.probe("[")&&K.error("Illegal double extended attribute lists, consider merging them"),D):D}*validate(K){for(let M of this)yield*M.validate(K)}write(K){return this.length?K.ts.wrap([K.token(this.tokens.open),...this.map((M)=>M.write(K)),K.token(this.tokens.close)]):""}}function E(K,M){let D=K.consume("?");D&&(M.tokens.nullable=D),K.probe("?")&&K.error("Can't nullable more than once")}function P(K,M){let D=function(j,O){let g=j.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!g)return;let i=$0(new R({source:j.source,tokens:{base:g}}));switch(i.tokens.open=j.consume("<")||j.error(`No opening bracket after ${g.value}`),g.value){case"Promise":{j.probe("[")&&j.error("Promise type cannot have extended attribute");let Q0=V0(j,O)||j.error("Missing Promise subtype");i.subtype.push(Q0);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let Q0=K0(j,O)||j.error(`Missing ${g.value} subtype`);i.subtype.push(Q0);break}case"record":{j.probe("[")&&j.error("Record key cannot have extended attribute");let Q0=j.consume(...D0)||j.error(`Record key must be one of: ${D0.join(", ")}`),L0=new R({source:j.source,tokens:{base:Q0}});L0.tokens.separator=j.consume(",")||j.error("Missing comma after record key type"),L0.type=O;let M0=K0(j,O)||j.error("Error parsing generic type record");i.subtype.push(L0,M0);break}}return i.idlType||j.error(`Error parsing generic type ${g.value}`),i.tokens.close=j.consume(">")||j.error(`Missing closing bracket after ${g.value}`),i.this}(K,M)||A0(K);if(!D){let j=K.consumeKind("identifier")||K.consume(...D0,...U0);if(!j)return;D=new R({source:K.source,tokens:{base:j}}),K.probe("<")&&K.error(`Unsupported generic type ${j.value}`)}return D.generic==="Promise"&&K.probe("?")&&K.error("Promise type cannot be nullable"),D.type=M||null,E(K,D),D.nullable&&D.idlType==="any"&&K.error("Type `any` cannot be made nullable"),D}class R extends G{static parse(K,M){return P(K,M)||function(D,j){let O={};if(O.open=D.consume("("),!O.open)return;let g=$0(new R({source:D.source,tokens:O}));for(g.type=j||null;;){let i=K0(D,j)||D.error("No type after open parenthesis or 'or' in union type");i.idlType==="any"&&D.error("Type `any` cannot be included in a union type"),i.generic==="Promise"&&D.error("Type `Promise` cannot be included in a union type"),g.subtype.push(i);let Q0=D.consume("or");if(!Q0)break;i.tokens.separator=Q0}return g.idlType.length<2&&D.error("At least two types are expected in a union type but found less"),O.close=D.consume(")")||D.error("Unterminated union type"),E(D,g),g.this}(K,M)}constructor({source:K,tokens:M}){super({source:K,tokens:M}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new T({source:K,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return u([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((K)=>K).map((K)=>K.value).join(" "))}*validate(K){if(yield*this.extAttrs.validate(K),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let g of O){if(g.name!=="AllowShared")continue;let i="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield J(this.tokens.base,this,"migrate-allowshared",i,{autofix:C(this,g,O)})}if(this.idlType==="void")yield J(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(M=this,()=>{M.tokens.base.value="undefined"})});var M;let D=!this.union&&K.unique.get(this.idlType),j=this.union?this:D&&D.type==="typedef"?D.idlType:void 0;if(j&&this.nullable){let{reference:O}=W(j,K)||{};if(O){let g=(this.union?O:this).tokens.base;yield J(g,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(K)}write(K){return K.ts.wrap([this.extAttrs.write(K),(()=>{if(this.union||this.generic)return K.ts.wrap([K.token(this.tokens.base,K.ts.generic),K.token(this.tokens.open),...this.subtype.map((O)=>O.write(K)),K.token(this.tokens.close)]);let M=this.tokens.prefix||this.tokens.base,D=this.tokens.prefix?[this.tokens.prefix.value,K.ts.trivia(this.tokens.base.trivia)]:[],j=K.reference(K.ts.wrap([...D,this.tokens.base.value,K.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return K.ts.wrap([K.ts.trivia(M.trivia),j])})(),K.token(this.tokens.nullable),K.token(this.tokens.separator)])}}function C(K,M,D){return()=>{let j=D.indexOf(M);D.splice(j,1),!D.length&&K.tokens.base.trivia.match(/^\s$/)&&(K.tokens.base.trivia=""),K.tokens.base.value="AllowSharedBufferSource"}}class y extends G{static parse(K){let M=K.consume("=");if(!M)return null;let D=Y0(K)||K.consumeKind("string")||K.consume("null","[","{")||K.error("No value for default"),j=[D];if(D.value==="["){let O=K.consume("]")||K.error("Default sequence value must be empty");j.push(O)}else if(D.value==="{"){let O=K.consume("}")||K.error("Default dictionary value must be empty");j.push(O)}return new y({source:K.source,tokens:{assign:M},expression:j})}constructor({source:K,tokens:M,expression:D}){super({source:K,tokens:M}),D.parent=this,Object.defineProperty(this,"expression",{value:D})}get type(){return G0(this.expression[0]).type}get value(){return G0(this.expression[0]).value}get negative(){return G0(this.expression[0]).negative}write(K){return K.ts.wrap([K.token(this.tokens.assign),...this.expression.map((M)=>K.token(M))])}}class v extends G{static parse(K){let M=K.position,D={},j=$0(new v({source:K.source,tokens:D}));return j.extAttrs=T.parse(K),D.optional=K.consume("optional"),j.idlType=K0(K,"argument-type"),j.idlType?(D.optional||(D.variadic=K.consume("...")),D.name=K.consumeKind("identifier")||K.consume(...e),D.name?(j.default=D.optional?y.parse(K):null,j.this):K.unconsume(M)):K.unconsume(M)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.extAttrs.validate(K),yield*this.idlType.validate(K);let M=W(this.idlType,K,{useNullableInner:!0});if(M){if(this.idlType.nullable)yield J(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield J(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:h(this)})}else if(this.parent&&!Y(M.dictionary,K)&&function(j){let O=j.parent.arguments||j.parent.list,g=O.indexOf(j);return!O.slice(g+1).some((Q0)=>!Q0.optional)}(this))yield J(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(D=this,()=>{let O=J0(D.idlType);D.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",h(D)()})})}var D}write(K){return K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.optional),K.ts.type(this.idlType.write(K)),K.token(this.tokens.variadic),K.name_token(this.tokens.name,{data:this}),this.default?this.default.write(K):"",K.token(this.tokens.separator)])}}function h(K){return()=>{K.default=y.parse(new v0(" = {}"))}}class X0 extends G{static parse(K,{special:M,regular:D}={}){let j={special:M},O=$0(new X0({source:K.source,tokens:j}));return M&&M.value==="stringifier"&&(j.termination=K.consume(";"),j.termination)?(O.arguments=[],O):(M||D||(j.special=K.consume("getter","setter","deleter")),O.idlType=V0(K)||K.error("Missing return type"),j.name=K.consumeKind("identifier")||K.consume("includes"),j.open=K.consume("(")||K.error("Invalid operation"),O.arguments=l(K),j.close=K.consume(")")||K.error("Unterminated operation"),j.termination=K.consume(";")||K.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:K}=this.tokens;return K?u(K.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(K){if(yield*this.extAttrs.validate(K),!this.name&&["","static"].includes(this.special))yield J(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield J(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(K)}for(let M of this.arguments)yield*M.validate(K)}write(K){let{parent:M}=this,D=this.idlType?[K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.open),K.ts.wrap(this.arguments.map((j)=>j.write(K))),K.token(this.tokens.close)]:[];return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),this.tokens.name?K.token(this.tokens.special):K.token(this.tokens.special,K.ts.nameless,{data:this,parent:M}),...D,K.token(this.tokens.termination)]),{data:this,parent:M})}}class r extends G{static parse(K,{special:M,noInherit:D=!1,readonly:j=!1}={}){let O=K.position,g={special:M},i=$0(new r({source:K.source,tokens:g}));if(M||D||(g.special=K.consume("inherit")),i.special==="inherit"&&K.probe("readonly")&&K.error("Inherited attributes cannot be read-only"),g.readonly=K.consume("readonly"),j&&!g.readonly&&K.probe("attribute")&&K.error("Attributes must be readonly in this context"),g.base=K.consume("attribute"),g.base)return i.idlType=K0(K,"attribute-type")||K.error("Attribute lacks a type"),g.name=K.consumeKind("identifier")||K.consume("async","required")||K.error("Attribute lacks a name"),g.termination=K.consume(";")||K.error("Unterminated attribute, expected `;`"),i.this;K.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return u(this.tokens.name.value)}*validate(K){if(yield*this.extAttrs.validate(K),yield*this.idlType.validate(K),["async_sequence","sequence","record"].includes(this.idlType.generic)){let M=`Attributes cannot accept ${this.idlType.generic} types.`;yield J(this.tokens.name,this,"attr-invalid-type",M)}{let{reference:M}=W(this.idlType,K)||{};if(M){let D=(this.idlType.union?M:this.idlType).tokens.base;yield J(D,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(M,D){if(M.union)return!1;if(M.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let j=D.unique.get(M.idlType);return j?.type==="typedef"&&j.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,K)){let M=this.idlType.tokens.base;yield J(M,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.special),K.token(this.tokens.readonly),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.termination)]),{data:this,parent:M})}}function u(K){return K.startsWith("_")?K.slice(1):K}function t(K,{parser:M,allowDangler:D,listName:j="list"}){let O=M(K);if(!O)return[];O.tokens.separator=K.consume(",");let g=[O];for(;O.tokens.separator;){let i=M(K);if(!i){D||K.error(`Trailing comma in ${j}`);break}if(i.tokens.separator=K.consume(","),g.push(i),!i.tokens.separator)break}return g}function Y0(K){return K.consumeKind("decimal","integer")||K.consume("true","false","Infinity","-Infinity","NaN")}function G0({type:K,value:M}){switch(K){case"decimal":case"integer":return{type:"number",value:M};case"string":return{type:"string",value:M.slice(1,-1)}}switch(M){case"true":case"false":return{type:"boolean",value:M==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:M.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:M}}}function A0(K){let{source:M}=K,D=function(){let O=K.consume("unsigned"),g=K.consume("short","long");if(g){let i=K.consume("long");return new R({source:M,tokens:{prefix:O,base:g,postfix:i}})}O&&K.error("Failed to parse integer type")}()||function(){let O=K.consume("unrestricted"),g=K.consume("float","double");if(g)return new R({source:M,tokens:{prefix:O,base:g}});O&&K.error("Failed to parse float type")}();if(D)return D;let j=K.consume("bigint","boolean","byte","octet","undefined");return j?new R({source:M,tokens:{base:j}}):void 0}function l(K){return t(K,{parser:v.parse,listName:"arguments list"})}function K0(K,M){let D=T.parse(K),j=R.parse(K,M);return j&&($0(j).extAttrs=D),j}function V0(K,M){let D=R.parse(K,M||"return-type");if(D)return D;let j=K.consume("void");if(j){let O=new R({source:K.source,tokens:{base:j}});return O.type="return-type",O}}function o(K){let M=K.consume("stringifier");if(!M)return;return r.parse(K,{special:M})||X0.parse(K,{special:M})||K.error("Unterminated stringifier")}function f(K){let M=K.split(`
384
+ `);if(M.length){let D=M[M.length-1].match(/^\s+/);if(D)return D[0]}return""}function Z0(K){return()=>{if(K.extAttrs.length){let M=new v0("Exposed=Window,"),D=I.parse(M);D.tokens.separator=M.consume(",");let j=K.extAttrs[0];/^\s/.test(j.tokens.name.trivia)||(j.tokens.name.trivia=` ${j.tokens.name.trivia}`),K.extAttrs.unshift(D)}else{$0(K).extAttrs=T.parse(new v0("[Exposed=Window]"));let M=K.tokens.base.trivia;K.extAttrs.tokens.open.trivia=M,K.tokens.base.trivia=`
385
+ ${f(M)}`}}}function J0(K){if(K.extAttrs.length)return K.extAttrs.tokens.open;if(K.type==="operation"&&!K.special)return J0(K.idlType);return Object.values(K.tokens).sort((M,D)=>M.index-D.index)[0]}function $0(K,M){if(M||(M=K),!K)return K;return new Proxy(K,{get(D,j){let O=D[j];return Array.isArray(O)&&j!=="source"?$0(O,D):O},set(D,j,O){if(D[j]=O,!O)return!0;if(Array.isArray(O))for(let g of O)g.parent!==void 0&&(g.parent=M);else O.parent!==void 0&&(O.parent=M);return!0}})}let F0={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},U0=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],D0=["ByteString","DOMString","USVString"],e=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],d0=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(e,D0,U0),R0=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],p0=["_constructor","toString","_toString"];class v0{constructor(K){this.source=function(M){let D=[],j=0,O="",g=1,i=0;for(;j<M.length;){let L0=M.charAt(j),M0=-1;if(/[\t\n\r ]/.test(L0)?M0=Q0("whitespace",{noFlushTrivia:!0}):L0==="/"&&(M0=Q0("comment",{noFlushTrivia:!0})),M0!==-1){let j0=D.pop().value;g+=(j0.match(/\n/g)||[]).length,O+=j0,i-=1}else if(/[-0-9.A-Z_a-z]/.test(L0)){if(M0=Q0("decimal"),M0===-1&&(M0=Q0("integer")),M0===-1){M0=Q0("identifier");let j0=D.length-1,b0=D[j0];if(M0!==-1){if(p0.includes(b0.value)){let B$=`${u(b0.value)} is a reserved identifier and must not be used.`;throw new i0(Q(D,j0,null,B$))}d0.includes(b0.value)&&(b0.type="inline")}}}else L0==='"'&&(M0=Q0("string"));for(let j0 of R0)if(M.startsWith(j0,j)){D.push({type:"inline",value:j0,trivia:O,line:g,index:i}),O="",j+=j0.length,M0=j;break}if(M0===-1&&(M0=Q0("other")),M0===-1)throw Error("Token stream not progressing");j=M0,i+=1}return D.push({type:"eof",value:"",trivia:O,line:g,index:i}),D;function Q0(L0,{noFlushTrivia:M0}={}){let j0=F0[L0];j0.lastIndex=j;let b0=j0.exec(M);return b0?(D.push({type:L0,value:b0[0],trivia:O,line:g,index:i}),M0||(O=""),j0.lastIndex):-1}}(K),this.position=0}error(K){throw new i0(Q(this.source,this.position,this.current,K))}probeKind(K){return this.source.length>this.position&&this.source[this.position].type===K}probe(K){return this.probeKind("inline")&&this.source[this.position].value===K}consumeKind(...K){for(let M of K){if(!this.probeKind(M))continue;let D=this.source[this.position];return this.position++,D}}consume(...K){if(!this.probeKind("inline"))return;let M=this.source[this.position];for(let D of K)if(M.value===D)return this.position++,M}consumeIdentifier(K){if(this.probeKind("identifier")&&this.source[this.position].value===K)return this.consumeKind("identifier")}unconsume(K){this.position=K}}class i0 extends Error{constructor({message:K,bareMessage:M,context:D,line:j,sourceName:O,input:g,tokens:i}){super(K),this.name="WebIDLParseError",this.bareMessage=M,this.context=D,this.line=j,this.sourceName=O,this.input=g,this.tokens=i}}class O$ extends q{static parse(K){let M=K.consumeKind("string");if(M)return new O$({source:K.source,tokens:{value:M}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(K){let{parent:M}=this;return K.ts.wrap([K.ts.trivia(this.tokens.value.trivia),K.ts.definition(K.ts.wrap(['"',K.ts.name(this.value,{data:this,parent:M}),'"']),{data:this,parent:M}),K.token(this.tokens.separator)])}}class q$ extends G{static parse(K){let M={};if(M.base=K.consume("enum"),!M.base)return;M.name=K.consumeKind("identifier")||K.error("No name for enum");let D=$0(new q$({source:K.source,tokens:M}));return K.current=D.this,M.open=K.consume("{")||K.error("Bodyless enum"),D.values=t(K,{parser:O$.parse,allowDangler:!0,listName:"enumeration"}),K.probeKind("string")&&K.error("No comma between enum values"),M.close=K.consume("}")||K.error("Unexpected value in enum"),D.values.length||K.error("No value in enum"),M.termination=K.consume(";")||K.error("No semicolon after enum"),D.this}get type(){return"enum"}get name(){return u(this.tokens.name.value)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.open),K.ts.wrap(this.values.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class M1 extends G{static parse(K){let M=K.consumeKind("identifier");if(!M)return;let D={target:M};if(D.includes=K.consume("includes"),D.includes)return D.mixin=K.consumeKind("identifier")||K.error("Incomplete includes statement"),D.termination=K.consume(";")||K.error("No terminating ; for includes statement"),new M1({source:K.source,tokens:D});K.unconsume(M.index)}get type(){return"includes"}get target(){return u(this.tokens.target.value)}get includes(){return u(this.tokens.mixin.value)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.reference_token(this.tokens.target,this),K.token(this.tokens.includes),K.reference_token(this.tokens.mixin,this),K.token(this.tokens.termination)]),{data:this})}}class A1 extends G{static parse(K){let M={},D=$0(new A1({source:K.source,tokens:M}));if(M.base=K.consume("typedef"),M.base)return D.idlType=K0(K,"typedef-type")||K.error("Typedef lacks a type"),M.name=K.consumeKind("identifier")||K.error("Typedef lacks a name"),K.current=D.this,M.termination=K.consume(";")||K.error("Unterminated typedef, expected `;`"),D.this}get type(){return"typedef"}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.idlType.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.termination)]),{data:this})}}class f$ extends G{static parse(K,M){let D={base:M},j=$0(new f$({source:K.source,tokens:D}));return D.name=K.consumeKind("identifier")||K.error("Callback lacks a name"),K.current=j.this,D.assign=K.consume("=")||K.error("Callback lacks an assignment"),j.idlType=V0(K)||K.error("Callback lacks a return type"),D.open=K.consume("(")||K.error("Callback lacks parentheses for arguments"),j.arguments=l(K),D.close=K.consume(")")||K.error("Unterminated callback"),D.termination=K.consume(";")||K.error("Unterminated callback, expected `;`"),j.this}get type(){return"callback"}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.extAttrs.validate(K);for(let M of this.arguments)if(yield*M.validate(K),M.idlType.generic==="async_sequence")yield J(M.tokens.name,M,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.assign),K.ts.type(this.idlType.write(K)),K.token(this.tokens.open),...this.arguments.map((M)=>M.write(K)),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class K$ extends G{static parse(K,M,{inheritable:D,allowedMembers:j}){let{tokens:O,type:g}=M;for(O.name=K.consumeKind("identifier")||K.error(`Missing name in ${g}`),K.current=M,M=$0(M),D&&Object.assign(O,function(i){let Q0=i.consume(":");return Q0?{colon:Q0,inheritance:i.consumeKind("identifier")||i.error("Inheritance lacks a type")}:{}}(K)),O.open=K.consume("{")||K.error(`Bodyless ${g}`),M.members=[];;){if(O.close=K.consume("}"),O.close)return O.termination=K.consume(";")||K.error(`Missing semicolon after ${g}`),M.this;let i=T.parse(K),Q0;for(let[L0,...M0]of j)if(Q0=$0(L0(K,...M0)),Q0)break;Q0||K.error("Unknown member"),Q0.extAttrs=i,M.members.push(Q0.this)}}get partial(){return!!this.tokens.partial}get name(){return u(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?u(this.tokens.inheritance.value):null}*validate(K){for(let M of this.members)M.validate&&(yield*M.validate(K))}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.callback),K.token(this.tokens.partial),K.token(this.tokens.base),K.token(this.tokens.mixin),K.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?K.ts.wrap([K.token(this.tokens.colon),K.ts.trivia(this.tokens.inheritance.trivia),K.ts.inheritance(K.reference(this.tokens.inheritance.value,{context:this}))]):"")(),K.token(this.tokens.open),K.ts.wrap(this.members.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class I1 extends G{static parse(K){let M={};if(M.base=K.consume("const"),!M.base)return;let D=A0(K);if(!D){let O=K.consumeKind("identifier")||K.error("Const lacks a type");D=new R({source:K.source,tokens:{base:O}})}K.probe("?")&&K.error("Unexpected nullable constant type"),D.type="const-type",M.name=K.consumeKind("identifier")||K.error("Const lacks a name"),M.assign=K.consume("=")||K.error("Const lacks value assignment"),M.value=Y0(K)||K.error("Const lacks a value"),M.termination=K.consume(";")||K.error("Unterminated const, expected `;`");let j=new I1({source:K.source,tokens:M});return $0(j).idlType=D,j}get type(){return"const"}get name(){return u(this.tokens.name.value)}get value(){return G0(this.tokens.value)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.assign),K.token(this.tokens.value),K.token(this.tokens.termination)]),{data:this,parent:M})}}class Y6 extends G{static parse(K){let M=K.position,D=$0(new Y6({source:K.source,tokens:{}})),{tokens:j}=D;if(j.readonly=K.consume("readonly"),j.readonly||(j.async=K.consume("async")),j.base=j.readonly?K.consume("maplike","setlike"):j.async?K.consume("iterable"):K.consume("iterable","async_iterable","maplike","setlike"),!j.base)return void K.unconsume(M);let{type:O}=D,g=O==="maplike",i=g||O==="iterable"||O==="async_iterable",Q0=O==="async_iterable"||D.async&&O==="iterable";j.open=K.consume("<")||K.error(`Missing less-than sign \`<\` in ${O} declaration`);let L0=K0(K)||K.error(`Missing a type argument in ${O} declaration`);return D.idlType=[L0],D.arguments=[],i&&(L0.tokens.separator=K.consume(","),L0.tokens.separator?D.idlType.push(K0(K)):g&&K.error(`Missing second type argument in ${O} declaration`)),j.close=K.consume(">")||K.error(`Missing greater-than sign \`>\` in ${O} declaration`),K.probe("(")&&(Q0?(j.argsOpen=K.consume("("),D.arguments.push(...l(K)),j.argsClose=K.consume(")")||K.error("Unterminated async iterable argument list")):K.error("Arguments are only allowed for `async iterable`")),j.termination=K.consume(";")||K.error(`Missing semicolon after ${O} declaration`),D.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(K){if(this.async&&this.type==="iterable")yield J(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(M=this,()=>{let j=M.tokens.async;M.tokens.base={...j,type:"async_iterable",value:"async_iterable"},delete M.tokens.async})});var M;for(let D of this.idlType)yield*D.validate(K);for(let D of this.arguments)yield*D.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.readonly),K.token(this.tokens.async),K.token(this.tokens.base,K.ts.generic),K.token(this.tokens.open),K.ts.wrap(this.idlType.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.argsOpen),K.ts.wrap(this.arguments.map((M)=>M.write(K))),K.token(this.tokens.argsClose),K.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class h1 extends G{static parse(K){let M=K.consume("constructor");if(!M)return;let D={base:M};D.open=K.consume("(")||K.error("No argument list in constructor");let j=l(K);D.close=K.consume(")")||K.error("Unterminated constructor"),D.termination=K.consume(";")||K.error("No semicolon after constructor");let O=new h1({source:K.source,tokens:D});return $0(O).arguments=j,O}get type(){return"constructor"}*validate(K){for(let M of this.arguments)yield*M.validate(K)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base,K.ts.nameless,{data:this,parent:M}),K.token(this.tokens.open),K.ts.wrap(this.arguments.map((D)=>D.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this,parent:M})}}function Y9(K){let M=K.consume("static");if(!M)return;return r.parse(K,{special:M})||X0.parse(K,{special:M})||K.error("No body in static member")}class h$ extends K${static parse(K,M,{extMembers:D=[],partial:j=null}={}){let O={partial:j,base:M};return K$.parse(K,new h$({source:K.source,tokens:O}),{inheritable:!j,allowedMembers:[...D,[I1.parse],[h1.parse],[Y9],[o],[Y6.parse],[r.parse],[X0.parse]]})}get type(){return"interface"}*validate(K){if(yield*this.extAttrs.validate(K),!this.partial&&this.extAttrs.every((D)=>D.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:Z0(this)});let M=this.extAttrs.filter((D)=>D.name==="Constructor");for(let D of M)yield J(D.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:z9(this,D)});if(this.extAttrs.some((D)=>D.name==="Global")){let D=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of D)yield J(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let j=this.members.filter((O)=>O.type==="constructor");for(let O of j)yield J(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(K),this.partial||(yield*function*(D,j){let O=function(M0){let j0=L0(M0);return{statics:new Set(j0.filter((b0)=>b0.special==="static").map((b0)=>b0.name)),nonstatics:new Set(j0.filter((b0)=>b0.special!=="static").map((b0)=>b0.name))}}(j),g=D.partials.get(j.name)||[],i=D.mixinMap.get(j.name)||[];for(let M0 of[...g,...i]){let j0=L0(M0),b0=j0.filter((E$)=>E$.special==="static"),B$=j0.filter((E$)=>E$.special!=="static");yield*Q0(b0,O.statics,M0,j),yield*Q0(B$,O.nonstatics,M0,j),b0.forEach((E$)=>O.statics.add(E$.name)),B$.forEach((E$)=>O.nonstatics.add(E$.name))}function*Q0(M0,j0,b0,B$){for(let E$ of M0){let{name:q9}=E$;if(q9&&j0.has(q9)){let xZ=`The ${E$.special==="static"?"static ":""}operation "${q9}" has already been defined for the base interface "${B$.name}" either in itself or in a mixin`;yield J(E$.tokens.name,b0,"no-cross-overload",xZ)}}}function L0(M0){return M0.members.filter(({type:j0})=>j0==="operation")}}(K,this))}}function z9(K,M){return K=$0(K),()=>{let D=f(K.extAttrs.tokens.open.trivia),j=K.members.length?f(J0(K.members[0]).trivia):function(j0){let b0=f(j0),B$=b0.includes("\t")?"\t":" ";return b0+B$}(D),O=h1.parse(new v0(`
386
+ ${j}constructor();`));O.extAttrs=new T({source:K.source,tokens:{}}),$0(O).arguments=M.arguments;let g=function(j0,b0){let B$=j0.slice().reverse().findIndex(b0);return B$===-1?B$:j0.length-B$-1}(K.members,(j0)=>j0.type==="constructor");K.members.splice(g+1,0,O);let{close:i}=K.tokens;i.trivia.includes(`
387
+ `)||(i.trivia+=`
388
+ ${D}`);let{extAttrs:Q0}=K,L0=Q0.indexOf(M),M0=Q0.splice(L0,1);Q0.length?Q0.length===L0?Q0[L0-1].tokens.separator=void 0:Q0[L0].tokens.name.trivia.trim()||(Q0[L0].tokens.name.trivia=M0[0].tokens.name.trivia):Q0.tokens.open=Q0.tokens.close=void 0}}class z6 extends K${static parse(K,M,{extMembers:D=[],partial:j}={}){let O={partial:j,base:M};if(O.mixin=K.consume("mixin"),O.mixin)return K$.parse(K,new z6({source:K.source,tokens:O}),{allowedMembers:[...D,[I1.parse],[o],[r.parse,{noInherit:!0}],[X0.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class q6 extends G{static parse(K){let M={},D=$0(new q6({source:K.source,tokens:M}));return D.extAttrs=T.parse(K),M.required=K.consume("required"),D.idlType=K0(K,"dictionary-type")||K.error("Dictionary member lacks a type"),M.name=K.consumeKind("identifier")||K.error("Dictionary member lacks a name"),D.default=y.parse(K),M.required&&D.default&&K.error("Required member must not have a default"),M.termination=K.consume(";")||K.error("Unterminated dictionary member, expected `;`"),D.this}get type(){return"field"}get name(){return u(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(K){yield*this.idlType.validate(K)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.required),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),this.default?this.default.write(K):"",K.token(this.tokens.termination)]),{data:this,parent:M})}}class K6 extends K${static parse(K,{extMembers:M=[],partial:D}={}){let j={partial:D};if(j.base=K.consume("dictionary"),j.base)return K$.parse(K,new K6({source:K.source,tokens:j}),{inheritable:!D,allowedMembers:[...M,[q6.parse]]})}get type(){return"dictionary"}}class V extends K${static parse(K,{extMembers:M=[],partial:D}={}){let j={partial:D};if(j.base=K.consume("namespace"),j.base)return K$.parse(K,new V({source:K.source,tokens:j}),{allowedMembers:[...M,[r.parse,{noInherit:!0,readonly:!0}],[I1.parse],[X0.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(K){if(!this.partial&&this.extAttrs.every((M)=>M.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:Z0(this)});yield*super.validate(K)}}class S extends K${static parse(K,M,{extMembers:D=[]}={}){let j={callback:M};if(j.base=K.consume("interface"),j.base)return K$.parse(K,new S({source:K.source,tokens:j}),{allowedMembers:[...D,[I1.parse],[X0.parse,{regular:!0}]]})}get type(){return"callback interface"}}function m(K,M){let D=K.source;function j(L0){K.error(L0)}function O(...L0){return K.consume(...L0)}function g(L0){let M0=O("interface");if(M0)return z6.parse(K,M0,{...L0,...M?.extensions?.mixin})||h$.parse(K,M0,{...L0,...M?.extensions?.interface})||j("Interface has no proper body")}function i(){if(M.productions)for(let L0 of M.productions){let M0=L0(K);if(M0)return M0}return function(){let L0=O("callback");if(L0)return K.probe("interface")?S.parse(K,L0,{...M?.extensions?.callbackInterface}):f$.parse(K,L0)}()||g()||function(){let L0=O("partial");if(L0)return K6.parse(K,{partial:L0,...M?.extensions?.dictionary})||g({partial:L0})||V.parse(K,{partial:L0,...M?.extensions?.namespace})||j("Partial doesn't apply to anything")}()||K6.parse(K,M?.extensions?.dictionary)||q$.parse(K)||A1.parse(K)||M1.parse(K)||V.parse(K,M?.extensions?.namespace)}let Q0=function(){if(!D.length)return[];let L0=[];for(;;){let j0=T.parse(K),b0=i();if(!b0){j0.length&&j("Stray extended attributes");break}$0(b0).extAttrs=j0,L0.push(b0)}let M0=H.parse(K);return M.concrete&&L0.push(M0),L0}();return K.position<D.length&&j("Unrecognised tokens"),Q0}function p(K,M={}){let D=new v0(K);return M.sourceName!==void 0&&(D.source.name=M.sourceName),m(D,M)}function k(K){return K}let a={wrap:(K)=>K.join(""),trivia:k,name:k,reference:k,type:k,generic:k,nameless:k,inheritance:k,definition:k,extendedAttribute:k,extendedAttributeReference:k};class A{constructor(K){this.ts=Object.assign({},a,K)}reference(K,{unescaped:M,context:D}){return M||(M=K.startsWith("_")?K.slice(1):K),this.ts.reference(K,M,D)}token(K,M=k,...D){if(!K)return"";let j=M(K.value,...D);return this.ts.wrap([this.ts.trivia(K.trivia),j])}reference_token(K,M){return this.token(K,this.reference.bind(this),{context:M})}name_token(K,M){return this.token(K,this.ts.name,M)}identifier(K,M){return this.ts.wrap([this.reference_token(K.tokens.value,M),this.token(K.tokens.separator)])}}function _(K,{templates:M=a}={}){M=Object.assign({},a,M);let D=new A(M);return M.wrap(K.map((j)=>j.write(D)))}function n(K,M){let D=new Map,j=K.filter((O)=>O.type==="includes");for(let O of j){let g=M.get(O.includes);if(!g)continue;let i=D.get(O.target);i?i.push(g):D.set(O.target,[g])}return D}function*d(K){let M=function(D){let j=new Map,O=new Set,g=new Map;for(let i of D)if(i.partial){let Q0=g.get(i.name);Q0?Q0.push(i):g.set(i.name,[i])}else i.name&&(j.has(i.name)?O.add(i):j.set(i.name,i));return{all:D,unique:j,partials:g,duplicates:O,mixinMap:n(D,j),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(K);for(let D of M.all)D.validate&&(yield*D.validate(M));yield*function*({unique:D,duplicates:j}){for(let O of j){let{name:g}=O,i=`The name "${g}" of type "${D.get(g).type}" was already seen`;yield J(O.tokens.name,O,"no-duplicate",i)}}(M)}function c(K){return[...d((M=K,M.flat?M.flat():[].concat(...M)))];var M}return Z})())});var lH=b((ap,dH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",hH=O0("fs").promises,fH=O0("path"),oP=gH();class uH{constructor($,Z){this.filename=Z,this.shortname=fH.basename(Z,".idl"),this.path=fH.join($,Z)}async text(){return await hH.readFile(this.path,"utf8")}async parse(){let $=await this.text();return oP.parse($)}}async function mH({folder:$=__dirname}={}){let Z={},X=await hH.readdir($);for(let Q of X)if(Q.endsWith(".idl")){let J=new uH($,Q);Z[J.shortname]=J}return Z}async function sP($){let Z=await mH($);for(let[X,Q]of Object.entries(Z))Z[X]=await Q.parse();return Z}dH.exports={listAll:mH,parseAll:sP}});var cH;var pH=s(()=>{cH={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec).",minLength:1,type:"string"}});var iH,nH,rH;var aH=s(()=>{iH={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},nH={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},rH={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var oH;var sH=s(()=>{oH={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:{type:"string"}},required:["tagName"],type:"object"}});var tH,eH;var $V=s(()=>{tH={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"},eH={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 ZV;var XV=s(()=>{ZV={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var QV,JV,GV,WV,YV,zV,qV,KV,UV;var HV=s(()=>{QV={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:"^#/\\$defs/",type:"string"},JV={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},GV={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:"^(\\./|\\.\\./).*\\.json$|^https?://",type:"string"},WV={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},YV={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},zV={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:"^\\$map/(item|index)(/.*)?$",type:"string"},qV={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},KV={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"},UV={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var n5;var VV=s(()=>{n5={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$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.",properties:{},type:"object"}});var BV,FV;var LV=s(()=>{BV={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"}]},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},FV={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:{oneOf:[{$ref:"#/$defs/ElementDef"},{$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:"\\$\\{",type:"string"}]}});var MV,AV,IV,NV,DV,VQ;var wV=s(()=>{MV={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},AV={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"},IV={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},NV={additionalProperties:!1,description:"Reactive $ref that drives which case to render.",properties:{$ref:{$ref:"#/$defs/StateRef"}},required:["$ref"],type:"object"},DV={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"},VQ={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/TagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var TV;var jV=s(()=>{TV={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 OV;var EV=s(()=>{OV={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$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: an opaque JS source string (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 → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{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 RV,PV;var CV=s(()=>{RV={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), or a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed).",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"}]},PV={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 SV;var _V=s(()=>{SV={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"},expires:{type:"string"},filter:{$ref:"#/$defs/RefObject"},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 bV;var xV=s(()=>{bV={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 kV,yV,vV,gV,fV,hV,uV,mV,dV,lV,cV,pV,iV,nV,rV,aV,oV;var sV=s(()=>{kV={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:"^(\\$map/|\\$reduce/|\\$args/|event#/|#/|parent#/|window#/|document#/)",type:"string"}},required:["$ref"],type:"object"},yV={anyOf:[{not:{pattern:"\\$\\{"},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."},vV={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."},gV={enum:["!","-"]},fV={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},hV={const:"?:"},uV={const:"switch"},mV={const:"call"},dV={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"]},lV={enum:["=","+=","-=","*=","/="]},cV={enum:["pop","shift"]},pV={enum:["push","unshift"]},iV={const:"splice"},nV={const:"reduce"},rV={enum:["map","filter"]},aV={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 the Intl helpers Intl/formatNumber, Intl/formatDate, Intl/formatRelativeTime) — 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"},oV={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 tV,eV,$3,Z3;var X3=s(()=>{tV={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"}]},eV={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},$3={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Z3={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 tP,BQ,FQ,LQ,MQ,AQ,IQ,NQ,DQ,wQ,Q3;var J3=s(()=>{tP=["method","accessor","parse","serialize","discover","load","projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],BQ={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"},FQ={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"},LQ={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{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"},MQ={description:"A class method or accessor definition. Capability roles (parse, serialize, 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:{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:tP,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"},AQ={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:"^\\.",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"},IQ={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"},NQ={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"},DQ={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"},wQ={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"},Q3={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"}});var G3;var W3=s(()=>{G3={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 r5;var Y3=s(()=>{r5={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},quality:{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" runs Sharp 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 TQ;var z3=s(()=>{TQ={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:"Global type definitions available to all pages.",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"},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:"utf8",description:"Default charset for the page.",type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element.",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"}]}},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"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale code.",examples:["en"],type:"string"},locales:{description:"Available locale codes.",examples:[["en","fr","de"]],items:{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:{type:"string"},description:"Static redirect rules. Maps source paths to destination paths.",examples:[{"/old-about":"/about"}],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"}});function eP(){return q3??=$C(),q3}async function $C(){let[$,Z,X]=await Promise.all([K3.listAll(),U3.default.listAll(),H3.default.parseAll()]),Q=new Set;for(let{elements:q}of Object.values($))for(let H of q)if(!H.obsolete)Q.add(H.name);let J=[...Q].toSorted(),G=new Set;for(let q of Z.properties)for(let H of q.styleDeclaration??[])G.add(H);let W=[...G].toSorted(),Y=new Set;for(let q of Object.values(X))for(let H of q){if(H.type!=="interface"&&H.type!=="interface mixin")continue;if(!H.members)continue;for(let B of H.members)if(B.type==="attribute"&&B.name?.startsWith("on")&&typeof B.idlType?.idlType==="string"&&B.idlType.idlType==="EventHandler")Y.add(B.name)}let z=[...Y].toSorted();return{cssProps:W,eventHandlers:z,tagExamples:J}}function ZC($){let Z={};for(let X of $)Z[X]={description:`Event handler for the "${X.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return Z}function XC($){let Z={};for(let X of $)Z[X]={oneOf:[{type:"string"},{type:"number"}]};return Z}async function QC(){let{tagExamples:$,cssProps:Z,eventHandlers:X}=await eP();return{$defs:{DefsMap:$3,TypeDefEntry:Z3,StateMap:eV,StateEntry:tV,TypedStateDef:TV,PureTypeDef:bV,FunctionDef:OV,ClassDef:Q3,ClassParameterDef:BQ,ClassFieldDef:FQ,ClassConstructorDef:LQ,ClassMethodDef:MQ,FormatDef:AQ,ProjectBlockDef:IQ,ServerBlockDef:NQ,ConnectorBlockDef:DQ,StudioHints:wQ,ExternalClassDef:SV,ExpressionPointer:kV,ExpressionLiteral:yV,ExpressionOperand:vV,UnaryOperator:gV,BinaryOperator:fV,ConditionalOperator:hV,SwitchOperator:uV,CallOperator:mV,PureMethod:dV,AssignmentOperator:lV,NoArgMethod:cV,OneArgMethod:pV,SpliceMethod:iV,ReduceMethod:nV,MapFilterMethod:rV,ExpressionNode:aV,ExpressionEntry:oV,Statement:RV,StatementList:PV,ElementDef:{...VQ,properties:{...VQ.properties,...ZC(X)}},ChildrenValue:FV,ArrayNamespace:BV,SwitchDef:NV,SwitchNode:DV,StyleObject:{...n5,properties:XC(Z)},AttributesObject:MV,PropsObject:AV,RefObject:KV,AnyRef:qV,InternalRef:QV,StateRef:JV,ExternalRef:GV,ExternalComponentRef:UV,GlobalRef:WV,ParentRef:YV,MapRef:zV,ElementPropertyValue:IV,StringOrRef:iH,BoolOrRef:nH,NumberOrRef:rH,CemParameter:tH,CemEvent:eH,TagName:{...cH,examples:[...$,"my-counter","todo-app","user-card"]},JsonSchemaType:ZV,HeadEntry:oH,ImageConfig:r5,PathsValue:{$id:J4,anyOf:[...r9,GQ],description:"Default $paths source union: the core shapes, plus a catch-all for source shapes contributed by extensions this schema cannot see. The project's generated document.schema.json replaces this with the exact set its extensions provide."}},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of element definitions for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/ElementDef"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{$ref:J4,description:"Dynamic route source for a page: expands one page per entry at build time. One of the core shapes (explicit `values`, a `$ref` data file, or a bare array of parameter objects) or a source shape contributed by an enabled extension, such as the parser's `contentType`."},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function JC(){return{$defs:{ImageConfig:r5,StyleObject:n5},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",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 are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:TQ.properties,title:"Jx Project",type:"object"}}function GC(){return{$defs:{ImageConfig:r5,JxFieldSchema:BH,RelationshipRef:FH,StyleObject:n5},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:TQ.properties,title:"Jx Project Core",type:"object"}}function WC(){return{$id:n9,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function YC(){return{$id:J4,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...r9,GQ],description:"Default $paths-value union for documents: the core source shapes. Per-project entry documents override this resource with those members PLUS every extension-contributed paths shape.",title:"Jx Document Paths Union"}}function zC(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...G3}}function jQ(){return{$defs:{ClassConstructorDef:LQ,ClassFieldDef:FQ,ClassMethodDef:MQ,ClassParameterDef:BQ,ConnectorBlockDef:DQ,FormatDef:AQ,ProjectBlockDef:IQ,ServerBlockDef:NQ,StudioHints:wQ},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. 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.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',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"},{additionalProperties:!1,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.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function qC(){let{mkdirSync:$,writeFileSync:Z}=await import("node:fs"),{resolve:X,dirname:Q}=await import("node:path"),J=Q(X(process.argv[1],"..")),G=await QC(),W=JC(),Y=jQ(),z=GC(),q=zC(),H=WC(),B=YC(),F=JSON.stringify(G,null,2),L=JSON.stringify(W,null,2),w=JSON.stringify(Y,null,2),N=JSON.stringify(z,null,2),I=JSON.stringify(q,null,2),T=JSON.stringify(H,null,2),E=JSON.stringify(B,null,2),[P]=process.argv.slice(2);if(P)Z(P,F,"utf8"),console.error(`Jx component schema written to ${P}`);else{Z(X(J,"schema.json"),F,"utf8"),Z(X(J,"project-schema.json"),L,"utf8"),Z(X(J,"class-schema.json"),w,"utf8"),$(X(J,"schemas"),{recursive:!0}),Z(X(J,"schemas","project.core.schema.json"),N,"utf8"),Z(X(J,"schemas","project.fields.schema.json"),T,"utf8"),Z(X(J,"schemas","document.paths.schema.json"),E,"utf8"),Z(X(J,"extension-manifest.schema.json"),I,"utf8");let R=Bun.spawnSync(["bunx","oxfmt",X(J,"schemas","project.core.schema.json"),X(J,"schemas","project.fields.schema.json"),X(J,"schemas","document.paths.schema.json")],{cwd:J});if(R.exitCode!==0){let C=R.stderr.toString()||R.stdout.toString()||`exit ${R.exitCode??"null"}${R.signalCode?`, signal ${R.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${C})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var K3,U3,H3,q3=null,gi;var V3=s(()=>{pH();aH();sH();$V();XV();HV();VV();LV();wV();jV();EV();CV();_V();xV();sV();X3();J3();W3();l5();Y3();z3();K3=F$(xH(),1),U3=F$(vH(),1),H3=F$(lH(),1);gi=process.argv[1]?.endsWith("schema.ts")?qC():void 0});var e9=b((L3)=>{Object.defineProperty(L3,"__esModule",{value:!0});L3.regexpCode=L3.getEsmExportName=L3.getProperty=L3.safeStringify=L3.stringify=L3.strConcat=L3.addCodeArg=L3.str=L3._=L3.nil=L3._Code=L3.Name=L3.IDENTIFIER=L3._CodeOrName=void 0;class a5{}L3._CodeOrName=a5;L3.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class p4 extends a5{constructor($){super();if(!L3.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}L3.Name=p4;class U1 extends a5{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((Z,X)=>`${Z}${X}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((Z,X)=>{if(X instanceof p4)Z[X.str]=(Z[X.str]||0)+1;return Z},{})}}L3._Code=U1;L3.nil=new U1("");function B3($,...Z){let X=[$[0]],Q=0;while(Q<Z.length)EQ(X,Z[Q]),X.push($[++Q]);return new U1(X)}L3._=B3;var OQ=new U1("+");function F3($,...Z){let X=[t9($[0])],Q=0;while(Q<Z.length)X.push(OQ),EQ(X,Z[Q]),X.push(OQ,t9($[++Q]));return KC(X),new U1(X)}L3.str=F3;function EQ($,Z){if(Z instanceof U1)$.push(...Z._items);else if(Z instanceof p4)$.push(Z);else $.push(VC(Z))}L3.addCodeArg=EQ;function KC($){let Z=1;while(Z<$.length-1){if($[Z]===OQ){let X=UC($[Z-1],$[Z+1]);if(X!==void 0){$.splice(Z-1,3,X);continue}$[Z++]="+"}Z++}}function UC($,Z){if(Z==='""')return $;if($==='""')return Z;if(typeof $=="string"){if(Z instanceof p4||$[$.length-1]!=='"')return;if(typeof Z!="string")return`${$.slice(0,-1)}${Z}"`;if(Z[0]==='"')return $.slice(0,-1)+Z.slice(1);return}if(typeof Z=="string"&&Z[0]==='"'&&!($ instanceof p4))return`"${$}${Z.slice(1)}`;return}function HC($,Z){return Z.emptyStr()?$:$.emptyStr()?Z:F3`${$}${Z}`}L3.strConcat=HC;function VC($){return typeof $=="number"||typeof $=="boolean"||$===null?$:t9(Array.isArray($)?$.join(","):$)}function BC($){return new U1(t9($))}L3.stringify=BC;function t9($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}L3.safeStringify=t9;function FC($){return typeof $=="string"&&L3.IDENTIFIER.test($)?new U1(`.${$}`):B3`[${$}]`}L3.getProperty=FC;function LC($){if(typeof $=="string"&&L3.IDENTIFIER.test($))return new U1(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}L3.getEsmExportName=LC;function MC($){return new U1($.toString())}L3.regexpCode=MC});var SQ=b((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});N3.ValueScope=N3.ValueScopeName=N3.Scope=N3.varKinds=N3.UsedValueState=void 0;var x$=e9();class A3 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var s5;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(s5||(N3.UsedValueState=s5={}));N3.varKinds={const:new x$.Name("const"),let:new x$.Name("let"),var:new x$.Name("var")};class PQ{constructor({prefixes:$,parent:Z}={}){this._names={},this._prefixes=$,this._parent=Z}toName($){return $ instanceof x$.Name?$:this.name($)}name($){return new x$.Name(this._newName($))}_newName($){let Z=this._names[$]||this._nameGroup($);return`${$}${Z.index++}`}_nameGroup($){var Z,X;if(((X=(Z=this._parent)===null||Z===void 0?void 0:Z._prefixes)===null||X===void 0?void 0:X.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}N3.Scope=PQ;class CQ extends x$.Name{constructor($,Z){super(Z);this.prefix=$}setValue($,{property:Z,itemIndex:X}){this.value=$,this.scopePath=x$._`.${new x$.Name(Z)}[${X}]`}}N3.ValueScopeName=CQ;var SC=x$._`\n`;class I3 extends PQ{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?SC:x$.nil}}get(){return this._scope}name($){return new CQ($,this._newName($))}value($,Z){var X;if(Z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:J}=Q,G=(X=Z.key)!==null&&X!==void 0?X:Z.ref,W=this._values[J];if(W){let q=W.get(G);if(q)return q}else W=this._values[J]=new Map;W.set(G,Q);let Y=this._scope[J]||(this._scope[J]=[]),z=Y.length;return Y[z]=Z.ref,Q.setValue(Z,{property:J,itemIndex:z}),Q}getValue($,Z){let X=this._values[$];if(!X)return;return X.get(Z)}scopeRefs($,Z=this._values){return this._reduceValues(Z,(X)=>{if(X.scopePath===void 0)throw Error(`CodeGen: name "${X}" has no value`);return x$._`${$}${X.scopePath}`})}scopeCode($=this._values,Z,X){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},Z,X)}_reduceValues($,Z,X={},Q){let J=x$.nil;for(let G in $){let W=$[G];if(!W)continue;let Y=X[G]=X[G]||new Map;W.forEach((z)=>{if(Y.has(z))return;Y.set(z,s5.Started);let q=Z(z);if(q){let H=this.opts.es5?N3.varKinds.var:N3.varKinds.const;J=x$._`${J}${H} ${z} = ${q};${this.opts._n}`}else if(q=Q===null||Q===void 0?void 0:Q(z))J=x$._`${J}${q}${this.opts._n}`;else throw new A3(z);Y.set(z,s5.Completed)})}return J}}N3.ValueScope=I3});var N0=b((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.or=k$.and=k$.not=k$.CodeGen=k$.operators=k$.varKinds=k$.ValueScopeName=k$.ValueScope=k$.Scope=k$.Name=k$.regexpCode=k$.stringify=k$.getProperty=k$.nil=k$.strConcat=k$.str=k$._=void 0;var C0=e9(),H1=SQ(),_6=e9();Object.defineProperty(k$,"_",{enumerable:!0,get:function(){return _6._}});Object.defineProperty(k$,"str",{enumerable:!0,get:function(){return _6.str}});Object.defineProperty(k$,"strConcat",{enumerable:!0,get:function(){return _6.strConcat}});Object.defineProperty(k$,"nil",{enumerable:!0,get:function(){return _6.nil}});Object.defineProperty(k$,"getProperty",{enumerable:!0,get:function(){return _6.getProperty}});Object.defineProperty(k$,"stringify",{enumerable:!0,get:function(){return _6.stringify}});Object.defineProperty(k$,"regexpCode",{enumerable:!0,get:function(){return _6.regexpCode}});Object.defineProperty(k$,"Name",{enumerable:!0,get:function(){return _6.Name}});var QZ=SQ();Object.defineProperty(k$,"Scope",{enumerable:!0,get:function(){return QZ.Scope}});Object.defineProperty(k$,"ValueScope",{enumerable:!0,get:function(){return QZ.ValueScope}});Object.defineProperty(k$,"ValueScopeName",{enumerable:!0,get:function(){return QZ.ValueScopeName}});Object.defineProperty(k$,"varKinds",{enumerable:!0,get:function(){return QZ.varKinds}});k$.operators={GT:new C0._Code(">"),GTE:new C0._Code(">="),LT:new C0._Code("<"),LTE:new C0._Code("<="),EQ:new C0._Code("==="),NEQ:new C0._Code("!=="),NOT:new C0._Code("!"),OR:new C0._Code("||"),AND:new C0._Code("&&"),ADD:new C0._Code("+")};class b6{optimizeNodes(){return this}optimizeNames($,Z){return this}}class w3 extends b6{constructor($,Z,X){super();this.varKind=$,this.name=Z,this.rhs=X}render({es5:$,_n:Z}){let X=$?H1.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${Q};`+Z}optimizeNames($,Z){if(!$[this.name.str])return;if(this.rhs)this.rhs=n4(this.rhs,$,Z);return this}get names(){return this.rhs instanceof C0._CodeOrName?this.rhs.names:{}}}class xQ extends b6{constructor($,Z,X){super();this.lhs=$,this.rhs=Z,this.sideEffects=X}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,Z){if(this.lhs instanceof C0.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=n4(this.rhs,$,Z),this}get names(){let $=this.lhs instanceof C0.Name?{}:{...this.lhs.names};return XZ($,this.rhs)}}class T3 extends xQ{constructor($,Z,X,Q){super($,X,Q);this.op=Z}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class j3 extends b6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class O3 extends b6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class E3 extends b6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class R3 extends b6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,Z){return this.code=n4(this.code,$,Z),this}get names(){return this.code instanceof C0._CodeOrName?this.code.names:{}}}class JZ extends b6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((Z,X)=>Z+X.render($),"")}optimizeNodes(){let{nodes:$}=this,Z=$.length;while(Z--){let X=$[Z].optimizeNodes();if(Array.isArray(X))$.splice(Z,1,...X);else if(X)$[Z]=X;else $.splice(Z,1)}return $.length>0?this:void 0}optimizeNames($,Z){let{nodes:X}=this,Q=X.length;while(Q--){let J=X[Q];if(J.optimizeNames($,Z))continue;kC($,J.names),X.splice(Q,1)}return X.length>0?this:void 0}get names(){return this.nodes.reduce(($,Z)=>W4($,Z.names),{})}}class x6 extends JZ{render($){return"{"+$._n+super.render($)+"}"+$._n}}class P3 extends JZ{}class $8 extends x6{}$8.kind="else";class J6 extends x6{constructor($,Z){super(Z);this.condition=$}render($){let Z=`if(${this.condition})`+super.render($);if(this.else)Z+="else "+this.else.render($);return Z}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let Z=this.else;if(Z){let X=Z.optimizeNodes();Z=this.else=Array.isArray(X)?new $8(X):X}if(Z){if($===!1)return Z instanceof J6?Z:Z.nodes;if(this.nodes.length)return this;return new J6(x3($),Z instanceof J6?[Z]:Z.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,Z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames($,Z),!(super.optimizeNames($,Z)||this.else))return;return this.condition=n4(this.condition,$,Z),this}get names(){let $=super.names;if(XZ($,this.condition),this.else)W4($,this.else.names);return $}}J6.kind="if";class i4 extends x6{}i4.kind="for";class C3 extends i4{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iteration=n4(this.iteration,$,Z),this}get names(){return W4(super.names,this.iteration.names)}}class S3 extends i4{constructor($,Z,X,Q){super();this.varKind=$,this.name=Z,this.from=X,this.to=Q}render($){let Z=$.es5?H1.varKinds.var:this.varKind,{name:X,from:Q,to:J}=this;return`for(${Z} ${X}=${Q}; ${X}<${J}; ${X}++)`+super.render($)}get names(){let $=XZ(super.names,this.from);return XZ($,this.to)}}class _Q extends i4{constructor($,Z,X,Q){super();this.loop=$,this.varKind=Z,this.name=X,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iterable=n4(this.iterable,$,Z),this}get names(){return W4(super.names,this.iterable.names)}}class t5 extends x6{constructor($,Z,X){super();this.name=$,this.args=Z,this.async=X}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}t5.kind="func";class e5 extends JZ{render($){return"return "+super.render($)}}e5.kind="return";class _3 extends x6{render($){let Z="try"+super.render($);if(this.catch)Z+=this.catch.render($);if(this.finally)Z+=this.finally.render($);return Z}optimizeNodes(){var $,Z;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(Z=this.finally)===null||Z===void 0||Z.optimizeNodes(),this}optimizeNames($,Z){var X,Q;return super.optimizeNames($,Z),(X=this.catch)===null||X===void 0||X.optimizeNames($,Z),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,Z),this}get names(){let $=super.names;if(this.catch)W4($,this.catch.names);if(this.finally)W4($,this.finally.names);return $}}class $Z extends x6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}$Z.kind="catch";class ZZ extends x6{render($){return"finally"+super.render($)}}ZZ.kind="finally";class b3{constructor($,Z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Z,_n:Z.lines?`
389
+ `:""},this._extScope=$,this._scope=new H1.Scope({parent:$}),this._nodes=[new P3]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,Z){let X=this._extScope.value($,Z);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue($,Z){return this._extScope.getValue($,Z)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,Z,X,Q){let J=this._scope.toName(Z);if(X!==void 0&&Q)this._constants[J.str]=X;return this._leafNode(new w3($,J,X)),J}const($,Z,X){return this._def(H1.varKinds.const,$,Z,X)}let($,Z,X){return this._def(H1.varKinds.let,$,Z,X)}var($,Z,X){return this._def(H1.varKinds.var,$,Z,X)}assign($,Z,X){return this._leafNode(new xQ($,Z,X))}add($,Z){return this._leafNode(new T3($,k$.operators.ADD,Z))}code($){if(typeof $=="function")$();else if($!==C0.nil)this._leafNode(new R3($));return this}object(...$){let Z=["{"];for(let[X,Q]of $){if(Z.length>1)Z.push(",");if(Z.push(X),X!==Q||this.opts.es5)Z.push(":"),(0,C0.addCodeArg)(Z,Q)}return Z.push("}"),new C0._Code(Z)}if($,Z,X){if(this._blockNode(new J6($)),Z&&X)this.code(Z).else().code(X).endIf();else if(Z)this.code(Z).endIf();else if(X)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new J6($))}else(){return this._elseNode(new $8)}endIf(){return this._endBlockNode(J6,$8)}_for($,Z){if(this._blockNode($),Z)this.code(Z).endFor();return this}for($,Z){return this._for(new C3($),Z)}forRange($,Z,X,Q,J=this.opts.es5?H1.varKinds.var:H1.varKinds.let){let G=this._scope.toName($);return this._for(new S3(J,G,Z,X),()=>Q(G))}forOf($,Z,X,Q=H1.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=Z instanceof C0.Name?Z:this.var("_arr",Z);return this.forRange("_i",0,C0._`${G}.length`,(W)=>{this.var(J,C0._`${G}[${W}]`),X(J)})}return this._for(new _Q("of",Q,J,Z),()=>X(J))}forIn($,Z,X,Q=this.opts.es5?H1.varKinds.var:H1.varKinds.const){if(this.opts.ownProperties)return this.forOf($,C0._`Object.keys(${Z})`,X);let J=this._scope.toName($);return this._for(new _Q("in",Q,J,Z),()=>X(J))}endFor(){return this._endBlockNode(i4)}label($){return this._leafNode(new j3($))}break($){return this._leafNode(new O3($))}return($){let Z=new e5;if(this._blockNode(Z),this.code($),Z.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(e5)}try($,Z,X){if(!Z&&!X)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new _3;if(this._blockNode(Q),this.code($),Z){let J=this.name("e");this._currNode=Q.catch=new $Z(J),Z(J)}if(X)this._currNode=Q.finally=new ZZ,this.code(X);return this._endBlockNode($Z,ZZ)}throw($){return this._leafNode(new E3($))}block($,Z){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(Z);return this}endBlock($){let Z=this._blockStarts.pop();if(Z===void 0)throw Error("CodeGen: not in self-balancing block");let X=this._nodes.length-Z;if(X<0||$!==void 0&&X!==$)throw Error(`CodeGen: wrong number of nodes: ${X} vs ${$} expected`);return this._nodes.length=Z,this}func($,Z=C0.nil,X,Q){if(this._blockNode(new t5($,Z,X)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(t5)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,Z){let X=this._currNode;if(X instanceof $||Z&&X instanceof Z)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Z?`${$.kind}/${Z.kind}`:$.kind}"`)}_elseNode($){let Z=this._currNode;if(!(Z instanceof J6))throw Error('CodeGen: "else" without "if"');return this._currNode=Z.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let Z=this._nodes;Z[Z.length-1]=$}}k$.CodeGen=b3;function W4($,Z){for(let X in Z)$[X]=($[X]||0)+(Z[X]||0);return $}function XZ($,Z){return Z instanceof C0._CodeOrName?W4($,Z.names):$}function n4($,Z,X){if($ instanceof C0.Name)return Q($);if(!J($))return $;return new C0._Code($._items.reduce((G,W)=>{if(W instanceof C0.Name)W=Q(W);if(W instanceof C0._Code)G.push(...W._items);else G.push(W);return G},[]));function Q(G){let W=X[G.str];if(W===void 0||Z[G.str]!==1)return G;return delete Z[G.str],W}function J(G){return G instanceof C0._Code&&G._items.some((W)=>W instanceof C0.Name&&Z[W.str]===1&&X[W.str]!==void 0)}}function kC($,Z){for(let X in Z)$[X]=($[X]||0)-(Z[X]||0)}function x3($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:C0._`!${bQ($)}`}k$.not=x3;var yC=k3(k$.operators.AND);function vC(...$){return $.reduce(yC)}k$.and=vC;var gC=k3(k$.operators.OR);function fC(...$){return $.reduce(gC)}k$.or=fC;function k3($){return(Z,X)=>Z===C0.nil?X:X===C0.nil?Z:C0._`${bQ(Z)} ${$} ${bQ(X)}`}function bQ($){return $ instanceof C0.Name?$:C0._`(${$})`}});var P0=b((l3)=>{Object.defineProperty(l3,"__esModule",{value:!0});l3.checkStrictMode=l3.getErrorPath=l3.Type=l3.useFunc=l3.setEvaluated=l3.evaluatedPropsToName=l3.mergeEvaluated=l3.eachItem=l3.unescapeJsonPointer=l3.escapeJsonPointer=l3.escapeFragment=l3.unescapeFragment=l3.schemaRefOrVal=l3.schemaHasRulesButRef=l3.schemaHasRules=l3.checkUnknownRules=l3.alwaysValidSchema=l3.toHash=void 0;var y0=N0(),dC=e9();function lC($){let Z={};for(let X of $)Z[X]=!0;return Z}l3.toHash=lC;function cC($,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return f3($,Z),!h3(Z,$.self.RULES.all)}l3.alwaysValidSchema=cC;function f3($,Z=$.schema){let{opts:X,self:Q}=$;if(!X.strictSchema)return;if(typeof Z==="boolean")return;let J=Q.RULES.keywords;for(let G in Z)if(!J[G])d3($,`unknown keyword: "${G}"`)}l3.checkUnknownRules=f3;function h3($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(Z[X])return!0;return!1}l3.schemaHasRules=h3;function pC($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(X!=="$ref"&&Z.all[X])return!0;return!1}l3.schemaHasRulesButRef=pC;function iC({topSchemaRef:$,schemaPath:Z},X,Q,J){if(!J){if(typeof X=="number"||typeof X=="boolean")return X;if(typeof X=="string")return y0._`${X}`}return y0._`${$}${Z}${(0,y0.getProperty)(Q)}`}l3.schemaRefOrVal=iC;function nC($){return u3(decodeURIComponent($))}l3.unescapeFragment=nC;function rC($){return encodeURIComponent(yQ($))}l3.escapeFragment=rC;function yQ($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}l3.escapeJsonPointer=yQ;function u3($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}l3.unescapeJsonPointer=u3;function aC($,Z){if(Array.isArray($))for(let X of $)Z(X);else Z($)}l3.eachItem=aC;function v3({mergeNames:$,mergeToName:Z,mergeValues:X,resultToName:Q}){return(J,G,W,Y)=>{let z=W===void 0?G:W instanceof y0.Name?(G instanceof y0.Name?$(J,G,W):Z(J,G,W),W):G instanceof y0.Name?(Z(J,W,G),G):X(G,W);return Y===y0.Name&&!(z instanceof y0.Name)?Q(J,z):z}}l3.mergeEvaluated={props:v3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>{$.if(y0._`${Z} === true`,()=>$.assign(X,!0),()=>$.assign(X,y0._`${X} || {}`).code(y0._`Object.assign(${X}, ${Z})`))}),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>{if(Z===!0)$.assign(X,!0);else $.assign(X,y0._`${X} || {}`),vQ($,X,Z)}),mergeValues:($,Z)=>$===!0?!0:{...$,...Z},resultToName:m3}),items:v3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>$.assign(X,y0._`${Z} === true ? true : ${X} > ${Z} ? ${X} : ${Z}`)),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>$.assign(X,Z===!0?!0:y0._`${X} > ${Z} ? ${X} : ${Z}`)),mergeValues:($,Z)=>$===!0?!0:Math.max($,Z),resultToName:($,Z)=>$.var("items",Z)})};function m3($,Z){if(Z===!0)return $.var("props",!0);let X=$.var("props",y0._`{}`);if(Z!==void 0)vQ($,X,Z);return X}l3.evaluatedPropsToName=m3;function vQ($,Z,X){Object.keys(X).forEach((Q)=>$.assign(y0._`${Z}${(0,y0.getProperty)(Q)}`,!0))}l3.setEvaluated=vQ;var g3={};function oC($,Z){return $.scopeValue("func",{ref:Z,code:g3[Z.code]||(g3[Z.code]=new dC._Code(Z.code))})}l3.useFunc=oC;var kQ;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(kQ||(l3.Type=kQ={}));function sC($,Z,X){if($ instanceof y0.Name){let Q=Z===kQ.Num;return X?Q?y0._`"[" + ${$} + "]"`:y0._`"['" + ${$} + "']"`:Q?y0._`"/" + ${$}`:y0._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return X?(0,y0.getProperty)($).toString():"/"+yQ($)}l3.getErrorPath=sC;function d3($,Z,X=$.opts.strictSchema){if(!X)return;if(Z=`strict mode: ${Z}`,X===!0)throw Error(Z);$.self.logger.warn(Z)}l3.checkStrictMode=d3});var J1=b((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var V$=N0(),FS={data:new V$.Name("data"),valCxt:new V$.Name("valCxt"),instancePath:new V$.Name("instancePath"),parentData:new V$.Name("parentData"),parentDataProperty:new V$.Name("parentDataProperty"),rootData:new V$.Name("rootData"),dynamicAnchors:new V$.Name("dynamicAnchors"),vErrors:new V$.Name("vErrors"),errors:new V$.Name("errors"),this:new V$.Name("this"),self:new V$.Name("self"),scope:new V$.Name("scope"),json:new V$.Name("json"),jsonPos:new V$.Name("jsonPos"),jsonLen:new V$.Name("jsonLen"),jsonPart:new V$.Name("jsonPart")};p3.default=FS});var Z8=b((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});a3.extendErrors=a3.resetErrorsCount=a3.reportExtraError=a3.reportError=a3.keyword$DataError=a3.keywordError=void 0;var S0=N0(),WZ=P0(),T$=J1();a3.keywordError={message:({keyword:$})=>S0.str`must pass "${$}" keyword validation`};a3.keyword$DataError={message:({keyword:$,schemaType:Z})=>Z?S0.str`"${$}" keyword must be ${Z} ($data)`:S0.str`"${$}" keyword is invalid ($data)`};function MS($,Z=a3.keywordError,X,Q){let{it:J}=$,{gen:G,compositeRule:W,allErrors:Y}=J,z=r3($,Z,X);if(Q!==null&&Q!==void 0?Q:W||Y)i3(G,z);else n3(J,S0._`[${z}]`)}a3.reportError=MS;function AS($,Z=a3.keywordError,X){let{it:Q}=$,{gen:J,compositeRule:G,allErrors:W}=Q,Y=r3($,Z,X);if(i3(J,Y),!(G||W))n3(Q,T$.default.vErrors)}a3.reportExtraError=AS;function IS($,Z){$.assign(T$.default.errors,Z),$.if(S0._`${T$.default.vErrors} !== null`,()=>$.if(Z,()=>$.assign(S0._`${T$.default.vErrors}.length`,Z),()=>$.assign(T$.default.vErrors,null)))}a3.resetErrorsCount=IS;function NS({gen:$,keyword:Z,schemaValue:X,data:Q,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",J,T$.default.errors,(Y)=>{if($.const(W,S0._`${T$.default.vErrors}[${Y}]`),$.if(S0._`${W}.instancePath === undefined`,()=>$.assign(S0._`${W}.instancePath`,(0,S0.strConcat)(T$.default.instancePath,G.errorPath))),$.assign(S0._`${W}.schemaPath`,S0.str`${G.errSchemaPath}/${Z}`),G.opts.verbose)$.assign(S0._`${W}.schema`,X),$.assign(S0._`${W}.data`,Q)})}a3.extendErrors=NS;function i3($,Z){let X=$.const("err",Z);$.if(S0._`${T$.default.vErrors} === null`,()=>$.assign(T$.default.vErrors,S0._`[${X}]`),S0._`${T$.default.vErrors}.push(${X})`),$.code(S0._`${T$.default.errors}++`)}function n3($,Z){let{gen:X,validateName:Q,schemaEnv:J}=$;if(J.$async)X.throw(S0._`new ${$.ValidationError}(${Z})`);else X.assign(S0._`${Q}.errors`,Z),X.return(!1)}var Y4={keyword:new S0.Name("keyword"),schemaPath:new S0.Name("schemaPath"),params:new S0.Name("params"),propertyName:new S0.Name("propertyName"),message:new S0.Name("message"),schema:new S0.Name("schema"),parentSchema:new S0.Name("parentSchema")};function r3($,Z,X){let{createErrors:Q}=$.it;if(Q===!1)return S0._`{}`;return DS($,Z,X)}function DS($,Z,X={}){let{gen:Q,it:J}=$,G=[wS(J,X),TS($,X)];return jS($,Z,G),Q.object(...G)}function wS({errorPath:$},{instancePath:Z}){let X=Z?S0.str`${$}${(0,WZ.getErrorPath)(Z,WZ.Type.Str)}`:$;return[T$.default.instancePath,(0,S0.strConcat)(T$.default.instancePath,X)]}function TS({keyword:$,it:{errSchemaPath:Z}},{schemaPath:X,parentSchema:Q}){let J=Q?Z:S0.str`${Z}/${$}`;if(X)J=S0.str`${J}${(0,WZ.getErrorPath)(X,WZ.Type.Str)}`;return[Y4.schemaPath,J]}function jS($,{params:Z,message:X},Q){let{keyword:J,data:G,schemaValue:W,it:Y}=$,{opts:z,propertyName:q,topSchemaRef:H,schemaPath:B}=Y;if(Q.push([Y4.keyword,J],[Y4.params,typeof Z=="function"?Z($):Z||S0._`{}`]),z.messages)Q.push([Y4.message,typeof X=="function"?X($):X]);if(z.verbose)Q.push([Y4.schema,W],[Y4.parentSchema,S0._`${H}${B}`],[T$.default.data,G]);if(q)Q.push([Y4.propertyName,q])}});var $B=b((t3)=>{Object.defineProperty(t3,"__esModule",{value:!0});t3.boolOrEmptySchema=t3.topBoolOrEmptySchema=void 0;var CS=Z8(),SS=N0(),_S=J1(),bS={message:"boolean schema is false"};function xS($){let{gen:Z,schema:X,validateName:Q}=$;if(X===!1)s3($,!1);else if(typeof X=="object"&&X.$async===!0)Z.return(_S.default.data);else Z.assign(SS._`${Q}.errors`,null),Z.return(!0)}t3.topBoolOrEmptySchema=xS;function kS($,Z){let{gen:X,schema:Q}=$;if(Q===!1)X.var(Z,!1),s3($);else X.var(Z,!0)}t3.boolOrEmptySchema=kS;function s3($,Z){let{gen:X,data:Q}=$,J={gen:X,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,CS.reportError)(J,bS,void 0,Z)}});var fQ=b((ZB)=>{Object.defineProperty(ZB,"__esModule",{value:!0});ZB.getRules=ZB.isJSONType=void 0;var vS=["string","number","integer","boolean","null","object","array"],gS=new Set(vS);function fS($){return typeof $=="string"&&gS.has($)}ZB.isJSONType=fS;function hS(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}ZB.getRules=hS});var hQ=b((GB)=>{Object.defineProperty(GB,"__esModule",{value:!0});GB.shouldUseRule=GB.shouldUseGroup=GB.schemaHasRulesForType=void 0;function mS({schema:$,self:Z},X){let Q=Z.RULES.types[X];return Q&&Q!==!0&&QB($,Q)}GB.schemaHasRulesForType=mS;function QB($,Z){return Z.rules.some((X)=>JB($,X))}GB.shouldUseGroup=QB;function JB($,Z){var X;return $[Z.keyword]!==void 0||((X=Z.definition.implements)===null||X===void 0?void 0:X.some((Q)=>$[Q]!==void 0))}GB.shouldUseRule=JB});var X8=b((KB)=>{Object.defineProperty(KB,"__esModule",{value:!0});KB.reportTypeError=KB.checkDataTypes=KB.checkDataType=KB.coerceAndCheckDataType=KB.getJSONTypes=KB.getSchemaTypes=KB.DataType=void 0;var cS=fQ(),pS=hQ(),iS=Z8(),E0=N0(),YB=P0(),r4;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(r4||(KB.DataType=r4={}));function nS($){let Z=zB($.type);if(Z.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!Z.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)Z.push("null")}return Z}KB.getSchemaTypes=nS;function zB($){let Z=Array.isArray($)?$:$?[$]:[];if(Z.every(cS.isJSONType))return Z;throw Error("type must be JSONType or JSONType[]: "+Z.join(","))}KB.getJSONTypes=zB;function rS($,Z){let{gen:X,data:Q,opts:J}=$,G=aS(Z,J.coerceTypes),W=Z.length>0&&!(G.length===0&&Z.length===1&&(0,pS.schemaHasRulesForType)($,Z[0]));if(W){let Y=mQ(Z,Q,J.strictNumbers,r4.Wrong);X.if(Y,()=>{if(G.length)oS($,Z,G);else dQ($)})}return W}KB.coerceAndCheckDataType=rS;var qB=new Set(["string","number","integer","boolean","null"]);function aS($,Z){return Z?$.filter((X)=>qB.has(X)||Z==="array"&&X==="array"):[]}function oS($,Z,X){let{gen:Q,data:J,opts:G}=$,W=Q.let("dataType",E0._`typeof ${J}`),Y=Q.let("coerced",E0._`undefined`);if(G.coerceTypes==="array")Q.if(E0._`${W} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Q.assign(J,E0._`${J}[0]`).assign(W,E0._`typeof ${J}`).if(mQ(Z,J,G.strictNumbers),()=>Q.assign(Y,J)));Q.if(E0._`${Y} !== undefined`);for(let q of X)if(qB.has(q)||q==="array"&&G.coerceTypes==="array")z(q);Q.else(),dQ($),Q.endIf(),Q.if(E0._`${Y} !== undefined`,()=>{Q.assign(J,Y),sS($,Y)});function z(q){switch(q){case"string":Q.elseIf(E0._`${W} == "number" || ${W} == "boolean"`).assign(Y,E0._`"" + ${J}`).elseIf(E0._`${J} === null`).assign(Y,E0._`""`);return;case"number":Q.elseIf(E0._`${W} == "boolean" || ${J} === null
390
+ || (${W} == "string" && ${J} && ${J} == +${J})`).assign(Y,E0._`+${J}`);return;case"integer":Q.elseIf(E0._`${W} === "boolean" || ${J} === null
391
+ || (${W} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(Y,E0._`+${J}`);return;case"boolean":Q.elseIf(E0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(Y,!1).elseIf(E0._`${J} === "true" || ${J} === 1`).assign(Y,!0);return;case"null":Q.elseIf(E0._`${J} === "" || ${J} === 0 || ${J} === false`),Q.assign(Y,null);return;case"array":Q.elseIf(E0._`${W} === "string" || ${W} === "number"
392
+ || ${W} === "boolean" || ${J} === null`).assign(Y,E0._`[${J}]`)}}}function sS({gen:$,parentData:Z,parentDataProperty:X},Q){$.if(E0._`${Z} !== undefined`,()=>$.assign(E0._`${Z}[${X}]`,Q))}function uQ($,Z,X,Q=r4.Correct){let J=Q===r4.Correct?E0.operators.EQ:E0.operators.NEQ,G;switch($){case"null":return E0._`${Z} ${J} null`;case"array":G=E0._`Array.isArray(${Z})`;break;case"object":G=E0._`${Z} && typeof ${Z} == "object" && !Array.isArray(${Z})`;break;case"integer":G=W(E0._`!(${Z} % 1) && !isNaN(${Z})`);break;case"number":G=W();break;default:return E0._`typeof ${Z} ${J} ${$}`}return Q===r4.Correct?G:(0,E0.not)(G);function W(Y=E0.nil){return(0,E0.and)(E0._`typeof ${Z} == "number"`,Y,X?E0._`isFinite(${Z})`:E0.nil)}}KB.checkDataType=uQ;function mQ($,Z,X,Q){if($.length===1)return uQ($[0],Z,X,Q);let J,G=(0,YB.toHash)($);if(G.array&&G.object){let W=E0._`typeof ${Z} != "object"`;J=G.null?W:E0._`!${Z} || ${W}`,delete G.null,delete G.array,delete G.object}else J=E0.nil;if(G.number)delete G.integer;for(let W in G)J=(0,E0.and)(J,uQ(W,Z,X,Q));return J}KB.checkDataTypes=mQ;var tS={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:Z})=>typeof $=="string"?E0._`{type: ${$}}`:E0._`{type: ${Z}}`};function dQ($){let Z=eS($);(0,iS.reportError)(Z,tS)}KB.reportTypeError=dQ;function eS($){let{gen:Z,data:X,schema:Q}=$,J=(0,YB.schemaRefOrVal)($,Q,"type");return{gen:Z,keyword:"type",data:X,schema:Q.type,schemaCode:J,schemaValue:J,parentSchema:Q,params:{},it:$}}});var FB=b((VB)=>{Object.defineProperty(VB,"__esModule",{value:!0});VB.assignDefaults=void 0;var a4=N0(),W_=P0();function Y_($,Z){let{properties:X,items:Q}=$.schema;if(Z==="object"&&X)for(let J in X)HB($,J,X[J].default);else if(Z==="array"&&Array.isArray(Q))Q.forEach((J,G)=>HB($,G,J.default))}VB.assignDefaults=Y_;function HB($,Z,X){let{gen:Q,compositeRule:J,data:G,opts:W}=$;if(X===void 0)return;let Y=a4._`${G}${(0,a4.getProperty)(Z)}`;if(J){(0,W_.checkStrictMode)($,`default is ignored for: ${Y}`);return}let z=a4._`${Y} === undefined`;if(W.useDefaults==="empty")z=a4._`${z} || ${Y} === null || ${Y} === ""`;Q.if(z,a4._`${Y} = ${(0,a4.stringify)(X)}`)}});var G1=b((AB)=>{Object.defineProperty(AB,"__esModule",{value:!0});AB.validateUnion=AB.validateArray=AB.usePattern=AB.callValidateCode=AB.schemaProperties=AB.allSchemaProperties=AB.noPropertyInData=AB.propertyInData=AB.isOwnProperty=AB.hasPropFunc=AB.reportMissingProp=AB.checkMissingProp=AB.checkReportMissingProp=void 0;var h0=N0(),lQ=P0(),k6=J1(),z_=P0();function q_($,Z){let{gen:X,data:Q,it:J}=$;X.if(pQ(X,Q,Z,J.opts.ownProperties),()=>{$.setParams({missingProperty:h0._`${Z}`},!0),$.error()})}AB.checkReportMissingProp=q_;function K_({gen:$,data:Z,it:{opts:X}},Q,J){return(0,h0.or)(...Q.map((G)=>(0,h0.and)(pQ($,Z,G,X.ownProperties),h0._`${J} = ${G}`)))}AB.checkMissingProp=K_;function U_($,Z){$.setParams({missingProperty:Z},!0),$.error()}AB.reportMissingProp=U_;function LB($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h0._`Object.prototype.hasOwnProperty`})}AB.hasPropFunc=LB;function cQ($,Z,X){return h0._`${LB($)}.call(${Z}, ${X})`}AB.isOwnProperty=cQ;function H_($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} !== undefined`;return Q?h0._`${J} && ${cQ($,Z,X)}`:J}AB.propertyInData=H_;function pQ($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} === undefined`;return Q?(0,h0.or)(J,(0,h0.not)(cQ($,Z,X))):J}AB.noPropertyInData=pQ;function MB($){return $?Object.keys($).filter((Z)=>Z!=="__proto__"):[]}AB.allSchemaProperties=MB;function V_($,Z){return MB(Z).filter((X)=>!(0,lQ.alwaysValidSchema)($,Z[X]))}AB.schemaProperties=V_;function B_({schemaCode:$,data:Z,it:{gen:X,topSchemaRef:Q,schemaPath:J,errorPath:G},it:W},Y,z,q){let H=q?h0._`${$}, ${Z}, ${Q}${J}`:Z,B=[[k6.default.instancePath,(0,h0.strConcat)(k6.default.instancePath,G)],[k6.default.parentData,W.parentData],[k6.default.parentDataProperty,W.parentDataProperty],[k6.default.rootData,k6.default.rootData]];if(W.opts.dynamicRef)B.push([k6.default.dynamicAnchors,k6.default.dynamicAnchors]);let F=h0._`${H}, ${X.object(...B)}`;return z!==h0.nil?h0._`${Y}.call(${z}, ${F})`:h0._`${Y}(${F})`}AB.callValidateCode=B_;var F_=h0._`new RegExp`;function L_({gen:$,it:{opts:Z}},X){let Q=Z.unicodeRegExp?"u":"",{regExp:J}=Z.code,G=J(X,Q);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:h0._`${J.code==="new RegExp"?F_:(0,z_.useFunc)($,J)}(${X}, ${Q})`})}AB.usePattern=L_;function M_($){let{gen:Z,data:X,keyword:Q,it:J}=$,G=Z.name("valid");if(J.allErrors){let Y=Z.let("valid",!0);return W(()=>Z.assign(Y,!1)),Y}return Z.var(G,!0),W(()=>Z.break()),G;function W(Y){let z=Z.const("len",h0._`${X}.length`);Z.forRange("i",0,z,(q)=>{$.subschema({keyword:Q,dataProp:q,dataPropType:lQ.Type.Num},G),Z.if((0,h0.not)(G),Y)})}}AB.validateArray=M_;function A_($){let{gen:Z,schema:X,keyword:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(X.some((z)=>(0,lQ.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let W=Z.let("valid",!1),Y=Z.name("_valid");Z.block(()=>X.forEach((z,q)=>{let H=$.subschema({keyword:Q,schemaProp:q,compositeRule:!0},Y);if(Z.assign(W,h0._`${W} || ${Y}`),!$.mergeValidEvaluated(H,Y))Z.if((0,h0.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}AB.validateUnion=A_});var jB=b((wB)=>{Object.defineProperty(wB,"__esModule",{value:!0});wB.validateKeywordUsage=wB.validSchemaType=wB.funcKeywordCode=wB.macroKeywordCode=void 0;var j$=N0(),z4=J1(),__=G1(),b_=Z8();function x_($,Z){let{gen:X,keyword:Q,schema:J,parentSchema:G,it:W}=$,Y=Z.macro.call(W.self,J,G,W),z=DB(X,Q,Y);if(W.opts.validateSchema!==!1)W.self.validateSchema(Y,!0);let q=X.name("valid");$.subschema({schema:Y,schemaPath:j$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:z,compositeRule:!0},q),$.pass(q,()=>$.error(!0))}wB.macroKeywordCode=x_;function k_($,Z){var X;let{gen:Q,keyword:J,schema:G,parentSchema:W,$data:Y,it:z}=$;v_(z,Z);let q=!Y&&Z.compile?Z.compile.call(z.self,G,W,z):Z.validate,H=DB(Q,J,q),B=Q.let("valid");$.block$data(B,F),$.ok((X=Z.valid)!==null&&X!==void 0?X:B);function F(){if(Z.errors===!1){if(N(),Z.modifying)NB($);I(()=>$.error())}else{let T=Z.async?L():w();if(Z.modifying)NB($);I(()=>y_($,T))}}function L(){let T=Q.let("ruleErrs",null);return Q.try(()=>N(j$._`await `),(E)=>Q.assign(B,!1).if(j$._`${E} instanceof ${z.ValidationError}`,()=>Q.assign(T,j$._`${E}.errors`),()=>Q.throw(E))),T}function w(){let T=j$._`${H}.errors`;return Q.assign(T,null),N(j$.nil),T}function N(T=Z.async?j$._`await `:j$.nil){let E=z.opts.passContext?z4.default.this:z4.default.self,P=!(("compile"in Z)&&!Y||Z.schema===!1);Q.assign(B,j$._`${T}${(0,__.callValidateCode)($,H,E,P)}`,Z.modifying)}function I(T){var E;Q.if((0,j$.not)((E=Z.valid)!==null&&E!==void 0?E:B),T)}}wB.funcKeywordCode=k_;function NB($){let{gen:Z,data:X,it:Q}=$;Z.if(Q.parentData,()=>Z.assign(X,j$._`${Q.parentData}[${Q.parentDataProperty}]`))}function y_($,Z){let{gen:X}=$;X.if(j$._`Array.isArray(${Z})`,()=>{X.assign(z4.default.vErrors,j$._`${z4.default.vErrors} === null ? ${Z} : ${z4.default.vErrors}.concat(${Z})`).assign(z4.default.errors,j$._`${z4.default.vErrors}.length`),(0,b_.extendErrors)($)},()=>$.error())}function v_({schemaEnv:$},Z){if(Z.async&&!$.$async)throw Error("async keyword in sync schema")}function DB($,Z,X){if(X===void 0)throw Error(`keyword "${Z}" failed to compile`);return $.scopeValue("keyword",typeof X=="function"?{ref:X}:{ref:X,code:(0,j$.stringify)(X)})}function g_($,Z,X=!1){return!Z.length||Z.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||X&&typeof $>"u")}wB.validSchemaType=g_;function f_({schema:$,opts:Z,self:X,errSchemaPath:Q},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let W=J.dependencies;if(W===null||W===void 0?void 0:W.some((Y)=>!Object.prototype.hasOwnProperty.call($,Y)))throw Error(`parent schema must have dependencies of ${G}: ${W.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Q}": `+X.errorsText(J.validateSchema.errors);if(Z.validateSchema==="log")X.logger.error(z);else throw Error(z)}}}wB.validateKeywordUsage=f_});var PB=b((EB)=>{Object.defineProperty(EB,"__esModule",{value:!0});EB.extendSubschemaMode=EB.extendSubschemaData=EB.getSubschema=void 0;var g1=N0(),OB=P0();function d_($,{keyword:Z,schemaProp:X,schema:Q,schemaPath:J,errSchemaPath:G,topSchemaRef:W}){if(Z!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(Z!==void 0){let Y=$.schema[Z];return X===void 0?{schema:Y,schemaPath:g1._`${$.schemaPath}${(0,g1.getProperty)(Z)}`,errSchemaPath:`${$.errSchemaPath}/${Z}`}:{schema:Y[X],schemaPath:g1._`${$.schemaPath}${(0,g1.getProperty)(Z)}${(0,g1.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${Z}/${(0,OB.escapeFragment)(X)}`}}if(Q!==void 0){if(J===void 0||G===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:J,topSchemaRef:W,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}EB.getSubschema=d_;function l_($,Z,{dataProp:X,dataPropType:Q,data:J,dataTypes:G,propertyName:W}){if(J!==void 0&&X!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=Z;if(X!==void 0){let{errorPath:q,dataPathArr:H,opts:B}=Z,F=Y.let("data",g1._`${Z.data}${(0,g1.getProperty)(X)}`,!0);z(F),$.errorPath=g1.str`${q}${(0,OB.getErrorPath)(X,Q,B.jsPropertySyntax)}`,$.parentDataProperty=g1._`${X}`,$.dataPathArr=[...H,$.parentDataProperty]}if(J!==void 0){let q=J instanceof g1.Name?J:Y.let("data",J,!0);if(z(q),W!==void 0)$.propertyName=W}if(G)$.dataTypes=G;function z(q){$.data=q,$.dataLevel=Z.dataLevel+1,$.dataTypes=[],Z.definedProperties=new Set,$.parentData=Z.data,$.dataNames=[...Z.dataNames,q]}}EB.extendSubschemaData=l_;function c_($,{jtdDiscriminator:Z,jtdMetadata:X,compositeRule:Q,createErrors:J,allErrors:G}){if(Q!==void 0)$.compositeRule=Q;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=Z,$.jtdMetadata=X}EB.extendSubschemaMode=c_});var iQ=b((Un,CB)=>{CB.exports=function $(Z,X){if(Z===X)return!0;if(Z&&X&&typeof Z=="object"&&typeof X=="object"){if(Z.constructor!==X.constructor)return!1;var Q,J,G;if(Array.isArray(Z)){if(Q=Z.length,Q!=X.length)return!1;for(J=Q;J--!==0;)if(!$(Z[J],X[J]))return!1;return!0}if(Z.constructor===RegExp)return Z.source===X.source&&Z.flags===X.flags;if(Z.valueOf!==Object.prototype.valueOf)return Z.valueOf()===X.valueOf();if(Z.toString!==Object.prototype.toString)return Z.toString()===X.toString();if(G=Object.keys(Z),Q=G.length,Q!==Object.keys(X).length)return!1;for(J=Q;J--!==0;)if(!Object.prototype.hasOwnProperty.call(X,G[J]))return!1;for(J=Q;J--!==0;){var W=G[J];if(!$(Z[W],X[W]))return!1}return!0}return Z!==Z&&X!==X}});var _B=b((Hn,SB)=>{var y6=SB.exports=function($,Z,X){if(typeof Z=="function")X=Z,Z={};X=Z.cb||X;var Q=typeof X=="function"?X:X.pre||function(){},J=X.post||function(){};YZ(Z,Q,J,$,"",$)};y6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};y6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};y6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};y6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function YZ($,Z,X,Q,J,G,W,Y,z,q){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Z(Q,J,G,W,Y,z,q);for(var H in Q){var B=Q[H];if(Array.isArray(B)){if(H in y6.arrayKeywords)for(var F=0;F<B.length;F++)YZ($,Z,X,B[F],J+"/"+H+"/"+F,G,J,H,Q,F)}else if(H in y6.propsKeywords){if(B&&typeof B=="object")for(var L in B)YZ($,Z,X,B[L],J+"/"+H+"/"+n_(L),G,J,H,Q,L)}else if(H in y6.keywords||$.allKeys&&!(H in y6.skipKeywords))YZ($,Z,X,B,J+"/"+H,G,J,H,Q)}X(Q,J,G,W,Y,z,q)}}function n_($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var Q8=b((yB)=>{Object.defineProperty(yB,"__esModule",{value:!0});yB.getSchemaRefs=yB.resolveUrl=yB.normalizeId=yB._getFullPath=yB.getFullPath=yB.inlineRef=void 0;var r_=P0(),a_=iQ(),o_=_B(),s_=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function t_($,Z=!0){if(typeof $=="boolean")return!0;if(Z===!0)return!nQ($);if(!Z)return!1;return bB($)<=Z}yB.inlineRef=t_;var e_=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nQ($){for(let Z in $){if(e_.has(Z))return!0;let X=$[Z];if(Array.isArray(X)&&X.some(nQ))return!0;if(typeof X=="object"&&nQ(X))return!0}return!1}function bB($){let Z=0;for(let X in $){if(X==="$ref")return 1/0;if(Z++,s_.has(X))continue;if(typeof $[X]=="object")(0,r_.eachItem)($[X],(Q)=>Z+=bB(Q));if(Z===1/0)return 1/0}return Z}function xB($,Z="",X){if(X!==!1)Z=o4(Z);let Q=$.parse(Z);return kB($,Q)}yB.getFullPath=xB;function kB($,Z){return $.serialize(Z).split("#")[0]+"#"}yB._getFullPath=kB;var $b=/#\/?$/;function o4($){return $?$.replace($b,""):""}yB.normalizeId=o4;function Zb($,Z,X){return X=o4(X),$.resolve(Z,X)}yB.resolveUrl=Zb;var Xb=/^[a-z_][-a-z0-9._]*$/i;function Qb($,Z){if(typeof $=="boolean")return{};let{schemaId:X,uriResolver:Q}=this.opts,J=o4($[X]||Z),G={"":J},W=xB(Q,J,!1),Y={},z=new Set;return o_($,{allKeys:!0},(B,F,L,w)=>{if(w===void 0)return;let N=W+F,I=G[w];if(typeof B[X]=="string")I=T.call(this,B[X]);E.call(this,B.$anchor),E.call(this,B.$dynamicAnchor),G[F]=I;function T(P){let R=this.opts.uriResolver.resolve;if(P=o4(I?R(I,P):P),z.has(P))throw H(P);z.add(P);let C=this.refs[P];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")q(B,C.schema,P);else if(P!==o4(N))if(P[0]==="#")q(B,Y[P],P),Y[P]=B;else this.refs[P]=N;return P}function E(P){if(typeof P=="string"){if(!Xb.test(P))throw Error(`invalid anchor "${P}"`);T.call(this,`#${P}`)}}}),Y;function q(B,F,L){if(F!==void 0&&!a_(B,F))throw H(L)}function H(B){return Error(`reference "${B}" resolves to more than one schema`)}}yB.getSchemaRefs=Qb});var s4=b((sB)=>{Object.defineProperty(sB,"__esModule",{value:!0});sB.getData=sB.KeywordCxt=sB.validateFunctionCode=void 0;var mB=$B(),gB=X8(),aQ=hQ(),zZ=X8(),qb=FB(),G8=jB(),rQ=PB(),B0=N0(),I0=J1(),Kb=Q8(),G6=P0(),J8=Z8();function Ub($){if(cB($)){if(pB($),lB($)){Bb($);return}}dB($,()=>(0,mB.topBoolOrEmptySchema)($))}sB.validateFunctionCode=Ub;function dB({gen:$,validateName:Z,schema:X,schemaEnv:Q,opts:J},G){if(J.code.es5)$.func(Z,B0._`${I0.default.data}, ${I0.default.valCxt}`,Q.$async,()=>{$.code(B0._`"use strict"; ${fB(X,J)}`),Vb($,J),$.code(G)});else $.func(Z,B0._`${I0.default.data}, ${Hb(J)}`,Q.$async,()=>$.code(fB(X,J)).code(G))}function Hb($){return B0._`{${I0.default.instancePath}="", ${I0.default.parentData}, ${I0.default.parentDataProperty}, ${I0.default.rootData}=${I0.default.data}${$.dynamicRef?B0._`, ${I0.default.dynamicAnchors}={}`:B0.nil}}={}`}function Vb($,Z){$.if(I0.default.valCxt,()=>{if($.var(I0.default.instancePath,B0._`${I0.default.valCxt}.${I0.default.instancePath}`),$.var(I0.default.parentData,B0._`${I0.default.valCxt}.${I0.default.parentData}`),$.var(I0.default.parentDataProperty,B0._`${I0.default.valCxt}.${I0.default.parentDataProperty}`),$.var(I0.default.rootData,B0._`${I0.default.valCxt}.${I0.default.rootData}`),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`${I0.default.valCxt}.${I0.default.dynamicAnchors}`)},()=>{if($.var(I0.default.instancePath,B0._`""`),$.var(I0.default.parentData,B0._`undefined`),$.var(I0.default.parentDataProperty,B0._`undefined`),$.var(I0.default.rootData,I0.default.data),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`{}`)})}function Bb($){let{schema:Z,opts:X,gen:Q}=$;dB($,()=>{if(X.$comment&&Z.$comment)nB($);if(Ib($),Q.let(I0.default.vErrors,null),Q.let(I0.default.errors,0),X.unevaluated)Fb($);iB($),wb($)});return}function Fb($){let{gen:Z,validateName:X}=$;$.evaluated=Z.const("evaluated",B0._`${X}.evaluated`),Z.if(B0._`${$.evaluated}.dynamicProps`,()=>Z.assign(B0._`${$.evaluated}.props`,B0._`undefined`)),Z.if(B0._`${$.evaluated}.dynamicItems`,()=>Z.assign(B0._`${$.evaluated}.items`,B0._`undefined`))}function fB($,Z){let X=typeof $=="object"&&$[Z.schemaId];return X&&(Z.code.source||Z.code.process)?B0._`/*# sourceURL=${X} */`:B0.nil}function Lb($,Z){if(cB($)){if(pB($),lB($)){Mb($,Z);return}}(0,mB.boolOrEmptySchema)($,Z)}function lB({schema:$,self:Z}){if(typeof $=="boolean")return!$;for(let X in $)if(Z.RULES.all[X])return!0;return!1}function cB($){return typeof $.schema!="boolean"}function Mb($,Z){let{schema:X,gen:Q,opts:J}=$;if(J.$comment&&X.$comment)nB($);Nb($),Db($);let G=Q.const("_errs",I0.default.errors);iB($,G),Q.var(Z,B0._`${G} === ${I0.default.errors}`)}function pB($){(0,G6.checkUnknownRules)($),Ab($)}function iB($,Z){if($.opts.jtd)return hB($,[],!1,Z);let X=(0,gB.getSchemaTypes)($.schema),Q=(0,gB.coerceAndCheckDataType)($,X);hB($,X,!Q,Z)}function Ab($){let{schema:Z,errSchemaPath:X,opts:Q,self:J}=$;if(Z.$ref&&Q.ignoreKeywordsWithRef&&(0,G6.schemaHasRulesButRef)(Z,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function Ib($){let{schema:Z,opts:X}=$;if(Z.default!==void 0&&X.useDefaults&&X.strictSchema)(0,G6.checkStrictMode)($,"default is ignored in the schema root")}function Nb($){let Z=$.schema[$.opts.schemaId];if(Z)$.baseId=(0,Kb.resolveUrl)($.opts.uriResolver,$.baseId,Z)}function Db($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function nB({gen:$,schemaEnv:Z,schema:X,errSchemaPath:Q,opts:J}){let G=X.$comment;if(J.$comment===!0)$.code(B0._`${I0.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let W=B0.str`${Q}/$comment`,Y=$.scopeValue("root",{ref:Z.root});$.code(B0._`${I0.default.self}.opts.$comment(${G}, ${W}, ${Y}.schema)`)}}function wb($){let{gen:Z,schemaEnv:X,validateName:Q,ValidationError:J,opts:G}=$;if(X.$async)Z.if(B0._`${I0.default.errors} === 0`,()=>Z.return(I0.default.data),()=>Z.throw(B0._`new ${J}(${I0.default.vErrors})`));else{if(Z.assign(B0._`${Q}.errors`,I0.default.vErrors),G.unevaluated)Tb($);Z.return(B0._`${I0.default.errors} === 0`)}}function Tb({gen:$,evaluated:Z,props:X,items:Q}){if(X instanceof B0.Name)$.assign(B0._`${Z}.props`,X);if(Q instanceof B0.Name)$.assign(B0._`${Z}.items`,Q)}function hB($,Z,X,Q){let{gen:J,schema:G,data:W,allErrors:Y,opts:z,self:q}=$,{RULES:H}=q;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,G6.schemaHasRulesButRef)(G,H))){J.block(()=>aB($,"$ref",H.all.$ref.definition));return}if(!z.jtd)jb($,Z);J.block(()=>{for(let F of H.rules)B(F);B(H.post)});function B(F){if(!(0,aQ.shouldUseGroup)(G,F))return;if(F.type){if(J.if((0,zZ.checkDataType)(F.type,W,z.strictNumbers)),uB($,F),Z.length===1&&Z[0]===F.type&&X)J.else(),(0,zZ.reportTypeError)($);J.endIf()}else uB($,F);if(!Y)J.if(B0._`${I0.default.errors} === ${Q||0}`)}}function uB($,Z){let{gen:X,schema:Q,opts:{useDefaults:J}}=$;if(J)(0,qb.assignDefaults)($,Z.type);X.block(()=>{for(let G of Z.rules)if((0,aQ.shouldUseRule)(Q,G))aB($,G.keyword,G.definition,Z.type)})}function jb($,Z){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(Ob($,Z),!$.opts.allowUnionTypes)Eb($,Z);Rb($,$.dataTypes)}function Ob($,Z){if(!Z.length)return;if(!$.dataTypes.length){$.dataTypes=Z;return}Z.forEach((X)=>{if(!rB($.dataTypes,X))oQ($,`type "${X}" not allowed by context "${$.dataTypes.join(",")}"`)}),Cb($,Z)}function Eb($,Z){if(Z.length>1&&!(Z.length===2&&Z.includes("null")))oQ($,"use allowUnionTypes to allow union type keyword")}function Rb($,Z){let X=$.self.RULES.all;for(let Q in X){let J=X[Q];if(typeof J=="object"&&(0,aQ.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((W)=>Pb(Z,W)))oQ($,`missing type "${G.join(",")}" for keyword "${Q}"`)}}}function Pb($,Z){return $.includes(Z)||Z==="number"&&$.includes("integer")}function rB($,Z){return $.includes(Z)||Z==="integer"&&$.includes("number")}function Cb($,Z){let X=[];for(let Q of $.dataTypes)if(rB(Z,Q))X.push(Q);else if(Z.includes("integer")&&Q==="number")X.push("integer");$.dataTypes=X}function oQ($,Z){let X=$.schemaEnv.baseId+$.errSchemaPath;Z+=` at "${X}" (strictTypes)`,(0,G6.checkStrictMode)($,Z,$.opts.strictTypes)}class sQ{constructor($,Z,X){if((0,G8.validateKeywordUsage)($,Z,X),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=X,this.data=$.data,this.schema=$.schema[X],this.$data=Z.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,G6.schemaRefOrVal)($,this.schema,X,this.$data),this.schemaType=Z.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=Z,this.$data)this.schemaCode=$.gen.const("vSchema",oB(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,G8.validSchemaType)(this.schema,Z.schemaType,Z.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(Z.schemaType)}`);if("code"in Z?Z.trackErrors:Z.errors!==!1)this.errsCount=$.gen.const("_errs",I0.default.errors)}result($,Z,X){this.failResult((0,B0.not)($),Z,X)}failResult($,Z,X){if(this.gen.if($),X)X();else this.error();if(Z){if(this.gen.else(),Z(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,Z){this.failResult((0,B0.not)($),void 0,Z)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:Z}=this;this.fail(B0._`${Z} !== undefined && (${(0,B0.or)(this.invalid$data(),$)})`)}error($,Z,X){if(Z){this.setParams(Z),this._error($,X),this.setParams({});return}this._error($,X)}_error($,Z){($?J8.reportExtraError:J8.reportError)(this,this.def.error,Z)}$dataError(){(0,J8.reportError)(this,this.def.$dataError||J8.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,J8.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,Z){if(Z)Object.assign(this.params,$);else this.params=$}block$data($,Z,X=B0.nil){this.gen.block(()=>{this.check$data($,X),Z()})}check$data($=B0.nil,Z=B0.nil){if(!this.$data)return;let{gen:X,schemaCode:Q,schemaType:J,def:G}=this;if(X.if((0,B0.or)(B0._`${Q} === undefined`,Z)),$!==B0.nil)X.assign($,!0);if(J.length||G.validateSchema){if(X.elseIf(this.invalid$data()),this.$dataError(),$!==B0.nil)X.assign($,!1)}X.else()}invalid$data(){let{gen:$,schemaCode:Z,schemaType:X,def:Q,it:J}=this;return(0,B0.or)(G(),W());function G(){if(X.length){if(!(Z instanceof B0.Name))throw Error("ajv implementation error");let Y=Array.isArray(X)?X:[X];return B0._`${(0,zZ.checkDataTypes)(Y,Z,J.opts.strictNumbers,zZ.DataType.Wrong)}`}return B0.nil}function W(){if(Q.validateSchema){let Y=$.scopeValue("validate$data",{ref:Q.validateSchema});return B0._`!${Y}(${Z})`}return B0.nil}}subschema($,Z){let X=(0,rQ.getSubschema)(this.it,$);(0,rQ.extendSubschemaData)(X,this.it,$),(0,rQ.extendSubschemaMode)(X,$);let Q={...this.it,...X,items:void 0,props:void 0};return Lb(Q,Z),Q}mergeEvaluated($,Z){let{it:X,gen:Q}=this;if(!X.opts.unevaluated)return;if(X.props!==!0&&$.props!==void 0)X.props=G6.mergeEvaluated.props(Q,$.props,X.props,Z);if(X.items!==!0&&$.items!==void 0)X.items=G6.mergeEvaluated.items(Q,$.items,X.items,Z)}mergeValidEvaluated($,Z){let{it:X,gen:Q}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Q.if(Z,()=>this.mergeEvaluated($,B0.Name)),!0}}sB.KeywordCxt=sQ;function aB($,Z,X,Q){let J=new sQ($,X,Z);if("code"in X)X.code(J,Q);else if(J.$data&&X.validate)(0,G8.funcKeywordCode)(J,X);else if("macro"in X)(0,G8.macroKeywordCode)(J,X);else if(X.compile||X.validate)(0,G8.funcKeywordCode)(J,X)}var Sb=/^\/(?:[^~]|~0|~1)*$/,_b=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oB($,{dataLevel:Z,dataNames:X,dataPathArr:Q}){let J,G;if($==="")return I0.default.rootData;if($[0]==="/"){if(!Sb.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=I0.default.rootData}else{let q=_b.exec($);if(!q)throw Error(`Invalid JSON-pointer: ${$}`);let H=+q[1];if(J=q[2],J==="#"){if(H>=Z)throw Error(z("property/index",H));return Q[Z-H]}if(H>Z)throw Error(z("data",H));if(G=X[Z-H],!J)return G}let W=G,Y=J.split("/");for(let q of Y)if(q)G=B0._`${G}${(0,B0.getProperty)((0,G6.unescapeJsonPointer)(q))}`,W=B0._`${W} && ${G}`;return W;function z(q,H){return`Cannot access ${q} ${H} levels up, current level is ${Z}`}}sB.getData=oB});var W8=b(($F)=>{Object.defineProperty($F,"__esModule",{value:!0});class eB extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}$F.default=eB});var t4=b((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});var tQ=Q8();class ZF extends Error{constructor($,Z,X,Q){super(Q||`can't resolve reference ${X} from id ${Z}`);this.missingRef=(0,tQ.resolveUrl)($,Z,X),this.missingSchema=(0,tQ.normalizeId)((0,tQ.getFullPath)($,this.missingRef))}}XF.default=ZF});var z8=b((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});GF.resolveSchema=GF.getCompilingSchema=GF.resolveRef=GF.compileSchema=GF.SchemaEnv=void 0;var V1=N0(),vb=W8(),q4=J1(),B1=Q8(),QF=P0(),gb=s4();class Y8{constructor($){var Z;this.refs={},this.dynamicAnchors={};let X;if(typeof $.schema=="object")X=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(Z=$.baseId)!==null&&Z!==void 0?Z:(0,B1.normalizeId)(X===null||X===void 0?void 0:X[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=X===null||X===void 0?void 0:X.$async,this.refs={}}}GF.SchemaEnv=Y8;function $J($){let Z=JF.call(this,$);if(Z)return Z;let X=(0,B1.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:J}=this.opts.code,{ownProperties:G}=this.opts,W=new V1.CodeGen(this.scope,{es5:Q,lines:J,ownProperties:G}),Y;if($.$async)Y=W.scopeValue("Error",{ref:vb.default,code:V1._`require("ajv/dist/runtime/validation_error").default`});let z=W.scopeName("validate");$.validateName=z;let q={gen:W,allErrors:this.opts.allErrors,data:q4.default.data,parentData:q4.default.parentData,parentDataProperty:q4.default.parentDataProperty,dataNames:[q4.default.data],dataPathArr:[V1.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,V1.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Y,schema:$.schema,schemaEnv:$,rootId:X,baseId:$.baseId||X,schemaPath:V1.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:V1._`""`,opts:this.opts,self:this},H;try{this._compilations.add($),(0,gb.validateFunctionCode)(q),W.optimize(this.opts.code.optimize);let B=W.toString();if(H=`${W.scopeRefs(q4.default.scope)}return ${B}`,this.opts.code.process)H=this.opts.code.process(H,$);let L=Function(`${q4.default.self}`,`${q4.default.scope}`,H)(this,this.scope.get());if(this.scope.value(z,{ref:L}),L.errors=null,L.schema=$.schema,L.schemaEnv=$,$.$async)L.$async=!0;if(this.opts.code.source===!0)L.source={validateName:z,validateCode:B,scopeValues:W._values};if(this.opts.unevaluated){let{props:w,items:N}=q;if(L.evaluated={props:w instanceof V1.Name?void 0:w,items:N instanceof V1.Name?void 0:N,dynamicProps:w instanceof V1.Name,dynamicItems:N instanceof V1.Name},L.source)L.source.evaluated=(0,V1.stringify)(L.evaluated)}return $.validate=L,$}catch(B){if(delete $.validate,delete $.validateName,H)this.logger.error("Error compiling schema, function code:",H);throw B}finally{this._compilations.delete($)}}GF.compileSchema=$J;function fb($,Z,X){var Q;X=(0,B1.resolveUrl)(this.opts.uriResolver,Z,X);let J=$.refs[X];if(J)return J;let G=mb.call(this,$,X);if(G===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[X],{schemaId:Y}=this.opts;if(W)G=new Y8({schema:W,schemaId:Y,root:$,baseId:Z})}if(G===void 0)return;return $.refs[X]=hb.call(this,G)}GF.resolveRef=fb;function hb($){if((0,B1.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:$J.call(this,$)}function JF($){for(let Z of this._compilations)if(ub(Z,$))return Z}GF.getCompilingSchema=JF;function ub($,Z){return $.schema===Z.schema&&$.root===Z.root&&$.baseId===Z.baseId}function mb($,Z){let X;while(typeof(X=this.refs[Z])=="string")Z=X;return X||this.schemas[Z]||qZ.call(this,$,Z)}function qZ($,Z){let X=this.opts.uriResolver.parse(Z),Q=(0,B1._getFullPath)(this.opts.uriResolver,X),J=(0,B1.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===J)return eQ.call(this,X,$);let G=(0,B1.normalizeId)(Q),W=this.refs[G]||this.schemas[G];if(typeof W=="string"){let Y=qZ.call(this,$,W);if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;return eQ.call(this,X,Y)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)$J.call(this,W);if(G===(0,B1.normalizeId)(Z)){let{schema:Y}=W,{schemaId:z}=this.opts,q=Y[z];if(q)J=(0,B1.resolveUrl)(this.opts.uriResolver,J,q);return new Y8({schema:Y,schemaId:z,root:$,baseId:J})}return eQ.call(this,X,W)}GF.resolveSchema=qZ;var db=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eQ($,{baseId:Z,schema:X,root:Q}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Y of $.fragment.slice(1).split("/")){if(typeof X==="boolean")return;let z=X[(0,QF.unescapeFragment)(Y)];if(z===void 0)return;X=z;let q=typeof X==="object"&&X[this.opts.schemaId];if(!db.has(Y)&&q)Z=(0,B1.resolveUrl)(this.opts.uriResolver,Z,q)}let G;if(typeof X!="boolean"&&X.$ref&&!(0,QF.schemaHasRulesButRef)(X,this.RULES)){let Y=(0,B1.resolveUrl)(this.opts.uriResolver,Z,X.$ref);G=qZ.call(this,Q,Y)}let{schemaId:W}=this.opts;if(G=G||new Y8({schema:X,schemaId:W,root:Q,baseId:Z}),G.schema!==G.root.schema)return G;return}});var YF=b((An,nb)=>{nb.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var QJ=b((In,VF)=>{var rb=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qF=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),ZJ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),KF=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ab=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function XJ($){let Z="",X=0,Q=0;for(Q=0;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),X===48)continue;if(!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q];break}for(Q+=1;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q]}return Z}var ob=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function zF($){return $.length=0,!0}function sb($,Z,X){if($.length){let Q=XJ($);if(Q!=="")Z.push(Q);else return X.error=!0,!1;$.length=0}return!0}function tb($){let Z=0,X={error:!1,address:"",zone:""},Q=[],J=[],G=!1,W=!1,Y=sb;for(let z=0;z<$.length;z++){let q=$[z];if(q==="["||q==="]")continue;if(q===":"){if(G===!0)W=!0;if(!Y(J,Q,X))break;if(++Z>7){X.error=!0;break}if(z>0&&$[z-1]===":")G=!0;Q.push(":");continue}else if(q==="%"){if(!Y(J,Q,X))break;Y=zF}else{J.push(q);continue}}if(J.length)if(Y===zF)X.zone=J.join("");else if(W)Q.push(J.join(""));else Q.push(XJ(J));return X.address=Q.join(""),X}function UF($){if(eb($,":")<2)return{host:$,isIPV6:!1};let Z=tb($);if(!Z.error){let{address:X,address:Q}=Z;if(Z.zone)X+="%"+Z.zone,Q+="%25"+Z.zone;return{host:X,isIPV6:!0,escapedHost:Q}}else return{host:$,isIPV6:!1}}function eb($,Z){let X=0;for(let Q=0;Q<$.length;Q++)if($[Q]===Z)X++;return X}function $x($){let Z=$,X=[],Q=-1,J=0;while(J=Z.length){if(J===1)if(Z===".")break;else if(Z==="/"){X.push("/");break}else{X.push(Z);break}else if(J===2){if(Z[0]==="."){if(Z[1]===".")break;else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."||Z[1]==="/"){X.push("/");break}}}else if(J===3){if(Z==="/.."){if(X.length!==0)X.pop();X.push("/");break}}if(Z[0]==="."){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(3);continue}}else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(2);continue}else if(Z[2]==="."){if(Z[3]==="/"){if(Z=Z.slice(3),X.length!==0)X.pop();continue}}}}if((Q=Z.indexOf("/",1))===-1){X.push(Z);break}else X.push(Z.slice(0,Q)),Z=Z.slice(Q)}return X.join("")}var Zx={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Xx=/[@/?#:]/g,Qx=/[@/?#]/g;function HF($,Z){let X=Z?Qx:Xx;return X.lastIndex=0,$.replace(X,(Q)=>Zx[Q])}function Jx($,Z=!1){if($.indexOf("%")===-1)return $;let X="";for(let Q=0;Q<$.length;Q++){if($[Q]==="%"&&Q+2<$.length){let J=$.slice(Q+1,Q+3);if(ZJ(J)){let G=J.toUpperCase(),W=String.fromCharCode(parseInt(G,16));if(Z&&KF(W))X+=W;else X+="%"+G;Q+=2;continue}}X+=$[Q]}return X}function Gx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(ZJ(Q)){let J=Q.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&KF(G))Z+=G;else Z+="%"+J;X+=2;continue}}if(ab($[X]))Z+=$[X];else Z+=escape($[X])}return Z}function Wx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(ZJ(Q)){Z+="%"+Q.toUpperCase(),X+=2;continue}}Z+=escape($[X])}return Z}function Yx($){let Z=[];if($.userinfo!==void 0)Z.push($.userinfo),Z.push("@");if($.host!==void 0){let X=unescape($.host);if(!qF(X)){let Q=UF(X);if(Q.isIPV6===!0)X=`[${Q.escapedHost}]`;else X=HF(X,!1)}Z.push(X)}if(typeof $.port==="number"||typeof $.port==="string")Z.push(":"),Z.push(String($.port));return Z.length?Z.join(""):void 0}VF.exports={nonSimpleDomain:ob,recomposeAuthority:Yx,reescapeHostDelimiters:HF,normalizePercentEncoding:Jx,normalizePathEncoding:Gx,escapePreservingEscapes:Wx,removeDotSegments:$x,isIPv4:qF,isUUID:rb,normalizeIPv6:UF,stringArrayToHexStripped:XJ}});var AF=b((Nn,MF)=>{var{isUUID:zx}=QJ(),qx=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Kx=["http","https","ws","wss","urn","urn:uuid"];function Ux($){return Kx.indexOf($)!==-1}function JJ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function BF($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function FF($){let Z=String($.scheme).toLowerCase()==="https";if($.port===(Z?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function Hx($){return $.secure=JJ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function Vx($){if($.port===(JJ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[Z,X]=$.resourceName.split("?");$.path=Z&&Z!=="/"?Z:void 0,$.query=X,$.resourceName=void 0}return $.fragment=void 0,$}function Bx($,Z){if(!$.path)return $.error="URN can not be parsed",$;let X=$.path.match(qx);if(X){let Q=Z.scheme||$.scheme||"urn";$.nid=X[1].toLowerCase(),$.nss=X[2];let J=`${Q}:${Z.nid||$.nid}`,G=GJ(J);if($.path=void 0,G)$=G.parse($,Z)}else $.error=$.error||"URN can not be parsed.";return $}function Fx($,Z){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let X=Z.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),J=`${X}:${Z.nid||Q}`,G=GJ(J);if(G)$=G.serialize($,Z);let W=$,Y=$.nss;return W.path=`${Q||Z.nid}:${Y}`,Z.skipEscape=!0,W}function Lx($,Z){let X=$;if(X.uuid=X.nss,X.nss=void 0,!Z.tolerant&&(!X.uuid||!zx(X.uuid)))X.error=X.error||"UUID is not valid.";return X}function Mx($){let Z=$;return Z.nss=($.uuid||"").toLowerCase(),Z}var LF={scheme:"http",domainHost:!0,parse:BF,serialize:FF},Ax={scheme:"https",domainHost:LF.domainHost,parse:BF,serialize:FF},KZ={scheme:"ws",domainHost:!0,parse:Hx,serialize:Vx},Ix={scheme:"wss",domainHost:KZ.domainHost,parse:KZ.parse,serialize:KZ.serialize},Nx={scheme:"urn",parse:Bx,serialize:Fx,skipNormalize:!0},Dx={scheme:"urn:uuid",parse:Lx,serialize:Mx,skipNormalize:!0},UZ={http:LF,https:Ax,ws:KZ,wss:Ix,urn:Nx,"urn:uuid":Dx};Object.setPrototypeOf(UZ,null);function GJ($){return $&&(UZ[$]||UZ[$.toLowerCase()])||void 0}MF.exports={wsIsSecure:JJ,SCHEMES:UZ,isValidSchemeName:Ux,getSchemeHandler:GJ}});var jF=b((Dn,HZ)=>{var{normalizeIPv6:wx,removeDotSegments:q8,recomposeAuthority:Tx,normalizePercentEncoding:jx,normalizePathEncoding:Ox,escapePreservingEscapes:Ex,reescapeHostDelimiters:Rx,isIPv4:Px,nonSimpleDomain:Cx}=QJ(),{SCHEMES:Sx,getSchemeHandler:NF}=AF();function _x($,Z){if(typeof $==="string")$=vx($,Z);else if(typeof $==="object")$=e4(K4($,Z),Z);return $}function bx($,Z,X){let Q=X?Object.assign({scheme:"null"},X):{scheme:"null"},J=DF(e4($,Q),e4(Z,Q),Q,!0);return Q.skipEscape=!0,K4(J,Q)}function DF($,Z,X,Q){let J={};if(!Q)$=e4(K4($,X),X),Z=e4(K4(Z,X),X);if(X=X||{},!X.tolerant&&Z.scheme)J.scheme=Z.scheme,J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=q8(Z.path||""),J.query=Z.query;else{if(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=q8(Z.path||""),J.query=Z.query;else{if(!Z.path)if(J.path=$.path,Z.query!==void 0)J.query=Z.query;else J.query=$.query;else{if(Z.path[0]==="/")J.path=q8(Z.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+Z.path;else if(!$.path)J.path=Z.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+Z.path;J.path=q8(J.path)}J.query=Z.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=Z.fragment,J}function xx($,Z,X){let Q=IF($,X),J=IF(Z,X);return Q!==void 0&&J!==void 0&&Q.toLowerCase()===J.toLowerCase()}function K4($,Z){let X={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},Z),J=[],G=NF(Q.scheme||X.scheme);if(G&&G.serialize)G.serialize(X,Q);if(X.path!==void 0)if(!Q.skipEscape){if(X.path=Ex(X.path),X.scheme!==void 0)X.path=X.path.split("%3A").join(":")}else X.path=jx(X.path);if(Q.reference!=="suffix"&&X.scheme)J.push(X.scheme,":");let W=Tx(X);if(W!==void 0){if(Q.reference!=="suffix")J.push("//");if(J.push(W),X.path&&X.path[0]!=="/")J.push("/")}if(X.path!==void 0){let Y=X.path;if(!Q.absolutePath&&(!G||!G.absolutePath))Y=q8(Y);if(W===void 0&&Y[0]==="/"&&Y[1]==="/")Y="/%2F"+Y.slice(2);J.push(Y)}if(X.query!==void 0)J.push("?",X.query);if(X.fragment!==void 0)J.push("#",X.fragment);return J.join("")}var kx=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yx($,Z){if(Z[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function wF($,Z){let X=Object.assign({},Z),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(X.reference==="suffix")if(X.scheme)$=X.scheme+":"+$;else $="//"+$;let W=$.match(kx);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];let Y=yx(Q,W);if(Y!==void 0)Q.error=Q.error||Y,J=!0;if(Q.host)if(Px(Q.host)===!1){let H=wx(Q.host);Q.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(X.reference&&X.reference!=="suffix"&&X.reference!==Q.reference)Q.error=Q.error||"URI is not a "+X.reference+" reference.";let z=NF(X.scheme||Q.scheme);if(!X.unicodeSupport&&(!z||!z.unicodeSupport)){if(Q.host&&(X.domainHost||z&&z.domainHost)&&G===!1&&Cx(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(q){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+q}}if(!z||z&&!z.skipNormalize){if($.indexOf("%")!==-1){if(Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(Q.host!==void 0)Q.host=Rx(unescape(Q.host),G)}if(Q.path)Q.path=Ox(Q.path);if(Q.fragment)try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}}if(z&&z.parse)z.parse(Q,X)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:J}}function e4($,Z){return wF($,Z).parsed}function vx($,Z){return TF($,Z).normalized}function TF($,Z){let{parsed:X,malformedAuthorityOrPort:Q}=wF($,Z);return{normalized:Q?$:K4(X,Z),malformedAuthorityOrPort:Q}}function IF($,Z){if(typeof $==="string"){let{normalized:X,malformedAuthorityOrPort:Q}=TF($,Z);return Q?void 0:X}if(typeof $==="object")return K4($,Z)}var WJ={SCHEMES:Sx,normalize:_x,resolve:bx,resolveComponent:DF,equal:xx,serialize:K4,parse:e4};HZ.exports=WJ;HZ.exports.default=WJ;HZ.exports.fastUri=WJ});var RF=b((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});var OF=jF();OF.code='require("ajv/dist/runtime/uri").default';EF.default=OF});var qJ=b((W6)=>{Object.defineProperty(W6,"__esModule",{value:!0});W6.CodeGen=W6.Name=W6.nil=W6.stringify=W6.str=W6._=W6.KeywordCxt=void 0;var fx=s4();Object.defineProperty(W6,"KeywordCxt",{enumerable:!0,get:function(){return fx.KeywordCxt}});var $9=N0();Object.defineProperty(W6,"_",{enumerable:!0,get:function(){return $9._}});Object.defineProperty(W6,"str",{enumerable:!0,get:function(){return $9.str}});Object.defineProperty(W6,"stringify",{enumerable:!0,get:function(){return $9.stringify}});Object.defineProperty(W6,"nil",{enumerable:!0,get:function(){return $9.nil}});Object.defineProperty(W6,"Name",{enumerable:!0,get:function(){return $9.Name}});Object.defineProperty(W6,"CodeGen",{enumerable:!0,get:function(){return $9.CodeGen}});var hx=W8(),bF=t4(),ux=fQ(),K8=z8(),mx=N0(),U8=Q8(),VZ=X8(),zJ=P0(),PF=YF(),dx=RF(),xF=($,Z)=>new RegExp($,Z);xF.code="new RegExp";var lx=["removeAdditional","useDefaults","coerceTypes"],cx=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),px={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ix={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},CF=200;function nx($){var Z,X,Q,J,G,W,Y,z,q,H,B,F,L,w,N,I,T,E,P,R,C,y,v,h,X0;let r=$.strict,u=(Z=$.code)===null||Z===void 0?void 0:Z.optimize,t=u===!0||u===void 0?1:u||0,Y0=(Q=(X=$.code)===null||X===void 0?void 0:X.regExp)!==null&&Q!==void 0?Q:xF,G0=(J=$.uriResolver)!==null&&J!==void 0?J:dx.default;return{strictSchema:(W=(G=$.strictSchema)!==null&&G!==void 0?G:r)!==null&&W!==void 0?W:!0,strictNumbers:(z=(Y=$.strictNumbers)!==null&&Y!==void 0?Y:r)!==null&&z!==void 0?z:!0,strictTypes:(H=(q=$.strictTypes)!==null&&q!==void 0?q:r)!==null&&H!==void 0?H:"log",strictTuples:(F=(B=$.strictTuples)!==null&&B!==void 0?B:r)!==null&&F!==void 0?F:"log",strictRequired:(w=(L=$.strictRequired)!==null&&L!==void 0?L:r)!==null&&w!==void 0?w:!1,code:$.code?{...$.code,optimize:t,regExp:Y0}:{optimize:t,regExp:Y0},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:CF,loopEnum:(I=$.loopEnum)!==null&&I!==void 0?I:CF,meta:(T=$.meta)!==null&&T!==void 0?T:!0,messages:(E=$.messages)!==null&&E!==void 0?E:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(R=$.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=$.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(y=$.validateSchema)!==null&&y!==void 0?y:!0,validateFormats:(v=$.validateFormats)!==null&&v!==void 0?v:!0,unicodeRegExp:(h=$.unicodeRegExp)!==null&&h!==void 0?h:!0,int32range:(X0=$.int32range)!==null&&X0!==void 0?X0:!0,uriResolver:G0}}class BZ{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...nx($)};let{es5:Z,lines:X}=this.opts.code;this.scope=new mx.ValueScope({scope:{},prefixes:cx,es5:Z,lines:X}),this.logger=ex($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,ux.getRules)(),SF.call(this,px,$,"NOT SUPPORTED"),SF.call(this,ix,$,"DEPRECATED","warn"),this._metaOpts=sx.call(this),$.formats)ax.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)ox.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);rx.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:Z,schemaId:X}=this.opts,Q=PF;if(X==="id")Q={...PF},Q.id=Q.$id,delete Q.$id;if(Z&&$)this.addMetaSchema(Q,Q[X],!1)}defaultMeta(){let{meta:$,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[Z]||$:void 0}validate($,Z){let X;if(typeof $=="string"){if(X=this.getSchema($),!X)throw Error(`no schema with key or ref "${$}"`)}else X=this.compile($);let Q=X(Z);if(!("$async"in X))this.errors=X.errors;return Q}compile($,Z){let X=this._addSchema($,Z);return X.validate||this._compileSchemaEnv(X)}compileAsync($,Z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:X}=this.opts;return Q.call(this,$,Z);async function Q(q,H){await J.call(this,q.$schema);let B=this._addSchema(q,H);return B.validate||G.call(this,B)}async function J(q){if(q&&!this.getSchema(q))await Q.call(this,{$ref:q},!0)}async function G(q){try{return this._compileSchemaEnv(q)}catch(H){if(!(H instanceof bF.default))throw H;return W.call(this,H),await Y.call(this,H.missingSchema),G.call(this,q)}}function W({missingSchema:q,missingRef:H}){if(this.refs[q])throw Error(`AnySchema ${q} is loaded but ${H} cannot be resolved`)}async function Y(q){let H=await z.call(this,q);if(!this.refs[q])await J.call(this,H.$schema);if(!this.refs[q])this.addSchema(H,q,Z)}async function z(q){let H=this._loading[q];if(H)return H;try{return await(this._loading[q]=X(q))}finally{delete this._loading[q]}}}addSchema($,Z,X,Q=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,X,Q);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return Z=(0,U8.normalizeId)(Z||J),this._checkUnique(Z),this.schemas[Z]=this._addSchema($,X,Z,Q,!0),this}addMetaSchema($,Z,X=this.opts.validateSchema){return this.addSchema($,Z,!0,X),this}validateSchema($,Z){if(typeof $=="boolean")return!0;let X;if(X=$.$schema,X!==void 0&&typeof X!="string")throw Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(X,$);if(!Q&&Z){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Q}getSchema($){let Z;while(typeof(Z=_F.call(this,$))=="string")$=Z;if(Z===void 0){let{schemaId:X}=this.opts,Q=new K8.SchemaEnv({schema:{},schemaId:X});if(Z=K8.resolveSchema.call(this,Q,$),!Z)return;this.refs[$]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Z=_F.call(this,$);if(typeof Z=="object")this._cache.delete(Z.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let Z=$;this._cache.delete(Z);let X=$[this.opts.schemaId];if(X)X=(0,U8.normalizeId)(X),delete this.schemas[X],delete this.refs[X];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let Z of $)this.addKeyword(Z);return this}addKeyword($,Z){let X;if(typeof $=="string"){if(X=$,typeof Z=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=X}else if(typeof $=="object"&&Z===void 0){if(Z=$,X=Z.keyword,Array.isArray(X)&&!X.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Zk.call(this,X,Z),!Z)return(0,zJ.eachItem)(X,(J)=>YJ.call(this,J)),this;Qk.call(this,Z);let Q={...Z,type:(0,VZ.getJSONTypes)(Z.type),schemaType:(0,VZ.getJSONTypes)(Z.schemaType)};return(0,zJ.eachItem)(X,Q.type.length===0?(J)=>YJ.call(this,J,Q):(J)=>Q.type.forEach((G)=>YJ.call(this,J,Q,G))),this}getKeyword($){let Z=this.RULES.all[$];return typeof Z=="object"?Z.definition:!!Z}removeKeyword($){let{RULES:Z}=this;delete Z.keywords[$],delete Z.all[$];for(let X of Z.rules){let Q=X.rules.findIndex((J)=>J.keyword===$);if(Q>=0)X.rules.splice(Q,1)}return this}addFormat($,Z){if(typeof Z=="string")Z=new RegExp(Z);return this.formats[$]=Z,this}errorsText($=this.errors,{separator:Z=", ",dataVar:X="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${X}${Q.instancePath} ${Q.message}`).reduce((Q,J)=>Q+Z+J)}$dataMetaSchema($,Z){let X=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of Z){let J=Q.split("/").slice(1),G=$;for(let W of J)G=G[W];for(let W in X){let Y=X[W];if(typeof Y!="object")continue;let{$data:z}=Y.definition,q=G[W];if(z&&q)G[W]=kF(q)}}return $}_removeAllSchemas($,Z){for(let X in $){let Q=$[X];if(!Z||Z.test(X)){if(typeof Q=="string")delete $[X];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[X]}}}_addSchema($,Z,X,Q=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:W}=this.opts;if(typeof $=="object")G=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Y=this._cache.get($);if(Y!==void 0)return Y;X=(0,U8.normalizeId)(G||X);let z=U8.getSchemaRefs.call(this,$,X);if(Y=new K8.SchemaEnv({schema:$,schemaId:W,meta:Z,baseId:X,localRefs:z}),this._cache.set(Y.schema,Y),J&&!X.startsWith("#")){if(X)this._checkUnique(X);this.refs[X]=Y}if(Q)this.validateSchema($,!0);return Y}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else K8.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let Z=this.opts;this.opts=this._metaOpts;try{K8.compileSchema.call(this,$)}finally{this.opts=Z}}}BZ.ValidationError=hx.default;BZ.MissingRefError=bF.default;W6.default=BZ;function SF($,Z,X,Q="error"){for(let J in $){let G=J;if(G in Z)this.logger[Q](`${X}: option ${J}. ${$[G]}`)}}function _F($){return $=(0,U8.normalizeId)($),this.schemas[$]||this.refs[$]}function rx(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let Z in $)this.addSchema($[Z],Z)}function ax(){for(let $ in this.opts.formats){let Z=this.opts.formats[$];if(Z)this.addFormat($,Z)}}function ox($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Z in $){let X=$[Z];if(!X.keyword)X.keyword=Z;this.addKeyword(X)}}function sx(){let $={...this.opts};for(let Z of lx)delete $[Z];return $}var tx={log(){},warn(){},error(){}};function ex($){if($===!1)return tx;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var $k=/^[a-z_$][a-z0-9_$:-]*$/i;function Zk($,Z){let{RULES:X}=this;if((0,zJ.eachItem)($,(Q)=>{if(X.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!$k.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!Z)return;if(Z.$data&&!(("code"in Z)||("validate"in Z)))throw Error('$data keyword must have "code" or "validate" function')}function YJ($,Z,X){var Q;let J=Z===null||Z===void 0?void 0:Z.post;if(X&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,W=J?G.post:G.rules.find(({type:z})=>z===X);if(!W)W={type:X,rules:[]},G.rules.push(W);if(G.keywords[$]=!0,!Z)return;let Y={keyword:$,definition:{...Z,type:(0,VZ.getJSONTypes)(Z.type),schemaType:(0,VZ.getJSONTypes)(Z.schemaType)}};if(Z.before)Xk.call(this,W,Y,Z.before);else W.rules.push(Y);G.all[$]=Y,(Q=Z.implements)===null||Q===void 0||Q.forEach((z)=>this.addKeyword(z))}function Xk($,Z,X){let Q=$.rules.findIndex((J)=>J.keyword===X);if(Q>=0)$.rules.splice(Q,0,Z);else $.rules.push(Z),this.logger.warn(`rule ${X} is not defined`)}function Qk($){let{metaSchema:Z}=$;if(Z===void 0)return;if($.$data&&this.opts.$data)Z=kF(Z);$.validateSchema=this.compile(Z,!0)}var Jk={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function kF($){return{anyOf:[$,Jk]}}});var vF=b((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});var Yk={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yF.default=Yk});var MZ=b((uF)=>{Object.defineProperty(uF,"__esModule",{value:!0});uF.callRef=uF.getValidate=void 0;var qk=t4(),gF=G1(),y$=N0(),Z9=J1(),fF=z8(),FZ=P0(),Kk={keyword:"$ref",schemaType:"string",code($){let{gen:Z,schema:X,it:Q}=$,{baseId:J,schemaEnv:G,validateName:W,opts:Y,self:z}=Q,{root:q}=G;if((X==="#"||X==="#/")&&J===q.baseId)return B();let H=fF.resolveRef.call(z,q,J,X);if(H===void 0)throw new qk.default(Q.opts.uriResolver,J,X);if(H instanceof fF.SchemaEnv)return F(H);return L(H);function B(){if(G===q)return LZ($,W,G,G.$async);let w=Z.scopeValue("root",{ref:q});return LZ($,y$._`${w}.validate`,q,q.$async)}function F(w){let N=hF($,w);LZ($,N,w,w.$async)}function L(w){let N=Z.scopeValue("schema",Y.code.source===!0?{ref:w,code:(0,y$.stringify)(w)}:{ref:w}),I=Z.name("valid"),T=$.subschema({schema:w,dataTypes:[],schemaPath:y$.nil,topSchemaRef:N,errSchemaPath:X},I);$.mergeEvaluated(T),$.ok(I)}}};function hF($,Z){let{gen:X}=$;return Z.validate?X.scopeValue("validate",{ref:Z.validate}):y$._`${X.scopeValue("wrapper",{ref:Z})}.validate`}uF.getValidate=hF;function LZ($,Z,X,Q){let{gen:J,it:G}=$,{allErrors:W,schemaEnv:Y,opts:z}=G,q=z.passContext?Z9.default.this:y$.nil;if(Q)H();else B();function H(){if(!Y.$async)throw Error("async schema referenced by sync schema");let w=J.let("valid");J.try(()=>{if(J.code(y$._`await ${(0,gF.callValidateCode)($,Z,q)}`),L(Z),!W)J.assign(w,!0)},(N)=>{if(J.if(y$._`!(${N} instanceof ${G.ValidationError})`,()=>J.throw(N)),F(N),!W)J.assign(w,!1)}),$.ok(w)}function B(){$.result((0,gF.callValidateCode)($,Z,q),()=>L(Z),()=>F(Z))}function F(w){let N=y$._`${w}.errors`;J.assign(Z9.default.vErrors,y$._`${Z9.default.vErrors} === null ? ${N} : ${Z9.default.vErrors}.concat(${N})`),J.assign(Z9.default.errors,y$._`${Z9.default.vErrors}.length`)}function L(w){var N;if(!G.opts.unevaluated)return;let I=(N=X===null||X===void 0?void 0:X.validate)===null||N===void 0?void 0:N.evaluated;if(G.props!==!0)if(I&&!I.dynamicProps){if(I.props!==void 0)G.props=FZ.mergeEvaluated.props(J,I.props,G.props)}else{let T=J.var("props",y$._`${w}.evaluated.props`);G.props=FZ.mergeEvaluated.props(J,T,G.props,y$.Name)}if(G.items!==!0)if(I&&!I.dynamicItems){if(I.items!==void 0)G.items=FZ.mergeEvaluated.items(J,I.items,G.items)}else{let T=J.var("items",y$._`${w}.evaluated.items`);G.items=FZ.mergeEvaluated.items(J,T,G.items,y$.Name)}}}uF.callRef=LZ;uF.default=Kk});var KJ=b((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});var Vk=vF(),Bk=MZ(),Fk=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Vk.default,Bk.default];dF.default=Fk});var cF=b((lF)=>{Object.defineProperty(lF,"__esModule",{value:!0});var AZ=N0(),v6=AZ.operators,IZ={maximum:{okStr:"<=",ok:v6.LTE,fail:v6.GT},minimum:{okStr:">=",ok:v6.GTE,fail:v6.LT},exclusiveMaximum:{okStr:"<",ok:v6.LT,fail:v6.GTE},exclusiveMinimum:{okStr:">",ok:v6.GT,fail:v6.LTE}},Mk={message:({keyword:$,schemaCode:Z})=>AZ.str`must be ${IZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>AZ._`{comparison: ${IZ[$].okStr}, limit: ${Z}}`},Ak={keyword:Object.keys(IZ),type:"number",schemaType:"number",$data:!0,error:Mk,code($){let{keyword:Z,data:X,schemaCode:Q}=$;$.fail$data(AZ._`${X} ${IZ[Z].fail} ${Q} || isNaN(${X})`)}};lF.default=Ak});var iF=b((pF)=>{Object.defineProperty(pF,"__esModule",{value:!0});var H8=N0(),Nk={message:({schemaCode:$})=>H8.str`must be multiple of ${$}`,params:({schemaCode:$})=>H8._`{multipleOf: ${$}}`},Dk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Nk,code($){let{gen:Z,data:X,schemaCode:Q,it:J}=$,G=J.opts.multipleOfPrecision,W=Z.let("res"),Y=G?H8._`Math.abs(Math.round(${W}) - ${W}) > 1e-${G}`:H8._`${W} !== parseInt(${W})`;$.fail$data(H8._`(${Q} === 0 || (${W} = ${X}/${Q}, ${Y}))`)}};pF.default=Dk});var aF=b((rF)=>{Object.defineProperty(rF,"__esModule",{value:!0});function nF($){let Z=$.length,X=0,Q=0,J;while(Q<Z)if(X++,J=$.charCodeAt(Q++),J>=55296&&J<=56319&&Q<Z){if(J=$.charCodeAt(Q),(J&64512)===56320)Q++}return X}rF.default=nF;nF.code='require("ajv/dist/runtime/ucs2length").default'});var sF=b((oF)=>{Object.defineProperty(oF,"__esModule",{value:!0});var U4=N0(),jk=P0(),Ok=aF(),Ek={message({keyword:$,schemaCode:Z}){let X=$==="maxLength"?"more":"fewer";return U4.str`must NOT have ${X} than ${Z} characters`},params:({schemaCode:$})=>U4._`{limit: ${$}}`},Rk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ek,code($){let{keyword:Z,data:X,schemaCode:Q,it:J}=$,G=Z==="maxLength"?U4.operators.GT:U4.operators.LT,W=J.opts.unicode===!1?U4._`${X}.length`:U4._`${(0,jk.useFunc)($.gen,Ok.default)}(${X})`;$.fail$data(U4._`${W} ${G} ${Q}`)}};oF.default=Rk});var eF=b((tF)=>{Object.defineProperty(tF,"__esModule",{value:!0});var Ck=G1(),Sk=P0(),X9=N0(),_k={message:({schemaCode:$})=>X9.str`must match pattern "${$}"`,params:({schemaCode:$})=>X9._`{pattern: ${$}}`},bk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_k,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$,Y=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:z}=W.opts.code,q=z.code==="new RegExp"?X9._`new RegExp`:(0,Sk.useFunc)(Z,z),H=Z.let("valid");Z.try(()=>Z.assign(H,X9._`${q}(${G}, ${Y}).test(${X})`),()=>Z.assign(H,!1)),$.fail$data(X9._`!${H}`)}else{let z=(0,Ck.usePattern)($,J);$.fail$data(X9._`!${z}.test(${X})`)}}};tF.default=bk});var ZL=b(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});var V8=N0(),kk={message({keyword:$,schemaCode:Z}){let X=$==="maxProperties"?"more":"fewer";return V8.str`must NOT have ${X} than ${Z} properties`},params:({schemaCode:$})=>V8._`{limit: ${$}}`},yk={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxProperties"?V8.operators.GT:V8.operators.LT;$.fail$data(V8._`Object.keys(${X}).length ${J} ${Q}`)}};$L.default=yk});var QL=b((XL)=>{Object.defineProperty(XL,"__esModule",{value:!0});var B8=G1(),F8=N0(),gk=P0(),fk={message:({params:{missingProperty:$}})=>F8.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>F8._`{missingProperty: ${$}}`},hk={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fk,code($){let{gen:Z,schema:X,schemaCode:Q,data:J,$data:G,it:W}=$,{opts:Y}=W;if(!G&&X.length===0)return;let z=X.length>=Y.loopRequired;if(W.allErrors)q();else H();if(Y.strictRequired){let L=$.parentSchema.properties,{definedProperties:w}=$.it;for(let N of X)if((L===null||L===void 0?void 0:L[N])===void 0&&!w.has(N)){let I=W.schemaEnv.baseId+W.errSchemaPath,T=`required property "${N}" is not defined at "${I}" (strictRequired)`;(0,gk.checkStrictMode)(W,T,W.opts.strictRequired)}}function q(){if(z||G)$.block$data(F8.nil,B);else for(let L of X)(0,B8.checkReportMissingProp)($,L)}function H(){let L=Z.let("missing");if(z||G){let w=Z.let("valid",!0);$.block$data(w,()=>F(L,w)),$.ok(w)}else Z.if((0,B8.checkMissingProp)($,X,L)),(0,B8.reportMissingProp)($,L),Z.else()}function B(){Z.forOf("prop",Q,(L)=>{$.setParams({missingProperty:L}),Z.if((0,B8.noPropertyInData)(Z,J,L,Y.ownProperties),()=>$.error())})}function F(L,w){$.setParams({missingProperty:L}),Z.forOf(L,Q,()=>{Z.assign(w,(0,B8.propertyInData)(Z,J,L,Y.ownProperties)),Z.if((0,F8.not)(w),()=>{$.error(),Z.break()})},F8.nil)}}};XL.default=hk});var GL=b((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});var L8=N0(),mk={message({keyword:$,schemaCode:Z}){let X=$==="maxItems"?"more":"fewer";return L8.str`must NOT have ${X} than ${Z} items`},params:({schemaCode:$})=>L8._`{limit: ${$}}`},dk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxItems"?L8.operators.GT:L8.operators.LT;$.fail$data(L8._`${X}.length ${J} ${Q}`)}};JL.default=dk});var NZ=b((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});var WL=iQ();WL.code='require("ajv/dist/runtime/equal").default';YL.default=WL});var qL=b((zL)=>{Object.defineProperty(zL,"__esModule",{value:!0});var UJ=X8(),z$=N0(),pk=P0(),ik=NZ(),nk={message:({params:{i:$,j:Z}})=>z$.str`must NOT have duplicate items (items ## ${Z} and ${$} are identical)`,params:({params:{i:$,j:Z}})=>z$._`{i: ${$}, j: ${Z}}`},rk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:nk,code($){let{gen:Z,data:X,$data:Q,schema:J,parentSchema:G,schemaCode:W,it:Y}=$;if(!Q&&!J)return;let z=Z.let("valid"),q=G.items?(0,UJ.getSchemaTypes)(G.items):[];$.block$data(z,H,z$._`${W} === false`),$.ok(z);function H(){let w=Z.let("i",z$._`${X}.length`),N=Z.let("j");$.setParams({i:w,j:N}),Z.assign(z,!0),Z.if(z$._`${w} > 1`,()=>(B()?F:L)(w,N))}function B(){return q.length>0&&!q.some((w)=>w==="object"||w==="array")}function F(w,N){let I=Z.name("item"),T=(0,UJ.checkDataTypes)(q,I,Y.opts.strictNumbers,UJ.DataType.Wrong),E=Z.const("indices",z$._`{}`);Z.for(z$._`;${w}--;`,()=>{if(Z.let(I,z$._`${X}[${w}]`),Z.if(T,z$._`continue`),q.length>1)Z.if(z$._`typeof ${I} == "string"`,z$._`${I} += "_"`);Z.if(z$._`typeof ${E}[${I}] == "number"`,()=>{Z.assign(N,z$._`${E}[${I}]`),$.error(),Z.assign(z,!1).break()}).code(z$._`${E}[${I}] = ${w}`)})}function L(w,N){let I=(0,pk.useFunc)(Z,ik.default),T=Z.name("outer");Z.label(T).for(z$._`;${w}--;`,()=>Z.for(z$._`${N} = ${w}; ${N}--;`,()=>Z.if(z$._`${I}(${X}[${w}], ${X}[${N}])`,()=>{$.error(),Z.assign(z,!1).break(T)})))}}};zL.default=rk});var UL=b((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});var HJ=N0(),ok=P0(),sk=NZ(),tk={message:"must be equal to constant",params:({schemaCode:$})=>HJ._`{allowedValue: ${$}}`},ek={keyword:"const",$data:!0,error:tk,code($){let{gen:Z,data:X,$data:Q,schemaCode:J,schema:G}=$;if(Q||G&&typeof G=="object")$.fail$data(HJ._`!${(0,ok.useFunc)(Z,sk.default)}(${X}, ${J})`);else $.fail(HJ._`${G} !== ${X}`)}};KL.default=ek});var VL=b((HL)=>{Object.defineProperty(HL,"__esModule",{value:!0});var M8=N0(),Zy=P0(),Xy=NZ(),Qy={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>M8._`{allowedValues: ${$}}`},Jy={keyword:"enum",schemaType:"array",$data:!0,error:Qy,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$;if(!Q&&J.length===0)throw Error("enum must have non-empty array");let Y=J.length>=W.opts.loopEnum,z,q=()=>z!==null&&z!==void 0?z:z=(0,Zy.useFunc)(Z,Xy.default),H;if(Y||Q)H=Z.let("valid"),$.block$data(H,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let L=Z.const("vSchema",G);H=(0,M8.or)(...J.map((w,N)=>F(L,N)))}$.pass(H);function B(){Z.assign(H,!1),Z.forOf("v",G,(L)=>Z.if(M8._`${q()}(${X}, ${L})`,()=>Z.assign(H,!0).break()))}function F(L,w){let N=J[w];return typeof N==="object"&&N!==null?M8._`${q()}(${X}, ${L}[${w}])`:M8._`${X} === ${N}`}}};HL.default=Jy});var VJ=b((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});var Wy=cF(),Yy=iF(),zy=sF(),qy=eF(),Ky=ZL(),Uy=QL(),Hy=GL(),Vy=qL(),By=UL(),Fy=VL(),Ly=[Wy.default,Yy.default,zy.default,qy.default,Ky.default,Uy.default,Hy.default,Vy.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},By.default,Fy.default];BL.default=Ly});var FJ=b((LL)=>{Object.defineProperty(LL,"__esModule",{value:!0});LL.validateAdditionalItems=void 0;var H4=N0(),BJ=P0(),Ay={message:({params:{len:$}})=>H4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>H4._`{limit: ${$}}`},Iy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ay,code($){let{parentSchema:Z,it:X}=$,{items:Q}=Z;if(!Array.isArray(Q)){(0,BJ.checkStrictMode)(X,'"additionalItems" is ignored when "items" is not an array of schemas');return}FL($,Q)}};function FL($,Z){let{gen:X,schema:Q,data:J,keyword:G,it:W}=$;W.items=!0;let Y=X.const("len",H4._`${J}.length`);if(Q===!1)$.setParams({len:Z.length}),$.pass(H4._`${Y} <= ${Z.length}`);else if(typeof Q=="object"&&!(0,BJ.alwaysValidSchema)(W,Q)){let q=X.var("valid",H4._`${Y} <= ${Z.length}`);X.if((0,H4.not)(q),()=>z(q)),$.ok(q)}function z(q){X.forRange("i",Z.length,Y,(H)=>{if($.subschema({keyword:G,dataProp:H,dataPropType:BJ.Type.Num},q),!W.allErrors)X.if((0,H4.not)(q),()=>X.break())})}}LL.validateAdditionalItems=FL;LL.default=Iy});var LJ=b((NL)=>{Object.defineProperty(NL,"__esModule",{value:!0});NL.validateTuple=void 0;var AL=N0(),DZ=P0(),Dy=G1(),wy={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:Z,it:X}=$;if(Array.isArray(Z))return IL($,"additionalItems",Z);if(X.items=!0,(0,DZ.alwaysValidSchema)(X,Z))return;$.ok((0,Dy.validateArray)($))}};function IL($,Z,X=$.schema){let{gen:Q,parentSchema:J,data:G,keyword:W,it:Y}=$;if(H(J),Y.opts.unevaluated&&X.length&&Y.items!==!0)Y.items=DZ.mergeEvaluated.items(Q,X.length,Y.items);let z=Q.name("valid"),q=Q.const("len",AL._`${G}.length`);X.forEach((B,F)=>{if((0,DZ.alwaysValidSchema)(Y,B))return;Q.if(AL._`${q} > ${F}`,()=>$.subschema({keyword:W,schemaProp:F,dataProp:F},z)),$.ok(z)});function H(B){let{opts:F,errSchemaPath:L}=Y,w=X.length,N=w===B.minItems&&(w===B.maxItems||B[Z]===!1);if(F.strictTuples&&!N){let I=`"${W}" is ${w}-tuple, but minItems or maxItems/${Z} are not specified or different at path "${L}"`;(0,DZ.checkStrictMode)(Y,I,F.strictTuples)}}}NL.validateTuple=IL;NL.default=wy});var TL=b((wL)=>{Object.defineProperty(wL,"__esModule",{value:!0});var jy=LJ(),Oy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,jy.validateTuple)($,"items")};wL.default=Oy});var EL=b((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var jL=N0(),Ry=P0(),Py=G1(),Cy=FJ(),Sy={message:({params:{len:$}})=>jL.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>jL._`{limit: ${$}}`},_y={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Sy,code($){let{schema:Z,parentSchema:X,it:Q}=$,{prefixItems:J}=X;if(Q.items=!0,(0,Ry.alwaysValidSchema)(Q,Z))return;if(J)(0,Cy.validateAdditionalItems)($,J);else $.ok((0,Py.validateArray)($))}};OL.default=_y});var PL=b((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});var W1=N0(),wZ=P0(),xy={message:({params:{min:$,max:Z}})=>Z===void 0?W1.str`must contain at least ${$} valid item(s)`:W1.str`must contain at least ${$} and no more than ${Z} valid item(s)`,params:({params:{min:$,max:Z}})=>Z===void 0?W1._`{minContains: ${$}}`:W1._`{minContains: ${$}, maxContains: ${Z}}`},ky={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:xy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$,W,Y,{minContains:z,maxContains:q}=Q;if(G.opts.next)W=z===void 0?1:z,Y=q;else W=1;let H=Z.const("len",W1._`${J}.length`);if($.setParams({min:W,max:Y}),Y===void 0&&W===0){(0,wZ.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Y!==void 0&&W>Y){(0,wZ.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,wZ.alwaysValidSchema)(G,X)){let N=W1._`${H} >= ${W}`;if(Y!==void 0)N=W1._`${N} && ${H} <= ${Y}`;$.pass(N);return}G.items=!0;let B=Z.name("valid");if(Y===void 0&&W===1)L(B,()=>Z.if(B,()=>Z.break()));else if(W===0){if(Z.let(B,!0),Y!==void 0)Z.if(W1._`${J}.length > 0`,F)}else Z.let(B,!1),F();$.result(B,()=>$.reset());function F(){let N=Z.name("_valid"),I=Z.let("count",0);L(N,()=>Z.if(N,()=>w(I)))}function L(N,I){Z.forRange("i",0,H,(T)=>{$.subschema({keyword:"contains",dataProp:T,dataPropType:wZ.Type.Num,compositeRule:!0},N),I()})}function w(N){if(Z.code(W1._`${N}++`),Y===void 0)Z.if(W1._`${N} >= ${W}`,()=>Z.assign(B,!0).break());else if(Z.if(W1._`${N} > ${Y}`,()=>Z.assign(B,!1).break()),W===1)Z.assign(B,!0);else Z.if(W1._`${N} >= ${W}`,()=>Z.assign(B,!0))}}};RL.default=ky});var TZ=b((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});_L.validateSchemaDeps=_L.validatePropertyDeps=_L.error=void 0;var MJ=N0(),vy=P0(),A8=G1();_L.error={message:({params:{property:$,depsCount:Z,deps:X}})=>{let Q=Z===1?"property":"properties";return MJ.str`must have ${Q} ${X} when property ${$} is present`},params:({params:{property:$,depsCount:Z,deps:X,missingProperty:Q}})=>MJ._`{property: ${$},
394
393
  missingProperty: ${Q},
395
394
  depsCount: ${Z},
396
- deps: ${X}}`};var $y={keyword:"dependencies",type:"object",schemaType:"object",error:HL.error,code($){let[Z,X]=Zy($);UL($,Z),KL($,X)}};function Zy({schema:$}){let Z={},X={};for(let Q in $){if(Q==="__proto__")continue;let J=Array.isArray($[Q])?Z:X;J[Q]=$[Q]}return[Z,X]}function UL($,Z=$.schema){let{gen:X,data:Q,it:J}=$;if(Object.keys(Z).length===0)return;let G=X.let("missing");for(let W in Z){let Y=Z[W];if(Y.length===0)continue;let z=(0,q5.propertyInData)(X,Q,W,J.opts.ownProperties);if($.setParams({property:W,depsCount:Y.length,deps:Y.join(", ")}),J.allErrors)X.if(z,()=>{for(let q of Y)(0,q5.checkReportMissingProp)($,q)});else X.if(XJ._`${z} && (${(0,q5.checkMissingProp)($,Y,G)})`),(0,q5.reportMissingProp)($,G),X.else()}}HL.validatePropertyDeps=UL;function KL($,Z=$.schema){let{gen:X,data:Q,keyword:J,it:G}=$,W=X.name("valid");for(let Y in Z){if((0,ek.alwaysValidSchema)(G,Z[Y]))continue;X.if((0,q5.propertyInData)(X,Q,Y,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Y},W);$.mergeValidEvaluated(z,W)},()=>X.var(W,!0)),$.ok(W)}}HL.validateSchemaDeps=KL;HL.default=$y});var ML=b((LL)=>{Object.defineProperty(LL,"__esModule",{value:!0});var FL=A0(),Jy=O0(),Gy={message:"property name must be valid",params:({params:$})=>FL._`{propertyName: ${$.propertyName}}`},Wy={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Gy,code($){let{gen:Z,schema:X,data:Q,it:J}=$;if((0,Jy.alwaysValidSchema)(J,X))return;let G=Z.name("valid");Z.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},G),Z.if((0,FL.not)(G),()=>{if($.error(!0),!J.allErrors)Z.break()})}),$.ok(G)}};LL.default=Wy});var QJ=b((AL)=>{Object.defineProperty(AL,"__esModule",{value:!0});var KZ=J6(),B6=A0(),zy=Q6(),HZ=O0(),qy={message:"must NOT have additional properties",params:({params:$})=>B6._`{additionalProperty: ${$.additionalProperty}}`},Uy={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,errsCount:G,it:W}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Y,opts:z}=W;if(W.props=!0,z.removeAdditional!=="all"&&(0,HZ.alwaysValidSchema)(W,X))return;let q=(0,KZ.allSchemaProperties)(Q.properties),H=(0,KZ.allSchemaProperties)(Q.patternProperties);B(),$.ok(B6._`${G} === ${zy.default.errors}`);function B(){Z.forIn("key",J,(D)=>{if(!q.length&&!H.length)A(D);else Z.if(L(D),()=>A(D))})}function L(D){let j;if(q.length>8){let E=(0,HZ.schemaRefOrVal)(W,Q.properties,"properties");j=(0,KZ.isOwnProperty)(Z,E,D)}else if(q.length)j=(0,B6.or)(...q.map((E)=>B6._`${D} === ${E}`));else j=B6.nil;if(H.length)j=(0,B6.or)(j,...H.map((E)=>B6._`${(0,KZ.usePattern)($,E)}.test(${D})`));return(0,B6.not)(j)}function M(D){Z.code(B6._`delete ${J}[${D}]`)}function A(D){if(z.removeAdditional==="all"||z.removeAdditional&&X===!1){M(D);return}if(X===!1){if($.setParams({additionalProperty:D}),$.error(),!Y)Z.break();return}if(typeof X=="object"&&!(0,HZ.alwaysValidSchema)(W,X)){let j=Z.name("valid");if(z.removeAdditional==="failing")w(D,j,!1),Z.if((0,B6.not)(j),()=>{$.reset(),M(D)});else if(w(D,j),!Y)Z.if((0,B6.not)(j),()=>Z.break())}}function w(D,j,E){let P={keyword:"additionalProperties",dataProp:D,dataPropType:HZ.Type.Str};if(E===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,j)}}};AL.default=Uy});var wL=b((DL)=>{Object.defineProperty(DL,"__esModule",{value:!0});var Hy=p4(),IL=J6(),JJ=O0(),NL=QJ(),Vy={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)NL.default.code(new Hy.KeywordCxt(G,NL.default,"additionalProperties"));let W=(0,IL.allSchemaProperties)(X);for(let B of W)G.definedProperties.add(B);if(G.opts.unevaluated&&W.length&&G.props!==!0)G.props=JJ.mergeEvaluated.props(Z,(0,JJ.toHash)(W),G.props);let Y=W.filter((B)=>!(0,JJ.alwaysValidSchema)(G,X[B]));if(Y.length===0)return;let z=Z.name("valid");for(let B of Y){if(q(B))H(B);else{if(Z.if((0,IL.propertyInData)(Z,J,B,G.opts.ownProperties)),H(B),!G.allErrors)Z.else().var(z,!0);Z.endIf()}$.it.definedProperties.add(B),$.ok(z)}function q(B){return G.opts.useDefaults&&!G.compositeRule&&X[B].default!==void 0}function H(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},z)}}};DL.default=Vy});var RL=b((EL)=>{Object.defineProperty(EL,"__esModule",{value:!0});var TL=J6(),VZ=A0(),jL=O0(),OL=O0(),Fy={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,data:Q,parentSchema:J,it:G}=$,{opts:W}=G,Y=(0,TL.allSchemaProperties)(X),z=Y.filter((w)=>(0,jL.alwaysValidSchema)(G,X[w]));if(Y.length===0||z.length===Y.length&&(!G.opts.unevaluated||G.props===!0))return;let q=W.strictSchema&&!W.allowMatchingProperties&&J.properties,H=Z.name("valid");if(G.props!==!0&&!(G.props instanceof VZ.Name))G.props=(0,OL.evaluatedPropsToName)(Z,G.props);let{props:B}=G;L();function L(){for(let w of Y){if(q)M(w);if(G.allErrors)A(w);else Z.var(H,!0),A(w),Z.if(H)}}function M(w){for(let D in q)if(new RegExp(w).test(D))(0,jL.checkStrictMode)(G,`property ${D} matches pattern ${w} (use allowMatchingProperties)`)}function A(w){Z.forIn("key",Q,(D)=>{Z.if(VZ._`${(0,TL.usePattern)($,w)}.test(${D})`,()=>{let j=z.includes(w);if(!j)$.subschema({keyword:"patternProperties",schemaProp:w,dataProp:D,dataPropType:OL.Type.Str},H);if(G.opts.unevaluated&&B!==!0)Z.assign(VZ._`${B}[${D}]`,!0);else if(!j&&!G.allErrors)Z.if((0,VZ.not)(H),()=>Z.break())})})}}};EL.default=Fy});var CL=b((PL)=>{Object.defineProperty(PL,"__esModule",{value:!0});var My=O0(),Ay={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:Z,schema:X,it:Q}=$;if((0,My.alwaysValidSchema)(Q,X)){$.fail();return}let J=Z.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};PL.default=Ay});var _L=b((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});var Ny=J6(),Dy={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ny.validateUnion,error:{message:"must match a schema in anyOf"}};SL.default=Dy});var bL=b((xL)=>{Object.defineProperty(xL,"__esModule",{value:!0});var BZ=A0(),Ty=O0(),jy={message:"must match exactly one schema in oneOf",params:({params:$})=>BZ._`{passingSchemas: ${$.passing}}`},Oy={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:jy,code($){let{gen:Z,schema:X,parentSchema:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(J.opts.discriminator&&Q.discriminator)return;let G=X,W=Z.let("valid",!1),Y=Z.let("passing",null),z=Z.name("_valid");$.setParams({passing:Y}),Z.block(q),$.result(W,()=>$.reset(),()=>$.error(!0));function q(){G.forEach((H,B)=>{let L;if((0,Ty.alwaysValidSchema)(J,H))Z.var(z,!0);else L=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},z);if(B>0)Z.if(BZ._`${z} && ${W}`).assign(W,!1).assign(Y,BZ._`[${Y}, ${B}]`).else();Z.if(z,()=>{if(Z.assign(W,!0),Z.assign(Y,B),L)$.mergeEvaluated(L,BZ.Name)})})}}};xL.default=Oy});var yL=b((kL)=>{Object.defineProperty(kL,"__esModule",{value:!0});var Ry=O0(),Py={keyword:"allOf",schemaType:"array",code($){let{gen:Z,schema:X,it:Q}=$;if(!Array.isArray(X))throw Error("ajv implementation error");let J=Z.name("valid");X.forEach((G,W)=>{if((0,Ry.alwaysValidSchema)(Q,G))return;let Y=$.subschema({keyword:"allOf",schemaProp:W},J);$.ok(J),$.mergeEvaluated(Y)})}};kL.default=Py});var hL=b((fL)=>{Object.defineProperty(fL,"__esModule",{value:!0});var FZ=A0(),gL=O0(),Sy={message:({params:$})=>FZ.str`must match "${$.ifClause}" schema`,params:({params:$})=>FZ._`{failingKeyword: ${$.ifClause}}`},_y={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Sy,code($){let{gen:Z,parentSchema:X,it:Q}=$;if(X.then===void 0&&X.else===void 0)(0,gL.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let J=vL(Q,"then"),G=vL(Q,"else");if(!J&&!G)return;let W=Z.let("valid",!0),Y=Z.name("_valid");if(z(),$.reset(),J&&G){let H=Z.let("ifClause");$.setParams({ifClause:H}),Z.if(Y,q("then",H),q("else",H))}else if(J)Z.if(Y,q("then"));else Z.if((0,FZ.not)(Y),q("else"));$.pass(W,()=>$.error(!0));function z(){let H=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Y);$.mergeEvaluated(H)}function q(H,B){return()=>{let L=$.subschema({keyword:H},Y);if(Z.assign(W,Y),$.mergeValidEvaluated(L,W),B)Z.assign(B,FZ._`${H}`);else $.setParams({ifClause:H})}}}};function vL($,Z){let X=$.schema[Z];return X!==void 0&&!(0,gL.alwaysValidSchema)($,X)}fL.default=_y});var mL=b((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});var by=O0(),ky={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:Z,it:X}){if(Z.if===void 0)(0,by.checkStrictMode)(X,`"${$}" without "if" is ignored`)}};uL.default=ky});var GJ=b((dL)=>{Object.defineProperty(dL,"__esModule",{value:!0});var vy=$J(),gy=JL(),fy=ZJ(),hy=YL(),uy=qL(),my=UZ(),dy=ML(),ly=QJ(),cy=wL(),py=RL(),iy=CL(),ny=_L(),ry=bL(),ay=yL(),oy=hL(),sy=mL();function ty($=!1){let Z=[iy.default,ny.default,ry.default,ay.default,oy.default,sy.default,dy.default,ly.default,my.default,cy.default,py.default];if($)Z.push(gy.default,hy.default);else Z.push(vy.default,fy.default);return Z.push(uy.default),Z}dL.default=ty});var YJ=b((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});pL.dynamicAnchor=void 0;var WJ=A0(),$v=Q6(),lL=e9(),Zv=JZ(),Xv={keyword:"$dynamicAnchor",schemaType:"string",code:($)=>cL($,$.schema)};function cL($,Z){let{gen:X,it:Q}=$;Q.schemaEnv.root.dynamicAnchors[Z]=!0;let J=WJ._`${$v.default.dynamicAnchors}${(0,WJ.getProperty)(Z)}`,G=Q.errSchemaPath==="#"?Q.validateName:Qv($);X.if(WJ._`!${J}`,()=>X.assign(J,G))}pL.dynamicAnchor=cL;function Qv($){let{schemaEnv:Z,schema:X,self:Q}=$.it,{root:J,baseId:G,localRefs:W,meta:Y}=Z.root,{schemaId:z}=Q.opts,q=new lL.SchemaEnv({schema:X,schemaId:z,root:J,baseId:G,localRefs:W,meta:Y});return lL.compileSchema.call(Q,q),(0,Zv.getValidate)($,q)}pL.default=Xv});var zJ=b((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});oL.dynamicRef=void 0;var nL=A0(),Gv=Q6(),rL=JZ(),Wv={keyword:"$dynamicRef",schemaType:"string",code:($)=>aL($,$.schema)};function aL($,Z){let{gen:X,keyword:Q,it:J}=$;if(Z[0]!=="#")throw Error(`"${Q}" only supports hash fragment reference`);let G=Z.slice(1);if(J.allErrors)W();else{let z=X.let("valid",!1);W(z),$.ok(z)}function W(z){if(J.schemaEnv.root.dynamicAnchors[G]){let q=X.let("_v",nL._`${Gv.default.dynamicAnchors}${(0,nL.getProperty)(G)}`);X.if(q,Y(q,z),Y(J.validateName,z))}else Y(J.validateName,z)()}function Y(z,q){return q?()=>X.block(()=>{(0,rL.callRef)($,z),X.let(q,!0)}):()=>(0,rL.callRef)($,z)}}oL.dynamicRef=aL;oL.default=Wv});var eL=b((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});var zv=YJ(),qv=O0(),Uv={keyword:"$recursiveAnchor",schemaType:"boolean",code($){if($.schema)(0,zv.dynamicAnchor)($,"");else(0,qv.checkStrictMode)($.it,"$recursiveAnchor: false is ignored")}};tL.default=Uv});var ZM=b(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});var Hv=zJ(),Vv={keyword:"$recursiveRef",schemaType:"string",code:($)=>(0,Hv.dynamicRef)($,$.schema)};$M.default=Vv});var QM=b((XM)=>{Object.defineProperty(XM,"__esModule",{value:!0});var Fv=YJ(),Lv=zJ(),Mv=eL(),Av=ZM(),Iv=[Fv.default,Lv.default,Mv.default,Av.default];XM.default=Iv});var WM=b((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});var JM=UZ(),Dv={keyword:"dependentRequired",type:"object",schemaType:"object",error:JM.error,code:($)=>(0,JM.validatePropertyDeps)($)};GM.default=Dv});var zM=b((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});var Tv=UZ(),jv={keyword:"dependentSchemas",type:"object",schemaType:"object",code:($)=>(0,Tv.validateSchemaDeps)($)};YM.default=jv});var UM=b((qM)=>{Object.defineProperty(qM,"__esModule",{value:!0});var Ev=O0(),Rv={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:$,parentSchema:Z,it:X}){if(Z.contains===void 0)(0,Ev.checkStrictMode)(X,`"${$}" without "contains" is ignored`)}};qM.default=Rv});var HM=b((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});var Cv=WM(),Sv=zM(),_v=UM(),xv=[Cv.default,Sv.default,_v.default];KM.default=xv});var FM=b((BM)=>{Object.defineProperty(BM,"__esModule",{value:!0});var k1=A0(),VM=O0(),kv=Q6(),yv={message:"must NOT have unevaluated properties",params:({params:$})=>k1._`{unevaluatedProperty: ${$.unevaluatedProperty}}`},vv={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:yv,code($){let{gen:Z,schema:X,data:Q,errsCount:J,it:G}=$;if(!J)throw Error("ajv implementation error");let{allErrors:W,props:Y}=G;if(Y instanceof k1.Name)Z.if(k1._`${Y} !== true`,()=>Z.forIn("key",Q,(B)=>Z.if(q(Y,B),()=>z(B))));else if(Y!==!0)Z.forIn("key",Q,(B)=>Y===void 0?z(B):Z.if(H(Y,B),()=>z(B)));G.props=!0,$.ok(k1._`${J} === ${kv.default.errors}`);function z(B){if(X===!1){if($.setParams({unevaluatedProperty:B}),$.error(),!W)Z.break();return}if(!(0,VM.alwaysValidSchema)(G,X)){let L=Z.name("valid");if($.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:VM.Type.Str},L),!W)Z.if((0,k1.not)(L),()=>Z.break())}}function q(B,L){return k1._`!${B} || !${B}[${L}]`}function H(B,L){let M=[];for(let A in B)if(B[A]===!0)M.push(k1._`${L} !== ${A}`);return(0,k1.and)(...M)}}};BM.default=vv});var AM=b((MM)=>{Object.defineProperty(MM,"__esModule",{value:!0});var Y4=A0(),LM=O0(),fv={message:({params:{len:$}})=>Y4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>Y4._`{limit: ${$}}`},hv={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:fv,code($){let{gen:Z,schema:X,data:Q,it:J}=$,G=J.items||0;if(G===!0)return;let W=Z.const("len",Y4._`${Q}.length`);if(X===!1)$.setParams({len:G}),$.fail(Y4._`${W} > ${G}`);else if(typeof X=="object"&&!(0,LM.alwaysValidSchema)(J,X)){let z=Z.var("valid",Y4._`${W} <= ${G}`);Z.if((0,Y4.not)(z),()=>Y(z,G)),$.ok(z)}J.items=!0;function Y(z,q){Z.forRange("i",q,W,(H)=>{if($.subschema({keyword:"unevaluatedItems",dataProp:H,dataPropType:LM.Type.Num},z),!J.allErrors)Z.if((0,Y4.not)(z),()=>Z.break())})}}};MM.default=hv});var NM=b((IM)=>{Object.defineProperty(IM,"__esModule",{value:!0});var mv=FM(),dv=AM(),lv=[mv.default,dv.default];IM.default=lv});var wM=b((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});var o0=A0(),pv={message:({schemaCode:$})=>o0.str`must match format "${$}"`,params:({schemaCode:$})=>o0._`{format: ${$}}`},iv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:pv,code($,Z){let{gen:X,data:Q,$data:J,schema:G,schemaCode:W,it:Y}=$,{opts:z,errSchemaPath:q,schemaEnv:H,self:B}=Y;if(!z.validateFormats)return;if(J)L();else M();function L(){let A=X.scopeValue("formats",{ref:B.formats,code:z.code.formats}),w=X.const("fDef",o0._`${A}[${W}]`),D=X.let("fType"),j=X.let("format");X.if(o0._`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>X.assign(D,o0._`${w}.type || "string"`).assign(j,o0._`${w}.validate`),()=>X.assign(D,o0._`"string"`).assign(j,w)),$.fail$data((0,o0.or)(E(),P()));function E(){if(z.strictSchema===!1)return o0.nil;return o0._`${W} && !${j}`}function P(){let R=H.$async?o0._`(${w}.async ? await ${j}(${Q}) : ${j}(${Q}))`:o0._`${j}(${Q})`,C=o0._`(typeof ${j} == "function" ? ${R} : ${j}.test(${Q}))`;return o0._`${j} && ${j} !== true && ${D} === ${Z} && !${C}`}}function M(){let A=B.formats[G];if(!A){E();return}if(A===!0)return;let[w,D,j]=P(A);if(w===Z)$.pass(R());function E(){if(z.strictSchema===!1){B.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${G}" ignored in schema at path "${q}"`}}function P(C){let v=C instanceof RegExp?(0,o0.regexpCode)(C):z.code.formats?o0._`${z.code.formats}${(0,o0.getProperty)(G)}`:void 0,d=X.scopeValue("formats",{key:G,ref:C,code:v});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,o0._`${d}.validate`];return["string",C,d]}function R(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!H.$async)throw Error("async format in sync schema");return o0._`await ${j}(${Q})`}return typeof D=="function"?o0._`${j}(${Q})`:o0._`${j}.test(${Q})`}}}};DM.default=iv});var qJ=b((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});var rv=wM(),av=[rv.default];TM.default=av});var UJ=b((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});jM.contentVocabulary=jM.metadataVocabulary=void 0;jM.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];jM.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var PM=b((RM)=>{Object.defineProperty(RM,"__esModule",{value:!0});var tv=aQ(),ev=tQ(),$g=GJ(),Zg=QM(),Xg=HM(),Qg=NM(),Jg=qJ(),EM=UJ(),Gg=[Zg.default,tv.default,ev.default,(0,$g.default)(!0),Jg.default,EM.metadataVocabulary,EM.contentVocabulary,Xg.default,Qg.default];RM.default=Gg});var xM=b((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});SM.DiscrError=void 0;var CM;(function($){$.Tag="tag",$.Mapping="mapping"})(CM||(SM.DiscrError=CM={}))});var HJ=b((kM)=>{Object.defineProperty(kM,"__esModule",{value:!0});var s4=A0(),KJ=xM(),bM=e9(),Yg=i4(),zg=O0(),qg={message:({params:{discrError:$,tagName:Z}})=>$===KJ.DiscrError.Tag?`tag "${Z}" must be string`:`value of tag "${Z}" must be in oneOf`,params:({params:{discrError:$,tag:Z,tagName:X}})=>s4._`{error: ${$}, tag: ${X}, tagValue: ${Z}}`},Ug={keyword:"discriminator",type:"object",schemaType:"object",error:qg,code($){let{gen:Z,data:X,schema:Q,parentSchema:J,it:G}=$,{oneOf:W}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Y=Q.propertyName;if(typeof Y!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let z=Z.let("valid",!1),q=Z.const("tag",s4._`${X}${(0,s4.getProperty)(Y)}`);Z.if(s4._`typeof ${q} == "string"`,()=>H(),()=>$.error(!1,{discrError:KJ.DiscrError.Tag,tag:q,tagName:Y})),$.ok(z);function H(){let M=L();Z.if(!1);for(let A in M)Z.elseIf(s4._`${q} === ${A}`),Z.assign(z,B(M[A]));Z.else(),$.error(!1,{discrError:KJ.DiscrError.Mapping,tag:q,tagName:Y}),Z.endIf()}function B(M){let A=Z.name("valid"),w=$.subschema({keyword:"oneOf",schemaProp:M},A);return $.mergeEvaluated(w,s4.Name),A}function L(){var M;let A={},w=j(J),D=!0;for(let R=0;R<W.length;R++){let C=W[R];if((C===null||C===void 0?void 0:C.$ref)&&!(0,zg.schemaHasRulesButRef)(C,G.self.RULES)){let d=C.$ref;if(C=bM.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,d),C instanceof bM.SchemaEnv)C=C.schema;if(C===void 0)throw new Yg.default(G.opts.uriResolver,G.baseId,d)}let v=(M=C===null||C===void 0?void 0:C.properties)===null||M===void 0?void 0:M[Y];if(typeof v!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Y}"`);D=D&&(w||j(C)),E(v,R)}if(!D)throw Error(`discriminator: "${Y}" must be required`);return A;function j({required:R}){return Array.isArray(R)&&R.includes(Y)}function E(R,C){if(R.const)P(R.const,C);else if(R.enum)for(let v of R.enum)P(v,C);else throw Error(`discriminator: "properties/${Y}" must have "const" or "enum"`)}function P(R,C){if(typeof R!="string"||R in A)throw Error(`discriminator: "${Y}" values must be unique strings`);A[R]=C}}}};kM.default=Ug});var yM=b((vn,Hg)=>{Hg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var vM=b((gn,Vg)=>{Vg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var gM=b((fn,Bg)=>{Bg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var fM=b((hn,Fg)=>{Fg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var hM=b((un,Lg)=>{Lg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var uM=b((mn,Mg)=>{Mg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var mM=b((dn,Ag)=>{Ag.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var dM=b((ln,Ig)=>{Ig.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var cM=b((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});var Ng=yM(),Dg=vM(),wg=gM(),Tg=fM(),jg=hM(),Og=uM(),Eg=mM(),Rg=dM(),Pg=["/properties"];function Cg($){return[Ng,Dg,wg,Tg,jg,Z(this,Og),Eg,Z(this,Rg)].forEach((X)=>this.addMetaSchema(X,void 0,!1)),this;function Z(X,Q){return $?X.$dataMetaSchema(Q,Pg):Q}}lM.default=Cg});var FJ=b((y$,BJ)=>{Object.defineProperty(y$,"__esModule",{value:!0});y$.MissingRefError=y$.ValidationError=y$.CodeGen=y$.Name=y$.nil=y$.stringify=y$.str=y$._=y$.KeywordCxt=y$.Ajv2020=void 0;var _g=rQ(),xg=PM(),bg=HJ(),kg=cM(),VJ="https://json-schema.org/draft/2020-12/schema";class U5 extends _g.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),xg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(bg.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:$,meta:Z}=this.opts;if(!Z)return;kg.default.call(this,$),this.refs["http://json-schema.org/schema"]=VJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(VJ)?VJ:void 0)}}y$.Ajv2020=U5;BJ.exports=y$=U5;BJ.exports.Ajv2020=U5;Object.defineProperty(y$,"__esModule",{value:!0});y$.default=U5;var yg=p4();Object.defineProperty(y$,"KeywordCxt",{enumerable:!0,get:function(){return yg.KeywordCxt}});var t4=A0();Object.defineProperty(y$,"_",{enumerable:!0,get:function(){return t4._}});Object.defineProperty(y$,"str",{enumerable:!0,get:function(){return t4.str}});Object.defineProperty(y$,"stringify",{enumerable:!0,get:function(){return t4.stringify}});Object.defineProperty(y$,"nil",{enumerable:!0,get:function(){return t4.nil}});Object.defineProperty(y$,"Name",{enumerable:!0,get:function(){return t4.Name}});Object.defineProperty(y$,"CodeGen",{enumerable:!0,get:function(){return t4.CodeGen}});var vg=s9();Object.defineProperty(y$,"ValidationError",{enumerable:!0,get:function(){return vg.default}});var gg=i4();Object.defineProperty(y$,"MissingRefError",{enumerable:!0,get:function(){return gg.default}})});import{existsSync as MZ,readFileSync as K5}from"node:fs";import{createRequire as pM}from"node:module";import{isAbsolute as ug,relative as mg,resolve as LZ}from"node:path";import{fileURLToPath as iM,pathToFileURL as dg}from"node:url";async function nM($){let Z=LZ($),X=LZ(Z,"project.json"),Q=LZ(Z,"project.schema.json");if(!MZ(X))throw Error(`project.json not found in ${Z}`);if(!MZ(Q))throw Error(`project.schema.json not found in ${Z} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(K5(X,"utf8")),G=JSON.parse(K5(Q,"utf8"));G.$id=dg(Q).href;let W;try{({default:W}=await Promise.resolve().then(() => B$(FJ(),1)))}catch(H){throw Error("Project validation requires ajv: bun add ajv",{cause:H})}let z=await new W({allErrors:!0,loadSchema:(H)=>lg(H,Z),strict:!1}).compileAsync(G),q=z(J);return{errors:z.errors??null,valid:q}}async function lg($,Z){if(!$.startsWith("file:"))throw Error(`Cannot resolve schema ref "${$}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let X=iM($),Q=mg(Z,X);if(Q.startsWith("..")||ug(Q))throw Error(`Schema ref "${$}" escapes the project root ${Z}`);if(MZ(X))return JSON.parse(K5(X,"utf8"));let J=Q.split("\\").join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${$}" does not exist`);let Y=J.slice(W+G.length),z;try{z=pM(LZ(Z,"package.json")).resolve(Y)}catch{try{z=pM(import.meta.url).resolve(Y)}catch(q){if(Y.startsWith("@jxsuite/schema/")){let B=iM(new URL(`../${Y.slice(16)}`,import.meta.url));if(MZ(B))return JSON.parse(K5(B,"utf8"))}throw Error(`Schema ref "${$}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(K5(z,"utf8"))}var rM=()=>{};var JA=b((XA)=>{Object.defineProperty(XA,"__esModule",{value:!0});XA.formatNames=XA.fastFormats=XA.fullFormats=void 0;function v6($,Z){return{validate:$,compare:Z}}XA.fullFormats={date:v6(tM,IJ),time:v6(MJ(!0),NJ),"date-time":v6(aM(!0),$A),"iso-time":v6(MJ(),eM),"iso-date-time":v6(aM(),ZA),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:ag,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Xf,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:og,int32:{type:"number",validate:eg},int64:{type:"number",validate:$f},float:{type:"number",validate:sM},double:{type:"number",validate:sM},password:!0,binary:!0};XA.fastFormats={...XA.fullFormats,date:v6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,IJ),time:v6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,NJ),"date-time":v6(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$A),"iso-time":v6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,eM),"iso-date-time":v6(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ZA),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};XA.formatNames=Object.keys(XA.fullFormats);function cg($){return $%4===0&&($%100!==0||$%400===0)}var pg=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ig=[0,31,28,31,30,31,30,31,31,30,31,30,31];function tM($){let Z=pg.exec($);if(!Z)return!1;let X=+Z[1],Q=+Z[2],J=+Z[3];return Q>=1&&Q<=12&&J>=1&&J<=(Q===2&&cg(X)?29:ig[Q])}function IJ($,Z){if(!($&&Z))return;if($>Z)return 1;if($<Z)return-1;return 0}var LJ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function MJ($){return function(X){let Q=LJ.exec(X);if(!Q)return!1;let J=+Q[1],G=+Q[2],W=+Q[3],Y=Q[4],z=Q[5]==="-"?-1:1,q=+(Q[6]||0),H=+(Q[7]||0);if(q>23||H>59||$&&!Y)return!1;if(J<=23&&G<=59&&W<60)return!0;let B=G-H*z,L=J-q*z-(B<0?1:0);return(L===23||L===-1)&&(B===59||B===-1)&&W<61}}function NJ($,Z){if(!($&&Z))return;let X=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+Z).valueOf();if(!(X&&Q))return;return X-Q}function eM($,Z){if(!($&&Z))return;let X=LJ.exec($),Q=LJ.exec(Z);if(!(X&&Q))return;if($=X[1]+X[2]+X[3],Z=Q[1]+Q[2]+Q[3],$>Z)return 1;if($<Z)return-1;return 0}var AJ=/t|\s/i;function aM($){let Z=MJ($);return function(Q){let J=Q.split(AJ);return J.length===2&&tM(J[0])&&Z(J[1])}}function $A($,Z){if(!($&&Z))return;let X=new Date($).valueOf(),Q=new Date(Z).valueOf();if(!(X&&Q))return;return X-Q}function ZA($,Z){if(!($&&Z))return;let[X,Q]=$.split(AJ),[J,G]=Z.split(AJ),W=IJ(X,J);if(W===void 0)return;return W||NJ(Q,G)}var ng=/\/|:/,rg=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ag($){return ng.test($)&&rg.test($)}var oM=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function og($){return oM.lastIndex=0,oM.test($)}var sg=-2147483648,tg=2147483647;function eg($){return Number.isInteger($)&&$<=tg&&$>=sg}function $f($){return Number.isInteger($)}function sM(){return!0}var Zf=/[^\\]\\Z/;function Xf($){if(Zf.test($))return!1;try{return new RegExp($),!0}catch(Z){return!1}}});var YA=b((WA)=>{Object.defineProperty(WA,"__esModule",{value:!0});var Jf=aQ(),Gf=tQ(),Wf=GJ(),Yf=qJ(),GA=UJ(),zf=[Jf.default,Gf.default,(0,Wf.default)(),Yf.default,GA.metadataVocabulary,GA.contentVocabulary];WA.default=zf});var zA=b((Yr,Uf)=>{Uf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var UA=b((v$,wJ)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.MissingRefError=v$.ValidationError=v$.CodeGen=v$.Name=v$.nil=v$.stringify=v$.str=v$._=v$.KeywordCxt=v$.Ajv=void 0;var Kf=rQ(),Hf=YA(),Vf=HJ(),qA=zA(),Bf=["/properties"],AZ="http://json-schema.org/draft-07/schema";class H5 extends Kf.default{_addVocabularies(){if(super._addVocabularies(),Hf.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Vf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(qA,Bf):qA;this.addMetaSchema($,AZ,!1),this.refs["http://json-schema.org/schema"]=AZ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(AZ)?AZ:void 0)}}v$.Ajv=H5;wJ.exports=v$=H5;wJ.exports.Ajv=H5;Object.defineProperty(v$,"__esModule",{value:!0});v$.default=H5;var Ff=p4();Object.defineProperty(v$,"KeywordCxt",{enumerable:!0,get:function(){return Ff.KeywordCxt}});var e4=A0();Object.defineProperty(v$,"_",{enumerable:!0,get:function(){return e4._}});Object.defineProperty(v$,"str",{enumerable:!0,get:function(){return e4.str}});Object.defineProperty(v$,"stringify",{enumerable:!0,get:function(){return e4.stringify}});Object.defineProperty(v$,"nil",{enumerable:!0,get:function(){return e4.nil}});Object.defineProperty(v$,"Name",{enumerable:!0,get:function(){return e4.Name}});Object.defineProperty(v$,"CodeGen",{enumerable:!0,get:function(){return e4.CodeGen}});var Lf=s9();Object.defineProperty(v$,"ValidationError",{enumerable:!0,get:function(){return Lf.default}});var Mf=i4();Object.defineProperty(v$,"MissingRefError",{enumerable:!0,get:function(){return Mf.default}})});var HA=b((KA)=>{Object.defineProperty(KA,"__esModule",{value:!0});KA.formatLimitDefinition=void 0;var Nf=UA(),F6=A0(),y1=F6.operators,IZ={formatMaximum:{okStr:"<=",ok:y1.LTE,fail:y1.GT},formatMinimum:{okStr:">=",ok:y1.GTE,fail:y1.LT},formatExclusiveMaximum:{okStr:"<",ok:y1.LT,fail:y1.GTE},formatExclusiveMinimum:{okStr:">",ok:y1.GT,fail:y1.LTE}},Df={message:({keyword:$,schemaCode:Z})=>F6.str`should be ${IZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>F6._`{comparison: ${IZ[$].okStr}, limit: ${Z}}`};KA.formatLimitDefinition={keyword:Object.keys(IZ),type:"string",schemaType:"string",$data:!0,error:Df,code($){let{gen:Z,data:X,schemaCode:Q,keyword:J,it:G}=$,{opts:W,self:Y}=G;if(!W.validateFormats)return;let z=new Nf.KeywordCxt(G,Y.RULES.all.format.definition,"format");if(z.$data)q();else H();function q(){let L=Z.scopeValue("formats",{ref:Y.formats,code:W.code.formats}),M=Z.const("fmt",F6._`${L}[${z.schemaCode}]`);$.fail$data((0,F6.or)(F6._`typeof ${M} != "object"`,F6._`${M} instanceof RegExp`,F6._`typeof ${M}.compare != "function"`,B(M)))}function H(){let L=z.schema,M=Y.formats[L];if(!M||M===!0)return;if(typeof M!="object"||M instanceof RegExp||typeof M.compare!="function")throw Error(`"${J}": format "${L}" does not define "compare" function`);let A=Z.scopeValue("formats",{key:L,ref:M,code:W.code.formats?F6._`${W.code.formats}${(0,F6.getProperty)(L)}`:void 0});$.fail$data(B(A))}function B(L){return F6._`${L}.compare(${X}, ${Q}) ${IZ[J].fail} 0`}},dependencies:["format"]};var wf=($)=>{return $.addKeyword(KA.formatLimitDefinition),$};KA.default=wf});var LA=b((V5,FA)=>{Object.defineProperty(V5,"__esModule",{value:!0});var $9=JA(),jf=HA(),jJ=A0(),VA=new jJ.Name("fullFormats"),Of=new jJ.Name("fastFormats"),OJ=($,Z={keywords:!0})=>{if(Array.isArray(Z))return BA($,Z,$9.fullFormats,VA),$;let[X,Q]=Z.mode==="fast"?[$9.fastFormats,Of]:[$9.fullFormats,VA],J=Z.formats||$9.formatNames;if(BA($,J,X,Q),Z.keywords)(0,jf.default)($);return $};OJ.get=($,Z="full")=>{let Q=(Z==="fast"?$9.fastFormats:$9.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function BA($,Z,X,Q){var J,G;(J=(G=$.opts.code).formats)!==null&&J!==void 0||(G.formats=jJ._`require("ajv-formats/dist/formats").${Q}`);for(let W of Z)$.addFormat(W,X[W])}FA.exports=V5=OJ;Object.defineProperty(V5,"__esModule",{value:!0});V5.default=OJ});var TA={};h6(TA,{validateProjectTree:()=>_f,formatProjectTreeIssues:()=>bf});import{existsSync as AA,readFileSync as B5,readdirSync as IA,statSync as NA}from"node:fs";import{createRequire as Ef}from"node:module";import{join as DA,relative as MA,resolve as EJ}from"node:path";async function Sf(){try{let{default:$}=await Promise.resolve().then(() => B$(FJ(),1)),{default:Z}=await Promise.resolve().then(() => B$(LA(),1));return{addFormats:Z,Ajv:$}}catch($){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:$})}}async function _f($){let Z=EJ($),X=[],Q=0,J=await nM(Z);if(Q+=1,!J.valid)X.push({errors:J.errors??[],file:"project.json"});for(let w of["project.schema.json","document.schema.json"]){let D=EJ(Z,w);if(!AA(D))continue;Q+=1;let j=[];if(RJ(JSON.parse(B5(D,"utf8")),j),j.length>0)X.push({errors:j.map((E)=>({message:`relative $ref "${E}" — committed entry documents must be self-contained; `+"regenerate with `jx schema`"})),file:w})}let{addFormats:G,Ajv:W}=await Sf(),{document:Y}=await aX(Z),z=new W({allErrors:!0,ownProperties:!0,strict:!1});G(z);let q=z.compile(Y);for(let w of Rf)for(let D of wA(EJ(Z,w))){if(D.endsWith(".class.json"))continue;Q+=1;let j=JSON.parse(B5(D,"utf8"));if(!q(j))X.push({errors:q.errors??[],file:MA(Z,D)})}let H=new W({allErrors:!0,ownProperties:!0,strict:!1});G(H);let B=H.compile(qQ());for(let w of xf(Z)){Q+=1;let D=JSON.parse(B5(w,"utf8"));if(!B(D))X.push({errors:B.errors??[],file:MA(Z,w)})}let{config:L}=D1(Z),M=await E6(Z,L),A=Ef(import.meta.url);for(let w of M.extensions)for(let D of["project","document","fields"]){let j=w.schemas[D];if(!j)continue;Q+=1;let E=new W({allErrors:!0,ownProperties:!0,strict:!1});G(E);for(let P of Cf){let R=A.resolve(P),C=JSON.parse(B5(R,"utf8"));E.addSchema(C)}try{E.compile(JSON.parse(B5(j,"utf8")))}catch(P){X.push({errors:[{message:P instanceof Error?P.message:String(P)}],file:`${w.specifier} (${D} fragment)`})}}return{checked:Q,issues:X,valid:X.length===0}}function RJ($,Z){if(Array.isArray($)){for(let X of $)RJ(X,Z);return}if($===null||typeof $!=="object")return;for(let[X,Q]of Object.entries($)){if(X==="$ref"&&typeof Q==="string"&&!Q.startsWith("#")&&!/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(Q))Z.push(Q);RJ(Q,Z)}}function wA($){if(!AA($))return[];let Z=[];for(let X of IA($)){let Q=DA($,X);if(NA(Q).isDirectory())Z.push(...wA(Q));else if(X.endsWith(".json"))Z.push(Q)}return Z.toSorted()}function xf($){let Z=[],X=(Q)=>{for(let J of IA(Q)){if(Pf.has(J))continue;let G=DA(Q,J);if(NA(G).isDirectory())X(G);else if(J.endsWith(".class.json"))Z.push(G)}};return X($),Z.toSorted()}function bf($){let Z=[];for(let X of $.issues){Z.push(`${X.file}:`);for(let Q of X.errors){let{instancePath:J,message:G}=Q??{};Z.push(` - ${J||"/"}: ${G??JSON.stringify(Q)}`)}}return Z}var Rf,Pf,Cf;var jA=t(()=>{rV();rM();i6();I9();oX();Rf=["components","pages","layouts"],Pf=new Set(["node_modules","dist",".git"]),Cf=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"]});import{relative as PJ,resolve as OA}from"node:path";async function kf(){let $=process.argv.slice(2),[Z]=$;if(!Z||Z==="--help"||Z==="-h")console.log(`Usage: jx <command> [options]
395
+ deps: ${X}}`};var gy={keyword:"dependencies",type:"object",schemaType:"object",error:_L.error,code($){let[Z,X]=fy($);CL($,Z),SL($,X)}};function fy({schema:$}){let Z={},X={};for(let Q in $){if(Q==="__proto__")continue;let J=Array.isArray($[Q])?Z:X;J[Q]=$[Q]}return[Z,X]}function CL($,Z=$.schema){let{gen:X,data:Q,it:J}=$;if(Object.keys(Z).length===0)return;let G=X.let("missing");for(let W in Z){let Y=Z[W];if(Y.length===0)continue;let z=(0,A8.propertyInData)(X,Q,W,J.opts.ownProperties);if($.setParams({property:W,depsCount:Y.length,deps:Y.join(", ")}),J.allErrors)X.if(z,()=>{for(let q of Y)(0,A8.checkReportMissingProp)($,q)});else X.if(MJ._`${z} && (${(0,A8.checkMissingProp)($,Y,G)})`),(0,A8.reportMissingProp)($,G),X.else()}}_L.validatePropertyDeps=CL;function SL($,Z=$.schema){let{gen:X,data:Q,keyword:J,it:G}=$,W=X.name("valid");for(let Y in Z){if((0,vy.alwaysValidSchema)(G,Z[Y]))continue;X.if((0,A8.propertyInData)(X,Q,Y,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Y},W);$.mergeValidEvaluated(z,W)},()=>X.var(W,!0)),$.ok(W)}}_L.validateSchemaDeps=SL;_L.default=gy});var vL=b((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});var kL=N0(),my=P0(),dy={message:"property name must be valid",params:({params:$})=>kL._`{propertyName: ${$.propertyName}}`},ly={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:dy,code($){let{gen:Z,schema:X,data:Q,it:J}=$;if((0,my.alwaysValidSchema)(J,X))return;let G=Z.name("valid");Z.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},G),Z.if((0,kL.not)(G),()=>{if($.error(!0),!J.allErrors)Z.break()})}),$.ok(G)}};yL.default=ly});var AJ=b((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});var jZ=G1(),F1=N0(),py=J1(),OZ=P0(),iy={message:"must NOT have additional properties",params:({params:$})=>F1._`{additionalProperty: ${$.additionalProperty}}`},ny={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:iy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,errsCount:G,it:W}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Y,opts:z}=W;if(W.props=!0,z.removeAdditional!=="all"&&(0,OZ.alwaysValidSchema)(W,X))return;let q=(0,jZ.allSchemaProperties)(Q.properties),H=(0,jZ.allSchemaProperties)(Q.patternProperties);B(),$.ok(F1._`${G} === ${py.default.errors}`);function B(){Z.forIn("key",J,(I)=>{if(!q.length&&!H.length)w(I);else Z.if(F(I),()=>w(I))})}function F(I){let T;if(q.length>8){let E=(0,OZ.schemaRefOrVal)(W,Q.properties,"properties");T=(0,jZ.isOwnProperty)(Z,E,I)}else if(q.length)T=(0,F1.or)(...q.map((E)=>F1._`${I} === ${E}`));else T=F1.nil;if(H.length)T=(0,F1.or)(T,...H.map((E)=>F1._`${(0,jZ.usePattern)($,E)}.test(${I})`));return(0,F1.not)(T)}function L(I){Z.code(F1._`delete ${J}[${I}]`)}function w(I){if(z.removeAdditional==="all"||z.removeAdditional&&X===!1){L(I);return}if(X===!1){if($.setParams({additionalProperty:I}),$.error(),!Y)Z.break();return}if(typeof X=="object"&&!(0,OZ.alwaysValidSchema)(W,X)){let T=Z.name("valid");if(z.removeAdditional==="failing")N(I,T,!1),Z.if((0,F1.not)(T),()=>{$.reset(),L(I)});else if(N(I,T),!Y)Z.if((0,F1.not)(T),()=>Z.break())}}function N(I,T,E){let P={keyword:"additionalProperties",dataProp:I,dataPropType:OZ.Type.Str};if(E===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,T)}}};gL.default=ny});var mL=b((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});var ay=s4(),fL=G1(),IJ=P0(),hL=AJ(),oy={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)hL.default.code(new ay.KeywordCxt(G,hL.default,"additionalProperties"));let W=(0,fL.allSchemaProperties)(X);for(let B of W)G.definedProperties.add(B);if(G.opts.unevaluated&&W.length&&G.props!==!0)G.props=IJ.mergeEvaluated.props(Z,(0,IJ.toHash)(W),G.props);let Y=W.filter((B)=>!(0,IJ.alwaysValidSchema)(G,X[B]));if(Y.length===0)return;let z=Z.name("valid");for(let B of Y){if(q(B))H(B);else{if(Z.if((0,fL.propertyInData)(Z,J,B,G.opts.ownProperties)),H(B),!G.allErrors)Z.else().var(z,!0);Z.endIf()}$.it.definedProperties.add(B),$.ok(z)}function q(B){return G.opts.useDefaults&&!G.compositeRule&&X[B].default!==void 0}function H(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},z)}}};uL.default=oy});var iL=b((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});var dL=G1(),EZ=N0(),lL=P0(),cL=P0(),ty={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,data:Q,parentSchema:J,it:G}=$,{opts:W}=G,Y=(0,dL.allSchemaProperties)(X),z=Y.filter((N)=>(0,lL.alwaysValidSchema)(G,X[N]));if(Y.length===0||z.length===Y.length&&(!G.opts.unevaluated||G.props===!0))return;let q=W.strictSchema&&!W.allowMatchingProperties&&J.properties,H=Z.name("valid");if(G.props!==!0&&!(G.props instanceof EZ.Name))G.props=(0,cL.evaluatedPropsToName)(Z,G.props);let{props:B}=G;F();function F(){for(let N of Y){if(q)L(N);if(G.allErrors)w(N);else Z.var(H,!0),w(N),Z.if(H)}}function L(N){for(let I in q)if(new RegExp(N).test(I))(0,lL.checkStrictMode)(G,`property ${I} matches pattern ${N} (use allowMatchingProperties)`)}function w(N){Z.forIn("key",Q,(I)=>{Z.if(EZ._`${(0,dL.usePattern)($,N)}.test(${I})`,()=>{let T=z.includes(N);if(!T)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:I,dataPropType:cL.Type.Str},H);if(G.opts.unevaluated&&B!==!0)Z.assign(EZ._`${B}[${I}]`,!0);else if(!T&&!G.allErrors)Z.if((0,EZ.not)(H),()=>Z.break())})})}}};pL.default=ty});var rL=b((nL)=>{Object.defineProperty(nL,"__esModule",{value:!0});var $v=P0(),Zv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:Z,schema:X,it:Q}=$;if((0,$v.alwaysValidSchema)(Q,X)){$.fail();return}let J=Z.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};nL.default=Zv});var oL=b((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var Qv=G1(),Jv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qv.validateUnion,error:{message:"must match a schema in anyOf"}};aL.default=Jv});var tL=b((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});var RZ=N0(),Wv=P0(),Yv={message:"must match exactly one schema in oneOf",params:({params:$})=>RZ._`{passingSchemas: ${$.passing}}`},zv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Yv,code($){let{gen:Z,schema:X,parentSchema:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(J.opts.discriminator&&Q.discriminator)return;let G=X,W=Z.let("valid",!1),Y=Z.let("passing",null),z=Z.name("_valid");$.setParams({passing:Y}),Z.block(q),$.result(W,()=>$.reset(),()=>$.error(!0));function q(){G.forEach((H,B)=>{let F;if((0,Wv.alwaysValidSchema)(J,H))Z.var(z,!0);else F=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},z);if(B>0)Z.if(RZ._`${z} && ${W}`).assign(W,!1).assign(Y,RZ._`[${Y}, ${B}]`).else();Z.if(z,()=>{if(Z.assign(W,!0),Z.assign(Y,B),F)$.mergeEvaluated(F,RZ.Name)})})}}};sL.default=zv});var $M=b((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});var Kv=P0(),Uv={keyword:"allOf",schemaType:"array",code($){let{gen:Z,schema:X,it:Q}=$;if(!Array.isArray(X))throw Error("ajv implementation error");let J=Z.name("valid");X.forEach((G,W)=>{if((0,Kv.alwaysValidSchema)(Q,G))return;let Y=$.subschema({keyword:"allOf",schemaProp:W},J);$.ok(J),$.mergeEvaluated(Y)})}};eL.default=Uv});var JM=b((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});var PZ=N0(),XM=P0(),Vv={message:({params:$})=>PZ.str`must match "${$.ifClause}" schema`,params:({params:$})=>PZ._`{failingKeyword: ${$.ifClause}}`},Bv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Vv,code($){let{gen:Z,parentSchema:X,it:Q}=$;if(X.then===void 0&&X.else===void 0)(0,XM.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let J=ZM(Q,"then"),G=ZM(Q,"else");if(!J&&!G)return;let W=Z.let("valid",!0),Y=Z.name("_valid");if(z(),$.reset(),J&&G){let H=Z.let("ifClause");$.setParams({ifClause:H}),Z.if(Y,q("then",H),q("else",H))}else if(J)Z.if(Y,q("then"));else Z.if((0,PZ.not)(Y),q("else"));$.pass(W,()=>$.error(!0));function z(){let H=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Y);$.mergeEvaluated(H)}function q(H,B){return()=>{let F=$.subschema({keyword:H},Y);if(Z.assign(W,Y),$.mergeValidEvaluated(F,W),B)Z.assign(B,PZ._`${H}`);else $.setParams({ifClause:H})}}}};function ZM($,Z){let X=$.schema[Z];return X!==void 0&&!(0,XM.alwaysValidSchema)($,X)}QM.default=Bv});var WM=b((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});var Lv=P0(),Mv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:Z,it:X}){if(Z.if===void 0)(0,Lv.checkStrictMode)(X,`"${$}" without "if" is ignored`)}};GM.default=Mv});var NJ=b((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});var Iv=FJ(),Nv=TL(),Dv=LJ(),wv=EL(),Tv=PL(),jv=TZ(),Ov=vL(),Ev=AJ(),Rv=mL(),Pv=iL(),Cv=rL(),Sv=oL(),_v=tL(),bv=$M(),xv=JM(),kv=WM();function yv($=!1){let Z=[Cv.default,Sv.default,_v.default,bv.default,xv.default,kv.default,Ov.default,Ev.default,jv.default,Rv.default,Pv.default];if($)Z.push(Nv.default,wv.default);else Z.push(Iv.default,Dv.default);return Z.push(Tv.default),Z}YM.default=yv});var wJ=b((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});KM.dynamicAnchor=void 0;var DJ=N0(),gv=J1(),zM=z8(),fv=MZ(),hv={keyword:"$dynamicAnchor",schemaType:"string",code:($)=>qM($,$.schema)};function qM($,Z){let{gen:X,it:Q}=$;Q.schemaEnv.root.dynamicAnchors[Z]=!0;let J=DJ._`${gv.default.dynamicAnchors}${(0,DJ.getProperty)(Z)}`,G=Q.errSchemaPath==="#"?Q.validateName:uv($);X.if(DJ._`!${J}`,()=>X.assign(J,G))}KM.dynamicAnchor=qM;function uv($){let{schemaEnv:Z,schema:X,self:Q}=$.it,{root:J,baseId:G,localRefs:W,meta:Y}=Z.root,{schemaId:z}=Q.opts,q=new zM.SchemaEnv({schema:X,schemaId:z,root:J,baseId:G,localRefs:W,meta:Y});return zM.compileSchema.call(Q,q),(0,fv.getValidate)($,q)}KM.default=hv});var TJ=b((FM)=>{Object.defineProperty(FM,"__esModule",{value:!0});FM.dynamicRef=void 0;var HM=N0(),dv=J1(),VM=MZ(),lv={keyword:"$dynamicRef",schemaType:"string",code:($)=>BM($,$.schema)};function BM($,Z){let{gen:X,keyword:Q,it:J}=$;if(Z[0]!=="#")throw Error(`"${Q}" only supports hash fragment reference`);let G=Z.slice(1);if(J.allErrors)W();else{let z=X.let("valid",!1);W(z),$.ok(z)}function W(z){if(J.schemaEnv.root.dynamicAnchors[G]){let q=X.let("_v",HM._`${dv.default.dynamicAnchors}${(0,HM.getProperty)(G)}`);X.if(q,Y(q,z),Y(J.validateName,z))}else Y(J.validateName,z)()}function Y(z,q){return q?()=>X.block(()=>{(0,VM.callRef)($,z),X.let(q,!0)}):()=>(0,VM.callRef)($,z)}}FM.dynamicRef=BM;FM.default=lv});var AM=b((MM)=>{Object.defineProperty(MM,"__esModule",{value:!0});var pv=wJ(),iv=P0(),nv={keyword:"$recursiveAnchor",schemaType:"boolean",code($){if($.schema)(0,pv.dynamicAnchor)($,"");else(0,iv.checkStrictMode)($.it,"$recursiveAnchor: false is ignored")}};MM.default=nv});var NM=b((IM)=>{Object.defineProperty(IM,"__esModule",{value:!0});var av=TJ(),ov={keyword:"$recursiveRef",schemaType:"string",code:($)=>(0,av.dynamicRef)($,$.schema)};IM.default=ov});var wM=b((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});var tv=wJ(),ev=TJ(),$g=AM(),Zg=NM(),Xg=[tv.default,ev.default,$g.default,Zg.default];DM.default=Xg});var OM=b((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var TM=TZ(),Jg={keyword:"dependentRequired",type:"object",schemaType:"object",error:TM.error,code:($)=>(0,TM.validatePropertyDeps)($)};jM.default=Jg});var RM=b((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});var Wg=TZ(),Yg={keyword:"dependentSchemas",type:"object",schemaType:"object",code:($)=>(0,Wg.validateSchemaDeps)($)};EM.default=Yg});var CM=b((PM)=>{Object.defineProperty(PM,"__esModule",{value:!0});var qg=P0(),Kg={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:$,parentSchema:Z,it:X}){if(Z.contains===void 0)(0,qg.checkStrictMode)(X,`"${$}" without "contains" is ignored`)}};PM.default=Kg});var _M=b((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var Hg=OM(),Vg=RM(),Bg=CM(),Fg=[Hg.default,Vg.default,Bg.default];SM.default=Fg});var kM=b((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});var g6=N0(),bM=P0(),Mg=J1(),Ag={message:"must NOT have unevaluated properties",params:({params:$})=>g6._`{unevaluatedProperty: ${$.unevaluatedProperty}}`},Ig={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:Ag,code($){let{gen:Z,schema:X,data:Q,errsCount:J,it:G}=$;if(!J)throw Error("ajv implementation error");let{allErrors:W,props:Y}=G;if(Y instanceof g6.Name)Z.if(g6._`${Y} !== true`,()=>Z.forIn("key",Q,(B)=>Z.if(q(Y,B),()=>z(B))));else if(Y!==!0)Z.forIn("key",Q,(B)=>Y===void 0?z(B):Z.if(H(Y,B),()=>z(B)));G.props=!0,$.ok(g6._`${J} === ${Mg.default.errors}`);function z(B){if(X===!1){if($.setParams({unevaluatedProperty:B}),$.error(),!W)Z.break();return}if(!(0,bM.alwaysValidSchema)(G,X)){let F=Z.name("valid");if($.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:bM.Type.Str},F),!W)Z.if((0,g6.not)(F),()=>Z.break())}}function q(B,F){return g6._`!${B} || !${B}[${F}]`}function H(B,F){let L=[];for(let w in B)if(B[w]===!0)L.push(g6._`${F} !== ${w}`);return(0,g6.and)(...L)}}};xM.default=Ig});var gM=b((vM)=>{Object.defineProperty(vM,"__esModule",{value:!0});var V4=N0(),yM=P0(),Dg={message:({params:{len:$}})=>V4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>V4._`{limit: ${$}}`},wg={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Dg,code($){let{gen:Z,schema:X,data:Q,it:J}=$,G=J.items||0;if(G===!0)return;let W=Z.const("len",V4._`${Q}.length`);if(X===!1)$.setParams({len:G}),$.fail(V4._`${W} > ${G}`);else if(typeof X=="object"&&!(0,yM.alwaysValidSchema)(J,X)){let z=Z.var("valid",V4._`${W} <= ${G}`);Z.if((0,V4.not)(z),()=>Y(z,G)),$.ok(z)}J.items=!0;function Y(z,q){Z.forRange("i",q,W,(H)=>{if($.subschema({keyword:"unevaluatedItems",dataProp:H,dataPropType:yM.Type.Num},z),!J.allErrors)Z.if((0,V4.not)(z),()=>Z.break())})}}};vM.default=wg});var hM=b((fM)=>{Object.defineProperty(fM,"__esModule",{value:!0});var jg=kM(),Og=gM(),Eg=[jg.default,Og.default];fM.default=Eg});var mM=b((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});var e0=N0(),Pg={message:({schemaCode:$})=>e0.str`must match format "${$}"`,params:({schemaCode:$})=>e0._`{format: ${$}}`},Cg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Pg,code($,Z){let{gen:X,data:Q,$data:J,schema:G,schemaCode:W,it:Y}=$,{opts:z,errSchemaPath:q,schemaEnv:H,self:B}=Y;if(!z.validateFormats)return;if(J)F();else L();function F(){let w=X.scopeValue("formats",{ref:B.formats,code:z.code.formats}),N=X.const("fDef",e0._`${w}[${W}]`),I=X.let("fType"),T=X.let("format");X.if(e0._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>X.assign(I,e0._`${N}.type || "string"`).assign(T,e0._`${N}.validate`),()=>X.assign(I,e0._`"string"`).assign(T,N)),$.fail$data((0,e0.or)(E(),P()));function E(){if(z.strictSchema===!1)return e0.nil;return e0._`${W} && !${T}`}function P(){let R=H.$async?e0._`(${N}.async ? await ${T}(${Q}) : ${T}(${Q}))`:e0._`${T}(${Q})`,C=e0._`(typeof ${T} == "function" ? ${R} : ${T}.test(${Q}))`;return e0._`${T} && ${T} !== true && ${I} === ${Z} && !${C}`}}function L(){let w=B.formats[G];if(!w){E();return}if(w===!0)return;let[N,I,T]=P(w);if(N===Z)$.pass(R());function E(){if(z.strictSchema===!1){B.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${G}" ignored in schema at path "${q}"`}}function P(C){let y=C instanceof RegExp?(0,e0.regexpCode)(C):z.code.formats?e0._`${z.code.formats}${(0,e0.getProperty)(G)}`:void 0,v=X.scopeValue("formats",{key:G,ref:C,code:y});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,e0._`${v}.validate`];return["string",C,v]}function R(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!H.$async)throw Error("async format in sync schema");return e0._`await ${T}(${Q})`}return typeof I=="function"?e0._`${T}(${Q})`:e0._`${T}.test(${Q})`}}}};uM.default=Cg});var jJ=b((dM)=>{Object.defineProperty(dM,"__esModule",{value:!0});var _g=mM(),bg=[_g.default];dM.default=bg});var OJ=b((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});lM.contentVocabulary=lM.metadataVocabulary=void 0;lM.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lM.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nM=b((iM)=>{Object.defineProperty(iM,"__esModule",{value:!0});var yg=KJ(),vg=VJ(),gg=NJ(),fg=wM(),hg=_M(),ug=hM(),mg=jJ(),pM=OJ(),dg=[fg.default,yg.default,vg.default,(0,gg.default)(!0),mg.default,pM.metadataVocabulary,pM.contentVocabulary,hg.default,ug.default];iM.default=dg});var sM=b((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.DiscrError=void 0;var rM;(function($){$.Tag="tag",$.Mapping="mapping"})(rM||(aM.DiscrError=rM={}))});var RJ=b((eM)=>{Object.defineProperty(eM,"__esModule",{value:!0});var Q9=N0(),EJ=sM(),tM=z8(),cg=t4(),pg=P0(),ig={message:({params:{discrError:$,tagName:Z}})=>$===EJ.DiscrError.Tag?`tag "${Z}" must be string`:`value of tag "${Z}" must be in oneOf`,params:({params:{discrError:$,tag:Z,tagName:X}})=>Q9._`{error: ${$}, tag: ${X}, tagValue: ${Z}}`},ng={keyword:"discriminator",type:"object",schemaType:"object",error:ig,code($){let{gen:Z,data:X,schema:Q,parentSchema:J,it:G}=$,{oneOf:W}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Y=Q.propertyName;if(typeof Y!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let z=Z.let("valid",!1),q=Z.const("tag",Q9._`${X}${(0,Q9.getProperty)(Y)}`);Z.if(Q9._`typeof ${q} == "string"`,()=>H(),()=>$.error(!1,{discrError:EJ.DiscrError.Tag,tag:q,tagName:Y})),$.ok(z);function H(){let L=F();Z.if(!1);for(let w in L)Z.elseIf(Q9._`${q} === ${w}`),Z.assign(z,B(L[w]));Z.else(),$.error(!1,{discrError:EJ.DiscrError.Mapping,tag:q,tagName:Y}),Z.endIf()}function B(L){let w=Z.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:L},w);return $.mergeEvaluated(N,Q9.Name),w}function F(){var L;let w={},N=T(J),I=!0;for(let R=0;R<W.length;R++){let C=W[R];if((C===null||C===void 0?void 0:C.$ref)&&!(0,pg.schemaHasRulesButRef)(C,G.self.RULES)){let v=C.$ref;if(C=tM.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,v),C instanceof tM.SchemaEnv)C=C.schema;if(C===void 0)throw new cg.default(G.opts.uriResolver,G.baseId,v)}let y=(L=C===null||C===void 0?void 0:C.properties)===null||L===void 0?void 0:L[Y];if(typeof y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Y}"`);I=I&&(N||T(C)),E(y,R)}if(!I)throw Error(`discriminator: "${Y}" must be required`);return w;function T({required:R}){return Array.isArray(R)&&R.includes(Y)}function E(R,C){if(R.const)P(R.const,C);else if(R.enum)for(let y of R.enum)P(y,C);else throw Error(`discriminator: "properties/${Y}" must have "const" or "enum"`)}function P(R,C){if(typeof R!="string"||R in w)throw Error(`discriminator: "${Y}" values must be unique strings`);w[R]=C}}}};eM.default=ng});var $A=b((Pr,ag)=>{ag.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var ZA=b((Cr,og)=>{og.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var XA=b((Sr,sg)=>{sg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var QA=b((_r,tg)=>{tg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var JA=b((br,eg)=>{eg.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var GA=b((xr,$f)=>{$f.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var WA=b((kr,Zf)=>{Zf.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var YA=b((yr,Xf)=>{Xf.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var qA=b((zA)=>{Object.defineProperty(zA,"__esModule",{value:!0});var Qf=$A(),Jf=ZA(),Gf=XA(),Wf=QA(),Yf=JA(),zf=GA(),qf=WA(),Kf=YA(),Uf=["/properties"];function Hf($){return[Qf,Jf,Gf,Wf,Yf,Z(this,zf),qf,Z(this,Kf)].forEach((X)=>this.addMetaSchema(X,void 0,!1)),this;function Z(X,Q){return $?X.$dataMetaSchema(Q,Uf):Q}}zA.default=Hf});var SJ=b((v$,CJ)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.MissingRefError=v$.ValidationError=v$.CodeGen=v$.Name=v$.nil=v$.stringify=v$.str=v$._=v$.KeywordCxt=v$.Ajv2020=void 0;var Bf=qJ(),Ff=nM(),Lf=RJ(),Mf=qA(),PJ="https://json-schema.org/draft/2020-12/schema";class I8 extends Bf.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),Ff.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Lf.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:$,meta:Z}=this.opts;if(!Z)return;Mf.default.call(this,$),this.refs["http://json-schema.org/schema"]=PJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(PJ)?PJ:void 0)}}v$.Ajv2020=I8;CJ.exports=v$=I8;CJ.exports.Ajv2020=I8;Object.defineProperty(v$,"__esModule",{value:!0});v$.default=I8;var Af=s4();Object.defineProperty(v$,"KeywordCxt",{enumerable:!0,get:function(){return Af.KeywordCxt}});var J9=N0();Object.defineProperty(v$,"_",{enumerable:!0,get:function(){return J9._}});Object.defineProperty(v$,"str",{enumerable:!0,get:function(){return J9.str}});Object.defineProperty(v$,"stringify",{enumerable:!0,get:function(){return J9.stringify}});Object.defineProperty(v$,"nil",{enumerable:!0,get:function(){return J9.nil}});Object.defineProperty(v$,"Name",{enumerable:!0,get:function(){return J9.Name}});Object.defineProperty(v$,"CodeGen",{enumerable:!0,get:function(){return J9.CodeGen}});var If=W8();Object.defineProperty(v$,"ValidationError",{enumerable:!0,get:function(){return If.default}});var Nf=t4();Object.defineProperty(v$,"MissingRefError",{enumerable:!0,get:function(){return Nf.default}})});import{existsSync as SZ,readFileSync as N8}from"node:fs";import{createRequire as KA}from"node:module";import{isAbsolute as Tf,relative as jf,resolve as CZ}from"node:path";import{fileURLToPath as UA,pathToFileURL as Of}from"node:url";async function HA($){let Z=CZ($),X=CZ(Z,"project.json"),Q=CZ(Z,"project.schema.json");if(!SZ(X))throw Error(`project.json not found in ${Z}`);if(!SZ(Q))throw Error(`project.schema.json not found in ${Z} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(N8(X,"utf8")),G=JSON.parse(N8(Q,"utf8"));G.$id=Of(Q).href;let W;try{({default:W}=await Promise.resolve().then(() => F$(SJ(),1)))}catch(H){throw Error("Project validation requires ajv: bun add ajv",{cause:H})}let z=await new W({allErrors:!0,loadSchema:(H)=>Ef(H,Z),strict:!1}).compileAsync(G),q=z(J);return{errors:z.errors??null,valid:q}}async function Ef($,Z){if(!$.startsWith("file:"))throw Error(`Cannot resolve schema ref "${$}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let X=UA($),Q=jf(Z,X);if(Q.startsWith("..")||Tf(Q))throw Error(`Schema ref "${$}" escapes the project root ${Z}`);if(SZ(X))return JSON.parse(N8(X,"utf8"));let J=Q.split("\\").join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${$}" does not exist`);let Y=J.slice(W+G.length),z;try{z=KA(CZ(Z,"package.json")).resolve(Y)}catch{try{z=KA(import.meta.url).resolve(Y)}catch(q){if(Y.startsWith("@jxsuite/schema/")){let B=UA(new URL(`../${Y.slice(16)}`,import.meta.url));if(SZ(B))return JSON.parse(N8(B,"utf8"))}throw Error(`Schema ref "${$}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(N8(z,"utf8"))}var VA=()=>{};var TA=b((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.formatNames=DA.fastFormats=DA.fullFormats=void 0;function f1($,Z){return{validate:$,compare:Z}}DA.fullFormats={date:f1(MA,kJ),time:f1(bJ(!0),yJ),"date-time":f1(BA(!0),IA),"iso-time":f1(bJ(),AA),"iso-date-time":f1(BA(),NA),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:bf,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:hf,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:xf,int32:{type:"number",validate:vf},int64:{type:"number",validate:gf},float:{type:"number",validate:LA},double:{type:"number",validate:LA},password:!0,binary:!0};DA.fastFormats={...DA.fullFormats,date:f1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,kJ),time:f1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,yJ),"date-time":f1(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,IA),"iso-time":f1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,AA),"iso-date-time":f1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,NA),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};DA.formatNames=Object.keys(DA.fullFormats);function Rf($){return $%4===0&&($%100!==0||$%400===0)}var Pf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cf=[0,31,28,31,30,31,30,31,31,30,31,30,31];function MA($){let Z=Pf.exec($);if(!Z)return!1;let X=+Z[1],Q=+Z[2],J=+Z[3];return Q>=1&&Q<=12&&J>=1&&J<=(Q===2&&Rf(X)?29:Cf[Q])}function kJ($,Z){if(!($&&Z))return;if($>Z)return 1;if($<Z)return-1;return 0}var _J=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function bJ($){return function(X){let Q=_J.exec(X);if(!Q)return!1;let J=+Q[1],G=+Q[2],W=+Q[3],Y=Q[4],z=Q[5]==="-"?-1:1,q=+(Q[6]||0),H=+(Q[7]||0);if(q>23||H>59||$&&!Y)return!1;if(J<=23&&G<=59&&W<60)return!0;let B=G-H*z,F=J-q*z-(B<0?1:0);return(F===23||F===-1)&&(B===59||B===-1)&&W<61}}function yJ($,Z){if(!($&&Z))return;let X=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+Z).valueOf();if(!(X&&Q))return;return X-Q}function AA($,Z){if(!($&&Z))return;let X=_J.exec($),Q=_J.exec(Z);if(!(X&&Q))return;if($=X[1]+X[2]+X[3],Z=Q[1]+Q[2]+Q[3],$>Z)return 1;if($<Z)return-1;return 0}var xJ=/t|\s/i;function BA($){let Z=bJ($);return function(Q){let J=Q.split(xJ);return J.length===2&&MA(J[0])&&Z(J[1])}}function IA($,Z){if(!($&&Z))return;let X=new Date($).valueOf(),Q=new Date(Z).valueOf();if(!(X&&Q))return;return X-Q}function NA($,Z){if(!($&&Z))return;let[X,Q]=$.split(xJ),[J,G]=Z.split(xJ),W=kJ(X,J);if(W===void 0)return;return W||yJ(Q,G)}var Sf=/\/|:/,_f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function bf($){return Sf.test($)&&_f.test($)}var FA=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function xf($){return FA.lastIndex=0,FA.test($)}var kf=-2147483648,yf=2147483647;function vf($){return Number.isInteger($)&&$<=yf&&$>=kf}function gf($){return Number.isInteger($)}function LA(){return!0}var ff=/[^\\]\\Z/;function hf($){if(ff.test($))return!1;try{return new RegExp($),!0}catch(Z){return!1}}});var EA=b((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});var mf=KJ(),df=VJ(),lf=NJ(),cf=jJ(),jA=OJ(),pf=[mf.default,df.default,(0,lf.default)(),cf.default,jA.metadataVocabulary,jA.contentVocabulary];OA.default=pf});var RA=b((tr,rf)=>{rf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var CA=b((g$,gJ)=>{Object.defineProperty(g$,"__esModule",{value:!0});g$.MissingRefError=g$.ValidationError=g$.CodeGen=g$.Name=g$.nil=g$.stringify=g$.str=g$._=g$.KeywordCxt=g$.Ajv=void 0;var af=qJ(),of=EA(),sf=RJ(),PA=RA(),tf=["/properties"],_Z="http://json-schema.org/draft-07/schema";class D8 extends af.default{_addVocabularies(){if(super._addVocabularies(),of.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(sf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(PA,tf):PA;this.addMetaSchema($,_Z,!1),this.refs["http://json-schema.org/schema"]=_Z}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(_Z)?_Z:void 0)}}g$.Ajv=D8;gJ.exports=g$=D8;gJ.exports.Ajv=D8;Object.defineProperty(g$,"__esModule",{value:!0});g$.default=D8;var ef=s4();Object.defineProperty(g$,"KeywordCxt",{enumerable:!0,get:function(){return ef.KeywordCxt}});var G9=N0();Object.defineProperty(g$,"_",{enumerable:!0,get:function(){return G9._}});Object.defineProperty(g$,"str",{enumerable:!0,get:function(){return G9.str}});Object.defineProperty(g$,"stringify",{enumerable:!0,get:function(){return G9.stringify}});Object.defineProperty(g$,"nil",{enumerable:!0,get:function(){return G9.nil}});Object.defineProperty(g$,"Name",{enumerable:!0,get:function(){return G9.Name}});Object.defineProperty(g$,"CodeGen",{enumerable:!0,get:function(){return G9.CodeGen}});var $h=W8();Object.defineProperty(g$,"ValidationError",{enumerable:!0,get:function(){return $h.default}});var Zh=t4();Object.defineProperty(g$,"MissingRefError",{enumerable:!0,get:function(){return Zh.default}})});var _A=b((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.formatLimitDefinition=void 0;var Jh=CA(),L1=N0(),f6=L1.operators,bZ={formatMaximum:{okStr:"<=",ok:f6.LTE,fail:f6.GT},formatMinimum:{okStr:">=",ok:f6.GTE,fail:f6.LT},formatExclusiveMaximum:{okStr:"<",ok:f6.LT,fail:f6.GTE},formatExclusiveMinimum:{okStr:">",ok:f6.GT,fail:f6.LTE}},Gh={message:({keyword:$,schemaCode:Z})=>L1.str`should be ${bZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>L1._`{comparison: ${bZ[$].okStr}, limit: ${Z}}`};SA.formatLimitDefinition={keyword:Object.keys(bZ),type:"string",schemaType:"string",$data:!0,error:Gh,code($){let{gen:Z,data:X,schemaCode:Q,keyword:J,it:G}=$,{opts:W,self:Y}=G;if(!W.validateFormats)return;let z=new Jh.KeywordCxt(G,Y.RULES.all.format.definition,"format");if(z.$data)q();else H();function q(){let F=Z.scopeValue("formats",{ref:Y.formats,code:W.code.formats}),L=Z.const("fmt",L1._`${F}[${z.schemaCode}]`);$.fail$data((0,L1.or)(L1._`typeof ${L} != "object"`,L1._`${L} instanceof RegExp`,L1._`typeof ${L}.compare != "function"`,B(L)))}function H(){let F=z.schema,L=Y.formats[F];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${J}": format "${F}" does not define "compare" function`);let w=Z.scopeValue("formats",{key:F,ref:L,code:W.code.formats?L1._`${W.code.formats}${(0,L1.getProperty)(F)}`:void 0});$.fail$data(B(w))}function B(F){return L1._`${F}.compare(${X}, ${Q}) ${bZ[J].fail} 0`}},dependencies:["format"]};var Wh=($)=>{return $.addKeyword(SA.formatLimitDefinition),$};SA.default=Wh});var yA=b((w8,kA)=>{Object.defineProperty(w8,"__esModule",{value:!0});var W9=TA(),zh=_A(),hJ=N0(),bA=new hJ.Name("fullFormats"),qh=new hJ.Name("fastFormats"),uJ=($,Z={keywords:!0})=>{if(Array.isArray(Z))return xA($,Z,W9.fullFormats,bA),$;let[X,Q]=Z.mode==="fast"?[W9.fastFormats,qh]:[W9.fullFormats,bA],J=Z.formats||W9.formatNames;if(xA($,J,X,Q),Z.keywords)(0,zh.default)($);return $};uJ.get=($,Z="full")=>{let Q=(Z==="fast"?W9.fastFormats:W9.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function xA($,Z,X,Q){var J,G;(J=(G=$.opts.code).formats)!==null&&J!==void 0||(G.formats=hJ._`require("ajv-formats/dist/formats").${Q}`);for(let W of Z)$.addFormat(W,X[W])}kA.exports=w8=uJ;Object.defineProperty(w8,"__esModule",{value:!0});w8.default=uJ});var cA={};m1(cA,{validateProjectTree:()=>Fh,formatProjectTreeIssues:()=>Ih});import{existsSync as fA,readFileSync as T8,readdirSync as hA,statSync as uA}from"node:fs";import{createRequire as Kh}from"node:module";import{join as mA,relative as vA,resolve as mJ}from"node:path";async function Bh(){try{let{default:$}=await Promise.resolve().then(() => F$(SJ(),1)),{default:Z}=await Promise.resolve().then(() => F$(yA(),1));return{addFormats:Z,Ajv:$}}catch($){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:$})}}async function Fh($){let Z=mJ($),X=[],Q=0;for(let N of["project.schema.json","document.schema.json"]){let I=mJ(Z,N);if(!fA(I))continue;Q+=1;let T=JSON.parse(T8(I,"utf8")),E=Lh(T);if(E.length>0)X.push({errors:E.map(({reason:P,ref:R})=>({message:`$ref "${R}" ${P} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:N})}if(X.length>0)return{checked:Q,issues:X,valid:!1};let J=await HA(Z);if(Q+=1,!J.valid)X.push({errors:J.errors??[],file:"project.json"});let{addFormats:G,Ajv:W}=await Bh(),{document:Y}=await KQ(Z),z=new W({allErrors:!0,ownProperties:!0,strict:!1});G(z);let q=z.compile(Y);for(let N of Uh)for(let I of lA(mJ(Z,N))){if(I.endsWith(".class.json"))continue;Q+=1;let T=JSON.parse(T8(I,"utf8"));if(!q(T))X.push({errors:q.errors??[],file:vA(Z,I)})}let H=new W({allErrors:!0,ownProperties:!0,strict:!1});G(H);let B=H.compile(jQ());for(let N of Ah(Z)){Q+=1;let I=JSON.parse(T8(N,"utf8"));if(!B(I))X.push({errors:B.errors??[],file:vA(Z,N)})}let{config:F}=T6(Z),L=await R1(Z,F),w=Kh(import.meta.url);for(let N of L.extensions)for(let I of["project","document","fields"]){let T=N.schemas[I];if(!T)continue;Q+=1;let E=new W({allErrors:!0,ownProperties:!0,strict:!1});G(E);for(let P of Vh){let R=w.resolve(P),C=JSON.parse(T8(R,"utf8"));E.addSchema(C)}try{E.compile(JSON.parse(T8(T,"utf8")))}catch(P){X.push({errors:[{message:P instanceof Error?P.message:String(P)}],file:`${N.specifier} (${I} fragment)`})}}return{checked:Q,issues:X,valid:X.length===0}}function Lh($){let Z=[],X=new Set,Q=(G)=>{let W=$;for(let Y of G.slice(1).split("/")){if(Y==="")continue;let z=Y.replaceAll("~1","/").replaceAll("~0","~");if(typeof W!=="object"||W===null)return!1;if(W=W[z],W===void 0)return!1}return!0},J=(G)=>{if(!gA(G)||X.has(G))return;X.add(G);let W=G.$ref;if(typeof W==="string"){if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(W))Z.push({reason:"is an absolute URI editors resolve over the network",ref:W});else if(!W.startsWith("#"))Z.push({reason:"is a relative path only Node module resolution can follow",ref:W});else if(W.length>1&&!W.startsWith("#/"))Z.push({reason:"is an $anchor reference, which has no root-pointer form",ref:W});else if(W.length>1&&!Q(W.slice(1)))Z.push({reason:"points at no node in this document",ref:W})}for(let[Y,z]of Object.entries(G)){if(!Mh.has(Y))continue;if(Array.isArray(z))for(let q of z)J(q);else if(gA(z)){if(J(z),dA.has(Y))for(let q of Object.values(z))J(q)}}};return J($),Z}function gA($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function lA($){if(!fA($))return[];let Z=[];for(let X of hA($)){let Q=mA($,X);if(uA(Q).isDirectory())Z.push(...lA(Q));else if(X.endsWith(".json"))Z.push(Q)}return Z.toSorted()}function Ah($){let Z=[],X=(Q)=>{for(let J of hA(Q)){if(Hh.has(J))continue;let G=mA(Q,J);if(uA(G).isDirectory())X(G);else if(J.endsWith(".class.json"))Z.push(G)}};return X($),Z.toSorted()}function Ih($){let Z=[];for(let X of $.issues){Z.push(`${X.file}:`);for(let Q of X.errors){let{instancePath:J,message:G}=Q??{};Z.push(` - ${J||"/"}: ${G??JSON.stringify(Q)}`)}}return Z}var Uh,Hh,Vh,dA,Mh;var pA=s(()=>{V3();VA();r1();E9();UQ();Uh=["components","pages","layouts"],Hh=new Set(["node_modules","dist",".git"]),Vh=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];dA=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),Mh=new Set([...dA,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});import{relative as dJ,resolve as iA}from"node:path";async function Nh(){let $=process.argv.slice(2),[Z]=$;if(!Z||Z==="--help"||Z==="-h")console.log(`Usage: jx <command> [options]
397
396
 
398
397
  Commands:
399
398
  build [root] Build a Jx site to dist/
@@ -408,8 +407,8 @@ Options:
408
407
  --no-clean Don't clean outDir before building
409
408
  --port <n> dev/preview: port to listen on (default 3000 / 4173)
410
409
  --dry-run db push: print the statements without executing them
411
- --connection db push: restrict to one connection name`),process.exit(0);let X=Z==="db",Q=X?$[1]:null,J=$.slice(X?2:1),G=new Set,W=[],Y,z;for(let B=0;B<J.length;B+=1){let L=J[B];if(L==="--connection")B+=1,Y=J[B];else if(L==="--port"){B+=1;let M=Math.trunc(Number(J[B]??""));if(Number.isFinite(M)&&M>=0)z=M}else if(L.startsWith("--"))G.add(L);else W.push(L)}let[q]=W,H=OA(q??".");if(X){if(Q!=="push")console.error(`Unknown db subcommand: ${Q??"(none)"}
412
- Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let B=G.has("--dry-run");try{let{dbPush:L}=await Promise.resolve().then(() => (YY(),WY)),{results:M,bindingsPatched:A,wranglerPath:w}=await L(H,{dryRun:B,...Y===void 0?{}:{connection:Y}});for(let D of M){let j=D.applied?"applied":"dry-run";console.log(`${D.connection} (${D.provider}) — ${D.tables.length} table(s), ${D.statements.length} statement(s) [${j}]`);for(let E of D.statements)console.log(` ${E}`);for(let E of D.warnings)console.warn(` warning: ${E}`)}if(A&&w)console.log(`Updated bindings in ${PJ(H,w)}`)}catch(L){console.error(`db push failed: ${L.message}`),process.exit(1)}return}if(Z==="build"){let B=G.has("--verbose"),L=!G.has("--no-clean");console.log(`Building site from ${H}...`);try{let{buildSite:M}=await Promise.resolve().then(() => (fK(),gK)),A=await M(H,{clean:L,verbose:B});if(A.errors.length>0){console.error(`
413
- Build completed with ${A.errors.length} error(s):`);for(let w of A.errors)console.error(` - ${w}`);process.exit(1)}console.log(`
414
- Done: ${A.routes} routes → ${A.files} files`)}catch(M){console.error(`Build failed: ${M.message}`),process.exit(1)}}else if(Z==="dev")try{let{runDev:B}=await Promise.resolve().then(() => (mK(),uK));B(H,z)}catch(B){console.error(B.message),process.exit(1)}else if(Z==="preview"){let{existsSync:B}=await import("node:fs"),L=OA(H,"dist");if(!B(L))console.error(`No build output at ${L} — run \`jx build\` first.`),process.exit(1);let{startPreviewServer:M}=await Promise.resolve().then(() => (iK(),pK)),A=z??4173;M(L,A),console.log(`Previewing ${L} at http://localhost:${A}`)}else if(Z==="schema")try{let{writeProjectSchemas:B}=await Promise.resolve().then(() => (oX(),UH)),{projectSchemaPath:L,documentSchemaPath:M}=await B(H);console.log(`Wrote ${PJ(H,L)}`),console.log(`Wrote ${PJ(H,M)}`)}catch(B){console.error(`Schema generation failed: ${B.message}`),process.exit(1)}else if(Z==="validate")try{let{formatProjectTreeIssues:B,validateProjectTree:L}=await Promise.resolve().then(() => (jA(),TA)),M=await L(H);if(M.valid)console.log(`Project is valid (${M.checked} files checked in ${H})`);else{console.error(`Project is INVALID (${H}):`);for(let A of B(M))console.error(A);process.exit(1)}}catch(B){console.error(`Validation failed: ${B.message}`),process.exit(1)}else console.error(`Unknown command: ${Z}
415
- Run "jx --help" for usage.`),process.exit(1)}var Er=kf();export{Er as ready};
410
+ --connection db push: restrict to one connection name`),process.exit(0);let X=Z==="db",Q=X?$[1]:null,J=$.slice(X?2:1),G=new Set,W=[],Y,z;for(let B=0;B<J.length;B+=1){let F=J[B];if(F==="--connection")B+=1,Y=J[B];else if(F==="--port"){B+=1;let L=Math.trunc(Number(J[B]??""));if(Number.isFinite(L)&&L>=0)z=L}else if(F.startsWith("--"))G.add(F);else W.push(F)}let[q]=W,H=iA(q??".");if(X){if(Q!=="push")console.error(`Unknown db subcommand: ${Q??"(none)"}
411
+ Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let B=G.has("--dry-run");try{let{dbPush:F}=await Promise.resolve().then(() => (TY(),wY)),{results:L,bindingsPatched:w,wranglerPath:N}=await F(H,{dryRun:B,...Y===void 0?{}:{connection:Y}});for(let I of L){let T=I.applied?"applied":"dry-run";console.log(`${I.connection} (${I.provider}) — ${I.tables.length} table(s), ${I.statements.length} statement(s) [${T}]`);for(let E of I.statements)console.log(` ${E}`);for(let E of I.warnings)console.warn(` warning: ${E}`)}if(w&&N)console.log(`Updated bindings in ${dJ(H,N)}`)}catch(F){console.error(`db push failed: ${F.message}`),process.exit(1)}return}if(Z==="build"){let B=G.has("--verbose"),F=!G.has("--no-clean");console.log(`Building site from ${H}...`);try{let{buildSite:L}=await Promise.resolve().then(() => (GH(),JH)),w=await L(H,{clean:F,verbose:B});if(w.errors.length>0){console.error(`
412
+ Build completed with ${w.errors.length} error(s):`);for(let N of w.errors)console.error(` - ${N}`);process.exit(1)}console.log(`
413
+ Done: ${w.routes} routes → ${w.files} files`)}catch(L){console.error(`Build failed: ${L.message}`),process.exit(1)}}else if(Z==="dev")try{let{runDev:B}=await Promise.resolve().then(() => (zH(),YH));B(H,z)}catch(B){console.error(B.message),process.exit(1)}else if(Z==="preview"){let{existsSync:B}=await import("node:fs"),F=iA(H,"dist");if(!B(F))console.error(`No build output at ${F} — run \`jx build\` first.`),process.exit(1);let{startPreviewServer:L}=await Promise.resolve().then(() => (VH(),HH)),w=z??4173;L(F,w),console.log(`Previewing ${F} at http://localhost:${w}`)}else if(Z==="schema")try{let{writeProjectSchemas:B}=await Promise.resolve().then(() => (UQ(),CH)),{projectSchemaPath:F,documentSchemaPath:L}=await B(H);console.log(`Wrote ${dJ(H,F)}`),console.log(`Wrote ${dJ(H,L)}`)}catch(B){console.error(`Schema generation failed: ${B.message}`),process.exit(1)}else if(Z==="validate")try{let{formatProjectTreeIssues:B,validateProjectTree:F}=await Promise.resolve().then(() => (pA(),cA)),L=await F(H);if(L.valid)console.log(`Project is valid (${L.checked} files checked in ${H})`);else{console.error(`Project is INVALID (${H}):`);for(let w of B(L))console.error(w);process.exit(1)}}catch(B){console.error(`Validation failed: ${B.message}`),process.exit(1)}else console.error(`Unknown command: ${Z}
414
+ Run "jx --help" for usage.`),process.exit(1)}var Ma=Nh();export{Ma as ready};