@jxsuite/compiler 0.35.0 → 1.1.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 +191 -164
- package/dist/compiler.js +121 -114
- package/package.json +11 -7
- package/src/cli.ts +132 -9
- package/src/shared.ts +53 -4
- package/src/site/context-injection.ts +0 -6
- package/src/site/db-push.ts +178 -0
- package/src/site/dev-command.ts +84 -0
- package/src/site/format-host.ts +128 -13
- package/src/site/head-merger.ts +13 -0
- package/src/site/image-cache.ts +57 -6
- package/src/site/image-transform.ts +21 -0
- package/src/site/pages-discovery.ts +61 -49
- package/src/site/preview-server.ts +93 -0
- package/src/site/project-sections.ts +48 -0
- package/src/site/prototype-resolver.ts +55 -11
- package/src/site/schema-command.ts +242 -0
- package/src/site/site-build.ts +178 -28
- package/src/site/site-loader.ts +3 -5
- package/src/targets/compile-client.ts +36 -5
- package/src/targets/compile-element.ts +41 -4
- package/src/targets/compile-server.ts +83 -5
- package/src/site/content-loader.ts +0 -385
package/dist/compiler.js
CHANGED
|
@@ -1,83 +1,88 @@
|
|
|
1
|
-
import{createRequire as B3}from"node:module";var Q3=Object.create;var{getPrototypeOf:G3,defineProperty:D1,getOwnPropertyNames:J3}=Object;var Y3=Object.prototype.hasOwnProperty;function q3(Z){return this[Z]}var U3,K3,t4=(Z,X,W)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=X?U3??=new WeakMap:K3??=new WeakMap,Y=J.get(Z);if(Y)return Y}W=Z!=null?Q3(G3(Z)):{};let G=X||!Z||!Z.__esModule?D1(W,"default",{value:Z,enumerable:!0}):W;for(let V of J3(Z))if(!Y3.call(G,V))D1(G,V,{get:q3.bind(Z,V),enumerable:!0});if(Q)J.set(Z,G);return G};var e4=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var V3=(Z)=>Z;function F3(Z,X){this[Z]=V3.bind(null,X)}var U8=(Z,X)=>{for(var W in X)D1(Z,W,{get:X[W],enumerable:!0,configurable:!0,set:F3.bind(X,W)})};var p=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var E2=B3(import.meta.url);function L1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function h2(Z){return V8.has(Z)}function L2(Z,X,W,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return S2(Z,X,W,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return M3(Z.$ref,X,W,Q);if(Array.isArray(Z))return Z.map((J)=>L2(J,X,W,Q));return Z}function M3(Z,X,W,Q){if(Z==="$reduce/acc")return Q?.acc;if(Z.startsWith("$reduce/"))return Q?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return z0(W,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,Y]=J,G,V=L1(X);if(Y==="item")G=Q?.item??V?.item??X["$map/item"];else if(Y==="index")G=Q?.index??V?.index??X["$map/index"];else G=V?.[Y]??X[`$map/${Y}`];return J.length>2?z0(G,J.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let J=Z.slice(8),Y=J.indexOf("/");if(Y===-1)return X[J];return z0(X[J.slice(0,Y)],J.slice(Y+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return z0(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return z0(globalThis.document,Z.slice(10));return X[Z]??null}function $3(Z,X,W,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,Y]=J,G,V=L1(X);if(Y==="item")G=Q?.item??V?.item??X["$map/item"];else if(Y==="index")G=Q?.index??V?.index??X["$map/index"];else G=V?.[Y]??X[`$map/${Y}`];if(J.length>2){let q=J.slice(2),U=q.pop(),H=q.length>0?z0(G,q.join("/")):G;return{key:U,obj:H}}return{key:Y==="item"?"$map/item":"$map/index",obj:L1(X)??X}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:X};let G=J.split("/"),V=G.pop(),q=X;for(let U of G)q=q[U];return{key:V,obj:q}}return{key:Z,obj:X}}function S2(Z,X,W,Q){let{operator:J,target:Y,value:G,initial:V}=Z;if(!H3.has(J))throw Error(`$expression: unknown operator "${J}"`);if(A1.has(J)&&!("value"in Z)){let q=L2(Y,X,W,Q);if(J==="!")return!q;if(J==="-")return-q}if(O1.has(J)){let q=L2(Y,X,W,Q),U=L2(G,X,W,Q);switch(J){case"+":return q+U;case"-":return q-U;case"*":return q*U;case"/":return q/U;case"%":return q%U;case"===":return q===U;case"!==":return q!==U;case"<":return q<U;case"<=":return q<=U;case">":return q>U;case">=":return q>=U;case"&&":return q&&U;case"||":return q||U;default:break}}if(F8.has(J)){let q=L2(G,X,W,Q),{obj:U,key:H}=$3(Y.$ref,X,W,Q);switch(J){case"=":{U[H]=q;break}case"+=":{let F=U[H];U[H]=F+q;break}case"-=":{let F=U[H];U[H]=F-q;break}case"*=":{let F=U[H];U[H]=F*q;break}case"/=":{let F=U[H];U[H]=F/q;break}default:break}return}if(B8.has(J)){let q=L2(Y,X,W,Q);switch(J){case"push":return q.push(L2(G,X,W,Q));case"unshift":return q.unshift(L2(G,X,W,Q));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let U=L2(G,X,W,Q);return q.splice(...U)}default:break}}if(I1.has(J)){let q=L2(Y,X,W,Q);if(J==="reduce"){let U=L2(V,X,W,Q);for(let[H,F]of q.entries())U=S2(G,X,W,{acc:U,index:H,item:F});return U}if(J==="map")return q.map((U,H)=>S2(G,X,W,{...Q,index:H,item:U}));if(J==="filter")return q.filter((U,H)=>S2(G,X,W,{...Q,index:H,item:U}))}return}function H2(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return M2(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return H8(Z.$ref,X);if(Array.isArray(Z))return Z.map((W)=>H2(W,X)).join(", ");return JSON.stringify(Z)}function H8(Z,X){let W=X.statePrefix??"state",Q=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${Q}.${J.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),[,Y]=J;if(Y==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(Y==="index")return"_index";return`_${Y}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${W}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${W}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${W}.${Z}`}function K8(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return H8(Z.$ref,X);return H2(Z,X)}function M2(Z,X={}){let{operator:W,target:Q,value:J,initial:Y}=Z;if(A1.has(W)&&!("value"in Z)){let G=H2(Q,X);if(W==="!")return`!(${G})`;if(W==="-")return`-(${G})`}if(O1.has(W)){let G=H2(Q,X),V=H2(J,X);return`(${G} ${W} ${V})`}if(F8.has(W)){let G=K8(Q,X),V=H2(J,X);return`${G} ${W} ${V}`}if(B8.has(W)){let G=K8(Q,X);switch(W){case"push":return`${G}.push(${H2(J,X)})`;case"unshift":return`${G}.unshift(${H2(J,X)})`;case"pop":return`${G}.pop()`;case"shift":return`${G}.shift()`;case"splice":{let V=Array.isArray(J)?J.map((q)=>H2(q,X)).join(", "):H2(J,X);return`${G}.splice(${V})`}default:break}}if(I1.has(W)){let G=H2(Q,X),V=M2(J,X);if(W==="reduce"){let q=H2(Y,X);return`${G}.reduce((_acc, _item, _index) => ${V}, ${q})`}if(W==="map")return`${G}.map((_item, _index) => ${V})`;if(W==="filter")return`${G}.filter((_item, _index) => ${V})`}return"undefined"}function z0(Z,X){let W=Z;for(let Q of X.split(/[./]/))W=W?.[Q];return W}var V8,A1,O1,F8,B8,I1,H3;var f0=p(()=>{V8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),A1=new Set(["!","-"]),O1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),F8=new Set(["=","+=","-=","*=","/="]),B8=new Set(["push","pop","shift","unshift","splice"]),I1=new Set(["reduce","map","filter"]),H3=new Set([...V8,...A1,...O1,...I1])});function K2(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function A2(Z){return K2(Z)&&typeof Z.$ref==="string"}function k2(Z){return K2(Z)&&Z.$prototype==="Function"}function O2(Z){return K2(Z)&&K2(Z.$expression)}function L0(Z){return K2(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function w1(Z){return K2(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function M8(Z){return K2(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function m2(Z){if(!K2(Z))return!1;for(let X of Object.keys(Z))if(!$8.has(X))return!1;return!0}function G2(Z){return K2(Z)&&Z.$prototype==="Array"}function T1(Z){if(G2(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>G2(X))}function D8(Z){return K2(Z)&&Z.$prototype==="Class"}function i(Z){return typeof Z==="string"&&Z.includes("${")}function u2(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var $8;var f2=p(()=>{$8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function O3(Z){if(!D3||!Z.includes("v"))return Z;return Z.replace(L3,(X,W,Q)=>`${W}${A3[Q.toLowerCase()]??`cq${Q}`}`)}function I3(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function J2(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function X2(Z){return Object.entries(Z).filter(([X,W])=>!I3(X)&&(W===null||typeof W!=="object")).map(([X,W])=>`${J2(X)}: ${O3(String(W))}`).join("; ")}var D3=!1,L3,A3,c2;var A0=p(()=>{f0();f2();L3=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,A3={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};c2=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 i0(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,W]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(W&&typeof W==="object"&&!Array.isArray(W)&&W.timing==="compiler")continue;if(typeof W!=="object"||W===null||Array.isArray(W))return!0;if(W.$prototype)return!0;if("default"in W)return!0;if(m2(W))continue;return!0}if(Z.$switch)return!0;if(G2(Z)||T1(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>i0(X)))return!0;for(let[X,W]of Object.entries(Z)){if(c2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(i(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(i(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(i(X))return!0}return!1}function A8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(G2(Z)||T1(Z.children))return!0;for(let[X,W]of Object.entries(Z)){if(c2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(i(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(i(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(i(X))return!0}return!1}function G0(Z,X=null,W={},Q={}){let J=Z?.state?O8(Z.state,X):X??Object.create(null);return{media:Q,scope:J,scopeDefs:W}}function O8(Z={},X=null){let W=Object.create(X??null);for(let[Q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){i2(W,Q,c0(J));continue}let Y=J;if("default"in Y){i2(W,Q,c0(Y.default));continue}if(!Y.$prototype&&!("$expression"in Y)&&!m2(Y))i2(W,Q,c0(Y))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&i(J)){R1(W,Q,()=>N1(J,W));continue}if(!J||typeof J!=="object")continue;if(O2(J)){let Y=J.$expression;if(h2(Y.operator))i2(W,Q,(G,V)=>S2(Y,G,V));else R1(W,Q,()=>S2(Y,W,null));continue}if(k2(J)){if(J.body){let Y=J.parameters?u2(J.parameters):J.arguments??[],G=Function("state",...Y,J.body);if(J.body.includes("return"))R1(W,Q,()=>G(W));else i2(W,Q,G)}else i2(W,Q,()=>{});continue}if(L0(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))i2(W,Q,c0(J.default??null))}return W}function i2(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:W,writable:!0})}function R1(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:W})}function t(Z,X){if(I2(Z))return w3(Z.$ref,X);if(i(Z))return N1(Z,X);return Z}function I2(Z){return A2(Z)}function w3(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let W=Z.split("/"),Q=W[1],J=X.$map?.[Q]??X[`$map/${Q}`];return W.length>2?L8(J,W.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let W=Z.slice(8),Q=W.indexOf("/");if(Q===-1)return X[W];return L8(X[W.slice(0,Q)],W.slice(Q+1))}return X[Z]??null}function N1(Z,X){try{let W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map",`return (${W[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function L8(Z,X){if(!X)return Z;let W=Z;for(let Q of X.split("/"))W=W==null?void 0:W[Q];return W}function c0(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function W0(Z,X){let W="",Q=t(Z.id,X),J=t(Z.className,X),Y=t(Z.hidden,X),G=t(Z.tabIndex,X),V=t(Z.title,X),q=t(Z.lang,X),U=t(Z.dir,X);if(Q)W+=` id="${d(String(Q))}"`;if(J)W+=` class="${d(String(J))}"`;if(Y)W+=" hidden";if(G!==void 0&&G!==null)W+=` tabindex="${d(String(G))}"`;if(V)W+=` title="${d(String(V))}"`;if(q)W+=` lang="${d(String(q))}"`;if(U)W+=` dir="${d(String(U))}"`;if(Z.style&&X){let H=Object.entries(Z.style).filter(([F,B])=>!F.startsWith(":")&&!F.startsWith(".")&&!F.startsWith("&")&&!F.startsWith("[")&&!F.startsWith("@")&&B!==null&&typeof B!=="object"&&typeof B==="string"&&i(B)).map(([F,B])=>{let M=t(B,X);return M==null?null:`${J2(F)}: ${M}`}).filter(Boolean).join("; ");if(H)W+=` style="${H}"`}if(Z.attributes)for(let[H,F]of Object.entries(Z.attributes)){let B=t(F,X);if(B!==null&&B!==void 0&&(typeof B==="string"||typeof B==="number"||typeof B==="boolean"))W+=` ${H}="${d(String(B))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)W+=' loading="lazy"';if(!Z.attributes?.decoding)W+=' decoding="async"'}if(Z.$static)W+=" data-jx-static";else if(Z.$prerendered)W+=" data-jx-prerendered";return W}function J0(Z,X={},W=null){let Q=[];if(W&&typeof W==="object"){let Y=(H,F)=>{let B=X2(F);if(B)Q.push(`${H} { ${B} }`);for(let[M,L]of Object.entries(F)){if(L===null||typeof L!=="object"||Array.isArray(L))continue;if(M.startsWith("@")){let C=M.startsWith("@--")?`@media ${X[M.slice(1)]??M.slice(1)}`:M,_=X2(L);if(_)Q.push(`${C} { ${H} { ${_} } }`);for(let[x,h]of Object.entries(L)){if(h===null||typeof h!=="object"||Array.isArray(h))continue;if(x.startsWith("@"))continue;let u=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,f=X2(h);if(f)Q.push(`${C} { ${u} { ${f} } }`)}continue}let E=M.startsWith("&")?M.replace("&",H):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${H}${M}`:`${H} ${M}`;Y(E,L)}};for(let[H,F]of Object.entries(W))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))Y(H,F);else if(F!==null&&typeof F==="object"&&!Array.isArray(F)&&!H.startsWith("@")&&!H.startsWith("--"))Y(H,F);else if(H.startsWith("@")){let B=H.startsWith("@--")?`@media ${X[H.slice(1)]??H.slice(1)}`:H.startsWith("@(")?`@media ${H.slice(1)}`:H;Q.push(`${B} { body { ${X2(F)} } }`)}let G={},V={};for(let[H,F]of Object.entries(W)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(F!==null&&typeof F==="object"&&!Array.isArray(F))continue;if(H.startsWith("--"))G[H]=F;else V[H]=F}let q=X2(G);if(q)Q.push(`:root { ${q} }`);let U=X2(V);if(U)Q.push(`body { ${U} }`)}if(Q0(Z,Q,X,"",{n:0}),Q.length===0)return"";return`<style>
|
|
1
|
+
import{createRequire as j6}from"node:module";var D6=Object.create;var{getPrototypeOf:L6,defineProperty:E1,getOwnPropertyNames:A6}=Object;var w6=Object.prototype.hasOwnProperty;function I6(Z){return this[Z]}var O6,_6,B7=(Z,X,W)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var G=X?O6??=new WeakMap:_6??=new WeakMap,J=G.get(Z);if(J)return J}W=Z!=null?D6(L6(Z)):{};let U=X||!Z||!Z.__esModule?E1(W,"default",{value:Z,enumerable:!0}):W;for(let K of A6(Z))if(!w6.call(U,K))E1(U,K,{get:I6.bind(Z,K),enumerable:!0});if(Q)G.set(Z,U);return U};var F7=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var T6=(Z)=>Z;function N6(Z,X){this[Z]=T6.bind(null,X)}var o8=(Z,X)=>{for(var W in X)E1(Z,W,{get:X[W],enumerable:!0,configurable:!0,set:N6.bind(X,W)})};var c=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var v2=j6(import.meta.url);function x1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function Z9(Z){return Z.startsWith("window#/")&&R6.has(Z.slice(8))}function d2(Z){return a8.has(Z)}function r(Z,X){if(!Z)return;let W=(Z.depth??0)+1;if(W>E6)return;return{depth:W,path:[...Z.path??[],...Array.isArray(X)?X:[X]],report:Z.report}}function i(Z,X,W,Q,G){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return B2(Z,X,W,Q,G);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z){let J=X9(Z.$ref,X,W,Q);return G?.report(G.path??[],J),J}if(Array.isArray(Z))return Z.map((J,U)=>i(J,X,W,Q,r(G,U)));return G?.report(G.path??[],Z),Z}function X9(Z,X,W,Q){if(Z==="$reduce/acc")return Q?.acc;if(Z.startsWith("$reduce/"))return Q?.acc;if(Z.startsWith("$args/")){let G=Z.slice(6).split("/"),J=Q?.args?.[G[0]];return G.length>1?y2(J,G.slice(1).join("/")):J}if(Z.startsWith("event#/")){let G=Z.slice(7);return y2(W,G)}if(Z.startsWith("$map/")){let G=Z.split("/"),[,J]=G,U,K=x1(X);if(J==="item")U=Q?.item??K?.item??X["$map/item"];else if(J==="index")U=Q?.index??K?.index??X["$map/index"];else U=K?.[J]??X[`$map/${J}`];return G.length>2?y2(U,G.slice(2).join("/")):U}if(Z.startsWith("#/state/")){let G=Z.slice(8),J=G.indexOf("/");if(J===-1)return X[G];return y2(X[G.slice(0,J)],G.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return y2(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return y2(globalThis.document,Z.slice(10));return X[Z]??null}function x6(Z,X,W,Q){if(Z.startsWith("$map/")){let G=Z.split("/"),[,J]=G,U,K=x1(X);if(J==="item")U=Q?.item??K?.item??X["$map/item"];else if(J==="index")U=Q?.index??K?.index??X["$map/index"];else U=K?.[J]??X[`$map/${J}`];if(G.length>2){let V=G.slice(2),Y=V.pop(),q=V.length>0?y2(U,V.join("/")):U;return{key:Y,obj:q}}return{key:J==="item"?"$map/item":"$map/index",obj:x1(X)??X}}if(Z.startsWith("#/state/")){let G=Z.slice(8);if(G.indexOf("/")===-1)return{key:G,obj:X};let U=G.split("/"),K=U.pop(),V=X;for(let Y of U)V=V[Y];return{key:K,obj:V}}return{key:Z,obj:X}}function B2(Z,X,W,Q,G){let J=S6(Z,X,W,Q,G);return G?.report(G.path??[],J),J}function S6(Z,X,W,Q,G){let{operator:J,target:U,value:K,initial:V}=Z;if(!C6.has(J))throw Error(`$expression: unknown operator "${J}"`);if(S1.has(J)&&!("value"in Z)){let Y=i(U,X,W,Q,r(G,"target"));if(J==="!")return!Y;if(J==="-")return-Y}if(J==="call"){let Y=U?.$ref;if(typeof Y!=="string")throw TypeError("$expression: call target must be a $ref pointer");let q=(Q?.callDepth??0)+1;if(q>r8)throw Error(`$expression: call depth exceeded (${r8})`);let M=Array.isArray(K)?K.map((F,L)=>i(F,X,W,Q,r(G,["value",L]))):[];if(Y.startsWith("window#/")){if(!Z9(Y))throw Error(`$expression: "${Y}" is not a blessed pure global`);let F=Y.slice(8),L=P6[F];if(L)return L(...M);let C=y2(globalThis.window,F),I=F.lastIndexOf("/"),E=I===-1?globalThis.window:y2(globalThis.window,F.slice(0,I));return C.apply(E,M)}let B=X9(Y,X,W,Q);if(typeof B==="function")return B(...M);if(B&&typeof B==="object"&&"$expression"in B){let F=B,L={};for(let[C,I]of(F.parameters??[]).entries()){let E=typeof I==="string"?I:I?.name??"";if(!E)continue;L[E]=M[C]===void 0&&typeof I==="object"&&I!==null&&"default"in I?I.default:M[C]}return B2(F.$expression,X,W,{args:L,callDepth:q})}throw TypeError(`$expression: call target "${Y}" is not callable`)}if(g1.has(J)){if(J==="?:"){let F=i(U,X,W,Q,r(G,"target"));if(G){let L=i(K,X,W,Q,r(G,"value")),C=i(V,X,W,Q,r(G,"initial"));return F?L:C}return F?i(K,X,W,Q):i(V,X,W,Q)}let Y=i(U,X,W,Q,r(G,"target")),q=String(Y),M=Z.cases??{},B=Object.hasOwn(M,q);if(G){let F;for(let[C,I]of Object.entries(M)){let E=i(I,X,W,Q,r(G,["cases",C]));if(C===q)F=E}let L=i(Z.default,X,W,Q,r(G,"default"));return B?F:L}return B?i(M[q],X,W,Q):i(Z.default,X,W,Q)}if(k1.has(J)){let Y=i(U,X,W,Q,r(G,"target")),q=i(K,X,W,Q,r(G,"value"));switch(J){case"+":return Y+q;case"-":return Y-q;case"*":return Y*q;case"/":return Y/q;case"%":return Y%q;case"===":return Y===q;case"!==":return Y!==q;case"<":return Y<q;case"<=":return Y<=q;case">":return Y>q;case">=":return Y>=q;case"&&":return Y&&q;case"||":return Y||q;case"??":return Y??q;default:break}}if(t8.has(J)){let Y=i(K,X,W,Q,r(G,"value")),{obj:q,key:M}=x6(U.$ref,X,W,Q);switch(J){case"=":{q[M]=Y;break}case"+=":{let B=q[M];q[M]=B+Y;break}case"-=":{let B=q[M];q[M]=B-Y;break}case"*=":{let B=q[M];q[M]=B*Y;break}case"/=":{let B=q[M];q[M]=B/Y;break}default:break}return}if(e8.has(J)){let Y=i(U,X,W,Q,r(G,"target"));switch(J){case"push":return Y.push(i(K,X,W,Q,r(G,"value")));case"unshift":return Y.unshift(i(K,X,W,Q,r(G,"value")));case"pop":return Y.pop();case"shift":return Y.shift();case"splice":{let q=i(K,X,W,Q,r(G,"value"));return Y.splice(...q)}default:break}}if(v1.has(J)){let Y=i(U,X,W,Q,r(G,"target")),q=K===void 0?[]:Array.isArray(K)?i(K,X,W,Q,r(G,"value")):[i(K,X,W,Q,r(G,"value"))],M=Y?.[J];if(typeof M!=="function")return;return M.apply(Y,q)}if(b1.has(J)){let Y=i(U,X,W,Q,r(G,"target"));if(J==="reduce"){let q=i(V,X,W,Q,r(G,"initial"));for(let[M,B]of Y.entries())q=B2(K,X,W,{acc:q,index:M,item:B},M===0?r(G,"value"):void 0);return q}if(J==="map")return Y.map((q,M)=>B2(K,X,W,{...Q,index:M,item:q},M===0?r(G,"value"):void 0));if(J==="filter")return Y.filter((q,M)=>B2(K,X,W,{...Q,index:M,item:q},M===0?r(G,"value"):void 0))}return}function s(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return G2(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return y1(Z.$ref,X);if(Array.isArray(Z))return Z.map((W)=>s(W,X)).join(", ");return JSON.stringify(Z)}function k6(Z){return`_fx_${Z.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function y1(Z,X){let W=X.statePrefix??"state",Q=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("$args/"))return`_args${Z.slice(6).split("/").map((J)=>`[${JSON.stringify(J)}]`).join("")}`;if(Z.startsWith("event#/")){let G=Z.slice(7);return`${Q}.${G.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let G=Z.split("/"),[,J]=G;if(J==="item")return G.length>2?`_item.${G.slice(2).join(".")}`:"_item";if(J==="index")return"_index";return`_${J}`}if(Z.startsWith("#/state/")){let G=Z.slice(8);return`${W}.${G.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${W}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${W}.${Z}`}function s8(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return y1(Z.$ref,X);return s(Z,X)}function b6(Z,X){let W=(Q)=>X[Q]??"undefined";switch(Z){case"Intl/formatNumber":return`new Intl.NumberFormat(${W(1)}, ${W(2)}).format(${W(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${W(1)}, ${W(2)}).format(new Date(${W(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${W(2)}, ${W(3)}).format(${W(0)}, ${W(1)})`;default:return null}}function G2(Z,X={}){let{operator:W,target:Q,value:G,initial:J}=Z;if(S1.has(W)&&!("value"in Z)){let U=s(Q,X);if(W==="!")return`!(${U})`;if(W==="-")return`-(${U})`}if(W==="call"){let U=Q?.$ref??"",K=Array.isArray(G)?G.map((V)=>s(V,X)):[];if(U.startsWith("window#/")){if(!Z9(U))throw Error(`$expression: "${U}" is not a blessed pure global`);let V=b6(U.slice(8),K);if(V)return V;return`window.${U.slice(8).replaceAll("/",".")}(${K.join(", ")})`}if(U.startsWith("#/state/")){let V=U.slice(8),Y=X.formulaParams?.[V];if(Y){let q=Y.map((M,B)=>`${JSON.stringify(M)}: ${K[B]??"undefined"}`).join(", ");return`${k6(V)}(${X.statePrefix??"state"}, { ${q} })`}}return`${y1(U,X)}(${K.join(", ")})`}if(g1.has(W)){if(W==="?:"){let Y=s(Q,X),q=s(G,X),M=s(J,X);return`(${Y} ? ${q} : ${M})`}let U=s(Q,X),K=Object.entries(Z.cases??{}).map(([Y,q])=>`_d === ${JSON.stringify(Y)} ? ${s(q,X)} : `).join(""),V="default"in Z?s(Z.default,X):"undefined";return`((_d) => ${K}${V})(String(${U}))`}if(k1.has(W)){let U=s(Q,X),K=s(G,X);return`(${U} ${W} ${K})`}if(t8.has(W)){let U=s8(Q,X),K=s(G,X);return`${U} ${W} ${K}`}if(e8.has(W)){let U=s8(Q,X);switch(W){case"push":return`${U}.push(${s(G,X)})`;case"unshift":return`${U}.unshift(${s(G,X)})`;case"pop":return`${U}.pop()`;case"shift":return`${U}.shift()`;case"splice":{let K=Array.isArray(G)?G.map((V)=>s(V,X)).join(", "):s(G,X);return`${U}.splice(${K})`}default:break}}if(v1.has(W)){let U=s(Q,X),K=G===void 0?"":Array.isArray(G)?G.map((V)=>s(V,X)).join(", "):s(G,X);return`(${U})?.${W}?.(${K})`}if(b1.has(W)){let U=s(Q,X),K=G2(G,X);if(W==="reduce"){let V=s(J,X);return`${U}.reduce((_acc, _item, _index) => ${K}, ${V})`}if(W==="map")return`${U}.map((_item, _index) => ${K})`;if(W==="filter")return`${U}.filter((_item, _index) => ${K})`}return"undefined"}function y2(Z,X){let W=Z;for(let Q of X.split(/[./]/))W=W?.[Q];return W}function o0(Z,X,W,Q){return i(Z,X,W,Q)}function r0(Z,X={}){return s(Z,X)}var a8,S1,k1,t8,e8,b1,g1,v1,C6,R6,P6,r8=64,E6=64;var _0=c(()=>{a8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),S1=new Set(["!","-"]),k1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),t8=new Set(["=","+=","-=","*=","/="]),e8=new Set(["push","pop","shift","unshift","splice"]),b1=new Set(["reduce","map","filter"]),g1=new Set(["?:","switch"]),v1=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"]),C6=new Set([...a8,...S1,...k1,...b1,...g1,...v1,"call"]),R6=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"]),P6={"Intl/formatDate":(Z,X,W)=>new Intl.DateTimeFormat(X,W).format(new Date(Z)),"Intl/formatNumber":(Z,X,W)=>new Intl.NumberFormat(X,W).format(Z),"Intl/formatRelativeTime":(Z,X,W,Q)=>new Intl.RelativeTimeFormat(W,Q).format(Z,X)}});function F2(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function _2(Z){return F2(Z)&&typeof Z.$ref==="string"}function j2(Z){return F2(Z)&&Z.$prototype==="Function"}function L2(Z){return F2(Z)&&F2(Z.$expression)}function t2(Z){return L2(Z)&&Array.isArray(Z.parameters)&&Z.parameters.length>0}function C2(Z){return j2(Z)&&Array.isArray(Z.body)}function T0(Z){return F2(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function m1(Z){return F2(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function z9(Z){return F2(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function p2(Z){if(!F2(Z))return!1;for(let X of Object.keys(Z))if(!W9.has(X))return!1;return!0}function K2(Z){return F2(Z)&&Z.$prototype==="Array"}function h1(Z){if(K2(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>K2(X))}function Q9(Z){return F2(Z)&&Z.$prototype==="Class"}function o(Z){return typeof Z==="string"&&Z.includes("${")}function l2(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var W9;var i2=c(()=>{W9=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function G9(Z){if("operator"in Z)return"expression";if("if"in Z)return"if";if("$switch"in Z)return"switch";return"dispatch"}async function Y0(Z,X,W,Q={}){let G=Q.args?{args:Q.args}:void 0;for(let J of Z)switch(G9(J)){case"expression":{let U=B2(J,X,W,G);if(U&&typeof U.then==="function")await U;break}case"if":{let U=J,K=o0(U.if,X,W,G)?U.then:U.else;if(Array.isArray(K))await Y0(K,X,W,Q);break}case"switch":{let U=J,K=String(o0(U.$switch,X,W,G)),V=U.cases??{},Y=Object.hasOwn(V,K)?V[K]:U.default;if(Array.isArray(Y))await Y0(Y,X,W,Q);break}case"dispatch":{let U=J,K=Q.target??W?.currentTarget;if(!K)break;let V={};if("detail"in U)V.detail=o0(U.detail,X,W,G);if(U.bubbles!==void 0)V.bubbles=U.bubbles;if(U.composed!==void 0)V.composed=U.composed;K.dispatchEvent(new CustomEvent(U.dispatchEvent,V));break}default:break}}function A2(Z,X={}){let W=X.indent??"",Q=[];for(let G of Z)switch(G9(G)){case"expression":{Q.push(`${W}${G2(G,X)};`);break}case"if":{let J=G,U=r0(J.if,X),K={...X,indent:`${W} `};if(Q.push(`${W}if (${U}) {`,A2(J.then??[],K)),J.else)Q.push(`${W}} else {`,A2(J.else,K));Q.push(`${W}}`);break}case"switch":{let J=G,U=r0(J.$switch,X),K={...X,indent:`${W} `};Q.push(`${W}switch (String(${U})) {`);for(let[V,Y]of Object.entries(J.cases??{}))Q.push(`${W} case ${JSON.stringify(V)}: {`,A2(Y,K),`${W} break;`,`${W} }`);if(J.default)Q.push(`${W} default: {`,A2(J.default,K),`${W} }`);Q.push(`${W}}`);break}case"dispatch":{let J=G,U=X.eventParam??"event",K=X.dispatchTarget??`(${U} && ${U}.currentTarget)`,V=[];if("detail"in J)V.push(`detail: ${r0(J.detail,X)}`);if(J.bubbles!==void 0)V.push(`bubbles: ${JSON.stringify(J.bubbles)}`);if(J.composed!==void 0)V.push(`composed: ${JSON.stringify(J.composed)}`);let Y=V.length>0?`, { ${V.join(", ")} }`:"";Q.push(`${W}${K}?.dispatchEvent(new CustomEvent(${JSON.stringify(J.dispatchEvent)}${Y}));`);break}default:break}return Q.join(`
|
|
2
|
+
`)}var s0=c(()=>{_0()});function m6(Z){if(!g6||!Z.includes("v"))return Z;return Z.replace(v6,(X,W,Q)=>`${W}${y6[Q.toLowerCase()]??`cq${Q}`}`)}function h6(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function q2(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function J2(Z){return Object.entries(Z).filter(([X,W])=>!h6(X)&&(W===null||typeof W!=="object")).map(([X,W])=>`${q2(X)}: ${m6(String(W))}`).join("; ")}var g6=!1,v6,y6,n2;var N0=c(()=>{_0();i2();s0();v6=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,y6={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};n2=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 j0(Z,X){let W=[];for(let[Q,G]of(Z.parameters??[]).entries()){let J=typeof G==="string"?G:G?.name??"";if(!J)continue;let K=typeof G==="object"&&G!==null&&"default"in G?`_a[${Q}] === undefined ? ${JSON.stringify(G.default)} : _a[${Q}]`:`_a[${Q}]`;W.push(`${JSON.stringify(J)}: ${K}`)}return`(..._a) => { const _args = { ${W.join(", ")} }; return ${X}; }`}function X1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,W]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(W&&typeof W==="object"&&!Array.isArray(W)&&W.timing==="compiler")continue;if(typeof W!=="object"||W===null||Array.isArray(W))return!0;if(W.$prototype)return!0;if("default"in W)return!0;if(p2(W))continue;return!0}if(Z.$switch)return!0;if(K2(Z)||h1(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>X1(X)))return!0;for(let[X,W]of Object.entries(Z)){if(n2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(o(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(o(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(o(X))return!0}return!1}function U9(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(K2(Z)||h1(Z.children))return!0;for(let[X,W]of Object.entries(Z)){if(n2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(o(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(o(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(o(X))return!0}return!1}function V0(Z,X=null,W={},Q={}){let G=Z?.state?Y9(Z.state,X):X??Object.create(null);return{media:Q,scope:G,scopeDefs:W}}function Y9(Z={},X=null){let W=Object.create(X??null);for(let[Q,G]of Object.entries(Z)){if(typeof G!=="object"||G===null||Array.isArray(G)){m2(W,Q,a0(G));continue}let J=G;if("default"in J){m2(W,Q,a0(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!p2(J))m2(W,Q,a0(J))}for(let[Q,G]of Object.entries(Z)){if(typeof G==="string"&&o(G)){u1(W,Q,()=>c1(G,W));continue}if(!G||typeof G!=="object")continue;if(L2(G)){let J=G.$expression;if(t2(G)){let U=G.parameters;m2(W,Q,(...K)=>{let V={};for(let[Y,q]of U.entries()){let M=typeof q==="string"?q:q?.name??"";if(!M)continue;V[M]=K[Y]===void 0&&typeof q==="object"&&q!==null&&"default"in q?q.default:K[Y]}return B2(J,W,null,{args:V})})}else if(d2(J.operator))m2(W,Q,(U,K)=>B2(J,U,K));else u1(W,Q,()=>B2(J,W,null));continue}if(j2(G)){if(C2(G)){let{body:J}=G;m2(W,Q,(U,K)=>{Y0(J,U??W,K??null)})}else if(typeof G.body==="string"){let J=G.parameters?l2(G.parameters):G.arguments??[],{body:U}=G,K=Function("state",...J,U);if(U.includes("return"))u1(W,Q,()=>K(W));else m2(W,Q,K)}else m2(W,Q,()=>{});continue}if(T0(G)&&(G.$prototype==="LocalStorage"||G.$prototype==="SessionStorage"))m2(W,Q,a0(G.default??null))}return W}function m2(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:W,writable:!0})}function u1(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:W})}function z2(Z,X){if(T2(Z))return u6(Z.$ref,X);if(o(Z))return c1(Z,X);return Z}function T2(Z){return _2(Z)}function u6(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let W=Z.split("/"),Q=W[1],G=X.$map?.[Q]??X[`$map/${Q}`];return W.length>2?J9(G,W.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let W=Z.slice(8),Q=W.indexOf("/");if(Q===-1)return X[W];return J9(X[W.slice(0,Q)],W.slice(Q+1))}return X[Z]??null}function c1(Z,X){try{let W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map",`return (${W[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function J9(Z,X){if(!X)return Z;let W=Z;for(let Q of X.split("/"))W=W==null?void 0:W[Q];return W}function a0(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function K0(Z,X){let W="",Q=z2(Z.id,X),G=z2(Z.className,X),J=z2(Z.hidden,X),U=z2(Z.tabIndex,X),K=z2(Z.title,X),V=z2(Z.lang,X),Y=z2(Z.dir,X);if(Q)W+=` id="${p(String(Q))}"`;if(G)W+=` class="${p(String(G))}"`;if(J)W+=" hidden";if(U!==void 0&&U!==null)W+=` tabindex="${p(String(U))}"`;if(K)W+=` title="${p(String(K))}"`;if(V)W+=` lang="${p(String(V))}"`;if(Y)W+=` dir="${p(String(Y))}"`;if(Z.style&&X){let q=Object.entries(Z.style).filter(([M,B])=>!M.startsWith(":")&&!M.startsWith(".")&&!M.startsWith("&")&&!M.startsWith("[")&&!M.startsWith("@")&&B!==null&&typeof B!=="object"&&typeof B==="string"&&o(B)).map(([M,B])=>{let F=z2(B,X);return F==null?null:`${q2(M)}: ${F}`}).filter(Boolean).join("; ");if(q)W+=` style="${q}"`}if(Z.attributes)for(let[q,M]of Object.entries(Z.attributes)){let B=z2(M,X);if(B!==null&&B!==void 0&&(typeof B==="string"||typeof B==="number"||typeof B==="boolean"))W+=` ${q}="${p(String(B))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)W+=' loading="lazy"';if(!Z.attributes?.decoding)W+=' decoding="async"'}if(Z.$static)W+=" data-jx-static";else if(Z.$prerendered)W+=" data-jx-prerendered";return W}function H0(Z,X={},W=null){let Q=[];if(W&&typeof W==="object"){let J=(q,M)=>{let B=J2(M);if(B)Q.push(`${q} { ${B} }`);for(let[F,L]of Object.entries(M)){if(L===null||typeof L!=="object"||Array.isArray(L))continue;if(F.startsWith("@")){let I=F.startsWith("@--")?`@media ${X[F.slice(1)]??F.slice(1)}`:F,E=J2(L);if(E)Q.push(`${I} { ${q} { ${E} } }`);for(let[P,b]of Object.entries(L)){if(b===null||typeof b!=="object"||Array.isArray(b))continue;if(P.startsWith("@"))continue;let m=P.startsWith("&")?P.replace("&",q):P.startsWith(":")||P.startsWith(".")||P.startsWith("[")?`${q}${P}`:`${q} ${P}`,f=J2(b);if(f)Q.push(`${I} { ${m} { ${f} } }`)}continue}let C=F.startsWith("&")?F.replace("&",q):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${q}${F}`:`${q} ${F}`;J(C,L)}};for(let[q,M]of Object.entries(W))if(q.startsWith(":")||q.startsWith(".")||q.startsWith("["))J(q,M);else if(M!==null&&typeof M==="object"&&!Array.isArray(M)&&!q.startsWith("@")&&!q.startsWith("--"))J(q,M);else if(q.startsWith("@")){let B=q.startsWith("@--")?`@media ${X[q.slice(1)]??q.slice(1)}`:q.startsWith("@(")?`@media ${q.slice(1)}`:q;Q.push(`${B} { body { ${J2(M)} } }`)}let U={},K={};for(let[q,M]of Object.entries(W)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("[")||q.startsWith("@"))continue;if(M!==null&&typeof M==="object"&&!Array.isArray(M))continue;if(q.startsWith("--"))U[q]=M;else K[q]=M}let V=J2(U);if(V)Q.push(`:root { ${V} }`);let Y=J2(K);if(Y)Q.push(`body { ${Y} }`)}if(q0(Z,Q,X,"",{n:0}),Q.length===0)return"";return`<style>
|
|
2
3
|
${Q.join(`
|
|
3
4
|
`)}
|
|
4
|
-
</style>`}function
|
|
5
|
-
${
|
|
5
|
+
</style>`}function K9(Z,X,W,Q){let G=J2(X);if(G)W.push(`${Z} { ${G} }`);for(let[J,U]of Object.entries(X)){if(U===null||typeof U!=="object"||Array.isArray(U))continue;if(J.startsWith("@")){let V=J.startsWith("@--")?`@media ${Q[J.slice(1)]??J.slice(1)}`:J.startsWith("@(")?`@media ${J.slice(1)}`:J,Y=J2(U);if(Y)W.push(`${V} { ${Z} { ${Y} } }`);for(let[q,M]of Object.entries(U)){if(M===null||typeof M!=="object"||Array.isArray(M))continue;if(q.startsWith("@"))continue;let B=q.startsWith("&")?q.replace("&",Z):q.startsWith(":")||q.startsWith(".")||q.startsWith("[")?`${Z}${q}`:`${Z} ${q}`,F=J2(M);if(F)W.push(`${V} { ${B} { ${F} } }`)}continue}let K=J.startsWith("&")?J.replace("&",Z):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${Z}${J}`:`${Z} ${J}`;K9(K,U,W,Q)}}function q0(Z,X,W,Q="",G,J="jx"){let U=G??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${J}-${U.n}`,U.n+=1;let K=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let V=[];for(let[Y,q]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(q===null||typeof q==="object")continue;if(typeof q==="string"&&o(q))continue;V.push(` ${q2(Y)}: ${q};`)}if(V.length>0)X.push(`${K} {
|
|
6
|
+
${V.join(`
|
|
6
7
|
`)}
|
|
7
|
-
}`);for(let[
|
|
8
|
-
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let
|
|
9
|
-
`);return`<${Q}${
|
|
10
|
-
`)}function
|
|
11
|
-
${
|
|
8
|
+
}`);for(let[Y,q]of Object.entries(Z.style)){if(q===null||typeof q!=="object"||Array.isArray(q))continue;if(Y.startsWith("@")){let M=Y.startsWith("@--")?`@media ${W[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y,B=J2(q);if(B)X.push(`${M} { ${K} { ${B} } }`);for(let[F,L]of Object.entries(q)){if(L===null||typeof L!=="object"||Array.isArray(L))continue;if(F.startsWith("@"))continue;let C=F.startsWith("&")?F.replace("&",K):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${K}${F}`:`${K} ${F}`;X.push(`${M} { ${C} { ${J2(L)} } }`)}}else{let M=Y.startsWith("&")?Y.replace("&",K):Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("[")?`${K}${Y}`:`${K} ${Y}`;K9(M,q,X,W)}}}if(Array.isArray(Z.children))for(let V of Z.children)q0(V,X,W,K,U,J);if(Z.cases&&typeof Z.cases==="object")for(let V of Object.values(Z.cases))q0(V,X,W,K,U,J)}function p(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function z1(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function q9(Z){let X=new Map;return V9(Z,X),[...X.values()]}function V9(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[W,Q]of Object.entries(Z.state))if(m1(Q))X.set(Q.$export,{exportName:Q.$export,key:W,src:Q.$src})}if(Array.isArray(Z.children))for(let W of Z.children)V9(W,X)}function t0(Z,X,W=null){if(typeof Z==="string"){if(o(Z)&&X){let U=c1(Z,X);return U!=null?p(String(U)):p(Z)}return p(Z)}if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(Array.isArray(Z))return Z.map((U)=>t0(U,X,W)).join(`
|
|
9
|
+
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let U=Z.tagName??"div",K=K0(Z,X),V=z2(Z.$switch,X),Y=V==null?void 0:Z.cases?.[String(V)],q=Y!==void 0&&!T2(Y)?t0(Y,X,W):"";return`<${U}${K}>${q}</${U}>`}let Q=Z.tagName??"div";if(Q==="slot"&&W!=null)return W;let G=K0(Z,X);if(d1.has(Q))return`<${Q}${G}>`;let J="";if(Z.textContent!==void 0){let U=z2(Z.textContent,X);J=U!=null?p(String(U)):""}else if(Z.innerHTML){let U=z2(Z.innerHTML,X);J=U!=null?String(U):Z.innerHTML}else if(Array.isArray(Z.children))J=Z.children.map((U)=>t0(U,X,W)).join(`
|
|
10
|
+
`);return`<${Q}${G}>${J}</${Q}>`}function E7(Z,X=null,W=null){let Q=Z.state??{};if(X){Q={...Q};for(let[J,U]of Object.entries(X))if(J in Q){let K=Q[J];Q[J]=K&&typeof K==="object"&&!Array.isArray(K)&&"default"in K?{...K,default:U}:U}else Q[J]=U}let G=Y9(Q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((J)=>t0(J,G,W)).join(`
|
|
11
|
+
`)}function x7(Z){return f1(Z)}function f1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>f1(X));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let W=X;if(W.$prototype)return!1;if(W.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((X)=>f1(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function S7(Z,X,W=null,Q={}){let G=[];if(X&&typeof X==="object"){let J=[];for(let[U,K]of Object.entries(X)){if(U.startsWith(":")||U.startsWith(".")||U.startsWith("&")||U.startsWith("[")||U.startsWith("@"))continue;if(K===null||typeof K==="object")continue;if(typeof K==="string"&&o(K))continue;J.push(` ${q2(U)}: ${K};`)}if(J.length>0)G.push(`${Z} {
|
|
12
|
+
${J.join(`
|
|
12
13
|
`)}
|
|
13
|
-
}`);for(let[
|
|
14
|
+
}`);for(let[U,K]of Object.entries(X))if(U.startsWith("@")){let V=U.startsWith("@--")?`@media ${Q[U.slice(1)]??U.slice(1)}`:U.startsWith("@(")?`@media ${U.slice(1)}`:U;G.push(`${V} { ${Z} { ${J2(K)} } }`)}else if(U.startsWith(":")||U.startsWith(".")||U.startsWith("&")||U.startsWith("[")){let V=U.startsWith("&")?U.replace("&",Z):`${Z}${U}`;G.push(`${V} { ${J2(K)} }`)}}if(W&&Array.isArray(W.children)){let J={n:0};for(let U of W.children)q0(U,G,Q,"",J,Z)}return G.length>0?`${G.join(`
|
|
14
15
|
`)}
|
|
15
|
-
`:""}var d0="https://esm.sh/@vue/reactivity@3.5.32",l0="https://esm.sh/lit-html@3.3.0",j1;var n2=p(()=>{A0();f0();f2();A0();f0();f2();j1=new Set(["input","br","hr","img","meta","link","area","col","source"])});function b2(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var T3,I0=()=>T3;var R8=p(()=>{T3=/^win/.test(globalThis.process?globalThis.process.platform:"")});function e(Z,X){let W=new URL(b2(Z),"https://aaa.nonexistanturl.com"),Q=new URL(b2(X),W),J=X.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:G,search:V,hash:q}=Q;return G+V+decodeURIComponent(q)+J}let Y=Q.toString()+J;if(Y.includes("#")){let[G,V]=Y.split("#",2);return G+"#"+decodeURIComponent(V||"")}return Y}function o2(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function N8(Z){let X=C3.exec(Z||"");if(X)return X[1].toLowerCase();return}function j8(Z){let X=Z.lastIndexOf(".");if(X>=0)return E3(Z.substring(X).toLowerCase());return""}function E3(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function T2(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function a(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function _8(Z){let X=N8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function o0(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let W=new URL(X.startsWith("//")?"http:"+X:X);if(P8(W.hostname))return!0;let Q=W.port;if(Q&&y3(parseInt(Q)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(v3(X))return!0}return!1}function P8(Z){let X=S3(Z);if(!X)return!0;if(X==="localhost"||x3.some((J)=>X.endsWith(J)))return!0;let W=x8(X);if(W)return E8(W);let Q=k3(X);if(Q)return b3(Q);return!1}function S3(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function x8(Z){let X=Z.split(".");if(X.length!==4)return;let W=X.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(W.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return W}function E8([Z,X,W,Q]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&W===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&W===255&&Q===255}function k3(Z){if(!Z.includes(":"))return;let X=Z,W=X.lastIndexOf(":"),Q=X.slice(W+1);if(Q.includes(".")){let q=x8(Q);if(!q)return;let U=q[0]*256+q[1],H=q[2]*256+q[3];X=`${X.slice(0,W+1)}${U.toString(16)}:${H.toString(16)}`}let J=X.split("::");if(J.length>2)return;let Y=C8(J[0]),G=J.length===2?C8(J[1]):[];if(!Y||!G)return;if(J.length===1)return Y.length===8?Y:void 0;let V=8-Y.length-G.length;if(V<1)return;return[...Y,...Array(V).fill(0),...G]}function C8(Z){if(!Z)return[];let X=Z.split(":").map((W)=>{if(!/^[\da-f]{1,4}$/i.test(W))return Number.NaN;return Number.parseInt(W,16)});if(X.some((W)=>!Number.isInteger(W)||W<0||W>65535))return;return X}function b3(Z){if(Z.length!==8)return!1;let X=Z.every((V)=>V===0),W=Z.slice(0,7).every((V)=>V===0)&&Z[7]===1,Q=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,Y=(Z[0]&65280)===65280;if(X||W||Q||J||Y)return!0;let G=g3(Z);return G?E8(G):!1}function g3(Z){let X=Z.slice(0,5).every((J)=>J===0),W=X&&Z[5]===0,Q=X&&Z[5]===65535;if(!W&&!Q)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function v3(Z){return Z.split(/[\s/?#]+/).map((W)=>W.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((W)=>P8(W))}function y3(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function r0(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=N8(Z);return X===void 0||X==="file"}function S8(Z){if(I0()){let X=o2(),W=Z.toUpperCase(),J=b2(X).toUpperCase(),Y=W.includes(J),G=W.includes(J),V=_3.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(Y||G||V)&&!X.startsWith("http"))Z=((U,H)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+H;else return U+"/"+H})(X,Z);Z=b2(Z)}Z=encodeURI(Z);for(let X of P3)Z=Z.replace(X[0],X[1]);return Z}function q0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<_1.length;Q+=2)Z=Z.replace(_1[Q],_1[Q+1]);let W=Z.toLowerCase().startsWith("file://");if(W){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),I0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else W=!1,Z=I0()?Z:"/"+Z}if(I0()&&!W){if(Z=Z.replace(R3,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function s0(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(N3,"/").replace(j3,"~")})}var R3,C3,N3,j3,_3,P3,_1,x3,Y0=(Z)=>new URL(Z);var Y2=p(()=>{R8();R3=/\//g,C3=/^(\w{2,}):\/\//i,N3=/~1/g,j3=/~0/g,_3=/^[a-zA-Z]:[\\/]/,P3=[[/\?/g,"%3F"],[/#/g,"%23"]],_1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],x3=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function k8(){let Z={},X=this;for(let W of f3(X))if(typeof W==="string"){let Q=X[W],J=typeof Q;if(!h3.includes(J))Z[W]=Q}return Z}function f3(Z,X=[]){let W=[];while(Z&&Z!==u3)W=W.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(W);for(let J of X.concat(m3))Q.delete(J);return Q}function C2(Z){return Z instanceof V2||Z instanceof U0}function x1(Z){if(Z.path===null)Z.path=[];return Z}var h3,m3,u3,V2,U0,$2,a0,w2,t0,e0,P1,K0;var D2=p(()=>{Y2();h3=["function","symbol","undefined"],m3=["constructor","prototype","__proto__"],u3=Object.getPrototypeOf({});V2=class V2 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=k8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};U0=class U0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${q0(Z.$refs._root$Ref.path)}'`}toJSON=k8.bind(this);static getParserErrors(Z){let X=[];for(let W of Object.values(Z.$refs._$refs))if(W.errors)X.push(...W.errors);return X}get errors(){return U0.getParserErrors(this.files)}};$2=class $2 extends V2{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};a0=class a0 extends V2{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};w2=class w2 extends V2{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};t0=class t0 extends V2{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};e0=class e0 extends V2{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,W,Q,J){super(`Missing $ref pointer "${T2(X)}". Token "${Z}" does not exist.`,a(X));this.targetToken=Z,this.targetRef=W,this.targetFound=Q,this.parentPath=J}};P1=class P1 extends V2{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};K0=class K0 extends V2{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,a(X))}}});function z2(Z,X){let W=c3(X);return W?e(Z,W):Z}function Z1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let W=Z.openapi;return typeof W==="string"&&/^3\.1(?:\.|$)/.test(W)}function X1(Z,X,W,Q,J=!1){if(!J)return;let Y=new Set,G=(V,q)=>{if(!V||typeof V!=="object"||ArrayBuffer.isView(V)||Y.has(V))return;Y.add(V);let U=z2(q,V);if(U!==q)Z._addAlias(U,V,Q,J);for(let H of Object.keys(V))G(V[H],U)};G(W,X)}function c3(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var r2=p(()=>{Y2()});class s2{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,W){this.$ref=Z,this.path=X,this.originalPath=W||X,this.scopeBase=Z.path||a(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,W){let Q=s2.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!v8(this.$ref))this.scopeBase=z2(this.scopeBase,this.value);for(let G=0;G<Q.length;G++){let V=this.circular,q=s.isExtended$Ref(this.value);if(z1(this,X,W))this.path=s2.join(this.path,Q.slice(G));else if(!V&&this.circular&&q)this.circular=!1;let U=Q[G];if(this.value[U]===void 0||this.value[U]===null&&G===Q.length-1){let H=!1;for(let E=Q.length-1;E>G;E--){let C=Q.slice(G,E+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],G=E,H=!0;break}}if(H)continue;if(U in this.value&&this.value[U]===null){this.value=W1;continue}this.value=null;let F=this.$ref.path||"",B=this.path.replace(F,""),M=s2.join("",J),L=W?.replace(F,"");throw new e0(U,decodeURI(this.originalPath),B,M,L)}else this.value=this.value[U];if(J.push(U),this.$ref.dynamicIdScope)this.scopeBase=z2(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&e(Y,this.value.$ref)!==W)z1(this,X,W);return this}set(Z,X,W){let Q=s2.parse(this.path),J;if(Q.length===0)return this.value=X,X;if(o3(this.path,Q),this.value=g8(Z),this.$ref.dynamicIdScope&&!v8(this.$ref))this.scopeBase=z2(this.scopeBase,this.value);for(let Y=0;Y<Q.length-1;Y++){if(z1(this,W),J=Q[Y],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=b8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=z2(this.scopeBase,this.value)}return z1(this,W),J=Q[Q.length-1],b8(this,J,X),Z}static parse(Z,X){let W=T2(Z).substring(1);if(!W)return[];let Q=W.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(l3,"/").replace(i3,"~");if(Q[0]!=="")throw new K0(W,X===void 0?Z:X);return Q.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let W=0;W<X.length;W++){let Q=X[W];Z+="/"+Q.replace(d3,"~0").replace(p3,"~1")}return Z}}function z1(Z,X,W){if(s.isAllowed$Ref(Z.value,X)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=e(Q,Z.value.$ref);if(J===Z.path&&!r3(W))Z.circular=!0;else{let Y=Z.$ref.$refs._resolve(J,Z.path,X);if(Y===null)return!1;if(Z.indirections+=Y.indirections+1,s.isExtended$Ref(Z.value))return Z.value=s.dereference(Z.value,Y.value,X),!1;else Z.$ref=Y.$ref,Z.path=Y.path,Z.value=Y.value,Z.scopeBase=Z.$ref.path;return!0}}return}function b8(Z,X,W){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(W);else Z.value[X]=W;else throw new V2(`Error assigning $ref pointer "${Z.path}".
|
|
16
|
-
Cannot set "${X}" of a non-object.`);return W}function
|
|
17
|
-
Unsafe JSON Pointer token "${W}" cannot be used for assignment.`)}function
|
|
18
|
-
"${
|
|
19
|
-
"${
|
|
20
|
-
Parsed value is empty`);else return
|
|
16
|
+
`:""}var e0="https://esm.sh/@vue/reactivity@3.5.32",Z1="https://esm.sh/lit-html@3.3.0",d1;var e2=c(()=>{N0();_0();s0();i2();N0();_0();s0();i2();d1=new Set(["input","br","hr","img","meta","link","area","col","source"])});function h2(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var f6,R0=()=>f6;var H9=c(()=>{f6=/^win/.test(globalThis.process?globalThis.process.platform:"")});function e(Z,X){let W=new URL(h2(Z),"https://aaa.nonexistanturl.com"),Q=new URL(h2(X),W),G=X.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:U,search:K,hash:V}=Q;return U+K+decodeURIComponent(V)+G}let J=Q.toString()+G;if(J.includes("#")){let[U,K]=J.split("#",2);return U+"#"+decodeURIComponent(K||"")}return J}function Z0(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function B9(Z){let X=d6.exec(Z||"");if(X)return X[1].toLowerCase();return}function F9(Z){let X=Z.lastIndexOf(".");if(X>=0)return r6(Z.substring(X).toLowerCase());return""}function r6(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function R2(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function Z2(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function $9(Z){let X=B9(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function W1(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let W=new URL(X.startsWith("//")?"http:"+X:X);if(D9(W.hostname))return!0;let Q=W.port;if(Q&&XZ(parseInt(Q)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(ZZ(X))return!0}return!1}function D9(Z){let X=s6(Z);if(!X)return!0;if(X==="localhost"||o6.some((G)=>X.endsWith(G)))return!0;let W=L9(X);if(W)return A9(W);let Q=a6(X);if(Q)return t6(Q);return!1}function s6(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function L9(Z){let X=Z.split(".");if(X.length!==4)return;let W=X.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(W.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return W}function A9([Z,X,W,Q]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&W===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&W===255&&Q===255}function a6(Z){if(!Z.includes(":"))return;let X=Z,W=X.lastIndexOf(":"),Q=X.slice(W+1);if(Q.includes(".")){let V=L9(Q);if(!V)return;let Y=V[0]*256+V[1],q=V[2]*256+V[3];X=`${X.slice(0,W+1)}${Y.toString(16)}:${q.toString(16)}`}let G=X.split("::");if(G.length>2)return;let J=M9(G[0]),U=G.length===2?M9(G[1]):[];if(!J||!U)return;if(G.length===1)return J.length===8?J:void 0;let K=8-J.length-U.length;if(K<1)return;return[...J,...Array(K).fill(0),...U]}function M9(Z){if(!Z)return[];let X=Z.split(":").map((W)=>{if(!/^[\da-f]{1,4}$/i.test(W))return Number.NaN;return Number.parseInt(W,16)});if(X.some((W)=>!Number.isInteger(W)||W<0||W>65535))return;return X}function t6(Z){if(Z.length!==8)return!1;let X=Z.every((K)=>K===0),W=Z.slice(0,7).every((K)=>K===0)&&Z[7]===1,Q=(Z[0]&65024)===64512,G=(Z[0]&65472)===65152,J=(Z[0]&65280)===65280;if(X||W||Q||G||J)return!0;let U=e6(Z);return U?A9(U):!1}function e6(Z){let X=Z.slice(0,5).every((G)=>G===0),W=X&&Z[5]===0,Q=X&&Z[5]===65535;if(!W&&!Q)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function ZZ(Z){return Z.split(/[\s/?#]+/).map((W)=>W.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((W)=>D9(W))}function XZ(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function Q1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=B9(Z);return X===void 0||X==="file"}function w9(Z){if(R0()){let X=Z0(),W=Z.toUpperCase(),G=h2(X).toUpperCase(),J=W.includes(G),U=W.includes(G),K=i6.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(J||U||K)&&!X.startsWith("http"))Z=((Y,q)=>{if(Y.endsWith("/")||Y.endsWith("\\"))return Y+q;else return Y+"/"+q})(X,Z);Z=h2(Z)}Z=encodeURI(Z);for(let X of n6)Z=Z.replace(X[0],X[1]);return Z}function B0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<p1.length;Q+=2)Z=Z.replace(p1[Q],p1[Q+1]);let W=Z.toLowerCase().startsWith("file://");if(W){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),R0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else W=!1,Z=R0()?Z:"/"+Z}if(R0()&&!W){if(Z=Z.replace(c6,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function G1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(p6,"/").replace(l6,"~")})}var c6,d6,p6,l6,i6,n6,p1,o6,M0=(Z)=>new URL(Z);var V2=c(()=>{H9();c6=/\//g,d6=/^(\w{2,}):\/\//i,p6=/~1/g,l6=/~0/g,i6=/^[a-zA-Z]:[\\/]/,n6=[[/\?/g,"%3F"],[/#/g,"%23"]],p1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],o6=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function I9(){let Z={},X=this;for(let W of GZ(X))if(typeof W==="string"){let Q=X[W],G=typeof Q;if(!zZ.includes(G))Z[W]=Q}return Z}function GZ(Z,X=[]){let W=[];while(Z&&Z!==QZ)W=W.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(W);for(let G of X.concat(WZ))Q.delete(G);return Q}function E2(Z){return Z instanceof $2||Z instanceof F0}function i1(Z){if(Z.path===null)Z.path=[];return Z}var zZ,WZ,QZ,$2,F0,w2,J1,N2,U1,Y1,l1,$0;var I2=c(()=>{V2();zZ=["function","symbol","undefined"],WZ=["constructor","prototype","__proto__"],QZ=Object.getPrototypeOf({});$2=class $2 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=I9.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};F0=class F0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${B0(Z.$refs._root$Ref.path)}'`}toJSON=I9.bind(this);static getParserErrors(Z){let X=[];for(let W of Object.values(Z.$refs._$refs))if(W.errors)X.push(...W.errors);return X}get errors(){return F0.getParserErrors(this.files)}};w2=class w2 extends $2{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};J1=class J1 extends $2{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};N2=class N2 extends $2{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};U1=class U1 extends $2{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};Y1=class Y1 extends $2{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,W,Q,G){super(`Missing $ref pointer "${R2(X)}". Token "${Z}" does not exist.`,Z2(X));this.targetToken=Z,this.targetRef=W,this.targetFound=Q,this.parentPath=G}};l1=class l1 extends $2{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};$0=class $0 extends $2{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,Z2(X))}}});function U2(Z,X){let W=JZ(X);return W?e(Z,W):Z}function K1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let W=Z.openapi;return typeof W==="string"&&/^3\.1(?:\.|$)/.test(W)}function q1(Z,X,W,Q,G=!1){if(!G)return;let J=new Set,U=(K,V)=>{if(!K||typeof K!=="object"||ArrayBuffer.isView(K)||J.has(K))return;J.add(K);let Y=U2(V,K);if(Y!==V)Z._addAlias(Y,K,Q,G);for(let q of Object.keys(K))U(K[q],Y)};U(W,X)}function JZ(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var X0=c(()=>{V2()});class z0{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,W){this.$ref=Z,this.path=X,this.originalPath=W||X,this.scopeBase=Z.path||Z2(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,W,Q=new Set,G=!0){let J=z0.parse(this.path,this.originalPath),U=[];if(this.value=_9(Z),this.$ref.dynamicIdScope&&!T9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let V=0;V<J.length;V++){let Y=this.circular,q=this.chainCircular,M=a.isExtended$Ref(this.value);if(V1(this,X,W,Q))this.path=z0.join(this.path,J.slice(V));else if(M)this.circular=Y,this.chainCircular=q;let B=J[V];if(this.value[B]===void 0||this.value[B]===null&&V===J.length-1){let F=!1;for(let P=J.length-1;P>V;P--){let b=J.slice(V,P+1).join("/");if(this.value[b]!==void 0){this.value=this.value[b],V=P,F=!0;break}}if(F){this.chainCircular=q;continue}if(B in this.value&&this.value[B]===null){this.value=H1,this.chainCircular=q;continue}this.value=null;let L=this.$ref.path||"",C=this.path.replace(L,""),I=z0.join("",U),E=W?.replace(L,"");throw new Y1(B,decodeURI(this.originalPath),C,I,E)}else this.value=this.value[B];if(this.chainCircular=q,U.push(B),this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}let K=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(G){let V=this.value?.$ref?e(K,this.value.$ref):void 0,Y=typeof W==="string"?e(this.$ref.$refs._root$Ref.path,W):W;if(a.isAllowed$Ref(this.value,X)&&V===Y&&V!==this.path)this.chainCircular=!0;else if(!this.value||V)V1(this,X,W,Q)}return this}set(Z,X,W){let Q=z0.parse(this.path),G;if(Q.length===0)return this.value=X,X;if(HZ(this.path,Q),this.value=_9(Z),this.$ref.dynamicIdScope&&!T9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let J=0;J<Q.length-1;J++){if(V1(this,W),G=Q[J],this.value&&this.value[G]!==void 0)this.value=this.value[G];else this.value=O9(this,G,{});if(this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}return V1(this,W),G=Q[Q.length-1],O9(this,G,X),Z}static parse(Z,X){let W=R2(Z).substring(1);if(!W)return[];let Q=W.split("/");for(let G=0;G<Q.length;G++)Q[G]=Q[G].replace(KZ,"/").replace(qZ,"~");if(Q[0]!=="")throw new $0(W,X===void 0?Z:X);return Q.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let W=0;W<X.length;W++){let Q=X[W];Z+="/"+Q.replace(YZ,"~0").replace(UZ,"~1")}return Z}}function V1(Z,X,W,Q=new Set){let G=!1,J=W,U=[];try{while(a.isAllowed$Ref(Z.value,X)){let K=a.isExtended$Ref(Z.value),V=Z.value,Y=Z.path,q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,M=e(q,Z.value.$ref);if(M===Z.path&&!MZ(J))return Z.circular=!0,Z.chainCircular=!0,G;let B=typeof J==="string"?e(Z.$ref.$refs._root$Ref.path,J):J;if(M===B&&M!==Z.path)return Z.chainCircular=!0,G;if(Q.has(M))return Z.chainCircular=!0,G;let F=X?.dereference?.maxDepth??500;if(Q.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);Q.add(M),U.push(M);let L=Z.$ref.$refs._resolve(M,Y,X,Q,K);if(L===null)return G;if(Z.indirections+=L.indirections+1,Z.chainCircular||=L.circular||L.chainCircular,K){if(Z.chainCircular)return G;return Z.value=a.dereference(V,L.value,X),G}else Z.$ref=L.$ref,Z.path=L.path,Z.value=L.value,Z.scopeBase=L.scopeBase,J=Y,G=!0}return G}finally{for(let K of U)Q.delete(K)}}function O9(Z,X,W){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(W);else Z.value[X]=W;else throw new $2(`Error assigning $ref pointer "${Z.path}".
|
|
17
|
+
Cannot set "${X}" of a non-object.`);return W}function HZ(Z,X){for(let W of X)if(VZ.has(W))throw new $2(`Error assigning $ref pointer "${Z}".
|
|
18
|
+
Unsafe JSON Pointer token "${W}" cannot be used for assignment.`)}function _9(Z){if(E2(Z))throw Z;return Z}function MZ(Z){return typeof Z=="string"&&z0.parse(Z).length==0}function T9(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var H1,UZ,YZ,KZ,qZ,VZ,H2;var P0=c(()=>{D0();V2();I2();X0();H1=Symbol("null"),UZ=/\//g,YZ=/~/g,KZ=/~1/g,qZ=/~0/g,VZ=new Set(["__proto__","constructor","prototype"]);H2=z0});class E0{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let X=this.errors.map(({footprint:W})=>W);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(i1).filter(({footprint:W})=>!X.includes(W)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(i1(Z))}exists(Z,X){try{return this.resolve(Z,X),!0}catch{return!1}}get(Z,X){return this.resolve(Z,X)?.value}resolve(Z,X,W,Q,G,J=!0){let U=new H2(this,Z,W);try{let K=U.resolve(this.value,X,Q,G,J);if(K.value===H1)K.value=null;return K}catch(K){if(!X||!X.continueOnError||!E2(K))throw K;if(K.path===null)K.path=G1(R2(Q));if(K instanceof $0)K.source=decodeURI(Z2(Q));return this.addError(K),null}}set(Z,X){let W=new H2(this,Z);if(this.value=W.set(this.value,X),this.value===H1)this.value=null}static is$Ref(Z){return Boolean(Z)&&typeof Z==="object"&&Z!==null&&"$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref.length>0}static isExternal$Ref(Z){return E0.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,X){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!X||X.resolve?.external))return!0}return}static isExtended$Ref(Z){return E0.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,W){if(X&&typeof X==="object"&&E0.isExtended$Ref(Z)){let Q={};for(let J of Object.keys(Z))if(J!=="$ref")Q[J]=Z[J];let G=W?.dereference?.mergeKeys??!0;for(let J of Object.keys(X)){let U=J;if(!(U in Q))Q[U]=X[U];else if(G&&typeof Q[U]==="object"&&Q[U]!==null&&typeof X[U]==="object"&&X[U]!==null)Q[U]=N9(X[U],Q[U])}return Q}else return X}}function N9(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let W=Array.isArray(Z)?[...Z]:{...Z};for(let Q of Object.keys(X))if(Array.isArray(X[Q]))W[Q]=[...X[Q]];else if(typeof X[Q]==="object"&&X[Q]!==null)W[Q]=N9(Z[Q],X[Q]);else W[Q]=X[Q];return W}var a;var D0=c(()=>{P0();I2();V2();a=E0});class x0{circular;paths(...Z){return j9(this._$refs,Z.flat()).map((W)=>{return h2(W.decoded)})}values(...Z){let X=this._$refs;return j9(X,Z.flat()).reduce((Q,G)=>{return Q[h2(G.decoded)]=X[G.encoded].value,Q},{})}exists(Z,X){try{return this._resolve(Z,"",X),!0}catch{return!1}}get(Z,X){return this._resolve(Z,"",X).value}set(Z,X){let W=e(this._root$Ref.path,Z),Q=this._getRef(W);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
|
|
19
|
+
"${Z2(W)}" not found.`);Q.set(W,X)}_get$Ref(Z){return Z=e(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=Z2(Z),W=new a(this);return W.path=X,this._$refs[X]=W,this._root$Ref=this._root$Ref||W,W}_addAlias(Z,X,W,Q=!1){let G=Z2(Z);if(!G||this._$refs[G]||this._aliases[G])return this._$refs[G]||this._aliases[G];let J=new a(this);return J.path=G,J.pathType=W,J.value=X,J.dynamicIdScope=Q,this._aliases[G]=J,J}_resolve(Z,X,W,Q,G=!0){let J=e(this._root$Ref.path,Z),U=this._getRef(J);if(!U)throw Error(`Error resolving $ref pointer "${Z}".
|
|
20
|
+
"${Z2(J)}" not found.`);return U.resolve(J,W,Z,X,Q,G)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=Z2(Z);return this._$refs[X]||this._aliases[X]}}function j9(Z,X){let W=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])W=W.filter((Q)=>{return X.includes(Z[Q].pathType)});return W.map((Q)=>{return{encoded:Q,decoded:Z[Q].pathType==="file"?B0(Q,!0):Q}})}var C9=c(()=>{D0();V2()});function n1(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function o1(Z,X,W,Q,G){return Z.filter((J)=>{return!!R9(J,X,W,Q,G)})}function r1(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,W)=>{return X.order-W.order})}async function s1(Z,X,W,Q){let G,J,U=0;return new Promise((K,V)=>{Y();function Y(){if(G=Z[U++],!G)return V(J);try{let F=R9(G,X,W,q,Q);if(F&&typeof F.then==="function")F.then(M,B);else if(F!==void 0)M(F);else if(U===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(F){B(F)}}function q(F,L){if(F)B(F);else M(L)}function M(F){K({plugin:G,result:F})}function B(F){J={plugin:G,error:F},Y()}})}function R9(Z,X,W,Q,G){let J=Z[X];if(typeof J==="function")return J.apply(Z,[W,Q,G]);if(!Q){if(J instanceof RegExp)return J.test(W.url);else if(typeof J==="string")return J===W.extension;else if(Array.isArray(J))return J.indexOf(W.extension)!==-1}return J}async function BZ(Z,X,W){let Q=typeof Z==="string"?Z:Z.url,G=typeof Z==="string"?void 0:Z.baseUrl,J=typeof Z==="string"?void 0:Z.reference,U=Q.indexOf("#"),K="";if(U>=0)K=Q.substring(U),Q=Q.substring(0,U);if(J){let q=J.indexOf("#");if(q>=0)J=J.substring(0,q)}let V=X._add(Q),Y={url:Q,hash:K,extension:F9(Q),...J!==void 0?{reference:J}:{},...G!==void 0?{baseUrl:G}:{}};try{let q=await FZ(Y,W,X);V.pathType=q.plugin.name,Y.data=q.result;let M=await $Z(Y,W,X);return V.value=M.result,V.dynamicIdScope=K1(V.value),q1(X,V.path,V.value,V.pathType,V.dynamicIdScope),M.result}catch(q){if(E2(q))V.value=q;throw q}}async function FZ(Z,X,W){let Q=n1(X.resolve);Q=o1(Q,"canRead",Z,void 0,W),r1(Q);try{return await s1(Q,"read",Z,W)}catch(G){if(!G&&X.continueOnError)throw new U1(Z.url);else if(!G||!("error"in G))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:G});else if(G.error instanceof N2)throw G.error;else throw new N2(G,Z.url)}}async function $Z(Z,X,W){let Q=n1(X.parse),G=o1(Q,"canParse",Z),J=G.length>0?G:Q;r1(J);try{let U=await s1(J,"parse",Z,W);if(!U.plugin.allowEmpty&&DZ(U.result))throw SyntaxError(`Error parsing "${Z.url}" as ${U.plugin.name}.
|
|
21
|
+
Parsed value is empty`);else return U}catch(U){if(!U&&X.continueOnError)throw new J1(Z.url);else if(U&&U.message&&U.message.startsWith("Error parsing"))throw U;else if(!U||!("error"in U))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:U});else if(U.error instanceof w2)throw U.error;else throw new w2(U.error.message,Z.url)}}function DZ(Z){return Z===void 0||typeof Z==="object"&&Object.keys(Z).length===0||typeof Z==="string"&&Z.trim().length===0||Buffer.isBuffer(Z)&&Z.length===0}var M1;var a1=c(()=>{V2();X0();I2();M1=BZ});var P9;var E9=c(()=>{I2();P9={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")if(X.trim().length===0)return;else try{return JSON.parse(X)}catch(W){if(this.allowBOM)try{let Q=X.indexOf("{");return X=X.slice(Q),JSON.parse(X)}catch(Q){throw new w2(Q.message,Z.url)}throw new w2(W.message,Z.url)}else return X}}});function LZ(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function S0(){if(x9)return o2;x9=1;function Z(U){return typeof U>"u"||U===null}function X(U){return typeof U==="object"&&U!==null}function W(U){if(Array.isArray(U))return U;else if(Z(U))return[];return[U]}function Q(U,K){if(K){let V=Object.keys(K);for(let Y=0,q=V.length;Y<q;Y+=1){let M=V[Y];U[M]=K[M]}}return U}function G(U,K){let V="";for(let Y=0;Y<K;Y+=1)V+=U;return V}function J(U){return U===0&&Number.NEGATIVE_INFINITY===1/U}return o2.isNothing=Z,o2.isObject=X,o2.toArray=W,o2.repeat=G,o2.isNegativeZero=J,o2.extend=Q,o2}function k0(){if(S9)return t1;S9=1;function Z(W,Q){let G="",J=W.reason||"(unknown reason)";if(!W.mark)return J;if(W.mark.name)G+='in "'+W.mark.name+'" ';if(G+="("+(W.mark.line+1)+":"+(W.mark.column+1)+")",!Q&&W.mark.snippet)G+=`
|
|
21
22
|
|
|
22
|
-
`+
|
|
23
|
-
`+M}let
|
|
24
|
-
`,M+=
|
|
25
|
-
`;for(let
|
|
26
|
-
`}return M.replace(/\n$/,"")}
|
|
27
|
-
\r`;function
|
|
28
|
-
`;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
|
|
29
|
-
`,$-1)}function
|
|
30
|
-
`,A?1+D:D);else if(T===
|
|
31
|
-
`}break}if(
|
|
32
|
-
`,A?1+D:D);else if(j)j=!1,z.result+=
|
|
33
|
-
`,D+1);else if(D===0){if(A)z.result+=" "}else z.result+=
|
|
34
|
-
`,D);else z.result+=
|
|
35
|
-
`,A?1+D:D);A=!0,
|
|
36
|
-
`;if(z.charCodeAt(0)===65279)z=z.slice(1)}let
|
|
37
|
-
`,
|
|
38
|
-
`)
|
|
39
|
-
`+
|
|
40
|
-
|
|
41
|
-
`||
|
|
42
|
-
`)?"+":
|
|
43
|
-
`}function
|
|
44
|
-
`?
|
|
45
|
-
`);return k=k!==-1?k:
|
|
46
|
-
`||
|
|
47
|
-
`:"")+
|
|
48
|
-
`+
|
|
49
|
-
`,
|
|
50
|
-
`+
|
|
51
|
-
`;return""}
|
|
23
|
+
`+W.mark.snippet;return J+" "+G}function X(W,Q){if(Error.call(this),this.name="YAMLException",this.reason=W,this.mark=Q,this.message=Z(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X.prototype.toString=function(Q){return this.name+": "+Z(this,Q)},t1=X,t1}function AZ(){if(k9)return e1;k9=1;let Z=S0();function X(G,J,U,K,V){let Y="",q="",M=Math.floor(V/2)-1;if(K-J>M)Y=" ... ",J=K-M+Y.length;if(U-K>M)q=" ...",U=K+M-q.length;return{str:Y+G.slice(J,U).replace(/\t/g,"→")+q,pos:K-J+Y.length}}function W(G,J){return Z.repeat(" ",J-G.length)+G}function Q(G,J){if(J=Object.create(J||null),!G.buffer)return null;if(!J.maxLength)J.maxLength=79;if(typeof J.indent!=="number")J.indent=1;if(typeof J.linesBefore!=="number")J.linesBefore=3;if(typeof J.linesAfter!=="number")J.linesAfter=2;let U=/\r?\n|\r|\0/g,K=[0],V=[],Y,q=-1;while(Y=U.exec(G.buffer))if(V.push(Y.index),K.push(Y.index+Y[0].length),G.position<=Y.index&&q<0)q=K.length-2;if(q<0)q=K.length-1;let M="",B=Math.min(G.line+J.linesAfter,V.length).toString().length,F=J.maxLength-(J.indent+B+3);for(let C=1;C<=J.linesBefore;C++){if(q-C<0)break;let I=X(G.buffer,K[q-C],V[q-C],G.position-(K[q]-K[q-C]),F);M=Z.repeat(" ",J.indent)+W((G.line-C+1).toString(),B)+" | "+I.str+`
|
|
24
|
+
`+M}let L=X(G.buffer,K[q],V[q],G.position,F);M+=Z.repeat(" ",J.indent)+W((G.line+1).toString(),B)+" | "+L.str+`
|
|
25
|
+
`,M+=Z.repeat("-",J.indent+B+3+L.pos)+`^
|
|
26
|
+
`;for(let C=1;C<=J.linesAfter;C++){if(q+C>=V.length)break;let I=X(G.buffer,K[q+C],V[q+C],G.position-(K[q]-K[q+C]),F);M+=Z.repeat(" ",J.indent)+W((G.line+C+1).toString(),B)+" | "+I.str+`
|
|
27
|
+
`}return M.replace(/\n$/,"")}return e1=Q,e1}function Y2(){if(b9)return Z8;b9=1;let Z=k0(),X=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],W=["scalar","sequence","mapping"];function Q(J){let U={};if(J!==null)Object.keys(J).forEach(function(K){J[K].forEach(function(V){U[String(V)]=K})});return U}function G(J,U){if(U=U||{},Object.keys(U).forEach(function(K){if(X.indexOf(K)===-1)throw new Z('Unknown option "'+K+'" is met in definition of "'+J+'" YAML type.')}),this.options=U,this.tag=J,this.kind=U.kind||null,this.resolve=U.resolve||function(){return!0},this.construct=U.construct||function(K){return K},this.instanceOf=U.instanceOf||null,this.predicate=U.predicate||null,this.represent=U.represent||null,this.representName=U.representName||null,this.defaultStyle=U.defaultStyle||null,this.multi=U.multi||!1,this.styleAliases=Q(U.styleAliases||null),W.indexOf(this.kind)===-1)throw new Z('Unknown kind "'+this.kind+'" is specified for "'+J+'" YAML type.')}return Z8=G,Z8}function z4(){if(g9)return X8;g9=1;let Z=k0(),X=Y2();function W(J,U){let K=[];return J[U].forEach(function(V){let Y=K.length;K.forEach(function(q,M){if(q.tag===V.tag&&q.kind===V.kind&&q.multi===V.multi)Y=M}),K[Y]=V}),K}function Q(){let J={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function U(K){if(K.multi)J.multi[K.kind].push(K),J.multi.fallback.push(K);else J[K.kind][K.tag]=J.fallback[K.tag]=K}for(let K=0,V=arguments.length;K<V;K+=1)arguments[K].forEach(U);return J}function G(J){return this.extend(J)}return G.prototype.extend=function(U){let K=[],V=[];if(U instanceof X)V.push(U);else if(Array.isArray(U))V=V.concat(U);else if(U&&(Array.isArray(U.implicit)||Array.isArray(U.explicit))){if(U.implicit)K=K.concat(U.implicit);if(U.explicit)V=V.concat(U.explicit)}else throw new Z("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");K.forEach(function(q){if(!(q instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(q.loadKind&&q.loadKind!=="scalar")throw new Z("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(q.multi)throw new Z("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),V.forEach(function(q){if(!(q instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let Y=Object.create(G.prototype);return Y.implicit=(this.implicit||[]).concat(K),Y.explicit=(this.explicit||[]).concat(V),Y.compiledImplicit=W(Y,"implicit"),Y.compiledExplicit=W(Y,"explicit"),Y.compiledTypeMap=Q(Y.compiledImplicit,Y.compiledExplicit),Y},X8=G,X8}function W4(){if(v9)return z8;return v9=1,z8=new(Y2())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}}),z8}function Q4(){if(y9)return W8;return y9=1,W8=new(Y2())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}}),W8}function G4(){if(m9)return Q8;return m9=1,Q8=new(Y2())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}}),Q8}function J4(){if(h9)return G8;return h9=1,G8=new(z4())({explicit:[W4(),Q4(),G4()]}),G8}function U4(){if(u9)return J8;u9=1;let Z=Y2();function X(G){if(G===null)return!0;let J=G.length;return J===1&&G==="~"||J===4&&(G==="null"||G==="Null"||G==="NULL")}function W(){return null}function Q(G){return G===null}return J8=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:X,construct:W,predicate:Q,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),J8}function Y4(){if(f9)return U8;f9=1;let Z=Y2();function X(G){if(G===null)return!1;let J=G.length;return J===4&&(G==="true"||G==="True"||G==="TRUE")||J===5&&(G==="false"||G==="False"||G==="FALSE")}function W(G){return G==="true"||G==="True"||G==="TRUE"}function Q(G){return Object.prototype.toString.call(G)==="[object Boolean]"}return U8=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X,construct:W,predicate:Q,represent:{lowercase:function(G){return G?"true":"false"},uppercase:function(G){return G?"TRUE":"FALSE"},camelcase:function(G){return G?"True":"False"}},defaultStyle:"lowercase"}),U8}function K4(){if(c9)return Y8;c9=1;let Z=S0(),X=Y2();function W(Y){return Y>=48&&Y<=57||Y>=65&&Y<=70||Y>=97&&Y<=102}function Q(Y){return Y>=48&&Y<=55}function G(Y){return Y>=48&&Y<=57}function J(Y){if(Y===null)return!1;let q=Y.length,M=0,B=!1;if(!q)return!1;let F=Y[M];if(F==="-"||F==="+")F=Y[++M];if(F==="0"){if(M+1===q)return!0;if(F=Y[++M],F==="b"){M++;for(;M<q;M++){if(F=Y[M],F!=="0"&&F!=="1")return!1;B=!0}return B&&isFinite(U(Y))}if(F==="x"){M++;for(;M<q;M++){if(!W(Y.charCodeAt(M)))return!1;B=!0}return B&&isFinite(U(Y))}if(F==="o"){M++;for(;M<q;M++){if(!Q(Y.charCodeAt(M)))return!1;B=!0}return B&&isFinite(U(Y))}}for(;M<q;M++){if(!G(Y.charCodeAt(M)))return!1;B=!0}if(!B)return!1;return isFinite(U(Y))}function U(Y){let q=Y,M=1,B=q[0];if(B==="-"||B==="+"){if(B==="-")M=-1;q=q.slice(1),B=q[0]}if(q==="0")return 0;if(B==="0"){if(q[1]==="b")return M*parseInt(q.slice(2),2);if(q[1]==="x")return M*parseInt(q.slice(2),16);if(q[1]==="o")return M*parseInt(q.slice(2),8)}return M*parseInt(q,10)}function K(Y){return U(Y)}function V(Y){return Object.prototype.toString.call(Y)==="[object Number]"&&(Y%1===0&&!Z.isNegativeZero(Y))}return Y8=new X("tag:yaml.org,2002:int",{kind:"scalar",resolve:J,construct:K,predicate:V,represent:{binary:function(Y){return Y>=0?"0b"+Y.toString(2):"-0b"+Y.toString(2).slice(1)},octal:function(Y){return Y>=0?"0o"+Y.toString(8):"-0o"+Y.toString(8).slice(1)},decimal:function(Y){return Y.toString(10)},hexadecimal:function(Y){return Y>=0?"0x"+Y.toString(16).toUpperCase():"-0x"+Y.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Y8}function q4(){if(d9)return K8;d9=1;let Z=S0(),X=Y2(),W=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 G(Y){if(Y===null)return!1;if(!W.test(Y))return!1;if(isFinite(parseFloat(Y,10)))return!0;return Q.test(Y)}function J(Y){let q=Y.toLowerCase(),M=q[0]==="-"?-1:1;if("+-".indexOf(q[0])>=0)q=q.slice(1);if(q===".inf")return M===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(q===".nan")return NaN;return M*parseFloat(q,10)}let U=/^[-+]?[0-9]+e/;function K(Y,q){if(isNaN(Y))switch(q){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Y)switch(q){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Y)switch(q){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z.isNegativeZero(Y))return"-0.0";let M=Y.toString(10);return U.test(M)?M.replace("e",".e"):M}function V(Y){return Object.prototype.toString.call(Y)==="[object Number]"&&(Y%1!==0||Z.isNegativeZero(Y))}return K8=new X("tag:yaml.org,2002:float",{kind:"scalar",resolve:G,construct:J,predicate:V,represent:K,defaultStyle:"lowercase"}),K8}function V4(){if(p9)return q8;return p9=1,q8=J4().extend({implicit:[U4(),Y4(),K4(),q4()]}),q8}function H4(){if(l9)return V8;return l9=1,V8=V4(),V8}function M4(){if(i9)return H8;i9=1;let Z=Y2(),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),W=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(U){if(U===null)return!1;if(X.exec(U)!==null)return!0;if(W.exec(U)!==null)return!0;return!1}function G(U){let K=0,V=null,Y=X.exec(U);if(Y===null)Y=W.exec(U);if(Y===null)throw Error("Date resolve error");let q=+Y[1],M=+Y[2]-1,B=+Y[3];if(!Y[4])return new Date(Date.UTC(q,M,B));let F=+Y[4],L=+Y[5],C=+Y[6];if(Y[7]){K=Y[7].slice(0,3);while(K.length<3)K+="0";K=+K}if(Y[9]){let E=+Y[10],P=+(Y[11]||0);if(V=(E*60+P)*60000,Y[9]==="-")V=-V}let I=new Date(Date.UTC(q,M,B,F,L,C,K));if(V)I.setTime(I.getTime()-V);return I}function J(U){return U.toISOString()}return H8=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q,construct:G,instanceOf:Date,represent:J}),H8}function B4(){if(n9)return M8;n9=1;let Z=Y2();function X(W){return W==="<<"||W===null}return M8=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:X}),M8}function F4(){if(o9)return B8;o9=1;let Z=Y2(),X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
28
|
+
\r`;function W(U){if(U===null)return!1;let K=0,V=U.length,Y=X;for(let q=0;q<V;q++){let M=Y.indexOf(U.charAt(q));if(M>64)continue;if(M<0)return!1;K+=6}return K%8===0}function Q(U){let K=U.replace(/[\r\n=]/g,""),V=K.length,Y=X,q=0,M=[];for(let F=0;F<V;F++){if(F%4===0&&F)M.push(q>>16&255),M.push(q>>8&255),M.push(q&255);q=q<<6|Y.indexOf(K.charAt(F))}let B=V%4*6;if(B===0)M.push(q>>16&255),M.push(q>>8&255),M.push(q&255);else if(B===18)M.push(q>>10&255),M.push(q>>2&255);else if(B===12)M.push(q>>4&255);return new Uint8Array(M)}function G(U){let K="",V=0,Y=U.length,q=X;for(let B=0;B<Y;B++){if(B%3===0&&B)K+=q[V>>18&63],K+=q[V>>12&63],K+=q[V>>6&63],K+=q[V&63];V=(V<<8)+U[B]}let M=Y%3;if(M===0)K+=q[V>>18&63],K+=q[V>>12&63],K+=q[V>>6&63],K+=q[V&63];else if(M===2)K+=q[V>>10&63],K+=q[V>>4&63],K+=q[V<<2&63],K+=q[64];else if(M===1)K+=q[V>>2&63],K+=q[V<<4&63],K+=q[64],K+=q[64];return K}function J(U){return Object.prototype.toString.call(U)==="[object Uint8Array]"}return B8=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:W,construct:Q,predicate:J,represent:G}),B8}function $4(){if(r9)return F8;r9=1;let Z=Y2(),X=Object.prototype.hasOwnProperty,W=Object.prototype.toString;function Q(J){if(J===null)return!0;let U=[],K=J;for(let V=0,Y=K.length;V<Y;V+=1){let q=K[V],M=!1;if(W.call(q)!=="[object Object]")return!1;let B;for(B in q)if(X.call(q,B))if(!M)M=!0;else return!1;if(!M)return!1;if(U.indexOf(B)===-1)U.push(B);else return!1}return!0}function G(J){return J!==null?J:[]}return F8=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Q,construct:G}),F8}function D4(){if(s9)return $8;s9=1;let Z=Y2(),X=Object.prototype.toString;function W(G){if(G===null)return!0;let J=G,U=Array(J.length);for(let K=0,V=J.length;K<V;K+=1){let Y=J[K];if(X.call(Y)!=="[object Object]")return!1;let q=Object.keys(Y);if(q.length!==1)return!1;U[K]=[q[0],Y[q[0]]]}return!0}function Q(G){if(G===null)return[];let J=G,U=Array(J.length);for(let K=0,V=J.length;K<V;K+=1){let Y=J[K],q=Object.keys(Y);U[K]=[q[0],Y[q[0]]]}return U}return $8=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:W,construct:Q}),$8}function L4(){if(a9)return D8;a9=1;let Z=Y2(),X=Object.prototype.hasOwnProperty;function W(G){if(G===null)return!0;let J=G;for(let U in J)if(X.call(J,U)){if(J[U]!==null)return!1}return!0}function Q(G){return G!==null?G:{}}return D8=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:W,construct:Q}),D8}function w8(){if(t9)return L8;return t9=1,L8=H4().extend({implicit:[M4(),B4()],explicit:[F4(),$4(),D4(),L4()]}),L8}function wZ(){if(e9)return B1;e9=1;let Z=S0(),X=k0(),W=AZ(),Q=w8(),G=Object.prototype.hasOwnProperty,J=1,U=2,K=3,V=4,Y=1,q=2,M=3,B=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,F=/[\x85\u2028\u2029]/,L=/[,\[\]{}]/,C=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function E(z){return Object.prototype.toString.call(z)}function P(z){return z===10||z===13}function b(z){return z===9||z===32}function m(z){return z===9||z===32||z===10||z===13}function f(z){return z===44||z===91||z===93||z===123||z===125}function u(z){if(z>=48&&z<=57)return z-48;let $=z|32;if($>=97&&$<=102)return $-97+10;return-1}function g(z){if(z===120)return 2;if(z===117)return 4;if(z===85)return 8;return 0}function l(z){if(z>=48&&z<=57)return z-48;return-1}function X2(z){switch(z){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
29
|
+
`;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 O2(z){if(z<=65535)return String.fromCharCode(z);return String.fromCharCode((z-65536>>10)+55296,(z-65536&1023)+56320)}function s2(z,$,w){if($==="__proto__")Object.defineProperty(z,$,{configurable:!0,enumerable:!0,writable:!0,value:w});else z[$]=w}let v0=Array(256),L0=Array(256);for(let z=0;z<256;z++)v0[z]=X2(z)?1:0,L0[z]=X2(z);function W2(z,$){this.input=z,this.filename=$.filename||null,this.schema=$.schema||Q,this.onWarning=$.onWarning||null,this.legacy=$.legacy||!1,this.json=$.json||!1,this.listener=$.listener||null,this.maxDepth=typeof $.maxDepth==="number"?$.maxDepth:100,this.maxTotalMergeKeys=typeof $.maxTotalMergeKeys==="number"?$.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=z.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 y0(z,$){let w={name:z.filename,buffer:z.input.slice(0,-1),position:z.position,line:z.line,column:z.position-z.lineStart};return w.snippet=W(w),new X($,w)}function v(z,$){throw y0(z,$)}function Q0(z,$){if(z.onWarning)z.onWarning.call(null,y0(z,$))}function x2(z,$,w){let T=z.anchorMapTransactions;if(T.length!==0){let A=T[T.length-1];if(!G.call(A,$))A[$]={existed:G.call(z.anchorMap,$),value:z.anchorMap[$]}}z.anchorMap[$]=w}function T1(z){z.anchorMapTransactions.push(Object.create(null))}function a2(z){let $=z.anchorMapTransactions.pop(),w=z.anchorMapTransactions;if(w.length===0)return;let T=w[w.length-1],A=Object.keys($);for(let x=0,H=A.length;x<H;x+=1){let D=A[x];if(!G.call(T,D))T[D]=$[D]}}function N1(z){let $=z.anchorMapTransactions.pop(),w=Object.keys($);for(let T=w.length-1;T>=0;T-=1){let A=$[w[T]];if(A.existed)z.anchorMap[w[T]]=A.value;else delete z.anchorMap[w[T]]}}function A0(z){return{position:z.position,line:z.line,lineStart:z.lineStart,lineIndent:z.lineIndent,firstTabInLine:z.firstTabInLine,tag:z.tag,anchor:z.anchor,kind:z.kind,result:z.result}}function G0(z,$){z.position=$.position,z.line=$.line,z.lineStart=$.lineStart,z.lineIndent=$.lineIndent,z.firstTabInLine=$.firstTabInLine,z.tag=$.tag,z.anchor=$.anchor,z.kind=$.kind,z.result=$.result}let m0={YAML:function($,w,T){if($.version!==null)v($,"duplication of %YAML directive");if(T.length!==1)v($,"YAML directive accepts exactly one argument");let A=/^([0-9]+)\.([0-9]+)$/.exec(T[0]);if(A===null)v($,"ill-formed argument of the YAML directive");let x=parseInt(A[1],10),H=parseInt(A[2],10);if(x!==1)v($,"unacceptable YAML version of the document");if($.version=T[0],$.checkLineBreaks=H<2,H!==1&&H!==2)Q0($,"unsupported YAML version of the document")},TAG:function($,w,T){let A;if(T.length!==2)v($,"TAG directive accepts exactly two arguments");let x=T[0];if(A=T[1],!C.test(x))v($,"ill-formed tag handle (first argument) of the TAG directive");if(G.call($.tagMap,x))v($,'there is a previously declared suffix for "'+x+'" tag handle');if(!I.test(A))v($,"ill-formed tag prefix (second argument) of the TAG directive");try{A=decodeURIComponent(A)}catch(H){v($,"tag prefix is malformed: "+A)}$.tagMap[x]=A}};function M2(z,$,w,T){if($<w){let A=z.input.slice($,w);if(T)for(let x=0,H=A.length;x<H;x+=1){let D=A.charCodeAt(x);if(!(D===9||D>=32&&D<=1114111))v(z,"expected valid JSON character")}else if(B.test(A))v(z,"the stream contains non-printable characters");z.result+=A}}function c2(z,$,w,T){if(!Z.isObject(w))v(z,"cannot merge mappings; the provided source object is unacceptable");let A=Object.keys(w);for(let x=0,H=A.length;x<H;x+=1){let D=A[x];if(z.maxTotalMergeKeys!==-1&&++z.totalMergeKeys>z.maxTotalMergeKeys)v(z,"merge keys exceeded maxTotalMergeKeys ("+z.maxTotalMergeKeys+")");if(!G.call($,D))s2($,D,w[D]),T[D]=!0}}function S2(z,$,w,T,A,x,H,D,j){if(Array.isArray(A)){A=Array.prototype.slice.call(A);for(let O=0,_=A.length;O<_;O+=1){if(Array.isArray(A[O]))v(z,"nested arrays are not supported inside keys");if(typeof A==="object"&&E(A[O])==="[object Object]")A[O]="[object Object]"}}if(typeof A==="object"&&E(A)==="[object Object]")A="[object Object]";if(A=String(A),$===null)$={};if(T==="tag:yaml.org,2002:merge")if(Array.isArray(x))for(let O=0,_=x.length;O<_;O+=1)c2(z,$,x[O],w);else c2(z,$,x,w);else{if(!z.json&&!G.call(w,A)&&G.call($,A))z.line=H||z.line,z.lineStart=D||z.lineStart,z.position=j||z.position,v(z,"duplicated mapping key");s2($,A,x),delete w[A]}return $}function J0(z){let $=z.input.charCodeAt(z.position);if($===10)z.position++;else if($===13){if(z.position++,z.input.charCodeAt(z.position)===10)z.position++}else v(z,"a line break is expected");z.line+=1,z.lineStart=z.position,z.firstTabInLine=-1}function t(z,$,w){let T=0,A=z.input.charCodeAt(z.position);while(A!==0){while(b(A)){if(A===9&&z.firstTabInLine===-1)z.firstTabInLine=z.position;A=z.input.charCodeAt(++z.position)}if($&&A===35)do A=z.input.charCodeAt(++z.position);while(A!==10&&A!==13&&A!==0);if(P(A)){J0(z),A=z.input.charCodeAt(z.position),T++,z.lineIndent=0;while(A===32)z.lineIndent++,A=z.input.charCodeAt(++z.position)}else break}if(w!==-1&&T!==0&&z.lineIndent<w)Q0(z,"deficient indentation");return T}function U0(z){let $=z.position,w=z.input.charCodeAt($);if((w===45||w===46)&&w===z.input.charCodeAt($+1)&&w===z.input.charCodeAt($+2)){if($+=3,w=z.input.charCodeAt($),w===0||m(w))return!0}return!1}function k2(z,$){if($===1)z.result+=" ";else if($>1)z.result+=Z.repeat(`
|
|
30
|
+
`,$-1)}function h0(z,$,w){let T,A,x,H,D,j,O=z.kind,_=z.result,R=z.input.charCodeAt(z.position);if(m(R)||f(R)||R===35||R===38||R===42||R===33||R===124||R===62||R===39||R===34||R===37||R===64||R===96)return!1;if(R===63||R===45){let N=z.input.charCodeAt(z.position+1);if(m(N)||w&&f(N))return!1}z.kind="scalar",z.result="",T=A=z.position,x=!1;while(R!==0){if(R===58){let N=z.input.charCodeAt(z.position+1);if(m(N)||w&&f(N))break}else if(R===35){let N=z.input.charCodeAt(z.position-1);if(m(N))break}else if(z.position===z.lineStart&&U0(z)||w&&f(R))break;else if(P(R))if(H=z.line,D=z.lineStart,j=z.lineIndent,t(z,!1,-1),z.lineIndent>=$){x=!0,R=z.input.charCodeAt(z.position);continue}else{z.position=A,z.line=H,z.lineStart=D,z.lineIndent=j;break}if(x)M2(z,T,A,!1),k2(z,z.line-H),T=A=z.position,x=!1;if(!b(R))A=z.position+1;R=z.input.charCodeAt(++z.position)}if(M2(z,T,A,!1),z.result)return!0;return z.kind=O,z.result=_,!1}function u0(z,$){let w,T,A=z.input.charCodeAt(z.position);if(A!==39)return!1;z.kind="scalar",z.result="",z.position++,w=T=z.position;while((A=z.input.charCodeAt(z.position))!==0)if(A===39)if(M2(z,w,z.position,!0),A=z.input.charCodeAt(++z.position),A===39)w=z.position,z.position++,T=z.position;else return!0;else if(P(A))M2(z,w,T,!0),k2(z,t(z,!1,$)),w=T=z.position;else if(z.position===z.lineStart&&U0(z))v(z,"unexpected end of the document within a single quoted scalar");else if(z.position++,!b(A))T=z.position;v(z,"unexpected end of the stream within a single quoted scalar")}function w0(z,$){let w,T,A,x=z.input.charCodeAt(z.position);if(x!==34)return!1;z.kind="scalar",z.result="",z.position++,w=T=z.position;while((x=z.input.charCodeAt(z.position))!==0)if(x===34)return M2(z,w,z.position,!0),z.position++,!0;else if(x===92){if(M2(z,w,z.position,!0),x=z.input.charCodeAt(++z.position),P(x))t(z,!1,$);else if(x<256&&v0[x])z.result+=L0[x],z.position++;else if((A=g(x))>0){let H=A,D=0;for(;H>0;H--)if(x=z.input.charCodeAt(++z.position),(A=u(x))>=0)D=(D<<4)+A;else v(z,"expected hexadecimal character");z.result+=O2(D),z.position++}else v(z,"unknown escape sequence");w=T=z.position}else if(P(x))M2(z,w,T,!0),k2(z,t(z,!1,$)),w=T=z.position;else if(z.position===z.lineStart&&U0(z))v(z,"unexpected end of the document within a double quoted scalar");else if(z.position++,!b(x))T=z.position;v(z,"unexpected end of the stream within a double quoted scalar")}function f0(z,$){let w=!0,T,A,x,H=z.tag,D,j=z.anchor,O,_,R,N,k=Object.create(null),S,y,h,d=z.input.charCodeAt(z.position);if(d===91)O=93,N=!1,D=[];else if(d===123)O=125,N=!0,D={};else return!1;if(z.anchor!==null)x2(z,z.anchor,D);d=z.input.charCodeAt(++z.position);while(d!==0){if(t(z,!0,$),d=z.input.charCodeAt(z.position),d===O)return z.position++,z.tag=H,z.anchor=j,z.kind=N?"mapping":"sequence",z.result=D,!0;else if(!w)v(z,"missed comma between flow collection entries");else if(d===44)v(z,"expected the node content, but found ','");if(y=S=h=null,_=R=!1,d===63){let n=z.input.charCodeAt(z.position+1);if(m(n))_=R=!0,z.position++,t(z,!0,$)}if(T=z.line,A=z.lineStart,x=z.position,g2(z,$,J,!1,!0),y=z.tag,S=z.result,t(z,!0,$),d=z.input.charCodeAt(z.position),(R||z.line===T)&&d===58)_=!0,d=z.input.charCodeAt(++z.position),t(z,!0,$),g2(z,$,J,!1,!0),h=z.result;if(N)S2(z,D,k,y,S,h,T,A,x);else if(_)D.push(S2(z,null,k,y,S,h,T,A,x));else D.push(S);if(t(z,!0,$),d=z.input.charCodeAt(z.position),d===44)w=!0,d=z.input.charCodeAt(++z.position);else w=!1}v(z,"unexpected end of the stream within a flow collection")}function c0(z,$){let w,T=Y,A=!1,x=!1,H=$,D=0,j=!1,O,_=z.input.charCodeAt(z.position);if(_===124)w=!1;else if(_===62)w=!0;else return!1;z.kind="scalar",z.result="";while(_!==0)if(_=z.input.charCodeAt(++z.position),_===43||_===45)if(Y===T)T=_===43?M:q;else v(z,"repeat of a chomping mode identifier");else if((O=l(_))>=0)if(O===0)v(z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!x)H=$+O-1,x=!0;else v(z,"repeat of an indentation width identifier");else break;if(b(_)){do _=z.input.charCodeAt(++z.position);while(b(_));if(_===35)do _=z.input.charCodeAt(++z.position);while(!P(_)&&_!==0)}while(_!==0){J0(z),z.lineIndent=0,_=z.input.charCodeAt(z.position);while((!x||z.lineIndent<H)&&_===32)z.lineIndent++,_=z.input.charCodeAt(++z.position);if(!x&&z.lineIndent>H)H=z.lineIndent;if(P(_)){D++;continue}if(!x&&H===0)v(z,"missing indentation for block scalar");if(z.lineIndent<H){if(T===M)z.result+=Z.repeat(`
|
|
31
|
+
`,A?1+D:D);else if(T===Y){if(A)z.result+=`
|
|
32
|
+
`}break}if(w)if(b(_))j=!0,z.result+=Z.repeat(`
|
|
33
|
+
`,A?1+D:D);else if(j)j=!1,z.result+=Z.repeat(`
|
|
34
|
+
`,D+1);else if(D===0){if(A)z.result+=" "}else z.result+=Z.repeat(`
|
|
35
|
+
`,D);else z.result+=Z.repeat(`
|
|
36
|
+
`,A?1+D:D);A=!0,x=!0,D=0;let R=z.position;while(!P(_)&&_!==0)_=z.input.charCodeAt(++z.position);M2(z,R,z.position,!1)}return!0}function b2(z,$){let{tag:w,anchor:T}=z,A=[],x=!1;if(z.firstTabInLine!==-1)return!1;if(z.anchor!==null)x2(z,z.anchor,A);let H=z.input.charCodeAt(z.position);while(H!==0){if(z.firstTabInLine!==-1)z.position=z.firstTabInLine,v(z,"tab characters must not be used in indentation");if(H!==45)break;let D=z.input.charCodeAt(z.position+1);if(!m(D))break;if(x=!0,z.position++,t(z,!0,-1)){if(z.lineIndent<=$){A.push(null),H=z.input.charCodeAt(z.position);continue}}let j=z.line;if(g2(z,$,K,!1,!0),A.push(z.result),t(z,!0,-1),H=z.input.charCodeAt(z.position),(z.line===j||z.lineIndent>$)&&H!==0)v(z,"bad indentation of a sequence entry");else if(z.lineIndent<$)break}if(x)return z.tag=w,z.anchor=T,z.kind="sequence",z.result=A,!0;return!1}function d0(z,$,w){let T,A,x,H,D=z.tag,j=z.anchor,O={},_=Object.create(null),R=null,N=null,k=null,S=!1,y=!1;if(z.firstTabInLine!==-1)return!1;if(z.anchor!==null)x2(z,z.anchor,O);let h=z.input.charCodeAt(z.position);while(h!==0){if(!S&&z.firstTabInLine!==-1)z.position=z.firstTabInLine,v(z,"tab characters must not be used in indentation");let d=z.input.charCodeAt(z.position+1),n=z.line;if((h===63||h===58)&&m(d)){if(h===63){if(S)S2(z,O,_,R,N,null,A,x,H),R=N=k=null;y=!0,S=!0,T=!0}else if(S)S=!1,T=!0;else v(z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");z.position+=1,h=d}else{if(A=z.line,x=z.lineStart,H=z.position,!g2(z,w,U,!1,!0))break;if(z.line===n){h=z.input.charCodeAt(z.position);while(b(h))h=z.input.charCodeAt(++z.position);if(h===58){if(h=z.input.charCodeAt(++z.position),!m(h))v(z,"a whitespace character is expected after the key-value separator within a block mapping");if(S)S2(z,O,_,R,N,null,A,x,H),R=N=k=null;y=!0,S=!1,T=!1,R=z.tag,N=z.result}else if(y)v(z,"can not read an implicit mapping pair; a colon is missed");else return z.tag=D,z.anchor=j,!0}else if(y)v(z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return z.tag=D,z.anchor=j,!0}if(z.line===n||z.lineIndent>$){if(S)A=z.line,x=z.lineStart,H=z.position;if(g2(z,$,V,!0,T))if(S)N=z.result;else k=z.result;if(!S)S2(z,O,_,R,N,k,A,x,H),R=N=k=null;t(z,!0,-1),h=z.input.charCodeAt(z.position)}if((z.line===n||z.lineIndent>$)&&h!==0)v(z,"bad indentation of a mapping entry");else if(z.lineIndent<$)break}if(S)S2(z,O,_,R,N,null,A,x,H);if(y)z.tag=D,z.anchor=j,z.kind="mapping",z.result=O;return y}function j1(z){let $=!1,w=!1,T,A,x=z.input.charCodeAt(z.position);if(x!==33)return!1;if(z.tag!==null)v(z,"duplication of a tag property");if(x=z.input.charCodeAt(++z.position),x===60)$=!0,x=z.input.charCodeAt(++z.position);else if(x===33)w=!0,T="!!",x=z.input.charCodeAt(++z.position);else T="!";let H=z.position;if($){do x=z.input.charCodeAt(++z.position);while(x!==0&&x!==62);if(z.position<z.length)A=z.input.slice(H,z.position),x=z.input.charCodeAt(++z.position);else v(z,"unexpected end of the stream within a verbatim tag")}else{while(x!==0&&!m(x)){if(x===33)if(!w){if(T=z.input.slice(H-1,z.position+1),!C.test(T))v(z,"named tag handle cannot contain such characters");w=!0,H=z.position+1}else v(z,"tag suffix cannot contain exclamation marks");x=z.input.charCodeAt(++z.position)}if(A=z.input.slice(H,z.position),L.test(A))v(z,"tag suffix cannot contain flow indicator characters")}if(A&&!I.test(A))v(z,"tag name cannot contain such characters: "+A);try{A=decodeURIComponent(A)}catch(D){v(z,"tag name is malformed: "+A)}if($)z.tag=A;else if(G.call(z.tagMap,T))z.tag=z.tagMap[T]+A;else if(T==="!")z.tag="!"+A;else if(T==="!!")z.tag="tag:yaml.org,2002:"+A;else v(z,'undeclared tag handle "'+T+'"');return!0}function p0(z){let $=z.input.charCodeAt(z.position);if($!==38)return!1;if(z.anchor!==null)v(z,"duplication of an anchor property");$=z.input.charCodeAt(++z.position);let w=z.position;while($!==0&&!m($)&&!f($))$=z.input.charCodeAt(++z.position);if(z.position===w)v(z,"name of an anchor node must contain at least one character");return z.anchor=z.input.slice(w,z.position),!0}function l0(z){let $=z.input.charCodeAt(z.position);if($!==42)return!1;$=z.input.charCodeAt(++z.position);let w=z.position;while($!==0&&!m($)&&!f($))$=z.input.charCodeAt(++z.position);if(z.position===w)v(z,"name of an alias node must contain at least one character");let T=z.input.slice(w,z.position);if(!G.call(z.anchorMap,T))v(z,'unidentified alias "'+T+'"');return z.result=z.anchorMap[T],t(z,!0,-1),!0}function C1(z,$,w,T){let A=A0(z);if(T1(z),G0(z,$),z.tag=null,z.anchor=null,z.kind=null,z.result=null,d0(z,w,T)&&z.kind==="mapping")return a2(z),!0;return N1(z),G0(z,A),!1}function g2(z,$,w,T,A){let x,H,D=1,j=!1,O=!1,_=null,R,N,k;if(z.depth>=z.maxDepth)v(z,"nesting exceeded maxDepth ("+z.maxDepth+")");if(z.depth+=1,z.listener!==null)z.listener("open",z);z.tag=null,z.anchor=null,z.kind=null,z.result=null;let S=x=H=V===w||K===w;if(T){if(t(z,!0,-1)){if(j=!0,z.lineIndent>$)D=1;else if(z.lineIndent===$)D=0;else if(z.lineIndent<$)D=-1}}if(D===1)while(!0){let y=z.input.charCodeAt(z.position),h=A0(z);if(j&&(y===33&&z.tag!==null||y===38&&z.anchor!==null))break;if(!j1(z)&&!p0(z))break;if(_===null)_=h;if(t(z,!0,-1)){if(j=!0,H=S,z.lineIndent>$)D=1;else if(z.lineIndent===$)D=0;else if(z.lineIndent<$)D=-1}else H=!1}if(H)H=j||A;if(D===1||V===w){if(J===w||U===w)N=$;else N=$+1;if(k=z.position-z.lineStart,D===1)if(H&&(b2(z,k)||d0(z,k,N))||f0(z,N))O=!0;else{let y=z.input.charCodeAt(z.position);if(_!==null&&S&&!H&&y!==124&&y!==62&&C1(z,_,_.position-_.lineStart,N))O=!0;else if(x&&c0(z,N)||u0(z,N)||w0(z,N))O=!0;else if(l0(z)){if(O=!0,z.tag!==null||z.anchor!==null)v(z,"alias node should not have any properties")}else if(h0(z,N,J===w)){if(O=!0,z.tag===null)z.tag="?"}if(z.anchor!==null)x2(z,z.anchor,z.result)}else if(D===0)O=H&&b2(z,k)}if(z.tag===null){if(z.anchor!==null)x2(z,z.anchor,z.result)}else if(z.tag==="?"){if(z.result!==null&&z.kind!=="scalar")v(z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+z.kind+'"');for(let y=0,h=z.implicitTypes.length;y<h;y+=1)if(R=z.implicitTypes[y],R.resolve(z.result)){if(z.result=R.construct(z.result),z.tag=R.tag,z.anchor!==null)x2(z,z.anchor,z.result);break}}else if(z.tag!=="!"){if(G.call(z.typeMap[z.kind||"fallback"],z.tag))R=z.typeMap[z.kind||"fallback"][z.tag];else{R=null;let y=z.typeMap.multi[z.kind||"fallback"];for(let h=0,d=y.length;h<d;h+=1)if(z.tag.slice(0,y[h].tag.length)===y[h].tag){R=y[h];break}}if(!R)v(z,"unknown tag !<"+z.tag+">");if(z.result!==null&&R.kind!==z.kind)v(z,"unacceptable node kind for !<"+z.tag+'> tag; it should be "'+R.kind+'", not "'+z.kind+'"');if(!R.resolve(z.result,z.tag))v(z,"cannot resolve a node with !<"+z.tag+"> explicit tag");else if(z.result=R.construct(z.result,z.tag),z.anchor!==null)x2(z,z.anchor,z.result)}if(z.listener!==null)z.listener("close",z);return z.depth-=1,z.tag!==null||z.anchor!==null||O}function R1(z){let $=z.position,w=!1,T;z.version=null,z.checkLineBreaks=z.legacy,z.tagMap=Object.create(null),z.anchorMap=Object.create(null);while((T=z.input.charCodeAt(z.position))!==0){if(t(z,!0,-1),T=z.input.charCodeAt(z.position),z.lineIndent>0||T!==37)break;w=!0,T=z.input.charCodeAt(++z.position);let A=z.position;while(T!==0&&!m(T))T=z.input.charCodeAt(++z.position);let x=z.input.slice(A,z.position),H=[];if(x.length<1)v(z,"directive name must not be less than one character in length");while(T!==0){while(b(T))T=z.input.charCodeAt(++z.position);if(T===35){do T=z.input.charCodeAt(++z.position);while(T!==0&&!P(T));break}if(P(T))break;A=z.position;while(T!==0&&!m(T))T=z.input.charCodeAt(++z.position);H.push(z.input.slice(A,z.position))}if(T!==0)J0(z);if(G.call(m0,x))m0[x](z,x,H);else Q0(z,'unknown document directive "'+x+'"')}if(t(z,!0,-1),z.lineIndent===0&&z.input.charCodeAt(z.position)===45&&z.input.charCodeAt(z.position+1)===45&&z.input.charCodeAt(z.position+2)===45)z.position+=3,t(z,!0,-1);else if(w)v(z,"directives end mark is expected");if(g2(z,z.lineIndent-1,V,!1,!0),t(z,!0,-1),z.checkLineBreaks&&F.test(z.input.slice($,z.position)))Q0(z,"non-ASCII line breaks are interpreted as content");if(z.documents.push(z.result),z.position===z.lineStart&&U0(z)){if(z.input.charCodeAt(z.position)===46)z.position+=3,t(z,!0,-1);return}if(z.position<z.length-1)v(z,"end of the stream or a document separator is expected")}function i0(z,$){if(z=String(z),$=$||{},z.length!==0){if(z.charCodeAt(z.length-1)!==10&&z.charCodeAt(z.length-1)!==13)z+=`
|
|
37
|
+
`;if(z.charCodeAt(0)===65279)z=z.slice(1)}let w=new W2(z,$),T=z.indexOf("\x00");if(T!==-1)w.position=T,v(w,"null byte is not allowed in input");w.input+="\x00";while(w.input.charCodeAt(w.position)===32)w.lineIndent+=1,w.position+=1;while(w.position<w.length-1)R1(w);return w.documents}function n0(z,$,w){if($!==null&&typeof $==="object"&&typeof w>"u")w=$,$=null;let T=i0(z,w);if(typeof $!=="function")return T;for(let A=0,x=T.length;A<x;A+=1)$(T[A])}function P1(z,$){let w=i0(z,$);if(w.length===0)return;else if(w.length===1)return w[0];throw new X("expected a single document in the stream, but found more")}return B1.loadAll=n0,B1.load=P1,B1}function IZ(){if(Z4)return A8;Z4=1;let Z=S0(),X=k0(),W=w8(),Q=Object.prototype.toString,G=Object.prototype.hasOwnProperty,J=65279,U=9,K=10,V=13,Y=32,q=33,M=34,B=35,F=37,L=38,C=39,I=42,E=44,P=45,b=58,m=61,f=62,u=63,g=64,l=91,X2=93,O2=96,s2=123,v0=124,L0=125,W2={};W2[0]="\\0",W2[7]="\\a",W2[8]="\\b",W2[9]="\\t",W2[10]="\\n",W2[11]="\\v",W2[12]="\\f",W2[13]="\\r",W2[27]="\\e",W2[34]="\\\"",W2[92]="\\\\",W2[133]="\\N",W2[160]="\\_",W2[8232]="\\L",W2[8233]="\\P";let y0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],v=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Q0(H,D){if(D===null)return{};let j={},O=Object.keys(D);for(let _=0,R=O.length;_<R;_+=1){let N=O[_],k=String(D[N]);if(N.slice(0,2)==="!!")N="tag:yaml.org,2002:"+N.slice(2);let S=H.compiledTypeMap.fallback[N];if(S&&G.call(S.styleAliases,k))k=S.styleAliases[k];j[N]=k}return j}function x2(H){let D,j,O=H.toString(16).toUpperCase();if(H<=255)D="x",j=2;else if(H<=65535)D="u",j=4;else if(H<=4294967295)D="U",j=8;else throw new X("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+D+Z.repeat("0",j-O.length)+O}let T1=1,a2=2;function N1(H){this.schema=H.schema||W,this.indent=Math.max(1,H.indent||2),this.noArrayIndent=H.noArrayIndent||!1,this.skipInvalid=H.skipInvalid||!1,this.flowLevel=Z.isNothing(H.flowLevel)?-1:H.flowLevel,this.styleMap=Q0(this.schema,H.styles||null),this.sortKeys=H.sortKeys||!1,this.lineWidth=H.lineWidth||80,this.noRefs=H.noRefs||!1,this.noCompatMode=H.noCompatMode||!1,this.condenseFlow=H.condenseFlow||!1,this.quotingType=H.quotingType==='"'?a2:T1,this.forceQuotes=H.forceQuotes||!1,this.replacer=typeof H.replacer==="function"?H.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function A0(H,D){let j=Z.repeat(" ",D),O=0,_="",R=H.length;while(O<R){let N,k=H.indexOf(`
|
|
38
|
+
`,O);if(k===-1)N=H.slice(O),O=R;else N=H.slice(O,k+1),O=k+1;if(N.length&&N!==`
|
|
39
|
+
`)_+=j;_+=N}return _}function G0(H,D){return`
|
|
40
|
+
`+Z.repeat(" ",H.indent*D)}function m0(H,D){for(let j=0,O=H.implicitTypes.length;j<O;j+=1)if(H.implicitTypes[j].resolve(D))return!0;return!1}function M2(H){return H===Y||H===U}function c2(H){return H>=32&&H<=126||H>=161&&H<=55295&&H!==8232&&H!==8233||H>=57344&&H<=65533&&H!==J||H>=65536&&H<=1114111}function S2(H){return c2(H)&&H!==J&&H!==V&&H!==K}function J0(H,D,j){let O=S2(H),_=O&&!M2(H);return(j?O:O&&H!==E&&H!==l&&H!==X2&&H!==s2&&H!==L0)&&H!==B&&!(D===b&&!_)||S2(D)&&!M2(D)&&H===B||D===b&&_}function t(H){return c2(H)&&H!==J&&!M2(H)&&H!==P&&H!==u&&H!==b&&H!==E&&H!==l&&H!==X2&&H!==s2&&H!==L0&&H!==B&&H!==L&&H!==I&&H!==q&&H!==v0&&H!==m&&H!==f&&H!==C&&H!==M&&H!==F&&H!==g&&H!==O2}function U0(H){return!M2(H)&&H!==b}function k2(H,D){let j=H.charCodeAt(D),O;if(j>=55296&&j<=56319&&D+1<H.length){if(O=H.charCodeAt(D+1),O>=56320&&O<=57343)return(j-55296)*1024+O-56320+65536}return j}function h0(H){return/^\n* /.test(H)}let u0=1,w0=2,f0=3,c0=4,b2=5;function d0(H,D,j,O,_,R,N,k){let S,y=0,h=null,d=!1,n=!1,n8=O!==-1,I0=-1,O0=t(k2(H,0))&&U0(k2(H,H.length-1));if(D||N)for(S=0;S<H.length;y>=65536?S+=2:S++){if(y=k2(H,S),!c2(y))return b2;O0=O0&&J0(y,h,k),h=y}else{for(S=0;S<H.length;y>=65536?S+=2:S++){if(y=k2(H,S),y===K){if(d=!0,n8)n=n||S-I0-1>O&&H[I0+1]!==" ",I0=S}else if(!c2(y))return b2;O0=O0&&J0(y,h,k),h=y}n=n||n8&&(S-I0-1>O&&H[I0+1]!==" ")}if(!d&&!n){if(O0&&!N&&!_(H))return u0;return R===a2?b2:w0}if(j>9&&h0(H))return b2;if(!N)return n?c0:f0;return R===a2?b2:w0}function j1(H,D,j,O,_){H.dump=function(){if(D.length===0)return H.quotingType===a2?'""':"''";if(!H.noCompatMode){if(y0.indexOf(D)!==-1||v.test(D))return H.quotingType===a2?'"'+D+'"':"'"+D+"'"}let R=H.indent*Math.max(1,j),N=H.lineWidth===-1?-1:Math.max(Math.min(H.lineWidth,40),H.lineWidth-R),k=O||H.flowLevel>-1&&j>=H.flowLevel;function S(y){return m0(H,y)}switch(d0(D,k,H.indent,N,S,H.quotingType,H.forceQuotes&&!O,_)){case u0:return D;case w0:return"'"+D.replace(/'/g,"''")+"'";case f0:return"|"+p0(D,H.indent)+l0(A0(D,R));case c0:return">"+p0(D,H.indent)+l0(A0(C1(D,N),R));case b2:return'"'+R1(D)+'"';default:throw new X("impossible error: invalid scalar style")}}()}function p0(H,D){let j=h0(H)?String(D):"",O=H[H.length-1]===`
|
|
41
|
+
`,R=O&&(H[H.length-2]===`
|
|
42
|
+
`||H===`
|
|
43
|
+
`)?"+":O?"":"-";return j+R+`
|
|
44
|
+
`}function l0(H){return H[H.length-1]===`
|
|
45
|
+
`?H.slice(0,-1):H}function C1(H,D){let j=/(\n+)([^\n]*)/g,O=function(){let k=H.indexOf(`
|
|
46
|
+
`);return k=k!==-1?k:H.length,j.lastIndex=k,g2(H.slice(0,k),D)}(),_=H[0]===`
|
|
47
|
+
`||H[0]===" ",R,N;while(N=j.exec(H)){let k=N[1],S=N[2];R=S[0]===" ",O+=k+(!_&&!R&&S!==""?`
|
|
48
|
+
`:"")+g2(S,D),_=R}return O}function g2(H,D){if(H===""||H[0]===" ")return H;let j=/ [^ ]/g,O,_=0,R,N=0,k=0,S="";while(O=j.exec(H)){if(k=O.index,k-_>D)R=N>_?N:k,S+=`
|
|
49
|
+
`+H.slice(_,R),_=R+1;N=k}if(S+=`
|
|
50
|
+
`,H.length-_>D&&N>_)S+=H.slice(_,N)+`
|
|
51
|
+
`+H.slice(N+1);else S+=H.slice(_);return S.slice(1)}function R1(H){let D="",j=0;for(let O=0;O<H.length;j>=65536?O+=2:O++){j=k2(H,O);let _=W2[j];if(!_&&c2(j)){if(D+=H[O],j>=65536)D+=H[O+1]}else D+=_||x2(j)}return D}function i0(H,D,j){let O="",_=H.tag;for(let R=0,N=j.length;R<N;R+=1){let k=j[R];if(H.replacer)k=H.replacer.call(j,String(R),k);if(w(H,D,k,!1,!1)||typeof k>"u"&&w(H,D,null,!1,!1)){if(O!=="")O+=","+(!H.condenseFlow?" ":"");O+=H.dump}}H.tag=_,H.dump="["+O+"]"}function n0(H,D,j,O){let _="",R=H.tag;for(let N=0,k=j.length;N<k;N+=1){let S=j[N];if(H.replacer)S=H.replacer.call(j,String(N),S);if(w(H,D+1,S,!0,!0,!1,!0)||typeof S>"u"&&w(H,D+1,null,!0,!0,!1,!0)){if(!O||_!=="")_+=G0(H,D);if(H.dump&&K===H.dump.charCodeAt(0))_+="-";else _+="- ";_+=H.dump}}H.tag=R,H.dump=_||"[]"}function P1(H,D,j){let O="",_=H.tag,R=Object.keys(j);for(let N=0,k=R.length;N<k;N+=1){let S="";if(O!=="")S+=", ";if(H.condenseFlow)S+='"';let y=R[N],h=j[y];if(H.replacer)h=H.replacer.call(j,y,h);if(!w(H,D,y,!1,!1))continue;if(H.dump.length>1024)S+="? ";if(S+=H.dump+(H.condenseFlow?'"':"")+":"+(H.condenseFlow?"":" "),!w(H,D,h,!1,!1))continue;S+=H.dump,O+=S}H.tag=_,H.dump="{"+O+"}"}function z(H,D,j,O){let _="",R=H.tag,N=Object.keys(j);if(H.sortKeys===!0)N.sort();else if(typeof H.sortKeys==="function")N.sort(H.sortKeys);else if(H.sortKeys)throw new X("sortKeys must be a boolean or a function");for(let k=0,S=N.length;k<S;k+=1){let y="";if(!O||_!=="")y+=G0(H,D);let h=N[k],d=j[h];if(H.replacer)d=H.replacer.call(j,h,d);if(!w(H,D+1,h,!0,!0,!0))continue;let n=H.tag!==null&&H.tag!=="?"||H.dump&&H.dump.length>1024;if(n)if(H.dump&&K===H.dump.charCodeAt(0))y+="?";else y+="? ";if(y+=H.dump,n)y+=G0(H,D);if(!w(H,D+1,d,!0,n))continue;if(H.dump&&K===H.dump.charCodeAt(0))y+=":";else y+=": ";y+=H.dump,_+=y}H.tag=R,H.dump=_||"{}"}function $(H,D,j){let O=j?H.explicitTypes:H.implicitTypes;for(let _=0,R=O.length;_<R;_+=1){let N=O[_];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof D==="object"&&D instanceof N.instanceOf)&&(!N.predicate||N.predicate(D))){if(j)if(N.multi&&N.representName)H.tag=N.representName(D);else H.tag=N.tag;else H.tag="?";if(N.represent){let k=H.styleMap[N.tag]||N.defaultStyle,S;if(Q.call(N.represent)==="[object Function]")S=N.represent(D,k);else if(G.call(N.represent,k))S=N.represent[k](D,k);else throw new X("!<"+N.tag+'> tag resolver accepts not "'+k+'" style');H.dump=S}return!0}}return!1}function w(H,D,j,O,_,R,N){if(H.tag=null,H.dump=j,!$(H,j,!1))$(H,j,!0);let k=Q.call(H.dump),S=O;if(O)O=H.flowLevel<0||H.flowLevel>D;let y=k==="[object Object]"||k==="[object Array]",h,d;if(y)h=H.duplicates.indexOf(j),d=h!==-1;if(H.tag!==null&&H.tag!=="?"||d||H.indent!==2&&D>0)_=!1;if(d&&H.usedDuplicates[h])H.dump="*ref_"+h;else{if(y&&d&&!H.usedDuplicates[h])H.usedDuplicates[h]=!0;if(k==="[object Object]"){if(O&&Object.keys(H.dump).length!==0){if(z(H,D,H.dump,_),d)H.dump="&ref_"+h+H.dump}else if(P1(H,D,H.dump),d)H.dump="&ref_"+h+" "+H.dump}else if(k==="[object Array]"){if(O&&H.dump.length!==0){if(H.noArrayIndent&&!N&&D>0)n0(H,D-1,H.dump,_);else n0(H,D,H.dump,_);if(d)H.dump="&ref_"+h+H.dump}else if(i0(H,D,H.dump),d)H.dump="&ref_"+h+" "+H.dump}else if(k==="[object String]"){if(H.tag!=="?")j1(H,H.dump,D,R,S)}else if(k==="[object Undefined]")return!1;else{if(H.skipInvalid)return!1;throw new X("unacceptable kind of an object to dump "+k)}if(H.tag!==null&&H.tag!=="?"){let n=encodeURI(H.tag[0]==="!"?H.tag.slice(1):H.tag).replace(/!/g,"%21");if(H.tag[0]==="!")n="!"+n;else if(n.slice(0,18)==="tag:yaml.org,2002:")n="!!"+n.slice(18);else n="!<"+n+">";H.dump=n+" "+H.dump}}return!0}function T(H,D){let j=[],O=[];A(H,j,O);let _=O.length;for(let R=0;R<_;R+=1)D.duplicates.push(j[O[R]]);D.usedDuplicates=Array(_)}function A(H,D,j){if(H!==null&&typeof H==="object"){let O=D.indexOf(H);if(O!==-1){if(j.indexOf(O)===-1)j.push(O)}else if(D.push(H),Array.isArray(H))for(let _=0,R=H.length;_<R;_+=1)A(H[_],D,j);else{let _=Object.keys(H);for(let R=0,N=_.length;R<N;R+=1)A(H[_[R]],D,j)}}}function x(H,D){D=D||{};let j=new N1(D);if(!j.noRefs)T(H,j);let O=H;if(j.replacer)O=j.replacer.call({"":O},"",O);if(w(j,0,O,!0,!0))return j.dump+`
|
|
52
|
+
`;return""}return A8.dump=x,A8}function OZ(){if(X4)return Q2;X4=1;let Z=wZ(),X=IZ();function W(Q,G){return function(){throw Error("Function yaml."+Q+" is removed in js-yaml 4. Use yaml."+G+" instead, which is now safe by default.")}}return Q2.Type=Y2(),Q2.Schema=z4(),Q2.FAILSAFE_SCHEMA=J4(),Q2.JSON_SCHEMA=V4(),Q2.CORE_SCHEMA=H4(),Q2.DEFAULT_SCHEMA=w8(),Q2.load=Z.load,Q2.loadAll=Z.loadAll,Q2.dump=X.dump,Q2.YAMLException=k0(),Q2.types={binary:F4(),float:q4(),map:G4(),null:U4(),pairs:D4(),set:L4(),timestamp:M4(),bool:Y4(),int:K4(),merge:B4(),omap:$4(),seq:Q4(),str:W4()},Q2.safeLoad=W("safeLoad","load"),Q2.safeLoadAll=W("safeLoadAll","loadAll"),Q2.safeDump=W("safeDump","dump"),Q2}var Q2,B1,o2,x9,t1,S9,e1,k9,Z8,b9,X8,g9,z8,v9,W8,y9,Q8,m9,G8,h9,J8,u9,U8,f9,Y8,c9,K8,d9,q8,p9,V8,l9,H8,i9,M8,n9,B8,o9,F8,r9,$8,s9,D8,a9,L8,t9,e9,A8,Z4,X4,_Z,F1,K5,q5,V5,A4,H5,M5,B5,F5,$5,D5,L5,A5,w5,I5;var I8=c(()=>{Q2={},B1={},o2={};A8={};_Z=OZ(),F1=LZ(_Z),{Type:K5,Schema:q5,FAILSAFE_SCHEMA:V5,JSON_SCHEMA:A4,CORE_SCHEMA:H5,DEFAULT_SCHEMA:M5,load:B5,loadAll:F5,dump:$5,YAMLException:D5,types:L5,safeLoad:A5,safeLoadAll:w5,safeDump:I5}=F1});var w4;var I4=c(()=>{I2();I8();I8();w4={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")try{return F1.load(X,{schema:A4})}catch{try{return F1.load(X)}catch(W){throw new w2(W?.message||"Parser Error",Z.url)}}else return X}}});var TZ,O4;var _4=c(()=>{I2();TZ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,O4={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&TZ.test(Z.url)},parse(Z){if(typeof Z.data==="string")return Z.data;else if(Buffer.isBuffer(Z.data))return Z.data.toString(this.encoding);else throw new w2("data is not text",Z.url)}}});var NZ,T4;var N4=c(()=>{NZ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,T4={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&NZ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var O8;var _8=c(()=>{V2();I2();O8={order:100,canRead(Z){return Q1(Z.url)},async read(Z){let X,W=await import("fs");try{X=B0(Z.url)}catch(Q){let G=Q;throw G.message=`Malformed URI: ${Z.url}: ${G.message}`,new N2(G,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await W.promises.readFile(X)}catch(Q){let G=Q;throw G.message=`Error opening file ${X}: ${G.message}`,new N2(G,X)}}}});async function j4(Z,X,W){Z=M0(Z);let Q=W||[];Q.push(Z.href);try{if(X.safeUrlResolver&&W1(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let G=await jZ(Z,X);if(G.status>=400){let J=Error(`HTTP ERROR ${G.status}`);throw J.status=G.status,J}else if(G.status>=300)if(!Number.isNaN(X.redirects)&&Q.length>X.redirects){let J=Error(`Error downloading ${Q[0]}.
|
|
52
53
|
Too many redirects:
|
|
53
54
|
${Q.join(`
|
|
54
|
-
`)}`);throw Y.status=J.status,new w2(Y)}else{let Y=B4(J,"location");if(!Y){let V=Error(`HTTP ${J.status} redirect with no location header`);throw V.status=J.status,V}let G=e(Z.href,Y);return M9(G,X,Q)}else{if(J.body){let Y=await J.arrayBuffer();return Buffer.from(Y)}return Buffer.alloc(0)}}catch(J){let Y=J;throw Y.message=`Error downloading ${Z.href}: ${Y.message}`,new w2(Y,Z.href)}}async function F4(Z,X){let W,Q;if(X.timeout&&typeof AbortController<"u")W=new AbortController,Q=setTimeout(()=>W.abort(),X.timeout);let J=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:W?W.signal:null});if(Q)clearTimeout(Q);return J}function B4(Z,X){return Z.headers.get(X)}var f1;var c1=p(()=>{Y2();D2();f1={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return _8(Z.url)&&(!this.safeUrlResolver||!o0(Z.url))},read(Z){let X=Y0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=Y0(location.href).protocol;return M9(X,this)}}});function A9(Z,X){if($9(X)){let W=Object.keys(X).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<W.length;Q++){let J=W[Q],Y=X[J],G=Z[J];if($9(Y))Z[J]=A9(G||{},Y);else if(Y!==void 0)Z[J]=Y}}return Z}function $9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var D9=()=>{return{parse:{json:{...f8},yaml:{...U9},text:{...V9},binary:{...B9}},resolve:{file:{...m1},http:{...f1},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},L9=(Z)=>{let X=D9();if(Z)A9(X,Z);return X};var p1=p(()=>{c8();K9();F9();H9();u1();c1()});function H4(Z){let X,W,Q,J,Y=Array.prototype.slice.call(Z);if(typeof Y[Y.length-1]==="function")J=Y.pop();if(typeof Y[0]==="string")if(X=Y[0],typeof Y[2]==="object")W=Y[1],Q=Y[2];else W=void 0,Q=Y[1];else X="",W=Y[0],Q=Y[1];try{Q=L9(Q)}catch(G){console.error(`JSON Schema Ref Parser: Error normalizing options: ${G}`)}if(!Q.mutateInputSchema&&typeof W==="object")W=JSON.parse(JSON.stringify(W));return{path:X,schema:W,options:Q,callback:J}}var j0;var O9=p(()=>{p1();j0=H4});function M4(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let W=Z.$refs._root$Ref.dynamicIdScope?z2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=d1(Z.schema,Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(Q)}catch(W){return Promise.reject(W)}}function d1(Z,X,W,Q,J,Y,G,V){G||=new Set;let q=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!G.has(Z)){G.add(Z);let U=W;if(s.isExternal$Ref(Z))q.push($4(Z,X,U,Q,J,Y));let H=Object.keys(Z);for(let F of H){let B=q2.join(X,F),M=Z[F],L=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?z2(U,M):U;q=q.concat(d1(M,B,L,Q,J,Y,G,V))}}return q}async function $4(Z,X,W,Q,J,Y){let V=Y.dereference?.externalReferenceResolution==="root"?o2():Q?W:X,q=e(V,Z.$ref),U=a(q),H=J._get$Ref(U);if(H)return Promise.resolve(H.value);try{let F=Z.$ref,B={url:q,baseUrl:V};if(typeof F==="string")B.reference=F;let M=await Q1(B,J,Y),L=J._get$Ref(U),E=d1(M,U+"#",U,L?.dynamicIdScope??!1,J,Y,new Set,!0);return Promise.all(E)}catch(F){if(!Y?.continueOnError||!C2(F))throw F;if(J._$refs[U])F.source=decodeURI(a(X)),F.path=s0(T2(X));return[]}}var I9;var w9=p(()=>{V0();w0();g1();Y2();D2();r2();I9=M4});function D4(Z,X){let W=Z.$refs._root$Ref.dynamicIdScope?z2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];l1(Z,"schema",Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,"#",0,Q,Z.$refs,X);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(L4(Q,X,J),(X.bundle||{}).optimizeInternalRefs!==!1)I4(Q,Z.schema)}function l1(Z,X,W,Q,J,Y,G,V,q,U){let H=X===null?Z:Z[X],F=U.bundle||{},B=F.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!B(Y)){let M=Q;if(s.isAllowed$Ref(H))T9(Z,X,W,M,J,Y,G,V,q,U);else{let L=Object.keys(H).sort((E,C)=>{if(E==="definitions"||E==="$defs")return-1;else if(C==="definitions"||C==="$defs")return 1;else return E.length-C.length});for(let E of L){let C=q2.join(W,E),_=q2.join(Y,E),x=H[E],h=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?z2(M,x):M;if(s.isAllowed$Ref(x))T9(H,E,C,h,J,_,G,V,q,U);else l1(H,E,C,h,J,_,G,V,q,U);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)F?.onBundle?.(x.$ref,H[E],H,E)}}}}}function T9(Z,X,W,Q,J,Y,G,V,q,U){let H=X===null?Z:Z[X],F=e(J?Q:W,H.$ref),B=q._resolve(F,Y,U);if(B===null)return;let L=q2.parse(Y).length,E=a(B.path),C=T2(B.path),_=E!==q._root$Ref.path&&!q._aliases[E],x=Boolean(q._aliases[E])&&B.$ref.value!==q._root$Ref.value,h=s.isExtended$Ref(H);G+=B.indirections;let u=A4(V,Z,X);if(u)if(L<u.depth||G<u.indirections)O4(V,u);else return;if(V.push({$ref:H,parent:Z,key:X,pathFromRoot:Y,depth:L,file:E,hash:C,value:B.value,circular:B.circular,extended:h,external:_,nestedResource:x,indirections:G}),!u||_)l1(B.value,null,B.path,B.$ref.path,B.$ref.dynamicIdScope,Y,G+1,V,q,U)}function L4(Z,X,W){Z.sort((G,V)=>{if(G.file!==V.file)return G.file<V.file?-1:1;else if(G.hash!==V.hash)return G.hash<V.hash?-1:1;else if(G.circular!==V.circular)return G.circular?-1:1;else if(G.extended!==V.extended)return G.extended?1:-1;else if(G.indirections!==V.indirections)return G.indirections-V.indirections;else if(G.depth!==V.depth)return G.depth-V.depth;else{let q=Math.max(G.pathFromRoot.lastIndexOf("/definitions"),G.pathFromRoot.lastIndexOf("/$defs")),U=Math.max(V.pathFromRoot.lastIndexOf("/definitions"),V.pathFromRoot.lastIndexOf("/$defs"));if(q!==U)return U-q;else return G.pathFromRoot.length-V.pathFromRoot.length}});let Q,J,Y;for(let G of Z){let V=X.bundle||{};if(!G.external){if(V.optimizeInternalRefs!==!1&&!G.nestedResource)G.$ref.$ref=G.hash}else if(G.file===Q&&G.hash===J)if(W&&R9(Z,G))G.$ref.$ref=W+Y;else G.$ref.$ref=Y;else if(G.file===Q&&G.hash.indexOf(J+"/")===0){let q=q2.join(Y,q2.parse(G.hash.replace(J,"#")));if(W&&R9(Z,G))G.$ref.$ref=W+q;else G.$ref.$ref=q}else if(Q=G.file,J=G.hash,Y=G.pathFromRoot,G.$ref=G.parent[G.key]=s.dereference(G.$ref,G.value,X),G.circular)G.$ref.$ref=G.pathFromRoot}}function A4(Z,X,W){for(let Q of Z)if(Q&&Q.parent===X&&Q.key===W)return Q;return}function O4(Z,X){let W=Z.indexOf(X);Z.splice(W,1)}function I4(Z,X){for(let W of Z){if(!W.$ref||typeof W.$ref!=="object"||!("$ref"in W.$ref))continue;let Q=W.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=w4(X,Q);if(J!==Q)W.$ref.$ref=J}}function w4(Z,X){if(!X.startsWith("#/"))return X;let W=X.slice(2).split("/"),Q=Z,J=[];for(let G of W){if(Q===null||Q===void 0||typeof Q!=="object")return X;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let U=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...U),Q=T4(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return X}let V=G.replace(/~1/g,"/").replace(/~0/g,"~"),q=Array.isArray(Q)?parseInt(V):V;Q=Q[q],J.push(G)}return"#/"+J.join("/")}function T4(Z,X){if(!X.startsWith("#/"))return;let W=X.slice(2).split("/"),Q=Z;for(let J of W){if(Q===null||Q===void 0||typeof Q!=="object")return;let Y=J.replace(/~1/g,"/").replace(/~0/g,"~"),G=Array.isArray(Q)?parseInt(Y):Y;Q=Q[G]}return Q}function R9(Z,X){for(let W of Z){if(W.pathFromRoot==="#"||W.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(W.pathFromRoot+"/")){if(W.value&&typeof W.value==="object"&&"$id"in W.value)return!0}}return!1}var C9;var N9=p(()=>{V0();w0();Y2();r2();C9=D4});function R4(Z,X){let W=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?z2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=i1(Z.schema,Z.$refs._root$Ref.path,Q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,W,0);Z.$refs.circular=J.circular,Z.schema=J.value}function i1(Z,X,W,Q,J,Y,G,V,q,U,H,F){let B,M={value:Z,circular:!1};_9(H,U);let L=U.dereference||{},E=L.maxDepth??500;if(F>E)throw RangeError(`Maximum dereference depth (${E}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let C=L.excludedPathMatcher||(()=>!1);if(L?.circular==="ignore"||!G.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!C(J)){Y.add(Z),G.add(Z);let _=W;if(s.isAllowed$Ref(Z,U))B=j9(Z,X,_,Q,J,Y,G,V,q,U,H,F),M.circular=B.circular,M.value=B.value;else for(let x of Object.keys(Z)){_9(H,U);let h=q2.join(X,x),u=q2.join(J,x);if(C(u))continue;let f=Z[x],y=Q&&f&&typeof f==="object"&&!ArrayBuffer.isView(f)?z2(_,f):_,b;if(s.isAllowed$Ref(f,U)){if(B=j9(f,h,y,Q,u,Y,G,V,q,U,H,F),b=B.circular,Z[x]!==B.value){let l=new Map;if(L?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))L?.preservedProperties.forEach((B2)=>{if(B2 in Z[x])l.set(B2,Z[x][B2])})}let Q2=B.value;if(L?.cloneReferences&&!b&&Q2&&typeof Q2==="object")Q2=structuredClone(Q2);if(Z[x]=Q2,L?.preservedProperties){if(l.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))l.forEach((B2,d2)=>{Z[x][d2]=B2})}L?.onDereference?.(f.$ref,Z[x],Z,x)}}else if(!Y.has(f)){if(B=i1(f,h,y,Q,u,Y,G,V,q,U,H,F+1),b=B.circular,Z[x]!==B.value)Z[x]=B.value}else b=G1(h,q,U);M.circular=M.circular||b}Y.delete(Z)}}return M}function j9(Z,X,W,Q,J,Y,G,V,q,U,H,F){let L=s.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?o2():Q?W:X,E=e(L,Z.$ref),C=V.get(E);if(C){if(!C.circular){let y=Object.keys(Z);if(y.length>1){let b={};for(let l of y)if(l!=="$ref"&&!(l in C.value))b[l]=Z[l];return{circular:C.circular,value:Object.assign({},C.value,b)}}return C}if(typeof C.value==="object"&&"$ref"in C.value&&"$ref"in Z){if(C.value.$ref===Z.$ref)return G1(X,q,U),C}else return G1(X,q,U),C}let _=q._resolve(E,X,U);if(_===null)return{circular:!1,value:null};let x=_.circular,h=x||Y.has(_.value);if(h)G1(X,q,U);let u=s.dereference(Z,_.value,U);if(!h){let y=i1(u,_.path,_.$ref.path,_.$ref.dynamicIdScope,J,Y,G,V,q,U,H,F+1);h=y.circular,u=y.value}if(h&&!x&&U.dereference?.circular==="ignore")u=Z;if(x)u.$ref=J;let f={circular:h,value:u};if(Object.keys(Z).length===1)V.set(E,f);return f}function _9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new P1(X.timeoutMs)}}function G1(Z,X,W){if(X.circular=!0,W?.dereference?.onCircular?.(Z),!W.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var P9;var x9=p(()=>{V0();w0();Y2();r2();D2();P9=R4});function C4(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var n1;var E9=p(()=>{n1=C4()});function F2(Z,X){if(Z){X.then(function(W){n1(function(){Z(null,W)})},function(W){n1(function(){Z(W)})});return}else return X}var S9=p(()=>{E9()});class g2{schema=null;$refs=new R0;async parse(){let Z=j0(arguments),X;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return F2(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new R0;let W="http";if(r0(Z.path))Z.path=S8(Z.path),W="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=Y0(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=e(o2(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=W,Q.dynamicIdScope=Z1(Q.value),X1(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Q1(Z.path,this.$refs,Z.options);try{let Q=await X;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,F2(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,F2(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!Z.options.continueOnError||!C2(Q))return F2(Z.callback,Promise.reject(Q));if(this.$refs._$refs[a(Z.path)])this.$refs._$refs[a(Z.path)].addError(Q);return F2(Z.callback,Promise.resolve(null))}}static parse(){let Z=new g2;return Z.parse.apply(Z,arguments)}async resolve(){let Z=j0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await I9(this,Z.options),o1(this),F2(Z.callback,Promise.resolve(this.$refs))}catch(X){return F2(Z.callback,Promise.reject(X))}}static resolve(){let Z=new g2;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new g2;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=j0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),C9(this,Z.options),o1(this),F2(Z.callback,Promise.resolve(this.schema))}catch(X){return F2(Z.callback,Promise.reject(X))}}static dereference(){let Z=new g2;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=j0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),P9(this,Z.options),o1(this),F2(Z.callback,Promise.resolve(this.schema))}catch(X){return F2(Z.callback,Promise.reject(X))}}}function o1(Z){if(U0.getParserErrors(Z).length>0)throw new U0(Z)}var eZ,Z7,X7,k9;var b9=p(()=>{m8();g1();O9();w9();N9();x9();Y2();u1();c1();D2();S9();r2();p1();Y2();eZ=g2.parse,Z7=g2.resolve,X7=g2.bundle,k9=g2.dereference});async function r1(Z,X={}){let{baseUrl:W="/_jx/server"}=X,Q=await k9(Z),J=w8(Q);if(J.length===0)return null;let Y=J.map(({exportName:V,src:q})=>`import { ${V} } from '${q}'`).join(`
|
|
55
|
-
`),G
|
|
55
|
+
`)}`);throw J.status=G.status,new N2(J)}else{let J=CZ(G,"location");if(!J){let K=Error(`HTTP ${G.status} redirect with no location header`);throw K.status=G.status,K}let U=e(Z.href,J);return j4(U,X,Q)}else{if(G.body){let J=await G.arrayBuffer();return Buffer.from(J)}return Buffer.alloc(0)}}catch(G){let J=G;throw J.message=`Error downloading ${Z.href}: ${J.message}`,new N2(J,Z.href)}}async function jZ(Z,X){let W,Q;if(X.timeout&&typeof AbortController<"u")W=new AbortController,Q=setTimeout(()=>W.abort(),X.timeout);let G=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:W?W.signal:null});if(Q)clearTimeout(Q);return G}function CZ(Z,X){return Z.headers.get(X)}var T8;var N8=c(()=>{V2();I2();T8={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return $9(Z.url)&&(!this.safeUrlResolver||!W1(Z.url))},read(Z){let X=M0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=M0(location.href).protocol;return j4(X,this)}}});function E4(Z,X){if(C4(X)){let W=Object.keys(X).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<W.length;Q++){let G=W[Q],J=X[G],U=Z[G];if(C4(J))Z[G]=E4(U||{},J);else if(J!==void 0)Z[G]=J}}return Z}function C4(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var R4=()=>{return{parse:{json:{...P9},yaml:{...w4},text:{...O4},binary:{...T4}},resolve:{file:{...O8},http:{...T8},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},P4=(Z)=>{let X=R4();if(Z)E4(X,Z);return X};var j8=c(()=>{E9();I4();_4();N4();_8();N8()});function RZ(Z){let X,W,Q,G,J=Array.prototype.slice.call(Z);if(typeof J[J.length-1]==="function")G=J.pop();if(typeof J[0]==="string")if(X=J[0],typeof J[2]==="object")W=J[1],Q=J[2];else W=void 0,Q=J[1];else X="",W=J[0],Q=J[1];try{Q=P4(Q)}catch(U){console.error(`JSON Schema Ref Parser: Error normalizing options: ${U}`)}if(!Q.mutateInputSchema&&typeof W==="object")W=JSON.parse(JSON.stringify(W));return{path:X,schema:W,options:Q,callback:G}}var b0;var x4=c(()=>{j8();b0=RZ});function PZ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=C8(Z.schema,Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(Q)}catch(W){return Promise.reject(W)}}function C8(Z,X,W,Q,G,J,U,K){U||=new Set;let V=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!U.has(Z)){U.add(Z);let Y=W;if(a.isExternal$Ref(Z))V.push(EZ(Z,X,Y,Q,G,J));let q=Object.keys(Z);for(let M of q){let B=H2.join(X,M),F=Z[M],L=Q&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?U2(Y,F):Y;V=V.concat(C8(F,B,L,Q,G,J,U,K))}}return V}async function EZ(Z,X,W,Q,G,J){let K=J.dereference?.externalReferenceResolution==="root"?Z0():Q?W:X,V=e(K,Z.$ref),Y=Z2(V),q=G._get$Ref(Y);if(q)return Promise.resolve(q.value);try{let M=Z.$ref,B={url:V,baseUrl:K};if(typeof M==="string")B.reference=M;let F=await M1(B,G,J),L=G._get$Ref(Y),C=C8(F,Y+"#",Y,L?.dynamicIdScope??!1,G,J,new Set,!0);return Promise.all(C)}catch(M){if(!J?.continueOnError||!E2(M))throw M;if(G._$refs[Y])M.source=decodeURI(Z2(X)),M.path=G1(R2(X));return[]}}var S4;var k4=c(()=>{D0();P0();a1();V2();I2();X0();S4=PZ});function xZ(Z,X){let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];R8(Z,"schema",Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,"#",0,Q,Z.$refs,X);let G=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SZ(Q,X,G),(X.bundle||{}).optimizeInternalRefs!==!1)gZ(Q,Z.schema)}function R8(Z,X,W,Q,G,J,U,K,V,Y){let q=X===null?Z:Z[X],M=Y.bundle||{},B=M.excludedPathMatcher||(()=>!1);if(q&&typeof q==="object"&&!ArrayBuffer.isView(q)&&!B(J)){let F=Q;if(a.isAllowed$Ref(q))b4(Z,X,W,F,G,J,U,K,V,Y);else{let L=Object.keys(q).sort((C,I)=>{if(C==="definitions"||C==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return C.length-I.length});for(let C of L){let I=H2.join(W,C),E=H2.join(J,C),P=q[C],b=G&&P&&typeof P==="object"&&!ArrayBuffer.isView(P)?U2(F,P):F;if(a.isAllowed$Ref(P))b4(q,C,I,b,G,E,U,K,V,Y);else R8(q,C,I,b,G,E,U,K,V,Y);if(P&&typeof P==="object"&&!Array.isArray(P)){if("$ref"in P)M?.onBundle?.(P.$ref,q[C],q,C)}}}}}function b4(Z,X,W,Q,G,J,U,K,V,Y){let q=X===null?Z:Z[X],M=e(G?Q:W,q.$ref),B=V._resolve(M,J,Y);if(B===null)return;let L=H2.parse(J).length,C=Z2(B.path),I=R2(B.path),E=C!==V._root$Ref.path&&!V._aliases[C],P=Boolean(V._aliases[C])&&B.$ref.value!==V._root$Ref.value,b=a.isExtended$Ref(q);U+=B.indirections;let m=kZ(K,Z,X);if(m)if(L<m.depth||U<m.indirections)bZ(K,m);else return;if(K.push({$ref:q,parent:Z,key:X,pathFromRoot:J,depth:L,file:C,hash:I,value:B.value,circular:B.circular,extended:b,external:E,nestedResource:P,indirections:U}),!m||E)R8(B.value,null,B.path,B.$ref.path,B.$ref.dynamicIdScope,J,U+1,K,V,Y)}function SZ(Z,X,W){Z.sort((U,K)=>{if(U.file!==K.file)return U.file<K.file?-1:1;else if(U.hash!==K.hash)return U.hash<K.hash?-1:1;else if(U.circular!==K.circular)return U.circular?-1:1;else if(U.extended!==K.extended)return U.extended?1:-1;else if(U.indirections!==K.indirections)return U.indirections-K.indirections;else if(U.depth!==K.depth)return U.depth-K.depth;else{let V=Math.max(U.pathFromRoot.lastIndexOf("/definitions"),U.pathFromRoot.lastIndexOf("/$defs")),Y=Math.max(K.pathFromRoot.lastIndexOf("/definitions"),K.pathFromRoot.lastIndexOf("/$defs"));if(V!==Y)return Y-V;else return U.pathFromRoot.length-K.pathFromRoot.length}});let Q,G,J;for(let U of Z){let K=X.bundle||{};if(!U.external){if(K.optimizeInternalRefs!==!1&&!U.nestedResource)U.$ref.$ref=U.hash}else if(U.file===Q&&U.hash===G)if(W&&g4(Z,U))U.$ref.$ref=W+J;else U.$ref.$ref=J;else if(U.file===Q&&U.hash.indexOf(G+"/")===0){let V=H2.join(J,H2.parse(U.hash.replace(G,"#")));if(W&&g4(Z,U))U.$ref.$ref=W+V;else U.$ref.$ref=V}else if(Q=U.file,G=U.hash,J=U.pathFromRoot,U.$ref=U.parent[U.key]=a.dereference(U.$ref,U.value,X),U.circular)U.$ref.$ref=U.pathFromRoot}}function kZ(Z,X,W){for(let Q of Z)if(Q&&Q.parent===X&&Q.key===W)return Q;return}function bZ(Z,X){let W=Z.indexOf(X);Z.splice(W,1)}function gZ(Z,X){for(let W of Z){if(!W.$ref||typeof W.$ref!=="object"||!("$ref"in W.$ref))continue;let Q=W.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let G=vZ(X,Q);if(G!==Q)W.$ref.$ref=G}}function vZ(Z,X){if(!X.startsWith("#/"))return X;let W=X.slice(2).split("/"),Q=Z,G=[];for(let U of W){if(Q===null||Q===void 0||typeof Q!=="object")return X;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let Y=Q.$ref.slice(2).split("/");if(G.length=0,G.push(...Y),Q=yZ(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return X}let K=U.replace(/~1/g,"/").replace(/~0/g,"~"),V=Array.isArray(Q)?parseInt(K):K;Q=Q[V],G.push(U)}return"#/"+G.join("/")}function yZ(Z,X){if(!X.startsWith("#/"))return;let W=X.slice(2).split("/"),Q=Z;for(let G of W){if(Q===null||Q===void 0||typeof Q!=="object")return;let J=G.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(Q)?parseInt(J):J;Q=Q[U]}return Q}function g4(Z,X){for(let W of Z){if(W.pathFromRoot==="#"||W.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(W.pathFromRoot+"/")){if(W.value&&typeof W.value==="object"&&"$id"in W.value)return!0}}return!1}var v4;var y4=c(()=>{D0();P0();V2();X0();v4=xZ});function mZ(Z,X){let W=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,G=P8(Z.schema,Z.$refs._root$Ref.path,Q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,W,0);Z.$refs.circular=G.circular,Z.schema=G.value}function P8(Z,X,W,Q,G,J,U,K,V,Y,q,M){let B,F={value:Z,circular:!1};h4(q,Y);let L=Y.dereference||{},C=L.maxDepth??500;if(M>C)throw RangeError(`Maximum dereference depth (${C}) exceeded at ${G}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=L.excludedPathMatcher||(()=>!1);if(L?.circular==="ignore"||!U.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!I(G)){J.add(Z),U.add(Z);let E=W;if(a.isAllowed$Ref(Z,Y))B=m4(Z,X,E,Q,G,J,U,K,V,Y,q,M),F.circular=B.circular,F.value=B.value;else for(let P of Object.keys(Z)){h4(q,Y);let b=H2.join(X,P),m=H2.join(G,P);if(I(m))continue;let f=Z[P],u=Q&&f&&typeof f==="object"&&!ArrayBuffer.isView(f)?U2(E,f):E,g;if(a.isAllowed$Ref(f,Y)){if(B=m4(f,b,u,Q,m,J,U,K,V,Y,q,M),g=B.circular,Z[P]!==B.value){let l=new Map;if(L?.preservedProperties){if(typeof Z[P]==="object"&&!Array.isArray(Z[P]))L?.preservedProperties.forEach((O2)=>{if(O2 in Z[P])l.set(O2,Z[P][O2])})}let X2=B.value;if(L?.cloneReferences&&!g&&X2&&typeof X2==="object")X2=structuredClone(X2);if(Z[P]=X2,L?.preservedProperties){if(l.size&&typeof Z[P]==="object"&&!Array.isArray(Z[P]))l.forEach((O2,s2)=>{Z[P][s2]=O2})}L?.onDereference?.(f.$ref,Z[P],Z,P)}}else if(!J.has(f)){if(B=P8(f,b,u,Q,m,J,U,K,V,Y,q,M+1),g=B.circular,Z[P]!==B.value)Z[P]=B.value}else g=$1(b,V,Y);F.circular=F.circular||g}J.delete(Z)}}return F}function m4(Z,X,W,Q,G,J,U,K,V,Y,q,M){let L=a.isExternal$Ref(Z)&&Y?.dereference?.externalReferenceResolution==="root"?Z0():Q?W:X,C=e(L,Z.$ref),I=K.get(C);if(I){if(!I.circular){let u=Object.keys(Z);if(u.length>1){let g={};for(let l of u)if(l!=="$ref"&&!(l in I.value))g[l]=Z[l];return{circular:I.circular,value:Object.assign({},I.value,g)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in Z){if(I.value.$ref===Z.$ref)return $1(X,V,Y),I}else return $1(X,V,Y),I}let E=V._resolve(C,X,Y);if(E===null)return{circular:!1,value:null};let P=E.circular,b=P||E.chainCircular||J.has(E.value);if(b)$1(X,V,Y);let m=a.dereference(Z,E.value,Y);if(!b){let u=P8(m,E.path,E.$ref.path,E.$ref.dynamicIdScope,G,J,U,K,V,Y,q,M+1);b=u.circular,m=u.value}if(b&&!P&&Y.dereference?.circular==="ignore")m=Z;if(P&&m!==Z)m.$ref=G;let f={circular:b,value:m};if(Object.keys(Z).length===1)K.set(C,f);return f}function h4(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new l1(X.timeoutMs)}}function $1(Z,X,W){if(X.circular=!0,W?.dereference?.onCircular?.(Z),!W.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var u4;var f4=c(()=>{D0();P0();V2();X0();I2();u4=mZ});function hZ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var E8;var c4=c(()=>{E8=hZ()});function D2(Z,X){if(Z){X.then(function(W){E8(function(){Z(null,W)})},function(W){E8(function(){Z(W)})});return}else return X}var d4=c(()=>{c4()});class u2{schema=null;$refs=new x0;async parse(){let Z=b0(arguments),X;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return D2(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new x0;let W="http";if(Q1(Z.path))Z.path=w9(Z.path),W="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=M0(Z.schema.$id),G=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${G}`}if(Z.path=e(Z0(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=W,Q.dynamicIdScope=K1(Q.value),q1(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=M1(Z.path,this.$refs,Z.options);try{let Q=await X;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,D2(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,D2(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!Z.options.continueOnError||!E2(Q))return D2(Z.callback,Promise.reject(Q));if(this.$refs._$refs[Z2(Z.path)])this.$refs._$refs[Z2(Z.path)].addError(Q);return D2(Z.callback,Promise.resolve(null))}}static parse(){let Z=new u2;return Z.parse.apply(Z,arguments)}async resolve(){let Z=b0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await S4(this,Z.options),x8(this),D2(Z.callback,Promise.resolve(this.$refs))}catch(X){return D2(Z.callback,Promise.reject(X))}}static resolve(){let Z=new u2;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new u2;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=b0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),v4(this,Z.options),x8(this),D2(Z.callback,Promise.resolve(this.schema))}catch(X){return D2(Z.callback,Promise.reject(X))}}static dereference(){let Z=new u2;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=b0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),u4(this,Z.options),x8(this),D2(Z.callback,Promise.resolve(this.schema))}catch(X){return D2(Z.callback,Promise.reject(X))}}}function x8(Z){if(F0.getParserErrors(Z).length>0)throw new F0(Z)}var wX,IX,OX,p4;var l4=c(()=>{C9();a1();x4();k4();y4();f4();V2();_8();N8();I2();d4();X0();j8();V2();wX=u2.parse,IX=u2.resolve,OX=u2.bundle,p4=u2.dereference});async function S8(Z,X={}){let{baseUrl:W="/_jx/server"}=X,Q=await p4(Z),G=q9(Q);if(G.length===0)return null;let J=G.map(({exportName:K,src:V})=>`import { ${K} } from '${V}'`).join(`
|
|
56
|
+
`),U=G.map(({exportName:K})=>i4(K,W)).join(`
|
|
56
57
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
57
58
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
58
59
|
// Requires: npm install hono
|
|
59
60
|
|
|
60
61
|
import { Hono } from 'hono'
|
|
61
|
-
${
|
|
62
|
+
${J}
|
|
62
63
|
|
|
63
64
|
const app = new Hono()
|
|
64
|
-
${
|
|
65
|
+
${U}
|
|
65
66
|
|
|
66
67
|
export default app
|
|
67
|
-
`}function
|
|
68
|
-
`),
|
|
69
|
-
`)
|
|
68
|
+
`}function uZ(Z,X={}){let{baseUrl:W="/_jx/server",adapter:Q=null,mounts:G=[],connectors:J=[]}=X;if(Z.length===0&&G.length===0&&!Q)return null;let U=Z.map(({exportName:q,src:M})=>`import { ${q} } from '${M}'`).join(`
|
|
69
|
+
`),K=fZ(G,J),V=Z.map(({exportName:q})=>i4(q,W)).join(`
|
|
70
|
+
`),Y=Q==="cloudflare-workers"||Q==="cloudflare-pages"?`
|
|
71
|
+
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
72
|
+
`:`
|
|
73
|
+
`;return`// Generated by @jxsuite/compiler — do not edit manually
|
|
70
74
|
import { Hono } from 'hono'
|
|
71
|
-
${
|
|
75
|
+
${U}${K.imports}
|
|
72
76
|
|
|
73
77
|
const app = new Hono()
|
|
78
|
+
${K.routes}${V}
|
|
74
79
|
${Y}
|
|
75
|
-
${Q==="cloudflare-workers"||Q==="cloudflare-pages"?`
|
|
76
|
-
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
77
|
-
`:`
|
|
78
|
-
`}
|
|
79
80
|
export default app
|
|
80
|
-
`}function
|
|
81
|
+
`}function fZ(Z,X){if(Z.length===0)return{imports:"",routes:""};let W=Z.toSorted((J,U)=>J.order-U.order),Q=[];for(let J of W)Q.push(`import { ${J.className} } from '${J.module}'`);for(let J of X)Q.push(`import { ${J.className} } from '${J.module}'`);let G=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${X.map((J)=>`${JSON.stringify(J.provider)}: ${J.className}`).join(", ")} }`];for(let[J,U]of W.entries()){let K=JSON.stringify(U.options);G.push(`const jxMount${J} = await ${U.className}.mount({ ...${K}, connectors: jxConnectors }, jxCtx)`,`app.all('${U.basePath}/*', (c) => jxMount${J}(c.req.raw, c.env))`,`app.all('${U.basePath}', (c) => jxMount${J}(c.req.raw, c.env))`)}return{imports:`
|
|
82
|
+
${Q.join(`
|
|
83
|
+
`)}`,routes:`${G.join(`
|
|
84
|
+
`)}
|
|
85
|
+
`}}function i4(Z,X){return`
|
|
81
86
|
app.post('${X}/${Z}', async (c) => {
|
|
82
87
|
const args = await c.req.json().catch(() => ({}))
|
|
83
88
|
try {
|
|
@@ -85,120 +90,122 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
85
90
|
} catch (e) {
|
|
86
91
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
87
92
|
}
|
|
88
|
-
})`}var
|
|
93
|
+
})`}var k8=c(()=>{l4();e2()});function cZ(Z){return Z instanceof Error?Z.message:String(Z)}function b8(Z,X,W){let Q;try{Q=JSON.parse(Z)}catch(G){throw Error(`Failed to parse ${W} at ${X}: ${cZ(G)}`,{cause:G})}if(!F2(Q))throw Error(`Invalid ${W} at ${X}: expected a JSON object`);return Q}function D1(Z,X){return b8(Z,X,"Jx document")}function RX(Z,X){return b8(Z,X,"project config")}function PX(Z,X){return b8(Z,X,"class definition")}var g8=c(()=>{i2()});class L1{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#X=null;constructor(Z,X,W,Q){this.name=Z,this.classPath=X,this.classDef=W,this.#Z=Q;let{format:G}=W;this.extensions=(G?.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=G?.mediaType??null,this.documentKinds=G?.documentKinds??[],this.exportTarget=G?.exportTarget===!0,this.remote=G?.remote===!0,this.studio=W.$studio??null,this.project=W.project??null,this.server=W.server??null,this.connector=W.connector??null,this.capabilities=pZ(W)}implementation(){if(!this.#X){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#X=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#X}async call(Z,...X){let W=this.capabilities[Z];if(!W)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let Q=await this.implementation(),G=this.classDef.title??this.name,J=Q[G]??Q.default?.[G]??Q.default,U=J?.[W.identifier];if(typeof U!=="function")throw TypeError(`Format class "${this.name}": implementation export "${G}" has no static "${W.identifier}" method`);return await U.call(J,...X)}}class A1{#Z;constructor(Z){this.#Z=Z;for(let X of o4){let W=new Map;for(let Q of Z){if(!Q.capabilities[X])continue;for(let G of Q.extensions){let J=W.get(G);if(J)throw Error(`Format conflict: "${J.name}" and "${Q.name}" both claim "${G}" with the "${X}" capability`);W.set(G,Q)}}}}get entries(){return this.#Z}byExtension(Z,X){let W=n4(Z);return this.#Z.find((Q)=>Q.extensions.includes(W)&&(!X||Q.capabilities[X]))}byName(Z){return this.#Z.find((X)=>X.name===Z)}withCapability(Z){return this.#Z.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let W of this.#Z){if(Z&&!W.documentKinds.includes(Z))continue;for(let Q of W.extensions)X.add(Q)}return X.delete(".json"),[...X]}has(Z){let X=n4(Z);return this.#Z.some((W)=>W.extensions.includes(X))}}function pZ(Z){let X={},W=Z.$defs?.methods??{};for(let[Q,G]of Object.entries(W)){let J=G.role;if(!J||!r4.includes(J))continue;let U={identifier:G.identifier??Q,timing:G.timing??dZ};if(typeof G.discriminator==="string")U.discriminator=G.discriminator;X[J]=U}return X}function n4(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var o4,r4,dZ;var v8=c(()=>{o4=["parse","serialize","discover","load"],r4=[...o4,"projectData","resolvePaths","lower","mount","dialect","deploySchema","bindings","testConnection"],dZ=["compiler","server"]});class s4{#Z;#X;#z;constructor(Z){this.#Z=Z,this.#X=Z.flatMap((G)=>G.classes);let X=new Map;for(let G of Z)for(let J of G.classes){let U=X.get(J.name);if(U&&U!==G.specifier)throw Error(`Extension conflict: "${U}" and "${G.specifier}" both provide a class named "${J.name}"`);X.set(J.name,G.specifier)}let W=new Map;for(let G of this.#X){if(!G.project)continue;let J=W.get(G.project.key);if(J)throw Error(`Extension conflict: "${J.name}" and "${G.name}" both claim the project section "${G.project.key}"`);W.set(G.project.key,G)}let Q=new Map;for(let G of this.#X){if(!G.server)continue;let{basePath:J}=G.server;if(!J.startsWith("/_jx/"))throw Error(`Extension "${G.name}": server basePath "${J}" must be under /_jx/`);let U=Q.get(J);if(U)throw Error(`Extension conflict: "${U.name}" and "${G.name}" both mount "${J}"`);Q.set(J,G)}this.#z=new A1(this.#X.filter((G)=>G.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#X}get formats(){return this.#z}byName(Z){return this.#X.find((X)=>X.name===Z)}projectContributions(){return this.#X.filter((Z)=>Z.project!==null)}byProjectKey(Z){return this.#X.find((X)=>X.project?.key===Z)}byPathsDiscriminator(Z){return this.#X.find((X)=>X.capabilities.resolvePaths?.discriminator===Z)}serverMounts(){return this.#X.filter((Z)=>Z.server!==null).toSorted((Z,X)=>(Z.server?.order??100)-(X.server?.order??100)||Z.name.localeCompare(X.name))}connectors(){return this.#X.filter((Z)=>Z.connector!==null)}schemaFragments(Z){return this.#Z.map((X)=>X.schemas[Z]).filter((X)=>typeof X==="string")}}async function a4(Z,X,W){let Q=[];for(let G of Z??[])Q.push(await lZ(G,X,W));return new s4(Q)}async function lZ(Z,X,W){let Q;if(Z.startsWith("./")||Z.startsWith("../")){let K=X.resolvePath(W,Z);Q=X.resolvePath(`${K}/package.json`,`./${w1}`)}else try{Q=X.resolvePath(W,`${Z}/${w1}`)}catch(K){throw Error(`Extension "${Z}" is not resolvable: it must export ${w1} (is the package installed, and does its exports map include it?): ${y8(K)}`,{cause:K})}let G;try{G=await X.loadJson(Q)}catch(K){throw Error(`Extension "${Z}": cannot read manifest ${Q}: ${y8(K)}`,{cause:K})}if(!G||typeof G!=="object"||typeof G.name!=="string")throw Error(`Extension "${Z}": ${w1} must declare a "name"`);if(!Z.startsWith(".")&&G.name!==Z)throw Error(`Extension "${Z}": manifest name "${G.name}" does not match the specifier`);let J=[];for(let[K,V]of Object.entries(G.classes??{})){let Y=X.resolvePath(Q,V),q;try{q=await X.loadJson(Y)}catch(M){throw Error(`Extension "${Z}": cannot read class "${K}" at ${Y}: ${y8(M)}`,{cause:M})}J.push(new L1(K,Y,q,X))}let U={};if(G.schemas?.project)U.project=X.resolvePath(Q,G.schemas.project);if(G.schemas?.document)U.document=X.resolvePath(Q,G.schemas.document);if(G.schemas?.fields)U.fields=X.resolvePath(Q,G.schemas.fields);return{specifier:Z,manifestPath:Q,manifest:G,classes:J,schemas:U}}function y8(Z){return Z instanceof Error?Z.message:String(Z)}var w1="jx-extension.json";var t4=c(()=>{v8();v8()});var h8={};o8(h8,{unknownFormatError:()=>aZ,importImplementation:()=>X6,createNodeFormatIO:()=>z6,buildProjectFormatRegistry:()=>rZ,buildProjectExtensionRegistry:()=>W6,buildExtensionsPayload:()=>sZ});import{readFileSync as Z6}from"node:fs";import{dirname as iZ,isAbsolute as nZ,resolve as m8,sep as I1}from"node:path";import{pathToFileURL as oZ}from"node:url";import{createRequire as e4}from"node:module";async function X6(Z){let X=[Z],W=`${I1}src${I1}`,Q=`${I1}dist${I1}`;if(Z.includes(W))X.push(Z.replace(W,Q));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let G;for(let J of X)try{return await import(oZ(J).href)}catch(U){G=U}throw G instanceof Error?G:Error(String(G))}function z6(Z){return{importModule:(X)=>X6(X),loadJson:async(X)=>JSON.parse(Z6(X,"utf8")),resolvePath:(X,W)=>{if(W.startsWith("./")||W.startsWith("../"))return m8(iZ(X),W);if(nZ(W))return W;let Q=e4(m8(Z,"package.json"));try{return Q.resolve(W)}catch{return e4(import.meta.url).resolve(W)}}}}async function W6(Z,X){return a4(X?.extensions,z6(Z),m8(Z,"project.json"))}async function rZ(Z,X){return(await W6(Z,X)).formats}function sZ(Z){let X=[];for(let W of Z.extensions){let Q={};if(W.schemas.project)try{Q=JSON.parse(Z6(W.schemas.project,"utf8")).properties??{}}catch{Q={}}let G=[];for(let J of W.classes){if(!J.project)continue;G.push({className:J.name,entrySchema:Q[J.project.key]??null,project:J.project,studio:J.studio})}X.push({classes:W.classes.map((J)=>{let U=J.studio?.stateDefaults,K=J.project===null&&J.server===null&&J.connector===null&&J.extensions.length===0;return{name:J.name,path:J.classPath,...K?{state:!0}:{},...U&&typeof U==="object"?{stateDefaults:U}:{}}}),contributions:G,name:W.manifest.name,specifier:W.specifier,...W.manifest.title===void 0?{}:{title:W.manifest.title},...W.manifest.description===void 0?{}:{description:W.manifest.description}})}return X}function aZ(Z,X){return Error(`No format class registered for "${X}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var u8=c(()=>{t4()});async function G6(Z,X={}){let{resolveElementPath:W,$media:Q,formats:G}=X,J=[],U=new Set;async function K(V,Y){let q,M;if(typeof V==="string"){let{readFileSync:b}=await import("node:fs"),{resolve:m}=await import("node:path");if(M=Y?m(Y,V):m(V),U.has(M))return;if(U.add(M),M.endsWith(".json"))q=D1(b(M,"utf8"),M);else{let{extname:f}=await import("node:path"),u=f(M).toLowerCase(),g=G?.byExtension?.(u,"parse");if(!g){let{unknownFormatError:l}=await Promise.resolve().then(() => (u8(),h8));throw l(M,u)}q=await g.call("parse",b(M,"utf8"))}}else{if(q=V,M=null,q.tagName&&U.has(q.tagName))return;if(q.tagName)U.add(q.tagName)}let{tagName:B}=q;if(!B||!B.includes("-"))throw Error(`compileElement: tagName "${B}" must contain a hyphen`);let{dirname:F}=await import("node:path"),L=M?F(M):null,C=[];if(Array.isArray(q.$elements))for(let b of q.$elements){let m=_2(b)?b.$ref:b;if(typeof m!=="string")continue;if(L)await K(m,L);let f=W?W(m,L):m.replace(/\.json$/,".js");C.push(f)}let I=z1(B);if(Q)q.$media={...Q,...q.$media};let E=g0(q,I,C),P=M?M.replace(/\.json$/,".js"):`${B}.js`;J.push({content:E,path:P,tagName:B})}return await K(Z,X.basePath??null),{files:J}}async function tZ(Z,X={}){let{title:W="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:G="https://esm.sh/lit-html@3.3.0"}=X,J=await G6(Z,X),U=J.files.at(-1);if(!U)throw Error("compileElementPage: no element modules were produced");let{basename:K}=await import("node:path"),V=K(U.path),Y=`<!DOCTYPE html>
|
|
89
94
|
<html lang="en">
|
|
90
95
|
<head>
|
|
91
96
|
<meta charset="utf-8">
|
|
92
97
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
93
|
-
<title>${
|
|
98
|
+
<title>${p(W)}</title>
|
|
94
99
|
<script type="importmap">
|
|
95
100
|
{
|
|
96
101
|
"imports": {
|
|
97
102
|
"@vue/reactivity": "${Q}",
|
|
98
|
-
"lit-html": "${
|
|
103
|
+
"lit-html": "${G}"
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
</script>
|
|
102
107
|
</head>
|
|
103
108
|
<body>
|
|
104
|
-
<${
|
|
105
|
-
<script type="module" src="./${
|
|
109
|
+
<${U.tagName}></${U.tagName}>
|
|
110
|
+
<script type="module" src="./${V}"></script>
|
|
106
111
|
</body>
|
|
107
|
-
</html>`;return{files:
|
|
108
|
-
`)}function
|
|
109
|
-
`)}function
|
|
112
|
+
</html>`;return{files:J.files,html:Y}}function eZ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(p2(Z))return;if(Z.$prototype==="LocalStorage"||Z.$prototype==="SessionStorage")return JSON.stringify(Z.default??null);if(Z.$prototype==="Request")return"null";return JSON.stringify(Z)}function g0(Z,X,W){let Q=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)Q.push(`// Source: ${Z.$id}`);for(let B of W)Q.push(`import '${B}';`);let G=new Map,J=Z.state??{};for(let[B,F]of Object.entries(J)){let L=F;if(L&&typeof L==="object"&&!Array.isArray(L)&&L.$prototype==="Function"&&L.$src){let C=L.$src;if(!G.has(C))G.set(C,[]);G.get(C).push(B)}}for(let[B,F]of G)Q.push(`import { ${F.join(", ")} } from '${B}';`);Q.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${X} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let U=[],K=[],V=[],Y=[];for(let[B,F]of Object.entries(J)){let L=F;if(L2(L)){let C=L.$expression;if(t2(L))Y.push([B,L]);else if(d2(C.operator))V.push([B,L]);else K.push([B,L])}else if(j2(L))if(typeof L.body==="string"&&L.body.includes("return"))K.push([B,L]);else V.push([B,L]);else{let C=eZ(L);if(C!==void 0)U.push([B,C])}}Q.push(" this.state = reactive({");for(let[B,F]of U)Q.push(` ${B}: ${F},`);Q.push(" });");for(let[B,F]of V)if(Q.push(""),L2(F)){let L=G2(F.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${B} = (s, e) => { ${L}; };`)}else if(C2(F)){let L=A2(F.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});Q.push(` this.state.${B} = (s, e) => {`,L," };")}else{let C=(F.parameters?l2(F.parameters):F.arguments??["state"]).join(", ");if(F.$src)Q.push(` this.state.${B} = (${C}) => ${B}(${C});`);else Q.push(` this.state.${B} = (${C}) => {`,` ${typeof F.body==="string"?F.body:""}`," };")}for(let[B,F]of Y){Q.push("");let L=G2(F.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${B} = ${j0(F,L)};`)}for(let[B,F]of K)if(Q.push(""),L2(F)){let L=G2(F.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${B} = computed(() => ${L});`)}else if(F.$src)Q.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{Q.push(` this.state.${B} = computed(() => {`);let L=(typeof F.body==="string"?F.body:"").replaceAll("state.","this.state.");Q.push(` ${L}`," });")}Q.push(" }","");let q=[];if(Array.isArray(Z.children)){let B={n:0};for(let F of Z.children)q0(F,q,Z.$media??{},"",B,Z.tagName)}if(Q.push(" template() {"," const s = this.state;"," return html`",c8(Z.children,Z.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];"," }"," }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[F,L]of Object.entries(Z.style)){if(F.startsWith(":")||F.startsWith(".")||F.startsWith("&")||F.startsWith("[")||F.startsWith("@"))continue;if(L===null||typeof L==="object")continue;let C=q2(F);if(typeof L==="string"&&L.includes("${"))B.push([C,L])}if(B.length>0){Q.push(" effect(() => {");for(let[F,L]of B){let C=L.replaceAll(/\$\{([^}]+)\}/g,(I,E)=>`\${${E.replaceAll("state.","this.state.")}}`);Q.push(` this.style['${F}'] = \`${C}\`;`)}Q.push(" });")}}let M=Y6(Z.children);if(M)Q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(Q.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),M)Q.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return Q.push(" }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," }","}","",`customElements.define('${Z.tagName}', ${X});`,""),Q.join(`
|
|
113
|
+
`)}function c8(Z,X,W){if(!Z)return"";if(K2(Z))return Q6(Z,W);if(!Array.isArray(Z))return"";return Z.map((Q)=>K2(Q)?Q6(Q,W):J6(Q,W)).join(`
|
|
114
|
+
`)}function J6(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${f8(Z)}`;return`${X}${p(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${p(String(Z))}`;if(!Z||typeof Z!=="object")return"";let W=Z.tagName??"div",Q=[];if(Z.attributes)for(let[V,Y]of Object.entries(Z.attributes))if(Y&&typeof Y==="object"&&_2(Y))Q.push(`${V}="\${${f2(Y.$ref)}}"`);else if(typeof Y==="string"&&Y.includes("${"))Q.push(`${V}="${O1(Y)}"`);else Q.push(`${V}="${Y}"`);if(Z.id)Q.push(`id="${Z.id}"`);if(Z.className)Q.push(`class="${Z.className}"`);for(let[V,Y]of Object.entries(Z)){if(n2.has(V)||V.startsWith("$")||V.startsWith("on")||V==="tagName"||V==="id"||V==="className"||V==="style"||V==="children"||V==="textContent"||V==="innerHTML"||V==="attributes")continue;if(Y&&typeof Y==="object"&&Y.$ref)Q.push(`.${V}="\${${f2(Y.$ref)}}"`);else if(typeof Y==="string"&&Y.includes("${"))Q.push(`.${V}="${O1(Y)}"`)}if(Z.$props)for(let[V,Y]of Object.entries(Z.$props))if(Y&&typeof Y==="object"&&Y.$ref)Q.push(`.${V}="\${${f2(Y.$ref)}}"`);else Q.push(`.${V}="\${${JSON.stringify(Y)}}"`);for(let[V,Y]of Object.entries(Z)){if(!V.startsWith("on")||V==="observedAttributes")continue;let q=V.slice(2).toLowerCase();if(Y&&typeof Y==="object"&&Y.$ref)Q.push(`@${q}="\${(e) => ${f2(Y.$ref)}(s, e)}"`);else if(Y&&typeof Y==="object"&&"$expression"in Y){let M=G2(Y.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${q}="\${(e) => { ${M}; }}"`)}else if(j2(Y))Q.push(`@${q}="\${(e) => { ${X7(Y)} }}"`)}let G=U6(Z.style);if(G)Q.push(`style="${G}"`);let J=Q.length>0?`
|
|
110
115
|
${X} ${Q.join(`
|
|
111
|
-
${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(W))return`${X}<${W}${
|
|
112
|
-
${X}>`;let
|
|
116
|
+
${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(W))return`${X}<${W}${J}
|
|
117
|
+
${X}>`;let K="";if(Z.$switch){let V=_2(Z.$switch)?Z.$switch.$ref:Z.$switch,Y=f2(V),q=Z.cases??{},M=[];for(let[B,F]of Object.entries(q)){if(!F||_2(F))continue;let L=J6(F,`${X} `);M.push(` ${JSON.stringify(B)}: html\`
|
|
113
118
|
${L}
|
|
114
|
-
\``)}
|
|
115
|
-
${
|
|
119
|
+
\``)}K=`\${{
|
|
120
|
+
${M.join(`,
|
|
116
121
|
`)}
|
|
117
|
-
}[${
|
|
118
|
-
${
|
|
119
|
-
${X}`;return`${X}<${W}${
|
|
120
|
-
${X}>${
|
|
121
|
-
${X} ${
|
|
122
|
-
${X} `)}`:"",
|
|
123
|
-
${
|
|
122
|
+
}[${Y}]}`}else if(Z.textContent!==void 0)K=f8(Z.textContent);else if(Z.innerHTML!==void 0)K=Z.innerHTML;else if(Z.children)K=`
|
|
123
|
+
${c8(Z.children,Z.style,`${X} `)}
|
|
124
|
+
${X}`;return`${X}<${W}${J}
|
|
125
|
+
${X}>${K}</${W}>`}function Q6(Z,X){let W=_2(Z.items)?f2(Z.items.$ref):"ITEMS",Q=Z.map;if(!Q)return"";let G=Q.tagName??"div",J=[];if(Q.$props)for(let[Y,q]of Object.entries(Q.$props))if(_2(q))J.push(`.${Y}="\${${Z7(q.$ref)}}"`);else J.push(`.${Y}="\${${JSON.stringify(q)}}"`);let U=U6(Q.style);if(U)J.push(`style="${U}"`);for(let[Y,q]of Object.entries(Q)){if(!Y.startsWith("on"))continue;let M=Y.slice(2).toLowerCase();if(_2(q))J.push(`@${M}="\${(e) => ${f2(q.$ref)}(s, e)}"`);else if(L2(q)){let B=G2(q.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${M}="\${(e) => { ${B}; }}"`)}}let K=J.length>0?`
|
|
126
|
+
${X} ${J.join(`
|
|
127
|
+
${X} `)}`:"",V="";if(Q.textContent!==void 0)V=f8(Q.textContent);else if(Q.children)V=`
|
|
128
|
+
${c8(Q.children,null,`${X} `)}
|
|
124
129
|
${X} `;return`${X}\${${W}.map((item, index) => html\`
|
|
125
|
-
${X} <${
|
|
126
|
-
${X} >${
|
|
127
|
-
${X}\`)}`}function
|
|
130
|
+
${X} <${G}${K}
|
|
131
|
+
${X} >${V}</${G}>
|
|
132
|
+
${X}\`)}`}function f2(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function Z7(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return f2(Z)}function O1(Z){return Z.replaceAll("state.","s.")}function f8(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${f2(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return O1(Z);return String(Z)}function X7(Z){if(C2(Z))return A2(Z.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});return(typeof Z.body==="string"?Z.body:"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function U6(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[W,Q]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let G=q2(W);X.push(`${G}: ${O1(Q)}`)}}return X.join("; ")}function Y6(Z){if(!Array.isArray(Z))return!1;for(let X of Z){if(!X||typeof X!=="object")continue;if(X.tagName==="slot")return!0;if(Y6(X.children))return!0}return!1}var _1=c(()=>{N0();e2();i2();g8()});function K6(Z,X){let{title:W="Jx App",reactivitySrc:Q,litHtmlSrc:G}=X,J=V0(Z,null,Z.state??{},Z.$media??{}),U=H0(Z,Z.$media??{},X.projectStyle??null),K=[],V=q6(Z,!1,Z,J,K),Y=[],q="",M="";if(K.length>0){for(let F of K){let L=g0(F.def,F.className,[]);Y.push({content:L,path:`_islands/${F.tagName}.js`,tagName:F.tagName})}q=`<script type="importmap">
|
|
128
133
|
{
|
|
129
134
|
"imports": {
|
|
130
135
|
"@vue/reactivity": "${Q}",
|
|
131
|
-
"lit-html": "${
|
|
136
|
+
"lit-html": "${G}"
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
|
-
</script>`,
|
|
139
|
+
</script>`,M=Y.map((F)=>`<script type="module" src="./${F.path}"></script>`).join(`
|
|
135
140
|
`)}let B=`<!DOCTYPE html>
|
|
136
141
|
<html lang="en">
|
|
137
142
|
<head>
|
|
138
143
|
<meta charset="utf-8">
|
|
139
144
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
140
|
-
<title>${
|
|
141
|
-
${
|
|
142
|
-
${
|
|
145
|
+
<title>${p(W)}</title>
|
|
146
|
+
${q}
|
|
147
|
+
${U}
|
|
143
148
|
</head>
|
|
144
149
|
<body>
|
|
145
|
-
${
|
|
146
|
-
${
|
|
150
|
+
${V}
|
|
151
|
+
${M}
|
|
147
152
|
</body>
|
|
148
|
-
</html>`;return{files:
|
|
149
|
-
`)}return""}var
|
|
153
|
+
</html>`;return{files:Y,html:B}}function q6(Z,X,W,Q,G){if(typeof Z==="string")return p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(!Z||typeof Z!=="object")return"";let J=V0(W,Q.scope,W?.state??Q.scopeDefs,W?.$media??Q.media);if(X){let Y=G.length,q=`jx-island-${Y}`,M=`JxIsland${Y}`,B={...W??Z,tagName:q};return G.push({className:M,def:B,tagName:q}),`<${q}></${q}>`}let U=Z.tagName??"div",K=K0(Z,J.scope);if(d1.has(U))return`<${U}${K}>`;let V=z7(Z,W,J,G);return`<${U}${K}>${V}</${U}>`}function z7(Z,X,W,Q){let G=X??Z;if(G.textContent!==void 0){let J=z2(G.textContent,W.scope);return J==null?"":p(String(J))}if(G.innerHTML)return z2(G.innerHTML,W.scope)??G.innerHTML;if(Array.isArray(G.children)){let J=Array.isArray(X?.children)?X.children:void 0;return G.children.map((U,K)=>{let V=U,Y=U9(V),q=J?.[K]??U;return q6(V,Y,q,W,Q)}).join(`
|
|
154
|
+
`)}return""}var V6=c(()=>{e2();_1()});function p8(Z,X){let{title:W="Jx App",reactivitySrc:Q=e0,litHtmlSrc:G=Z1,modulePath:J="app.js"}=X,U=V0(Z,null,Z.state??{},Z.$media??{}),K=H0(Z,Z.$media??{},X.projectStyle??null),V={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},Y=new Map,q=new Map,M=[],B=[],F=[],L=[],C=[],I=new Map,E=Z.state??{};for(let[u,g]of Object.entries(E)){if(g===null||typeof g!=="object"||Array.isArray(g)){if(typeof g==="string"&&o(g))B.push([u,`() => \`${g}\``]);else M.push([u,g]);continue}if(L2(g)){let l=g.$expression,X2=G2(l,{eventParam:"e",statePrefix:"state"});if(t2(g))C.push(`state[${JSON.stringify(u)}] = ${j0(g,X2)};`);else if(d2(l.operator))L.push([u,{args:["state","e"],body:X2}]);else B.push([u,`() => ${X2}`]);continue}if(j2(g)){let l=g.parameters?l2(g.parameters):g.arguments;if(C2(g)){let X2=A2(g.body,{eventParam:"e",statePrefix:"state"});if(g.parameters&&g.parameters.length>0)C.push(`state[${JSON.stringify(u)}] = ${j0(g,`(() => {
|
|
155
|
+
${X2}
|
|
156
|
+
})()`)};`);else L.push([u,{args:["state","e"],body:X2}])}else if(g.$src){if(!I.has(g.$src))I.set(g.$src,new Set);I.get(g.$src).add(u),B.push([u,`() => { return ${u}(state); }`])}else if(typeof g.body==="string"&&g.body.includes("return"))B.push([u,`() => { ${g.body} }`]);else L.push([u,{args:l??["state"],body:g.body}]);continue}if(p2(g))continue;if(z9(g)){M.push([u,g.default]);continue}if(T0(g)){if(g.$prototype==="LocalStorage"||g.$prototype==="SessionStorage"){let l=g.$prototype==="LocalStorage"?"localStorage":"sessionStorage",X2=g.key??u,O2=g.default??null;M.push([u,null]),C.push(G7(u,l,X2,O2));continue}if(g.$prototype==="Request"){M.push([u,null]),C.push(Q7(u,g));continue}if(g.$prototype==="Cookie"){M.push([u,null]),C.push(J7(u,g.name??u,g.default??null));continue}}M.push([u,g])}let P=H6(Z,Z,U,Y,q,V);for(let[u,g]of Y)if(!F.some(([l])=>l===u))F.push([u,g]);for(let[u,g]of q)if(!L.some(([l])=>l===u))L.push([u,g]);let b=W7(M,B,F,L,C,I,V,Q),m=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${G}"`],f=`<!DOCTYPE html>
|
|
150
157
|
<html lang="en">
|
|
151
158
|
<head>
|
|
152
159
|
<meta charset="utf-8">
|
|
153
160
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
154
|
-
<title>${
|
|
161
|
+
<title>${p(W)}</title>
|
|
155
162
|
<script type="importmap">
|
|
156
163
|
{
|
|
157
164
|
"imports": {
|
|
158
|
-
${
|
|
165
|
+
${m.join(`,
|
|
159
166
|
`)}
|
|
160
167
|
}
|
|
161
168
|
}
|
|
162
169
|
</script>
|
|
163
|
-
${
|
|
164
|
-
<script type="module" src="./${
|
|
170
|
+
${K}
|
|
171
|
+
<script type="module" src="./${J}"></script>
|
|
165
172
|
</head>
|
|
166
173
|
<body>
|
|
167
|
-
${
|
|
174
|
+
${P}
|
|
168
175
|
</body>
|
|
169
|
-
</html>`;return{files:[{content:
|
|
170
|
-
`);Q.set(
|
|
171
|
-
${
|
|
172
|
-
\``),
|
|
173
|
-
`)}if(new Set(["input","br","hr","img","meta","link"]).has(
|
|
174
|
-
${
|
|
176
|
+
</html>`;return{files:[{content:b,path:J}],html:f}}function H6(Z,X,W,Q,G,J){if(typeof Z==="string")return p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(!Z||typeof Z!=="object")return"";let U=V0(X,W.scope,X?.state??W.scopeDefs,X?.$media??W.media),K=Z.tagName??"div",V=[],Y=!1;if(Z.textContent!==void 0){let I=X?.textContent??Z.textContent;if(T2(I)){let E=r2(I.$ref);V.push(`:text-content="${E}"`),d8(Q,E,I.$ref),Y=!0}else if(o(I)){let E=`_t${J.t}`;J.t+=1,V.push(`:text-content="${E}"`),Q.set(E,`() => \`${I}\``),Y=!0}}for(let[I,E]of Object.entries(Z)){if(!I.startsWith("on")||I==="observedAttributes")continue;let P=I.slice(2).toLowerCase();if(T2(E)){let b=r2(E.$ref);V.push(`@${P}="${b}"`),Y=!0}else if(C2(E)){let b=`_h${J.h}`;J.h+=1,V.push(`@${P}="${b}"`),G.set(b,{args:["state","e"],body:A2(E.body,{eventParam:"e",statePrefix:"state"})}),Y=!0}else if(j2(E)){let b=`_h${J.h}`;J.h+=1,V.push(`@${P}="${b}"`),G.set(b,{args:E.parameters?l2(E.parameters):E.arguments??["state","event"],body:E.body}),Y=!0}else if(L2(E)){let b=`_h${J.h}`;J.h+=1,V.push(`@${P}="${b}"`);let m=G2(E.$expression,{eventParam:"e",statePrefix:"state"});G.set(b,{args:["state","e"],body:m}),Y=!0}}if(Z.style&&typeof Z.style==="object")for(let[I,E]of Object.entries(Z.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(E===null||typeof E==="object")continue;if(o(E)){let P=`_s${J.s}`;J.s+=1,V.push(`:style.${q2(I)}="${P}"`),Q.set(P,`() => \`${E}\``),Y=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[I,E]of Object.entries(Z.attributes))if(T2(E)){let P=r2(E.$ref);V.push(`:attr.${I}="${P}"`),d8(Q,P,E.$ref),Y=!0}else if(o(E)){let P=`_t${J.t}`;J.t+=1,V.push(`:attr.${I}="${P}"`),Q.set(P,`() => \`${E}\``),Y=!0}}for(let[I,E]of Object.entries(Z)){if(n2.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(T2(E)){let P=r2(E.$ref);V.push(`:${q2(I)}="${P}"`),d8(Q,P,E.$ref),Y=!0}else if(o(E)){let P=`_t${J.t}`;J.t+=1,V.push(`:${q2(I)}="${P}"`),Q.set(P,`() => \`${E}\``),Y=!0}}let q=K0(Z,U.scope),M=Y?" data-bind":"",B=V.length>0?` ${V.join(" ")}`:"",F="",L=X??Z;if(L.textContent!==void 0&&!Y){let I=z2(L.textContent,U.scope);F=I==null?"":p(String(I))}else if(L.textContent!==void 0&&Y){let I=z2(L.textContent,U.scope);F=I==null?"":p(String(I))}else if(L.innerHTML)F=z2(L.innerHTML,U.scope)??L.innerHTML;else if(K2(L.children)){J.needsLit=!0;let I=`_list${J.l}`;J.l+=1;let E=L.children,P;if(T2(E.items))P=`state.${r2(E.items.$ref)}`;else P=JSON.stringify(E.items);let b=l8(E.map);Q.set(I,`() => (${P} ?? []).map((item, index) => html\`${b}\`)`),V.push(`:render="${I}"`),Y=!0;let m=" data-bind",f=` ${V.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(K))return`<${K}${q}${m}${f}>`;return`<${K}${q}${m}${f}></${K}>`}else if(Array.isArray(L.children)&&L.children.some((I)=>K2(I))){J.needsLit=!0;let I=`_children${J.l}`;J.l+=1;let E=L.children.map((b)=>M6(b)).join(`
|
|
177
|
+
`);Q.set(I,`() => html\`
|
|
178
|
+
${E}
|
|
179
|
+
\``),V.push(`:render="${I}"`),Y=!0;let P=` ${V.join(" ")}`;return`<${K}${q} data-bind${P}></${K}>`}else if(Array.isArray(L.children)){let I=Array.isArray(X?.children)?X.children:void 0;F=L.children.map((E,P)=>{let b=I?.[P]??E;return H6(E,b,U,Q,G,J)}).join(`
|
|
180
|
+
`)}if(new Set(["input","br","hr","img","meta","link"]).has(K))return`<${K}${q}${M}${B}>`;return`<${K}${q}${M}${B}>${F}</${K}>`}function l8(Z){if(!Z)return"";let X=Z.tagName??"div",W="";if(Z.id)W+=` id="${Z.id}"`;if(Z.className)W+=` class="${W0(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[J,U]of Object.entries(Z.attributes))W+=typeof U==="string"&&o(U)?` ${J}="${W0(U)}"`:` ${J}="${p(String(U))}"`;if(Z.style&&typeof Z.style==="object"){let J=[];for(let[U,K]of Object.entries(Z.style)){if(U.startsWith(":")||U.startsWith(".")||U.startsWith("&")||U.startsWith("[")||U.startsWith("@"))continue;if(K===null||typeof K==="object")continue;let V=q2(U);if(o(String(K)))J.push(`${V}: ${W0(String(K))}`);else J.push(`${V}: ${K}`)}if(J.length>0)W+=` style="${J.join("; ")}"`}for(let[J,U]of Object.entries(Z)){if(!J.startsWith("on")||J==="observedAttributes")continue;let K=J.slice(2).toLowerCase();if(T2(U)){let V=r2(U.$ref);W+=` @${K}=\${(e) => { state.$map = { item, index }; on.${V}(e); }}`}else if(C2(U)){let V=A2(U.body,{eventParam:"e",statePrefix:"state"});W+=` @${K}=\${(e) => { state.$map = { item, index }; ${V} }}`}else if(U&&typeof U==="object"&&U.$prototype==="Function"){let V=W0(U.body);W+=` @${K}=\${(e) => { ${V} }}`}else if(U&&typeof U==="object"&&"$expression"in U){let V=G2(U.$expression,{eventParam:"e",statePrefix:"state"});W+=` @${K}=\${(e) => { state.$map = { item, index }; ${V}; }}`}}if(Z.contentEditable)W+=` contenteditable="${Z.contentEditable}"`;let Q="";if(Z.textContent!==void 0){let J=String(Z.textContent);if(o(J))Q=W0(J);else if(T2(Z.textContent))Q=`\${state.${r2(Z.textContent.$ref)}}`;else Q=p(J)}else if(Z.innerHTML)Q=W0(String(Z.innerHTML));else if(K2(Z.children))Q=`
|
|
181
|
+
${B6(Z.children)}
|
|
175
182
|
`;else if(Array.isArray(Z.children))Q=`
|
|
176
|
-
${Z.children.map((
|
|
183
|
+
${Z.children.map((J)=>M6(J)).join(`
|
|
177
184
|
`)}
|
|
178
|
-
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${W}>`;return`<${X}${W}>${Q}</${X}>`}function
|
|
179
|
-
`)}function
|
|
180
|
-
`)}function
|
|
181
|
-
`)}function
|
|
182
|
-
`)}function
|
|
183
|
-
`)}function
|
|
184
|
-
`):Z.body??"").includes("await ")}import{readFileSync as
|
|
185
|
+
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${W}>`;return`<${X}${W}>${Q}</${X}>`}function M6(Z){if(typeof Z==="string")return o(Z)?W0(Z):p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(K2(Z))return B6(Z);return l8(Z)}function B6(Z){let{items:X}=Z,W=T2(X)?`state.${r2(X.$ref)}`:JSON.stringify(X??[]),Q=l8(Z.map);return`\${(${W} ?? []).map((item, index) => html\`${Q}\`)}`}function W0(Z){return Z.replaceAll("$map.","")}function W7(Z,X,W,Q,G,J,U,K){let V=[],{needsLit:Y}=U,q=X.length>0;V.push("// Generated by @jxsuite/compiler — do not edit manually");let M=["reactive","effect"];if(q)M.push("computed");if(V.push(`import { ${M.join(", ")} } from '@vue/reactivity';`),Y)V.push("import { html, render } from 'lit-html';");for(let[B,F]of J)V.push(`import { ${[...F].join(", ")} } from '${B}';`);V.push("","const state = reactive({");for(let[B,F]of Z)V.push(` ${B}: ${JSON.stringify(F)},`);if(V.push("});",""),G.length>0){for(let B of G)V.push(B);V.push("")}if(X.length>0){for(let[B,F]of X)V.push(`state.${B} = computed(${F});`);V.push("")}if(W.length>0){V.push("const bind = {");for(let[B,F]of W)V.push(` ${B}: ${F},`);V.push("};")}else V.push("const bind = {};");if(V.push(""),Q.length>0){V.push("const on = {");for(let[B,F]of Q){let L=F.args??["state"],C=L.map((I)=>I==="state"?"state":"e").join(", ");V.push(` ${B}: (e) => { const fn = (${L.join(", ")}) => { ${F.body} }; fn(${C}); },`)}V.push("};")}else V.push("const on = {};");if(V.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;"),Y)V.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else V.push(" if (parts[0] === 'style' && parts.length > 1) {");return V.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);",""),V.join(`
|
|
186
|
+
`)}function Q7(Z,X){let{url:W}=X,Q=X.method??"GET",G=o(W);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let J=[`// ${Z}: auto-fetch from ${G?"(dynamic URL)":W}`,"effect(() => {"];if(G)J.push(` const url = \`${W}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else J.push(` const url = ${JSON.stringify(W)};`);let U=[];if(Q!=="GET")U.push(`method: ${JSON.stringify(Q)}`);if(X.headers)U.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let V=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);U.push(`body: ${V}`)}let K=U.length>0?`, { ${U.join(", ")} }`:"";return J.push(` fetch(url${K})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),J.join(`
|
|
187
|
+
`)}function G7(Z,X,W,Q){return[`// ${Z}: ${X} (key: "${W}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(W)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${Z} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(W)});`,` else ${X}.setItem(${JSON.stringify(W)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
188
|
+
`)}function J7(Z,X,W){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(W)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(W)}; }`,"}"].join(`
|
|
189
|
+
`)}function r2(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function d8(Z,X,W){if(Z.has(X))return;if(W.startsWith("#/state/")){let G=W.slice(8).split("/");Z.set(X,`() => state.${G.join(".")}`)}else Z.set(X,`() => state.${W}`)}var i8=c(()=>{N0();e2();i2()});var $6={};o8($6,{compileClassJson:()=>U7});function U7(Z,X={}){let W=Z.title;if(!W)throw Error("compileClassJson: missing title (class name)");let Q=Y7(Z.extends),G=Z.$defs,J=G?.fields??{},U=G?.constructor,K=typeof U==="object"?U:void 0,V=G?.methods??{},Y=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)Y.push(`// Source: ${Z.$id}`);Y.push("");let q=Q!=="Object"?` extends ${Q}`:"";Y.push(`class ${W}${q} {`);for(let[M,B]of Object.entries(J)){if(B.scope!=="static")continue;let F=B.identifier??M,L=B.access==="private"?"#":"",C=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";Y.push(` static ${L}${F} = ${C};`)}for(let[M,B]of Object.entries(J)){if(B.scope==="static")continue;if(B.access!=="private")continue;let F=B.identifier??M;Y.push(` #${F};`)}if(Object.keys(J).length>0)Y.push("");if(Y.push(" constructor(config = {}) {"),K?.superCall||Q!=="Object"){let M=K?.superCall?.arguments?K.superCall.arguments.join(", "):"";Y.push(` super(${M});`)}for(let[M,B]of Object.entries(J)){if(B.scope==="static")continue;let F=B.identifier??M,L=B.access==="private"?"#":"",C=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";Y.push(` this.${L}${F} = config.${F} !== undefined ? config.${F} : ${C};`)}if(K?.body){let M=Array.isArray(K.body)?K.body:[K.body];for(let B of M)Y.push(` ${B}`)}Y.push(" }");for(let[M,B]of Object.entries(V)){let F=B.identifier??M,L=B.scope==="static",I=B.access==="private"?"#":"",E=L?"static ":"",P=B.returnType?.$ref?.includes("Promise")||q7(B)?"async ":"",b=F6(B.parameters??[]),m=K7(B.body);if(Y.push(""),B.role==="accessor"){if(B.getter)Y.push(` ${E}get ${I}${F}() {`,` ${B.getter.body}`," }");if(B.setter){let f=F6(B.setter.parameters??[]);Y.push(` ${E}set ${I}${F}(${f}) {`,` ${B.setter.body}`," }")}}else{Y.push(` ${E}${P}${I}${F}(${b}) {`);for(let f of m)Y.push(` ${f}`);Y.push(" }")}}return Y.push("}","",`export { ${W} };`,`export default ${W};`,""),Y.join(`
|
|
190
|
+
`)}function Y7(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let X=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return X?X[1]:"Object"}return"Object"}function F6(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let W=X.identifier??X.name;return typeof W==="string"?W:"arg"}).join(", ")}function K7(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function q7(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
191
|
+
`):Z.body??"").includes("await ")}import{readFileSync as V7}from"node:fs";async function H7(Z,X={}){let{title:W="Jx App",reactivitySrc:Q=e0,litHtmlSrc:G=Z1,projectStyle:J=null}=X,U;if(typeof Z==="string"){let K=V7(Z,"utf8");if(Z.endsWith(".json"))U=D1(K,Z);else{let{extname:V}=await import("node:path"),Y=V(Z).toLowerCase(),q=X.formats?.byExtension?.(Y,"parse");if(!q){let{unknownFormatError:M}=await Promise.resolve().then(() => (u8(),h8));throw M(Z,Y)}U=await q.call("parse",K)}}else U=Z;if(Q9(U)){let{compileClassJson:K}=await Promise.resolve().then(() => $6),V=K(U,X),Y=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${U.title}.js`;return{files:[{content:V,path:Y}],html:""}}if(!X1(U))return K6(U,{litHtmlSrc:G,projectStyle:J,reactivitySrc:Q,title:W});if(U.tagName&&U.tagName.includes("-")){let{tagName:K}=U,V=z1(K),q={content:g0(U,V,[]),path:`${K}.js`,tagName:K},M=H0(U,U.$media??{}),B=`<!DOCTYPE html>
|
|
185
192
|
<html lang="en">
|
|
186
193
|
<head>
|
|
187
194
|
<meta charset="utf-8">
|
|
188
195
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
189
|
-
<title>${
|
|
196
|
+
<title>${p(W)}</title>
|
|
190
197
|
<script type="importmap">
|
|
191
198
|
{
|
|
192
199
|
"imports": {
|
|
193
200
|
"@vue/reactivity": "${Q}",
|
|
194
|
-
"lit-html": "${
|
|
201
|
+
"lit-html": "${G}"
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
204
|
</script>
|
|
198
|
-
${
|
|
205
|
+
${M}
|
|
199
206
|
</head>
|
|
200
207
|
<body>
|
|
201
|
-
<${
|
|
202
|
-
<script type="module" src="./${
|
|
208
|
+
<${K}></${K}>
|
|
209
|
+
<script type="module" src="./${K}.js"></script>
|
|
203
210
|
</body>
|
|
204
|
-
</html>`;return{files:[
|
|
211
|
+
</html>`;return{files:[q],html:B}}return p8(U,{litHtmlSrc:G,projectStyle:J,reactivitySrc:Q,title:W})}async function Jz(Z,X){let[W,Q]=await Promise.all([H7(Z),S8(Z)]),{writeFileSync:G,mkdirSync:J}=await import("node:fs"),{dirname:U,join:K}=await import("node:path");if(X){G(X,W.html,"utf8"),console.error(`Written to ${X}`);let V=U(X);for(let Y of W.files){let q=K(V,Y.path);J(U(q),{recursive:!0}),G(q,Y.content,"utf8"),console.error(`Written to ${q}`)}}else process.stdout.write(W.html);if(Q&&X){let V=X.replace(/(\.[^.]+)?$/,"-server.js");G(V,Q,"utf8"),console.error(`Server handler written to ${V}`)}}var M7=c(()=>{e2();k8();_1();V6();i8();i2();g8();e2();k8();_1();i8()});M7();export{Jz as runCli,X1 as isDynamic,uZ as compileSiteServer,S8 as compileServer,tZ as compileElementPage,G6 as compileElement,p8 as compileClient,H7 as compile};
|