@jxsuite/compiler 0.28.2 → 0.28.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,281 +1,290 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as ZJ}from"node:module";var pZ=Object.create;var{getPrototypeOf:nZ,defineProperty:T6,getOwnPropertyNames:rZ}=Object;var iZ=Object.prototype.hasOwnProperty;function aZ(Z){return this[Z]}var sZ,oZ,B7=(Z,J,X)=>{var W=Z!=null&&typeof Z==="object";if(W){var q=J?sZ??=new WeakMap:oZ??=new WeakMap,Q=q.get(Z);if(Q)return Q}X=Z!=null?pZ(nZ(Z)):{};let G=J||!Z||!Z.__esModule?T6(X,"default",{value:Z,enumerable:!0}):X;for(let z of rZ(Z))if(!iZ.call(G,z))T6(G,z,{get:aZ.bind(Z,z),enumerable:!0});if(W)q.set(Z,G);return G};var S=(Z,J)=>()=>(J||Z((J={exports:{}}).exports,J),J.exports);var tZ=(Z)=>Z;function eZ(Z,J){this[Z]=tZ.bind(null,J)}var P6=(Z,J)=>{for(var X in J)T6(Z,X,{get:J[X],enumerable:!0,configurable:!0,set:eZ.bind(J,X)})};var O=(Z,J)=>()=>(Z&&(J=Z(Z=0)),J);var h=ZJ(import.meta.url);function G4(Z){return F7.has(Z)}function _0(Z,J,X,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return o0(Z,J,X,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return XJ(Z.$ref,J,X,W);if(Array.isArray(Z))return Z.map((q)=>_0(q,J,X,W));return Z}function XJ(Z,J,X,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let q=Z.slice(7);return w4(X,q)}if(Z.startsWith("$map/")){let q=Z.split("/"),Q=q[1],G;if(Q==="item")G=W?.item??J.$map?.item??J["$map/item"];else if(Q==="index")G=W?.index??J.$map?.index??J["$map/index"];else G=J.$map?.[Q]??J["$map/"+Q];return q.length>2?w4(G,q.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let q=Z.slice(8),Q=q.indexOf("/");if(Q<0)return J[q];return w4(J[q.slice(0,Q)],q.slice(Q+1))}if(Z.startsWith("parent#/"))return J[Z.slice(8)];if(Z.startsWith("window#/"))return w4(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return w4(globalThis.document,Z.slice(10));return J[Z]??null}function WJ(Z,J,X,W){if(Z.startsWith("$map/")){let q=Z.split("/"),Q=q[1],G;if(Q==="item")G=W?.item??J.$map?.item??J["$map/item"];else if(Q==="index")G=W?.index??J.$map?.index??J["$map/index"];else G=J.$map?.[Q]??J["$map/"+Q];if(q.length>2){let z=q.slice(2),Y=z.pop();return{obj:z.length>0?w4(G,z.join("/")):G,key:Y}}return{obj:J.$map??J,key:Q==="item"?"$map/item":"$map/index"}}if(Z.startsWith("#/state/")){let q=Z.slice(8);if(q.indexOf("/")<0)return{obj:J,key:q};let G=q.split("/"),z=G.pop(),Y=J;for(let U of G)Y=Y[U];return{obj:Y,key:z}}return{obj:J,key:Z}}function o0(Z,J,X,W){let{operator:q,target:Q,value:G,initial:z}=Z;if(!JJ.has(q))throw Error(`$expression: unknown operator "${q}"`);if(R6.has(q)&&!("value"in Z)){let Y=_0(Q,J,X,W);if(q==="!")return!Y;if(q==="-")return-Y}if(j6.has(q)){let Y=_0(Q,J,X,W),U=_0(G,J,X,W);switch(q){case"+":return Y+U;case"-":return Y-U;case"*":return Y*U;case"/":return Y/U;case"%":return Y%U;case"===":return Y===U;case"!==":return Y!==U;case"<":return Y<U;case"<=":return Y<=U;case">":return Y>U;case">=":return Y>=U;case"&&":return Y&&U;case"||":return Y||U}}if(M7.has(q)){let Y=_0(G,J,X,W),{obj:U,key:K}=WJ(Q.$ref,J,X,W);switch(q){case"=":U[K]=Y;break;case"+=":U[K]+=Y;break;case"-=":U[K]-=Y;break;case"*=":U[K]*=Y;break;case"/=":U[K]/=Y;break}return}if(A7.has(q)){let Y=_0(Q,J,X,W);switch(q){case"push":return Y.push(_0(G,J,X,W));case"unshift":return Y.unshift(_0(G,J,X,W));case"pop":return Y.pop();case"shift":return Y.shift();case"splice":{let U=_0(G,J,X,W);return Y.splice(...U)}}}if(_6.has(q)){let Y=_0(Q,J,X,W);if(q==="reduce"){let U=_0(z,J,X,W);return Y.reduce((K,V,B)=>{return o0(G,J,X,{acc:K,item:V,index:B})},U)}if(q==="map")return Y.map((U,K)=>{return o0(G,J,X,{...W,item:U,index:K})});if(q==="filter")return Y.filter((U,K)=>{return o0(G,J,X,{...W,item:U,index:K})})}return}function N0(Z,J){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return L0(Z,J);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return L7(Z.$ref,J);if(Array.isArray(Z))return Z.map((X)=>N0(X,J)).join(", ");return JSON.stringify(Z)}function L7(Z,J){let X=J.statePrefix??"state",W=J.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let q=Z.slice(7);return`${W}.${q.replace(/\//g,".")}`}if(Z.startsWith("$map/")){let q=Z.split("/"),Q=q[1];if(Q==="item")return q.length>2?`_item.${q.slice(2).join(".")}`:"_item";if(Q==="index")return"_index";return`_${Q}`}if(Z.startsWith("#/state/")){let q=Z.slice(8);return`${X}.${q.replace(/\//g,".")}`}if(Z.startsWith("parent#/"))return`${X}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replace(/\//g,".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replace(/\//g,".")}`;return`${X}.${Z}`}function $7(Z,J){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return L7(Z.$ref,J);return N0(Z,J)}function L0(Z,J={}){let{operator:X,target:W,value:q,initial:Q}=Z;if(R6.has(X)&&!("value"in Z)){let G=N0(W,J);if(X==="!")return`!(${G})`;if(X==="-")return`-(${G})`}if(j6.has(X)){let G=N0(W,J),z=N0(q,J);return`(${G} ${X} ${z})`}if(M7.has(X)){let G=$7(W,J),z=N0(q,J);return`${G} ${X} ${z}`}if(A7.has(X)){let G=$7(W,J);switch(X){case"push":return`${G}.push(${N0(q,J)})`;case"unshift":return`${G}.unshift(${N0(q,J)})`;case"pop":return`${G}.pop()`;case"shift":return`${G}.shift()`;case"splice":{let z=Array.isArray(q)?q.map((Y)=>N0(Y,J)).join(", "):N0(q,J);return`${G}.splice(${z})`}}}if(_6.has(X)){let G=N0(W,J),z=L0(q,J);if(X==="reduce"){let Y=N0(Q,J);return`${G}.reduce((_acc, _item, _index) => ${z}, ${Y})`}if(X==="map")return`${G}.map((_item, _index) => ${z})`;if(X==="filter")return`${G}.filter((_item, _index) => ${z})`}return"undefined"}function w4(Z,J){return J.split(/[./]/).reduce((X,W)=>X?.[W],Z)}var F7,R6,j6,M7,A7,_6,JJ;var C6=O(()=>{F7=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),R6=new Set(["!","-"]),j6=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),M7=new Set(["=","+=","-=","*=","/="]),A7=new Set(["push","pop","shift","unshift","splice"]),_6=new Set(["reduce","map","filter"]),JJ=new Set([...F7,...R6,...j6,..._6])});function qJ(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replace(/[A-Z]/g,(J)=>`-${J.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([J,X])=>!qJ(J)&&(X===null||typeof X!=="object")).map(([J,X])=>`${I0(J)}: ${X}`).join("; ")}var Y4;var j1=O(()=>{C6();Y4=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 P4(Z){for(let J of Object.keys(Z))if(!QJ.has(J))return!1;return!0}function b(Z){return typeof Z==="string"&&Z.includes("${")}function x6(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[J,X]of Object.entries(Z.state)){if(J==="$site"||J==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(P4(X))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)){if(Z.children.some((J)=>x6(J)))return!0}for(let[J,X]of Object.entries(Z)){if(Y4.has(J))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(b(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let J of Object.values(Z.style))if(b(J))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let J of Object.values(Z.attributes))if(b(J))return!0}return!1}function D7(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[J,X]of Object.entries(Z)){if(Y4.has(J))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(b(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let J of Object.values(Z.style))if(b(J))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let J of Object.values(Z.attributes))if(b(J))return!0}return!1}function R4(Z,J=null,X={},W={}){return{scope:Z?.state?j4(Z.state,J):J??Object.create(null),scopeDefs:X,media:W}}function j4(Z={},J=null){let X=Object.create(J??null);for(let[W,q]of Object.entries(Z)){if(typeof q!=="object"||q===null||Array.isArray(q)){z4(X,W,_1(q));continue}let Q=q;if("default"in Q){z4(X,W,_1(Q.default));continue}if(!Q.$prototype&&!("$expression"in Q)&&!P4(Q))z4(X,W,_1(Q))}for(let[W,q]of Object.entries(Z)){if(typeof q==="string"&&b(q)){E6(X,W,()=>Y0(q,X));continue}if(!q||typeof q!=="object")continue;let Q=q;if("$expression"in Q){let G=Q.$expression;if(G4(G.operator))z4(X,W,(z,Y)=>o0(G,z,Y));else E6(X,W,()=>o0(G,X,null));continue}if(Q.$prototype==="Function"){if(Q.body){let G=Function("state",...Q.parameters??Q.arguments??[],Q.body);if(Q.body.includes("return"))E6(X,W,()=>G(X));else z4(X,W,G)}else if(!Q.body?.includes("return"))z4(X,W,()=>{});continue}if(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage")z4(X,W,_1(Q.default??null))}return X}function z4(Z,J,X){Object.defineProperty(Z,J,{value:X,enumerable:!0,configurable:!0,writable:!0})}function E6(Z,J,X){Object.defineProperty(Z,J,{enumerable:!0,configurable:!0,get:X})}function a(Z,J){if(c0(Z))return k6(Z.$ref,J);if(b(Z))return Y0(Z,J);return Z}function c0(Z){return Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string"}function k6(Z,J){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let X=Z.split("/"),W=X[1],q=J.$map?.[W]??J["$map/"+W];return X.length>2?I7(q,X.slice(2).join("/")):q}if(Z.startsWith("#/state/")){let X=Z.slice(8),W=X.indexOf("/");if(W<0)return J[X];return I7(J[X.slice(0,W)],X.slice(W+1))}return J[Z]??null}function Y0(Z,J){try{let X=Z.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(J,J?.$map);return Function("state","$map",`return \`${Z}\``)(J,J?.$map)}catch{return null}}function I7(Z,J){if(!J)return Z;return J.split("/").reduce((X,W)=>X==null?void 0:X[W],Z)}function _1(Z){if(Z===null||typeof Z!=="object")return Z;return JSON.parse(JSON.stringify(Z))}function J1(Z,J){let X="",W=a(Z.id,J),q=a(Z.className,J),Q=a(Z.hidden,J),G=a(Z.tabIndex,J),z=a(Z.title,J),Y=a(Z.lang,J),U=a(Z.dir,J);if(W)X+=` id="${m(String(W))}"`;if(q)X+=` class="${m(String(q))}"`;if(Q)X+=" hidden";if(G!==void 0&&G!==null)X+=` tabindex="${m(String(G))}"`;if(z)X+=` title="${m(String(z))}"`;if(Y)X+=` lang="${m(String(Y))}"`;if(U)X+=` dir="${m(String(U))}"`;if(Z.style&&J){let K=Object.entries(Z.style).filter(([V,B])=>!V.startsWith(":")&&!V.startsWith(".")&&!V.startsWith("&")&&!V.startsWith("[")&&!V.startsWith("@")&&B!==null&&typeof B!=="object"&&typeof B==="string"&&b(B)).map(([V,B])=>{let $=a(B,J);return $==null?null:`${I0(V)}: ${$}`}).filter(Boolean).join("; ");if(K)X+=` style="${K}"`}if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes)){let B=a(V,J);if(B!==null&&B!==void 0&&(typeof B==="string"||typeof B==="number"||typeof B==="boolean"))X+=` ${K}="${m(String(B))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)X+=' loading="lazy"';if(!Z.attributes?.decoding)X+=' decoding="async"'}if(Z.$static)X+=" data-jx-static";else if(Z.$prerendered)X+=" data-jx-prerendered";return X}function _4(Z,J={},X=null){let W=[];if(X&&typeof X==="object"){let Q=function(K,V){let B=B0(V);if(B)W.push(`${K} { ${B} }`);for(let[$,A]of Object.entries(V)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if($.startsWith("@")){let L=$.startsWith("@--")?`@media ${J[$.slice(1)]??$.slice(1)}`:$,w=B0(A);if(w)W.push(`${L} { ${K} { ${w} } }`);for(let[I,j]of Object.entries(A)){if(j===null||typeof j!=="object"||Array.isArray(j))continue;if(I.startsWith("@"))continue;let v=I.startsWith("&")?I.replace("&",K):I.startsWith(":")||I.startsWith(".")||I.startsWith("[")?`${K}${I}`:`${K} ${I}`,y=B0(j);if(y)W.push(`${L} { ${v} { ${y} } }`)}continue}let D=$.startsWith("&")?$.replace("&",K):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${K}${$}`:`${K} ${$}`;Q(D,A)}};for(let[K,V]of Object.entries(X))if(K.startsWith(":")||K.startsWith(".")||K.startsWith("["))Q(K,V);else if(V!==null&&typeof V==="object"&&!Array.isArray(V)&&!K.startsWith("@")&&!K.startsWith("--"))Q(K,V);else if(K.startsWith("@")){let B=K.startsWith("@--")?`@media ${J[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K;W.push(`${B} { body { ${B0(V)} } }`)}let G={},z={};for(let[K,V]of Object.entries(X)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("[")||K.startsWith("@"))continue;if(V!==null&&typeof V==="object"&&!Array.isArray(V))continue;if(K.startsWith("--"))G[K]=V;else z[K]=V}let Y=B0(G);if(Y)W.push(`:root { ${Y} }`);let U=B0(z);if(U)W.push(`body { ${U} }`)}if(X1(Z,W,J,"",{n:0}),W.length===0)return"";return`<style>
2
+ import{createRequire as kq}from"node:module";var Tq=Object.create;var{getPrototypeOf:Rq,defineProperty:d1,getOwnPropertyNames:_q}=Object;var Pq=Object.prototype.hasOwnProperty;function jq(Z){return this[Z]}var Eq,Cq,B4=(Z,X,q)=>{var W=Z!=null&&typeof Z==="object";if(W){var Q=X?Eq??=new WeakMap:Cq??=new WeakMap,J=Q.get(Z);if(J)return J}q=Z!=null?Tq(Rq(Z)):{};let z=X||!Z||!Z.__esModule?d1(q,"default",{value:Z,enumerable:!0}):q;for(let Y of _q(Z))if(!Pq.call(z,Y))d1(z,Y,{get:jq.bind(Z,Y),enumerable:!0});if(W)Q.set(Z,z);return z};var E=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var Oq=(Z)=>Z;function xq(Z,X){this[Z]=Oq.bind(null,X)}var f4=(Z,X)=>{for(var q in X)d1(Z,q,{get:X[q],enumerable:!0,configurable:!0,set:xq.bind(X,q)})};var R=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var q0=kq(import.meta.url);function c1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function L6(Z){return p3.has(Z)}function C0(Z,X,q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return Q6(Z,X,q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return bq(Z.$ref,X,q,W);if(Array.isArray(Z))return Z.map((Q)=>C0(Q,X,q,W));return Z}function bq(Z,X,q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let Q=Z.slice(7);return S6(q,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];return Q.length>2?S6(z,Q.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return S6(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return S6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return S6(globalThis.document,Z.slice(10));return X[Z]??null}function vq(Z,X,q,W){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];if(Q.length>2){let U=Q.slice(2),K=U.pop(),V=U.length>0?S6(z,U.join("/")):z;return{key:K,obj:V}}return{key:J==="item"?"$map/item":"$map/index",obj:c1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let z=Q.split("/"),Y=z.pop(),U=X;for(let K of z)U=U[K];return{key:Y,obj:U}}return{key:Z,obj:X}}function Q6(Z,X,q,W){let{operator:Q,target:J,value:z,initial:Y}=Z;if(!Sq.has(Q))throw Error(`$expression: unknown operator "${Q}"`);if(l1.has(Q)&&!("value"in Z)){let U=C0(J,X,q,W);if(Q==="!")return!U;if(Q==="-")return-U}if(p1.has(Q)){let U=C0(J,X,q,W),K=C0(z,X,q,W);switch(Q){case"+":return U+K;case"-":return U-K;case"*":return U*K;case"/":return U/K;case"%":return U%K;case"===":return U===K;case"!==":return U!==K;case"<":return U<K;case"<=":return U<=K;case">":return U>K;case">=":return U>=K;case"&&":return U&&K;case"||":return U||K;default:break}}if(n3.has(Q)){let U=C0(z,X,q,W),{obj:K,key:V}=vq(J.$ref,X,q,W);switch(Q){case"=":{K[V]=U;break}case"+=":{let B=K[V];K[V]=B+U;break}case"-=":{let B=K[V];K[V]=B-U;break}case"*=":{let B=K[V];K[V]=B*U;break}case"/=":{let B=K[V];K[V]=B/U;break}default:break}return}if(i3.has(Q)){let U=C0(J,X,q,W);switch(Q){case"push":return U.push(C0(z,X,q,W));case"unshift":return U.unshift(C0(z,X,q,W));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let K=C0(z,X,q,W);return U.splice(...K)}default:break}}if(n1.has(Q)){let U=C0(J,X,q,W);if(Q==="reduce"){let K=C0(Y,X,q,W);for(let[V,B]of U.entries())K=Q6(z,X,q,{acc:K,index:V,item:B});return K}if(Q==="map")return U.map((K,V)=>Q6(z,X,q,{...W,index:V,item:K}));if(Q==="filter")return U.filter((K,V)=>Q6(z,X,q,{...W,index:V,item:K}))}return}function N0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return T0(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return r3(Z.$ref,X);if(Array.isArray(Z))return Z.map((q)=>N0(q,X)).join(", ");return JSON.stringify(Z)}function r3(Z,X){let q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${W}.${Q.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q;if(J==="item")return Q.length>2?`_item.${Q.slice(2).join(".")}`:"_item";if(J==="index")return"_index";return`_${J}`}if(Z.startsWith("#/state/")){let Q=Z.slice(8);return`${q}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${q}.${Z}`}function l3(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return r3(Z.$ref,X);return N0(Z,X)}function T0(Z,X={}){let{operator:q,target:W,value:Q,initial:J}=Z;if(l1.has(q)&&!("value"in Z)){let z=N0(W,X);if(q==="!")return`!(${z})`;if(q==="-")return`-(${z})`}if(p1.has(q)){let z=N0(W,X),Y=N0(Q,X);return`(${z} ${q} ${Y})`}if(n3.has(q)){let z=l3(W,X),Y=N0(Q,X);return`${z} ${q} ${Y}`}if(i3.has(q)){let z=l3(W,X);switch(q){case"push":return`${z}.push(${N0(Q,X)})`;case"unshift":return`${z}.unshift(${N0(Q,X)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((U)=>N0(U,X)).join(", "):N0(Q,X);return`${z}.splice(${Y})`}default:break}}if(n1.has(q)){let z=N0(W,X),Y=T0(Q,X);if(q==="reduce"){let U=N0(J,X);return`${z}.reduce((_acc, _item, _index) => ${Y}, ${U})`}if(q==="map")return`${z}.map((_item, _index) => ${Y})`;if(q==="filter")return`${z}.filter((_item, _index) => ${Y})`}return"undefined"}function S6(Z,X){let q=Z;for(let W of X.split(/[./]/))q=q?.[W];return q}var p3,l1,p1,n3,i3,n1,Sq;var i1=R(()=>{p3=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),l1=new Set(["!","-"]),p1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),n3=new Set(["=","+=","-=","*=","/="]),i3=new Set(["push","pop","shift","unshift","splice"]),n1=new Set(["reduce","map","filter"]),Sq=new Set([...p3,...l1,...p1,...n1])});function M0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function L0(Z){return M0(Z)&&typeof Z.$ref==="string"}function i0(Z){return M0(Z)&&Z.$prototype==="Function"}function O0(Z){return M0(Z)&&M0(Z.$expression)}function I6(Z){return M0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function r1(Z){return M0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function a3(Z){return M0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function J6(Z){if(!M0(Z))return!1;for(let X of Object.keys(Z))if(!s3.has(X))return!1;return!0}function w6(Z){return M0(Z)&&Z.$prototype==="Array"}function o3(Z){return M0(Z)&&Z.$prototype==="Class"}function x(Z){return typeof Z==="string"&&Z.includes("${")}function z6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var s3;var S0=R(()=>{s3=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function yq(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([X,q])=>!yq(X)&&(q===null||typeof q!=="object")).map(([X,q])=>`${I0(X)}: ${q}`).join("; ")}var D6;var u4=R(()=>{i1();S0();D6=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 o1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(q&&typeof q==="object"&&!Array.isArray(q)&&q.timing==="compiler")continue;if(typeof q!=="object"||q===null||Array.isArray(q))return!0;if(q.$prototype)return!0;if("default"in q)return!0;if(J6(q))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>o1(X)))return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function e3(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function h6(Z,X=null,q={},W={}){let Q=Z?.state?m6(Z.state,X):X??Object.create(null);return{media:W,scope:Q,scopeDefs:q}}function m6(Z={},X=null){let q=Object.create(X??null);for(let[W,Q]of Object.entries(Z)){if(typeof Q!=="object"||Q===null||Array.isArray(Q)){N6(q,W,d4(Q));continue}let J=Q;if("default"in J){N6(q,W,d4(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!J6(J))N6(q,W,d4(J))}for(let[W,Q]of Object.entries(Z)){if(typeof Q==="string"&&x(Q)){a1(q,W,()=>Y0(Q,q));continue}if(!Q||typeof Q!=="object")continue;if(O0(Q)){let J=Q.$expression;if(L6(J.operator))N6(q,W,(z,Y)=>Q6(J,z,Y));else a1(q,W,()=>Q6(J,q,null));continue}if(i0(Q)){if(Q.body){let J=Q.parameters?z6(Q.parameters):Q.arguments??[],z=Function("state",...J,Q.body);if(Q.body.includes("return"))a1(q,W,()=>z(q));else N6(q,W,z)}else N6(q,W,()=>{});continue}if(I6(Q)&&(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage"))N6(q,W,d4(Q.default??null))}return q}function N6(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:q,writable:!0})}function a1(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:q})}function p(Z,X){if(b0(Z))return t1(Z.$ref,X);if(x(Z))return Y0(Z,X);return Z}function b0(Z){return L0(Z)}function t1(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let q=Z.split("/"),[,W]=q,Q=X.$map?.[W]??X[`$map/${W}`];return q.length>2?t3(Q,q.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let q=Z.slice(8),W=q.indexOf("/");if(W===-1)return X[q];return t3(X[q.slice(0,W)],q.slice(W+1))}return X[Z]??null}function Y0(Z,X){try{let q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map",`return (${q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function t3(Z,X){if(!X)return Z;let q=Z;for(let W of X.split("/"))q=q==null?void 0:q[W];return q}function d4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function v6(Z,X){let q="",W=p(Z.id,X),Q=p(Z.className,X),J=p(Z.hidden,X),z=p(Z.tabIndex,X),Y=p(Z.title,X),U=p(Z.lang,X),K=p(Z.dir,X);if(W)q+=` id="${y(String(W))}"`;if(Q)q+=` class="${y(String(Q))}"`;if(J)q+=" hidden";if(z!==void 0&&z!==null)q+=` tabindex="${y(String(z))}"`;if(Y)q+=` title="${y(String(Y))}"`;if(U)q+=` lang="${y(String(U))}"`;if(K)q+=` dir="${y(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&x(H)).map(([B,H])=>{let $=p(H,X);return $==null?null:`${I0(B)}: ${$}`}).filter(Boolean).join("; ");if(V)q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=p(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))q+=` ${V}="${y(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)q+=' loading="lazy"';if(!Z.attributes?.decoding)q+=' decoding="async"'}if(Z.$static)q+=" data-jx-static";else if(Z.$prerendered)q+=" data-jx-prerendered";return q}function f6(Z,X={},q=null){let W=[];if(q&&typeof q==="object"){let J=(V,B)=>{let H=B0(B);if(H)W.push(`${V} { ${H} }`);for(let[$,F]of Object.entries(B)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@")){let A=$.startsWith("@--")?`@media ${X[$.slice(1)]??$.slice(1)}`:$,I=B0(F);if(I)W.push(`${A} { ${V} { ${I} } }`);for(let[M,_]of Object.entries(F)){if(_===null||typeof _!=="object"||Array.isArray(_))continue;if(M.startsWith("@"))continue;let k=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`,b=B0(_);if(b)W.push(`${A} { ${k} { ${b} } }`)}continue}let L=$.startsWith("&")?$.replace("&",V):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${V}${$}`:`${V} ${$}`;J(L,F)}};for(let[V,B]of Object.entries(q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))J(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))J(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${B0(B)} } }`)}let z={},Y={};for(let[V,B]of Object.entries(q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))z[V]=B;else Y[V]=B}let U=B0(z);if(U)W.push(`:root { ${U} }`);let K=B0(Y);if(K)W.push(`body { ${K} }`)}if(G6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
3
3
  ${W.join(`
4
4
  `)}
5
- </style>`}function w7(Z,J,X,W){let q=B0(J);if(q)X.push(`${Z} { ${q} }`);for(let[Q,G]of Object.entries(J)){if(G===null||typeof G!=="object"||Array.isArray(G))continue;if(Q.startsWith("@")){let Y=Q.startsWith("@--")?`@media ${W[Q.slice(1)]??Q.slice(1)}`:Q.startsWith("@(")?`@media ${Q.slice(1)}`:Q,U=B0(G);if(U)X.push(`${Y} { ${Z} { ${U} } }`);for(let[K,V]of Object.entries(G)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@"))continue;let B=K.startsWith("&")?K.replace("&",Z):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Z}${K}`:`${Z} ${K}`,$=B0(V);if($)X.push(`${Y} { ${B} { ${$} } }`)}continue}let z=Q.startsWith("&")?Q.replace("&",Z):Q.startsWith(":")||Q.startsWith(".")||Q.startsWith("[")?`${Z}${Q}`:`${Z} ${Q}`;w7(z,G,X,W)}}function X1(Z,J,X,W="",q={n:0},Q="jx"){if(!Z||typeof Z!=="object")return;if(Z.style){if(!Z.id&&!Z.className)Z.className=`${Q}-${q.n++}`}let G=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let z=[];for(let[Y,U]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(U===null||typeof U==="object")continue;if(typeof U==="string"&&b(U))continue;z.push(` ${I0(Y)}: ${U};`)}if(z.length>0)J.push(`${G} {
6
- ${z.join(`
5
+ </style>`}function Z8(Z,X,q,W){let Q=B0(X);if(Q)q.push(`${Z} { ${Q} }`);for(let[J,z]of Object.entries(X)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(J.startsWith("@")){let U=J.startsWith("@--")?`@media ${W[J.slice(1)]??J.slice(1)}`:J.startsWith("@(")?`@media ${J.slice(1)}`:J,K=B0(z);if(K)q.push(`${U} { ${Z} { ${K} } }`);for(let[V,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(V.startsWith("@"))continue;let H=V.startsWith("&")?V.replace("&",Z):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${Z}${V}`:`${Z} ${V}`,$=B0(B);if($)q.push(`${U} { ${H} { ${$} } }`)}continue}let Y=J.startsWith("&")?J.replace("&",Z):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${Z}${J}`:`${Z} ${J}`;Z8(Y,z,q,W)}}function G6(Z,X,q,W="",Q,J="jx"){let z=Q??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${J}-${z.n}`,z.n+=1;let Y=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let U=[];for(let[K,V]of Object.entries(Z.style)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("&")||K.startsWith("[")||K.startsWith("@"))continue;if(V===null||typeof V==="object")continue;if(typeof V==="string"&&x(V))continue;U.push(` ${I0(K)}: ${V};`)}if(U.length>0)X.push(`${Y} {
6
+ ${U.join(`
7
7
  `)}
8
- }`);for(let[Y,U]of Object.entries(Z.style)){if(U===null||typeof U!=="object"||Array.isArray(U))continue;if(Y.startsWith("@")){let K=Y.startsWith("@--")?`@media ${X[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y,V=B0(U);if(V)J.push(`${K} { ${G} { ${V} } }`);for(let[B,$]of Object.entries(U)){if($===null||typeof $!=="object"||Array.isArray($))continue;if(B.startsWith("@"))continue;let A=B.startsWith("&")?B.replace("&",G):B.startsWith(":")||B.startsWith(".")||B.startsWith("[")?`${G}${B}`:`${G} ${B}`;J.push(`${K} { ${A} { ${B0($)} } }`)}}else{let K=Y.startsWith("&")?Y.replace("&",G):Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("[")?`${G}${Y}`:`${G} ${Y}`;w7(K,U,J,X)}}}if(Array.isArray(Z.children))Z.children.forEach((z)=>{X1(z,J,X,G,q,Q)})}function m(Z){return String(Z).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function C1(Z){return Z.split("-").map((J)=>J.charAt(0).toUpperCase()+J.slice(1)).join("")}function E1(Z){let J=new Map;return N7(Z,J),[...J.values()]}function N7(Z,J){if(!Z||typeof Z!=="object")return;if(Z.state)for(let[X,W]of Object.entries(Z.state)){let q=W;if(q&&typeof q==="object"&&q.timing==="server"&&q.$src&&q.$export&&!q.$prototype)J.set(q.$export,{key:X,exportName:q.$export,src:q.$src})}if(Array.isArray(Z.children))Z.children.forEach((X)=>N7(X,J))}function Z1(Z,J,X=null){if(typeof Z==="string"){if(b(Z)&&J){let G=Y0(Z,J);return G!=null?m(String(G)):m(Z)}return m(Z)}if(typeof Z==="number"||typeof Z==="boolean")return m(String(Z));if(Array.isArray(Z))return Z.map((G)=>Z1(G,J,X)).join(`
9
- `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";let W=Z.tagName??"div";if(W==="slot"&&X!=null)return X;let q=J1(Z,J);if(GJ.has(W))return`<${W}${q}>`;let Q="";if(Z.textContent!==void 0){let G=a(Z.textContent,J);Q=G!=null?m(String(G)):""}else if(Z.innerHTML){let G=a(Z.innerHTML,J);Q=G!=null?String(G):Z.innerHTML}else if(Array.isArray(Z.children))Q=Z.children.map((G)=>Z1(G,J,X)).join(`
10
- `);return`<${W}${q}>${Q}</${W}>`}function T7(Z,J=null,X=null){let W=Z.state??{};if(J){W={...W};for(let[Q,G]of Object.entries(J))if(Q in W){let z=W[Q];if(z&&typeof z==="object"&&!Array.isArray(z)&&"default"in z)W[Q]={...z,default:G};else W[Q]=G}else W[Q]=G}let q=j4(W,null);if(!Array.isArray(Z.children))return"";return Z.children.map((Q)=>Z1(Q,q,X)).join(`
11
- `)}function S6(Z){return O6(Z)}function O6(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every(O6);if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let J of Object.values(Z.state)){if(!J||typeof J!=="object")continue;let X=J;if(X.$prototype)return!1;if(X.$ref)return!1}for(let J of Object.keys(Z))if(J.startsWith("on")&&J!=="observedAttributes")return!1;if(Array.isArray(Z.children)){if(!Z.children.every(O6))return!1}else if(Z.children&&typeof Z.children==="object"){if(Z.children.$prototype)return!1}return!0}function P7(Z,J,X=null,W={}){let q=[];if(J&&typeof J==="object"){let Q=[];for(let[G,z]of Object.entries(J)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(z===null||typeof z==="object")continue;if(typeof z==="string"&&b(z))continue;Q.push(` ${I0(G)}: ${z};`)}if(Q.length>0)q.push(`${Z} {
12
- ${Q.join(`
8
+ }`);for(let[K,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@")){let B=K.startsWith("@--")?`@media ${q[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K,H=B0(V);if(H)X.push(`${B} { ${Y} { ${H} } }`);for(let[$,F]of Object.entries(V)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@"))continue;let L=$.startsWith("&")?$.replace("&",Y):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${Y}${$}`:`${Y} ${$}`;X.push(`${B} { ${L} { ${B0(F)} } }`)}}else{let B=K.startsWith("&")?K.replace("&",Y):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Y}${K}`:`${Y} ${K}`;Z8(B,V,X,q)}}}if(Array.isArray(Z.children))for(let U of Z.children)G6(U,X,q,Y,z,J);if(Z.cases&&typeof Z.cases==="object")for(let U of Object.values(Z.cases))G6(U,X,q,Y,z,J)}function y(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function c4(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function l4(Z){let X=new Map;return X8(Z,X),[...X.values()]}function X8(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[q,W]of Object.entries(Z.state))if(r1(W))X.set(W.$export,{exportName:W.$export,key:q,src:W.$src})}if(Array.isArray(Z.children))for(let q of Z.children)X8(q,X)}function b6(Z,X,q=null){if(typeof Z==="string"){if(x(Z)&&X){let z=Y0(Z,X);return z!=null?y(String(z)):y(Z)}return y(Z)}if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(Array.isArray(Z))return Z.map((z)=>b6(z,X,q)).join(`
9
+ `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",Y=v6(Z,X),U=p(Z.$switch,X),K=U==null?void 0:Z.cases?.[String(U)],V=K!==void 0&&!b0(K)?b6(K,X,q):"";return`<${z}${Y}>${V}</${z}>`}let W=Z.tagName??"div";if(W==="slot"&&q!=null)return q;let Q=v6(Z,X);if(gq.has(W))return`<${W}${Q}>`;let J="";if(Z.textContent!==void 0){let z=p(Z.textContent,X);J=z!=null?y(String(z)):""}else if(Z.innerHTML){let z=p(Z.innerHTML,X);J=z!=null?String(z):Z.innerHTML}else if(Array.isArray(Z.children))J=Z.children.map((z)=>b6(z,X,q)).join(`
10
+ `);return`<${W}${Q}>${J}</${W}>`}function q8(Z,X=null,q=null){let W=Z.state??{};if(X){W={...W};for(let[J,z]of Object.entries(X))if(J in W){let Y=W[J];W[J]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:z}:z}else W[J]=z}let Q=m6(W,null);if(!Array.isArray(Z.children))return"";return Z.children.map((J)=>b6(J,Q,q)).join(`
11
+ `)}function e1(Z){return s1(Z)}function s1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>s1(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 q=X;if(q.$prototype)return!1;if(q.$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)=>s1(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function W8(Z,X,q=null,W={}){let Q=[];if(X&&typeof X==="object"){let J=[];for(let[z,Y]of Object.entries(X)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&x(Y))continue;J.push(` ${I0(z)}: ${Y};`)}if(J.length>0)Q.push(`${Z} {
12
+ ${J.join(`
13
13
  `)}
14
- }`);for(let[G,z]of Object.entries(J))if(G.startsWith("@")){let Y=G.startsWith("@--")?`@media ${W[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G;q.push(`${Y} { ${Z} { ${B0(z)} } }`)}else if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")){let Y=G.startsWith("&")?G.replace("&",Z):`${Z}${G}`;q.push(`${Y} { ${B0(z)} }`)}}if(X&&Array.isArray(X.children)){let Q={n:0};for(let G of X.children)X1(G,q,W,"",Q,Z)}return q.length>0?q.join(`
15
- `)+`
16
- `:""}var N4="https://esm.sh/@vue/reactivity@3.5.32",T4="https://esm.sh/lit-html@3.3.0",QJ,GJ;var U4=O(()=>{j1();C6();QJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"]);GJ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function p0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var YJ,W1=()=>YJ;var R7=O(()=>{YJ=/^win/.test(globalThis.process?globalThis.process.platform:"")});function o(Z,J){let X=new URL(p0(Z),"https://aaa.nonexistanturl.com"),W=new URL(p0(J),X),q=J.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:G,search:z,hash:Y}=W;return G+z+decodeURIComponent(Y)+q}let Q=W.toString()+q;if(Q.includes("#")){let[G,z]=Q.split("#",2);return G+"#"+decodeURIComponent(z||"")}return Q}function K4(){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(),J=Z.slice(-1);if(J==="/"||J==="\\")return Z;else return Z+"/"}return"/"}function j7(Z){let J=UJ.exec(Z||"");if(J)return J[1].toLowerCase();return}function _7(Z){let J=Z.lastIndexOf(".");if(J>=0)return $J(Z.substring(J).toLowerCase());return""}function $J(Z){let J=Z.indexOf("?");if(J>=0)Z=Z.substring(0,J);return Z}function O0(Z){if(!Z)return"#";let J=Z.indexOf("#");if(J>=0)return Z.substring(J);return"#"}function i(Z){if(!Z)return"";let J=Z.indexOf("#");if(J>=0)Z=Z.substring(0,J);return Z}function C7(Z){let J=j7(Z);if(J==="http"||J==="https")return!0;else if(J===void 0)return typeof window<"u";else return!1}function v6(Z){if(!Z||typeof Z!=="string")return!0;let J=Z.trim().toLowerCase();if(!J)return!0;if(J.startsWith("javascript:")||J.startsWith("vbscript:")||J.startsWith("data:"))return!0;if(J.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;let X=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let W=new URL(J.startsWith("//")?"http:"+J:J),q=W.hostname.toLowerCase();for(let G of X)if(q===G||q.startsWith(G)||q.endsWith(G))return!0;if(FJ(q))return!0;let Q=W.port;if(Q&&MJ(parseInt(Q)))return!0}catch{if(J.startsWith("/")&&!J.startsWith("//"))return!1;for(let W of X)if(J.includes(W))return!0}return!1}function FJ(Z){let J=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,X=Z.match(J);if(!X)return!1;let[,W,q,Q,G]=X.map(Number);if(W>255||q>255||Q>255||G>255)return!1;return W===10||W===127||W===172&&q>=16&&q<=31||W===192&&q===168||W===169&&q===254}function MJ(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 O1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let J=j7(Z);return J===void 0||J==="file"}function E7(Z){if(W1()){let J=K4(),X=Z.toUpperCase(),q=p0(J).toUpperCase(),Q=X.includes(q),G=X.includes(q),z=HJ.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(Q||G||z)&&!J.startsWith("http"))Z=((U,K)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+K;else return U+"/"+K})(J,Z);Z=p0(Z)}Z=encodeURI(Z);for(let J of BJ)Z=Z.replace(J[0],J[1]);return Z}function E4(Z,J){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<b6.length;W+=2)Z=Z.replace(b6[W],b6[W+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),W1()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(J)Z="file:///"+Z;else X=!1,Z=W1()?Z:"/"+Z}if(W1()&&!X){if(Z=Z.replace(zJ,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function x1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((J)=>{return J.replace(KJ,"/").replace(VJ,"~")})}var zJ,UJ,KJ,VJ,HJ,BJ,b6,C4=(Z)=>new URL(Z);var $0=O(()=>{R7();zJ=/\//g,UJ=/^(\w{2,}):\/\//i,KJ=/~1/g,VJ=/~0/g,HJ=/^[a-zA-Z]:[\\/]/,BJ=[[/\?/g,"%3F"],[/#/g,"%23"]],b6=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function O7(){let Z={},J=this;for(let X of DJ(J))if(typeof X==="string"){let W=J[X],q=typeof W;if(!AJ.includes(q))Z[X]=W}return Z}function DJ(Z,J=[]){let X=[];while(Z&&Z!==IJ)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(X);for(let q of J.concat(LJ))W.delete(q);return W}function k0(Z){return Z instanceof T0||Z instanceof O4}function g6(Z){if(Z.path===null)Z.path=[];return Z}var AJ,LJ,IJ,T0,O4,P0,k1,C0,S1,b1,y6,x4;var R0=O(()=>{$0();AJ=["function","symbol","undefined"],LJ=["constructor","prototype","__proto__"],IJ=Object.getPrototypeOf({});T0=class T0 extends Error{name;message;source;path;code;constructor(Z,J){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=J,this.path=null}toJSON=O7.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};O4=class O4 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 '${E4(Z.$refs._root$Ref.path)}'`}toJSON=O7.bind(this);static getParserErrors(Z){let J=[];for(let X of Object.values(Z.$refs._$refs))if(X.errors)J.push(...X.errors);return J}get errors(){return O4.getParserErrors(this.files)}};P0=class P0 extends T0{code="EPARSER";name="ParserError";constructor(Z,J){super(`Error parsing ${J}: ${Z}`,J)}};k1=class k1 extends T0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};C0=class C0 extends T0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,J){super(Z.message||`Error reading file "${J}"`,J);if("code"in Z)this.ioErrorCode=String(Z.code)}};S1=class S1 extends T0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};b1=class b1 extends T0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,J,X,W,q){super(`Missing $ref pointer "${O0(J)}". Token "${Z}" does not exist.`,i(J));this.targetToken=Z,this.targetRef=X,this.targetFound=W,this.parentPath=q}};y6=class y6 extends T0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};x4=class x4 extends T0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,J){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,i(J))}}});function z0(Z,J){let X=wJ(J);return X?o(Z,X):Z}function v1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let J=Z.$schema;if(typeof J==="string"&&(J.includes("draft/2019-09/")||J.includes("draft/2020-12/")||J.includes("oas/3.1/")))return!0;let X=Z.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function y1(Z,J,X,W,q=!1){if(!q)return;let Q=new Set,G=(z,Y)=>{if(!z||typeof z!=="object"||ArrayBuffer.isView(z)||Q.has(z))return;Q.add(z);let U=z0(Y,z);if(U!==Y)Z._addAlias(U,z,W,q);for(let K of Object.keys(z))G(z[K],U)};G(X,J)}function wJ(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var V4=O(()=>{$0()});class H4{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,J,X){this.$ref=Z,this.path=J,this.originalPath=X||J,this.scopeBase=Z.path||i(J),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,J,X){let W=H4.parse(this.path,this.originalPath),q=[];if(this.value=k7(Z),this.$ref.dynamicIdScope&&!S7(this.$ref))this.scopeBase=z0(this.scopeBase,this.value);for(let G=0;G<W.length;G++){let z=this.circular,Y=p.isExtended$Ref(this.value);if(g1(this,J,X))this.path=H4.join(this.path,W.slice(G));else if(!z&&this.circular&&Y)this.circular=!1;let U=W[G];if(this.value[U]===void 0||this.value[U]===null&&G===W.length-1){let K=!1;for(let D=W.length-1;D>G;D--){let L=W.slice(G,D+1).join("/");if(this.value[L]!==void 0){this.value=this.value[L],G=D,K=!0;break}}if(K)continue;if(U in this.value&&this.value[U]===null){this.value=h1;continue}this.value=null;let V=this.$ref.path||"",B=this.path.replace(V,""),$=H4.join("",q),A=X?.replace(V,"");throw new b1(U,decodeURI(this.originalPath),B,$,A)}else this.value=this.value[U];if(q.push(U),this.$ref.dynamicIdScope)this.scopeBase=z0(this.scopeBase,this.value)}let Q=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&o(Q,this.value.$ref)!==X)g1(this,J,X);return this}set(Z,J,X){let W=H4.parse(this.path),q;if(W.length===0)return this.value=J,J;if(this.value=k7(Z),this.$ref.dynamicIdScope&&!S7(this.$ref))this.scopeBase=z0(this.scopeBase,this.value);for(let Q=0;Q<W.length-1;Q++){if(g1(this,X),q=W[Q],this.value&&this.value[q]!==void 0)this.value=this.value[q];else this.value=x7(this,q,{});if(this.$ref.dynamicIdScope)this.scopeBase=z0(this.scopeBase,this.value)}return g1(this,X),q=W[W.length-1],x7(this,q,J),Z}static parse(Z,J){let X=O0(Z).substring(1);if(!X)return[];let W=X.split("/");for(let q=0;q<W.length;q++)W[q]=W[q].replace(PJ,"/").replace(RJ,"~");if(W[0]!=="")throw new x4(X,J===void 0?Z:J);return W.slice(1)}static join(Z,J){if(Z.indexOf("#")===-1)Z+="#";J=Array.isArray(J)?J:[J];for(let X=0;X<J.length;X++){let W=J[X];Z+="/"+W.replace(TJ,"~0").replace(NJ,"~1")}return Z}}function g1(Z,J,X){if(p.isAllowed$Ref(Z.value,J)){let W=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,q=o(W,Z.value.$ref);if(q===Z.path&&!jJ(X))Z.circular=!0;else{let Q=Z.$ref.$refs._resolve(q,Z.path,J);if(Q===null)return!1;if(Z.indirections+=Q.indirections+1,p.isExtended$Ref(Z.value))return Z.value=p.dereference(Z.value,Q.value,J),!1;else Z.$ref=Q.$ref,Z.path=Q.path,Z.value=Q.value,Z.scopeBase=Z.$ref.path;return!0}}return}function x7(Z,J,X){if(Z.value&&typeof Z.value==="object")if(J==="-"&&Array.isArray(Z.value))Z.value.push(X);else Z.value[J]=X;else throw new T0(`Error assigning $ref pointer "${Z.path}".
17
- Cannot set "${J}" of a non-object.`);return X}function k7(Z){if(k0(Z))throw Z;return Z}function jJ(Z){return typeof Z=="string"&&H4.parse(Z).length==0}function S7(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var h1,NJ,TJ,PJ,RJ,F0;var q1=O(()=>{k4();$0();R0();V4();h1=Symbol("null"),NJ=/\//g,TJ=/~/g,PJ=/~1/g,RJ=/~0/g;F0=H4});class Q1{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let J=this.errors.map(({footprint:X})=>X);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(g6).filter(({footprint:X})=>!J.includes(X)));else if(!("footprint"in Z)||!J.includes(Z.footprint))this.errors.push(g6(Z))}exists(Z,J){try{return this.resolve(Z,J),!0}catch{return!1}}get(Z,J){return this.resolve(Z,J)?.value}resolve(Z,J,X,W){let q=new F0(this,Z,X);try{let Q=q.resolve(this.value,J,W);if(Q.value===h1)Q.value=null;return Q}catch(Q){if(!J||!J.continueOnError||!k0(Q))throw Q;if(Q.path===null)Q.path=x1(O0(W));if(Q instanceof x4)Q.source=decodeURI(i(W));return this.addError(Q),null}}set(Z,J){let X=new F0(this,Z);if(this.value=X.set(this.value,J),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 Q1.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,J){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!J||J.resolve?.external))return!0}return}static isExtended$Ref(Z){return Q1.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,J,X){if(J&&typeof J==="object"&&Q1.isExtended$Ref(Z)){let W={};for(let Q of Object.keys(Z))if(Q!=="$ref")W[Q]=Z[Q];let q=X?.dereference?.mergeKeys??!0;for(let Q of Object.keys(J)){let G=Q;if(!(G in W))W[G]=J[G];else if(q&&typeof W[G]==="object"&&W[G]!==null&&typeof J[G]==="object"&&J[G]!==null)W[G]=b7(J[G],W[G])}return W}else return J}}function b7(Z,J){if(typeof Z!=="object"||Z===null)return J;if(typeof J!=="object"||J===null)return J;let X=Array.isArray(Z)?[...Z]:{...Z};for(let W of Object.keys(J))if(Array.isArray(J[W]))X[W]=[...J[W]];else if(typeof J[W]==="object"&&J[W]!==null)X[W]=b7(Z[W],J[W]);else X[W]=J[W];return X}var p;var k4=O(()=>{q1();R0();$0();p=Q1});class G1{circular;paths(...Z){return v7(this._$refs,Z.flat()).map((X)=>{return p0(X.decoded)})}values(...Z){let J=this._$refs;return v7(J,Z.flat()).reduce((W,q)=>{return W[p0(q.decoded)]=J[q.encoded].value,W},{})}exists(Z,J){try{return this._resolve(Z,"",J),!0}catch{return!1}}get(Z,J){return this._resolve(Z,"",J).value}set(Z,J){let X=o(this._root$Ref.path,Z),W=this._getRef(X);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
18
- "${i(X)}" not found.`);W.set(X,J)}_get$Ref(Z){return Z=o(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let J=i(Z),X=new p(this);return X.path=J,this._$refs[J]=X,this._root$Ref=this._root$Ref||X,X}_addAlias(Z,J,X,W=!1){let q=i(Z);if(!q||this._$refs[q]||this._aliases[q])return this._$refs[q]||this._aliases[q];let Q=new p(this);return Q.path=q,Q.pathType=X,Q.value=J,Q.dynamicIdScope=W,this._aliases[q]=Q,Q}_resolve(Z,J,X){let W=o(this._root$Ref.path,Z),q=this._getRef(W);if(!q)throw Error(`Error resolving $ref pointer "${Z}".
19
- "${i(W)}" not found.`);return q.resolve(W,X,Z,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let J=i(Z);return this._$refs[J]||this._aliases[J]}}function v7(Z,J){let X=Object.keys(Z);if(J=Array.isArray(J[0])?J[0]:Array.prototype.slice.call(J),J.length>0&&J[0])X=X.filter((W)=>{return J.includes(Z[W].pathType)});return X.map((W)=>{return{encoded:W,decoded:Z[W].pathType==="file"?E4(W,!0):W}})}var y7=O(()=>{k4();$0()});function h6(Z){return Object.keys(Z||{}).filter((J)=>{return typeof Z[J]==="object"}).map((J)=>{return Z[J].name=J,Z[J]})}function m6(Z,J,X,W,q){return Z.filter((Q)=>{return!!g7(Q,J,X,W,q)})}function f6(Z){for(let J of Z)J.order=J.order||Number.MAX_SAFE_INTEGER;return Z.sort((J,X)=>{return J.order-X.order})}async function u6(Z,J,X,W){let q,Q,G=0;return new Promise((z,Y)=>{U();function U(){if(q=Z[G++],!q)return Y(Q);try{let $=g7(q,J,X,K,W);if($&&typeof $.then==="function")$.then(V,B);else if($!==void 0)V($);else if(G===Z.length)throw Error("No promise has been returned or callback has been called.")}catch($){B($)}}function K($,A){if($)B($);else V(A)}function V($){z({plugin:q,result:$})}function B($){Q={plugin:q,error:$},U()}})}function g7(Z,J,X,W,q){let Q=Z[J];if(typeof Q==="function")return Q.apply(Z,[X,W,q]);if(!W){if(Q instanceof RegExp)return Q.test(X.url);else if(typeof Q==="string")return Q===X.extension;else if(Array.isArray(Q))return Q.indexOf(X.extension)!==-1}return Q}async function _J(Z,J,X){let W=typeof Z==="string"?Z:Z.url,q=typeof Z==="string"?void 0:Z.baseUrl,Q=typeof Z==="string"?void 0:Z.reference,G=W.indexOf("#"),z="";if(G>=0)z=W.substring(G),W=W.substring(0,G);if(Q){let K=Q.indexOf("#");if(K>=0)Q=Q.substring(0,K)}let Y=J._add(W),U={url:W,hash:z,extension:_7(W),...Q!==void 0?{reference:Q}:{},...q!==void 0?{baseUrl:q}:{}};try{let K=await CJ(U,X,J);Y.pathType=K.plugin.name,U.data=K.result;let V=await EJ(U,X,J);return Y.value=V.result,Y.dynamicIdScope=v1(Y.value),y1(J,Y.path,Y.value,Y.pathType,Y.dynamicIdScope),V.result}catch(K){if(k0(K))Y.value=K;throw K}}async function CJ(Z,J,X){let W=h6(J.resolve);W=m6(W,"canRead",Z,void 0,X),f6(W);try{return await u6(W,"read",Z,X)}catch(q){if(!q&&J.continueOnError)throw new S1(Z.url);else if(!q||!("error"in q))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:q});else if(q.error instanceof C0)throw q.error;else throw new C0(q,Z.url)}}async function EJ(Z,J,X){let W=h6(J.parse),q=m6(W,"canParse",Z),Q=q.length>0?q:W;f6(Q);try{let G=await u6(Q,"parse",Z,X);if(!G.plugin.allowEmpty&&OJ(G.result))throw SyntaxError(`Error parsing "${Z.url}" as ${G.plugin.name}.
20
- Parsed value is empty`);else return G}catch(G){if(!G&&J.continueOnError)throw new k1(Z.url);else if(G&&G.message&&G.message.startsWith("Error parsing"))throw G;else if(!G||!("error"in G))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:G});else if(G.error instanceof P0)throw G.error;else throw new P0(G.error.message,Z.url)}}function OJ(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 d6=O(()=>{$0();V4();R0();m1=_J});var h7;var m7=O(()=>{R0();h7={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let J=Z.data;if(Buffer.isBuffer(J))J=J.toString();if(typeof J==="string")if(J.trim().length===0)return;else try{return JSON.parse(J)}catch(X){if(this.allowBOM)try{let W=J.indexOf("{");return J=J.slice(W),JSON.parse(J)}catch(W){throw new P0(W.message,Z.url)}throw new P0(X.message,Z.url)}else return J}}});function J3(Z){return typeof Z>"u"||Z===null}function xJ(Z){return typeof Z==="object"&&Z!==null}function kJ(Z){if(Array.isArray(Z))return Z;else if(J3(Z))return[];return[Z]}function SJ(Z,J){var X,W,q,Q;if(J){Q=Object.keys(J);for(X=0,W=Q.length;X<W;X+=1)q=Q[X],Z[q]=J[q]}return Z}function bJ(Z,J){var X="",W;for(W=0;W<J;W+=1)X+=Z;return X}function vJ(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function X3(Z,J){var X="",W=Z.reason||"(unknown reason)";if(!Z.mark)return W;if(Z.mark.name)X+='in "'+Z.mark.name+'" ';if(X+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!J&&Z.mark.snippet)X+=`
14
+ }`);for(let[z,Y]of Object.entries(X))if(z.startsWith("@")){let U=z.startsWith("@--")?`@media ${W[z.slice(1)]??z.slice(1)}`:z.startsWith("@(")?`@media ${z.slice(1)}`:z;Q.push(`${U} { ${Z} { ${B0(Y)} } }`)}else if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")){let U=z.startsWith("&")?z.replace("&",Z):`${Z}${z}`;Q.push(`${U} { ${B0(Y)} }`)}}if(q&&Array.isArray(q.children)){let J={n:0};for(let z of q.children)G6(z,Q,W,"",J,Z)}return Q.length>0?`${Q.join(`
15
+ `)}
16
+ `:""}var y6="https://esm.sh/@vue/reactivity@3.5.32",g6="https://esm.sh/lit-html@3.3.0",gq;var T6=R(()=>{u4();i1();S0();S0();gq=new Set(["input","br","hr","img","meta","link","area","col","source"])});function a0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var hq,H4=()=>hq;var Q8=R(()=>{hq=/^win/.test(globalThis.process?globalThis.process.platform:"")});function r(Z,X){let q=new URL(a0(Z),"https://aaa.nonexistanturl.com"),W=new URL(a0(X),q),Q=X.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:Y,hash:U}=W;return z+Y+decodeURIComponent(U)+Q}let J=W.toString()+Q;if(J.includes("#")){let[z,Y]=J.split("#",2);return z+"#"+decodeURIComponent(Y||"")}return J}function R6(){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 J8(Z){let X=fq.exec(Z||"");if(X)return X[1].toLowerCase();return}function z8(Z){let X=Z.lastIndexOf(".");if(X>=0)return pq(Z.substring(X).toLowerCase());return""}function pq(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function v0(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function n(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function G8(Z){let X=J8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function X5(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;let q=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let W=new URL(X.startsWith("//")?"http:"+X:X),Q=W.hostname.toLowerCase();for(let z of q)if(Q===z||Q.startsWith(z)||Q.endsWith(z))return!0;if(nq(Q))return!0;let J=W.port;if(J&&iq(parseInt(J)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;for(let W of q)if(X.includes(W))return!0}return!1}function nq(Z){let X=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,q=Z.match(X);if(!q)return!1;let[,W,Q,J,z]=q.map(Number);if(W>255||Q>255||J>255||z>255)return!1;return W===10||W===127||W===172&&Q>=16&&Q<=31||W===192&&Q===168||W===169&&Q===254}function iq(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 p4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=J8(Z);return X===void 0||X==="file"}function Y8(Z){if(H4()){let X=R6(),q=Z.toUpperCase(),Q=a0(X).toUpperCase(),J=q.includes(Q),z=q.includes(Q),Y=cq.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(J||z||Y)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=a0(Z)}Z=encodeURI(Z);for(let X of lq)Z=Z.replace(X[0],X[1]);return Z}function d6(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<Z5.length;W+=2)Z=Z.replace(Z5[W],Z5[W+1]);let q=Z.toLowerCase().startsWith("file://");if(q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),H4()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else q=!1,Z=H4()?Z:"/"+Z}if(H4()&&!q){if(Z=Z.replace(mq,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function n4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(uq,"/").replace(dq,"~")})}var mq,fq,uq,dq,cq,lq,Z5,u6=(Z)=>new URL(Z);var H0=R(()=>{Q8();mq=/\//g,fq=/^(\w{2,}):\/\//i,uq=/~1/g,dq=/~0/g,cq=/^[a-zA-Z]:[\\/]/,lq=[[/\?/g,"%3F"],[/#/g,"%23"]],Z5=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function U8(){let Z={},X=this;for(let q of oq(X))if(typeof q==="string"){let W=X[q],Q=typeof W;if(!rq.includes(Q))Z[q]=W}return Z}function oq(Z,X=[]){let q=[];while(Z&&Z!==sq)q=q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(q);for(let Q of X.concat(aq))W.delete(Q);return W}function g0(Z){return Z instanceof R0||Z instanceof c6}function W5(Z){if(Z.path===null)Z.path=[];return Z}var rq,aq,sq,R0,c6,_0,i4,x0,r4,a4,q5,l6;var P0=R(()=>{H0();rq=["function","symbol","undefined"],aq=["constructor","prototype","__proto__"],sq=Object.getPrototypeOf({});R0=class R0 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=U8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};c6=class c6 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 '${d6(Z.$refs._root$Ref.path)}'`}toJSON=U8.bind(this);static getParserErrors(Z){let X=[];for(let q of Object.values(Z.$refs._$refs))if(q.errors)X.push(...q.errors);return X}get errors(){return c6.getParserErrors(this.files)}};_0=class _0 extends R0{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};i4=class i4 extends R0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};x0=class x0 extends R0{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)}};r4=class r4 extends R0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};a4=class a4 extends R0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,q,W,Q){super(`Missing $ref pointer "${v0(X)}". Token "${Z}" does not exist.`,n(X));this.targetToken=Z,this.targetRef=q,this.targetFound=W,this.parentPath=Q}};q5=class q5 extends R0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};l6=class l6 extends R0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,n(X))}}});function U0(Z,X){let q=tq(X);return q?r(Z,q):Z}function s4(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 q=Z.openapi;return typeof q==="string"&&/^3\.1(?:\.|$)/.test(q)}function o4(Z,X,q,W,Q=!1){if(!Q)return;let J=new Set,z=(Y,U)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||J.has(Y))return;J.add(Y);let K=U0(U,Y);if(K!==U)Z._addAlias(K,Y,W,Q);for(let V of Object.keys(Y))z(Y[V],K)};z(q,X)}function tq(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var _6=R(()=>{H0()});class P6{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,q){this.$ref=Z,this.path=X,this.originalPath=q||X,this.scopeBase=Z.path||n(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,q){let W=P6.parse(this.path,this.originalPath),Q=[];if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let z=0;z<W.length;z++){let Y=this.circular,U=d.isExtended$Ref(this.value);if(t4(this,X,q))this.path=P6.join(this.path,W.slice(z));else if(!Y&&this.circular&&U)this.circular=!1;let K=W[z];if(this.value[K]===void 0||this.value[K]===null&&z===W.length-1){let V=!1;for(let L=W.length-1;L>z;L--){let A=W.slice(z,L+1).join("/");if(this.value[A]!==void 0){this.value=this.value[A],z=L,V=!0;break}}if(V)continue;if(K in this.value&&this.value[K]===null){this.value=e4;continue}this.value=null;let B=this.$ref.path||"",H=this.path.replace(B,""),$=P6.join("",Q),F=q?.replace(B,"");throw new a4(K,decodeURI(this.originalPath),H,$,F)}else this.value=this.value[K];if(Q.push(K),this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}let J=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&r(J,this.value.$ref)!==q)t4(this,X,q);return this}set(Z,X,q){let W=P6.parse(this.path),Q;if(W.length===0)return this.value=X,X;if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let J=0;J<W.length-1;J++){if(t4(this,q),Q=W[J],this.value&&this.value[Q]!==void 0)this.value=this.value[Q];else this.value=K8(this,Q,{});if(this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}return t4(this,q),Q=W[W.length-1],K8(this,Q,X),Z}static parse(Z,X){let q=v0(Z).substring(1);if(!q)return[];let W=q.split("/");for(let Q=0;Q<W.length;Q++)W[Q]=W[Q].replace(XW,"/").replace(qW,"~");if(W[0]!=="")throw new l6(q,X===void 0?Z:X);return W.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let q=0;q<X.length;q++){let W=X[q];Z+="/"+W.replace(ZW,"~0").replace(eq,"~1")}return Z}}function t4(Z,X,q){if(d.isAllowed$Ref(Z.value,X)){let W=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,Q=r(W,Z.value.$ref);if(Q===Z.path&&!WW(q))Z.circular=!0;else{let J=Z.$ref.$refs._resolve(Q,Z.path,X);if(J===null)return!1;if(Z.indirections+=J.indirections+1,d.isExtended$Ref(Z.value))return Z.value=d.dereference(Z.value,J.value,X),!1;else Z.$ref=J.$ref,Z.path=J.path,Z.value=J.value,Z.scopeBase=Z.$ref.path;return!0}}return}function K8(Z,X,q){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(q);else Z.value[X]=q;else throw new R0(`Error assigning $ref pointer "${Z.path}".
17
+ Cannot set "${X}" of a non-object.`);return q}function V8(Z){if(g0(Z))throw Z;return Z}function WW(Z){return typeof Z=="string"&&P6.parse(Z).length==0}function B8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var e4,eq,ZW,XW,qW,$0;var $4=R(()=>{p6();H0();P0();_6();e4=Symbol("null"),eq=/\//g,ZW=/~/g,XW=/~1/g,qW=/~0/g;$0=P6});class F4{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:q})=>q);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(W5).filter(({footprint:q})=>!X.includes(q)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(W5(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,q,W){let Q=new $0(this,Z,q);try{let J=Q.resolve(this.value,X,W);if(J.value===e4)J.value=null;return J}catch(J){if(!X||!X.continueOnError||!g0(J))throw J;if(J.path===null)J.path=n4(v0(W));if(J instanceof l6)J.source=decodeURI(n(W));return this.addError(J),null}}set(Z,X){let q=new $0(this,Z);if(this.value=q.set(this.value,X),this.value===e4)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 F4.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 F4.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,q){if(X&&typeof X==="object"&&F4.isExtended$Ref(Z)){let W={};for(let J of Object.keys(Z))if(J!=="$ref")W[J]=Z[J];let Q=q?.dereference?.mergeKeys??!0;for(let J of Object.keys(X)){let z=J;if(!(z in W))W[z]=X[z];else if(Q&&typeof W[z]==="object"&&W[z]!==null&&typeof X[z]==="object"&&X[z]!==null)W[z]=H8(X[z],W[z])}return W}else return X}}function H8(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let q=Array.isArray(Z)?[...Z]:{...Z};for(let W of Object.keys(X))if(Array.isArray(X[W]))q[W]=[...X[W]];else if(typeof X[W]==="object"&&X[W]!==null)q[W]=H8(Z[W],X[W]);else q[W]=X[W];return q}var d;var p6=R(()=>{$4();P0();H0();d=F4});class A4{circular;paths(...Z){return $8(this._$refs,Z.flat()).map((q)=>{return a0(q.decoded)})}values(...Z){let X=this._$refs;return $8(X,Z.flat()).reduce((W,Q)=>{return W[a0(Q.decoded)]=X[Q.encoded].value,W},{})}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 q=r(this._root$Ref.path,Z),W=this._getRef(q);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
18
+ "${n(q)}" not found.`);W.set(q,X)}_get$Ref(Z){return Z=r(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=n(Z),q=new d(this);return q.path=X,this._$refs[X]=q,this._root$Ref=this._root$Ref||q,q}_addAlias(Z,X,q,W=!1){let Q=n(Z);if(!Q||this._$refs[Q]||this._aliases[Q])return this._$refs[Q]||this._aliases[Q];let J=new d(this);return J.path=Q,J.pathType=q,J.value=X,J.dynamicIdScope=W,this._aliases[Q]=J,J}_resolve(Z,X,q){let W=r(this._root$Ref.path,Z),Q=this._getRef(W);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
19
+ "${n(W)}" not found.`);return Q.resolve(W,q,Z,X)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=n(Z);return this._$refs[X]||this._aliases[X]}}function $8(Z,X){let q=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])q=q.filter((W)=>{return X.includes(Z[W].pathType)});return q.map((W)=>{return{encoded:W,decoded:Z[W].pathType==="file"?d6(W,!0):W}})}var F8=R(()=>{p6();H0()});function Q5(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function J5(Z,X,q,W,Q){return Z.filter((J)=>{return!!A8(J,X,q,W,Q)})}function z5(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,q)=>{return X.order-q.order})}async function G5(Z,X,q,W){let Q,J,z=0;return new Promise((Y,U)=>{K();function K(){if(Q=Z[z++],!Q)return U(J);try{let $=A8(Q,X,q,V,W);if($&&typeof $.then==="function")$.then(B,H);else if($!==void 0)B($);else if(z===Z.length)throw Error("No promise has been returned or callback has been called.")}catch($){H($)}}function V($,F){if($)H($);else B(F)}function B($){Y({plugin:Q,result:$})}function H($){J={plugin:Q,error:$},K()}})}function A8(Z,X,q,W,Q){let J=Z[X];if(typeof J==="function")return J.apply(Z,[q,W,Q]);if(!W){if(J instanceof RegExp)return J.test(q.url);else if(typeof J==="string")return J===q.extension;else if(Array.isArray(J))return J.indexOf(q.extension)!==-1}return J}async function QW(Z,X,q){let W=typeof Z==="string"?Z:Z.url,Q=typeof Z==="string"?void 0:Z.baseUrl,J=typeof Z==="string"?void 0:Z.reference,z=W.indexOf("#"),Y="";if(z>=0)Y=W.substring(z),W=W.substring(0,z);if(J){let V=J.indexOf("#");if(V>=0)J=J.substring(0,V)}let U=X._add(W),K={url:W,hash:Y,extension:z8(W),...J!==void 0?{reference:J}:{},...Q!==void 0?{baseUrl:Q}:{}};try{let V=await JW(K,q,X);U.pathType=V.plugin.name,K.data=V.result;let B=await zW(K,q,X);return U.value=B.result,U.dynamicIdScope=s4(U.value),o4(X,U.path,U.value,U.pathType,U.dynamicIdScope),B.result}catch(V){if(g0(V))U.value=V;throw V}}async function JW(Z,X,q){let W=Q5(X.resolve);W=J5(W,"canRead",Z,void 0,q),z5(W);try{return await G5(W,"read",Z,q)}catch(Q){if(!Q&&X.continueOnError)throw new r4(Z.url);else if(!Q||!("error"in Q))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:Q});else if(Q.error instanceof x0)throw Q.error;else throw new x0(Q,Z.url)}}async function zW(Z,X,q){let W=Q5(X.parse),Q=J5(W,"canParse",Z),J=Q.length>0?Q:W;z5(J);try{let z=await G5(J,"parse",Z,q);if(!z.plugin.allowEmpty&&GW(z.result))throw SyntaxError(`Error parsing "${Z.url}" as ${z.plugin.name}.
20
+ Parsed value is empty`);else return z}catch(z){if(!z&&X.continueOnError)throw new i4(Z.url);else if(z&&z.message&&z.message.startsWith("Error parsing"))throw z;else if(!z||!("error"in z))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:z});else if(z.error instanceof _0)throw z.error;else throw new _0(z.error.message,Z.url)}}function GW(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 Z1;var Y5=R(()=>{H0();_6();P0();Z1=QW});var M8;var L8=R(()=>{P0();M8={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(q){if(this.allowBOM)try{let W=X.indexOf("{");return X=X.slice(W),JSON.parse(X)}catch(W){throw new _0(W.message,Z.url)}throw new _0(q.message,Z.url)}else return X}}});function b8(Z){return typeof Z>"u"||Z===null}function YW(Z){return typeof Z==="object"&&Z!==null}function UW(Z){if(Array.isArray(Z))return Z;else if(b8(Z))return[];return[Z]}function KW(Z,X){var q,W,Q,J;if(X){J=Object.keys(X);for(q=0,W=J.length;q<W;q+=1)Q=J[q],Z[Q]=X[Q]}return Z}function VW(Z,X){var q="",W;for(W=0;W<X;W+=1)q+=Z;return q}function BW(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function v8(Z,X){var q="",W=Z.reason||"(unknown reason)";if(!Z.mark)return W;if(Z.mark.name)q+='in "'+Z.mark.name+'" ';if(q+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!X&&Z.mark.snippet)q+=`
21
21
 
22
- `+Z.mark.snippet;return W+" "+X}function z1(Z,J){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=J,this.message=X3(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function c6(Z,J,X,W,q){var Q="",G="",z=Math.floor(q/2)-1;if(W-J>z)Q=" ... ",J=W-z+Q.length;if(X-W>z)G=" ...",X=W+z-G.length;return{str:Q+Z.slice(J,X).replace(/\t/g,"→")+G,pos:W-J+Q.length}}function l6(Z,J){return t.repeat(" ",J-Z.length)+Z}function dJ(Z,J){if(J=Object.create(J||null),!Z.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;var X=/\r?\n|\r|\0/g,W=[0],q=[],Q,G=-1;while(Q=X.exec(Z.buffer))if(q.push(Q.index),W.push(Q.index+Q[0].length),Z.position<=Q.index&&G<0)G=W.length-2;if(G<0)G=W.length-1;var z="",Y,U,K=Math.min(Z.line+J.linesAfter,q.length).toString().length,V=J.maxLength-(J.indent+K+3);for(Y=1;Y<=J.linesBefore;Y++){if(G-Y<0)break;U=c6(Z.buffer,W[G-Y],q[G-Y],Z.position-(W[G]-W[G-Y]),V),z=t.repeat(" ",J.indent)+l6((Z.line-Y+1).toString(),K)+" | "+U.str+`
23
- `+z}U=c6(Z.buffer,W[G],q[G],Z.position,V),z+=t.repeat(" ",J.indent)+l6((Z.line+1).toString(),K)+" | "+U.str+`
24
- `,z+=t.repeat("-",J.indent+K+3+U.pos)+`^
25
- `;for(Y=1;Y<=J.linesAfter;Y++){if(G+Y>=q.length)break;U=c6(Z.buffer,W[G+Y],q[G+Y],Z.position-(W[G]-W[G+Y]),V),z+=t.repeat(" ",J.indent)+l6((Z.line+Y+1).toString(),K)+" | "+U.str+`
26
- `}return z.replace(/\n$/,"")}function nJ(Z){var J={};if(Z!==null)Object.keys(Z).forEach(function(X){Z[X].forEach(function(W){J[String(W)]=X})});return J}function rJ(Z,J){if(J=J||{},Object.keys(J).forEach(function(X){if(lJ.indexOf(X)===-1)throw new U0('Unknown option "'+X+'" is met in definition of "'+Z+'" YAML type.')}),this.options=J,this.tag=Z,this.kind=J.kind||null,this.resolve=J.resolve||function(){return!0},this.construct=J.construct||function(X){return X},this.instanceOf=J.instanceOf||null,this.predicate=J.predicate||null,this.represent=J.represent||null,this.representName=J.representName||null,this.defaultStyle=J.defaultStyle||null,this.multi=J.multi||!1,this.styleAliases=nJ(J.styleAliases||null),pJ.indexOf(this.kind)===-1)throw new U0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function f7(Z,J){var X=[];return Z[J].forEach(function(W){var q=X.length;X.forEach(function(Q,G){if(Q.tag===W.tag&&Q.kind===W.kind&&Q.multi===W.multi)q=G}),X[q]=W}),X}function iJ(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},J,X;function W(q){if(q.multi)Z.multi[q.kind].push(q),Z.multi.fallback.push(q);else Z[q.kind][q.tag]=Z.fallback[q.tag]=q}for(J=0,X=arguments.length;J<X;J+=1)arguments[J].forEach(W);return Z}function n6(Z){return this.extend(Z)}function aJ(Z){if(Z===null)return!0;var J=Z.length;return J===1&&Z==="~"||J===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function sJ(){return null}function oJ(Z){return Z===null}function tJ(Z){if(Z===null)return!1;var J=Z.length;return J===4&&(Z==="true"||Z==="True"||Z==="TRUE")||J===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function eJ(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function ZX(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function JX(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function XX(Z){return 48<=Z&&Z<=55}function WX(Z){return 48<=Z&&Z<=57}function qX(Z){if(Z===null)return!1;var J=Z.length,X=0,W=!1,q;if(!J)return!1;if(q=Z[X],q==="-"||q==="+")q=Z[++X];if(q==="0"){if(X+1===J)return!0;if(q=Z[++X],q==="b"){X++;for(;X<J;X++){if(q=Z[X],q==="_")continue;if(q!=="0"&&q!=="1")return!1;W=!0}return W&&q!=="_"}if(q==="x"){X++;for(;X<J;X++){if(q=Z[X],q==="_")continue;if(!JX(Z.charCodeAt(X)))return!1;W=!0}return W&&q!=="_"}if(q==="o"){X++;for(;X<J;X++){if(q=Z[X],q==="_")continue;if(!XX(Z.charCodeAt(X)))return!1;W=!0}return W&&q!=="_"}}if(q==="_")return!1;for(;X<J;X++){if(q=Z[X],q==="_")continue;if(!WX(Z.charCodeAt(X)))return!1;W=!0}if(!W||q==="_")return!1;return!0}function QX(Z){var J=Z,X=1,W;if(J.indexOf("_")!==-1)J=J.replace(/_/g,"");if(W=J[0],W==="-"||W==="+"){if(W==="-")X=-1;J=J.slice(1),W=J[0]}if(J==="0")return 0;if(W==="0"){if(J[1]==="b")return X*parseInt(J.slice(2),2);if(J[1]==="x")return X*parseInt(J.slice(2),16);if(J[1]==="o")return X*parseInt(J.slice(2),8)}return X*parseInt(J,10)}function GX(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!t.isNegativeZero(Z))}function zX(Z){if(Z===null)return!1;if(!YX.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function UX(Z){var J,X;if(J=Z.replace(/_/g,"").toLowerCase(),X=J[0]==="-"?-1:1,"+-".indexOf(J[0])>=0)J=J.slice(1);if(J===".inf")return X===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(J===".nan")return NaN;return X*parseFloat(J,10)}function VX(Z,J){var X;if(isNaN(Z))switch(J){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(J){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(J){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(Z))return"-0.0";return X=Z.toString(10),KX.test(X)?X.replace("e",".e"):X}function HX(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||t.isNegativeZero(Z))}function BX(Z){if(Z===null)return!1;if($3.exec(Z)!==null)return!0;if(F3.exec(Z)!==null)return!0;return!1}function $X(Z){var J,X,W,q,Q,G,z,Y=0,U=null,K,V,B;if(J=$3.exec(Z),J===null)J=F3.exec(Z);if(J===null)throw Error("Date resolve error");if(X=+J[1],W=+J[2]-1,q=+J[3],!J[4])return new Date(Date.UTC(X,W,q));if(Q=+J[4],G=+J[5],z=+J[6],J[7]){Y=J[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(J[9]){if(K=+J[10],V=+(J[11]||0),U=(K*60+V)*60000,J[9]==="-")U=-U}if(B=new Date(Date.UTC(X,W,q,Q,G,z,Y)),U)B.setTime(B.getTime()-U);return B}function FX(Z){return Z.toISOString()}function MX(Z){return Z==="<<"||Z===null}function AX(Z){if(Z===null)return!1;var J,X,W=0,q=Z.length,Q=o6;for(X=0;X<q;X++){if(J=Q.indexOf(Z.charAt(X)),J>64)continue;if(J<0)return!1;W+=6}return W%8===0}function LX(Z){var J,X,W=Z.replace(/[\r\n=]/g,""),q=W.length,Q=o6,G=0,z=[];for(J=0;J<q;J++){if(J%4===0&&J)z.push(G>>16&255),z.push(G>>8&255),z.push(G&255);G=G<<6|Q.indexOf(W.charAt(J))}if(X=q%4*6,X===0)z.push(G>>16&255),z.push(G>>8&255),z.push(G&255);else if(X===18)z.push(G>>10&255),z.push(G>>2&255);else if(X===12)z.push(G>>4&255);return new Uint8Array(z)}function IX(Z){var J="",X=0,W,q,Q=Z.length,G=o6;for(W=0;W<Q;W++){if(W%3===0&&W)J+=G[X>>18&63],J+=G[X>>12&63],J+=G[X>>6&63],J+=G[X&63];X=(X<<8)+Z[W]}if(q=Q%3,q===0)J+=G[X>>18&63],J+=G[X>>12&63],J+=G[X>>6&63],J+=G[X&63];else if(q===2)J+=G[X>>10&63],J+=G[X>>4&63],J+=G[X<<2&63],J+=G[64];else if(q===1)J+=G[X>>2&63],J+=G[X<<4&63],J+=G[64],J+=G[64];return J}function DX(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function TX(Z){if(Z===null)return!0;var J=[],X,W,q,Q,G,z=Z;for(X=0,W=z.length;X<W;X+=1){if(q=z[X],G=!1,NX.call(q)!=="[object Object]")return!1;for(Q in q)if(wX.call(q,Q))if(!G)G=!0;else return!1;if(!G)return!1;if(J.indexOf(Q)===-1)J.push(Q);else return!1}return!0}function PX(Z){return Z!==null?Z:[]}function jX(Z){if(Z===null)return!0;var J,X,W,q,Q,G=Z;Q=Array(G.length);for(J=0,X=G.length;J<X;J+=1){if(W=G[J],RX.call(W)!=="[object Object]")return!1;if(q=Object.keys(W),q.length!==1)return!1;Q[J]=[q[0],W[q[0]]]}return!0}function _X(Z){if(Z===null)return[];var J,X,W,q,Q,G=Z;Q=Array(G.length);for(J=0,X=G.length;J<X;J+=1)W=G[J],q=Object.keys(W),Q[J]=[q[0],W[q[0]]];return Q}function EX(Z){if(Z===null)return!0;var J,X=Z;for(J in X)if(CX.call(X,J)){if(X[J]!==null)return!1}return!0}function OX(Z){return Z!==null?Z:{}}function d7(Z){return Object.prototype.toString.call(Z)}function S0(Z){return Z===10||Z===13}function B4(Z){return Z===9||Z===32}function M0(Z){return Z===9||Z===32||Z===10||Z===13}function b4(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function vX(Z){var J;if(48<=Z&&Z<=57)return Z-48;if(J=Z|32,97<=J&&J<=102)return J-97+10;return-1}function yX(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function gX(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function c7(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
27
- `:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"…":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function hX(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function j3(Z,J,X){if(J==="__proto__")Object.defineProperty(Z,J,{configurable:!0,enumerable:!0,writable:!0,value:X});else Z[J]=X}function mX(Z,J){this.input=Z,this.filename=J.filename||null,this.schema=J.schema||t6,this.onWarning=J.onWarning||null,this.legacy=J.legacy||!1,this.json=J.json||!1,this.listener=J.listener||null,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.firstTabInLine=-1,this.documents=[]}function E3(Z,J){var X={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return X.snippet=cJ(X),new U0(J,X)}function C(Z,J){throw E3(Z,J)}function d1(Z,J){if(Z.onWarning)Z.onWarning.call(null,E3(Z,J))}function e0(Z,J,X,W){var q,Q,G,z;if(J<X){if(z=Z.input.slice(J,X),W){for(q=0,Q=z.length;q<Q;q+=1)if(G=z.charCodeAt(q),!(G===9||32<=G&&G<=1114111))C(Z,"expected valid JSON character")}else if(kX.test(z))C(Z,"the stream contains non-printable characters");Z.result+=z}}function p7(Z,J,X,W){var q,Q,G,z;if(!t.isObject(X))C(Z,"cannot merge mappings; the provided source object is unacceptable");q=Object.keys(X);for(G=0,z=q.length;G<z;G+=1)if(Q=q[G],!Z4.call(J,Q))j3(J,Q,X[Q]),W[Q]=!0}function v4(Z,J,X,W,q,Q,G,z,Y){var U,K;if(Array.isArray(q)){q=Array.prototype.slice.call(q);for(U=0,K=q.length;U<K;U+=1){if(Array.isArray(q[U]))C(Z,"nested arrays are not supported inside keys");if(typeof q==="object"&&d7(q[U])==="[object Object]")q[U]="[object Object]"}}if(typeof q==="object"&&d7(q)==="[object Object]")q="[object Object]";if(q=String(q),J===null)J={};if(W==="tag:yaml.org,2002:merge")if(Array.isArray(Q))for(U=0,K=Q.length;U<K;U+=1)p7(Z,J,Q[U],X);else p7(Z,J,Q,X);else{if(!Z.json&&!Z4.call(X,q)&&Z4.call(J,q))Z.line=G||Z.line,Z.lineStart=z||Z.lineStart,Z.position=Y||Z.position,C(Z,"duplicated mapping key");j3(J,q,Q),delete X[q]}return J}function e6(Z){var J=Z.input.charCodeAt(Z.position);if(J===10)Z.position++;else if(J===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else C(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function s(Z,J,X){var W=0,q=Z.input.charCodeAt(Z.position);while(q!==0){while(B4(q)){if(q===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;q=Z.input.charCodeAt(++Z.position)}if(J&&q===35)do q=Z.input.charCodeAt(++Z.position);while(q!==10&&q!==13&&q!==0);if(S0(q)){e6(Z),q=Z.input.charCodeAt(Z.position),W++,Z.lineIndent=0;while(q===32)Z.lineIndent++,q=Z.input.charCodeAt(++Z.position)}else break}if(X!==-1&&W!==0&&Z.lineIndent<X)d1(Z,"deficient indentation");return W}function p1(Z){var J=Z.position,X;if(X=Z.input.charCodeAt(J),(X===45||X===46)&&X===Z.input.charCodeAt(J+1)&&X===Z.input.charCodeAt(J+2)){if(J+=3,X=Z.input.charCodeAt(J),X===0||M0(X))return!0}return!1}function Z5(Z,J){if(J===1)Z.result+=" ";else if(J>1)Z.result+=t.repeat(`
28
- `,J-1)}function fX(Z,J,X){var W,q,Q,G,z,Y,U,K,V=Z.kind,B=Z.result,$;if($=Z.input.charCodeAt(Z.position),M0($)||b4($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(q=Z.input.charCodeAt(Z.position+1),M0(q)||X&&b4(q))return!1}Z.kind="scalar",Z.result="",Q=G=Z.position,z=!1;while($!==0){if($===58){if(q=Z.input.charCodeAt(Z.position+1),M0(q)||X&&b4(q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),M0(W))break}else if(Z.position===Z.lineStart&&p1(Z)||X&&b4($))break;else if(S0($))if(Y=Z.line,U=Z.lineStart,K=Z.lineIndent,s(Z,!1,-1),Z.lineIndent>=J){z=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=G,Z.line=Y,Z.lineStart=U,Z.lineIndent=K;break}if(z)e0(Z,Q,G,!1),Z5(Z,Z.line-Y),Q=G=Z.position,z=!1;if(!B4($))G=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(e0(Z,Q,G,!1),Z.result)return!0;return Z.kind=V,Z.result=B,!1}function uX(Z,J){var X,W,q;if(X=Z.input.charCodeAt(Z.position),X!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=q=Z.position;while((X=Z.input.charCodeAt(Z.position))!==0)if(X===39)if(e0(Z,W,Z.position,!0),X=Z.input.charCodeAt(++Z.position),X===39)W=Z.position,Z.position++,q=Z.position;else return!0;else if(S0(X))e0(Z,W,q,!0),Z5(Z,s(Z,!1,J)),W=q=Z.position;else if(Z.position===Z.lineStart&&p1(Z))C(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,q=Z.position;C(Z,"unexpected end of the stream within a single quoted scalar")}function dX(Z,J){var X,W,q,Q,G,z;if(z=Z.input.charCodeAt(Z.position),z!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,X=W=Z.position;while((z=Z.input.charCodeAt(Z.position))!==0)if(z===34)return e0(Z,X,Z.position,!0),Z.position++,!0;else if(z===92){if(e0(Z,X,Z.position,!0),z=Z.input.charCodeAt(++Z.position),S0(z))s(Z,!1,J);else if(z<256&&_3[z])Z.result+=C3[z],Z.position++;else if((G=yX(z))>0){q=G,Q=0;for(;q>0;q--)if(z=Z.input.charCodeAt(++Z.position),(G=vX(z))>=0)Q=(Q<<4)+G;else C(Z,"expected hexadecimal character");Z.result+=hX(Q),Z.position++}else C(Z,"unknown escape sequence");X=W=Z.position}else if(S0(z))e0(Z,X,W,!0),Z5(Z,s(Z,!1,J)),X=W=Z.position;else if(Z.position===Z.lineStart&&p1(Z))C(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,W=Z.position;C(Z,"unexpected end of the stream within a double quoted scalar")}function cX(Z,J){var X=!0,W,q,Q,G=Z.tag,z,Y=Z.anchor,U,K,V,B,$,A=Object.create(null),D,L,w,I;if(I=Z.input.charCodeAt(Z.position),I===91)K=93,$=!1,z=[];else if(I===123)K=125,$=!0,z={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=z;I=Z.input.charCodeAt(++Z.position);while(I!==0){if(s(Z,!0,J),I=Z.input.charCodeAt(Z.position),I===K)return Z.position++,Z.tag=G,Z.anchor=Y,Z.kind=$?"mapping":"sequence",Z.result=z,!0;else if(!X)C(Z,"missed comma between flow collection entries");else if(I===44)C(Z,"expected the node content, but found ','");if(L=D=w=null,V=B=!1,I===63){if(U=Z.input.charCodeAt(Z.position+1),M0(U))V=B=!0,Z.position++,s(Z,!0,J)}if(W=Z.line,q=Z.lineStart,Q=Z.position,y4(Z,J,f1,!1,!0),L=Z.tag,D=Z.result,s(Z,!0,J),I=Z.input.charCodeAt(Z.position),(B||Z.line===W)&&I===58)V=!0,I=Z.input.charCodeAt(++Z.position),s(Z,!0,J),y4(Z,J,f1,!1,!0),w=Z.result;if($)v4(Z,z,A,L,D,w,W,q,Q);else if(V)z.push(v4(Z,null,A,L,D,w,W,q,Q));else z.push(D);if(s(Z,!0,J),I=Z.input.charCodeAt(Z.position),I===44)X=!0,I=Z.input.charCodeAt(++Z.position);else X=!1}C(Z,"unexpected end of the stream within a flow collection")}function lX(Z,J){var X,W,q=p6,Q=!1,G=!1,z=J,Y=0,U=!1,K,V;if(V=Z.input.charCodeAt(Z.position),V===124)W=!1;else if(V===62)W=!0;else return!1;Z.kind="scalar",Z.result="";while(V!==0)if(V=Z.input.charCodeAt(++Z.position),V===43||V===45)if(p6===q)q=V===43?u7:xX;else C(Z,"repeat of a chomping mode identifier");else if((K=gX(V))>=0)if(K===0)C(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!G)z=J+K-1,G=!0;else C(Z,"repeat of an indentation width identifier");else break;if(B4(V)){do V=Z.input.charCodeAt(++Z.position);while(B4(V));if(V===35)do V=Z.input.charCodeAt(++Z.position);while(!S0(V)&&V!==0)}while(V!==0){e6(Z),Z.lineIndent=0,V=Z.input.charCodeAt(Z.position);while((!G||Z.lineIndent<z)&&V===32)Z.lineIndent++,V=Z.input.charCodeAt(++Z.position);if(!G&&Z.lineIndent>z)z=Z.lineIndent;if(S0(V)){Y++;continue}if(Z.lineIndent<z){if(q===u7)Z.result+=t.repeat(`
29
- `,Q?1+Y:Y);else if(q===p6){if(Q)Z.result+=`
30
- `}break}if(W)if(B4(V))U=!0,Z.result+=t.repeat(`
31
- `,Q?1+Y:Y);else if(U)U=!1,Z.result+=t.repeat(`
32
- `,Y+1);else if(Y===0){if(Q)Z.result+=" "}else Z.result+=t.repeat(`
33
- `,Y);else Z.result+=t.repeat(`
34
- `,Q?1+Y:Y);Q=!0,G=!0,Y=0,X=Z.position;while(!S0(V)&&V!==0)V=Z.input.charCodeAt(++Z.position);e0(Z,X,Z.position,!1)}return!0}function n7(Z,J){var X,W=Z.tag,q=Z.anchor,Q=[],G,z=!1,Y;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Q;Y=Z.input.charCodeAt(Z.position);while(Y!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,C(Z,"tab characters must not be used in indentation");if(Y!==45)break;if(G=Z.input.charCodeAt(Z.position+1),!M0(G))break;if(z=!0,Z.position++,s(Z,!0,-1)){if(Z.lineIndent<=J){Q.push(null),Y=Z.input.charCodeAt(Z.position);continue}}if(X=Z.line,y4(Z,J,T3,!1,!0),Q.push(Z.result),s(Z,!0,-1),Y=Z.input.charCodeAt(Z.position),(Z.line===X||Z.lineIndent>J)&&Y!==0)C(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<J)break}if(z)return Z.tag=W,Z.anchor=q,Z.kind="sequence",Z.result=Q,!0;return!1}function pX(Z,J,X){var W,q,Q,G,z,Y,U=Z.tag,K=Z.anchor,V={},B=Object.create(null),$=null,A=null,D=null,L=!1,w=!1,I;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=V;I=Z.input.charCodeAt(Z.position);while(I!==0){if(!L&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,C(Z,"tab characters must not be used in indentation");if(W=Z.input.charCodeAt(Z.position+1),Q=Z.line,(I===63||I===58)&&M0(W)){if(I===63){if(L)v4(Z,V,B,$,A,null,G,z,Y),$=A=D=null;w=!0,L=!0,q=!0}else if(L)L=!1,q=!0;else C(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,I=W}else{if(G=Z.line,z=Z.lineStart,Y=Z.position,!y4(Z,X,N3,!1,!0))break;if(Z.line===Q){I=Z.input.charCodeAt(Z.position);while(B4(I))I=Z.input.charCodeAt(++Z.position);if(I===58){if(I=Z.input.charCodeAt(++Z.position),!M0(I))C(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(L)v4(Z,V,B,$,A,null,G,z,Y),$=A=D=null;w=!0,L=!1,q=!1,$=Z.tag,A=Z.result}else if(w)C(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=U,Z.anchor=K,!0}else if(w)C(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=U,Z.anchor=K,!0}if(Z.line===Q||Z.lineIndent>J){if(L)G=Z.line,z=Z.lineStart,Y=Z.position;if(y4(Z,J,u1,!0,q))if(L)A=Z.result;else D=Z.result;if(!L)v4(Z,V,B,$,A,D,G,z,Y),$=A=D=null;s(Z,!0,-1),I=Z.input.charCodeAt(Z.position)}if((Z.line===Q||Z.lineIndent>J)&&I!==0)C(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<J)break}if(L)v4(Z,V,B,$,A,null,G,z,Y);if(w)Z.tag=U,Z.anchor=K,Z.kind="mapping",Z.result=V;return w}function nX(Z){var J,X=!1,W=!1,q,Q,G;if(G=Z.input.charCodeAt(Z.position),G!==33)return!1;if(Z.tag!==null)C(Z,"duplication of a tag property");if(G=Z.input.charCodeAt(++Z.position),G===60)X=!0,G=Z.input.charCodeAt(++Z.position);else if(G===33)W=!0,q="!!",G=Z.input.charCodeAt(++Z.position);else q="!";if(J=Z.position,X){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&G!==62);if(Z.position<Z.length)Q=Z.input.slice(J,Z.position),G=Z.input.charCodeAt(++Z.position);else C(Z,"unexpected end of the stream within a verbatim tag")}else{while(G!==0&&!M0(G)){if(G===33)if(!W){if(q=Z.input.slice(J-1,Z.position+1),!P3.test(q))C(Z,"named tag handle cannot contain such characters");W=!0,J=Z.position+1}else C(Z,"tag suffix cannot contain exclamation marks");G=Z.input.charCodeAt(++Z.position)}if(Q=Z.input.slice(J,Z.position),bX.test(Q))C(Z,"tag suffix cannot contain flow indicator characters")}if(Q&&!R3.test(Q))C(Z,"tag name cannot contain such characters: "+Q);try{Q=decodeURIComponent(Q)}catch(z){C(Z,"tag name is malformed: "+Q)}if(X)Z.tag=Q;else if(Z4.call(Z.tagMap,q))Z.tag=Z.tagMap[q]+Q;else if(q==="!")Z.tag="!"+Q;else if(q==="!!")Z.tag="tag:yaml.org,2002:"+Q;else C(Z,'undeclared tag handle "'+q+'"');return!0}function rX(Z){var J,X;if(X=Z.input.charCodeAt(Z.position),X!==38)return!1;if(Z.anchor!==null)C(Z,"duplication of an anchor property");X=Z.input.charCodeAt(++Z.position),J=Z.position;while(X!==0&&!M0(X)&&!b4(X))X=Z.input.charCodeAt(++Z.position);if(Z.position===J)C(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(J,Z.position),!0}function iX(Z){var J,X,W;if(W=Z.input.charCodeAt(Z.position),W!==42)return!1;W=Z.input.charCodeAt(++Z.position),J=Z.position;while(W!==0&&!M0(W)&&!b4(W))W=Z.input.charCodeAt(++Z.position);if(Z.position===J)C(Z,"name of an alias node must contain at least one character");if(X=Z.input.slice(J,Z.position),!Z4.call(Z.anchorMap,X))C(Z,'unidentified alias "'+X+'"');return Z.result=Z.anchorMap[X],s(Z,!0,-1),!0}function y4(Z,J,X,W,q){var Q,G,z,Y=1,U=!1,K=!1,V,B,$,A,D,L;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,Q=G=z=u1===X||T3===X,W){if(s(Z,!0,-1)){if(U=!0,Z.lineIndent>J)Y=1;else if(Z.lineIndent===J)Y=0;else if(Z.lineIndent<J)Y=-1}}if(Y===1)while(nX(Z)||rX(Z))if(s(Z,!0,-1)){if(U=!0,z=Q,Z.lineIndent>J)Y=1;else if(Z.lineIndent===J)Y=0;else if(Z.lineIndent<J)Y=-1}else z=!1;if(z)z=U||q;if(Y===1||u1===X){if(f1===X||N3===X)D=J;else D=J+1;if(L=Z.position-Z.lineStart,Y===1)if(z&&(n7(Z,L)||pX(Z,L,D))||cX(Z,D))K=!0;else{if(G&&lX(Z,D)||uX(Z,D)||dX(Z,D))K=!0;else if(iX(Z)){if(K=!0,Z.tag!==null||Z.anchor!==null)C(Z,"alias node should not have any properties")}else if(fX(Z,D,f1===X)){if(K=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Y===0)K=z&&n7(Z,L)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")C(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(V=0,B=Z.implicitTypes.length;V<B;V+=1)if(A=Z.implicitTypes[V],A.resolve(Z.result)){if(Z.result=A.construct(Z.result),Z.tag=A.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(Z4.call(Z.typeMap[Z.kind||"fallback"],Z.tag))A=Z.typeMap[Z.kind||"fallback"][Z.tag];else{A=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(V=0,B=$.length;V<B;V+=1)if(Z.tag.slice(0,$[V].tag.length)===$[V].tag){A=$[V];break}}if(!A)C(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&A.kind!==Z.kind)C(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+A.kind+'", not "'+Z.kind+'"');if(!A.resolve(Z.result,Z.tag))C(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=A.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||K}function aX(Z){var J=Z.position,X,W,q,Q=!1,G;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((G=Z.input.charCodeAt(Z.position))!==0){if(s(Z,!0,-1),G=Z.input.charCodeAt(Z.position),Z.lineIndent>0||G!==37)break;Q=!0,G=Z.input.charCodeAt(++Z.position),X=Z.position;while(G!==0&&!M0(G))G=Z.input.charCodeAt(++Z.position);if(W=Z.input.slice(X,Z.position),q=[],W.length<1)C(Z,"directive name must not be less than one character in length");while(G!==0){while(B4(G))G=Z.input.charCodeAt(++Z.position);if(G===35){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&!S0(G));break}if(S0(G))break;X=Z.position;while(G!==0&&!M0(G))G=Z.input.charCodeAt(++Z.position);q.push(Z.input.slice(X,Z.position))}if(G!==0)e6(Z);if(Z4.call(l7,W))l7[W](Z,W,q);else d1(Z,'unknown document directive "'+W+'"')}if(s(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,s(Z,!0,-1);else if(Q)C(Z,"directives end mark is expected");if(y4(Z,Z.lineIndent-1,u1,!1,!0),s(Z,!0,-1),Z.checkLineBreaks&&SX.test(Z.input.slice(J,Z.position)))d1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&p1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,s(Z,!0,-1);return}if(Z.position<Z.length-1)C(Z,"end of the stream or a document separator is expected");else return}function O3(Z,J){if(Z=String(Z),J=J||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
35
- `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var X=new mX(Z,J),W=Z.indexOf("\x00");if(W!==-1)X.position=W,C(X,"null byte is not allowed in input");X.input+="\x00";while(X.input.charCodeAt(X.position)===32)X.lineIndent+=1,X.position+=1;while(X.position<X.length-1)aX(X);return X.documents}function sX(Z,J,X){if(J!==null&&typeof J==="object"&&typeof X>"u")X=J,J=null;var W=O3(Z,X);if(typeof J!=="function")return W;for(var q=0,Q=W.length;q<Q;q+=1)J(W[q])}function oX(Z,J){var X=O3(Z,J);if(X.length===0)return;else if(X.length===1)return X[0];throw new U0("expected a single document in the stream, but found more")}function LW(Z,J){var X,W,q,Q,G,z,Y;if(J===null)return{};X={},W=Object.keys(J);for(q=0,Q=W.length;q<Q;q+=1){if(G=W[q],z=String(J[G]),G.slice(0,2)==="!!")G="tag:yaml.org,2002:"+G.slice(2);if(Y=Z.compiledTypeMap.fallback[G],Y&&S3.call(Y.styleAliases,z))z=Y.styleAliases[z];X[G]=z}return X}function IW(Z){var J,X,W;if(J=Z.toString(16).toUpperCase(),Z<=255)X="x",W=2;else if(Z<=65535)X="u",W=4;else if(Z<=4294967295)X="U",W=8;else throw new U0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+X+t.repeat("0",W-J.length)+J}function wW(Z){this.schema=Z.schema||t6,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=t.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=LW(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?K1:DW,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function r7(Z,J){var X=t.repeat(" ",J),W=0,q=-1,Q="",G,z=Z.length;while(W<z){if(q=Z.indexOf(`
36
- `,W),q===-1)G=Z.slice(W),W=z;else G=Z.slice(W,q+1),W=q+1;if(G.length&&G!==`
37
- `)Q+=X;Q+=G}return Q}function i6(Z,J){return`
38
- `+t.repeat(" ",Z.indent*J)}function NW(Z,J){var X,W,q;for(X=0,W=Z.implicitTypes.length;X<W;X+=1)if(q=Z.implicitTypes[X],q.resolve(J))return!0;return!1}function l1(Z){return Z===XW||Z===ZW}function V1(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==J5||65536<=Z&&Z<=1114111}function i7(Z){return V1(Z)&&Z!==J5&&Z!==JW&&Z!==U1}function a7(Z,J,X){var W=i7(Z),q=W&&!l1(Z);return(X?W:W&&Z!==b3&&Z!==v3&&Z!==y3&&Z!==g3&&Z!==h3)&&Z!==r6&&!(J===c1&&!q)||i7(J)&&!l1(J)&&Z===r6||J===c1&&q}function TW(Z){return V1(Z)&&Z!==J5&&!l1(Z)&&Z!==UW&&Z!==HW&&Z!==c1&&Z!==b3&&Z!==v3&&Z!==y3&&Z!==g3&&Z!==h3&&Z!==r6&&Z!==GW&&Z!==zW&&Z!==WW&&Z!==FW&&Z!==KW&&Z!==VW&&Z!==YW&&Z!==qW&&Z!==QW&&Z!==BW&&Z!==$W}function PW(Z){return!l1(Z)&&Z!==c1}function Y1(Z,J){var X=Z.charCodeAt(J),W;if(X>=55296&&X<=56319&&J+1<Z.length){if(W=Z.charCodeAt(J+1),W>=56320&&W<=57343)return(X-55296)*1024+W-56320+65536}return X}function m3(Z){var J=/^\n* /;return J.test(Z)}function RW(Z,J,X,W,q,Q,G,z){var Y,U=0,K=null,V=!1,B=!1,$=W!==-1,A=-1,D=TW(Y1(Z,0))&&PW(Y1(Z,Z.length-1));if(J||G)for(Y=0;Y<Z.length;U>=65536?Y+=2:Y++){if(U=Y1(Z,Y),!V1(U))return S4;D=D&&a7(U,K,z),K=U}else{for(Y=0;Y<Z.length;U>=65536?Y+=2:Y++){if(U=Y1(Z,Y),U===U1){if(V=!0,$)B=B||Y-A-1>W&&Z[A+1]!==" ",A=Y}else if(!V1(U))return S4;D=D&&a7(U,K,z),K=U}B=B||$&&(Y-A-1>W&&Z[A+1]!==" ")}if(!V&&!B){if(D&&!G&&!q(Z))return f3;return Q===K1?S4:a6}if(X>9&&m3(Z))return S4;if(!G)return B?d3:u3;return Q===K1?S4:a6}function jW(Z,J,X,W,q){Z.dump=function(){if(J.length===0)return Z.quotingType===K1?'""':"''";if(!Z.noCompatMode){if(MW.indexOf(J)!==-1||AW.test(J))return Z.quotingType===K1?'"'+J+'"':"'"+J+"'"}var Q=Z.indent*Math.max(1,X),G=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-Q),z=W||Z.flowLevel>-1&&X>=Z.flowLevel;function Y(U){return NW(Z,U)}switch(RW(J,z,Z.indent,G,Y,Z.quotingType,Z.forceQuotes&&!W,q)){case f3:return J;case a6:return"'"+J.replace(/'/g,"''")+"'";case u3:return"|"+s7(J,Z.indent)+o7(r7(J,Q));case d3:return">"+s7(J,Z.indent)+o7(r7(_W(J,G),Q));case S4:return'"'+CW(J)+'"';default:throw new U0("impossible error: invalid scalar style")}}()}function s7(Z,J){var X=m3(Z)?String(J):"",W=Z[Z.length-1]===`
39
- `,q=W&&(Z[Z.length-2]===`
22
+ `+Z.mark.snippet;return W+" "+q}function L4(Z,X){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=X,this.message=v8(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function U5(Z,X,q,W,Q){var J="",z="",Y=Math.floor(Q/2)-1;if(W-X>Y)J=" ... ",X=W-Y+J.length;if(q-W>Y)z=" ...",q=W+Y-z.length;return{str:J+Z.slice(X,q).replace(/\t/g,"→")+z,pos:W-X+J.length}}function K5(Z,X){return a.repeat(" ",X-Z.length)+Z}function IW(Z,X){if(X=Object.create(X||null),!Z.buffer)return null;if(!X.maxLength)X.maxLength=79;if(typeof X.indent!=="number")X.indent=1;if(typeof X.linesBefore!=="number")X.linesBefore=3;if(typeof X.linesAfter!=="number")X.linesAfter=2;var q=/\r?\n|\r|\0/g,W=[0],Q=[],J,z=-1;while(J=q.exec(Z.buffer))if(Q.push(J.index),W.push(J.index+J[0].length),Z.position<=J.index&&z<0)z=W.length-2;if(z<0)z=W.length-1;var Y="",U,K,V=Math.min(Z.line+X.linesAfter,Q.length).toString().length,B=X.maxLength-(X.indent+V+3);for(U=1;U<=X.linesBefore;U++){if(z-U<0)break;K=U5(Z.buffer,W[z-U],Q[z-U],Z.position-(W[z]-W[z-U]),B),Y=a.repeat(" ",X.indent)+K5((Z.line-U+1).toString(),V)+" | "+K.str+`
23
+ `+Y}K=U5(Z.buffer,W[z],Q[z],Z.position,B),Y+=a.repeat(" ",X.indent)+K5((Z.line+1).toString(),V)+" | "+K.str+`
24
+ `,Y+=a.repeat("-",X.indent+V+3+K.pos)+`^
25
+ `;for(U=1;U<=X.linesAfter;U++){if(z+U>=Q.length)break;K=U5(Z.buffer,W[z+U],Q[z+U],Z.position-(W[z]-W[z+U]),B),Y+=a.repeat(" ",X.indent)+K5((Z.line+U+1).toString(),V)+" | "+K.str+`
26
+ `}return Y.replace(/\n$/,"")}function TW(Z){var X={};if(Z!==null)Object.keys(Z).forEach(function(q){Z[q].forEach(function(W){X[String(W)]=q})});return X}function RW(Z,X){if(X=X||{},Object.keys(X).forEach(function(q){if(DW.indexOf(q)===-1)throw new K0('Unknown option "'+q+'" is met in definition of "'+Z+'" YAML type.')}),this.options=X,this.tag=Z,this.kind=X.kind||null,this.resolve=X.resolve||function(){return!0},this.construct=X.construct||function(q){return q},this.instanceOf=X.instanceOf||null,this.predicate=X.predicate||null,this.represent=X.represent||null,this.representName=X.representName||null,this.defaultStyle=X.defaultStyle||null,this.multi=X.multi||!1,this.styleAliases=TW(X.styleAliases||null),NW.indexOf(this.kind)===-1)throw new K0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function I8(Z,X){var q=[];return Z[X].forEach(function(W){var Q=q.length;q.forEach(function(J,z){if(J.tag===W.tag&&J.kind===W.kind&&J.multi===W.multi)Q=z}),q[Q]=W}),q}function _W(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},X,q;function W(Q){if(Q.multi)Z.multi[Q.kind].push(Q),Z.multi.fallback.push(Q);else Z[Q.kind][Q.tag]=Z.fallback[Q.tag]=Q}for(X=0,q=arguments.length;X<q;X+=1)arguments[X].forEach(W);return Z}function B5(Z){return this.extend(Z)}function PW(Z){if(Z===null)return!0;var X=Z.length;return X===1&&Z==="~"||X===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function jW(){return null}function EW(Z){return Z===null}function CW(Z){if(Z===null)return!1;var X=Z.length;return X===4&&(Z==="true"||Z==="True"||Z==="TRUE")||X===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function OW(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function xW(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function kW(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function SW(Z){return 48<=Z&&Z<=55}function bW(Z){return 48<=Z&&Z<=57}function vW(Z){if(Z===null)return!1;var X=Z.length,q=0,W=!1,Q;if(!X)return!1;if(Q=Z[q],Q==="-"||Q==="+")Q=Z[++q];if(Q==="0"){if(q+1===X)return!0;if(Q=Z[++q],Q==="b"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(Q!=="0"&&Q!=="1")return!1;W=!0}return W&&Q!=="_"}if(Q==="x"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!kW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}if(Q==="o"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!SW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}}if(Q==="_")return!1;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!bW(Z.charCodeAt(q)))return!1;W=!0}if(!W||Q==="_")return!1;return!0}function yW(Z){var X=Z,q=1,W;if(X.indexOf("_")!==-1)X=X.replace(/_/g,"");if(W=X[0],W==="-"||W==="+"){if(W==="-")q=-1;X=X.slice(1),W=X[0]}if(X==="0")return 0;if(W==="0"){if(X[1]==="b")return q*parseInt(X.slice(2),2);if(X[1]==="x")return q*parseInt(X.slice(2),16);if(X[1]==="o")return q*parseInt(X.slice(2),8)}return q*parseInt(X,10)}function gW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!a.isNegativeZero(Z))}function mW(Z){if(Z===null)return!1;if(!hW.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function fW(Z){var X,q;if(X=Z.replace(/_/g,"").toLowerCase(),q=X[0]==="-"?-1:1,"+-".indexOf(X[0])>=0)X=X.slice(1);if(X===".inf")return q===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(X===".nan")return NaN;return q*parseFloat(X,10)}function dW(Z,X){var q;if(isNaN(Z))switch(X){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(X){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(X){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(Z))return"-0.0";return q=Z.toString(10),uW.test(q)?q.replace("e",".e"):q}function cW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||a.isNegativeZero(Z))}function lW(Z){if(Z===null)return!1;if(i8.exec(Z)!==null)return!0;if(r8.exec(Z)!==null)return!0;return!1}function pW(Z){var X,q,W,Q,J,z,Y,U=0,K=null,V,B,H;if(X=i8.exec(Z),X===null)X=r8.exec(Z);if(X===null)throw Error("Date resolve error");if(q=+X[1],W=+X[2]-1,Q=+X[3],!X[4])return new Date(Date.UTC(q,W,Q));if(J=+X[4],z=+X[5],Y=+X[6],X[7]){U=X[7].slice(0,3);while(U.length<3)U+="0";U=+U}if(X[9]){if(V=+X[10],B=+(X[11]||0),K=(V*60+B)*60000,X[9]==="-")K=-K}if(H=new Date(Date.UTC(q,W,Q,J,z,Y,U)),K)H.setTime(H.getTime()-K);return H}function nW(Z){return Z.toISOString()}function iW(Z){return Z==="<<"||Z===null}function rW(Z){if(Z===null)return!1;var X,q,W=0,Q=Z.length,J=M5;for(q=0;q<Q;q++){if(X=J.indexOf(Z.charAt(q)),X>64)continue;if(X<0)return!1;W+=6}return W%8===0}function aW(Z){var X,q,W=Z.replace(/[\r\n=]/g,""),Q=W.length,J=M5,z=0,Y=[];for(X=0;X<Q;X++){if(X%4===0&&X)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);z=z<<6|J.indexOf(W.charAt(X))}if(q=Q%4*6,q===0)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);else if(q===18)Y.push(z>>10&255),Y.push(z>>2&255);else if(q===12)Y.push(z>>4&255);return new Uint8Array(Y)}function sW(Z){var X="",q=0,W,Q,J=Z.length,z=M5;for(W=0;W<J;W++){if(W%3===0&&W)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];q=(q<<8)+Z[W]}if(Q=J%3,Q===0)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];else if(Q===2)X+=z[q>>10&63],X+=z[q>>4&63],X+=z[q<<2&63],X+=z[64];else if(Q===1)X+=z[q>>2&63],X+=z[q<<4&63],X+=z[64],X+=z[64];return X}function oW(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function ZQ(Z){if(Z===null)return!0;var X=[],q,W,Q,J,z,Y=Z;for(q=0,W=Y.length;q<W;q+=1){if(Q=Y[q],z=!1,eW.call(Q)!=="[object Object]")return!1;for(J in Q)if(tW.call(Q,J))if(!z)z=!0;else return!1;if(!z)return!1;if(X.indexOf(J)===-1)X.push(J);else return!1}return!0}function XQ(Z){return Z!==null?Z:[]}function WQ(Z){if(Z===null)return!0;var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1){if(W=z[X],qQ.call(W)!=="[object Object]")return!1;if(Q=Object.keys(W),Q.length!==1)return!1;J[X]=[Q[0],W[Q[0]]]}return!0}function QQ(Z){if(Z===null)return[];var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1)W=z[X],Q=Object.keys(W),J[X]=[Q[0],W[Q[0]]];return J}function zQ(Z){if(Z===null)return!0;var X,q=Z;for(X in q)if(JQ.call(q,X)){if(q[X]!==null)return!1}return!0}function GQ(Z){return Z!==null?Z:{}}function D8(Z){return Object.prototype.toString.call(Z)}function h0(Z){return Z===10||Z===13}function j6(Z){return Z===9||Z===32}function F0(Z){return Z===9||Z===32||Z===10||Z===13}function i6(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function BQ(Z){var X;if(48<=Z&&Z<=57)return Z-48;if(X=Z|32,97<=X&&X<=102)return X-97+10;return-1}function HQ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function $Q(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function N8(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
27
+ `:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"…":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function FQ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function J9(Z,X,q){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:q});else Z[X]=q}function AQ(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||L5,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,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.firstTabInLine=-1,this.documents=[]}function Y9(Z,X){var q={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return q.snippet=wW(q),new K0(X,q)}function P(Z,X){throw Y9(Z,X)}function W1(Z,X){if(Z.onWarning)Z.onWarning.call(null,Y9(Z,X))}function U6(Z,X,q,W){var Q,J,z,Y;if(X<q){if(Y=Z.input.slice(X,q),W){for(Q=0,J=Y.length;Q<J;Q+=1)if(z=Y.charCodeAt(Q),!(z===9||32<=z&&z<=1114111))P(Z,"expected valid JSON character")}else if(UQ.test(Y))P(Z,"the stream contains non-printable characters");Z.result+=Y}}function R8(Z,X,q,W){var Q,J,z,Y;if(!a.isObject(q))P(Z,"cannot merge mappings; the provided source object is unacceptable");Q=Object.keys(q);for(z=0,Y=Q.length;z<Y;z+=1)if(J=Q[z],!K6.call(X,J))J9(X,J,q[J]),W[J]=!0}function r6(Z,X,q,W,Q,J,z,Y,U){var K,V;if(Array.isArray(Q)){Q=Array.prototype.slice.call(Q);for(K=0,V=Q.length;K<V;K+=1){if(Array.isArray(Q[K]))P(Z,"nested arrays are not supported inside keys");if(typeof Q==="object"&&D8(Q[K])==="[object Object]")Q[K]="[object Object]"}}if(typeof Q==="object"&&D8(Q)==="[object Object]")Q="[object Object]";if(Q=String(Q),X===null)X={};if(W==="tag:yaml.org,2002:merge")if(Array.isArray(J))for(K=0,V=J.length;K<V;K+=1)R8(Z,X,J[K],q);else R8(Z,X,J,q);else{if(!Z.json&&!K6.call(q,Q)&&K6.call(X,Q))Z.line=z||Z.line,Z.lineStart=Y||Z.lineStart,Z.position=U||Z.position,P(Z,"duplicated mapping key");J9(X,Q,J),delete q[Q]}return X}function I5(Z){var X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else P(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function i(Z,X,q){var W=0,Q=Z.input.charCodeAt(Z.position);while(Q!==0){while(j6(Q)){if(Q===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;Q=Z.input.charCodeAt(++Z.position)}if(X&&Q===35)do Q=Z.input.charCodeAt(++Z.position);while(Q!==10&&Q!==13&&Q!==0);if(h0(Q)){I5(Z),Q=Z.input.charCodeAt(Z.position),W++,Z.lineIndent=0;while(Q===32)Z.lineIndent++,Q=Z.input.charCodeAt(++Z.position)}else break}if(q!==-1&&W!==0&&Z.lineIndent<q)W1(Z,"deficient indentation");return W}function z1(Z){var X=Z.position,q;if(q=Z.input.charCodeAt(X),(q===45||q===46)&&q===Z.input.charCodeAt(X+1)&&q===Z.input.charCodeAt(X+2)){if(X+=3,q=Z.input.charCodeAt(X),q===0||F0(q))return!0}return!1}function w5(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=a.repeat(`
28
+ `,X-1)}function MQ(Z,X,q){var W,Q,J,z,Y,U,K,V,B=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),F0($)||i6($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))return!1}Z.kind="scalar",Z.result="",J=z=Z.position,Y=!1;while($!==0){if($===58){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),F0(W))break}else if(Z.position===Z.lineStart&&z1(Z)||q&&i6($))break;else if(h0($))if(U=Z.line,K=Z.lineStart,V=Z.lineIndent,i(Z,!1,-1),Z.lineIndent>=X){Y=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=z,Z.line=U,Z.lineStart=K,Z.lineIndent=V;break}if(Y)U6(Z,J,z,!1),w5(Z,Z.line-U),J=z=Z.position,Y=!1;if(!j6($))z=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(U6(Z,J,z,!1),Z.result)return!0;return Z.kind=B,Z.result=H,!1}function LQ(Z,X){var q,W,Q;if(q=Z.input.charCodeAt(Z.position),q!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=Q=Z.position;while((q=Z.input.charCodeAt(Z.position))!==0)if(q===39)if(U6(Z,W,Z.position,!0),q=Z.input.charCodeAt(++Z.position),q===39)W=Z.position,Z.position++,Q=Z.position;else return!0;else if(h0(q))U6(Z,W,Q,!0),w5(Z,i(Z,!1,X)),W=Q=Z.position;else if(Z.position===Z.lineStart&&z1(Z))P(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,Q=Z.position;P(Z,"unexpected end of the stream within a single quoted scalar")}function IQ(Z,X){var q,W,Q,J,z,Y;if(Y=Z.input.charCodeAt(Z.position),Y!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,q=W=Z.position;while((Y=Z.input.charCodeAt(Z.position))!==0)if(Y===34)return U6(Z,q,Z.position,!0),Z.position++,!0;else if(Y===92){if(U6(Z,q,Z.position,!0),Y=Z.input.charCodeAt(++Z.position),h0(Y))i(Z,!1,X);else if(Y<256&&z9[Y])Z.result+=G9[Y],Z.position++;else if((z=HQ(Y))>0){Q=z,J=0;for(;Q>0;Q--)if(Y=Z.input.charCodeAt(++Z.position),(z=BQ(Y))>=0)J=(J<<4)+z;else P(Z,"expected hexadecimal character");Z.result+=FQ(J),Z.position++}else P(Z,"unknown escape sequence");q=W=Z.position}else if(h0(Y))U6(Z,q,W,!0),w5(Z,i(Z,!1,X)),q=W=Z.position;else if(Z.position===Z.lineStart&&z1(Z))P(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,W=Z.position;P(Z,"unexpected end of the stream within a double quoted scalar")}function wQ(Z,X){var q=!0,W,Q,J,z=Z.tag,Y,U=Z.anchor,K,V,B,H,$,F=Object.create(null),L,A,I,M;if(M=Z.input.charCodeAt(Z.position),M===91)V=93,$=!1,Y=[];else if(M===123)V=125,$=!0,Y={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Y;M=Z.input.charCodeAt(++Z.position);while(M!==0){if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===V)return Z.position++,Z.tag=z,Z.anchor=U,Z.kind=$?"mapping":"sequence",Z.result=Y,!0;else if(!q)P(Z,"missed comma between flow collection entries");else if(M===44)P(Z,"expected the node content, but found ','");if(A=L=I=null,B=H=!1,M===63){if(K=Z.input.charCodeAt(Z.position+1),F0(K))B=H=!0,Z.position++,i(Z,!0,X)}if(W=Z.line,Q=Z.lineStart,J=Z.position,a6(Z,X,X1,!1,!0),A=Z.tag,L=Z.result,i(Z,!0,X),M=Z.input.charCodeAt(Z.position),(H||Z.line===W)&&M===58)B=!0,M=Z.input.charCodeAt(++Z.position),i(Z,!0,X),a6(Z,X,X1,!1,!0),I=Z.result;if($)r6(Z,Y,F,A,L,I,W,Q,J);else if(B)Y.push(r6(Z,null,F,A,L,I,W,Q,J));else Y.push(L);if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===44)q=!0,M=Z.input.charCodeAt(++Z.position);else q=!1}P(Z,"unexpected end of the stream within a flow collection")}function DQ(Z,X){var q,W,Q=V5,J=!1,z=!1,Y=X,U=0,K=!1,V,B;if(B=Z.input.charCodeAt(Z.position),B===124)W=!1;else if(B===62)W=!0;else return!1;Z.kind="scalar",Z.result="";while(B!==0)if(B=Z.input.charCodeAt(++Z.position),B===43||B===45)if(V5===Q)Q=B===43?w8:YQ;else P(Z,"repeat of a chomping mode identifier");else if((V=$Q(B))>=0)if(V===0)P(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!z)Y=X+V-1,z=!0;else P(Z,"repeat of an indentation width identifier");else break;if(j6(B)){do B=Z.input.charCodeAt(++Z.position);while(j6(B));if(B===35)do B=Z.input.charCodeAt(++Z.position);while(!h0(B)&&B!==0)}while(B!==0){I5(Z),Z.lineIndent=0,B=Z.input.charCodeAt(Z.position);while((!z||Z.lineIndent<Y)&&B===32)Z.lineIndent++,B=Z.input.charCodeAt(++Z.position);if(!z&&Z.lineIndent>Y)Y=Z.lineIndent;if(h0(B)){U++;continue}if(Z.lineIndent<Y){if(Q===w8)Z.result+=a.repeat(`
29
+ `,J?1+U:U);else if(Q===V5){if(J)Z.result+=`
30
+ `}break}if(W)if(j6(B))K=!0,Z.result+=a.repeat(`
31
+ `,J?1+U:U);else if(K)K=!1,Z.result+=a.repeat(`
32
+ `,U+1);else if(U===0){if(J)Z.result+=" "}else Z.result+=a.repeat(`
33
+ `,U);else Z.result+=a.repeat(`
34
+ `,J?1+U:U);J=!0,z=!0,U=0,q=Z.position;while(!h0(B)&&B!==0)B=Z.input.charCodeAt(++Z.position);U6(Z,q,Z.position,!1)}return!0}function _8(Z,X){var q,W=Z.tag,Q=Z.anchor,J=[],z,Y=!1,U;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=J;U=Z.input.charCodeAt(Z.position);while(U!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,P(Z,"tab characters must not be used in indentation");if(U!==45)break;if(z=Z.input.charCodeAt(Z.position+1),!F0(z))break;if(Y=!0,Z.position++,i(Z,!0,-1)){if(Z.lineIndent<=X){J.push(null),U=Z.input.charCodeAt(Z.position);continue}}if(q=Z.line,a6(Z,X,q9,!1,!0),J.push(Z.result),i(Z,!0,-1),U=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&U!==0)P(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(Y)return Z.tag=W,Z.anchor=Q,Z.kind="sequence",Z.result=J,!0;return!1}function NQ(Z,X,q){var W,Q,J,z,Y,U,K=Z.tag,V=Z.anchor,B={},H=Object.create(null),$=null,F=null,L=null,A=!1,I=!1,M;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=B;M=Z.input.charCodeAt(Z.position);while(M!==0){if(!A&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,P(Z,"tab characters must not be used in indentation");if(W=Z.input.charCodeAt(Z.position+1),J=Z.line,(M===63||M===58)&&F0(W)){if(M===63){if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!0,Q=!0}else if(A)A=!1,Q=!0;else P(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,M=W}else{if(z=Z.line,Y=Z.lineStart,U=Z.position,!a6(Z,q,X9,!1,!0))break;if(Z.line===J){M=Z.input.charCodeAt(Z.position);while(j6(M))M=Z.input.charCodeAt(++Z.position);if(M===58){if(M=Z.input.charCodeAt(++Z.position),!F0(M))P(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!1,Q=!1,$=Z.tag,F=Z.result}else if(I)P(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=K,Z.anchor=V,!0}else if(I)P(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=K,Z.anchor=V,!0}if(Z.line===J||Z.lineIndent>X){if(A)z=Z.line,Y=Z.lineStart,U=Z.position;if(a6(Z,X,q1,!0,Q))if(A)F=Z.result;else L=Z.result;if(!A)r6(Z,B,H,$,F,L,z,Y,U),$=F=L=null;i(Z,!0,-1),M=Z.input.charCodeAt(Z.position)}if((Z.line===J||Z.lineIndent>X)&&M!==0)P(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(A)r6(Z,B,H,$,F,null,z,Y,U);if(I)Z.tag=K,Z.anchor=V,Z.kind="mapping",Z.result=B;return I}function TQ(Z){var X,q=!1,W=!1,Q,J,z;if(z=Z.input.charCodeAt(Z.position),z!==33)return!1;if(Z.tag!==null)P(Z,"duplication of a tag property");if(z=Z.input.charCodeAt(++Z.position),z===60)q=!0,z=Z.input.charCodeAt(++Z.position);else if(z===33)W=!0,Q="!!",z=Z.input.charCodeAt(++Z.position);else Q="!";if(X=Z.position,q){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&z!==62);if(Z.position<Z.length)J=Z.input.slice(X,Z.position),z=Z.input.charCodeAt(++Z.position);else P(Z,"unexpected end of the stream within a verbatim tag")}else{while(z!==0&&!F0(z)){if(z===33)if(!W){if(Q=Z.input.slice(X-1,Z.position+1),!W9.test(Q))P(Z,"named tag handle cannot contain such characters");W=!0,X=Z.position+1}else P(Z,"tag suffix cannot contain exclamation marks");z=Z.input.charCodeAt(++Z.position)}if(J=Z.input.slice(X,Z.position),VQ.test(J))P(Z,"tag suffix cannot contain flow indicator characters")}if(J&&!Q9.test(J))P(Z,"tag name cannot contain such characters: "+J);try{J=decodeURIComponent(J)}catch(Y){P(Z,"tag name is malformed: "+J)}if(q)Z.tag=J;else if(K6.call(Z.tagMap,Q))Z.tag=Z.tagMap[Q]+J;else if(Q==="!")Z.tag="!"+J;else if(Q==="!!")Z.tag="tag:yaml.org,2002:"+J;else P(Z,'undeclared tag handle "'+Q+'"');return!0}function RQ(Z){var X,q;if(q=Z.input.charCodeAt(Z.position),q!==38)return!1;if(Z.anchor!==null)P(Z,"duplication of an anchor property");q=Z.input.charCodeAt(++Z.position),X=Z.position;while(q!==0&&!F0(q)&&!i6(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===X)P(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(X,Z.position),!0}function _Q(Z){var X,q,W;if(W=Z.input.charCodeAt(Z.position),W!==42)return!1;W=Z.input.charCodeAt(++Z.position),X=Z.position;while(W!==0&&!F0(W)&&!i6(W))W=Z.input.charCodeAt(++Z.position);if(Z.position===X)P(Z,"name of an alias node must contain at least one character");if(q=Z.input.slice(X,Z.position),!K6.call(Z.anchorMap,q))P(Z,'unidentified alias "'+q+'"');return Z.result=Z.anchorMap[q],i(Z,!0,-1),!0}function a6(Z,X,q,W,Q){var J,z,Y,U=1,K=!1,V=!1,B,H,$,F,L,A;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,J=z=Y=q1===q||q9===q,W){if(i(Z,!0,-1)){if(K=!0,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}}if(U===1)while(TQ(Z)||RQ(Z))if(i(Z,!0,-1)){if(K=!0,Y=J,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}else Y=!1;if(Y)Y=K||Q;if(U===1||q1===q){if(X1===q||X9===q)L=X;else L=X+1;if(A=Z.position-Z.lineStart,U===1)if(Y&&(_8(Z,A)||NQ(Z,A,L))||wQ(Z,L))V=!0;else{if(z&&DQ(Z,L)||LQ(Z,L)||IQ(Z,L))V=!0;else if(_Q(Z)){if(V=!0,Z.tag!==null||Z.anchor!==null)P(Z,"alias node should not have any properties")}else if(MQ(Z,L,X1===q)){if(V=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(U===0)V=Y&&_8(Z,A)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")P(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(B=0,H=Z.implicitTypes.length;B<H;B+=1)if(F=Z.implicitTypes[B],F.resolve(Z.result)){if(Z.result=F.construct(Z.result),Z.tag=F.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(K6.call(Z.typeMap[Z.kind||"fallback"],Z.tag))F=Z.typeMap[Z.kind||"fallback"][Z.tag];else{F=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(B=0,H=$.length;B<H;B+=1)if(Z.tag.slice(0,$[B].tag.length)===$[B].tag){F=$[B];break}}if(!F)P(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&F.kind!==Z.kind)P(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+F.kind+'", not "'+Z.kind+'"');if(!F.resolve(Z.result,Z.tag))P(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=F.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||V}function PQ(Z){var X=Z.position,q,W,Q,J=!1,z;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((z=Z.input.charCodeAt(Z.position))!==0){if(i(Z,!0,-1),z=Z.input.charCodeAt(Z.position),Z.lineIndent>0||z!==37)break;J=!0,z=Z.input.charCodeAt(++Z.position),q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);if(W=Z.input.slice(q,Z.position),Q=[],W.length<1)P(Z,"directive name must not be less than one character in length");while(z!==0){while(j6(z))z=Z.input.charCodeAt(++Z.position);if(z===35){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&!h0(z));break}if(h0(z))break;q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);Q.push(Z.input.slice(q,Z.position))}if(z!==0)I5(Z);if(K6.call(T8,W))T8[W](Z,W,Q);else W1(Z,'unknown document directive "'+W+'"')}if(i(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,i(Z,!0,-1);else if(J)P(Z,"directives end mark is expected");if(a6(Z,Z.lineIndent-1,q1,!1,!0),i(Z,!0,-1),Z.checkLineBreaks&&KQ.test(Z.input.slice(X,Z.position)))W1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&z1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,i(Z,!0,-1);return}if(Z.position<Z.length-1)P(Z,"end of the stream or a document separator is expected");else return}function U9(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
35
+ `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var q=new AQ(Z,X),W=Z.indexOf("\x00");if(W!==-1)q.position=W,P(q,"null byte is not allowed in input");q.input+="\x00";while(q.input.charCodeAt(q.position)===32)q.lineIndent+=1,q.position+=1;while(q.position<q.length-1)PQ(q);return q.documents}function jQ(Z,X,q){if(X!==null&&typeof X==="object"&&typeof q>"u")q=X,X=null;var W=U9(Z,q);if(typeof X!=="function")return W;for(var Q=0,J=W.length;Q<J;Q+=1)X(W[Q])}function EQ(Z,X){var q=U9(Z,X);if(q.length===0)return;else if(q.length===1)return q[0];throw new K0("expected a single document in the stream, but found more")}function aQ(Z,X){var q,W,Q,J,z,Y,U;if(X===null)return{};q={},W=Object.keys(X);for(Q=0,J=W.length;Q<J;Q+=1){if(z=W[Q],Y=String(X[z]),z.slice(0,2)==="!!")z="tag:yaml.org,2002:"+z.slice(2);if(U=Z.compiledTypeMap.fallback[z],U&&B9.call(U.styleAliases,Y))Y=U.styleAliases[Y];q[z]=Y}return q}function sQ(Z){var X,q,W;if(X=Z.toString(16).toUpperCase(),Z<=255)q="x",W=2;else if(Z<=65535)q="u",W=4;else if(Z<=4294967295)q="U",W=8;else throw new K0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+q+a.repeat("0",W-X.length)+X}function tQ(Z){this.schema=Z.schema||L5,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=a.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=aQ(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?w4:oQ,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P8(Z,X){var q=a.repeat(" ",X),W=0,Q=-1,J="",z,Y=Z.length;while(W<Y){if(Q=Z.indexOf(`
36
+ `,W),Q===-1)z=Z.slice(W),W=Y;else z=Z.slice(W,Q+1),W=Q+1;if(z.length&&z!==`
37
+ `)J+=q;J+=z}return J}function $5(Z,X){return`
38
+ `+a.repeat(" ",Z.indent*X)}function eQ(Z,X){var q,W,Q;for(q=0,W=Z.implicitTypes.length;q<W;q+=1)if(Q=Z.implicitTypes[q],Q.resolve(X))return!0;return!1}function J1(Z){return Z===SQ||Z===xQ}function D4(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==D5||65536<=Z&&Z<=1114111}function j8(Z){return D4(Z)&&Z!==D5&&Z!==kQ&&Z!==I4}function E8(Z,X,q){var W=j8(Z),Q=W&&!J1(Z);return(q?W:W&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9)&&Z!==H5&&!(X===Q1&&!Q)||j8(X)&&!J1(X)&&Z===H5||X===Q1&&Q}function ZJ(Z){return D4(Z)&&Z!==D5&&!J1(Z)&&Z!==fQ&&Z!==cQ&&Z!==Q1&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9&&Z!==H5&&Z!==gQ&&Z!==mQ&&Z!==bQ&&Z!==nQ&&Z!==uQ&&Z!==dQ&&Z!==hQ&&Z!==vQ&&Z!==yQ&&Z!==lQ&&Z!==pQ}function XJ(Z){return!J1(Z)&&Z!==Q1}function M4(Z,X){var q=Z.charCodeAt(X),W;if(q>=55296&&q<=56319&&X+1<Z.length){if(W=Z.charCodeAt(X+1),W>=56320&&W<=57343)return(q-55296)*1024+W-56320+65536}return q}function L9(Z){var X=/^\n* /;return X.test(Z)}function qJ(Z,X,q,W,Q,J,z,Y){var U,K=0,V=null,B=!1,H=!1,$=W!==-1,F=-1,L=ZJ(M4(Z,0))&&XJ(M4(Z,Z.length-1));if(X||z)for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),!D4(K))return n6;L=L&&E8(K,V,Y),V=K}else{for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),K===I4){if(B=!0,$)H=H||U-F-1>W&&Z[F+1]!==" ",F=U}else if(!D4(K))return n6;L=L&&E8(K,V,Y),V=K}H=H||$&&(U-F-1>W&&Z[F+1]!==" ")}if(!B&&!H){if(L&&!z&&!Q(Z))return I9;return J===w4?n6:F5}if(q>9&&L9(Z))return n6;if(!z)return H?D9:w9;return J===w4?n6:F5}function WJ(Z,X,q,W,Q){Z.dump=function(){if(X.length===0)return Z.quotingType===w4?'""':"''";if(!Z.noCompatMode){if(iQ.indexOf(X)!==-1||rQ.test(X))return Z.quotingType===w4?'"'+X+'"':"'"+X+"'"}var J=Z.indent*Math.max(1,q),z=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Y=W||Z.flowLevel>-1&&q>=Z.flowLevel;function U(K){return eQ(Z,K)}switch(qJ(X,Y,Z.indent,z,U,Z.quotingType,Z.forceQuotes&&!W,Q)){case I9:return X;case F5:return"'"+X.replace(/'/g,"''")+"'";case w9:return"|"+C8(X,Z.indent)+O8(P8(X,J));case D9:return">"+C8(X,Z.indent)+O8(P8(QJ(X,z),J));case n6:return'"'+JJ(X)+'"';default:throw new K0("impossible error: invalid scalar style")}}()}function C8(Z,X){var q=L9(Z)?String(X):"",W=Z[Z.length-1]===`
39
+ `,Q=W&&(Z[Z.length-2]===`
40
40
  `||Z===`
41
- `),Q=q?"+":W?"":"-";return X+Q+`
42
- `}function o7(Z){return Z[Z.length-1]===`
43
- `?Z.slice(0,-1):Z}function _W(Z,J){var X=/(\n+)([^\n]*)/g,W=function(){var U=Z.indexOf(`
44
- `);return U=U!==-1?U:Z.length,X.lastIndex=U,t7(Z.slice(0,U),J)}(),q=Z[0]===`
45
- `||Z[0]===" ",Q,G;while(G=X.exec(Z)){var z=G[1],Y=G[2];Q=Y[0]===" ",W+=z+(!q&&!Q&&Y!==""?`
46
- `:"")+t7(Y,J),q=Q}return W}function t7(Z,J){if(Z===""||Z[0]===" ")return Z;var X=/ [^ ]/g,W,q=0,Q,G=0,z=0,Y="";while(W=X.exec(Z)){if(z=W.index,z-q>J)Q=G>q?G:z,Y+=`
47
- `+Z.slice(q,Q),q=Q+1;G=z}if(Y+=`
48
- `,Z.length-q>J&&G>q)Y+=Z.slice(q,G)+`
49
- `+Z.slice(G+1);else Y+=Z.slice(q);return Y.slice(1)}function CW(Z){var J="",X=0,W;for(var q=0;q<Z.length;X>=65536?q+=2:q++)if(X=Y1(Z,q),W=q0[X],!W&&V1(X)){if(J+=Z[q],X>=65536)J+=Z[q+1]}else J+=W||IW(X);return J}function EW(Z,J,X){var W="",q=Z.tag,Q,G,z;for(Q=0,G=X.length;Q<G;Q+=1){if(z=X[Q],Z.replacer)z=Z.replacer.call(X,String(Q),z);if(n0(Z,J,z,!1,!1)||typeof z>"u"&&n0(Z,J,null,!1,!1)){if(W!=="")W+=","+(!Z.condenseFlow?" ":"");W+=Z.dump}}Z.tag=q,Z.dump="["+W+"]"}function e7(Z,J,X,W){var q="",Q=Z.tag,G,z,Y;for(G=0,z=X.length;G<z;G+=1){if(Y=X[G],Z.replacer)Y=Z.replacer.call(X,String(G),Y);if(n0(Z,J+1,Y,!0,!0,!1,!0)||typeof Y>"u"&&n0(Z,J+1,null,!0,!0,!1,!0)){if(!W||q!=="")q+=i6(Z,J);if(Z.dump&&U1===Z.dump.charCodeAt(0))q+="-";else q+="- ";q+=Z.dump}}Z.tag=Q,Z.dump=q||"[]"}function OW(Z,J,X){var W="",q=Z.tag,Q=Object.keys(X),G,z,Y,U,K;for(G=0,z=Q.length;G<z;G+=1){if(K="",W!=="")K+=", ";if(Z.condenseFlow)K+='"';if(Y=Q[G],U=X[Y],Z.replacer)U=Z.replacer.call(X,Y,U);if(!n0(Z,J,Y,!1,!1))continue;if(Z.dump.length>1024)K+="? ";if(K+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!n0(Z,J,U,!1,!1))continue;K+=Z.dump,W+=K}Z.tag=q,Z.dump="{"+W+"}"}function xW(Z,J,X,W){var q="",Q=Z.tag,G=Object.keys(X),z,Y,U,K,V,B;if(Z.sortKeys===!0)G.sort();else if(typeof Z.sortKeys==="function")G.sort(Z.sortKeys);else if(Z.sortKeys)throw new U0("sortKeys must be a boolean or a function");for(z=0,Y=G.length;z<Y;z+=1){if(B="",!W||q!=="")B+=i6(Z,J);if(U=G[z],K=X[U],Z.replacer)K=Z.replacer.call(X,U,K);if(!n0(Z,J+1,U,!0,!0,!0))continue;if(V=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,V)if(Z.dump&&U1===Z.dump.charCodeAt(0))B+="?";else B+="? ";if(B+=Z.dump,V)B+=i6(Z,J);if(!n0(Z,J+1,K,!0,V))continue;if(Z.dump&&U1===Z.dump.charCodeAt(0))B+=":";else B+=": ";B+=Z.dump,q+=B}Z.tag=Q,Z.dump=q||"{}"}function Z3(Z,J,X){var W,q,Q,G,z,Y;q=X?Z.explicitTypes:Z.implicitTypes;for(Q=0,G=q.length;Q<G;Q+=1)if(z=q[Q],(z.instanceOf||z.predicate)&&(!z.instanceOf||typeof J==="object"&&J instanceof z.instanceOf)&&(!z.predicate||z.predicate(J))){if(X)if(z.multi&&z.representName)Z.tag=z.representName(J);else Z.tag=z.tag;else Z.tag="?";if(z.represent){if(Y=Z.styleMap[z.tag]||z.defaultStyle,k3.call(z.represent)==="[object Function]")W=z.represent(J,Y);else if(S3.call(z.represent,Y))W=z.represent[Y](J,Y);else throw new U0("!<"+z.tag+'> tag resolver accepts not "'+Y+'" style');Z.dump=W}return!0}return!1}function n0(Z,J,X,W,q,Q,G){if(Z.tag=null,Z.dump=X,!Z3(Z,X,!1))Z3(Z,X,!0);var z=k3.call(Z.dump),Y=W,U;if(W)W=Z.flowLevel<0||Z.flowLevel>J;var K=z==="[object Object]"||z==="[object Array]",V,B;if(K)V=Z.duplicates.indexOf(X),B=V!==-1;if(Z.tag!==null&&Z.tag!=="?"||B||Z.indent!==2&&J>0)q=!1;if(B&&Z.usedDuplicates[V])Z.dump="*ref_"+V;else{if(K&&B&&!Z.usedDuplicates[V])Z.usedDuplicates[V]=!0;if(z==="[object Object]"){if(W&&Object.keys(Z.dump).length!==0){if(xW(Z,J,Z.dump,q),B)Z.dump="&ref_"+V+Z.dump}else if(OW(Z,J,Z.dump),B)Z.dump="&ref_"+V+" "+Z.dump}else if(z==="[object Array]"){if(W&&Z.dump.length!==0){if(Z.noArrayIndent&&!G&&J>0)e7(Z,J-1,Z.dump,q);else e7(Z,J,Z.dump,q);if(B)Z.dump="&ref_"+V+Z.dump}else if(EW(Z,J,Z.dump),B)Z.dump="&ref_"+V+" "+Z.dump}else if(z==="[object String]"){if(Z.tag!=="?")jW(Z,Z.dump,J,Q,Y)}else if(z==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new U0("unacceptable kind of an object to dump "+z)}if(Z.tag!==null&&Z.tag!=="?"){if(U=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")U="!"+U;else if(U.slice(0,18)==="tag:yaml.org,2002:")U="!!"+U.slice(18);else U="!<"+U+">";Z.dump=U+" "+Z.dump}}return!0}function kW(Z,J){var X=[],W=[],q,Q;s6(Z,X,W);for(q=0,Q=W.length;q<Q;q+=1)J.duplicates.push(X[W[q]]);J.usedDuplicates=Array(Q)}function s6(Z,J,X){var W,q,Q;if(Z!==null&&typeof Z==="object")if(q=J.indexOf(Z),q!==-1){if(X.indexOf(q)===-1)X.push(q)}else if(J.push(Z),Array.isArray(Z))for(q=0,Q=Z.length;q<Q;q+=1)s6(Z[q],J,X);else{W=Object.keys(Z);for(q=0,Q=W.length;q<Q;q+=1)s6(Z[W[q]],J,X)}}function SW(Z,J){J=J||{};var X=new wW(J);if(!X.noRefs)kW(Z,X);var W=Z;if(X.replacer)W=X.replacer.call({"":W},"",W);if(n0(X,0,W,!0,!0))return X.dump+`
50
- `;return""}function X5(Z,J){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}var yJ,gJ,hJ,mJ,fJ,uJ,t,U0,cJ,lJ,pJ,W0,W3,q3,Q3,G3,Y3,z3,U3,K3,YX,KX,V3,H3,B3,$3,F3,M3,A3,o6=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
- \r`,L3,wX,NX,I3,RX,D3,CX,w3,t6,Z4,f1=1,N3=2,T3=3,u1=4,p6=1,xX=2,u7=3,kX,SX,bX,P3,R3,_3,C3,t0,l7,tX,eX,x3,k3,S3,J5=65279,ZW=9,U1=10,JW=13,XW=32,WW=33,qW=34,r6=35,QW=37,GW=38,YW=39,zW=42,b3=44,UW=45,c1=58,KW=61,VW=62,HW=63,BW=64,v3=91,y3=93,$W=96,g3=123,FW=124,h3=125,q0,MW,AW,DW=1,K1=2,f3=1,a6=2,u3=3,d3=4,S4=5,bW,vW,yW,gW,hW,W5,mW,fW,uW,dW,cW,lW,pW,nW,rW,iW,q5;var Q5=O(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */yJ=J3,gJ=xJ,hJ=kJ,mJ=bJ,fJ=vJ,uJ=SJ,t={isNothing:yJ,isObject:gJ,toArray:hJ,repeat:mJ,isNegativeZero:fJ,extend:uJ};z1.prototype=Object.create(Error.prototype);z1.prototype.constructor=z1;z1.prototype.toString=function(J){return this.name+": "+X3(this,J)};U0=z1;cJ=dJ,lJ=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],pJ=["scalar","sequence","mapping"];W0=rJ;n6.prototype.extend=function(J){var X=[],W=[];if(J instanceof W0)W.push(J);else if(Array.isArray(J))W=W.concat(J);else if(J&&(Array.isArray(J.implicit)||Array.isArray(J.explicit))){if(J.implicit)X=X.concat(J.implicit);if(J.explicit)W=W.concat(J.explicit)}else throw new U0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");X.forEach(function(Q){if(!(Q instanceof W0))throw new U0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(Q.loadKind&&Q.loadKind!=="scalar")throw new U0("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 U0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(Q){if(!(Q instanceof W0))throw new U0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var q=Object.create(n6.prototype);return q.implicit=(this.implicit||[]).concat(X),q.explicit=(this.explicit||[]).concat(W),q.compiledImplicit=f7(q,"implicit"),q.compiledExplicit=f7(q,"explicit"),q.compiledTypeMap=iJ(q.compiledImplicit,q.compiledExplicit),q};W3=n6,q3=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),Q3=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),G3=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),Y3=new W3({explicit:[q3,Q3,G3]});z3=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:aJ,construct:sJ,predicate:oJ,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});U3=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:tJ,construct:eJ,predicate:ZX,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});K3=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:qX,construct:QX,predicate:GX,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YX=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");KX=/^[-+]?[0-9]+e/;V3=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:zX,construct:UX,predicate:HX,represent:VX,defaultStyle:"lowercase"}),H3=Y3.extend({implicit:[z3,U3,K3,V3]}),B3=H3,$3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),F3=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]))?))?$");M3=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:BX,construct:$X,instanceOf:Date,represent:FX});A3=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:MX});L3=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:AX,construct:LX,predicate:DX,represent:IX}),wX=Object.prototype.hasOwnProperty,NX=Object.prototype.toString;I3=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:TX,construct:PX}),RX=Object.prototype.toString;D3=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:jX,construct:_X}),CX=Object.prototype.hasOwnProperty;w3=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:EX,construct:OX}),t6=B3.extend({implicit:[M3,A3],explicit:[L3,I3,D3,w3]}),Z4=Object.prototype.hasOwnProperty,kX=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,SX=/[\x85\u2028\u2029]/,bX=/[,\[\]\{\}]/,P3=/^(?:!|!!|![a-z\-]+!)$/i,R3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;_3=Array(256),C3=Array(256);for(t0=0;t0<256;t0++)_3[t0]=c7(t0)?1:0,C3[t0]=c7(t0);l7={YAML:function(J,X,W){var q,Q,G;if(J.version!==null)C(J,"duplication of %YAML directive");if(W.length!==1)C(J,"YAML directive accepts exactly one argument");if(q=/^([0-9]+)\.([0-9]+)$/.exec(W[0]),q===null)C(J,"ill-formed argument of the YAML directive");if(Q=parseInt(q[1],10),G=parseInt(q[2],10),Q!==1)C(J,"unacceptable YAML version of the document");if(J.version=W[0],J.checkLineBreaks=G<2,G!==1&&G!==2)d1(J,"unsupported YAML version of the document")},TAG:function(J,X,W){var q,Q;if(W.length!==2)C(J,"TAG directive accepts exactly two arguments");if(q=W[0],Q=W[1],!P3.test(q))C(J,"ill-formed tag handle (first argument) of the TAG directive");if(Z4.call(J.tagMap,q))C(J,'there is a previously declared suffix for "'+q+'" tag handle');if(!R3.test(Q))C(J,"ill-formed tag prefix (second argument) of the TAG directive");try{Q=decodeURIComponent(Q)}catch(G){C(J,"tag prefix is malformed: "+Q)}J.tagMap[q]=Q}};tX=sX,eX=oX,x3={loadAll:tX,load:eX},k3=Object.prototype.toString,S3=Object.prototype.hasOwnProperty,q0={};q0[0]="\\0";q0[7]="\\a";q0[8]="\\b";q0[9]="\\t";q0[10]="\\n";q0[11]="\\v";q0[12]="\\f";q0[13]="\\r";q0[27]="\\e";q0[34]="\\\"";q0[92]="\\\\";q0[133]="\\N";q0[160]="\\_";q0[8232]="\\L";q0[8233]="\\P";MW=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],AW=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;bW=SW,vW={dump:bW};yW=W0,gW=W3,hW=Y3,W5=H3,mW=B3,fW=t6,uW=x3.load,dW=x3.loadAll,cW=vW.dump,lW=U0,pW={binary:L3,float:V3,map:G3,null:z3,pairs:D3,set:w3,timestamp:M3,bool:U3,int:K3,merge:A3,omap:I3,seq:Q3,str:q3},nW=X5("safeLoad","load"),rW=X5("safeLoadAll","loadAll"),iW=X5("safeDump","dump"),q5={Type:yW,Schema:gW,FAILSAFE_SCHEMA:hW,JSON_SCHEMA:W5,CORE_SCHEMA:mW,DEFAULT_SCHEMA:fW,load:uW,loadAll:dW,dump:cW,YAMLException:lW,types:pW,safeLoad:nW,safeLoadAll:rW,safeDump:iW}});var c3;var l3=O(()=>{R0();Q5();Q5();c3={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let J=Z.data;if(Buffer.isBuffer(J))J=J.toString();if(typeof J==="string")try{return q5.load(J,{schema:W5})}catch{try{return q5.load(J)}catch(X){throw new P0(X?.message||"Parser Error",Z.url)}}else return J}}});var aW,p3;var n3=O(()=>{R0();aW=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,p3={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&aW.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 P0("data is not text",Z.url)}}});var sW,r3;var i3=O(()=>{sW=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,r3={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&sW.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var G5;var Y5=O(()=>{$0();R0();G5={order:100,canRead(Z){return O1(Z.url)},async read(Z){let J,X=await import("fs");try{J=E4(Z.url)}catch(W){let q=W;throw q.message=`Malformed URI: ${Z.url}: ${q.message}`,new C0(q,Z.url)}if(J.endsWith("/")||J.endsWith("\\"))J=J.slice(0,-1);try{return await X.promises.readFile(J)}catch(W){let q=W;throw q.message=`Error opening file ${J}: ${q.message}`,new C0(q,J)}}}});async function a3(Z,J,X){Z=C4(Z);let W=X||[];W.push(Z.href);try{let q=await oW(Z,J);if(q.status>=400){let Q=Error(`HTTP ERROR ${q.status}`);throw Q.status=q.status,Q}else if(q.status>=300)if(!Number.isNaN(J.redirects)&&W.length>J.redirects){let Q=Error(`Error downloading ${W[0]}.
41
+ `),J=Q?"+":W?"":"-";return q+J+`
42
+ `}function O8(Z){return Z[Z.length-1]===`
43
+ `?Z.slice(0,-1):Z}function QJ(Z,X){var q=/(\n+)([^\n]*)/g,W=function(){var K=Z.indexOf(`
44
+ `);return K=K!==-1?K:Z.length,q.lastIndex=K,x8(Z.slice(0,K),X)}(),Q=Z[0]===`
45
+ `||Z[0]===" ",J,z;while(z=q.exec(Z)){var Y=z[1],U=z[2];J=U[0]===" ",W+=Y+(!Q&&!J&&U!==""?`
46
+ `:"")+x8(U,X),Q=J}return W}function x8(Z,X){if(Z===""||Z[0]===" ")return Z;var q=/ [^ ]/g,W,Q=0,J,z=0,Y=0,U="";while(W=q.exec(Z)){if(Y=W.index,Y-Q>X)J=z>Q?z:Y,U+=`
47
+ `+Z.slice(Q,J),Q=J+1;z=Y}if(U+=`
48
+ `,Z.length-Q>X&&z>Q)U+=Z.slice(Q,z)+`
49
+ `+Z.slice(z+1);else U+=Z.slice(Q);return U.slice(1)}function JJ(Z){var X="",q=0,W;for(var Q=0;Q<Z.length;q>=65536?Q+=2:Q++)if(q=M4(Z,Q),W=z0[q],!W&&D4(q)){if(X+=Z[Q],q>=65536)X+=Z[Q+1]}else X+=W||sQ(q);return X}function zJ(Z,X,q){var W="",Q=Z.tag,J,z,Y;for(J=0,z=q.length;J<z;J+=1){if(Y=q[J],Z.replacer)Y=Z.replacer.call(q,String(J),Y);if(s0(Z,X,Y,!1,!1)||typeof Y>"u"&&s0(Z,X,null,!1,!1)){if(W!=="")W+=","+(!Z.condenseFlow?" ":"");W+=Z.dump}}Z.tag=Q,Z.dump="["+W+"]"}function k8(Z,X,q,W){var Q="",J=Z.tag,z,Y,U;for(z=0,Y=q.length;z<Y;z+=1){if(U=q[z],Z.replacer)U=Z.replacer.call(q,String(z),U);if(s0(Z,X+1,U,!0,!0,!1,!0)||typeof U>"u"&&s0(Z,X+1,null,!0,!0,!1,!0)){if(!W||Q!=="")Q+=$5(Z,X);if(Z.dump&&I4===Z.dump.charCodeAt(0))Q+="-";else Q+="- ";Q+=Z.dump}}Z.tag=J,Z.dump=Q||"[]"}function GJ(Z,X,q){var W="",Q=Z.tag,J=Object.keys(q),z,Y,U,K,V;for(z=0,Y=J.length;z<Y;z+=1){if(V="",W!=="")V+=", ";if(Z.condenseFlow)V+='"';if(U=J[z],K=q[U],Z.replacer)K=Z.replacer.call(q,U,K);if(!s0(Z,X,U,!1,!1))continue;if(Z.dump.length>1024)V+="? ";if(V+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!s0(Z,X,K,!1,!1))continue;V+=Z.dump,W+=V}Z.tag=Q,Z.dump="{"+W+"}"}function YJ(Z,X,q,W){var Q="",J=Z.tag,z=Object.keys(q),Y,U,K,V,B,H;if(Z.sortKeys===!0)z.sort();else if(typeof Z.sortKeys==="function")z.sort(Z.sortKeys);else if(Z.sortKeys)throw new K0("sortKeys must be a boolean or a function");for(Y=0,U=z.length;Y<U;Y+=1){if(H="",!W||Q!=="")H+=$5(Z,X);if(K=z[Y],V=q[K],Z.replacer)V=Z.replacer.call(q,K,V);if(!s0(Z,X+1,K,!0,!0,!0))continue;if(B=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,B)if(Z.dump&&I4===Z.dump.charCodeAt(0))H+="?";else H+="? ";if(H+=Z.dump,B)H+=$5(Z,X);if(!s0(Z,X+1,V,!0,B))continue;if(Z.dump&&I4===Z.dump.charCodeAt(0))H+=":";else H+=": ";H+=Z.dump,Q+=H}Z.tag=J,Z.dump=Q||"{}"}function S8(Z,X,q){var W,Q,J,z,Y,U;Q=q?Z.explicitTypes:Z.implicitTypes;for(J=0,z=Q.length;J<z;J+=1)if(Y=Q[J],(Y.instanceOf||Y.predicate)&&(!Y.instanceOf||typeof X==="object"&&X instanceof Y.instanceOf)&&(!Y.predicate||Y.predicate(X))){if(q)if(Y.multi&&Y.representName)Z.tag=Y.representName(X);else Z.tag=Y.tag;else Z.tag="?";if(Y.represent){if(U=Z.styleMap[Y.tag]||Y.defaultStyle,V9.call(Y.represent)==="[object Function]")W=Y.represent(X,U);else if(B9.call(Y.represent,U))W=Y.represent[U](X,U);else throw new K0("!<"+Y.tag+'> tag resolver accepts not "'+U+'" style');Z.dump=W}return!0}return!1}function s0(Z,X,q,W,Q,J,z){if(Z.tag=null,Z.dump=q,!S8(Z,q,!1))S8(Z,q,!0);var Y=V9.call(Z.dump),U=W,K;if(W)W=Z.flowLevel<0||Z.flowLevel>X;var V=Y==="[object Object]"||Y==="[object Array]",B,H;if(V)B=Z.duplicates.indexOf(q),H=B!==-1;if(Z.tag!==null&&Z.tag!=="?"||H||Z.indent!==2&&X>0)Q=!1;if(H&&Z.usedDuplicates[B])Z.dump="*ref_"+B;else{if(V&&H&&!Z.usedDuplicates[B])Z.usedDuplicates[B]=!0;if(Y==="[object Object]"){if(W&&Object.keys(Z.dump).length!==0){if(YJ(Z,X,Z.dump,Q),H)Z.dump="&ref_"+B+Z.dump}else if(GJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object Array]"){if(W&&Z.dump.length!==0){if(Z.noArrayIndent&&!z&&X>0)k8(Z,X-1,Z.dump,Q);else k8(Z,X,Z.dump,Q);if(H)Z.dump="&ref_"+B+Z.dump}else if(zJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object String]"){if(Z.tag!=="?")WJ(Z,Z.dump,X,J,U)}else if(Y==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new K0("unacceptable kind of an object to dump "+Y)}if(Z.tag!==null&&Z.tag!=="?"){if(K=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")K="!"+K;else if(K.slice(0,18)==="tag:yaml.org,2002:")K="!!"+K.slice(18);else K="!<"+K+">";Z.dump=K+" "+Z.dump}}return!0}function UJ(Z,X){var q=[],W=[],Q,J;A5(Z,q,W);for(Q=0,J=W.length;Q<J;Q+=1)X.duplicates.push(q[W[Q]]);X.usedDuplicates=Array(J)}function A5(Z,X,q){var W,Q,J;if(Z!==null&&typeof Z==="object")if(Q=X.indexOf(Z),Q!==-1){if(q.indexOf(Q)===-1)q.push(Q)}else if(X.push(Z),Array.isArray(Z))for(Q=0,J=Z.length;Q<J;Q+=1)A5(Z[Q],X,q);else{W=Object.keys(Z);for(Q=0,J=W.length;Q<J;Q+=1)A5(Z[W[Q]],X,q)}}function KJ(Z,X){X=X||{};var q=new tQ(X);if(!q.noRefs)UJ(Z,q);var W=Z;if(q.replacer)W=q.replacer.call({"":W},"",W);if(s0(q,0,W,!0,!0))return q.dump+`
50
+ `;return""}function N5(Z,X){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+X+" instead, which is now safe by default.")}}var HW,$W,FW,AW,MW,LW,a,K0,wW,DW,NW,W0,y8,g8,h8,m8,f8,u8,d8,c8,hW,uW,l8,p8,n8,i8,r8,a8,s8,M5=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
+ \r`,o8,tW,eW,t8,qQ,e8,JQ,Z9,L5,K6,X1=1,X9=2,q9=3,q1=4,V5=1,YQ=2,w8=3,UQ,KQ,VQ,W9,Q9,z9,G9,Y6,T8,CQ,OQ,K9,V9,B9,D5=65279,xQ=9,I4=10,kQ=13,SQ=32,bQ=33,vQ=34,H5=35,yQ=37,gQ=38,hQ=39,mQ=42,H9=44,fQ=45,Q1=58,uQ=61,dQ=62,cQ=63,lQ=64,$9=91,F9=93,pQ=96,A9=123,nQ=124,M9=125,z0,iQ,rQ,oQ=1,w4=2,I9=1,F5=2,w9=3,D9=4,n6=5,VJ,BJ,HJ,$J,FJ,T5,AJ,MJ,LJ,IJ,wJ,DJ,NJ,TJ,RJ,_J,R5;var _5=R(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */HW=b8,$W=YW,FW=UW,AW=VW,MW=BW,LW=KW,a={isNothing:HW,isObject:$W,toArray:FW,repeat:AW,isNegativeZero:MW,extend:LW};L4.prototype=Object.create(Error.prototype);L4.prototype.constructor=L4;L4.prototype.toString=function(X){return this.name+": "+v8(this,X)};K0=L4;wW=IW,DW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NW=["scalar","sequence","mapping"];W0=RW;B5.prototype.extend=function(X){var q=[],W=[];if(X instanceof W0)W.push(X);else if(Array.isArray(X))W=W.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)q=q.concat(X.implicit);if(X.explicit)W=W.concat(X.explicit)}else throw new K0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");q.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(J.loadKind&&J.loadKind!=="scalar")throw new K0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(J.multi)throw new K0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var Q=Object.create(B5.prototype);return Q.implicit=(this.implicit||[]).concat(q),Q.explicit=(this.explicit||[]).concat(W),Q.compiledImplicit=I8(Q,"implicit"),Q.compiledExplicit=I8(Q,"explicit"),Q.compiledTypeMap=_W(Q.compiledImplicit,Q.compiledExplicit),Q};y8=B5,g8=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),h8=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),m8=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),f8=new y8({explicit:[g8,h8,m8]});u8=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:PW,construct:jW,predicate:EW,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});d8=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:CW,construct:OW,predicate:xW,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});c8=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:vW,construct:yW,predicate:gW,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");uW=/^[-+]?[0-9]+e/;l8=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:mW,construct:fW,predicate:cW,represent:dW,defaultStyle:"lowercase"}),p8=f8.extend({implicit:[u8,d8,c8,l8]}),n8=p8,i8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r8=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]))?))?$");a8=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lW,construct:pW,instanceOf:Date,represent:nW});s8=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iW});o8=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rW,construct:aW,predicate:oW,represent:sW}),tW=Object.prototype.hasOwnProperty,eW=Object.prototype.toString;t8=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ZQ,construct:XQ}),qQ=Object.prototype.toString;e8=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:WQ,construct:QQ}),JQ=Object.prototype.hasOwnProperty;Z9=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:zQ,construct:GQ}),L5=n8.extend({implicit:[a8,s8],explicit:[o8,t8,e8,Z9]}),K6=Object.prototype.hasOwnProperty,UQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KQ=/[\x85\u2028\u2029]/,VQ=/[,\[\]\{\}]/,W9=/^(?:!|!!|![a-z\-]+!)$/i,Q9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;z9=Array(256),G9=Array(256);for(Y6=0;Y6<256;Y6++)z9[Y6]=N8(Y6)?1:0,G9[Y6]=N8(Y6);T8={YAML:function(X,q,W){var Q,J,z;if(X.version!==null)P(X,"duplication of %YAML directive");if(W.length!==1)P(X,"YAML directive accepts exactly one argument");if(Q=/^([0-9]+)\.([0-9]+)$/.exec(W[0]),Q===null)P(X,"ill-formed argument of the YAML directive");if(J=parseInt(Q[1],10),z=parseInt(Q[2],10),J!==1)P(X,"unacceptable YAML version of the document");if(X.version=W[0],X.checkLineBreaks=z<2,z!==1&&z!==2)W1(X,"unsupported YAML version of the document")},TAG:function(X,q,W){var Q,J;if(W.length!==2)P(X,"TAG directive accepts exactly two arguments");if(Q=W[0],J=W[1],!W9.test(Q))P(X,"ill-formed tag handle (first argument) of the TAG directive");if(K6.call(X.tagMap,Q))P(X,'there is a previously declared suffix for "'+Q+'" tag handle');if(!Q9.test(J))P(X,"ill-formed tag prefix (second argument) of the TAG directive");try{J=decodeURIComponent(J)}catch(z){P(X,"tag prefix is malformed: "+J)}X.tagMap[Q]=J}};CQ=jQ,OQ=EQ,K9={loadAll:CQ,load:OQ},V9=Object.prototype.toString,B9=Object.prototype.hasOwnProperty,z0={};z0[0]="\\0";z0[7]="\\a";z0[8]="\\b";z0[9]="\\t";z0[10]="\\n";z0[11]="\\v";z0[12]="\\f";z0[13]="\\r";z0[27]="\\e";z0[34]="\\\"";z0[92]="\\\\";z0[133]="\\N";z0[160]="\\_";z0[8232]="\\L";z0[8233]="\\P";iQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],rQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;VJ=KJ,BJ={dump:VJ};HJ=W0,$J=y8,FJ=f8,T5=p8,AJ=n8,MJ=L5,LJ=K9.load,IJ=K9.loadAll,wJ=BJ.dump,DJ=K0,NJ={binary:o8,float:l8,map:m8,null:u8,pairs:e8,set:Z9,timestamp:a8,bool:d8,int:c8,merge:s8,omap:t8,seq:h8,str:g8},TJ=N5("safeLoad","load"),RJ=N5("safeLoadAll","loadAll"),_J=N5("safeDump","dump"),R5={Type:HJ,Schema:$J,FAILSAFE_SCHEMA:FJ,JSON_SCHEMA:T5,CORE_SCHEMA:AJ,DEFAULT_SCHEMA:MJ,load:LJ,loadAll:IJ,dump:wJ,YAMLException:DJ,types:NJ,safeLoad:TJ,safeLoadAll:RJ,safeDump:_J}});var N9;var T9=R(()=>{P0();_5();_5();N9={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 R5.load(X,{schema:T5})}catch{try{return R5.load(X)}catch(q){throw new _0(q?.message||"Parser Error",Z.url)}}else return X}}});var PJ,R9;var _9=R(()=>{P0();PJ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,R9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&PJ.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 _0("data is not text",Z.url)}}});var jJ,P9;var j9=R(()=>{jJ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,P9={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&jJ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var P5;var j5=R(()=>{H0();P0();P5={order:100,canRead(Z){return p4(Z.url)},async read(Z){let X,q=await import("fs");try{X=d6(Z.url)}catch(W){let Q=W;throw Q.message=`Malformed URI: ${Z.url}: ${Q.message}`,new x0(Q,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await q.promises.readFile(X)}catch(W){let Q=W;throw Q.message=`Error opening file ${X}: ${Q.message}`,new x0(Q,X)}}}});async function E9(Z,X,q){Z=u6(Z);let W=q||[];W.push(Z.href);try{let Q=await EJ(Z,X);if(Q.status>=400){let J=Error(`HTTP ERROR ${Q.status}`);throw J.status=Q.status,J}else if(Q.status>=300)if(!Number.isNaN(X.redirects)&&W.length>X.redirects){let J=Error(`Error downloading ${W[0]}.
52
52
  Too many redirects:
53
53
  ${W.join(`
54
- `)}`);throw Q.status=q.status,new C0(Q)}else if(!("location"in q.headers)||!q.headers.location){let Q=Error(`HTTP ${q.status} redirect with no location header`);throw Q.status=q.status,Q}else{let Q=o(Z.href,q.headers.location);return a3(Q,J,W)}else{if(q.body){let Q=await q.arrayBuffer();return Buffer.from(Q)}return Buffer.alloc(0)}}catch(q){let Q=q;throw Q.message=`Error downloading ${Z.href}: ${Q.message}`,new C0(Q,Z.href)}}async function oW(Z,J){let X,W;if(J.timeout&&typeof AbortController<"u")X=new AbortController,W=setTimeout(()=>X.abort(),J.timeout);let q=await fetch(Z,{method:"GET",headers:J.headers||{},credentials:J.withCredentials?"include":"same-origin",signal:X?X.signal:null});if(W)clearTimeout(W);return q}var z5;var U5=O(()=>{$0();R0();z5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return C7(Z.url)&&(!this.safeUrlResolver||!v6(Z.url))},read(Z){let J=C4(Z.url);if(typeof window<"u"&&!J.protocol)J.protocol=C4(location.href).protocol;return a3(J,this)}}});function e3(Z,J){if(s3(J)){let X=Object.keys(J).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<X.length;W++){let q=X[W],Q=J[q],G=Z[q];if(s3(Q))Z[q]=e3(G||{},Q);else if(Q!==void 0)Z[q]=Q}}return Z}function s3(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var o3=()=>{return{parse:{json:{...h7},yaml:{...c3},text:{...p3},binary:{...r3}},resolve:{file:{...G5},http:{...z5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},t3=(Z)=>{let J=o3();if(Z)e3(J,Z);return J};var K5=O(()=>{m7();l3();n3();i3();Y5();U5()});function tW(Z){let J,X,W,q,Q=Array.prototype.slice.call(Z);if(typeof Q[Q.length-1]==="function")q=Q.pop();if(typeof Q[0]==="string")if(J=Q[0],typeof Q[2]==="object")X=Q[1],W=Q[2];else X=void 0,W=Q[1];else J="",X=Q[0],W=Q[1];try{W=t3(W)}catch(G){console.error(`JSON Schema Ref Parser: Error normalizing options: ${G}`)}if(!W.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:J,schema:X,options:W,callback:q}}var H1;var Z9=O(()=>{K5();H1=tW});function eW(Z,J){if(!J.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?z0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=V5(Z.schema,Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,J);return Promise.all(W)}catch(X){return Promise.reject(X)}}function V5(Z,J,X,W,q,Q,G,z){G||=new Set;let Y=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!G.has(Z)){G.add(Z);let U=X;if(p.isExternal$Ref(Z))Y.push(Zq(Z,J,U,W,q,Q));let K=Object.keys(Z);for(let V of K){let B=F0.join(J,V),$=Z[V],A=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?z0(U,$):U;Y=Y.concat(V5($,B,A,W,q,Q,G,z))}}return Y}async function Zq(Z,J,X,W,q,Q){let z=Q.dereference?.externalReferenceResolution==="root"?K4():W?X:J,Y=o(z,Z.$ref),U=i(Y),K=q._get$Ref(U);if(K)return Promise.resolve(K.value);try{let V=Z.$ref,B={url:Y,baseUrl:z};if(typeof V==="string")B.reference=V;let $=await m1(B,q,Q),A=q._get$Ref(U),D=V5($,U+"#",U,A?.dynamicIdScope??!1,q,Q,new Set,!0);return Promise.all(D)}catch(V){if(!Q?.continueOnError||!k0(V))throw V;if(q._$refs[U])V.source=decodeURI(i(J)),V.path=x1(O0(J));return[]}}var J9;var X9=O(()=>{k4();q1();d6();$0();R0();V4();J9=eW});function Jq(Z,J){let X=Z.$refs._root$Ref.dynamicIdScope?z0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];H5(Z,"schema",Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,J);let q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(Xq(W,J,q),(J.bundle||{}).optimizeInternalRefs!==!1)Qq(W,Z.schema)}function H5(Z,J,X,W,q,Q,G,z,Y,U){let K=J===null?Z:Z[J],V=U.bundle||{},B=V.excludedPathMatcher||(()=>!1);if(K&&typeof K==="object"&&!ArrayBuffer.isView(K)&&!B(Q)){let $=W;if(p.isAllowed$Ref(K))W9(Z,J,X,$,q,Q,G,z,Y,U);else{let A=Object.keys(K).sort((D,L)=>{if(D==="definitions"||D==="$defs")return-1;else if(L==="definitions"||L==="$defs")return 1;else return D.length-L.length});for(let D of A){let L=F0.join(X,D),w=F0.join(Q,D),I=K[D],j=q&&I&&typeof I==="object"&&!ArrayBuffer.isView(I)?z0($,I):$;if(p.isAllowed$Ref(I))W9(K,D,L,j,q,w,G,z,Y,U);else H5(K,D,L,j,q,w,G,z,Y,U);if(I&&typeof I==="object"&&!Array.isArray(I)){if("$ref"in I)V?.onBundle?.(I.$ref,K[D],K,D)}}}}}function W9(Z,J,X,W,q,Q,G,z,Y,U){let K=J===null?Z:Z[J],V=o(q?W:X,K.$ref),B=Y._resolve(V,Q,U);if(B===null)return;let A=F0.parse(Q).length,D=i(B.path),L=O0(B.path),w=D!==Y._root$Ref.path&&!Y._aliases[D],I=p.isExtended$Ref(K);G+=B.indirections;let j=Wq(z,Z,J);if(j)if(A<j.depth||G<j.indirections)qq(z,j);else return;if(z.push({$ref:K,parent:Z,key:J,pathFromRoot:Q,depth:A,file:D,hash:L,value:B.value,circular:B.circular,extended:I,external:w,indirections:G}),!j||w)H5(B.value,null,B.path,B.$ref.path,B.$ref.dynamicIdScope,Q,G+1,z,Y,U)}function Xq(Z,J,X){Z.sort((G,z)=>{if(G.file!==z.file)return G.file<z.file?-1:1;else if(G.hash!==z.hash)return G.hash<z.hash?-1:1;else if(G.circular!==z.circular)return G.circular?-1:1;else if(G.extended!==z.extended)return G.extended?1:-1;else if(G.indirections!==z.indirections)return G.indirections-z.indirections;else if(G.depth!==z.depth)return G.depth-z.depth;else{let Y=Math.max(G.pathFromRoot.lastIndexOf("/definitions"),G.pathFromRoot.lastIndexOf("/$defs")),U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs"));if(Y!==U)return U-Y;else return G.pathFromRoot.length-z.pathFromRoot.length}});let W,q,Q;for(let G of Z){let z=J.bundle||{};if(!G.external){if(z.optimizeInternalRefs!==!1)G.$ref.$ref=G.hash}else if(G.file===W&&G.hash===q)if(X&&q9(Z,G))G.$ref.$ref=X+Q;else G.$ref.$ref=Q;else if(G.file===W&&G.hash.indexOf(q+"/")===0){let Y=F0.join(Q,F0.parse(G.hash.replace(q,"#")));if(X&&q9(Z,G))G.$ref.$ref=X+Y;else G.$ref.$ref=Y}else if(W=G.file,q=G.hash,Q=G.pathFromRoot,G.$ref=G.parent[G.key]=p.dereference(G.$ref,G.value,J),G.circular)G.$ref.$ref=G.pathFromRoot}}function Wq(Z,J,X){for(let W of Z)if(W&&W.parent===J&&W.key===X)return W;return}function qq(Z,J){let X=Z.indexOf(J);Z.splice(X,1)}function Qq(Z,J){for(let X of Z){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let W=X.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let q=Gq(J,W);if(q!==W)X.$ref.$ref=q}}function Gq(Z,J){if(!J.startsWith("#/"))return J;let X=J.slice(2).split("/"),W=Z,q=[];for(let G of X){if(W===null||W===void 0||typeof W!=="object")return J;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let U=W.$ref.slice(2).split("/");if(q.length=0,q.push(...U),W=Yq(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return J}let z=G.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(W)?parseInt(z):z;W=W[Y],q.push(G)}return"#/"+q.join("/")}function Yq(Z,J){if(!J.startsWith("#/"))return;let X=J.slice(2).split("/"),W=Z;for(let q of X){if(W===null||W===void 0||typeof W!=="object")return;let Q=q.replace(/~1/g,"/").replace(/~0/g,"~"),G=Array.isArray(W)?parseInt(Q):Q;W=W[G]}return W}function q9(Z,J){for(let X of Z){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(J.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var Q9;var G9=O(()=>{k4();q1();$0();V4();Q9=Jq});function zq(Z,J){let X=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?z0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=B5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,J,X,0);Z.$refs.circular=q.circular,Z.schema=q.value}function B5(Z,J,X,W,q,Q,G,z,Y,U,K,V){let B,$={value:Z,circular:!1};z9(K,U);let A=U.dereference||{},D=A.maxDepth??500;if(V>D)throw RangeError(`Maximum dereference depth (${D}) exceeded at ${q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let L=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!G.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!L(q)){Q.add(Z),G.add(Z);let w=X;if(p.isAllowed$Ref(Z,U))B=Y9(Z,J,w,W,q,Q,G,z,Y,U,K,V),$.circular=B.circular,$.value=B.value;else for(let I of Object.keys(Z)){z9(K,U);let j=F0.join(J,I),v=F0.join(q,I);if(L(v))continue;let y=Z[I],E=W&&y&&typeof y==="object"&&!ArrayBuffer.isView(y)?z0(w,y):w,g;if(p.isAllowed$Ref(y,U)){if(B=Y9(y,j,E,W,v,Q,G,z,Y,U,K,V),g=B.circular,Z[I]!==B.value){let N=new Map;if(A?.preservedProperties){if(typeof Z[I]==="object"&&!Array.isArray(Z[I]))A?.preservedProperties.forEach((f)=>{if(f in Z[I])N.set(f,Z[I][f])})}let k=B.value;if(A?.cloneReferences&&!g&&k&&typeof k==="object")k=structuredClone(k);if(Z[I]=k,A?.preservedProperties){if(N.size&&typeof Z[I]==="object"&&!Array.isArray(Z[I]))N.forEach((f,d)=>{Z[I][d]=f})}A?.onDereference?.(y.$ref,Z[I],Z,I)}}else if(!Q.has(y)){if(B=B5(y,j,E,W,v,Q,G,z,Y,U,K,V+1),g=B.circular,Z[I]!==B.value)Z[I]=B.value}else g=n1(j,Y,U);$.circular=$.circular||g}Q.delete(Z)}}return $}function Y9(Z,J,X,W,q,Q,G,z,Y,U,K,V){let A=p.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?K4():W?X:J,D=o(A,Z.$ref),L=z.get(D);if(L){if(!L.circular){let E=Object.keys(Z);if(E.length>1){let g={};for(let N of E)if(N!=="$ref"&&!(N in L.value))g[N]=Z[N];return{circular:L.circular,value:Object.assign({},L.value,g)}}return L}if(typeof L.value==="object"&&"$ref"in L.value&&"$ref"in Z){if(L.value.$ref===Z.$ref)return n1(J,Y,U),L}else return n1(J,Y,U),L}let w=Y._resolve(D,J,U);if(w===null)return{circular:!1,value:null};let I=w.circular,j=I||Q.has(w.value);if(j)n1(J,Y,U);let v=p.dereference(Z,w.value,U);if(!j){let E=B5(v,w.path,w.$ref.path,w.$ref.dynamicIdScope,q,Q,G,z,Y,U,K,V+1);j=E.circular,v=E.value}if(j&&!I&&U.dereference?.circular==="ignore")v=Z;if(I)v.$ref=q;let y={circular:j,value:v};if(Object.keys(Z).length===1)z.set(D,y);return y}function z9(Z,J){if(J&&J.timeoutMs){if(Date.now()-Z>J.timeoutMs)throw new y6(J.timeoutMs)}}function n1(Z,J,X){if(J.circular=!0,X?.dereference?.onCircular?.(Z),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var U9;var K9=O(()=>{k4();q1();$0();V4();R0();U9=zq});function Uq(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(J){setTimeout(J,0)}}var $5;var V9=O(()=>{$5=Uq()});function D0(Z,J){if(Z){J.then(function(X){$5(function(){Z(null,X)})},function(X){$5(function(){Z(X)})});return}else return J}var H9=O(()=>{V9()});class b0{schema=null;$refs=new G1;async parse(){let Z=H1(arguments),J;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return D0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new G1;let X="http";if(O1(Z.path))Z.path=E7(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=C4(Z.schema.$id),q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${q}`}if(Z.path=o(K4(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=X,W.dynamicIdScope=v1(W.value),y1(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),J=Promise.resolve(Z.schema)}else J=m1(Z.path,this.$refs,Z.options);try{let W=await J;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,D0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,D0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!k0(W))return D0(Z.callback,Promise.reject(W));if(this.$refs._$refs[i(Z.path)])this.$refs._$refs[i(Z.path)].addError(W);return D0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new b0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=H1(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await J9(this,Z.options),F5(this),D0(Z.callback,Promise.resolve(this.$refs))}catch(J){return D0(Z.callback,Promise.reject(J))}}static resolve(){let Z=new b0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new b0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=H1(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),Q9(this,Z.options),F5(this),D0(Z.callback,Promise.resolve(this.schema))}catch(J){return D0(Z.callback,Promise.reject(J))}}static dereference(){let Z=new b0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=H1(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),U9(this,Z.options),F5(this),D0(Z.callback,Promise.resolve(this.schema))}catch(J){return D0(Z.callback,Promise.reject(J))}}}function F5(Z){if(O4.getParserErrors(Z).length>0)throw new O4(Z)}var B9,hV,mV,fV,uV;var $9=O(()=>{y7();d6();Z9();X9();G9();K9();$0();Y5();U5();R0();H9();V4();K5();$0();B9=b0;hV=b0.parse,mV=b0.resolve,fV=b0.bundle,uV=b0.dereference});async function r1(Z,J={}){let{baseUrl:X="/_jx/server"}=J,W=await B9.dereference(Z),q=E1(W);if(q.length===0)return null;let Q=q.map(({exportName:z,src:Y})=>`import { ${z} } from '${Y}'`).join(`
55
- `),G=q.map(({exportName:z})=>F9(z,X)).join(`
54
+ `)}`);throw J.status=Q.status,new x0(J)}else if(!("location"in Q.headers)||!Q.headers.location){let J=Error(`HTTP ${Q.status} redirect with no location header`);throw J.status=Q.status,J}else{let J=r(Z.href,Q.headers.location);return E9(J,X,W)}else{if(Q.body){let J=await Q.arrayBuffer();return Buffer.from(J)}return Buffer.alloc(0)}}catch(Q){let J=Q;throw J.message=`Error downloading ${Z.href}: ${J.message}`,new x0(J,Z.href)}}async function EJ(Z,X){let q,W;if(X.timeout&&typeof AbortController<"u")q=new AbortController,W=setTimeout(()=>q.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:q?q.signal:null});if(W)clearTimeout(W);return Q}var E5;var C5=R(()=>{H0();P0();E5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return G8(Z.url)&&(!this.safeUrlResolver||!X5(Z.url))},read(Z){let X=u6(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=u6(location.href).protocol;return E9(X,this)}}});function k9(Z,X){if(C9(X)){let q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<q.length;W++){let Q=q[W],J=X[Q],z=Z[Q];if(C9(J))Z[Q]=k9(z||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function C9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var O9=()=>{return{parse:{json:{...M8},yaml:{...N9},text:{...R9},binary:{...P9}},resolve:{file:{...P5},http:{...E5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},x9=(Z)=>{let X=O9();if(Z)k9(X,Z);return X};var O5=R(()=>{L8();T9();_9();j9();j5();C5()});function CJ(Z){let X,q,W,Q,J=Array.prototype.slice.call(Z);if(typeof J[J.length-1]==="function")Q=J.pop();if(typeof J[0]==="string")if(X=J[0],typeof J[2]==="object")q=J[1],W=J[2];else q=void 0,W=J[1];else X="",q=J[0],W=J[1];try{W=x9(W)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!W.mutateInputSchema&&typeof q==="object")q=JSON.parse(JSON.stringify(q));return{path:X,schema:q,options:W,callback:Q}}var N4;var S9=R(()=>{O5();N4=CJ});function OJ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=x5(Z.schema,Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(q){return Promise.reject(q)}}function x5(Z,X,q,W,Q,J,z,Y){z||=new Set;let U=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let K=q;if(d.isExternal$Ref(Z))U.push(xJ(Z,X,K,W,Q,J));let V=Object.keys(Z);for(let B of V){let H=$0.join(X,B),$=Z[B],F=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?U0(K,$):K;U=U.concat(x5($,H,F,W,Q,J,z,Y))}}return U}async function xJ(Z,X,q,W,Q,J){let Y=J.dereference?.externalReferenceResolution==="root"?R6():W?q:X,U=r(Y,Z.$ref),K=n(U),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:U,baseUrl:Y};if(typeof B==="string")H.reference=B;let $=await Z1(H,Q,J),F=Q._get$Ref(K),L=x5($,K+"#",K,F?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(L)}catch(B){if(!J?.continueOnError||!g0(B))throw B;if(Q._$refs[K])B.source=decodeURI(n(X)),B.path=n4(v0(X));return[]}}var b9;var v9=R(()=>{p6();$4();Y5();H0();P0();_6();b9=OJ});function kJ(Z,X){let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];k5(Z,"schema",Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SJ(W,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)yJ(W,Z.schema)}function k5(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(J)){let $=W;if(d.isAllowed$Ref(V))y9(Z,X,q,$,Q,J,z,Y,U,K);else{let F=Object.keys(V).sort((L,A)=>{if(L==="definitions"||L==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return L.length-A.length});for(let L of F){let A=$0.join(q,L),I=$0.join(J,L),M=V[L],_=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U0($,M):$;if(d.isAllowed$Ref(M))y9(V,L,A,_,Q,I,z,Y,U,K);else k5(V,L,A,_,Q,I,z,Y,U,K);if(M&&typeof M==="object"&&!Array.isArray(M)){if("$ref"in M)B?.onBundle?.(M.$ref,V[L],V,L)}}}}}function y9(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=r(Q?W:q,V.$ref),H=U._resolve(B,J,K);if(H===null)return;let F=$0.parse(J).length,L=n(H.path),A=v0(H.path),I=L!==U._root$Ref.path&&!U._aliases[L],M=d.isExtended$Ref(V);z+=H.indirections;let _=bJ(Y,Z,X);if(_)if(F<_.depth||z<_.indirections)vJ(Y,_);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:J,depth:F,file:L,hash:A,value:H.value,circular:H.circular,extended:M,external:I,indirections:z}),!_||I)k5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,J,z+1,Y,U,K)}function SJ(Z,X,q){Z.sort((z,Y)=>{if(z.file!==Y.file)return z.file<Y.file?-1:1;else if(z.hash!==Y.hash)return z.hash<Y.hash?-1:1;else if(z.circular!==Y.circular)return z.circular?-1:1;else if(z.extended!==Y.extended)return z.extended?1:-1;else if(z.indirections!==Y.indirections)return z.indirections-Y.indirections;else if(z.depth!==Y.depth)return z.depth-Y.depth;else{let U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(U!==K)return K-U;else return z.pathFromRoot.length-Y.pathFromRoot.length}});let W,Q,J;for(let z of Z){let Y=X.bundle||{};if(!z.external){if(Y.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===W&&z.hash===Q)if(q&&g9(Z,z))z.$ref.$ref=q+J;else z.$ref.$ref=J;else if(z.file===W&&z.hash.indexOf(Q+"/")===0){let U=$0.join(J,$0.parse(z.hash.replace(Q,"#")));if(q&&g9(Z,z))z.$ref.$ref=q+U;else z.$ref.$ref=U}else if(W=z.file,Q=z.hash,J=z.pathFromRoot,z.$ref=z.parent[z.key]=d.dereference(z.$ref,z.value,X),z.circular)z.$ref.$ref=z.pathFromRoot}}function bJ(Z,X,q){for(let W of Z)if(W&&W.parent===X&&W.key===q)return W;return}function vJ(Z,X){let q=Z.indexOf(X);Z.splice(q,1)}function yJ(Z,X){for(let q of Z){if(!q.$ref||typeof q.$ref!=="object"||!("$ref"in q.$ref))continue;let W=q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let Q=gJ(X,W);if(Q!==W)q.$ref.$ref=Q}}function gJ(Z,X){if(!X.startsWith("#/"))return X;let q=X.slice(2).split("/"),W=Z,Q=[];for(let z of q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),W=hJ(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let Y=z.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(W)?parseInt(Y):Y;W=W[U],Q.push(z)}return"#/"+Q.join("/")}function hJ(Z,X){if(!X.startsWith("#/"))return;let q=X.slice(2).split("/"),W=Z;for(let Q of q){if(W===null||W===void 0||typeof W!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(W)?parseInt(J):J;W=W[z]}return W}function g9(Z,X){for(let q of Z){if(q.pathFromRoot==="#"||q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(q.pathFromRoot+"/")){if(q.value&&typeof q.value==="object"&&"$id"in q.value)return!0}}return!1}var h9;var m9=R(()=>{p6();$4();H0();_6();h9=kJ});function mJ(Z,X){let q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=S5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,q,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function S5(Z,X,q,W,Q,J,z,Y,U,K,V,B){let H,$={value:Z,circular:!1};u9(V,K);let F=K.dereference||{},L=F.maxDepth??500;if(B>L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=F.excludedPathMatcher||(()=>!1);if(F?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),z.add(Z);let I=q;if(d.isAllowed$Ref(Z,K))H=f9(Z,X,I,W,Q,J,z,Y,U,K,V,B),$.circular=H.circular,$.value=H.value;else for(let M of Object.keys(Z)){u9(V,K);let _=$0.join(X,M),k=$0.join(Q,M);if(A(k))continue;let b=Z[M],C=W&&b&&typeof b==="object"&&!ArrayBuffer.isView(b)?U0(I,b):I,T;if(d.isAllowed$Ref(b,K)){if(H=f9(b,_,C,W,k,J,z,Y,U,K,V,B),T=H.circular,Z[M]!==H.value){let j=new Map;if(F?.preservedProperties){if(typeof Z[M]==="object"&&!Array.isArray(Z[M]))F?.preservedProperties.forEach((g)=>{if(g in Z[M])j.set(g,Z[M][g])})}let S=H.value;if(F?.cloneReferences&&!T&&S&&typeof S==="object")S=structuredClone(S);if(Z[M]=S,F?.preservedProperties){if(j.size&&typeof Z[M]==="object"&&!Array.isArray(Z[M]))j.forEach((g,f)=>{Z[M][f]=g})}F?.onDereference?.(b.$ref,Z[M],Z,M)}}else if(!J.has(b)){if(H=S5(b,_,C,W,k,J,z,Y,U,K,V,B+1),T=H.circular,Z[M]!==H.value)Z[M]=H.value}else T=G1(_,U,K);$.circular=$.circular||T}J.delete(Z)}}return $}function f9(Z,X,q,W,Q,J,z,Y,U,K,V,B){let F=d.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?R6():W?q:X,L=r(F,Z.$ref),A=Y.get(L);if(A){if(!A.circular){let C=Object.keys(Z);if(C.length>1){let T={};for(let j of C)if(j!=="$ref"&&!(j in A.value))T[j]=Z[j];return{circular:A.circular,value:Object.assign({},A.value,T)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return G1(X,U,K),A}else return G1(X,U,K),A}let I=U._resolve(L,X,K);if(I===null)return{circular:!1,value:null};let M=I.circular,_=M||J.has(I.value);if(_)G1(X,U,K);let k=d.dereference(Z,I.value,K);if(!_){let C=S5(k,I.path,I.$ref.path,I.$ref.dynamicIdScope,Q,J,z,Y,U,K,V,B+1);_=C.circular,k=C.value}if(_&&!M&&K.dereference?.circular==="ignore")k=Z;if(M)k.$ref=Q;let b={circular:_,value:k};if(Object.keys(Z).length===1)Y.set(L,b);return b}function u9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new q5(X.timeoutMs)}}function G1(Z,X,q){if(X.circular=!0,q?.dereference?.onCircular?.(Z),!q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var d9;var c9=R(()=>{p6();$4();H0();_6();P0();d9=mJ});function fJ(){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 b5;var l9=R(()=>{b5=fJ()});function w0(Z,X){if(Z){X.then(function(q){b5(function(){Z(null,q)})},function(q){b5(function(){Z(q)})});return}else return X}var p9=R(()=>{l9()});class o0{schema=null;$refs=new A4;async parse(){let Z=N4(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return w0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new A4;let q="http";if(p4(Z.path))Z.path=Y8(Z.path),q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=u6(Z.schema.$id),Q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${Q}`}if(Z.path=r(R6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=q,W.dynamicIdScope=s4(W.value),o4(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Z1(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,w0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,w0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!g0(W))return w0(Z.callback,Promise.reject(W));if(this.$refs._$refs[n(Z.path)])this.$refs._$refs[n(Z.path)].addError(W);return w0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=N4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await b9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.$refs))}catch(X){return w0(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),h9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),d9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}}function v5(Z){if(c6.getParserErrors(Z).length>0)throw new c6(Z)}var VF,BF,HF,n9;var i9=R(()=>{F8();Y5();S9();v9();m9();c9();H0();j5();C5();P0();p9();_6();O5();H0();VF=o0.parse,BF=o0.resolve,HF=o0.bundle,n9=o0.dereference});async function Y1(Z,X={}){let{baseUrl:q="/_jx/server"}=X,W=await n9(Z),Q=l4(W);if(Q.length===0)return null;let J=Q.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
55
+ `),z=Q.map(({exportName:Y})=>r9(Y,q)).join(`
56
56
  `);return`// Generated by @jxsuite/compiler — do not edit manually
57
57
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
58
58
  // Requires: npm install hono
59
59
 
60
60
  import { Hono } from 'hono'
61
- ${Q}
61
+ ${J}
62
62
 
63
63
  const app = new Hono()
64
- ${G}
64
+ ${z}
65
65
 
66
66
  export default app
67
- `}function M5(Z,J={}){let{baseUrl:X="/_jx/server",adapter:W=null}=J;if(Z.length===0&&!W)return null;let q=Z.map(({exportName:z,src:Y})=>`import { ${z} } from '${Y}'`).join(`
68
- `),Q=Z.map(({exportName:z})=>F9(z,X)).join(`
67
+ `}function y5(Z,X={}){let{baseUrl:q="/_jx/server",adapter:W=null}=X;if(Z.length===0&&!W)return null;let Q=Z.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
68
+ `),J=Z.map(({exportName:Y})=>r9(Y,q)).join(`
69
69
  `);return`// Generated by @jxsuite/compiler — do not edit manually
70
70
  import { Hono } from 'hono'
71
- ${q}
71
+ ${Q}
72
72
 
73
73
  const app = new Hono()
74
- ${Q}
74
+ ${J}
75
75
  ${W==="cloudflare-workers"||W==="cloudflare-pages"?`
76
76
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
77
77
  `:`
78
78
  `}
79
79
  export default app
80
- `}function F9(Z,J){return`
81
- app.post('${J}/${Z}', async (c) => {
80
+ `}function r9(Z,X){return`
81
+ app.post('${X}/${Z}', async (c) => {
82
82
  const args = await c.req.json().catch(() => ({}))
83
83
  try {
84
84
  return c.json(await ${Z}(args, c.env))
85
85
  } catch (e) {
86
86
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
87
87
  }
88
- })`}var M9=O(()=>{$9();U4()});class I9{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#J=null;constructor(Z,J,X,W){this.name=Z,this.classPath=J,this.classDef=X,this.#Z=W;let q=X.format;this.extensions=(q.extensions??[]).map((Q)=>Q.toLowerCase()),this.mediaType=q.mediaType??null,this.documentKinds=q.documentKinds??[],this.exportTarget=q.exportTarget===!0,this.remote=q.remote===!0,this.studio=X.$studio??null,this.capabilities=Vq(X)}implementation(){if(!this.#J){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#J=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#J}async call(Z,...J){let X=this.capabilities[Z];if(!X)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),q=this.classDef.title??this.name,Q=W[q]??W.default?.[q]??W.default,G=Q?.[X.identifier];if(typeof G!=="function")throw Error(`Format class "${this.name}": implementation export "${q}" has no static "${X.identifier}" method`);return await G.call(Q,...J)}}class D9{#Z;constructor(Z){this.#Z=Z;for(let J of L9){let X=new Map;for(let W of Z){if(!W.capabilities[J])continue;for(let q of W.extensions){let Q=X.get(q);if(Q)throw Error(`Format conflict: "${Q.name}" and "${W.name}" both claim "${q}" with the "${J}" capability`);X.set(q,W)}}}}get entries(){return this.#Z}byExtension(Z,J){let X=A9(Z);return this.#Z.find((W)=>W.extensions.includes(X)&&(!J||W.capabilities[J]))}byName(Z){return this.#Z.find((J)=>J.name===Z)}withCapability(Z){return this.#Z.filter((J)=>J.capabilities[Z])}documentExtensions(Z){let J=new Set;for(let X of this.#Z){if(Z&&!X.documentKinds.includes(Z))continue;for(let W of X.extensions)J.add(W)}return J.delete(".json"),[...J]}has(Z){let J=A9(Z);return this.#Z.some((X)=>X.extensions.includes(J))}}async function w9(Z,J,X){let W=[];for(let[q,Q]of Object.entries(Z??{})){if(typeof Q!=="string"||!Q.endsWith(".class.json"))continue;let G=X?J.resolvePath(X,Q):Q,z;try{z=await J.loadJson(G)}catch{continue}if(!z||typeof z!=="object")continue;if(!z.format||!Array.isArray(z.format.extensions))continue;W.push(new I9(q,G,z,J))}return new D9(W)}function Vq(Z){let J={},X=Z.$defs?.methods??{};for(let[W,q]of Object.entries(X)){let Q=q.role;if(!Q||!L9.includes(Q))continue;J[Q]={identifier:q.identifier??W,timing:q.timing??Kq}}return J}function A9(Z){let J=Z.toLowerCase();return J.startsWith(".")?J:`.${J}`}var L9,Kq;var N9=O(()=>{L9=["parse","serialize","discover","load"],Kq=["compiler","server"]});var I5={};P6(I5,{unknownFormatError:()=>L5,importImplementation:()=>a1,createNodeFormatIO:()=>T9,buildProjectFormatRegistry:()=>B1});import{readFileSync as Hq}from"node:fs";import{dirname as Bq,resolve as A5,isAbsolute as $q,sep as i1}from"node:path";import{pathToFileURL as Fq}from"node:url";import{createRequire as Mq}from"node:module";async function a1(Z){let J=[Z],X=`${i1}src${i1}`,W=`${i1}dist${i1}`;if(Z.includes(X))J.push(Z.replace(X,W));if(Z.endsWith(".js"))J.push(Z.slice(0,-3)+".ts");let q;for(let Q of J)try{return await import(Fq(Q).href)}catch(G){q=G}throw q}function T9(Z){return{loadJson:async(J)=>JSON.parse(Hq(J,"utf-8")),importModule:(J)=>a1(J),resolvePath:(J,X)=>{if(X.startsWith("./")||X.startsWith("../"))return A5(Bq(J),X);if($q(X))return X;return Mq(A5(Z,"package.json")).resolve(X)}}}async function B1(Z,J){return w9(J?.imports,T9(Z),A5(Z,"project.json"))}function L5(Z,J){return Error(`No format class imported for "${J}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var g4=O(()=>{N9()});async function o1(Z,J={}){let{resolveElementPath:X,$media:W,formats:q}=J,Q=[],G=new Set;async function z(Y,U){let K,V;if(typeof Y==="string"){let{readFileSync:j}=await import("node:fs"),{resolve:v}=await import("node:path");if(V=U?v(U,Y):v(Y),G.has(V))return;if(G.add(V),V.endsWith(".json"))K=JSON.parse(j(V,"utf8"));else{let{extname:y}=await import("node:path"),E=y(V).toLowerCase(),N=q?.byExtension?.(E,"parse");if(!N){let{unknownFormatError:k}=await Promise.resolve().then(() => (g4(),I5));throw k(V,E)}K=await N.call("parse",j(V,"utf8"))}}else{if(K=Y,V=null,G.has(K.tagName))return;G.add(K.tagName)}let B=K.tagName;if(!B||!B.includes("-"))throw Error(`compileElement: tagName "${B}" must contain a hyphen`);let{dirname:$}=await import("node:path"),A=V?$(V):null,D=[];if(Array.isArray(K.$elements))for(let j of K.$elements){let v=j.$ref??j;if(typeof v!=="string")continue;if(A)await z(v,A);let y;if(X)y=X(v,A);else y=v.replace(/\.json$/,".js");D.push(y)}let L=C1(B);if(W)K.$media={...W,...K.$media};let w=$1(K,L,D),I=V?V.replace(/\.json$/,".js"):`${B}.js`;Q.push({path:I,content:w,tagName:B})}return await z(Z,J.basePath??null),{files:Q}}async function Aq(Z,J={}){let{title:X="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:q="https://esm.sh/lit-html@3.3.0"}=J,Q=await o1(Z,J),G=Q.files[Q.files.length-1],{basename:z}=await import("node:path"),Y=z(G.path);return{html:`<!DOCTYPE html>
88
+ })`}var a9=R(()=>{i9();T6()});function t0(Z){return Z instanceof Error?Z.message:String(Z)}function g5(Z,X,q){let W;try{W=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${q} at ${X}: ${t0(Q)}`,{cause:Q})}if(!M0(W))throw Error(`Invalid ${q} at ${X}: expected a JSON object`);return W}function V6(Z,X){return g5(Z,X,"Jx document")}function s9(Z,X){return g5(Z,X,"project config")}function o9(Z,X){return g5(Z,X,"class definition")}var e0=R(()=>{S0()});class Z7{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,q,W){this.name=Z,this.classPath=X,this.classDef=q,this.#Z=W;let Q=q.format;this.extensions=(Q.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=Q.mediaType??null,this.documentKinds=Q.documentKinds??[],this.exportTarget=Q.exportTarget===!0,this.remote=Q.remote===!0,this.studio=q.$studio??null,this.capabilities=dJ(q)}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 q=this.capabilities[Z];if(!q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),Q=this.classDef.title??this.name,J=W[Q]??W.default?.[Q]??W.default,z=J?.[q.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${q.identifier}" method`);return await z.call(J,...X)}}class X7{#Z;constructor(Z){this.#Z=Z;for(let X of e9){let q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let Q of W.extensions){let J=q.get(Q);if(J)throw Error(`Format conflict: "${J.name}" and "${W.name}" both claim "${Q}" with the "${X}" capability`);q.set(Q,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let q=t9(Z);return this.#Z.find((W)=>W.extensions.includes(q)&&(!X||W.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 q of this.#Z){if(Z&&!q.documentKinds.includes(Z))continue;for(let W of q.extensions)X.add(W)}return X.delete(".json"),[...X]}has(Z){let X=t9(Z);return this.#Z.some((q)=>q.extensions.includes(X))}}async function q7(Z,X,q){let W=[];for(let[Q,J]of Object.entries(Z??{})){if(typeof J!=="string"||!J.endsWith(".class.json"))continue;let z,Y;try{z=q?X.resolvePath(q,J):J,Y=await X.loadJson(z)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;W.push(new Z7(Q,z,Y,X))}return new X7(W)}function dJ(Z){let X={},q=Z.$defs?.methods??{};for(let[W,Q]of Object.entries(q)){let J=Q.role;if(!J||!e9.includes(J))continue;X[J]={identifier:Q.identifier??W,timing:Q.timing??uJ}}return X}function t9(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var e9,uJ;var W7=R(()=>{e9=["parse","serialize","discover","load"],uJ=["compiler","server"]});var f5={};f4(f5,{unknownFormatError:()=>m5,importImplementation:()=>K1,createNodeFormatIO:()=>J7,buildProjectFormatRegistry:()=>T4});import{readFileSync as cJ}from"node:fs";import{dirname as lJ,isAbsolute as pJ,resolve as h5,sep as U1}from"node:path";import{pathToFileURL as nJ}from"node:url";import{createRequire as Q7}from"node:module";async function K1(Z){let X=[Z],q=`${U1}src${U1}`,W=`${U1}dist${U1}`;if(Z.includes(q))X.push(Z.replace(q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let J of X)try{return await import(nJ(J).href)}catch(z){Q=z}throw Q instanceof Error?Q:Error(String(Q))}function J7(Z){return{importModule:(X)=>K1(X),loadJson:async(X)=>JSON.parse(cJ(X,"utf8")),resolvePath:(X,q)=>{if(q.startsWith("./")||q.startsWith("../"))return h5(lJ(X),q);if(pJ(q))return q;let W=Q7(h5(Z,"package.json"));try{return W.resolve(q)}catch{return Q7(import.meta.url).resolve(q)}}}}async function T4(Z,X){return q7(X?.imports,J7(Z),h5(Z,"project.json"))}function m5(Z,X){return Error(`No format class imported for "${X}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var s6=R(()=>{W7()});async function B1(Z,X={}){let{resolveElementPath:q,$media:W,formats:Q}=X,J=[],z=new Set;async function Y(U,K){let V,B;if(typeof U==="string"){let{readFileSync:_}=await import("node:fs"),{resolve:k}=await import("node:path");if(B=K?k(K,U):k(U),z.has(B))return;if(z.add(B),B.endsWith(".json"))V=V6(_(B,"utf8"),B);else{let{extname:b}=await import("node:path"),C=b(B).toLowerCase(),T=Q?.byExtension?.(C,"parse");if(!T){let{unknownFormatError:j}=await Promise.resolve().then(() => (s6(),f5));throw j(B,C)}V=await T.call("parse",_(B,"utf8"))}}else{if(V=U,B=null,V.tagName&&z.has(V.tagName))return;if(V.tagName)z.add(V.tagName)}let{tagName:H}=V;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:$}=await import("node:path"),F=B?$(B):null,L=[];if(Array.isArray(V.$elements))for(let _ of V.$elements){let k=L0(_)?_.$ref:_;if(typeof k!=="string")continue;if(F)await Y(k,F);let b=q?q(k,F):k.replace(/\.json$/,".js");L.push(b)}let A=c4(H);if(W)V.$media={...W,...V.$media};let I=R4(V,A,L),M=B?B.replace(/\.json$/,".js"):`${H}.js`;J.push({content:I,path:M,tagName:H})}return await Y(Z,X.basePath??null),{files:J}}async function iJ(Z,X={}){let{title:q="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:Q="https://esm.sh/lit-html@3.3.0"}=X,J=await B1(Z,X),z=J.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),U=Y(z.path),K=`<!DOCTYPE html>
89
89
  <html lang="en">
90
90
  <head>
91
91
  <meta charset="utf-8">
92
92
  <meta name="viewport" content="width=device-width, initial-scale=1">
93
- <title>${m(X)}</title>
93
+ <title>${y(q)}</title>
94
94
  <script type="importmap">
95
95
  {
96
96
  "imports": {
97
97
  "@vue/reactivity": "${W}",
98
- "lit-html": "${q}"
98
+ "lit-html": "${Q}"
99
99
  }
100
100
  }
101
101
  </script>
102
102
  </head>
103
103
  <body>
104
- <${G.tagName}></${G.tagName}>
105
- <script type="module" src="./${Y}"></script>
104
+ <${z.tagName}></${z.tagName}>
105
+ <script type="module" src="./${U}"></script>
106
106
  </body>
107
- </html>`,files:Q.files}}function Lq(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(P4(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 $1(Z,J,X){let W=[];if(W.push("// Generated by @jxsuite/compiler — do not edit manually"),Z.$id)W.push(`// Source: ${Z.$id}`);for(let V of X)W.push(`import '${V}';`);let q=new Map,Q=Z.state??{};for(let[V,B]of Object.entries(Q)){let $=B;if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function"&&$.$src){let A=$.$src;if(!q.has(A))q.set(A,[]);q.get(A).push(V)}}for(let[V,B]of q)W.push(`import { ${B.join(", ")} } from '${V}';`);W.push("import { reactive, computed, effect } from '@vue/reactivity';"),W.push("import { render, html } from 'lit-html';"),W.push(""),W.push(`class ${J} extends HTMLElement {`),W.push(" #dispose = null;"),W.push(""),W.push(" constructor() {"),W.push(" super();");let G=[],z=[],Y=[];for(let[V,B]of Object.entries(Q)){let $=B;if($&&typeof $==="object"&&!Array.isArray($)&&"$expression"in $){let A=$.$expression;if(G4(A.operator))Y.push([V,$]);else z.push([V,$])}else if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function")if(typeof $.body==="string"&&$.body.includes("return"))z.push([V,$]);else Y.push([V,$]);else{let A=Lq($);if(A!==void 0)G.push([V,A])}}W.push(" this.state = reactive({");for(let[V,B]of G)W.push(` ${V}: ${B},`);W.push(" });");for(let[V,B]of Y)if(W.push(""),"$expression"in B){let $=L0(B.$expression,{statePrefix:"s",eventParam:"e"});W.push(` this.state.${V} = (s, e) => { ${$}; };`)}else if(B.$src){let A=(B.parameters??B.arguments??["state"]).join(", ");W.push(` this.state.${V} = (${A}) => ${V}(${A});`)}else{let A=(B.parameters??B.arguments??["state"]).join(", ");W.push(` this.state.${V} = (${A}) => {`),W.push(` ${B.body}`),W.push(" };")}for(let[V,B]of z)if(W.push(""),"$expression"in B){let $=L0(B.$expression,{statePrefix:"this.state",eventParam:"e"});W.push(` this.state.${V} = computed(() => ${$});`)}else if(B.$src)W.push(` this.state.${V} = computed(() => ${V}(this.state));`);else{W.push(` this.state.${V} = computed(() => {`);let $=B.body.replace(/state\./g,"this.state.");W.push(` ${$}`),W.push(" });")}W.push(" }"),W.push("");let U=[];if(Array.isArray(Z.children)){let V={n:0};for(let B of Z.children)X1(B,U,Z.$media??{},"",V,Z.tagName)}if(W.push(" template() {"),W.push(" const s = this.state;"),W.push(" return html`"),W.push(w5(Z.children,Z.style," ")),W.push(" `;"),W.push(" }"),W.push(""),W.push(" connectedCallback() {"),W.push(" const _pa = this.getAttribute('data-jx-props');"),W.push(" if (_pa) {"),W.push(" try {"),W.push(" const _p = JSON.parse(_pa);"),W.push(" for (const [k, v] of Object.entries(_p)) {"),W.push(" if (k in this.state) this.state[k] = v;"),W.push(" }"),W.push(" } catch {}"),W.push(" this.removeAttribute('data-jx-props');"),W.push(" }"),W.push(" for (const key of Object.keys(this.state)) {"),W.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),W.push(" this.state[key] = this[key];"),W.push(" }"),W.push(" }"),Z.style&&typeof Z.style==="object"){let V=[];for(let[B,$]of Object.entries(Z.style)){if(B.startsWith(":")||B.startsWith(".")||B.startsWith("&")||B.startsWith("[")||B.startsWith("@"))continue;if($===null||typeof $==="object")continue;let A=I0(B);if(typeof $==="string"&&$.includes("${"))V.push([A,$])}if(V.length>0){W.push(" effect(() => {");for(let[B,$]of V){let A=$.replace(/\$\{([^}]+)\}/g,(D,L)=>"${"+L.replace(/state\./g,"this.state.")+"}");W.push(` this.style['${B}'] = \`${A}\`;`)}W.push(" });")}}let K=R9(Z.children);if(K)W.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(W.push(" if (this.hasAttribute('data-jx-prerendered')) {"),W.push(" this.removeAttribute('data-jx-prerendered');"),W.push(" }"),W.push(" this.innerHTML = '';"),W.push(" this.#dispose = effect(() => render(this.template(), this));"),K)W.push(" const _slot = this.querySelector('slot');"),W.push(" if (_slot && _slotted.length > 0) {"),W.push(" for (const n of _slotted) _slot.before(n);"),W.push(" _slot.remove();"),W.push(" }");return W.push(" }"),W.push(""),W.push(" disconnectedCallback() {"),W.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),W.push(" }"),W.push("}"),W.push(""),W.push(`customElements.define('${Z.tagName}', ${J});`),W.push(""),W.join(`
108
- `)}function w5(Z,J,X){if(!Z)return"";if(Z.$prototype==="Array")return Dq(Z,X);if(!Array.isArray(Z))return"";return Z.map((W)=>Iq(W,X)).join(`
109
- `)}function Iq(Z,J){if(typeof Z==="string"){if(Z.includes("${"))return`${J}${D5(Z)}`;return`${J}${m(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${J}${m(String(Z))}`;if(!Z||typeof Z!=="object")return"";let X=Z.tagName??"div",W=[];if(Z.attributes)for(let[Y,U]of Object.entries(Z.attributes))if(typeof U==="string"&&U.includes("${"))W.push(`${Y}="${s1(U)}"`);else W.push(`${Y}="${U}"`);if(Z.id)W.push(`id="${Z.id}"`);if(Z.className)W.push(`class="${Z.className}"`);for(let[Y,U]of Object.entries(Z)){if(Y4.has(Y)||Y.startsWith("$")||Y.startsWith("on")||Y==="tagName"||Y==="id"||Y==="className"||Y==="style"||Y==="children"||Y==="textContent"||Y==="innerHTML"||Y==="attributes")continue;if(U&&typeof U==="object"&&U.$ref)W.push(`.${Y}="\${${$4(U.$ref)}}"`);else if(typeof U==="string"&&U.includes("${"))W.push(`.${Y}="${s1(U)}"`)}if(Z.$props)for(let[Y,U]of Object.entries(Z.$props))if(U&&typeof U==="object"&&U.$ref)W.push(`.${Y}="\${${$4(U.$ref)}}"`);else W.push(`.${Y}="\${${JSON.stringify(U)}}"`);for(let[Y,U]of Object.entries(Z)){if(!Y.startsWith("on")||Y==="observedAttributes")continue;let K=Y.slice(2).toLowerCase();if(U&&typeof U==="object"&&U.$ref)W.push(`@${K}="\${(e) => ${$4(U.$ref)}(s, e)}"`);else if(U&&typeof U==="object"&&"$expression"in U){let V=L0(U.$expression,{statePrefix:"s",eventParam:"e"});W.push(`@${K}="\${(e) => { ${V}; }}"`)}else if(U&&typeof U==="object"&&U.$prototype==="Function")W.push(`@${K}="\${(e) => { ${Nq(U)} }}"`)}let q=P9(Z.style);if(q)W.push(`style="${q}"`);let Q=W.length>0?`
110
- `+J+" "+W.join(`
111
- `+J+" "):"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${J}<${X}${Q}
112
- ${J}>`;let z="";if(Z.textContent!==void 0)z=D5(Z.textContent);else if(Z.innerHTML!==void 0)z=Z.innerHTML;else if(Z.children)z=`
113
- `+w5(Z.children,Z.style,J+" ")+`
114
- `+J;return`${J}<${X}${Q}
115
- ${J}>${z}</${X}>`}function Dq(Z,J){let X=Z.items?.$ref?$4(Z.items.$ref):"ITEMS",W=Z.map;if(!W)return"";let q=W.tagName??"div",Q=[];if(W.$props)for(let[U,K]of Object.entries(W.$props))if(K&&typeof K==="object"&&K.$ref)Q.push(`.${U}="\${${wq(K.$ref)}}"`);else Q.push(`.${U}="\${${JSON.stringify(K)}}"`);let G=P9(W.style);if(G)Q.push(`style="${G}"`);for(let[U,K]of Object.entries(W)){if(!U.startsWith("on"))continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)Q.push(`@${V}="\${(e) => ${$4(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let B=L0(K.$expression,{statePrefix:"s",eventParam:"e"});Q.push(`@${V}="\${(e) => { ${B}; }}"`)}}let z=Q.length>0?`
116
- `+J+" "+Q.join(`
117
- `+J+" "):"",Y="";if(W.textContent!==void 0)Y=D5(W.textContent);else if(W.children)Y=`
118
- `+w5(W.children,null,J+" ")+`
119
- `+J+" ";return`${J}\${${X}.map((item, index) => html\`
120
- ${J} <${q}${z}
121
- ${J} >${Y}</${q}>
122
- ${J}\`)}`}function $4(Z){if(Z.startsWith("#/state/"))return"s."+Z.slice(8).replace(/\//g,".");if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return"s."+Z}function wq(Z){if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return $4(Z)}function s1(Z){return Z.replace(/state\./g,"s.")}function D5(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${$4(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return s1(Z);return String(Z)}function Nq(Z){return(Z.body??"").replace(/(?<!this\.)state\./g,"s.").replace(/(?<!this\.)state(?!\.)/g,"s")}function P9(Z){if(!Z||typeof Z!=="object")return"";let J=[];for(let[X,W]of Object.entries(Z)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(W===null||typeof W==="object")continue;if(typeof W==="string"&&W.includes("${")){let q=I0(X);J.push(`${q}: ${s1(W)}`)}}return J.join("; ")}function R9(Z){if(!Array.isArray(Z))return!1;for(let J of Z){if(!J||typeof J!=="object")continue;if(J.tagName==="slot")return!0;if(R9(J.children))return!0}return!1}var t1=O(()=>{j1();U4()});function j9(Z,J){let{title:X,reactivitySrc:W,litHtmlSrc:q}=J,Q=R4(Z,null,Z.state??{},Z.$media??{}),G=_4(Z,Z.$media??{},J.projectStyle??null),z=[],Y=_9(Z,!1,Z,Q,z),U=[],K="",V="";if(z.length>0){for(let $ of z){let A=$1($.def,$.className,[]);U.push({path:`_islands/${$.tagName}.js`,content:A,tagName:$.tagName})}K=`<script type="importmap">
107
+ </html>`;return{files:J.files,html:K}}function rJ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(J6(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 R4(Z,X,q){let W=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)W.push(`// Source: ${Z.$id}`);for(let B of q)W.push(`import '${B}';`);let Q=new Map,J=Z.state??{};for(let[B,H]of Object.entries(J)){let $=H;if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function"&&$.$src){let F=$.$src;if(!Q.has(F))Q.set(F,[]);Q.get(F).push(B)}}for(let[B,H]of Q)W.push(`import { ${H.join(", ")} } from '${B}';`);W.push("import { reactive, computed, effect } from '@vue/reactivity';"),W.push("import { render, html } from 'lit-html';"),W.push(""),W.push(`class ${X} extends HTMLElement {`),W.push(" #dispose = null;"),W.push(""),W.push(" constructor() {"),W.push(" super();");let z=[],Y=[],U=[];for(let[B,H]of Object.entries(J)){let $=H;if(O0($)){let F=$.$expression;if(L6(F.operator))U.push([B,$]);else Y.push([B,$])}else if(i0($))if(typeof $.body==="string"&&$.body.includes("return"))Y.push([B,$]);else U.push([B,$]);else{let F=rJ($);if(F!==void 0)z.push([B,F])}}W.push(" this.state = reactive({");for(let[B,H]of z)W.push(` ${B}: ${H},`);W.push(" });");for(let[B,H]of U)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"s"});W.push(` this.state.${B} = (s, e) => { ${$}; };`)}else{let F=(H.parameters?z6(H.parameters):H.arguments??["state"]).join(", ");if(H.$src)W.push(` this.state.${B} = (${F}) => ${B}(${F});`);else W.push(` this.state.${B} = (${F}) => {`),W.push(` ${H.body??""}`),W.push(" };")}for(let[B,H]of Y)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${B} = computed(() => ${$});`)}else if(H.$src)W.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{W.push(` this.state.${B} = computed(() => {`);let $=(H.body??"").replaceAll("state.","this.state.");W.push(` ${$}`),W.push(" });")}W.push(" }"),W.push("");let K=[];if(Array.isArray(Z.children)){let B={n:0};for(let H of Z.children)G6(H,K,Z.$media??{},"",B,Z.tagName)}if(W.push(" template() {"),W.push(" const s = this.state;"),W.push(" return html`"),W.push(d5(Z.children,Z.style," ")),W.push(" `;"),W.push(" }"),W.push(""),W.push(" connectedCallback() {"),W.push(" const _pa = this.getAttribute('data-jx-props');"),W.push(" if (_pa) {"),W.push(" try {"),W.push(" const _p = JSON.parse(_pa);"),W.push(" for (const [k, v] of Object.entries(_p)) {"),W.push(" if (k in this.state) this.state[k] = v;"),W.push(" }"),W.push(" } catch {}"),W.push(" this.removeAttribute('data-jx-props');"),W.push(" }"),W.push(" for (const key of Object.keys(this.state)) {"),W.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),W.push(" this.state[key] = this[key];"),W.push(" }"),W.push(" }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[H,$]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if($===null||typeof $==="object")continue;let F=I0(H);if(typeof $==="string"&&$.includes("${"))B.push([F,$])}if(B.length>0){W.push(" effect(() => {");for(let[H,$]of B){let F=$.replaceAll(/\$\{([^}]+)\}/g,(L,A)=>`\${${A.replaceAll("state.","this.state.")}}`);W.push(` this.style['${H}'] = \`${F}\`;`)}W.push(" });")}}let V=Y7(Z.children);if(V)W.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(W.push(" if (this.hasAttribute('data-jx-prerendered')) {"),W.push(" this.removeAttribute('data-jx-prerendered');"),W.push(" }"),W.push(" this.innerHTML = '';"),W.push(" this.#dispose = effect(() => render(this.template(), this));"),V)W.push(" const _slot = this.querySelector('slot');"),W.push(" if (_slot && _slotted.length > 0) {"),W.push(" for (const n of _slotted) _slot.before(n);"),W.push(" _slot.remove();"),W.push(" }");return W.push(" }"),W.push(""),W.push(" disconnectedCallback() {"),W.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),W.push(" }"),W.push("}"),W.push(""),W.push(`customElements.define('${Z.tagName}', ${X});`),W.push(""),W.join(`
108
+ `)}function d5(Z,X,q){if(!Z)return"";if(w6(Z))return aJ(Z,q);if(!Array.isArray(Z))return"";return Z.map((W)=>z7(W,q)).join(`
109
+ `)}function z7(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${u5(Z)}`;return`${X}${y(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${y(String(Z))}`;if(!Z||typeof Z!=="object")return"";let q=Z.tagName??"div",W=[];if(Z.attributes)for(let[U,K]of Object.entries(Z.attributes))if(K&&typeof K==="object"&&L0(K))W.push(`${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`${U}="${V1(K)}"`);else W.push(`${U}="${K}"`);if(Z.id)W.push(`id="${Z.id}"`);if(Z.className)W.push(`class="${Z.className}"`);for(let[U,K]of Object.entries(Z)){if(D6.has(U)||U.startsWith("$")||U.startsWith("on")||U==="tagName"||U==="id"||U==="className"||U==="style"||U==="children"||U==="textContent"||U==="innerHTML"||U==="attributes")continue;if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`.${U}="${V1(K)}"`)}if(Z.$props)for(let[U,K]of Object.entries(Z.$props))if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else W.push(`.${U}="\${${JSON.stringify(K)}}"`);for(let[U,K]of Object.entries(Z)){if(!U.startsWith("on")||U==="observedAttributes")continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)W.push(`@${V}="\${(e) => ${Z6(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let B=T0(K.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${V}="\${(e) => { ${B}; }}"`)}else if(i0(K))W.push(`@${V}="\${(e) => { ${oJ(K)} }}"`)}let Q=G7(Z.style);if(Q)W.push(`style="${Q}"`);let J=W.length>0?`
110
+ ${X} ${W.join(`
111
+ ${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(q))return`${X}<${q}${J}
112
+ ${X}>`;let Y="";if(Z.$switch){let U=L0(Z.$switch)?Z.$switch.$ref:Z.$switch,K=Z6(U),V=Z.cases??{},B=[];for(let[H,$]of Object.entries(V)){if(!$||L0($))continue;let F=z7($,`${X} `);B.push(` ${JSON.stringify(H)}: html\`
113
+ ${F}
114
+ \``)}Y=`\${{
115
+ ${B.join(`,
116
+ `)}
117
+ }[${K}]}`}else if(Z.textContent!==void 0)Y=u5(Z.textContent);else if(Z.innerHTML!==void 0)Y=Z.innerHTML;else if(Z.children)Y=`
118
+ ${d5(Z.children,Z.style,`${X} `)}
119
+ ${X}`;return`${X}<${q}${J}
120
+ ${X}>${Y}</${q}>`}function aJ(Z,X){let q=L0(Z.items)?Z6(Z.items.$ref):"ITEMS",W=Z.map;if(!W)return"";let Q=W.tagName??"div",J=[];if(W.$props)for(let[K,V]of Object.entries(W.$props))if(L0(V))J.push(`.${K}="\${${sJ(V.$ref)}}"`);else J.push(`.${K}="\${${JSON.stringify(V)}}"`);let z=G7(W.style);if(z)J.push(`style="${z}"`);for(let[K,V]of Object.entries(W)){if(!K.startsWith("on"))continue;let B=K.slice(2).toLowerCase();if(L0(V))J.push(`@${B}="\${(e) => ${Z6(V.$ref)}(s, e)}"`);else if(O0(V)){let H=T0(V.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${B}="\${(e) => { ${H}; }}"`)}}let Y=J.length>0?`
121
+ ${X} ${J.join(`
122
+ ${X} `)}`:"",U="";if(W.textContent!==void 0)U=u5(W.textContent);else if(W.children)U=`
123
+ ${d5(W.children,null,`${X} `)}
124
+ ${X} `;return`${X}\${${q}.map((item, index) => html\`
125
+ ${X} <${Q}${Y}
126
+ ${X} >${U}</${Q}>
127
+ ${X}\`)}`}function Z6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function sJ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return Z6(Z)}function V1(Z){return Z.replaceAll("state.","s.")}function u5(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${Z6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return V1(Z);return String(Z)}function oJ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function G7(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[q,W]of Object.entries(Z)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(W===null||typeof W==="object")continue;if(typeof W==="string"&&W.includes("${")){let Q=I0(q);X.push(`${Q}: ${V1(W)}`)}}return X.join("; ")}function Y7(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(Y7(X.children))return!0}return!1}var H1=R(()=>{u4();T6();S0();e0()});function U7(Z,X){let{title:q="Jx App",reactivitySrc:W,litHtmlSrc:Q}=X,J=h6(Z,null,Z.state??{},Z.$media??{}),z=f6(Z,Z.$media??{},X.projectStyle??null),Y=[],U=K7(Z,!1,Z,J,Y),K=[],V="",B="";if(Y.length>0){for(let $ of Y){let F=R4($.def,$.className,[]);K.push({content:F,path:`_islands/${$.tagName}.js`,tagName:$.tagName})}V=`<script type="importmap">
123
128
  {
124
129
  "imports": {
125
130
  "@vue/reactivity": "${W}",
126
- "lit-html": "${q}"
131
+ "lit-html": "${Q}"
127
132
  }
128
133
  }
129
- </script>`,V=U.map(($)=>`<script type="module" src="./${$.path}"></script>`).join(`
130
- `)}return{html:`<!DOCTYPE html>
134
+ </script>`,B=K.map(($)=>`<script type="module" src="./${$.path}"></script>`).join(`
135
+ `)}let H=`<!DOCTYPE html>
131
136
  <html lang="en">
132
137
  <head>
133
138
  <meta charset="utf-8">
134
139
  <meta name="viewport" content="width=device-width, initial-scale=1">
135
- <title>${m(X)}</title>
136
- ${K}
137
- ${G}
140
+ <title>${y(q)}</title>
141
+ ${V}
142
+ ${z}
138
143
  </head>
139
144
  <body>
140
- ${Y}
141
- ${V}
145
+ ${U}
146
+ ${B}
142
147
  </body>
143
- </html>`,files:U}}function _9(Z,J,X,W,q){if(typeof Z==="string")return m(Z);if(typeof Z==="number"||typeof Z==="boolean")return m(String(Z));if(!Z||typeof Z!=="object")return"";let Q=R4(X,W.scope,X?.state??W.scopeDefs,X?.$media??W.media);if(J){let U=q.length,K=`jx-island-${U}`,V=`JxIsland${U}`,B={...X??Z,tagName:K};return q.push({def:B,tagName:K,className:V}),`<${K}></${K}>`}let G=Z.tagName??"div",z=J1(Z,Q.scope),Y=Tq(Z,X,Q,q);return`<${G}${z}>${Y}</${G}>`}function Tq(Z,J,X,W){let q=J??Z;if(q.textContent!==void 0){let Q=a(q.textContent,X.scope);return Q==null?"":m(String(Q))}if(q.innerHTML)return a(q.innerHTML,X.scope)??q.innerHTML;if(Array.isArray(q.children)){let Q=J?.children;return q.children.map((G,z)=>{let Y=G,U=D7(Y),K=Q?.[z]??G;return _9(Y,U,K,X,W)}).join(`
144
- `)}return""}var C9=O(()=>{U4();t1()});function E9(Z,J){let{title:X,reactivitySrc:W=N4,litHtmlSrc:q=T4,modulePath:Q="app.js"}=J,G=R4(Z,null,Z.state??{},Z.$media??{}),z=_4(Z,Z.$media??{},J.projectStyle??null),Y={t:0,s:0,h:0,m:0,sw:0,l:0,needsLit:!1},U=new Map,K=new Map,V=[],B=[],$=[],A=[],D=[],L=new Map,w=Z.state??{};for(let[E,g]of Object.entries(w)){if(g===null||typeof g!=="object"||Array.isArray(g)){if(typeof g==="string"&&b(g))B.push([E,"() => `"+g+"`"]);else V.push([E,g]);continue}let N=g;if("$expression"in N){let k=N.$expression;if(G4(k.operator)){let f=L0(k,{statePrefix:"state",eventParam:"e"});A.push([E,{args:["state","e"],body:f}])}else{let f=L0(k,{statePrefix:"state",eventParam:"e"});B.push([E,`() => ${f}`])}continue}if(N.$prototype==="Function"){let k=N.parameters??N.arguments;if(N.$src){if(!L.has(N.$src))L.set(N.$src,new Set);L.get(N.$src).add(E),B.push([E,"() => { return "+E+"(state); }"])}else if(N.body&&N.body.includes("return"))B.push([E,"() => { "+N.body+" }"]);else A.push([E,{args:k??["state"],body:N.body}]);continue}if(P4(N))continue;if("default"in N&&!N.$prototype){V.push([E,N.default]);continue}if(N.$prototype==="LocalStorage"||N.$prototype==="SessionStorage"){let k=N.$prototype==="LocalStorage"?"localStorage":"sessionStorage",f=N.key??E,d=N.default??null;V.push([E,null]),D.push(jq(E,k,f,d));continue}if(N.$prototype==="Request"){V.push([E,null]),D.push(Rq(E,N));continue}if(N.$prototype==="Cookie"){V.push([E,null]),D.push(_q(E,N.name??E,N.default??null));continue}V.push([E,N])}let I=O9(Z,Z,G,U,K,Y);for(let[E,g]of U)if(!$.some(([N])=>N===E))$.push([E,g]);for(let[E,g]of K)if(!A.some(([N])=>N===E))A.push([E,g]);let j=Pq(V,B,$,A,D,L,Y,W),v=[` "@vue/reactivity": "${W}"`,` "lit-html": "${q}"`];return{html:`<!DOCTYPE html>
148
+ </html>`;return{files:K,html:H}}function K7(Z,X,q,W,Q){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let J=h6(q,W.scope,q?.state??W.scopeDefs,q?.$media??W.media);if(X){let K=Q.length,V=`jx-island-${K}`,B=`JxIsland${K}`,H={...q??Z,tagName:V};return Q.push({className:B,def:H,tagName:V}),`<${V}></${V}>`}let z=Z.tagName??"div",Y=v6(Z,J.scope),U=tJ(Z,q,J,Q);return`<${z}${Y}>${U}</${z}>`}function tJ(Z,X,q,W){let Q=X??Z;if(Q.textContent!==void 0){let J=p(Q.textContent,q.scope);return J==null?"":y(String(J))}if(Q.innerHTML)return p(Q.innerHTML,q.scope)??Q.innerHTML;if(Array.isArray(Q.children)){let J=Array.isArray(X?.children)?X.children:void 0;return Q.children.map((z,Y)=>{let U=z,K=e3(U),V=J?.[Y]??z;return K7(U,K,V,q,W)}).join(`
149
+ `)}return""}var V7=R(()=>{T6();H1()});function B7(Z,X){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,modulePath:J="app.js"}=X,z=h6(Z,null,Z.state??{},Z.$media??{}),Y=f6(Z,Z.$media??{},X.projectStyle??null),U={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],$=[],F=[],L=[],A=new Map,I=Z.state??{};for(let[C,T]of Object.entries(I)){if(T===null||typeof T!=="object"||Array.isArray(T)){if(typeof T==="string"&&x(T))H.push([C,`() => \`${T}\``]);else B.push([C,T]);continue}if(O0(T)){let j=T.$expression,S=T0(j,{eventParam:"e",statePrefix:"state"});if(L6(j.operator))F.push([C,{args:["state","e"],body:S}]);else H.push([C,`() => ${S}`]);continue}if(i0(T)){let j=T.parameters?z6(T.parameters):T.arguments;if(T.$src){if(!A.has(T.$src))A.set(T.$src,new Set);A.get(T.$src).add(C),H.push([C,`() => { return ${C}(state); }`])}else if(T.body&&T.body.includes("return"))H.push([C,`() => { ${T.body} }`]);else F.push([C,{args:j??["state"],body:T.body}]);continue}if(J6(T))continue;if(a3(T)){B.push([C,T.default]);continue}if(I6(T)){if(T.$prototype==="LocalStorage"||T.$prototype==="SessionStorage"){let j=T.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=T.key??C,g=T.default??null;B.push([C,null]),L.push(Xz(C,j,S,g));continue}if(T.$prototype==="Request"){B.push([C,null]),L.push(Zz(C,T));continue}if(T.$prototype==="Cookie"){B.push([C,null]),L.push(qz(C,T.name??C,T.default??null));continue}}B.push([C,T])}let M=H7(Z,Z,z,K,V,U);for(let[C,T]of K)if(!$.some(([j])=>j===C))$.push([C,T]);for(let[C,T]of V)if(!F.some(([j])=>j===C))F.push([C,T]);let _=eJ(B,H,$,F,L,A,U,W),k=[` "@vue/reactivity": "${W}"`,` "lit-html": "${Q}"`],b=`<!DOCTYPE html>
145
150
  <html lang="en">
146
151
  <head>
147
152
  <meta charset="utf-8">
148
153
  <meta name="viewport" content="width=device-width, initial-scale=1">
149
- <title>${m(X)}</title>
154
+ <title>${y(q)}</title>
150
155
  <script type="importmap">
151
156
  {
152
157
  "imports": {
153
- ${v.join(`,
158
+ ${k.join(`,
154
159
  `)}
155
160
  }
156
161
  }
157
162
  </script>
158
- ${z}
159
- <script type="module" src="./${Q}"></script>
163
+ ${Y}
164
+ <script type="module" src="./${J}"></script>
160
165
  </head>
161
166
  <body>
162
- ${I}
167
+ ${M}
163
168
  </body>
164
- </html>`,files:[{path:Q,content:j}]}}function O9(Z,J,X,W,q,Q){if(typeof Z==="string")return m(Z);if(typeof Z==="number"||typeof Z==="boolean")return m(String(Z));if(!Z||typeof Z!=="object")return"";let G=R4(J,X.scope,J?.state??X.scopeDefs,J?.$media??X.media),z=Z.tagName??"div",Y=[],U=!1;if(Z.textContent!==void 0){let L=J?.textContent??Z.textContent;if(c0(L)){let w=F4(L.$ref);Y.push(`:text-content="${w}"`),N5(W,w,L.$ref),U=!0}else if(b(L)){let w=`_t${Q.t++}`;Y.push(`:text-content="${w}"`),W.set(w,"() => `"+L+"`"),U=!0}}for(let[L,w]of Object.entries(Z)){if(!L.startsWith("on")||L==="observedAttributes")continue;let I=L.slice(2).toLowerCase();if(c0(w)){let j=F4(w.$ref);Y.push(`@${I}="${j}"`),U=!0}else if(w&&typeof w==="object"&&w.$prototype==="Function"){let j=w,v=`_h${Q.h++}`;Y.push(`@${I}="${v}"`),q.set(v,{args:j.parameters??j.arguments??["state","event"],body:j.body}),U=!0}else if(w&&typeof w==="object"&&"$expression"in w){let j=`_h${Q.h++}`;Y.push(`@${I}="${j}"`);let v=L0(w.$expression,{statePrefix:"state",eventParam:"e"});q.set(j,{args:["state","e"],body:v}),U=!0}}if(Z.style&&typeof Z.style==="object")for(let[L,w]of Object.entries(Z.style)){if(L.startsWith(":")||L.startsWith(".")||L.startsWith("&")||L.startsWith("[")||L.startsWith("@"))continue;if(w===null||typeof w==="object")continue;if(b(w)){let I=`_s${Q.s++}`;Y.push(`:style.${I0(L)}="${I}"`),W.set(I,"() => `"+w+"`"),U=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[L,w]of Object.entries(Z.attributes))if(c0(w)){let I=F4(w.$ref);Y.push(`:attr.${L}="${I}"`),N5(W,I,w.$ref),U=!0}else if(b(w)){let I=`_t${Q.t++}`;Y.push(`:attr.${L}="${I}"`),W.set(I,"() => `"+w+"`"),U=!0}}for(let[L,w]of Object.entries(Z)){if(Y4.has(L)||L.startsWith("on")||L.startsWith("$")||L==="tagName"||L==="id"||L==="className"||L==="style"||L==="children"||L==="textContent"||L==="innerHTML"||L==="attributes")continue;if(c0(w)){let I=F4(w.$ref);Y.push(`:${I0(L)}="${I}"`),N5(W,I,w.$ref),U=!0}else if(b(w)){let I=`_t${Q.t++}`;Y.push(`:${I0(L)}="${I}"`),W.set(I,"() => `"+w+"`"),U=!0}}let K=J1(Z,G.scope),V=U?" data-bind":"",B=Y.length>0?" "+Y.join(" "):"",$="",A=J??Z;if(A.textContent!==void 0&&!U){let L=a(A.textContent,G.scope);$=L==null?"":m(String(L))}else if(A.textContent!==void 0&&U){let L=a(A.textContent,G.scope);$=L==null?"":m(String(L))}else if(A.innerHTML)$=a(A.innerHTML,G.scope)??A.innerHTML;else if(A.children&&typeof A.children==="object"&&!Array.isArray(A.children)&&A.children.$prototype==="Array"){Q.needsLit=!0;let L=`_list${Q.l++}`,w=A.children,I;if(c0(w.items))I="state."+F4(w.items.$ref);else I=JSON.stringify(w.items);let j=x9(w.map);W.set(L,"() => ("+I+" ?? []).map((item, index) => html`"+j+"`)"),Y.push(`:render="${L}"`),U=!0;let v=" data-bind",y=" "+Y.join(" ");if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${K}${v}${y}>`;return`<${z}${K}${v}${y}></${z}>`}else if(Array.isArray(A.children)){let L=J?.children;$=A.children.map((w,I)=>{let j=L?.[I]??w;return O9(w,j,G,W,q,Q)}).join(`
165
- `)}if(new Set(["input","br","hr","img","meta","link"]).has(z))return`<${z}${K}${V}${B}>`;return`<${z}${K}${V}${B}>${$}</${z}>`}function x9(Z){if(!Z)return"";let J=Z.tagName??"div",X="";if(Z.id)X+=' id="'+Z.id+'"';if(Z.className)X+=' class="'+h4(Z.className)+'"';if(Z.attributes&&typeof Z.attributes==="object")for(let[Q,G]of Object.entries(Z.attributes))if(typeof G==="string"&&b(G))X+=" "+Q+'="'+h4(G)+'"';else X+=" "+Q+'="'+m(String(G))+'"';if(Z.style&&typeof Z.style==="object"){let Q=[];for(let[G,z]of Object.entries(Z.style)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(z===null||typeof z==="object")continue;let Y=I0(G);if(b(String(z)))Q.push(Y+": "+h4(String(z)));else Q.push(Y+": "+z)}if(Q.length>0)X+=' style="'+Q.join("; ")+'"'}for(let[Q,G]of Object.entries(Z)){if(!Q.startsWith("on")||Q==="observedAttributes")continue;let z=Q.slice(2).toLowerCase();if(c0(G)){let Y=F4(G.$ref);X+=" @"+z+"=${(e) => { state.$map = { item, index }; on."+Y+"(e); }}"}else if(G&&typeof G==="object"&&G.$prototype==="Function"){let Y=h4(G.body);X+=" @"+z+"=${(e) => { "+Y+" }}"}else if(G&&typeof G==="object"&&"$expression"in G){let Y=L0(G.$expression,{statePrefix:"state",eventParam:"e"});X+=" @"+z+"=${(e) => { state.$map = { item, index }; "+Y+"; }}"}}if(Z.contentEditable)X+=' contenteditable="'+Z.contentEditable+'"';let W="";if(Z.textContent!==void 0){let Q=String(Z.textContent);if(b(Q))W=h4(Q);else if(c0(Z.textContent))W="${state."+F4(Z.textContent.$ref)+"}";else W=m(Q)}else if(Z.innerHTML)W=h4(String(Z.innerHTML));else if(Array.isArray(Z.children))W=`
166
- `+Z.children.map((Q)=>x9(Q)).join(`
167
- `)+`
168
- `;if(new Set(["input","br","hr","img","meta","link"]).has(J))return"<"+J+X+">";return"<"+J+X+">"+W+"</"+J+">"}function h4(Z){return Z.replace(/\$map\./g,"")}function Pq(Z,J,X,W,q,Q,G,z){let Y=[],U=G.needsLit,K=J.length>0;Y.push("// Generated by @jxsuite/compiler — do not edit manually");let V=["reactive","effect"];if(K)V.push("computed");if(Y.push("import { "+V.join(", ")+" } from '@vue/reactivity';"),U)Y.push("import { html, render } from 'lit-html';");for(let[B,$]of Q)Y.push("import { "+[...$].join(", ")+" } from '"+B+"';");Y.push(""),Y.push("const state = reactive({");for(let[B,$]of Z)Y.push(" "+B+": "+JSON.stringify($)+",");if(Y.push("});"),Y.push(""),q.length>0){for(let B of q)Y.push(B);Y.push("")}if(J.length>0){for(let[B,$]of J)Y.push("state."+B+" = computed("+$+");");Y.push("")}if(X.length>0){Y.push("const bind = {");for(let[B,$]of X)Y.push(" "+B+": "+$+",");Y.push("};")}else Y.push("const bind = {};");if(Y.push(""),W.length>0){Y.push("const on = {");for(let[B,$]of W){let A=$.args??["state"],D=A.map((L)=>L==="state"?"state":"e").join(", ");Y.push(" "+B+": (e) => { const fn = ("+A.join(", ")+") => { "+$.body+" }; fn("+D+"); },")}Y.push("};")}else Y.push("const on = {};");if(Y.push(""),Y.push("function hydrate(root) {"),Y.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),Y.push(" [...el.attributes].forEach(a => {"),Y.push(" if (a.name.startsWith(':')) {"),Y.push(" const parts = a.name.slice(1).split('.');"),Y.push(" const key = a.value;"),U)Y.push(" if (parts[0] === 'render') {"),Y.push(" effect(() => { render(bind[key](), el); });"),Y.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else Y.push(" if (parts[0] === 'style' && parts.length > 1) {");return Y.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),Y.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),Y.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),Y.push(" } else {"),Y.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),Y.push(" effect(() => { el[prop] = bind[key](); });"),Y.push(" }"),Y.push(" } else if (a.name.startsWith('@')) {"),Y.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),Y.push(" }"),Y.push(" });"),Y.push(" });"),Y.push("}"),Y.push(""),Y.push("hydrate(document);"),Y.push(""),Y.join(`
169
- `)}function Rq(Z,J){let X=J.url,W=J.method??"GET",q=b(X);if(J.manual)return"// "+Z+": manual Request — fetch triggered by user action";let Q=[];if(Q.push("// "+Z+": auto-fetch from "+(q?"(dynamic URL)":X)),Q.push("effect(() => {"),q)Q.push(" const url = `"+X+"`;"),Q.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else Q.push(" const url = "+JSON.stringify(X)+";");let G=[];if(W!=="GET")G.push("method: "+JSON.stringify(W));if(J.headers)G.push("headers: "+JSON.stringify(J.headers));if(J.body){let Y=typeof J.body==="object"?JSON.stringify(JSON.stringify(J.body)):JSON.stringify(J.body);G.push("body: "+Y)}let z=G.length>0?", { "+G.join(", ")+" }":"";return Q.push(" fetch(url"+z+")"),Q.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),Q.push(" .then(d => { state."+Z+" = d; })"),Q.push(" .catch(e => { state."+Z+" = { error: String(e) }; });"),Q.push("});"),Q.join(`
170
- `)}function jq(Z,J,X,W){let q=[];return q.push("// "+Z+": "+J+' (key: "'+X+'")'),q.push("try {"),q.push(" const _s = "+J+".getItem("+JSON.stringify(X)+");"),q.push(" state."+Z+" = _s !== null ? JSON.parse(_s) : "+JSON.stringify(W)+";"),q.push("} catch { state."+Z+" = "+JSON.stringify(W)+"; }"),q.push("effect(() => {"),q.push(" const v = state."+Z+";"),q.push(" try {"),q.push(" if (v === null) "+J+".removeItem("+JSON.stringify(X)+");"),q.push(" else "+J+".setItem("+JSON.stringify(X)+", JSON.stringify(v));"),q.push(" } catch {}"),q.push("});"),q.join(`
171
- `)}function _q(Z,J,X){let W=[];return W.push("// "+Z+': Cookie (name: "'+J+'")'),W.push("{"),W.push(' const _m = document.cookie.match(new RegExp("(?:^|; )'+J+'=([^;]*)"));'),W.push(" try { state."+Z+" = _m ? JSON.parse(decodeURIComponent(_m[1])) : "+JSON.stringify(X)+"; }"),W.push(" catch { state."+Z+" = _m ? _m[1] : "+JSON.stringify(X)+"; }"),W.push("}"),W.join(`
172
- `)}function F4(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replace(/\//g,"_");return Z.replace(/\//g,"_")}function N5(Z,J,X){if(Z.has(J))return;if(X.startsWith("#/state/")){let q=X.slice(8).split("/");Z.set(J,"() => state."+q.join("."))}else Z.set(J,"() => state."+X)}var k9=O(()=>{j1();U4()});var b9={};P6(b9,{compileClassJson:()=>Cq});function Cq(Z,J={}){let X=Z.title;if(!X)throw Error("compileClassJson: missing title (class name)");let W=Eq(Z.extends),q=Z.$defs,Q=q?.fields??{},G=q?.constructor,z=q?.methods??{},Y=[];if(Y.push("// Generated by @jxsuite/compiler from .class.json — do not edit manually"),Z.$id)Y.push(`// Source: ${Z.$id}`);Y.push("");let U=W!=="Object"?` extends ${W}`:"";Y.push(`class ${X}${U} {`);for(let[K,V]of Object.entries(Q)){let B=V;if(B.scope!=="static")continue;let $=B.identifier??K,A=B.access==="private"?"#":"",D=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";Y.push(` static ${A}${$} = ${D};`)}for(let[K,V]of Object.entries(Q)){let B=V;if(B.scope==="static")continue;if(B.access!=="private")continue;let $=B.identifier??K;Y.push(` #${$};`)}if(Object.keys(Q).length>0)Y.push("");if(Y.push(" constructor(config = {}) {"),G?.superCall||W!=="Object"){let K=G?.superCall?.arguments?G.superCall.arguments.join(", "):"";Y.push(` super(${K});`)}for(let[K,V]of Object.entries(Q)){let B=V;if(B.scope==="static")continue;let $=B.identifier??K,A=B.access==="private"?"#":"",D=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";Y.push(` this.${A}${$} = config.${$} !== undefined ? config.${$} : ${D};`)}if(G?.body){let K=Array.isArray(G.body)?G.body:[G.body];for(let V of K)Y.push(` ${V}`)}Y.push(" }");for(let[K,V]of Object.entries(z)){let B=V,$=B.identifier??K,A=B.scope==="static",L=B.access==="private"?"#":"",w=A?"static ":"",I=B.returnType?.$ref?.includes("Promise")||xq(B)?"async ":"",j=S9(B.parameters??[]),v=Oq(B.body);if(Y.push(""),B.role==="accessor"){if(B.getter)Y.push(` ${w}get ${L}${$}() {`),Y.push(` ${B.getter.body}`),Y.push(" }");if(B.setter){let y=S9(B.setter.parameters??[]);Y.push(` ${w}set ${L}${$}(${y}) {`),Y.push(` ${B.setter.body}`),Y.push(" }")}}else{Y.push(` ${w}${I}${L}${$}(${j}) {`);for(let y of v)Y.push(` ${y}`);Y.push(" }")}}return Y.push("}"),Y.push(""),Y.push(`export { ${X} };`),Y.push(`export default ${X};`),Y.push(""),Y.join(`
173
- `)}function Eq(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;let J=Z;if(J.$ref){let W=J.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return W?W[1]:"Object"}return"Object"}function S9(Z){return Z.map((J)=>{let X=J;if(X.$ref)return X.$ref.split("/").pop();return X.identifier??X.name??"arg"}).join(", ")}function Oq(Z){if(!Z)return[""];if(Array.isArray(Z))return Z;return[Z]}function xq(Z){return(Array.isArray(Z.body)?Z.body.join(`
174
- `):Z.body??"").includes("await ")}import{readFileSync as kq}from"node:fs";async function T5(Z,J={}){let{title:X="Jx App",reactivitySrc:W=N4,litHtmlSrc:q=T4,projectStyle:Q=null}=J,G;if(typeof Z==="string"){let z=kq(Z,"utf8");if(Z.endsWith(".json"))G=JSON.parse(z);else{let{extname:Y}=await import("node:path"),U=Y(Z).toLowerCase(),V=J.formats?.byExtension?.(U,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (g4(),I5));throw B(Z,U)}G=await V.call("parse",z)}}else G=Z;if(G.$prototype==="Class"){let{compileClassJson:z}=await Promise.resolve().then(() => b9),Y=z(G,J);return{html:"",files:[{path:typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${G.title}.js`,content:Y}]}}if(!x6(G))return j9(G,{title:X,reactivitySrc:W,litHtmlSrc:q,projectStyle:Q});if(G.tagName&&G.tagName.includes("-")){let z=G.tagName,Y=C1(z),U=$1(G,Y,[]),K={path:`${z}.js`,content:U,tagName:z},V=_4(G,G.$media??{});return{html:`<!DOCTYPE html>
169
+ </html>`;return{files:[{content:_,path:J}],html:b}}function H7(Z,X,q,W,Q,J){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let z=h6(X,q.scope,X?.state??q.scopeDefs,X?.$media??q.media),Y=Z.tagName??"div",U=[],K=!1;if(Z.textContent!==void 0){let A=X?.textContent??Z.textContent;if(b0(A)){let I=E6(A.$ref);U.push(`:text-content="${I}"`),c5(W,I,A.$ref),K=!0}else if(x(A)){let I=`_t${J.t}`;J.t+=1,U.push(`:text-content="${I}"`),W.set(I,`() => \`${A}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(!A.startsWith("on")||A==="observedAttributes")continue;let M=A.slice(2).toLowerCase();if(b0(I)){let _=E6(I.$ref);U.push(`@${M}="${_}"`),K=!0}else if(i0(I)){let _=`_h${J.h}`;J.h+=1,U.push(`@${M}="${_}"`),Q.set(_,{args:I.parameters?z6(I.parameters):I.arguments??["state","event"],body:I.body}),K=!0}else if(O0(I)){let _=`_h${J.h}`;J.h+=1,U.push(`@${M}="${_}"`);let k=T0(I.$expression,{eventParam:"e",statePrefix:"state"});Q.set(_,{args:["state","e"],body:k}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[A,I]of Object.entries(Z.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(I===null||typeof I==="object")continue;if(x(I)){let M=`_s${J.s}`;J.s+=1,U.push(`:style.${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[A,I]of Object.entries(Z.attributes))if(b0(I)){let M=E6(I.$ref);U.push(`:attr.${A}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:attr.${A}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(D6.has(A)||A.startsWith("on")||A.startsWith("$")||A==="tagName"||A==="id"||A==="className"||A==="style"||A==="children"||A==="textContent"||A==="innerHTML"||A==="attributes")continue;if(b0(I)){let M=E6(I.$ref);U.push(`:${I0(A)}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}let V=v6(Z,z.scope),B=K?" data-bind":"",H=U.length>0?` ${U.join(" ")}`:"",$="",F=X??Z;if(F.textContent!==void 0&&!K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.textContent!==void 0&&K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.innerHTML)$=p(F.innerHTML,z.scope)??F.innerHTML;else if(w6(F.children)){J.needsLit=!0;let A=`_list${J.l}`;J.l+=1;let I=F.children,M;if(b0(I.items))M=`state.${E6(I.items.$ref)}`;else M=JSON.stringify(I.items);let _=$7(I.map);W.set(A,`() => (${M} ?? []).map((item, index) => html\`${_}\`)`),U.push(`:render="${A}"`),K=!0;let k=" data-bind",b=` ${U.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${k}${b}>`;return`<${Y}${V}${k}${b}></${Y}>`}else if(Array.isArray(F.children)){let A=Array.isArray(X?.children)?X.children:void 0;$=F.children.map((I,M)=>{let _=A?.[M]??I;return H7(I,_,z,W,Q,J)}).join(`
170
+ `)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${B}${H}>`;return`<${Y}${V}${B}${H}>${$}</${Y}>`}function $7(Z){if(!Z)return"";let X=Z.tagName??"div",q="";if(Z.id)q+=` id="${Z.id}"`;if(Z.className)q+=` class="${o6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[J,z]of Object.entries(Z.attributes))q+=typeof z==="string"&&x(z)?` ${J}="${o6(z)}"`:` ${J}="${y(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let J=[];for(let[z,Y]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let U=I0(z);if(x(String(Y)))J.push(`${U}: ${o6(String(Y))}`);else J.push(`${U}: ${Y}`)}if(J.length>0)q+=` style="${J.join("; ")}"`}for(let[J,z]of Object.entries(Z)){if(!J.startsWith("on")||J==="observedAttributes")continue;let Y=J.slice(2).toLowerCase();if(b0(z)){let U=E6(z.$ref);q+=` @${Y}=\${(e) => { state.$map = { item, index }; on.${U}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let U=o6(z.body);q+=` @${Y}=\${(e) => { ${U} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let U=T0(z.$expression,{eventParam:"e",statePrefix:"state"});q+=` @${Y}=\${(e) => { state.$map = { item, index }; ${U}; }}`}}if(Z.contentEditable)q+=` contenteditable="${Z.contentEditable}"`;let W="";if(Z.textContent!==void 0){let J=String(Z.textContent);if(x(J))W=o6(J);else if(b0(Z.textContent))W=`\${state.${E6(Z.textContent.$ref)}}`;else W=y(J)}else if(Z.innerHTML)W=o6(String(Z.innerHTML));else if(Array.isArray(Z.children))W=`
171
+ ${Z.children.map((J)=>$7(J)).join(`
172
+ `)}
173
+ `;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${q}>`;return`<${X}${q}>${W}</${X}>`}function o6(Z){return Z.replaceAll("$map.","")}function eJ(Z,X,q,W,Q,J,z,Y){let U=[],{needsLit:K}=z,V=X.length>0;U.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(V)B.push("computed");if(U.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),K)U.push("import { html, render } from 'lit-html';");for(let[H,$]of J)U.push(`import { ${[...$].join(", ")} } from '${H}';`);U.push(""),U.push("const state = reactive({");for(let[H,$]of Z)U.push(` ${H}: ${JSON.stringify($)},`);if(U.push("});"),U.push(""),Q.length>0){for(let H of Q)U.push(H);U.push("")}if(X.length>0){for(let[H,$]of X)U.push(`state.${H} = computed(${$});`);U.push("")}if(q.length>0){U.push("const bind = {");for(let[H,$]of q)U.push(` ${H}: ${$},`);U.push("};")}else U.push("const bind = {};");if(U.push(""),W.length>0){U.push("const on = {");for(let[H,$]of W){let F=$.args??["state"],L=F.map((A)=>A==="state"?"state":"e").join(", ");U.push(` ${H}: (e) => { const fn = (${F.join(", ")}) => { ${$.body} }; fn(${L}); },`)}U.push("};")}else U.push("const on = {};");if(U.push(""),U.push("function hydrate(root) {"),U.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),U.push(" [...el.attributes].forEach(a => {"),U.push(" if (a.name.startsWith(':')) {"),U.push(" const parts = a.name.slice(1).split('.');"),U.push(" const key = a.value;"),K)U.push(" if (parts[0] === 'render') {"),U.push(" effect(() => { render(bind[key](), el); });"),U.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else U.push(" if (parts[0] === 'style' && parts.length > 1) {");return U.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),U.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),U.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),U.push(" } else {"),U.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),U.push(" effect(() => { el[prop] = bind[key](); });"),U.push(" }"),U.push(" } else if (a.name.startsWith('@')) {"),U.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),U.push(" }"),U.push(" });"),U.push(" });"),U.push("}"),U.push(""),U.push("hydrate(document);"),U.push(""),U.join(`
174
+ `)}function Zz(Z,X){let{url:q}=X,W=X.method??"GET",Q=x(q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let J=[`// ${Z}: auto-fetch from ${Q?"(dynamic URL)":q}`,"effect(() => {"];if(Q)J.push(` const url = \`${q}\`;`),J.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else J.push(` const url = ${JSON.stringify(q)};`);let z=[];if(W!=="GET")z.push(`method: ${JSON.stringify(W)}`);if(X.headers)z.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let U=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);z.push(`body: ${U}`)}let Y=z.length>0?`, { ${z.join(", ")} }`:"";return J.push(` fetch(url${Y})`),J.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),J.push(` .then(d => { state.${Z} = d; })`),J.push(` .catch(e => { state.${Z} = { error: String(e) }; });`),J.push("});"),J.join(`
175
+ `)}function Xz(Z,X,q,W){return[`// ${Z}: ${X} (key: "${q}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(q)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(W)};`,`} catch { state.${Z} = ${JSON.stringify(W)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(q)});`,` else ${X}.setItem(${JSON.stringify(q)}, JSON.stringify(v));`," } catch {}","});"].join(`
176
+ `)}function qz(Z,X,q){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(q)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(q)}; }`,"}"].join(`
177
+ `)}function E6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function c5(Z,X,q){if(Z.has(X))return;if(q.startsWith("#/state/")){let Q=q.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${q}`)}var F7=R(()=>{u4();T6();S0()});var M7={};f4(M7,{compileClassJson:()=>Wz});function Wz(Z,X={}){let q=Z.title;if(!q)throw Error("compileClassJson: missing title (class name)");let W=Qz(Z.extends),Q=Z.$defs,J=Q?.fields??{},z=Q?.constructor,Y=typeof z==="object"?z:void 0,U=Q?.methods??{},K=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)K.push(`// Source: ${Z.$id}`);K.push("");let V=W!=="Object"?` extends ${W}`:"";K.push(`class ${q}${V} {`);for(let[B,H]of Object.entries(J)){if(H.scope!=="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${F}${$} = ${L};`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??B;K.push(` #${$};`)}if(Object.keys(J).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||W!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${F}${$} = config.${$} !== undefined ? config.${$} : ${L};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(U)){let $=H.identifier??B,F=H.scope==="static",A=H.access==="private"?"#":"",I=F?"static ":"",M=H.returnType?.$ref?.includes("Promise")||zz(H)?"async ":"",_=A7(H.parameters??[]),k=Jz(H.body);if(K.push(""),H.role==="accessor"){if(H.getter)K.push(` ${I}get ${A}${$}() {`),K.push(` ${H.getter.body}`),K.push(" }");if(H.setter){let b=A7(H.setter.parameters??[]);K.push(` ${I}set ${A}${$}(${b}) {`),K.push(` ${H.setter.body}`),K.push(" }")}}else{K.push(` ${I}${M}${A}${$}(${_}) {`);for(let b of k)K.push(` ${b}`);K.push(" }")}}return K.push("}"),K.push(""),K.push(`export { ${q} };`),K.push(`export default ${q};`),K.push(""),K.join(`
178
+ `)}function Qz(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 A7(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let q=X.identifier??X.name;return typeof q==="string"?q:"arg"}).join(", ")}function Jz(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function zz(Z){return(Array.isArray(Z.body)?Z.body.join(`
179
+ `):Z.body??"").includes("await ")}import{readFileSync as Gz}from"node:fs";async function l5(Z,X={}){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,projectStyle:J=null}=X,z;if(typeof Z==="string"){let Y=Gz(Z,"utf8");if(Z.endsWith(".json"))z=V6(Y,Z);else{let{extname:U}=await import("node:path"),K=U(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (s6(),f5));throw B(Z,K)}z=await V.call("parse",Y)}}else z=Z;if(o3(z)){let{compileClassJson:Y}=await Promise.resolve().then(() => M7),U=Y(z,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:U,path:K}],html:""}}if(!o1(z))return U7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q});if(z.tagName&&z.tagName.includes("-")){let{tagName:Y}=z,U=c4(Y),V={content:R4(z,U,[]),path:`${Y}.js`,tagName:Y},B=f6(z,z.$media??{}),H=`<!DOCTYPE html>
175
180
  <html lang="en">
176
181
  <head>
177
182
  <meta charset="utf-8">
178
183
  <meta name="viewport" content="width=device-width, initial-scale=1">
179
- <title>${m(X)}</title>
184
+ <title>${y(q)}</title>
180
185
  <script type="importmap">
181
186
  {
182
187
  "imports": {
183
188
  "@vue/reactivity": "${W}",
184
- "lit-html": "${q}"
189
+ "lit-html": "${Q}"
185
190
  }
186
191
  }
187
192
  </script>
188
- ${V}
193
+ ${B}
189
194
  </head>
190
195
  <body>
191
- <${z}></${z}>
192
- <script type="module" src="./${z}.js"></script>
196
+ <${Y}></${Y}>
197
+ <script type="module" src="./${Y}.js"></script>
193
198
  </body>
194
- </html>`,files:[K]}}return E9(G,{title:X,reactivitySrc:W,litHtmlSrc:q,projectStyle:Q})}async function BH(Z,J){let[X,W]=await Promise.all([T5(Z),r1(Z)]),{writeFileSync:q,mkdirSync:Q}=await import("node:fs"),{dirname:G,join:z}=await import("node:path");if(J){q(J,X.html,"utf8"),console.error(`Written to ${J}`);let Y=G(J);for(let U of X.files){let K=z(Y,U.path);Q(G(K),{recursive:!0}),q(K,U.content,"utf8"),console.error(`Written to ${K}`)}}else process.stdout.write(X.html);if(W&&J){let Y=J.replace(/(\.[^.]+)?$/,"-server.js");q(Y,W,"utf8"),console.error(`Server handler written to ${Y}`)}}var v9=O(()=>{U4();M9();t1();C9();k9()});import{readFileSync as Sq,existsSync as bq}from"node:fs";import{resolve as y9}from"node:path";function g9(Z){let J=y9(Z,"project.json");if(!bq(J))throw Error(`project.json not found in ${Z}`);let X;try{X=JSON.parse(Sq(J,"utf8"))}catch(G){throw Error(`Invalid JSON in ${J}: ${G.message}`)}if(typeof X!=="object"||X===null||Array.isArray(X))throw Error(`project.json must be a JSON object, got ${typeof X}`);let W={...e1,...X,defaults:{...e1.defaults,...X.defaults},images:{...e1.images,...X.images},build:{...e1.build,...X.build}};if(X.$head)W.$head=X.$head;if(X.$media)W.$media=X.$media;if(X.style)W.style=X.style;if(X.state)W.state=X.state;if(X.redirects)W.redirects=X.redirects;if(X.imports)W.imports=X.imports;if(X.contentTypes)W.contentTypes=X.contentTypes;let q=["cloudflare-workers","cloudflare-pages","node","bun"];if(W.build.adapter&&!q.includes(W.build.adapter))throw Error(`Unknown build adapter "${W.build.adapter}" in project.json. Valid adapters: ${q.join(", ")}`);let Q=["build","cloudflare"];if(!Q.includes(W.images.service))throw Error(`Unknown images.service "${W.images.service}" in project.json. Valid services: ${Q.join(", ")}`);return{config:W,configPath:J,projectRoot:y9(Z)}}var e1;var h9=O(()=>{e1={name:"Jx Site",url:"",defaults:{layout:null,lang:"en",charset:"utf-8"},$head:[],imports:{},$media:{},style:{},state:{},contentTypes:{},redirects:{},images:{optimize:!0,widths:[320,640,960,1280,1920],formats:["webp","avif"],quality:{webp:80,avif:65,jpeg:80,png:80},sizes:"(max-width: 768px) 100vw, 50vw",lazyLoad:!0,service:"build"},build:{outDir:"./dist",format:"directory",trailingSlash:"always",provider:null}}});import{readdirSync as vq,readFileSync as m9}from"node:fs";import{resolve as yq,relative as gq,extname as P5,join as hq}from"node:path";async function F1(Z,J){let X=m9(Z,"utf8");if(Z.endsWith(".json"))return JSON.parse(X);let W=P5(Z).toLowerCase(),q=J?.byExtension(W,"parse");if(!q)throw Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await q.call("parse",X)}async function f9(Z,J){let X=[],W=new Set([".json",...J?.documentExtensions("page")??[]]);return await u9(Z,Z,X,W,J),X.sort((q,Q)=>{if(q.isDynamic!==Q.isDynamic)return q.isDynamic?1:-1;if(q.isCatchAll!==Q.isCatchAll)return q.isCatchAll?1:-1;return q.urlPattern.localeCompare(Q.urlPattern)}),X}async function u9(Z,J,X,W,q){let Q=vq(Z,{withFileTypes:!0});for(let G of Q){let z=hq(Z,G.name);if(G.isDirectory()){if(G.name.startsWith("_"))continue;await u9(z,J,X,W,q);continue}let Y=P5(G.name).toLowerCase();if(!W.has(Y))continue;if(G.name.startsWith("_"))continue;let U=gq(J,z),K=await mq(U,z,q);if(K)X.push(K)}}async function mq(Z,J,X){let W=P5(Z),q=W?Z.slice(0,-W.length):Z;if(q=q.split("\\").join("/"),q.endsWith("/index"))q=q.slice(0,-6)||"/";else if(q==="index")q="/";if(!q.startsWith("/"))q="/"+q;let Q=[],G=!1,z=!1,Y=q.replace(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(K,V,B)=>{if(V)return z=!0,G=!0,Q.push(V),"*";return G=!0,Q.push(B),`:${B}`}),U=null;try{let K=await F1(J,X);if(typeof K.$layout==="string")U=K.$layout}catch{}return{urlPattern:Y,sourcePath:J,relativePath:Z,isDynamic:G,isCatchAll:z,params:Q,$layout:U}}async function d9(Z,J,X=new Map,W){let q=[];for(let Q of Z){if(!Q.isDynamic){q.push(Q);continue}let G;try{G=await F1(Q.sourcePath,W)}catch{q.push(Q);continue}if(!G.$paths){console.warn(`Warning: dynamic route ${Q.urlPattern} has no $paths — skipping`);continue}let z=fq(G.$paths,J,X);for(let Y of z){let U=Q.urlPattern;for(let[K,V]of Object.entries(Y))U=U.replace(`:${K}`,V),U=U.replace("*",V);q.push({...Q,urlPattern:U,isDynamic:!1,isCatchAll:!1,params:[],_pathParams:Y})}}return q}function fq(Z,J,X){if(Array.isArray(Z))return Z;if(Z.contentType){let W=X.get(Z.contentType);if(!W||W.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let q=Z.param??"slug",Q=Z.field??"id";return W.map((G)=>({[q]:Q==="id"?G.id:G.data[Q]??G.id})).filter((G)=>G[q])}if(Array.isArray(Z.values)){let W=Z.param??"value";return Z.values.map((q)=>({[W]:q}))}if(Z.$ref){let W=yq(J,Z.$ref),q;try{q=JSON.parse(m9(W,"utf8"))}catch(z){let Y=z;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${Y.message}`),[]}if(!Array.isArray(q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let Q=Z.param??"id",G=Z.field??"id";return q.map((z)=>({[Q]:z[G]??z.id??String(z)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var c9=()=>{};import{readFileSync as uq,existsSync as dq}from"node:fs";import{resolve as cq}from"node:path";function R5(Z,J,X){let W=Z.$layout??J.defaults?.layout??null;if(!W)return Z;let q=cq(X,W);if(!dq(q))throw Error(`Layout not found: ${W} (resolved to ${q})`);let Q;try{Q=JSON.parse(uq(q,"utf8"))}catch(U){throw Error(`Invalid layout JSON at ${q}: ${U.message}`)}if(Q.$layout)Q=R5(Q,J,X);let G=Z.children??[],z=typeof G==="string"?[G]:Array.isArray(G)?G:[],Y=pq(Q);if(lq(Y,z),Z.state)Y.state={...Y.state,...Z.state};if(Z.$media)Y.$media={...Y.$media,...Z.$media};if(Z.style)Y.style={...Y.style,...Z.style};if(Z.attributes)Y.attributes={...Y.attributes,...Z.attributes};if(Z.$head)Y._pageHead=Z.$head;if(Z.title)Y._pageTitle=Z.title;return delete Y.$layout,Y}function lq(Z,J){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,W=[];for(let q of J)if(q&&typeof q==="object"&&q.attributes?.slot){let Q=q.attributes.slot;if(!X.has(Q))X.set(Q,[]);X.get(Q).push(q)}else W.push(q);l9(Z,X,W)}function l9(Z,J,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=[];for(let q of Z.children)if(q&&typeof q==="object"&&q.tagName==="slot"){let Q=q.attributes?.name;if(Q&&J.has(Q))W.push(...J.get(Q)),J.delete(Q);else if(!Q&&X.length>0)W.push(...X);else if(Array.isArray(q.children))W.push(...q.children)}else l9(q,J,X),W.push(q);Z.children=W}function pq(Z){return JSON.parse(JSON.stringify(Z))}var p9=()=>{};function n9(Z=[],J=[],X=[],W={}){let q=[{tagName:"meta",attributes:{charset:W.charset??"utf-8"}},{tagName:"meta",attributes:{name:"viewport",content:"width=device-width, initial-scale=1"}}],Q=new Map;for(let z of[...q,...Z,...J,...X]){let Y=nq(z);Q.set(Y,z)}let G=W.title??W.siteName??"Jx Site";if(Q.set("title",{tagName:"title",children:[G]}),W.pageUrl&&W.siteUrl){let z=new URL(W.pageUrl,W.siteUrl).href;Q.set("link:canonical",{tagName:"link",attributes:{rel:"canonical",href:z}})}return Array.from(Q.values())}function nq(Z){if(!Z||typeof Z!=="object")return String(Z);let J=Z.tagName??"unknown",X=Z.attributes??{};if(J==="title")return"title";if(X.charset)return"meta:charset";if(J==="meta"&&X.name)return`meta:${X.name}`;if(J==="meta"&&X.property)return`meta:${X.property}`;if(J==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(J==="script"&&X.src)return`script:${X.src}`;if(J==="style"){let W=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${rq(W)}`}return`${J}:${JSON.stringify(Z)}`}function rq(Z){let J=0;for(let X=0;X<Z.length;X++)J=(J<<5)-J+Z.charCodeAt(X)|0;return J.toString(36)}function r9(Z){return Z.map((J)=>iq(J)).join(`
195
- `)}function iq(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let J=Z.tagName,X=Z.attributes??{},W=Object.entries(X).map(([z,Y])=>Y===!0?z:`${z}="${aq(Y)}"`).join(" "),q=W?`<${J} ${W}>`:`<${J}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(J))return q;let G=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${q}${G}</${J}>`}function aq(Z){return String(Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}import{resolve as sq,dirname as oq,relative as tq}from"node:path";function i9(Z,J,X,W=new Map,q=null){if(!Z.state)Z.state={};if(Z.state.$site={name:J.name??"Jx Site",url:J.url??"",...J.state},Z.state.$page={url:X.urlPattern,title:Z.title??Z._pageTitle??J.name??"",params:X._pathParams??{}},J.state){for(let[Q,G]of Object.entries(J.state))if(Q!=="$site"&&Q!=="$page"&&!(Q in Z.state))Z.state[Q]=G}if(J.$media)Z.$media={...J.$media,...Z.$media};if(J.imports&&Object.keys(J.imports).length>0){if(!Z.imports)Z.imports={};for(let[Q,G]of Object.entries(J.imports))if(!(Q in Z.imports)){let z=G;if(q&&X.sourcePath&&(z.startsWith("./")||z.startsWith("../"))){let Y=sq(q,z);Z.imports[Q]="./"+tq(oq(X.sourcePath),Y)}else Z.imports[Q]=z}}if(J.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...J.$elements];else{let Q=new Set,G=[];for(let z of[...J.$elements,...Z.$elements]){let Y=typeof z==="string"?z:z?.$ref;if(Y&&!Q.has(Y))Q.add(Y),G.push(z)}Z.$elements=G}return Z}var a9=()=>{};import{readFileSync as eq,readdirSync as ZQ,existsSync as JQ}from"node:fs";import{resolve as _5,basename as s9,extname as o9}from"node:path";function XQ(Z){let J=JSON.parse(eq(Z,"utf-8"));if(Array.isArray(J))return J.map((W,q)=>({id:W.id??s9(Z,".json")+"-"+q,data:W,body:null}));let X=J;return[{id:X.id??s9(Z,".json"),data:X,body:null}]}function WQ(Z){if(o9(Z))return JQ(Z)?[Z]:[];try{return ZQ(Z,{recursive:!0}).filter((J)=>String(J).endsWith(".json")).map((J)=>_5(Z,String(J)))}catch{return[]}}function C5(Z,J){let X=_5(Z,"content");return{config:{contentTypes:J?.contentTypes??{}},contentDir:X}}async function t9(Z,J,X){let W=C5(Z,J);if(!W)return new Map;let{config:q}=W,Q=new Map;if(Object.keys(q.contentTypes).length===0)return Q;let G=X??await B1(Z,J);for(let[z,Y]of Object.entries(q.contentTypes)){let U=await qQ(z,Y,Z,G);Q.set(z,U)}return Q}async function qQ(Z,J,X,W){let q=J.source;if(!q)return[];let Q=J.schema,G=J.$elements?.length?{allowedNames:J.$elements.filter(($)=>typeof $==="string"||typeof $==="object"&&$?.$ref).map(($)=>typeof $==="string"?$:$.$ref)}:void 0,z=J.format,Y;if(z&&z!=="json"){if(Y=W.byName(z),!Y)throw Error(`Content type "${Z}": format "${z}" is not an imported format class. Add it to project.json imports, e.g. "${z}": "@jxsuite/parser/${z}.class.json".`)}if(q.startsWith("http://")||q.startsWith("https://")){if(!Y)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!Y.remote)throw Error(`Content type "${Z}": format "${Y.name}" does not support remote sources (its format block lacks "remote": true).`);try{let $=await Y.call("load",q,{schema:Q,directiveOptions:G});if(Q)j5($,Q,Z);return $}catch($){return console.warn(`Content type "${Z}": ${$.message}`),[]}}let U=_5(X,q).split("\\").join("/"),K=o9(q).toLowerCase();if(z==="json"||!Y&&K===".json"){let $=WQ(U),A=[];for(let D of $)A.push(...XQ(D));if(Q)j5(A,Q,Z);return A}if(!Y&&K)Y=W.byExtension(K,"load");if(!Y)throw L5(q,K||`content type "${Z}" (directory sources need an explicit "format")`);let V=Y.capabilities.discover?await Y.call("discover",q,{baseDir:X}):[U],B=[];for(let $ of V)B.push(...await Y.call("load",$,{schema:Q,directiveOptions:G}));if(Q)j5(B,Q,Z);return B}function j5(Z,J,X){let W=J.required??[],q=J.properties??{};for(let Q of Z){for(let G of W)if(!(G in Q.data)||Q.data[G]==null)console.warn(`Content validation: "${X}/${Q.id}" missing required field "${G}"`);for(let[G,z]of Object.entries(q)){let Y=Q.data[G];if(Y==null)continue;if(z.type==="string"&&typeof Y!=="string")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected string, got ${typeof Y}`);else if(z.type==="number"&&typeof Y!=="number")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected number, got ${typeof Y}`);else if(z.type==="boolean"&&typeof Y!=="boolean")console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected boolean, got ${typeof Y}`);else if(z.type==="array"&&!Array.isArray(Y))console.warn(`Content validation: "${X}/${Q.id}" field "${G}" expected array, got ${typeof Y}`)}}}function e9(Z,J){for(let[X,W]of Object.entries(J.contentTypes)){let q=W.schema;if(!q?.properties)continue;let Q=Z.get(X);if(!Q)continue;for(let[G,z]of Object.entries(q.properties)){if(!z.$ref?.startsWith("#/contentTypes/"))continue;let Y=z.$ref.replace("#/contentTypes/",""),U=Z.get(Y);if(!U)continue;for(let K of Q){let V=K.data[G];if(typeof V==="string"){let B=U.find(($)=>$.id===V);if(B)K.data[G]=B}}}}}var Z2=O(()=>{g4()});import{readFileSync as QQ}from"node:fs";import{dirname as E5,resolve as Z6}from"node:path";import{createRequire as GQ}from"node:module";async function J2(Z,J,X,W={}){let q=Z.imports??{},Q=Z.state;if(!Q)return;for(let[G,z]of Object.entries(Q)){if(!z||typeof z!=="object"||!z.$prototype)continue;if(YQ.has(z.$prototype))continue;if(z.timing&&z.timing!=="compiler")continue;if(!z.$src){let Y=q[z.$prototype];if(!Y)continue;z.$src=Y}try{let Y=await UQ(z,J,X,Q,W);if(z.timing&&Y&&typeof Y==="object"&&!Array.isArray(Y))Y.timing=z.timing;Q[G]=Y}catch(Y){console.warn(`prototype-resolver: failed to resolve "${G}" ($prototype: "${z.$prototype}"):`,Y.message)}}}async function UQ(Z,J,X,W,q){let Q=Z.$src,G;if(Q.startsWith("./")||Q.startsWith("../"))G=J.sourcePath?Z6(E5(J.sourcePath),Q):Z6(X,Q);else G=GQ(Z6(X,"package.json")).resolve(Q);let z=QQ(G,"utf-8"),Y=JSON.parse(z);if(!Y.$implementation)throw Error(`${Q} has no $implementation field`);let U=Z6(E5(G),Y.$implementation),K=await a1(U),V=Z.$export??Y.title??Z.$prototype,B=K[V]??K.default?.[V];if(!B)throw Error(`Module ${Y.$implementation} does not export "${V}"`);let $={};for(let[D,L]of Object.entries(Z))if(!zQ.has(D))$[D]=L;if($.src&&!$.basePath&&J.sourcePath)$.basePath=E5(J.sourcePath);$._project={config:q.config??null,contentTypes:q.contentTypes??null,root:X},$._document={route:J,state:W};let A=new B($);if(typeof A.resolve==="function")return await A.resolve();return A}var YQ,zQ;var X2=O(()=>{g4();YQ=new Set(["Function","LocalStorage","SessionStorage","Array"]),zQ=new Set(["$prototype","$src","$export","timing","default","description"])});var v0=S((fH,q2)=>{/*!
199
+ </html>`;return{files:[V],html:H}}return B7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q})}async function nF(Z,X){let[q,W]=await Promise.all([l5(Z),Y1(Z)]),{writeFileSync:Q,mkdirSync:J}=await import("node:fs"),{dirname:z,join:Y}=await import("node:path");if(X){Q(X,q.html,"utf8"),console.error(`Written to ${X}`);let U=z(X);for(let K of q.files){let V=Y(U,K.path);J(z(V),{recursive:!0}),Q(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(q.html);if(W&&X){let U=X.replace(/(\.[^.]+)?$/,"-server.js");Q(U,W,"utf8"),console.error(`Server handler written to ${U}`)}}var L7=R(()=>{T6();a9();H1();V7();F7();S0();e0()});import{existsSync as Yz,readFileSync as Uz}from"node:fs";import{resolve as I7}from"node:path";function w7(Z){let X=I7(Z,"project.json");if(!Yz(X))throw Error(`project.json not found in ${Z}`);let q;try{q=s9(Uz(X,"utf8"),X)}catch(z){throw Error(`Invalid project.json: ${t0(z)}`,{cause:z})}let W={...$1,...q,build:{...$1.build,...q.build},defaults:{...$1.defaults,...q.defaults},images:{...$1.images,...q.images}};if(q.$head)W.$head=q.$head;if(q.$media)W.$media=q.$media;if(q.style)W.style=q.style;if(q.state)W.state=q.state;if(q.redirects)W.redirects=q.redirects;if(q.imports)W.imports=q.imports;if(q.contentTypes)W.contentTypes=q.contentTypes;let Q=["cloudflare-workers","cloudflare-pages","node","bun"];if(W.build.adapter&&!Q.includes(W.build.adapter))throw Error(`Unknown build adapter "${W.build.adapter}" in project.json. Valid adapters: ${Q.join(", ")}`);let J=["build","cloudflare"];if(!J.includes(W.images.service))throw Error(`Unknown images.service "${W.images.service}" in project.json. Valid services: ${J.join(", ")}`);return{config:W,configPath:X,projectRoot:I7(Z)}}var $1;var D7=R(()=>{e0();$1={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},contentTypes:{},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{readFileSync as N7,readdirSync as Kz}from"node:fs";import{extname as p5,join as Vz,relative as Bz,resolve as Hz}from"node:path";async function _4(Z,X){let q=N7(Z,"utf8");if(Z.endsWith(".json"))return V6(q,Z);let W=p5(Z).toLowerCase(),Q=X?.byExtension(W,"parse");if(!Q)throw Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await Q.call("parse",q)}async function T7(Z,X){let q=[],W=new Set([".json",...X?.documentExtensions("page")??[]]);return await R7(Z,Z,q,W,X),q.sort((Q,J)=>{if(Q.isDynamic!==J.isDynamic)return Q.isDynamic?1:-1;if(Q.isCatchAll!==J.isCatchAll)return Q.isCatchAll?1:-1;return Q.urlPattern.localeCompare(J.urlPattern)}),q}async function R7(Z,X,q,W,Q){let J=Kz(Z,{withFileTypes:!0});for(let z of J){let Y=Vz(Z,z.name);if(z.isDirectory()){if(z.name.startsWith("_"))continue;await R7(Y,X,q,W,Q);continue}let U=p5(z.name).toLowerCase();if(!W.has(U))continue;if(z.name.startsWith("_"))continue;let K=Bz(X,Y),V=await $z(K,Y,Q);if(V)q.push(V)}}async function $z(Z,X,q){let W=p5(Z),Q=W?Z.slice(0,-W.length):Z;if(Q=Q.split("\\").join("/"),Q.endsWith("/index"))Q=Q.slice(0,-6)||"/";else if(Q==="index")Q="/";if(!Q.startsWith("/"))Q=`/${Q}`;let J=[],z=!1,Y=!1,U=Q.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,B,H)=>{if(B)return Y=!0,z=!0,J.push(B),"*";return z=!0,J.push(H),`:${H}`}),K=null;try{let B=(await _4(X,q)).$layout;if(typeof B==="string")K=B}catch{}return{$layout:K,isCatchAll:Y,isDynamic:z,params:J,relativePath:Z,sourcePath:X,urlPattern:U}}async function _7(Z,X,q=new Map,W){let Q=[];for(let J of Z){if(!J.isDynamic){Q.push(J);continue}let z;try{z=await _4(J.sourcePath,W)}catch{Q.push(J);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${J.urlPattern} has no $paths — skipping`);continue}let Y=Fz(z.$paths,X,q);for(let U of Y){let K=J.urlPattern,V={};for(let[B,H]of Object.entries(U))V[B]=String(H),K=K.replace(`:${B}`,V[B]),K=K.replace("*",V[B]);Q.push({...J,_pathParams:V,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:K})}}return Q}function Fz(Z,X,q){if(Array.isArray(Z))return Z;if("contentType"in Z&&Z.contentType){let W=q.get(Z.contentType);if(!W||W.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let Q=Z.param??"slug",J=Z.field??"id";return W.map((z)=>({[Q]:J==="id"?z.id:z.data[J]??z.id})).filter((z)=>z[Q])}if("values"in Z&&Array.isArray(Z.values)){let W=Z.param??"value";return Z.values.map((Q)=>({[W]:Q}))}if("$ref"in Z&&Z.$ref){let W=Hz(X,Z.$ref),Q;try{Q=JSON.parse(N7(W,"utf8"))}catch(Y){let U=Y;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${U.message}`),[]}if(!Array.isArray(Q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let J=Z.param??"id",z=Z.field??"id";return Q.map((Y)=>({[J]:Y[z]??Y.id??String(Y)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var P7=R(()=>{e0()});import{existsSync as Az,readFileSync as Mz}from"node:fs";import{resolve as Lz}from"node:path";function n5(Z,X,q){let W=Z.$layout??X.defaults?.layout??null;if(!W)return Z;let Q=Lz(q,W);if(!Az(Q))throw Error(`Layout not found: ${W} (resolved to ${Q})`);let J;try{J=V6(Mz(Q,"utf8"),Q)}catch(K){throw Error(`Invalid layout JSON at ${Q}: ${K.message}`,{cause:K})}if(J.$layout)J=n5(J,X,q);let z=Z.children??[],Y=typeof z==="string"?[z]:Array.isArray(z)?z:[],U=wz(J);if(Iz(U,Y),Z.state)U.state={...U.state,...Z.state};if(Z.$media)U.$media={...U.$media,...Z.$media};if(Z.style)U.style={...U.style,...Z.style};if(Z.attributes)U.attributes={...U.attributes,...Z.attributes};if(Z.$head)U._pageHead=Z.$head;if(Z.title)U._pageTitle=Z.title;return delete U.$layout,U}function Iz(Z,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let q=new Map,W=[];for(let Q of X)if(Q&&typeof Q==="object"&&Q.attributes?.slot){let J=Q.attributes.slot;if(!q.has(J))q.set(J,[]);q.get(J).push(Q)}else W.push(Q);j7(Z,q,W)}function j7(Z,X,q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=[];for(let Q of Z.children)if(Q&&typeof Q==="object"&&Q.tagName==="slot"){let J=Q.attributes?.name;if(J&&X.has(J))W.push(...X.get(J)),X.delete(J);else if(!J&&q.length>0)W.push(...q);else if(Array.isArray(Q.children))W.push(...Q.children)}else j7(Q,X,q),W.push(Q);Z.children=W}function wz(Z){return structuredClone(Z)}var E7=R(()=>{e0()});function C7(Z=[],X=[],q=[],W={}){let Q=[{attributes:{charset:W.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],J=new Map;for(let Y of[...Q,...Z,...X,...q]){let U=Dz(Y);J.set(U,Y)}let z=W.title??W.siteName??"Jx Site";if(J.set("title",{children:[z],tagName:"title"}),W.pageUrl&&W.siteUrl){let Y=new URL(W.pageUrl,W.siteUrl).href;J.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"})}return[...J.values()]}function Dz(Z){if(!Z||typeof Z!=="object")return String(Z);let X=Z.tagName??"unknown",q=Z.attributes??{};if(X==="title")return"title";if(q.charset)return"meta:charset";if(X==="meta"&&q.name)return`meta:${q.name}`;if(X==="meta"&&q.property)return`meta:${q.property}`;if(X==="link"&&q.rel)return`link:${q.rel}:${q.href??""}`;if(X==="script"&&q.src)return`script:${q.src}`;if(X==="style"){let W=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${Nz(W)}`}return`${X}:${JSON.stringify(Z)}`}function Nz(Z){let X=0;for(let q=0;q<Z.length;q++)X=Math.trunc((X<<5)-X+(Z.codePointAt(q)??0));return X.toString(36)}function O7(Z){return Z.map((X)=>Tz(X)).join(`
200
+ `)}function Tz(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let X=Z.tagName,q=Z.attributes??{},W=Object.entries(q).map(([Y,U])=>U===!0?Y:`${Y}="${Rz(U)}"`).join(" "),Q=W?`<${X} ${W}>`:`<${X}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(X))return Q;let z=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${Q}${z}</${X}>`}function Rz(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as _z,relative as Pz,resolve as jz}from"node:path";function x7(Z,X,q,W=new Map,Q=null){if(!Z.state)Z.state={};if(Z.state.$site={name:X.name??"Jx Site",url:X.url??"",...X.state},Z.state.$page={params:q._pathParams??{},title:Z.title??Z._pageTitle??X.name??"",url:q.urlPattern},X.state){for(let[J,z]of Object.entries(X.state))if(J!=="$site"&&J!=="$page"&&!(J in Z.state))Z.state[J]=z}if(X.$media)Z.$media={...X.$media,...Z.$media};if(X.imports&&Object.keys(X.imports).length>0){if(!Z.imports)Z.imports={};for(let[J,z]of Object.entries(X.imports))if(!(J in Z.imports)){let Y=z;if(Q&&q.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let U=jz(Q,Y);Z.imports[J]=`./${Pz(_z(q.sourcePath),U)}`}else Z.imports[J]=Y}}if(X.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...X.$elements];else{let J=new Set,z=[];for(let Y of[...X.$elements,...Z.$elements]){let U=typeof Y==="string"?Y:Y?.$ref;if(U&&!J.has(U))J.add(U),z.push(Y)}Z.$elements=z}return Z}var k7=()=>{};import{existsSync as Ez,readFileSync as Cz,readdirSync as Oz}from"node:fs";import{basename as S7,extname as b7,resolve as r5}from"node:path";function xz(Z){let X=JSON.parse(Cz(Z,"utf8"));if(Array.isArray(X))return X.map((W,Q)=>({body:null,data:W,id:W.id??`${S7(Z,".json")}-${Q}`}));let q=X;return[{body:null,data:q,id:q.id??S7(Z,".json")}]}function kz(Z){if(b7(Z))return Ez(Z)?[Z]:[];try{return Oz(Z,{recursive:!0}).filter((X)=>String(X).endsWith(".json")).map((X)=>r5(Z,String(X)))}catch{return[]}}function a5(Z,X){let q=r5(Z,"content");return{config:{contentTypes:X?.contentTypes??{}},contentDir:q}}async function v7(Z,X,q){let W=a5(Z,X);if(!W)return new Map;let{config:Q}=W,J=new Map;if(Object.keys(Q.contentTypes).length===0)return J;let z=q??await T4(Z,X);for(let[Y,U]of Object.entries(Q.contentTypes)){let K=await Sz(Y,U,Z,z);J.set(Y,K)}return J}async function Sz(Z,X,q,W){let{source:Q}=X;if(!Q)return[];let{schema:J}=X,z=X.$elements?.length?{allowedNames:X.$elements.filter(($)=>typeof $==="string"||typeof $==="object"&&$?.$ref).map(($)=>typeof $==="string"?$:$.$ref)}:void 0,Y=X.format,U;if(Y&&Y!=="json"){if(U=W.byName(Y),!U)throw Error(`Content type "${Z}": format "${Y}" is not an imported format class. Add it to project.json imports, e.g. "${Y}": "@jxsuite/parser/${Y}.class.json".`)}if(Q.startsWith("http://")||Q.startsWith("https://")){if(!U)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!U.remote)throw Error(`Content type "${Z}": format "${U.name}" does not support remote sources (its format block lacks "remote": true).`);try{let $=await U.call("load",Q,{directiveOptions:z,schema:J});if(J)i5($,J,Z);return $}catch($){return console.warn(`Content type "${Z}": ${t0($)}`),[]}}let K=r5(q,Q).split("\\").join("/"),V=b7(Q).toLowerCase();if(Y==="json"||!U&&V===".json"){let $=kz(K),F=[];for(let L of $)F.push(...xz(L));if(J)i5(F,J,Z);return F}if(!U&&V)U=W.byExtension(V,"load");if(!U)throw m5(Q,V||`content type "${Z}" (directory sources need an explicit "format")`);let B=U.capabilities.discover?await U.call("discover",Q,{baseDir:q}):[K],H=[];for(let $ of B)H.push(...await U.call("load",$,{directiveOptions:z,schema:J}));if(J)i5(H,J,Z);return H}function i5(Z,X,q){let W=X.required??[],Q=X.properties??{};for(let J of Z){for(let z of W)if(!(z in J.data)||J.data[z]==null)console.warn(`Content validation: "${q}/${J.id}" missing required field "${z}"`);for(let[z,Y]of Object.entries(Q)){let U=J.data[z];if(U==null)continue;if(Y.type==="string"&&typeof U!=="string")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected string, got ${typeof U}`);else if(Y.type==="number"&&typeof U!=="number")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected number, got ${typeof U}`);else if(Y.type==="boolean"&&typeof U!=="boolean")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected boolean, got ${typeof U}`);else if(Y.type==="array"&&!Array.isArray(U))console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected array, got ${typeof U}`)}}}function y7(Z,X){for(let[q,W]of Object.entries(X.contentTypes)){let{schema:Q}=W;if(!Q?.properties)continue;let J=Z.get(q);if(!J)continue;for(let[z,Y]of Object.entries(Q.properties)){if(!Y.$ref?.startsWith("#/contentTypes/"))continue;let U=Y.$ref.replace("#/contentTypes/",""),K=Z.get(U);if(!K)continue;for(let V of J){let B=V.data[z];if(typeof B==="string"){let H=K.find(($)=>$.id===B);if(H)V.data[z]=H}}}}}var g7=R(()=>{e0();s6()});import{readFileSync as bz}from"node:fs";import{dirname as s5,resolve as F1}from"node:path";import{createRequire as vz}from"node:module";async function h7(Z,X,q,W={}){let Q=Z.imports??{},{state:J}=Z;if(!J)return;for(let[z,Y]of Object.entries(J)){if(!I6(Y))continue;if(yz.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler")continue;if(!Y.$src){let U=Q[Y.$prototype];if(!U)continue;Y.$src=U}try{let U=await hz(Y,X,q,J,W);if(Y.timing&&U&&typeof U==="object"&&!Array.isArray(U))U.timing=Y.timing;J[z]=U}catch(U){console.warn(`prototype-resolver: failed to resolve "${z}" ($prototype: "${Y.$prototype}"):`,t0(U))}}}async function hz(Z,X,q,W,Q){let J=Z.$src;if(!J)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let z;if(J.startsWith("./")||J.startsWith("../"))z=X.sourcePath?F1(s5(X.sourcePath),J):F1(q,J);else z=vz(F1(q,"package.json")).resolve(J);let Y=bz(z,"utf8"),U=o9(Y,z);if(!U.$implementation)throw Error(`${J} has no $implementation field`);let K=F1(s5(z),U.$implementation),V=await K1(K),B=Z.$export??U.title??Z.$prototype,H=V[B]??V.default?.[B];if(!H)throw Error(`Module ${U.$implementation} does not export "${B}"`);let $={};for(let[L,A]of Object.entries(Z))if(!gz.has(L))$[L]=A;if($.src&&!$.basePath&&X.sourcePath)$.basePath=s5(X.sourcePath);$._project={config:Q.config??null,contentTypes:Q.contentTypes??null,root:q},$._document={route:X,state:W};let F=new H($);if(typeof F.resolve==="function")return await F.resolve();return F}var yz,gz;var m7=R(()=>{s6();S0();e0();yz=new Set(["Function","LocalStorage","SessionStorage","Array"]),gz=new Set(["$prototype","$src","$export","timing","default","description"])});var f7=(Z)=>typeof Z<"u"&&Z!==null,mz=(Z)=>typeof Z==="object",fz=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",uz=(Z)=>typeof Z==="function",dz=(Z)=>typeof Z==="boolean",cz=(Z)=>Z instanceof Buffer,lz=(Z)=>{if(f7(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},pz=(Z)=>Z instanceof ArrayBuffer,nz=(Z)=>typeof Z==="string"&&Z.length>0,iz=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),rz=(Z)=>Number.isInteger(Z),az=(Z,X,q)=>Z>=X&&Z<=q,sz=(Z,X)=>X.includes(Z),oz=(Z,X,q)=>Error(`Expected ${X} for ${Z} but received ${q} of type ${typeof q}`),tz=(Z,X)=>{return X.message=Z.message,X},G;var m0=R(()=>{/*!
196
201
  Copyright 2013 Lovell Fuller and others.
197
202
  SPDX-License-Identifier: Apache-2.0
198
- */var W2=(Z)=>typeof Z<"u"&&Z!==null,KQ=(Z)=>typeof Z==="object",VQ=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",HQ=(Z)=>typeof Z==="function",BQ=(Z)=>typeof Z==="boolean",$Q=(Z)=>Z instanceof Buffer,FQ=(Z)=>{if(W2(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},MQ=(Z)=>Z instanceof ArrayBuffer,AQ=(Z)=>typeof Z==="string"&&Z.length>0,LQ=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),IQ=(Z)=>Number.isInteger(Z),DQ=(Z,J,X)=>Z>=J&&Z<=X,wQ=(Z,J)=>J.includes(Z),NQ=(Z,J,X)=>Error(`Expected ${J} for ${Z} but received ${X} of type ${typeof X}`),TQ=(Z,J)=>{return J.message=Z.message,J};q2.exports={defined:W2,object:KQ,plainObject:VQ,fn:HQ,bool:BQ,buffer:$Q,typedArray:FQ,arrayBuffer:MQ,string:AQ,number:LQ,integer:IQ,inRange:DQ,inArray:wQ,invalidParameterError:NQ,nativeError:TQ}});var Y2=S((uH,G2)=>{var Q2=()=>process.platform==="linux",J6=null,PQ=()=>{if(!J6)if(Q2()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,J6=process.report.getReport(),process.report.excludeNetwork=Z}else J6={};return J6};G2.exports={isLinux:Q2,getReport:PQ}});var U2=S((dH,z2)=>{var m4=h("fs"),RQ=(Z)=>{let J=m4.openSync(Z,"r"),X=Buffer.alloc(2048),W=m4.readSync(J,X,0,2048,0);return m4.close(J,()=>{}),X.subarray(0,W)},jQ=(Z)=>new Promise((J,X)=>{m4.open(Z,"r",(W,q)=>{if(W)X(W);else{let Q=Buffer.alloc(2048);m4.read(q,Q,0,2048,0,(G,z)=>{J(Q.subarray(0,z)),m4.close(q,()=>{})})}})});z2.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:RQ,readFile:jQ}});var V2=S((cH,K2)=>{var _Q=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let J=Z.readUInt32LE(32),X=Z.readUInt16LE(54),W=Z.readUInt16LE(56);for(let q=0;q<W;q++){let Q=J+q*X;if(Z.readUInt32LE(Q)===3){let z=Z.readUInt32LE(Q+8),Y=Z.readUInt32LE(Q+32);return Z.subarray(z,z+Y).toString().replace(/\0.*$/g,"")}}return null};K2.exports={interpreterPath:_Q}});var W6=S((lH,C2)=>{var B2=h("child_process"),{isLinux:f4,getReport:$2}=Y2(),{LDD_PATH:X6,SELF_PATH:F2,readFile:O5,readFileSync:x5}=U2(),{interpreterPath:M2}=V2(),y0,g0,h0,J4="",A2=()=>{if(!J4)return new Promise((Z)=>{B2.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(J,X)=>{J4=J?" ":X,Z(J4)})});return J4},L2=()=>{if(!J4)try{J4=B2.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){J4=" "}return J4},r0="glibc",I2=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,M4="musl",CQ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),D2=()=>{let Z=$2();if(Z.header&&Z.header.glibcVersionRuntime)return r0;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(CQ))return M4}return null},w2=(Z)=>{let[J,X]=Z.split(/[\r\n]+/);if(J&&J.includes(r0))return r0;if(X&&X.includes(M4))return M4;return null},N2=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return M4;else if(Z.includes("/ld-linux-"))return r0}return null},T2=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return M4;if(Z.includes("GNU C Library"))return r0;return null},EQ=async()=>{if(g0!==void 0)return g0;g0=null;try{let Z=await O5(X6);g0=T2(Z)}catch(Z){}return g0},OQ=()=>{if(g0!==void 0)return g0;g0=null;try{let Z=x5(X6);g0=T2(Z)}catch(Z){}return g0},xQ=async()=>{if(y0!==void 0)return y0;y0=null;try{let Z=await O5(F2),J=M2(Z);y0=N2(J)}catch(Z){}return y0},kQ=()=>{if(y0!==void 0)return y0;y0=null;try{let Z=x5(F2),J=M2(Z);y0=N2(J)}catch(Z){}return y0},P2=async()=>{let Z=null;if(f4()){if(Z=await xQ(),!Z){if(Z=await EQ(),!Z)Z=D2();if(!Z){let J=await A2();Z=w2(J)}}}return Z},R2=()=>{let Z=null;if(f4()){if(Z=kQ(),!Z){if(Z=OQ(),!Z)Z=D2();if(!Z){let J=L2();Z=w2(J)}}}return Z},SQ=async()=>f4()&&await P2()!==r0,bQ=()=>f4()&&R2()!==r0,vQ=async()=>{if(h0!==void 0)return h0;h0=null;try{let J=(await O5(X6)).match(I2);if(J)h0=J[1]}catch(Z){}return h0},yQ=()=>{if(h0!==void 0)return h0;h0=null;try{let J=x5(X6).match(I2);if(J)h0=J[1]}catch(Z){}return h0},j2=()=>{let Z=$2();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},H2=(Z)=>Z.trim().split(/\s+/)[1],_2=(Z)=>{let[J,X,W]=Z.split(/[\r\n]+/);if(J&&J.includes(r0))return H2(J);if(X&&W&&X.includes(M4))return H2(W);return null},gQ=async()=>{let Z=null;if(f4()){if(Z=await vQ(),!Z)Z=j2();if(!Z){let J=await A2();Z=_2(J)}}return Z},hQ=()=>{let Z=null;if(f4()){if(Z=yQ(),!Z)Z=j2();if(!Z){let J=L2();Z=_2(J)}}return Z};C2.exports={GLIBC:r0,MUSL:M4,family:P2,familySync:R2,isNonGlibcLinux:SQ,isNonGlibcLinuxSync:bQ,version:gQ,versionSync:hQ}});var M1=S((pH,E2)=>{var mQ=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};E2.exports=mQ});var q6=S((nH,O2)=>{var fQ=Number.MAX_SAFE_INTEGER||9007199254740991,uQ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];O2.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:fQ,RELEASE_TYPES:uQ,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var A1=S((m0,x2)=>{var{MAX_SAFE_COMPONENT_LENGTH:k5,MAX_SAFE_BUILD_LENGTH:dQ,MAX_LENGTH:cQ}=q6(),lQ=M1();m0=x2.exports={};var pQ=m0.re=[],nQ=m0.safeRe=[],P=m0.src=[],rQ=m0.safeSrc=[],R=m0.t={},iQ=0,S5="[a-zA-Z0-9-]",aQ=[["\\s",1],["\\d",cQ],[S5,dQ]],sQ=(Z)=>{for(let[J,X]of aQ)Z=Z.split(`${J}*`).join(`${J}{0,${X}}`).split(`${J}+`).join(`${J}{1,${X}}`);return Z},x=(Z,J,X)=>{let W=sQ(J),q=iQ++;lQ(Z,q,J),R[Z]=q,P[q]=J,rQ[q]=W,pQ[q]=new RegExp(J,X?"g":void 0),nQ[q]=new RegExp(W,X?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*");x("NUMERICIDENTIFIERLOOSE","\\d+");x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${S5}*`);x("MAINVERSION",`(${P[R.NUMERICIDENTIFIER]})\\.(${P[R.NUMERICIDENTIFIER]})\\.(${P[R.NUMERICIDENTIFIER]})`);x("MAINVERSIONLOOSE",`(${P[R.NUMERICIDENTIFIERLOOSE]})\\.(${P[R.NUMERICIDENTIFIERLOOSE]})\\.(${P[R.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASEIDENTIFIER",`(?:${P[R.NONNUMERICIDENTIFIER]}|${P[R.NUMERICIDENTIFIER]})`);x("PRERELEASEIDENTIFIERLOOSE",`(?:${P[R.NONNUMERICIDENTIFIER]}|${P[R.NUMERICIDENTIFIERLOOSE]})`);x("PRERELEASE",`(?:-(${P[R.PRERELEASEIDENTIFIER]}(?:\\.${P[R.PRERELEASEIDENTIFIER]})*))`);x("PRERELEASELOOSE",`(?:-?(${P[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${P[R.PRERELEASEIDENTIFIERLOOSE]})*))`);x("BUILDIDENTIFIER",`${S5}+`);x("BUILD",`(?:\\+(${P[R.BUILDIDENTIFIER]}(?:\\.${P[R.BUILDIDENTIFIER]})*))`);x("FULLPLAIN",`v?${P[R.MAINVERSION]}${P[R.PRERELEASE]}?${P[R.BUILD]}?`);x("FULL",`^${P[R.FULLPLAIN]}$`);x("LOOSEPLAIN",`[v=\\s]*${P[R.MAINVERSIONLOOSE]}${P[R.PRERELEASELOOSE]}?${P[R.BUILD]}?`);x("LOOSE",`^${P[R.LOOSEPLAIN]}$`);x("GTLT","((?:<|>)?=?)");x("XRANGEIDENTIFIERLOOSE",`${P[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);x("XRANGEIDENTIFIER",`${P[R.NUMERICIDENTIFIER]}|x|X|\\*`);x("XRANGEPLAIN",`[v=\\s]*(${P[R.XRANGEIDENTIFIER]})(?:\\.(${P[R.XRANGEIDENTIFIER]})(?:\\.(${P[R.XRANGEIDENTIFIER]})(?:${P[R.PRERELEASE]})?${P[R.BUILD]}?)?)?`);x("XRANGEPLAINLOOSE",`[v=\\s]*(${P[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[R.XRANGEIDENTIFIERLOOSE]})(?:${P[R.PRERELEASELOOSE]})?${P[R.BUILD]}?)?)?`);x("XRANGE",`^${P[R.GTLT]}\\s*${P[R.XRANGEPLAIN]}$`);x("XRANGELOOSE",`^${P[R.GTLT]}\\s*${P[R.XRANGEPLAINLOOSE]}$`);x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${k5}})(?:\\.(\\d{1,${k5}}))?(?:\\.(\\d{1,${k5}}))?`);x("COERCE",`${P[R.COERCEPLAIN]}(?:$|[^\\d])`);x("COERCEFULL",P[R.COERCEPLAIN]+`(?:${P[R.PRERELEASE]})?(?:${P[R.BUILD]})?(?:$|[^\\d])`);x("COERCERTL",P[R.COERCE],!0);x("COERCERTLFULL",P[R.COERCEFULL],!0);x("LONETILDE","(?:~>?)");x("TILDETRIM",`(\\s*)${P[R.LONETILDE]}\\s+`,!0);m0.tildeTrimReplace="$1~";x("TILDE",`^${P[R.LONETILDE]}${P[R.XRANGEPLAIN]}$`);x("TILDELOOSE",`^${P[R.LONETILDE]}${P[R.XRANGEPLAINLOOSE]}$`);x("LONECARET","(?:\\^)");x("CARETTRIM",`(\\s*)${P[R.LONECARET]}\\s+`,!0);m0.caretTrimReplace="$1^";x("CARET",`^${P[R.LONECARET]}${P[R.XRANGEPLAIN]}$`);x("CARETLOOSE",`^${P[R.LONECARET]}${P[R.XRANGEPLAINLOOSE]}$`);x("COMPARATORLOOSE",`^${P[R.GTLT]}\\s*(${P[R.LOOSEPLAIN]})$|^$`);x("COMPARATOR",`^${P[R.GTLT]}\\s*(${P[R.FULLPLAIN]})$|^$`);x("COMPARATORTRIM",`(\\s*)${P[R.GTLT]}\\s*(${P[R.LOOSEPLAIN]}|${P[R.XRANGEPLAIN]})`,!0);m0.comparatorTrimReplace="$1$2$3";x("HYPHENRANGE",`^\\s*(${P[R.XRANGEPLAIN]})\\s+-\\s+(${P[R.XRANGEPLAIN]})\\s*$`);x("HYPHENRANGELOOSE",`^\\s*(${P[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${P[R.XRANGEPLAINLOOSE]})\\s*$`);x("STAR","(<|>)?=?\\s*\\*");x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Q6=S((rH,k2)=>{var oQ=Object.freeze({loose:!0}),tQ=Object.freeze({}),eQ=(Z)=>{if(!Z)return tQ;if(typeof Z!=="object")return oQ;return Z};k2.exports=eQ});var y2=S((iH,v2)=>{var S2=/^[0-9]+$/,b2=(Z,J)=>{if(typeof Z==="number"&&typeof J==="number")return Z===J?0:Z<J?-1:1;let X=S2.test(Z),W=S2.test(J);if(X&&W)Z=+Z,J=+J;return Z===J?0:X&&!W?-1:W&&!X?1:Z<J?-1:1},ZG=(Z,J)=>b2(J,Z);v2.exports={compareIdentifiers:b2,rcompareIdentifiers:ZG}});var u4=S((aH,h2)=>{var G6=M1(),{MAX_LENGTH:g2,MAX_SAFE_INTEGER:Y6}=q6(),{safeRe:z6,t:U6}=A1(),JG=Q6(),{compareIdentifiers:b5}=y2();class E0{constructor(Z,J){if(J=JG(J),Z instanceof E0)if(Z.loose===!!J.loose&&Z.includePrerelease===!!J.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>g2)throw TypeError(`version is longer than ${g2} characters`);G6("SemVer",Z,J),this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease;let X=Z.trim().match(J.loose?z6[U6.LOOSE]:z6[U6.FULL]);if(!X)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>Y6||this.major<0)throw TypeError("Invalid major version");if(this.minor>Y6||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Y6||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){let q=+W;if(q>=0&&q<Y6)return q}return W});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(G6("SemVer.compare",this.version,this.options,Z),!(Z instanceof E0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new E0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let J=0;do{let X=this.prerelease[J],W=Z.prerelease[J];if(G6("prerelease compare",J,X,W),X===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(X===void 0)return-1;else if(X===W)continue;else return b5(X,W)}while(++J)}compareBuild(Z){if(!(Z instanceof E0))Z=new E0(Z,this.options);let J=0;do{let X=this.build[J],W=Z.build[J];if(G6("build compare",J,X,W),X===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(X===void 0)return-1;else if(X===W)continue;else return b5(X,W)}while(++J)}inc(Z,J,X){if(Z.startsWith("pre")){if(!J&&X===!1)throw Error("invalid increment argument: identifier is empty");if(J){let W=`-${J}`.match(this.options.loose?z6[U6.PRERELEASELOOSE]:z6[U6.PRERELEASE]);if(!W||W[1]!==J)throw Error(`invalid identifier: ${J}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",J,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",J,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",J,X),this.inc("pre",J,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",J,X);this.inc("pre",J,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let W=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let q=this.prerelease.length;while(--q>=0)if(typeof this.prerelease[q]==="number")this.prerelease[q]++,q=-2;if(q===-1){if(J===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(J){let q=[J,W];if(X===!1)q=[J];if(b5(this.prerelease[0],J)===0){if(isNaN(this.prerelease[1]))this.prerelease=q}else this.prerelease=q}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}h2.exports=E0});var u2=S((sH,f2)=>{var m2=u4(),XG=(Z,J,X=!1)=>{if(Z instanceof m2)return Z;try{return new m2(Z,J)}catch(W){if(!X)return null;throw W}};f2.exports=XG});var c2=S((oH,d2)=>{var WG=u4(),qG=u2(),{safeRe:K6,t:V6}=A1(),QG=(Z,J)=>{if(Z instanceof WG)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;J=J||{};let X=null;if(!J.rtl)X=Z.match(J.includePrerelease?K6[V6.COERCEFULL]:K6[V6.COERCE]);else{let Y=J.includePrerelease?K6[V6.COERCERTLFULL]:K6[V6.COERCERTL],U;while((U=Y.exec(Z))&&(!X||X.index+X[0].length!==Z.length)){if(!X||U.index+U[0].length!==X.index+X[0].length)X=U;Y.lastIndex=U.index+U[1].length+U[2].length}Y.lastIndex=-1}if(X===null)return null;let W=X[2],q=X[3]||"0",Q=X[4]||"0",G=J.includePrerelease&&X[5]?`-${X[5]}`:"",z=J.includePrerelease&&X[6]?`+${X[6]}`:"";return qG(`${W}.${q}.${Q}${G}${z}`,J)};d2.exports=QG});var A4=S((tH,p2)=>{var l2=u4(),GG=(Z,J,X)=>new l2(Z,X).compare(new l2(J,X));p2.exports=GG});var v5=S((eH,n2)=>{var YG=A4(),zG=(Z,J,X)=>YG(Z,J,X)>=0;n2.exports=zG});var a2=S((ZB,i2)=>{class r2{constructor(){this.max=1000,this.map=new Map}get(Z){let J=this.map.get(Z);if(J===void 0)return;else return this.map.delete(Z),this.map.set(Z,J),J}delete(Z){return this.map.delete(Z)}set(Z,J){if(!this.delete(Z)&&J!==void 0){if(this.map.size>=this.max){let W=this.map.keys().next().value;this.delete(W)}this.map.set(Z,J)}return this}}i2.exports=r2});var o2=S((JB,s2)=>{var UG=A4(),KG=(Z,J,X)=>UG(Z,J,X)===0;s2.exports=KG});var e2=S((XB,t2)=>{var VG=A4(),HG=(Z,J,X)=>VG(Z,J,X)!==0;t2.exports=HG});var J8=S((WB,Z8)=>{var BG=A4(),$G=(Z,J,X)=>BG(Z,J,X)>0;Z8.exports=$G});var W8=S((qB,X8)=>{var FG=A4(),MG=(Z,J,X)=>FG(Z,J,X)<0;X8.exports=MG});var Q8=S((QB,q8)=>{var AG=A4(),LG=(Z,J,X)=>AG(Z,J,X)<=0;q8.exports=LG});var Y8=S((GB,G8)=>{var IG=o2(),DG=e2(),wG=J8(),NG=v5(),TG=W8(),PG=Q8(),RG=(Z,J,X,W)=>{switch(J){case"===":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z===X;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z!==X;case"":case"=":case"==":return IG(Z,X,W);case"!=":return DG(Z,X,W);case">":return wG(Z,X,W);case">=":return NG(Z,X,W);case"<":return TG(Z,X,W);case"<=":return PG(Z,X,W);default:throw TypeError(`Invalid operator: ${J}`)}};G8.exports=RG});var $8=S((YB,B8)=>{var L1=Symbol("SemVer ANY");class H6{static get ANY(){return L1}constructor(Z,J){if(J=z8(J),Z instanceof H6)if(Z.loose===!!J.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),g5("comparator",Z,J),this.options=J,this.loose=!!J.loose,this.parse(Z),this.semver===L1)this.value="";else this.value=this.operator+this.semver.version;g5("comp",this)}parse(Z){let J=this.options.loose?U8[K8.COMPARATORLOOSE]:U8[K8.COMPARATOR],X=Z.match(J);if(!X)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=L1;else this.semver=new V8(X[2],this.options.loose)}toString(){return this.value}test(Z){if(g5("Comparator.test",Z,this.options.loose),this.semver===L1||Z===L1)return!0;if(typeof Z==="string")try{Z=new V8(Z,this.options)}catch(J){return!1}return y5(Z,this.operator,this.semver,this.options)}intersects(Z,J){if(!(Z instanceof H6))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new H8(Z.value,J).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new H8(this.value,J).test(Z.semver)}if(J=z8(J),J.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!J.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(y5(this.semver,"<",Z.semver,J)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(y5(this.semver,">",Z.semver,J)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}B8.exports=H6;var z8=Q6(),{safeRe:U8,t:K8}=A1(),y5=Y8(),g5=M1(),V8=u4(),H8=h5()});var h5=S((zB,L8)=>{var jG=/\s+/g;class I1{constructor(Z,J){if(J=CG(J),Z instanceof I1)if(Z.loose===!!J.loose&&Z.includePrerelease===!!J.includePrerelease)return Z;else return new I1(Z.raw,J);if(Z instanceof m5)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease,this.raw=Z.trim().replace(jG," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((W)=>!M8(W[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&vG(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let J=this.set[Z];for(let X=0;X<J.length;X++){if(X>0)this.formatted+=" ";this.formatted+=J[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){let X=((this.options.includePrerelease&&SG)|(this.options.loose&&bG))+":"+Z,W=F8.get(X);if(W)return W;let q=this.options.loose,Q=q?K0[Q0.HYPHENRANGELOOSE]:K0[Q0.HYPHENRANGE];Z=Z.replace(Q,pG(this.options.includePrerelease)),l("hyphen replace",Z),Z=Z.replace(K0[Q0.COMPARATORTRIM],OG),l("comparator trim",Z),Z=Z.replace(K0[Q0.TILDETRIM],xG),l("tilde trim",Z),Z=Z.replace(K0[Q0.CARETTRIM],kG),l("caret trim",Z);let G=Z.split(" ").map((K)=>yG(K,this.options)).join(" ").split(/\s+/).map((K)=>lG(K,this.options));if(q)G=G.filter((K)=>{return l("loose invalid filter",K,this.options),!!K.match(K0[Q0.COMPARATORLOOSE])});l("range list",G);let z=new Map,Y=G.map((K)=>new m5(K,this.options));for(let K of Y){if(M8(K))return[K];z.set(K.value,K)}if(z.size>1&&z.has(""))z.delete("");let U=[...z.values()];return F8.set(X,U),U}intersects(Z,J){if(!(Z instanceof I1))throw TypeError("a Range is required");return this.set.some((X)=>{return A8(X,J)&&Z.set.some((W)=>{return A8(W,J)&&X.every((q)=>{return W.every((Q)=>{return q.intersects(Q,J)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new EG(Z,this.options)}catch(J){return!1}for(let J=0;J<this.set.length;J++)if(nG(this.set[J],Z,this.options))return!0;return!1}}L8.exports=I1;var _G=a2(),F8=new _G,CG=Q6(),m5=$8(),l=M1(),EG=u4(),{safeRe:K0,t:Q0,comparatorTrimReplace:OG,tildeTrimReplace:xG,caretTrimReplace:kG}=A1(),{FLAG_INCLUDE_PRERELEASE:SG,FLAG_LOOSE:bG}=q6(),M8=(Z)=>Z.value==="<0.0.0-0",vG=(Z)=>Z.value==="",A8=(Z,J)=>{let X=!0,W=Z.slice(),q=W.pop();while(X&&W.length)X=W.every((Q)=>{return q.intersects(Q,J)}),q=W.pop();return X},yG=(Z,J)=>{return Z=Z.replace(K0[Q0.BUILD],""),l("comp",Z,J),Z=mG(Z,J),l("caret",Z),Z=gG(Z,J),l("tildes",Z),Z=uG(Z,J),l("xrange",Z),Z=cG(Z,J),l("stars",Z),Z},V0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",gG=(Z,J)=>{return Z.trim().split(/\s+/).map((X)=>hG(X,J)).join(" ")},hG=(Z,J)=>{let X=J.loose?K0[Q0.TILDELOOSE]:K0[Q0.TILDE];return Z.replace(X,(W,q,Q,G,z)=>{l("tilde",Z,W,q,Q,G,z);let Y;if(V0(q))Y="";else if(V0(Q))Y=`>=${q}.0.0 <${+q+1}.0.0-0`;else if(V0(G))Y=`>=${q}.${Q}.0 <${q}.${+Q+1}.0-0`;else if(z)l("replaceTilde pr",z),Y=`>=${q}.${Q}.${G}-${z} <${q}.${+Q+1}.0-0`;else Y=`>=${q}.${Q}.${G} <${q}.${+Q+1}.0-0`;return l("tilde return",Y),Y})},mG=(Z,J)=>{return Z.trim().split(/\s+/).map((X)=>fG(X,J)).join(" ")},fG=(Z,J)=>{l("caret",Z,J);let X=J.loose?K0[Q0.CARETLOOSE]:K0[Q0.CARET],W=J.includePrerelease?"-0":"";return Z.replace(X,(q,Q,G,z,Y)=>{l("caret",Z,q,Q,G,z,Y);let U;if(V0(Q))U="";else if(V0(G))U=`>=${Q}.0.0${W} <${+Q+1}.0.0-0`;else if(V0(z))if(Q==="0")U=`>=${Q}.${G}.0${W} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.0${W} <${+Q+1}.0.0-0`;else if(Y)if(l("replaceCaret pr",Y),Q==="0")if(G==="0")U=`>=${Q}.${G}.${z}-${Y} <${Q}.${G}.${+z+1}-0`;else U=`>=${Q}.${G}.${z}-${Y} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.${z}-${Y} <${+Q+1}.0.0-0`;else if(l("no pr"),Q==="0")if(G==="0")U=`>=${Q}.${G}.${z}${W} <${Q}.${G}.${+z+1}-0`;else U=`>=${Q}.${G}.${z}${W} <${Q}.${+G+1}.0-0`;else U=`>=${Q}.${G}.${z} <${+Q+1}.0.0-0`;return l("caret return",U),U})},uG=(Z,J)=>{return l("replaceXRanges",Z,J),Z.split(/\s+/).map((X)=>dG(X,J)).join(" ")},dG=(Z,J)=>{Z=Z.trim();let X=J.loose?K0[Q0.XRANGELOOSE]:K0[Q0.XRANGE];return Z.replace(X,(W,q,Q,G,z,Y)=>{l("xRange",Z,W,q,Q,G,z,Y);let U=V0(Q),K=U||V0(G),V=K||V0(z),B=V;if(q==="="&&B)q="";if(Y=J.includePrerelease?"-0":"",U)if(q===">"||q==="<")W="<0.0.0-0";else W="*";else if(q&&B){if(K)G=0;if(z=0,q===">")if(q=">=",K)Q=+Q+1,G=0,z=0;else G=+G+1,z=0;else if(q==="<=")if(q="<",K)Q=+Q+1;else G=+G+1;if(q==="<")Y="-0";W=`${q+Q}.${G}.${z}${Y}`}else if(K)W=`>=${Q}.0.0${Y} <${+Q+1}.0.0-0`;else if(V)W=`>=${Q}.${G}.0${Y} <${Q}.${+G+1}.0-0`;return l("xRange return",W),W})},cG=(Z,J)=>{return l("replaceStars",Z,J),Z.trim().replace(K0[Q0.STAR],"")},lG=(Z,J)=>{return l("replaceGTE0",Z,J),Z.trim().replace(K0[J.includePrerelease?Q0.GTE0PRE:Q0.GTE0],"")},pG=(Z)=>(J,X,W,q,Q,G,z,Y,U,K,V,B)=>{if(V0(W))X="";else if(V0(q))X=`>=${W}.0.0${Z?"-0":""}`;else if(V0(Q))X=`>=${W}.${q}.0${Z?"-0":""}`;else if(G)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(V0(U))Y="";else if(V0(K))Y=`<${+U+1}.0.0-0`;else if(V0(V))Y=`<${U}.${+K+1}.0-0`;else if(B)Y=`<=${U}.${K}.${V}-${B}`;else if(Z)Y=`<${U}.${K}.${+V+1}-0`;else Y=`<=${Y}`;return`${X} ${Y}`.trim()},nG=(Z,J,X)=>{for(let W=0;W<Z.length;W++)if(!Z[W].test(J))return!1;if(J.prerelease.length&&!X.includePrerelease){for(let W=0;W<Z.length;W++){if(l(Z[W].semver),Z[W].semver===m5.ANY)continue;if(Z[W].semver.prerelease.length>0){let q=Z[W].semver;if(q.major===J.major&&q.minor===J.minor&&q.patch===J.patch)return!0}}return!1}return!0}});var D8=S((UB,I8)=>{var rG=h5(),iG=(Z,J,X)=>{try{J=new rG(J,X)}catch(W){return!1}return J.test(Z)};I8.exports=iG});var f5=S((KB,aG)=>{aG.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{build:"node install/build.js",install:"node install/check.js || npm run build",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.2",semver:"^7.7.3"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.5","@img/sharp-darwin-x64":"0.34.5","@img/sharp-libvips-darwin-arm64":"1.2.4","@img/sharp-libvips-darwin-x64":"1.2.4","@img/sharp-libvips-linux-arm":"1.2.4","@img/sharp-libvips-linux-arm64":"1.2.4","@img/sharp-libvips-linux-ppc64":"1.2.4","@img/sharp-libvips-linux-riscv64":"1.2.4","@img/sharp-libvips-linux-s390x":"1.2.4","@img/sharp-libvips-linux-x64":"1.2.4","@img/sharp-libvips-linuxmusl-arm64":"1.2.4","@img/sharp-libvips-linuxmusl-x64":"1.2.4","@img/sharp-linux-arm":"0.34.5","@img/sharp-linux-arm64":"0.34.5","@img/sharp-linux-ppc64":"0.34.5","@img/sharp-linux-riscv64":"0.34.5","@img/sharp-linux-s390x":"0.34.5","@img/sharp-linux-x64":"0.34.5","@img/sharp-linuxmusl-arm64":"0.34.5","@img/sharp-linuxmusl-x64":"0.34.5","@img/sharp-wasm32":"0.34.5","@img/sharp-win32-arm64":"0.34.5","@img/sharp-win32-ia32":"0.34.5","@img/sharp-win32-x64":"0.34.5"},devDependencies:{"@biomejs/biome":"^2.3.4","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.7.0","@img/sharp-libvips-dev":"1.2.4","@img/sharp-libvips-dev-wasm32":"1.2.4","@img/sharp-libvips-win32-arm64":"1.2.4","@img/sharp-libvips-win32-ia32":"1.2.4","@img/sharp-libvips-win32-x64":"1.2.4","@types/node":"*",emnapi:"^1.7.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.3","node-addon-api":"^8.5.0","node-gyp":"^11.5.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.3"},funding:{url:"https://opencollective.com/libvips"}}});var d5=S((VB,O8)=>{/*!
203
+ */G={defined:f7,object:mz,plainObject:fz,fn:uz,bool:dz,buffer:cz,typedArray:lz,arrayBuffer:pz,string:nz,number:iz,integer:rz,inRange:az,inArray:sz,invalidParameterError:oz,nativeError:tz}});var c7=E((PA,d7)=>{var u7=()=>process.platform==="linux",A1=null,ez=()=>{if(!A1)if(u7()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,A1=process.report.getReport(),process.report.excludeNetwork=Z}else A1={};return A1};d7.exports={isLinux:u7,getReport:ez}});var p7=E((jA,l7)=>{var t6=q0("fs"),ZG=(Z)=>{let X=t6.openSync(Z,"r"),q=Buffer.alloc(2048),W=t6.readSync(X,q,0,2048,0);return t6.close(X,()=>{}),q.subarray(0,W)},XG=(Z)=>new Promise((X,q)=>{t6.open(Z,"r",(W,Q)=>{if(W)q(W);else{let J=Buffer.alloc(2048);t6.read(Q,J,0,2048,0,(z,Y)=>{X(J.subarray(0,Y)),t6.close(Q,()=>{})})}})});l7.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:ZG,readFile:XG}});var i7=E((EA,n7)=>{var qG=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let X=Z.readUInt32LE(32),q=Z.readUInt16LE(54),W=Z.readUInt16LE(56);for(let Q=0;Q<W;Q++){let J=X+Q*q;if(Z.readUInt32LE(J)===3){let Y=Z.readUInt32LE(J+8),U=Z.readUInt32LE(J+32);return Z.subarray(Y,Y+U).toString().replace(/\0.*$/g,"")}}return null};n7.exports={interpreterPath:qG}});var L1=E((CA,KZ)=>{var a7=q0("child_process"),{isLinux:e6,getReport:s7}=c7(),{LDD_PATH:M1,SELF_PATH:o7,readFile:o5,readFileSync:t5}=p7(),{interpreterPath:t7}=i7(),f0,u0,d0,B6="",e7=()=>{if(!B6)return new Promise((Z)=>{a7.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,q)=>{B6=X?" ":q,Z(B6)})});return B6},ZZ=()=>{if(!B6)try{B6=a7.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){B6=" "}return B6},X6="glibc",XZ=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,C6="musl",WG=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),qZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return X6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(WG))return C6}return null},WZ=(Z)=>{let[X,q]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return X6;if(q&&q.includes(C6))return C6;return null},QZ=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return C6;else if(Z.includes("/ld-linux-"))return X6}return null},JZ=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return C6;if(Z.includes("GNU C Library"))return X6;return null},QG=async()=>{if(u0!==void 0)return u0;u0=null;try{let Z=await o5(M1);u0=JZ(Z)}catch(Z){}return u0},JG=()=>{if(u0!==void 0)return u0;u0=null;try{let Z=t5(M1);u0=JZ(Z)}catch(Z){}return u0},zG=async()=>{if(f0!==void 0)return f0;f0=null;try{let Z=await o5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},GG=()=>{if(f0!==void 0)return f0;f0=null;try{let Z=t5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},zZ=async()=>{let Z=null;if(e6()){if(Z=await zG(),!Z){if(Z=await QG(),!Z)Z=qZ();if(!Z){let X=await e7();Z=WZ(X)}}}return Z},GZ=()=>{let Z=null;if(e6()){if(Z=GG(),!Z){if(Z=JG(),!Z)Z=qZ();if(!Z){let X=ZZ();Z=WZ(X)}}}return Z},YG=async()=>e6()&&await zZ()!==X6,UG=()=>e6()&&GZ()!==X6,KG=async()=>{if(d0!==void 0)return d0;d0=null;try{let X=(await o5(M1)).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},VG=()=>{if(d0!==void 0)return d0;d0=null;try{let X=t5(M1).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},YZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},r7=(Z)=>Z.trim().split(/\s+/)[1],UZ=(Z)=>{let[X,q,W]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return r7(X);if(q&&W&&q.includes(C6))return r7(W);return null},BG=async()=>{let Z=null;if(e6()){if(Z=await KG(),!Z)Z=YZ();if(!Z){let X=await e7();Z=UZ(X)}}return Z},HG=()=>{let Z=null;if(e6()){if(Z=VG(),!Z)Z=YZ();if(!Z){let X=ZZ();Z=UZ(X)}}return Z};KZ.exports={GLIBC:X6,MUSL:C6,family:zZ,familySync:GZ,isNonGlibcLinux:YG,isNonGlibcLinuxSync:UG,version:BG,versionSync:HG}});var Z4=E((OA,VZ)=>{var $G=Number.MAX_SAFE_INTEGER||9007199254740991,FG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];VZ.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$G,RELEASE_TYPES:FG,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P4=E((xA,BZ)=>{var AG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};BZ.exports=AG});var X4=E((c0,HZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:e5,MAX_SAFE_BUILD_LENGTH:MG,MAX_LENGTH:LG}=Z4(),IG=P4();c0=HZ.exports={};var wG=c0.re=[],DG=c0.safeRe=[],D=c0.src=[],NG=c0.safeSrc=[],N=c0.t={},TG=0,Z3="[a-zA-Z0-9-]",RG=[["\\s",1],["\\d",LG],[Z3,MG]],_G=(Z)=>{for(let[X,q]of RG)Z=Z.split(`${X}*`).join(`${X}{0,${q}}`).split(`${X}+`).join(`${X}{1,${q}}`);return Z},O=(Z,X,q)=>{let W=_G(X),Q=TG++;IG(Z,Q,X),N[Z]=Q,D[Q]=X,NG[Q]=W,wG[Q]=new RegExp(X,q?"g":void 0),DG[Q]=new RegExp(W,q?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*");O("NUMERICIDENTIFIERLOOSE","\\d+");O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Z3}*`);O("MAINVERSION",`(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})`);O("MAINVERSIONLOOSE",`(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASEIDENTIFIER",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIER]})`);O("PRERELEASEIDENTIFIERLOOSE",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASE",`(?:-(${D[N.PRERELEASEIDENTIFIER]}(?:\\.${D[N.PRERELEASEIDENTIFIER]})*))`);O("PRERELEASELOOSE",`(?:-?(${D[N.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[N.PRERELEASEIDENTIFIERLOOSE]})*))`);O("BUILDIDENTIFIER",`${Z3}+`);O("BUILD",`(?:\\+(${D[N.BUILDIDENTIFIER]}(?:\\.${D[N.BUILDIDENTIFIER]})*))`);O("FULLPLAIN",`v?${D[N.MAINVERSION]}${D[N.PRERELEASE]}?${D[N.BUILD]}?`);O("FULL",`^${D[N.FULLPLAIN]}$`);O("LOOSEPLAIN",`[v=\\s]*${D[N.MAINVERSIONLOOSE]}${D[N.PRERELEASELOOSE]}?${D[N.BUILD]}?`);O("LOOSE",`^${D[N.LOOSEPLAIN]}$`);O("GTLT","((?:<|>)?=?)");O("XRANGEIDENTIFIERLOOSE",`${D[N.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);O("XRANGEIDENTIFIER",`${D[N.NUMERICIDENTIFIER]}|x|X|\\*`);O("XRANGEPLAIN",`[v=\\s]*(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:${D[N.PRERELEASE]})?${D[N.BUILD]}?)?)?`);O("XRANGEPLAINLOOSE",`[v=\\s]*(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:${D[N.PRERELEASELOOSE]})?${D[N.BUILD]}?)?)?`);O("XRANGE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAIN]}$`);O("XRANGELOOSE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAINLOOSE]}$`);O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e5}})(?:\\.(\\d{1,${e5}}))?(?:\\.(\\d{1,${e5}}))?`);O("COERCE",`${D[N.COERCEPLAIN]}(?:$|[^\\d])`);O("COERCEFULL",D[N.COERCEPLAIN]+`(?:${D[N.PRERELEASE]})?(?:${D[N.BUILD]})?(?:$|[^\\d])`);O("COERCERTL",D[N.COERCE],!0);O("COERCERTLFULL",D[N.COERCEFULL],!0);O("LONETILDE","(?:~>?)");O("TILDETRIM",`(\\s*)${D[N.LONETILDE]}\\s+`,!0);c0.tildeTrimReplace="$1~";O("TILDE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAIN]}$`);O("TILDELOOSE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAINLOOSE]}$`);O("LONECARET","(?:\\^)");O("CARETTRIM",`(\\s*)${D[N.LONECARET]}\\s+`,!0);c0.caretTrimReplace="$1^";O("CARET",`^${D[N.LONECARET]}${D[N.XRANGEPLAIN]}$`);O("CARETLOOSE",`^${D[N.LONECARET]}${D[N.XRANGEPLAINLOOSE]}$`);O("COMPARATORLOOSE",`^${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]})$|^$`);O("COMPARATOR",`^${D[N.GTLT]}\\s*(${D[N.FULLPLAIN]})$|^$`);O("COMPARATORTRIM",`(\\s*)${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]}|${D[N.XRANGEPLAIN]})`,!0);c0.comparatorTrimReplace="$1$2$3";O("HYPHENRANGE",`^\\s*(${D[N.XRANGEPLAIN]})\\s+-\\s+(${D[N.XRANGEPLAIN]})\\s*$`);O("HYPHENRANGELOOSE",`^\\s*(${D[N.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[N.XRANGEPLAINLOOSE]})\\s*$`);O("STAR","(<|>)?=?\\s*\\*");O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var I1=E((kA,$Z)=>{var PG=Object.freeze({loose:!0}),jG=Object.freeze({}),EG=(Z)=>{if(!Z)return jG;if(typeof Z!=="object")return PG;return Z};$Z.exports=EG});var X3=E((SA,MZ)=>{var FZ=/^[0-9]+$/,AZ=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let q=FZ.test(Z),W=FZ.test(X);if(q&&W)Z=+Z,X=+X;return Z===X?0:q&&!W?-1:W&&!q?1:Z<X?-1:1},CG=(Z,X)=>AZ(X,Z);MZ.exports={compareIdentifiers:AZ,rcompareIdentifiers:CG}});var Q0=E((bA,IZ)=>{var w1=P4(),{MAX_LENGTH:LZ,MAX_SAFE_INTEGER:D1}=Z4(),{safeRe:N1,t:T1}=X4(),OG=I1(),{compareIdentifiers:q3}=X3(),xG=(Z,X)=>{let q=X.split(".");if(q.length>Z.length)return!1;for(let W=0;W<q.length;W++)if(q3(Z[W],q[W])!==0)return!1;return!0};class k0{constructor(Z,X){if(X=OG(X),Z instanceof k0)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>LZ)throw TypeError(`version is longer than ${LZ} characters`);w1("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let q=Z.trim().match(X.loose?N1[T1.LOOSE]:N1[T1.FULL]);if(!q)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+q[1],this.minor=+q[2],this.patch=+q[3],this.major>D1||this.major<0)throw TypeError("Invalid major version");if(this.minor>D1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>D1||this.patch<0)throw TypeError("Invalid patch version");if(!q[4])this.prerelease=[];else this.prerelease=q[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){let Q=+W;if(Q>=0&&Q<D1)return Q}return W});this.build=q[5]?q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(w1("SemVer.compare",this.version,this.options,Z),!(Z instanceof k0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new k0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let X=0;do{let q=this.prerelease[X],W=Z.prerelease[X];if(w1("prerelease compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}compareBuild(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);let X=0;do{let q=this.build[X],W=Z.build[X];if(w1("build compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}inc(Z,X,q){if(Z.startsWith("pre")){if(!X&&q===!1)throw Error("invalid increment argument: identifier is empty");if(X){let W=`-${X}`.match(this.options.loose?N1[T1.PRERELEASELOOSE]:N1[T1.PRERELEASE]);if(!W||W[1]!==X)throw Error(`invalid identifier: ${X}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",X,q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",X,q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",X,q),this.inc("pre",X,q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",X,q);this.inc("pre",X,q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let W=Number(q)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(X===this.prerelease.join(".")&&q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(X){let Q=[X,W];if(q===!1)Q=[X];if(xG(this.prerelease,X)){let J=this.prerelease[X.split(".").length];if(isNaN(J))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}IZ.exports=k0});var H6=E((vA,DZ)=>{var wZ=Q0(),kG=(Z,X,q=!1)=>{if(Z instanceof wZ)return Z;try{return new wZ(Z,X)}catch(W){if(!q)return null;throw W}};DZ.exports=kG});var TZ=E((yA,NZ)=>{var SG=H6(),bG=(Z,X)=>{let q=SG(Z,X);return q?q.version:null};NZ.exports=bG});var _Z=E((gA,RZ)=>{var vG=H6(),yG=(Z,X)=>{let q=vG(Z.trim().replace(/^[=v]+/,""),X);return q?q.version:null};RZ.exports=yG});var EZ=E((hA,jZ)=>{var PZ=Q0(),gG=(Z,X,q,W,Q)=>{if(typeof q==="string")Q=W,W=q,q=void 0;try{return new PZ(Z instanceof PZ?Z.version:Z,q).inc(X,W,Q).version}catch(J){return null}};jZ.exports=gG});var xZ=E((mA,OZ)=>{var CZ=H6(),hG=(Z,X)=>{let q=CZ(Z,null,!0),W=CZ(X,null,!0),Q=q.compare(W);if(Q===0)return null;let J=Q>0,z=J?q:W,Y=J?W:q,U=!!z.prerelease.length;if(!!Y.prerelease.length&&!U){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(z)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let V=U?"pre":"";if(q.major!==W.major)return V+"major";if(q.minor!==W.minor)return V+"minor";if(q.patch!==W.patch)return V+"patch";return"prerelease"};OZ.exports=hG});var SZ=E((fA,kZ)=>{var mG=Q0(),fG=(Z,X)=>new mG(Z,X).major;kZ.exports=fG});var vZ=E((uA,bZ)=>{var uG=Q0(),dG=(Z,X)=>new uG(Z,X).minor;bZ.exports=dG});var gZ=E((dA,yZ)=>{var cG=Q0(),lG=(Z,X)=>new cG(Z,X).patch;yZ.exports=lG});var mZ=E((cA,hZ)=>{var pG=H6(),nG=(Z,X)=>{let q=pG(Z,X);return q&&q.prerelease.length?q.prerelease:null};hZ.exports=nG});var j0=E((lA,uZ)=>{var fZ=Q0(),iG=(Z,X,q)=>new fZ(Z,q).compare(new fZ(X,q));uZ.exports=iG});var cZ=E((pA,dZ)=>{var rG=j0(),aG=(Z,X,q)=>rG(X,Z,q);dZ.exports=aG});var pZ=E((nA,lZ)=>{var sG=j0(),oG=(Z,X)=>sG(Z,X,!0);lZ.exports=oG});var R1=E((iA,iZ)=>{var nZ=Q0(),tG=(Z,X,q)=>{let W=new nZ(Z,q),Q=new nZ(X,q);return W.compare(Q)||W.compareBuild(Q)};iZ.exports=tG});var aZ=E((rA,rZ)=>{var eG=R1(),ZY=(Z,X)=>Z.sort((q,W)=>eG(q,W,X));rZ.exports=ZY});var oZ=E((aA,sZ)=>{var XY=R1(),qY=(Z,X)=>Z.sort((q,W)=>XY(W,q,X));sZ.exports=qY});var j4=E((sA,tZ)=>{var WY=j0(),QY=(Z,X,q)=>WY(Z,X,q)>0;tZ.exports=QY});var _1=E((oA,eZ)=>{var JY=j0(),zY=(Z,X,q)=>JY(Z,X,q)<0;eZ.exports=zY});var W3=E((tA,Z2)=>{var GY=j0(),YY=(Z,X,q)=>GY(Z,X,q)===0;Z2.exports=YY});var Q3=E((eA,X2)=>{var UY=j0(),KY=(Z,X,q)=>UY(Z,X,q)!==0;X2.exports=KY});var P1=E((ZM,q2)=>{var VY=j0(),BY=(Z,X,q)=>VY(Z,X,q)>=0;q2.exports=BY});var j1=E((XM,W2)=>{var HY=j0(),$Y=(Z,X,q)=>HY(Z,X,q)<=0;W2.exports=$Y});var J3=E((qM,Q2)=>{var FY=W3(),AY=Q3(),MY=j4(),LY=P1(),IY=_1(),wY=j1(),DY=(Z,X,q,W)=>{switch(X){case"===":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z===q;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z!==q;case"":case"=":case"==":return FY(Z,q,W);case"!=":return AY(Z,q,W);case">":return MY(Z,q,W);case">=":return LY(Z,q,W);case"<":return IY(Z,q,W);case"<=":return wY(Z,q,W);default:throw TypeError(`Invalid operator: ${X}`)}};Q2.exports=DY});var z2=E((WM,J2)=>{var NY=Q0(),TY=H6(),{safeRe:E1,t:C1}=X4(),RY=(Z,X)=>{if(Z instanceof NY)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;X=X||{};let q=null;if(!X.rtl)q=Z.match(X.includePrerelease?E1[C1.COERCEFULL]:E1[C1.COERCE]);else{let U=X.includePrerelease?E1[C1.COERCERTLFULL]:E1[C1.COERCERTL],K;while((K=U.exec(Z))&&(!q||q.index+q[0].length!==Z.length)){if(!q||K.index+K[0].length!==q.index+q[0].length)q=K;U.lastIndex=K.index+K[1].length+K[2].length}U.lastIndex=-1}if(q===null)return null;let W=q[2],Q=q[3]||"0",J=q[4]||"0",z=X.includePrerelease&&q[5]?`-${q[5]}`:"",Y=X.includePrerelease&&q[6]?`+${q[6]}`:"";return TY(`${W}.${Q}.${J}${z}${Y}`,X)};J2.exports=RY});var Y2=E((QM,G2)=>{var _Y=H6(),PY=Z4(),jY=Q0(),EY=(Z,X,q)=>{if(!PY.RELEASE_TYPES.includes(X))return null;let W=CY(Z,q);return W&&OY(W,X)},CY=(Z,X)=>{let q=Z instanceof jY?Z.version:Z;return _Y(q,X)},OY=(Z,X)=>{if(xY(X))return Z.version;switch(Z.prerelease=[],X){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},xY=(Z)=>{return Z.startsWith("pre")};G2.exports=EY});var V2=E((JM,K2)=>{class U2{constructor(){this.max=1000,this.map=new Map}get(Z){let X=this.map.get(Z);if(X===void 0)return;else return this.map.delete(Z),this.map.set(Z,X),X}delete(Z){return this.map.delete(Z)}set(Z,X){if(!this.delete(Z)&&X!==void 0){if(this.map.size>=this.max){let W=this.map.keys().next().value;this.delete(W)}this.map.set(Z,X)}return this}}K2.exports=U2});var E0=E((zM,F2)=>{var kY=/\s+/g;class E4{constructor(Z,X){if(X=bY(X),Z instanceof E4)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new E4(Z.raw,X);if(Z instanceof z3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=Z.trim().replace(kY," "),this.set=this.raw.split("||").map((q)=>this.parseRange(q.trim())).filter((q)=>q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let q=this.set[0];if(this.set=this.set.filter((W)=>!H2(W[0])),this.set.length===0)this.set=[q];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&cY(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let X=this.set[Z];for(let q=0;q<X.length;q++){if(q>0)this.formatted+=" ";this.formatted+=X[q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(dY,"");let q=((this.options.includePrerelease&&fY)|(this.options.loose&&uY))+":"+Z,W=B2.get(q);if(W)return W;let Q=this.options.loose,J=Q?V0[J0.HYPHENRANGELOOSE]:V0[J0.HYPHENRANGE];Z=Z.replace(J,ZU(this.options.includePrerelease)),m("hyphen replace",Z),Z=Z.replace(V0[J0.COMPARATORTRIM],gY),m("comparator trim",Z),Z=Z.replace(V0[J0.TILDETRIM],hY),m("tilde trim",Z),Z=Z.replace(V0[J0.CARETTRIM],mY),m("caret trim",Z);let z=Z.split(" ").map((V)=>lY(V,this.options)).join(" ").split(/\s+/).map((V)=>eY(V,this.options));if(Q)z=z.filter((V)=>{return m("loose invalid filter",V,this.options),!!V.match(V0[J0.COMPARATORLOOSE])});m("range list",z);let Y=new Map,U=z.map((V)=>new z3(V,this.options));for(let V of U){if(H2(V))return[V];Y.set(V.value,V)}if(Y.size>1&&Y.has(""))Y.delete("");let K=[...Y.values()];return B2.set(q,K),K}intersects(Z,X){if(!(Z instanceof E4))throw TypeError("a Range is required");return this.set.some((q)=>{return $2(q,X)&&Z.set.some((W)=>{return $2(W,X)&&q.every((Q)=>{return W.every((J)=>{return Q.intersects(J,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new vY(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(XU(this.set[X],Z,this.options))return!0;return!1}}F2.exports=E4;var SY=V2(),B2=new SY,bY=I1(),z3=C4(),m=P4(),vY=Q0(),{safeRe:V0,src:yY,t:J0,comparatorTrimReplace:gY,tildeTrimReplace:hY,caretTrimReplace:mY}=X4(),{FLAG_INCLUDE_PRERELEASE:fY,FLAG_LOOSE:uY}=Z4(),dY=new RegExp(yY[J0.BUILD],"g"),H2=(Z)=>Z.value==="<0.0.0-0",cY=(Z)=>Z.value==="",$2=(Z,X)=>{let q=!0,W=Z.slice(),Q=W.pop();while(q&&W.length)q=W.every((J)=>{return Q.intersects(J,X)}),Q=W.pop();return q},lY=(Z,X)=>{return Z=Z.replace(V0[J0.BUILD],""),m("comp",Z,X),Z=rY(Z,X),m("caret",Z),Z=nY(Z,X),m("tildes",Z),Z=sY(Z,X),m("xrange",Z),Z=tY(Z,X),m("stars",Z),Z},s=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",pY=(Z,X,q)=>s(Z)&&!s(X)||s(X)&&q&&!s(q),nY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>iY(q,X)).join(" ")},iY=(Z,X)=>{let q=X.loose?V0[J0.TILDELOOSE]:V0[J0.TILDE];return Z.replace(q,(W,Q,J,z,Y)=>{m("tilde",Z,W,Q,J,z,Y);let U;if(s(Q))U="";else if(s(J))U=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(s(z))U=`>=${Q}.${J}.0 <${Q}.${+J+1}.0-0`;else if(Y)m("replaceTilde pr",Y),U=`>=${Q}.${J}.${z}-${Y} <${Q}.${+J+1}.0-0`;else U=`>=${Q}.${J}.${z} <${Q}.${+J+1}.0-0`;return m("tilde return",U),U})},rY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>aY(q,X)).join(" ")},aY=(Z,X)=>{m("caret",Z,X);let q=X.loose?V0[J0.CARETLOOSE]:V0[J0.CARET],W=X.includePrerelease?"-0":"";return Z.replace(q,(Q,J,z,Y,U)=>{m("caret",Z,Q,J,z,Y,U);let K;if(s(J))K="";else if(s(z))K=`>=${J}.0.0${W} <${+J+1}.0.0-0`;else if(s(Y))if(J==="0")K=`>=${J}.${z}.0${W} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.0${W} <${+J+1}.0.0-0`;else if(U)if(m("replaceCaret pr",U),J==="0")if(z==="0")K=`>=${J}.${z}.${Y}-${U} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y}-${U} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y}-${U} <${+J+1}.0.0-0`;else if(m("no pr"),J==="0")if(z==="0")K=`>=${J}.${z}.${Y} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y} <${+J+1}.0.0-0`;return m("caret return",K),K})},sY=(Z,X)=>{return m("replaceXRanges",Z,X),Z.split(/\s+/).map((q)=>oY(q,X)).join(" ")},oY=(Z,X)=>{Z=Z.trim();let q=X.loose?V0[J0.XRANGELOOSE]:V0[J0.XRANGE];return Z.replace(q,(W,Q,J,z,Y,U)=>{if(m("xRange",Z,W,Q,J,z,Y,U),pY(J,z,Y))return Z;let K=s(J),V=K||s(z),B=V||s(Y),H=B;if(Q==="="&&H)Q="";if(U=X.includePrerelease?"-0":"",K)if(Q===">"||Q==="<")W="<0.0.0-0";else W="*";else if(Q&&H){if(V)z=0;if(Y=0,Q===">")if(Q=">=",V)J=+J+1,z=0,Y=0;else z=+z+1,Y=0;else if(Q==="<=")if(Q="<",V)J=+J+1;else z=+z+1;if(Q==="<")U="-0";W=`${Q+J}.${z}.${Y}${U}`}else if(V)W=`>=${J}.0.0${U} <${+J+1}.0.0-0`;else if(B)W=`>=${J}.${z}.0${U} <${J}.${+z+1}.0-0`;return m("xRange return",W),W})},tY=(Z,X)=>{return m("replaceStars",Z,X),Z.trim().replace(V0[J0.STAR],"")},eY=(Z,X)=>{return m("replaceGTE0",Z,X),Z.trim().replace(V0[X.includePrerelease?J0.GTE0PRE:J0.GTE0],"")},ZU=(Z)=>(X,q,W,Q,J,z,Y,U,K,V,B,H)=>{if(s(W))q="";else if(s(Q))q=`>=${W}.0.0${Z?"-0":""}`;else if(s(J))q=`>=${W}.${Q}.0${Z?"-0":""}`;else if(z)q=`>=${q}`;else q=`>=${q}${Z?"-0":""}`;if(s(K))U="";else if(s(V))U=`<${+K+1}.0.0-0`;else if(s(B))U=`<${K}.${+V+1}.0-0`;else if(H)U=`<=${K}.${V}.${B}-${H}`;else if(Z)U=`<${K}.${V}.${+B+1}-0`;else U=`<=${U}`;return`${q} ${U}`.trim()},XU=(Z,X,q)=>{for(let W=0;W<Z.length;W++)if(!Z[W].test(X))return!1;if(X.prerelease.length&&!q.includePrerelease){for(let W=0;W<Z.length;W++){if(m(Z[W].semver),Z[W].semver===z3.ANY)continue;if(Z[W].semver.prerelease.length>0){let Q=Z[W].semver;if(Q.major===X.major&&Q.minor===X.minor&&Q.patch===X.patch)return!0}}return!1}return!0}});var C4=E((GM,D2)=>{var O4=Symbol("SemVer ANY");class O1{static get ANY(){return O4}constructor(Z,X){if(X=A2(X),Z instanceof O1)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),Y3("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===O4)this.value="";else this.value=this.operator+this.semver.version;Y3("comp",this)}parse(Z){let X=this.options.loose?M2[L2.COMPARATORLOOSE]:M2[L2.COMPARATOR],q=Z.match(X);if(!q)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=q[1]!==void 0?q[1]:"",this.operator==="=")this.operator="";if(!q[2])this.semver=O4;else this.semver=new I2(q[2],this.options.loose)}toString(){return this.value}test(Z){if(Y3("Comparator.test",Z,this.options.loose),this.semver===O4||Z===O4)return!0;if(typeof Z==="string")try{Z=new I2(Z,this.options)}catch(X){return!1}return G3(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof O1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new w2(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new w2(this.value,X).test(Z.semver)}if(X=A2(X),X.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!X.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(G3(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(G3(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}D2.exports=O1;var A2=I1(),{safeRe:M2,t:L2}=X4(),G3=J3(),Y3=P4(),I2=Q0(),w2=E0()});var x4=E((YM,N2)=>{var qU=E0(),WU=(Z,X,q)=>{try{X=new qU(X,q)}catch(W){return!1}return X.test(Z)};N2.exports=WU});var R2=E((UM,T2)=>{var QU=E0(),JU=(Z,X)=>new QU(Z,X).set.map((q)=>q.map((W)=>W.value).join(" ").trim().split(" "));T2.exports=JU});var P2=E((KM,_2)=>{var zU=Q0(),GU=E0(),YU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new GU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===-1)W=z,Q=new zU(W,q)}}),W};_2.exports=YU});var E2=E((VM,j2)=>{var UU=Q0(),KU=E0(),VU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new KU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===1)W=z,Q=new UU(W,q)}}),W};j2.exports=VU});var x2=E((BM,O2)=>{var U3=Q0(),BU=E0(),C2=j4(),HU=(Z,X)=>{Z=new BU(Z,X);let q=new U3("0.0.0");if(Z.test(q))return q;if(q=new U3("0.0.0-0"),Z.test(q))return q;q=null;for(let W=0;W<Z.set.length;++W){let Q=Z.set[W],J=null;if(Q.forEach((z)=>{let Y=new U3(z.semver.version);switch(z.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!J||C2(Y,J))J=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),J&&(!q||C2(q,J)))q=J}if(q&&Z.test(q))return q;return null};O2.exports=HU});var S2=E((HM,k2)=>{var $U=E0(),FU=(Z,X)=>{try{return new $U(Z,X).range||"*"}catch(q){return null}};k2.exports=FU});var x1=E(($M,g2)=>{var AU=Q0(),y2=C4(),{ANY:MU}=y2,LU=E0(),IU=x4(),b2=j4(),v2=_1(),wU=j1(),DU=P1(),NU=(Z,X,q,W)=>{Z=new AU(Z,W),X=new LU(X,W);let Q,J,z,Y,U;switch(q){case">":Q=b2,J=wU,z=v2,Y=">",U=">=";break;case"<":Q=v2,J=DU,z=b2,Y="<",U="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(IU(Z,X,W))return!1;for(let K=0;K<X.set.length;++K){let V=X.set[K],B=null,H=null;if(V.forEach(($)=>{if($.semver===MU)$=new y2(">=0.0.0");if(B=B||$,H=H||$,Q($.semver,B.semver,W))B=$;else if(z($.semver,H.semver,W))H=$}),B.operator===Y||B.operator===U)return!1;if((!H.operator||H.operator===Y)&&J(Z,H.semver))return!1;else if(H.operator===U&&z(Z,H.semver))return!1}return!0};g2.exports=NU});var m2=E((FM,h2)=>{var TU=x1(),RU=(Z,X,q)=>TU(Z,X,">",q);h2.exports=RU});var u2=E((AM,f2)=>{var _U=x1(),PU=(Z,X,q)=>_U(Z,X,"<",q);f2.exports=PU});var l2=E((MM,c2)=>{var d2=E0(),jU=(Z,X,q)=>{return Z=new d2(Z,q),X=new d2(X,q),Z.intersects(X,q)};c2.exports=jU});var n2=E((LM,p2)=>{var EU=x4(),CU=j0();p2.exports=(Z,X,q)=>{let W=[],Q=null,J=null,z=Z.sort((V,B)=>CU(V,B,q));for(let V of z)if(EU(V,X,q)){if(J=V,!Q)Q=V}else{if(J)W.push([Q,J]);J=null,Q=null}if(Q)W.push([Q,null]);let Y=[];for(let[V,B]of W)if(V===B)Y.push(V);else if(!B&&V===z[0])Y.push("*");else if(!B)Y.push(`>=${V}`);else if(V===z[0])Y.push(`<=${B}`);else Y.push(`${V} - ${B}`);let U=Y.join(" || "),K=typeof X.raw==="string"?X.raw:String(X);return U.length<K.length?U:X}});var t2=E((IM,o2)=>{var i2=E0(),B3=C4(),{ANY:K3}=B3,V3=x4(),H3=j0(),OU=(Z,X,q={})=>{if(Z===X)return!0;Z=new i2(Z,q),X=new i2(X,q);let W=!1;Z:for(let Q of Z.set){for(let J of X.set){let z=kU(Q,J,q);if(W=W||z!==null,z)continue Z}if(W)return!1}return!0},xU=[new B3(">=0.0.0-0")],r2=[new B3(">=0.0.0")],kU=(Z,X,q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===K3)if(X.length===1&&X[0].semver===K3)return!0;else if(q.includePrerelease)Z=xU;else Z=r2;if(X.length===1&&X[0].semver===K3)if(q.includePrerelease)return!0;else X=r2;let W=new Set,Q,J;for(let $ of Z)if($.operator===">"||$.operator===">=")Q=a2(Q,$,q);else if($.operator==="<"||$.operator==="<=")J=s2(J,$,q);else W.add($.semver);if(W.size>1)return null;let z;if(Q&&J){if(z=H3(Q.semver,J.semver,q),z>0)return null;else if(z===0&&(Q.operator!==">="||J.operator!=="<="))return null}for(let $ of W){if(Q&&!V3($,String(Q),q))return null;if(J&&!V3($,String(J),q))return null;for(let F of X)if(!V3($,String(F),q))return!1;return!0}let Y,U,K,V,B=J&&!q.includePrerelease&&J.semver.prerelease.length?J.semver:!1,H=Q&&!q.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(B&&B.prerelease.length===1&&J.operator==="<"&&B.prerelease[0]===0)B=!1;for(let $ of X){if(V=V||$.operator===">"||$.operator===">=",K=K||$.operator==="<"||$.operator==="<=",Q){if(H){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===H.major&&$.semver.minor===H.minor&&$.semver.patch===H.patch)H=!1}if($.operator===">"||$.operator===">="){if(Y=a2(Q,$,q),Y===$&&Y!==Q)return!1}else if(Q.operator===">="&&!$.test(Q.semver))return!1}if(J){if(B){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===B.major&&$.semver.minor===B.minor&&$.semver.patch===B.patch)B=!1}if($.operator==="<"||$.operator==="<="){if(U=s2(J,$,q),U===$&&U!==J)return!1}else if(J.operator==="<="&&!$.test(J.semver))return!1}if(!$.operator&&(J||Q)&&z!==0)return!1}if(Q&&K&&!J&&z!==0)return!1;if(J&&V&&!Q&&z!==0)return!1;if(H||B)return!1;return!0},a2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W>0?Z:W<0?X:X.operator===">"&&Z.operator===">="?X:Z},s2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W<0?Z:W>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};o2.exports=OU});var qX=E((wM,XX)=>{var $3=X4(),e2=Z4(),SU=Q0(),ZX=X3(),bU=H6(),vU=TZ(),yU=_Z(),gU=EZ(),hU=xZ(),mU=SZ(),fU=vZ(),uU=gZ(),dU=mZ(),cU=j0(),lU=cZ(),pU=pZ(),nU=R1(),iU=aZ(),rU=oZ(),aU=j4(),sU=_1(),oU=W3(),tU=Q3(),eU=P1(),ZK=j1(),XK=J3(),qK=z2(),WK=Y2(),QK=C4(),JK=E0(),zK=x4(),GK=R2(),YK=P2(),UK=E2(),KK=x2(),VK=S2(),BK=x1(),HK=m2(),$K=u2(),FK=l2(),AK=n2(),MK=t2();XX.exports={parse:bU,valid:vU,clean:yU,inc:gU,diff:hU,major:mU,minor:fU,patch:uU,prerelease:dU,compare:cU,rcompare:lU,compareLoose:pU,compareBuild:nU,sort:iU,rsort:rU,gt:aU,lt:sU,eq:oU,neq:tU,gte:eU,lte:ZK,cmp:XK,coerce:qK,truncate:WK,Comparator:QK,Range:JK,satisfies:zK,toComparators:GK,maxSatisfying:YK,minSatisfying:UK,minVersion:KK,validRange:VK,outside:BK,gtr:HK,ltr:$K,intersects:FK,simplifyRange:AK,subset:MK,SemVer:SU,re:$3.re,src:$3.src,tokens:$3.t,SEMVER_SPEC_VERSION:e2.SEMVER_SPEC_VERSION,RELEASE_TYPES:e2.RELEASE_TYPES,compareIdentifiers:ZX.compareIdentifiers,rcompareIdentifiers:ZX.rcompareIdentifiers}});var q6;var k1=R(()=>{q6={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.0",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./lib/index.d.ts",exports:{".":{import:"./dist/index.mjs",require:"./dist/index.cjs"}},repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.0","@img/sharp-darwin-x64":"0.35.0","@img/sharp-freebsd-wasm32":"0.35.0","@img/sharp-libvips-darwin-arm64":"1.3.0","@img/sharp-libvips-darwin-x64":"1.3.0","@img/sharp-libvips-linux-arm":"1.3.0","@img/sharp-libvips-linux-arm64":"1.3.0","@img/sharp-libvips-linux-ppc64":"1.3.0","@img/sharp-libvips-linux-riscv64":"1.3.0","@img/sharp-libvips-linux-s390x":"1.3.0","@img/sharp-libvips-linux-x64":"1.3.0","@img/sharp-libvips-linuxmusl-arm64":"1.3.0","@img/sharp-libvips-linuxmusl-x64":"1.3.0","@img/sharp-linux-arm":"0.35.0","@img/sharp-linux-arm64":"0.35.0","@img/sharp-linux-ppc64":"0.35.0","@img/sharp-linux-riscv64":"0.35.0","@img/sharp-linux-s390x":"0.35.0","@img/sharp-linux-x64":"0.35.0","@img/sharp-linuxmusl-arm64":"0.35.0","@img/sharp-linuxmusl-x64":"0.35.0","@img/sharp-webcontainers-wasm32":"0.35.0","@img/sharp-win32-arm64":"0.35.0","@img/sharp-win32-ia32":"0.35.0","@img/sharp-win32-x64":"0.35.0"},devDependencies:{"@biomejs/biome":"^2.4.16","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.0","@img/sharp-libvips-dev":"1.3.0","@img/sharp-libvips-dev-wasm32":"1.3.0","@img/sharp-libvips-win32-arm64":"1.3.0","@img/sharp-libvips-win32-ia32":"1.3.0","@img/sharp-libvips-win32-x64":"1.3.0","@types/node":"*",emnapi:"^1.11.0","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as k4}from"node:child_process";import{createHash as IK}from"node:crypto";var S4,A3,wK,QX,DK,M3,NK=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},JX=()=>A3.default.isNonGlibcLinuxSync()?A3.default.familySync():"",TK=()=>`${process.platform}${JX()}-${process.arch}`,q4=()=>{if(zX())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:q}=process.env,W=typeof q==="string"?q:JX();return`${X||process.platform}${W}-${Z||process.arch}`},RK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},_K=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},PK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/lib`)}catch{try{return q0(`@img/sharp-libvips-${q4()}/lib`)}catch{}}return""},jK=()=>{if(process.release?.name==="node"&&process.versions){if(!S4.default.satisfies(process.versions.node,q6.engines.node))return{found:process.versions.node,expected:q6.engines.node}}},zX=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},EK=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(k4("sysctl sysctl.proc_translated",M3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},WX=(Z)=>IK("sha512").update(Z).digest("hex"),CK=()=>{try{let Z=WX(`imgsharp-libvips-${q4()}`),X=S4.default.coerce(q6.optionalDependencies[`@img/sharp-libvips-${q4()}`],{includePrerelease:!0}).version;return WX(`${Z}npm:${X}`).slice(0,10)}catch{}return""},OK=()=>k4(`node-gyp rebuild --directory=src ${zX()?"--nodedir=emscripten":""}`,{...M3,stdio:"inherit"}).status,GX=()=>{if(process.platform!=="win32")return(k4("pkg-config --modversion vips-cpp",{...M3,env:{...process.env,PKG_CONFIG_PATH:YX()}}).stdout||"").trim();else return""},xK=()=>{try{let Z=(k4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},kK=()=>{try{let Z=(k4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},YX=()=>{if(process.platform!=="win32")return[xK(),kK(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},F3=(Z,X,q)=>{if(q)q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},SK=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return F3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return F3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(EK())return F3(!1,"Rosetta",Z);let X=GX();return!!X&&S4.default.gte(X,QX)},S1;var L3=R(()=>{k1();S4=B4(qX(),1),A3=B4(L1(),1);/*!
199
204
  Copyright 2013 Lovell Fuller and others.
200
205
  SPDX-License-Identifier: Apache-2.0
201
- */var{spawnSync:B6}=h("node:child_process"),{createHash:sG}=h("node:crypto"),P8=c2(),oG=v5(),tG=D8(),w8=W6(),{config:eG,engines:N8,optionalDependencies:ZY}=f5(),JY=process.env.npm_package_config_libvips||eG.libvips,R8=P8(JY).version,XY=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],$6={encoding:"utf8",shell:!0},WY=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},j8=()=>w8.isNonGlibcLinuxSync()?w8.familySync():"",qY=()=>`${process.platform}${j8()}-${process.arch}`,d4=()=>{if(_8())return"wasm32";let{npm_config_arch:Z,npm_config_platform:J,npm_config_libc:X}=process.env,W=typeof X==="string"?X:j8();return`${J||process.platform}${W}-${Z||process.arch}`},QY=()=>{try{return h(`@img/sharp-libvips-dev-${d4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},GY=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},YY=()=>{try{return h(`@img/sharp-libvips-dev-${d4()}/lib`)}catch{try{return h(`@img/sharp-libvips-${d4()}/lib`)}catch{}}return""},zY=()=>{if(process.release?.name==="node"&&process.versions){if(!tG(process.versions.node,N8.node))return{found:process.versions.node,expected:N8.node}}},_8=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},UY=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(B6("sysctl sysctl.proc_translated",$6).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},T8=(Z)=>sG("sha512").update(Z).digest("hex"),KY=()=>{try{let Z=T8(`imgsharp-libvips-${d4()}`),J=P8(ZY[`@img/sharp-libvips-${d4()}`],{includePrerelease:!0}).version;return T8(`${Z}npm:${J}`).slice(0,10)}catch{}return""},VY=()=>B6(`node-gyp rebuild --directory=src ${_8()?"--nodedir=emscripten":""}`,{...$6,stdio:"inherit"}).status,C8=()=>{if(process.platform!=="win32")return(B6("pkg-config --modversion vips-cpp",{...$6,env:{...process.env,PKG_CONFIG_PATH:E8()}}).stdout||"").trim();else return""},E8=()=>{if(process.platform!=="win32")return[(B6('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',$6).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":");else return""},u5=(Z,J,X)=>{if(X)X(`Detected ${J}, skipping search for globally-installed libvips`);return Z},HY=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return u5(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return u5(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(UY())return u5(!1,"Rosetta",Z);let J=C8();return!!J&&oG(J,R8)};O8.exports={minimumLibvipsVersion:R8,prebuiltPlatforms:XY,buildPlatformArch:d4,buildSharpLibvipsIncludeDir:QY,buildSharpLibvipsCPlusPlusDir:GY,buildSharpLibvipsLibDir:YY,isUnsupportedNodeRuntime:zY,runtimePlatformArch:qY,log:WY,yarnLocator:KY,spawnRebuild:VY,globalLibvipsVersion:C8,pkgConfigPath:E8,useGlobalLibvips:HY}});var w1=S((BB,k8)=>{/*!
206
+ */wK=process.env.npm_package_config_libvips||q6.config.libvips,QX=S4.default.coerce(wK).version,DK=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],M3={encoding:"utf8",shell:!0},S1={minimumLibvipsVersion:QX,prebuiltPlatforms:DK,buildPlatformArch:q4,buildSharpLibvipsIncludeDir:RK,buildSharpLibvipsCPlusPlusDir:_K,buildSharpLibvipsLibDir:PK,isUnsupportedNodeRuntime:jK,runtimePlatformArch:TK,log:NK,yarnLocator:CK,spawnRebuild:OK,globalLibvipsVersion:GX,pkgConfigPath:YX,useGlobalLibvips:SK}});import{createRequire as bK}from"node:module";var b1,o,KX,vK,UX,yK,gK,$6,u,O6,v;var b4=R(()=>{L3();k1();b1=B4(L1(),1);/*!
202
207
  Copyright 2013 Lovell Fuller and others.
203
208
  SPDX-License-Identifier: Apache-2.0
204
- */var{familySync:BY,versionSync:$Y}=W6(),{runtimePlatformArch:FY,isUnsupportedNodeRuntime:x8,prebuiltPlatforms:MY,minimumLibvipsVersion:AY}=d5(),L4=FY(),LY=[`../src/build/Release/sharp-${L4}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${L4}/sharp.node`,"@img/sharp-wasm32/sharp.node"],c5,c4,D1=[];for(c5 of LY)try{c4=h(c5);break}catch(Z){D1.push(Z)}if(c4&&c5.startsWith("@img/sharp-linux-x64")&&!c4._isUsingX64V2()){let Z=Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");Z.code="Unsupported CPU",D1.push(Z),c4=null}if(c4)k8.exports=c4;else{let[Z,J,X]=["linux","darwin","win32"].map((Q)=>L4.startsWith(Q)),W=[`Could not load the "sharp" module using the ${L4} runtime`];D1.forEach((Q)=>{if(Q.code!=="MODULE_NOT_FOUND")W.push(`${Q.code}: ${Q.message}`)});let q=D1.map((Q)=>Q.message).join(" ");if(W.push("Possible solutions:"),x8()){let{found:Q,expected:G}=x8();W.push("- Please upgrade Node.js:",` Found ${Q}`,` Requires ${G}`)}else if(MY.includes(L4)){let[Q,G]=L4.split("-"),z=Q.endsWith("musl")?" --libc=musl":"";W.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${Q.replace("musl","")}${z} --cpu=${G} sharp`)}else W.push(`- Manually install libvips >= ${AY}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(q))try{let{config:Q}=h(`@img/sharp-libvips-${L4}/package`),G=`${BY()} ${$Y()}`,z=`${Q.musl?"musl":"glibc"} ${Q.musl||Q.glibc}`;W.push("- Update your OS:",` Found ${G}`,` Requires ${z}`)}catch(Q){}if(Z&&/\/snap\/core[0-9]{2}/.test(q))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(J&&/Incompatible library version/.test(q))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(D1.some((Q)=>Q.code==="ERR_DLOPEN_DISABLED"))W.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(q))W.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw W.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(W.join(`
205
- `))}});var b8=S((FB,S8)=>{/*!
209
+ */o=bK(import.meta.url),{version:KX}=q6,{runtimePlatformArch:vK,isUnsupportedNodeRuntime:UX,prebuiltPlatforms:yK,minimumLibvipsVersion:gK}=S1,$6=vK(),O6=[];try{u=o(`../src/build/Release/sharp-${$6}-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{u=o(`../src/build/Release/sharp-wasm32-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{switch($6){case"darwin-arm64":u=o("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":u=o("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":u=o("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":u=o("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":u=o("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":u=o("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":u=o("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":u=o("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":u=o("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":u=o("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":u=o("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":u=o("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":u=o("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":u=o("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":u=o("@img/sharp-webcontainers-wasm32/sharp.node");break;default:u=o("@img/sharp-wasm32/sharp.node");break}if(["linux-x64","linuxmusl-x64"].includes($6)&&!u._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",O6.push(Z),u=null}}catch(Z){O6.push(Z)}if(!u){let[Z,X,q]=["linux","darwin","win32"].map((J)=>$6.startsWith(J)),W=[`Could not load the "sharp" module using the ${$6} runtime`];O6.forEach((J)=>{if(!J.code.endsWith("MODULE_NOT_FOUND"))W.push(`${J.code}: ${J.message}`)});let Q=O6.map((J)=>J.message).join(" ");if(W.push("Possible solutions:"),UX()){let{found:J,expected:z}=UX();W.push("- Please upgrade Node.js:",` Found ${J}`,` Requires ${z}`)}else if(yK.includes($6)){let[J,z]=$6.split("-"),Y=J.endsWith("musl")?" --libc=musl":"";W.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${J.replace("musl","")}${Y} --cpu=${z} sharp`)}else W.push(`- Manually install libvips >= ${gK}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(Q))try{let{config:J}=o(`@img/sharp-libvips-${$6}/package`),z=`${b1.familySync()} ${b1.versionSync()}`,Y=`${J.musl?"musl":"glibc"} ${J.musl||J.glibc}`;W.push("- Update your OS:",` Found ${z}`,` Requires ${Y}`)}catch(J){}if(Z&&/\/snap\/core[0-9]{2}/.test(Q))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(X&&/Incompatible library version/.test(Q))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(O6.some((J)=>J.code==="ERR_DLOPEN_DISABLED"))W.push("- Run Node.js without using the --no-addons flag");if(q&&/The specified procedure could not be found/.test(Q))W.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw W.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(W.join(`
210
+ `))}v=u});import hK from"node:util";import I3 from"node:stream";function uK(){let Z=this.constructor.call(),{debuglog:X,queueListener:q,...W}=this.options;if(Z.options=structuredClone(W),Z.options.debuglog=X,Z.options.queueListener=q,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var mK,fK=(Z)=>{x6.queue.emit("change",Z)},x6=function(Z,X){if(arguments.length===1&&!G.defined(Z))throw Error("Invalid input");if(!(this instanceof x6))return new x6(Z,X);return I3.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(q)=>{this.emit("warning",q),mK(q)},queueListener:fK},this.options.input=this._createInputDescriptor(Z,X,{allowStream:!0}),this},l0;var VX=R(()=>{m0();b4();/*!
206
211
  Copyright 2013 Lovell Fuller and others.
207
212
  SPDX-License-Identifier: Apache-2.0
208
- */var IY=h("node:util"),l5=h("node:stream"),DY=v0();w1();var wY=IY.debuglog("sharp"),NY=(Z)=>{I4.queue.emit("change",Z)},I4=function(Z,J){if(arguments.length===1&&!DY.defined(Z))throw Error("Invalid input");if(!(this instanceof I4))return new I4(Z,J);return l5.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),wY(X)},queueListener:NY},this.options.input=this._createInputDescriptor(Z,J,{allowStream:!0}),this};Object.setPrototypeOf(I4.prototype,l5.Duplex.prototype);Object.setPrototypeOf(I4,l5.Duplex);function TY(){let Z=this.constructor.call(),{debuglog:J,queueListener:X,...W}=this.options;if(Z.options=structuredClone(W),Z.options.debuglog=J,Z.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}Object.assign(I4.prototype,{clone:TY});S8.exports=I4});var g8=S((MB,y8)=>{/*!
213
+ */mK=hK.debuglog("sharp");Object.setPrototypeOf(x6.prototype,I3.Duplex.prototype);Object.setPrototypeOf(x6,I3.Duplex);Object.assign(x6.prototype,{clone:uK});l0=x6});function BX(Z){let X=cK.filter((q)=>G.defined(Z[q])).map((q)=>[q,Z[q]]);return X.length?Object.fromEntries(X):void 0}function lK(Z,X,q){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(G.string(Z))W.file=Z;else if(G.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if(G.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if(G.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(G.plainObject(Z)&&!G.defined(X)){if(X=Z,BX(X))W.buffer=[]}else if(!G.defined(Z)&&!G.defined(X)&&G.object(q)&&q.allowStream)W.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((Q)=>this._createInputDescriptor(Q));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${G.defined(X)?` when also providing options of type ${typeof X}`:""}`);if(G.object(X)){if(G.defined(X.failOn))if(G.string(X.failOn)&&G.inArray(X.failOn,["none","truncated","error","warning"]))W.failOn=X.failOn;else throw G.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if(G.defined(X.autoOrient))if(G.bool(X.autoOrient))W.autoOrient=X.autoOrient;else throw G.invalidParameterError("autoOrient","boolean",X.autoOrient);if(G.defined(X.density))if(G.number(X.density)&&G.inRange(X.density,1,1e5))W.density=X.density;else throw G.invalidParameterError("density","number between 1 and 100000",X.density);if(G.defined(X.ignoreIcc))if(G.bool(X.ignoreIcc))W.ignoreIcc=X.ignoreIcc;else throw G.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if(G.defined(X.limitInputPixels))if(G.bool(X.limitInputPixels))W.limitInputPixels=X.limitInputPixels?268402689:0;else if(G.integer(X.limitInputPixels)&&G.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=X.limitInputPixels;else throw G.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if(G.defined(X.limitInputChannels))if(G.bool(X.limitInputChannels))W.limitInputChannels=X.limitInputChannels?5:0;else if(G.integer(X.limitInputChannels)&&G.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))W.limitInputChannels=X.limitInputChannels;else throw G.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if(G.defined(X.unlimited))if(G.bool(X.unlimited))W.unlimited=X.unlimited;else throw G.invalidParameterError("unlimited","boolean",X.unlimited);if(G.defined(X.sequentialRead))if(G.bool(X.sequentialRead))W.sequentialRead=X.sequentialRead;else throw G.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if(G.defined(X.raw)){if(G.object(X.raw)&&G.integer(X.raw.width)&&X.raw.width>0&&G.integer(X.raw.height)&&X.raw.height>0&&G.integer(X.raw.channels)&&G.inRange(X.raw.channels,1,4))switch(W.rawWidth=X.raw.width,W.rawHeight=X.raw.height,W.rawChannels=X.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(W.rawPremultiplied=!1,G.defined(X.raw.premultiplied))if(G.bool(X.raw.premultiplied))W.rawPremultiplied=X.raw.premultiplied;else throw G.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(W.rawPageHeight=0,G.defined(X.raw.pageHeight))if(G.integer(X.raw.pageHeight)&&X.raw.pageHeight>0&&X.raw.pageHeight<=X.raw.height){if(X.raw.height%X.raw.pageHeight!==0)throw Error(`Expected raw.height ${X.raw.height} to be a multiple of raw.pageHeight ${X.raw.pageHeight}`);W.rawPageHeight=X.raw.pageHeight}else throw G.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if(G.defined(X.animated))if(G.bool(X.animated))W.pages=X.animated?-1:1;else throw G.invalidParameterError("animated","boolean",X.animated);if(G.defined(X.pages))if(G.integer(X.pages)&&G.inRange(X.pages,-1,1e5))W.pages=X.pages;else throw G.invalidParameterError("pages","integer between -1 and 100000",X.pages);if(G.defined(X.page))if(G.integer(X.page)&&G.inRange(X.page,0,1e5))W.page=X.page;else throw G.invalidParameterError("page","integer between 0 and 100000",X.page);if(G.object(X.openSlide)&&G.defined(X.openSlide.level))if(G.integer(X.openSlide.level)&&G.inRange(X.openSlide.level,0,256))W.openSlideLevel=X.openSlide.level;else throw G.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if(G.defined(X.level))if(G.integer(X.level)&&G.inRange(X.level,0,256))W.openSlideLevel=X.level;else throw G.invalidParameterError("level","integer between 0 and 256",X.level);if(G.object(X.tiff)&&G.defined(X.tiff.subifd))if(G.integer(X.tiff.subifd)&&G.inRange(X.tiff.subifd,-1,1e5))W.tiffSubifd=X.tiff.subifd;else throw G.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if(G.defined(X.subifd))if(G.integer(X.subifd)&&G.inRange(X.subifd,-1,1e5))W.tiffSubifd=X.subifd;else throw G.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if(G.object(X.svg)){if(G.defined(X.svg.stylesheet))if(G.string(X.svg.stylesheet))W.svgStylesheet=X.svg.stylesheet;else throw G.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if(G.defined(X.svg.highBitdepth))if(G.bool(X.svg.highBitdepth))W.svgHighBitdepth=X.svg.highBitdepth;else throw G.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if(G.object(X.pdf)&&G.defined(X.pdf.background))W.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if(G.defined(X.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if(G.object(X.jp2)&&G.defined(X.jp2.oneshot))if(G.bool(X.jp2.oneshot))W.jp2Oneshot=X.jp2.oneshot;else throw G.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if(G.defined(X.create))if(G.object(X.create)&&G.integer(X.create.width)&&X.create.width>0&&G.integer(X.create.height)&&X.create.height>0&&G.integer(X.create.channels)){if(W.createWidth=X.create.width,W.createHeight=X.create.height,W.createChannels=X.create.channels,W.createPageHeight=0,G.defined(X.create.pageHeight))if(G.integer(X.create.pageHeight)&&X.create.pageHeight>0&&X.create.pageHeight<=X.create.height){if(X.create.height%X.create.pageHeight!==0)throw Error(`Expected create.height ${X.create.height} to be a multiple of create.pageHeight ${X.create.pageHeight}`);W.createPageHeight=X.create.pageHeight}else throw G.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if(G.defined(X.create.noise)){if(!G.object(X.create.noise))throw Error("Expected noise to be an object");if(X.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(W.createNoiseType=X.create.noise.type,!G.inRange(X.create.channels,1,4))throw G.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(W.createNoiseMean=128,G.defined(X.create.noise.mean))if(G.number(X.create.noise.mean)&&G.inRange(X.create.noise.mean,0,1e4))W.createNoiseMean=X.create.noise.mean;else throw G.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(W.createNoiseSigma=30,G.defined(X.create.noise.sigma))if(G.number(X.create.noise.sigma)&&G.inRange(X.create.noise.sigma,0,1e4))W.createNoiseSigma=X.create.noise.sigma;else throw G.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if(G.defined(X.create.background)){if(!G.inRange(X.create.channels,3,4))throw G.invalidParameterError("create.channels","number between 3 and 4",X.create.channels);W.createBackground=this._getBackgroundColourOption(X.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(G.defined(X.text))if(G.object(X.text)&&G.string(X.text.text)){if(W.textValue=X.text.text,G.defined(X.text.height)&&G.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if(G.defined(X.text.font))if(G.string(X.text.font))W.textFont=X.text.font;else throw G.invalidParameterError("text.font","string",X.text.font);if(G.defined(X.text.fontfile))if(G.string(X.text.fontfile))W.textFontfile=X.text.fontfile;else throw G.invalidParameterError("text.fontfile","string",X.text.fontfile);if(G.defined(X.text.width))if(G.integer(X.text.width)&&X.text.width>0)W.textWidth=X.text.width;else throw G.invalidParameterError("text.width","positive integer",X.text.width);if(G.defined(X.text.height))if(G.integer(X.text.height)&&X.text.height>0)W.textHeight=X.text.height;else throw G.invalidParameterError("text.height","positive integer",X.text.height);if(G.defined(X.text.align))if(G.string(X.text.align)&&G.string(this.constructor.align[X.text.align]))W.textAlign=this.constructor.align[X.text.align];else throw G.invalidParameterError("text.align","valid alignment",X.text.align);if(G.defined(X.text.justify))if(G.bool(X.text.justify))W.textJustify=X.text.justify;else throw G.invalidParameterError("text.justify","boolean",X.text.justify);if(G.defined(X.text.dpi))if(G.integer(X.text.dpi)&&G.inRange(X.text.dpi,1,1e6))W.textDpi=X.text.dpi;else throw G.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if(G.defined(X.text.rgba))if(G.bool(X.text.rgba))W.textRgba=X.text.rgba;else throw G.invalidParameterError("text.rgba","bool",X.text.rgba);if(G.defined(X.text.spacing))if(G.integer(X.text.spacing)&&G.inRange(X.text.spacing,-1e6,1e6))W.textSpacing=X.text.spacing;else throw G.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if(G.defined(X.text.wrap))if(G.string(X.text.wrap)&&G.inArray(X.text.wrap,["word","char","word-char","none"]))W.textWrap=X.text.wrap;else throw G.invalidParameterError("text.wrap","one of: word, char, word-char, none",X.text.wrap);delete W.buffer}else throw Error("Expected a valid string to create an image with text.");if(G.defined(X.join))if(G.defined(this.options.join)){if(G.defined(X.join.animated))if(G.bool(X.join.animated))W.joinAnimated=X.join.animated;else throw G.invalidParameterError("join.animated","boolean",X.join.animated);if(G.defined(X.join.across))if(G.integer(X.join.across)&&G.inRange(X.join.across,1,1e6))W.joinAcross=X.join.across;else throw G.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if(G.defined(X.join.shim))if(G.integer(X.join.shim)&&G.inRange(X.join.shim,0,1e6))W.joinShim=X.join.shim;else throw G.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if(G.defined(X.join.background))W.joinBackground=this._getBackgroundColourOption(X.join.background);if(G.defined(X.join.halign))if(G.string(X.join.halign)&&G.string(this.constructor.align[X.join.halign]))W.joinHalign=this.constructor.align[X.join.halign];else throw G.invalidParameterError("join.halign","valid alignment",X.join.halign);if(G.defined(X.join.valign))if(G.string(X.join.valign)&&G.string(this.constructor.align[X.join.valign]))W.joinValign=this.constructor.align[X.join.valign];else throw G.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(G.defined(X))throw Error(`Invalid input options ${X}`);return W}function pK(Z,X,q){if(Array.isArray(this.options.input.buffer))if(G.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),q()}else q(Error("Non-Buffer data on Writable Stream"));else q(Error("Unexpected data on Writable Stream"))}function nK(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function iK(){return Array.isArray(this.options.input.buffer)}function rK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{let Q=()=>{this._flattenBufferIn(),v.metadata(this.options,(J,z)=>{if(J)W(G.nativeError(J,X));else q(z)})};if(this.writableFinished)Q();else this.once("finish",Q)});else return new Promise((q,W)=>{v.metadata(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}function aK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.on("finish",function(){this._flattenBufferIn(),v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})});else return new Promise((q,W)=>{v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}var dK,cK,HX=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:BX,_createInputDescriptor:lK,_write:pK,_flattenBufferIn:nK,_isStreamInput:iK,metadata:rK,stats:aK}),Z.align=dK};var $X=R(()=>{m0();b4();/*!
209
214
  Copyright 2013 Lovell Fuller and others.
210
215
  SPDX-License-Identifier: Apache-2.0
211
- */var F=v0(),X4=w1(),PY={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},RY=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function v8(Z){let J=RY.filter((X)=>F.defined(Z[X])).map((X)=>[X,Z[X]]);return J.length?Object.fromEntries(J):void 0}function jY(Z,J,X){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(F.string(Z))W.file=Z;else if(F.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if(F.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if(F.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(F.plainObject(Z)&&!F.defined(J)){if(J=Z,v8(J))W.buffer=[]}else if(!F.defined(Z)&&!F.defined(J)&&F.object(X)&&X.allowStream)W.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((q)=>this._createInputDescriptor(q));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${F.defined(J)?` when also providing options of type ${typeof J}`:""}`);if(F.object(J)){if(F.defined(J.failOnError))if(F.bool(J.failOnError))W.failOn=J.failOnError?"warning":"none";else throw F.invalidParameterError("failOnError","boolean",J.failOnError);if(F.defined(J.failOn))if(F.string(J.failOn)&&F.inArray(J.failOn,["none","truncated","error","warning"]))W.failOn=J.failOn;else throw F.invalidParameterError("failOn","one of: none, truncated, error, warning",J.failOn);if(F.defined(J.autoOrient))if(F.bool(J.autoOrient))W.autoOrient=J.autoOrient;else throw F.invalidParameterError("autoOrient","boolean",J.autoOrient);if(F.defined(J.density))if(F.inRange(J.density,1,1e5))W.density=J.density;else throw F.invalidParameterError("density","number between 1 and 100000",J.density);if(F.defined(J.ignoreIcc))if(F.bool(J.ignoreIcc))W.ignoreIcc=J.ignoreIcc;else throw F.invalidParameterError("ignoreIcc","boolean",J.ignoreIcc);if(F.defined(J.limitInputPixels))if(F.bool(J.limitInputPixels))W.limitInputPixels=J.limitInputPixels?268402689:0;else if(F.integer(J.limitInputPixels)&&F.inRange(J.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=J.limitInputPixels;else throw F.invalidParameterError("limitInputPixels","positive integer",J.limitInputPixels);if(F.defined(J.unlimited))if(F.bool(J.unlimited))W.unlimited=J.unlimited;else throw F.invalidParameterError("unlimited","boolean",J.unlimited);if(F.defined(J.sequentialRead))if(F.bool(J.sequentialRead))W.sequentialRead=J.sequentialRead;else throw F.invalidParameterError("sequentialRead","boolean",J.sequentialRead);if(F.defined(J.raw)){if(F.object(J.raw)&&F.integer(J.raw.width)&&J.raw.width>0&&F.integer(J.raw.height)&&J.raw.height>0&&F.integer(J.raw.channels)&&F.inRange(J.raw.channels,1,4))switch(W.rawWidth=J.raw.width,W.rawHeight=J.raw.height,W.rawChannels=J.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(W.rawPremultiplied=!1,F.defined(J.raw.premultiplied))if(F.bool(J.raw.premultiplied))W.rawPremultiplied=J.raw.premultiplied;else throw F.invalidParameterError("raw.premultiplied","boolean",J.raw.premultiplied);if(W.rawPageHeight=0,F.defined(J.raw.pageHeight))if(F.integer(J.raw.pageHeight)&&J.raw.pageHeight>0&&J.raw.pageHeight<=J.raw.height){if(J.raw.height%J.raw.pageHeight!==0)throw Error(`Expected raw.height ${J.raw.height} to be a multiple of raw.pageHeight ${J.raw.pageHeight}`);W.rawPageHeight=J.raw.pageHeight}else throw F.invalidParameterError("raw.pageHeight","positive integer",J.raw.pageHeight)}if(F.defined(J.animated))if(F.bool(J.animated))W.pages=J.animated?-1:1;else throw F.invalidParameterError("animated","boolean",J.animated);if(F.defined(J.pages))if(F.integer(J.pages)&&F.inRange(J.pages,-1,1e5))W.pages=J.pages;else throw F.invalidParameterError("pages","integer between -1 and 100000",J.pages);if(F.defined(J.page))if(F.integer(J.page)&&F.inRange(J.page,0,1e5))W.page=J.page;else throw F.invalidParameterError("page","integer between 0 and 100000",J.page);if(F.object(J.openSlide)&&F.defined(J.openSlide.level))if(F.integer(J.openSlide.level)&&F.inRange(J.openSlide.level,0,256))W.openSlideLevel=J.openSlide.level;else throw F.invalidParameterError("openSlide.level","integer between 0 and 256",J.openSlide.level);else if(F.defined(J.level))if(F.integer(J.level)&&F.inRange(J.level,0,256))W.openSlideLevel=J.level;else throw F.invalidParameterError("level","integer between 0 and 256",J.level);if(F.object(J.tiff)&&F.defined(J.tiff.subifd))if(F.integer(J.tiff.subifd)&&F.inRange(J.tiff.subifd,-1,1e5))W.tiffSubifd=J.tiff.subifd;else throw F.invalidParameterError("tiff.subifd","integer between -1 and 100000",J.tiff.subifd);else if(F.defined(J.subifd))if(F.integer(J.subifd)&&F.inRange(J.subifd,-1,1e5))W.tiffSubifd=J.subifd;else throw F.invalidParameterError("subifd","integer between -1 and 100000",J.subifd);if(F.object(J.svg)){if(F.defined(J.svg.stylesheet))if(F.string(J.svg.stylesheet))W.svgStylesheet=J.svg.stylesheet;else throw F.invalidParameterError("svg.stylesheet","string",J.svg.stylesheet);if(F.defined(J.svg.highBitdepth))if(F.bool(J.svg.highBitdepth))W.svgHighBitdepth=J.svg.highBitdepth;else throw F.invalidParameterError("svg.highBitdepth","boolean",J.svg.highBitdepth)}if(F.object(J.pdf)&&F.defined(J.pdf.background))W.pdfBackground=this._getBackgroundColourOption(J.pdf.background);else if(F.defined(J.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(J.pdfBackground);if(F.object(J.jp2)&&F.defined(J.jp2.oneshot))if(F.bool(J.jp2.oneshot))W.jp2Oneshot=J.jp2.oneshot;else throw F.invalidParameterError("jp2.oneshot","boolean",J.jp2.oneshot);if(F.defined(J.create))if(F.object(J.create)&&F.integer(J.create.width)&&J.create.width>0&&F.integer(J.create.height)&&J.create.height>0&&F.integer(J.create.channels)){if(W.createWidth=J.create.width,W.createHeight=J.create.height,W.createChannels=J.create.channels,W.createPageHeight=0,F.defined(J.create.pageHeight))if(F.integer(J.create.pageHeight)&&J.create.pageHeight>0&&J.create.pageHeight<=J.create.height){if(J.create.height%J.create.pageHeight!==0)throw Error(`Expected create.height ${J.create.height} to be a multiple of create.pageHeight ${J.create.pageHeight}`);W.createPageHeight=J.create.pageHeight}else throw F.invalidParameterError("create.pageHeight","positive integer",J.create.pageHeight);if(F.defined(J.create.noise)){if(!F.object(J.create.noise))throw Error("Expected noise to be an object");if(J.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(W.createNoiseType=J.create.noise.type,!F.inRange(J.create.channels,1,4))throw F.invalidParameterError("create.channels","number between 1 and 4",J.create.channels);if(W.createNoiseMean=128,F.defined(J.create.noise.mean))if(F.number(J.create.noise.mean)&&F.inRange(J.create.noise.mean,0,1e4))W.createNoiseMean=J.create.noise.mean;else throw F.invalidParameterError("create.noise.mean","number between 0 and 10000",J.create.noise.mean);if(W.createNoiseSigma=30,F.defined(J.create.noise.sigma))if(F.number(J.create.noise.sigma)&&F.inRange(J.create.noise.sigma,0,1e4))W.createNoiseSigma=J.create.noise.sigma;else throw F.invalidParameterError("create.noise.sigma","number between 0 and 10000",J.create.noise.sigma)}else if(F.defined(J.create.background)){if(!F.inRange(J.create.channels,3,4))throw F.invalidParameterError("create.channels","number between 3 and 4",J.create.channels);W.createBackground=this._getBackgroundColourOption(J.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(F.defined(J.text))if(F.object(J.text)&&F.string(J.text.text)){if(W.textValue=J.text.text,F.defined(J.text.height)&&F.defined(J.text.dpi))throw Error("Expected only one of dpi or height");if(F.defined(J.text.font))if(F.string(J.text.font))W.textFont=J.text.font;else throw F.invalidParameterError("text.font","string",J.text.font);if(F.defined(J.text.fontfile))if(F.string(J.text.fontfile))W.textFontfile=J.text.fontfile;else throw F.invalidParameterError("text.fontfile","string",J.text.fontfile);if(F.defined(J.text.width))if(F.integer(J.text.width)&&J.text.width>0)W.textWidth=J.text.width;else throw F.invalidParameterError("text.width","positive integer",J.text.width);if(F.defined(J.text.height))if(F.integer(J.text.height)&&J.text.height>0)W.textHeight=J.text.height;else throw F.invalidParameterError("text.height","positive integer",J.text.height);if(F.defined(J.text.align))if(F.string(J.text.align)&&F.string(this.constructor.align[J.text.align]))W.textAlign=this.constructor.align[J.text.align];else throw F.invalidParameterError("text.align","valid alignment",J.text.align);if(F.defined(J.text.justify))if(F.bool(J.text.justify))W.textJustify=J.text.justify;else throw F.invalidParameterError("text.justify","boolean",J.text.justify);if(F.defined(J.text.dpi))if(F.integer(J.text.dpi)&&F.inRange(J.text.dpi,1,1e6))W.textDpi=J.text.dpi;else throw F.invalidParameterError("text.dpi","integer between 1 and 1000000",J.text.dpi);if(F.defined(J.text.rgba))if(F.bool(J.text.rgba))W.textRgba=J.text.rgba;else throw F.invalidParameterError("text.rgba","bool",J.text.rgba);if(F.defined(J.text.spacing))if(F.integer(J.text.spacing)&&F.inRange(J.text.spacing,-1e6,1e6))W.textSpacing=J.text.spacing;else throw F.invalidParameterError("text.spacing","integer between -1000000 and 1000000",J.text.spacing);if(F.defined(J.text.wrap))if(F.string(J.text.wrap)&&F.inArray(J.text.wrap,["word","char","word-char","none"]))W.textWrap=J.text.wrap;else throw F.invalidParameterError("text.wrap","one of: word, char, word-char, none",J.text.wrap);delete W.buffer}else throw Error("Expected a valid string to create an image with text.");if(F.defined(J.join))if(F.defined(this.options.join)){if(F.defined(J.join.animated))if(F.bool(J.join.animated))W.joinAnimated=J.join.animated;else throw F.invalidParameterError("join.animated","boolean",J.join.animated);if(F.defined(J.join.across))if(F.integer(J.join.across)&&F.inRange(J.join.across,1,1e6))W.joinAcross=J.join.across;else throw F.invalidParameterError("join.across","integer between 1 and 100000",J.join.across);if(F.defined(J.join.shim))if(F.integer(J.join.shim)&&F.inRange(J.join.shim,0,1e6))W.joinShim=J.join.shim;else throw F.invalidParameterError("join.shim","integer between 0 and 100000",J.join.shim);if(F.defined(J.join.background))W.joinBackground=this._getBackgroundColourOption(J.join.background);if(F.defined(J.join.halign))if(F.string(J.join.halign)&&F.string(this.constructor.align[J.join.halign]))W.joinHalign=this.constructor.align[J.join.halign];else throw F.invalidParameterError("join.halign","valid alignment",J.join.halign);if(F.defined(J.join.valign))if(F.string(J.join.valign)&&F.string(this.constructor.align[J.join.valign]))W.joinValign=this.constructor.align[J.join.valign];else throw F.invalidParameterError("join.valign","valid alignment",J.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(F.defined(J))throw Error(`Invalid input options ${J}`);return W}function _Y(Z,J,X){if(Array.isArray(this.options.input.buffer))if(F.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function CY(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function EY(){return Array.isArray(this.options.input.buffer)}function OY(Z){let J=Error();if(F.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),X4.metadata(this.options,(X,W)=>{if(X)Z(F.nativeError(X,J));else Z(null,W)})});else X4.metadata(this.options,(X,W)=>{if(X)Z(F.nativeError(X,J));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((X,W)=>{let q=()=>{this._flattenBufferIn(),X4.metadata(this.options,(Q,G)=>{if(Q)W(F.nativeError(Q,J));else X(G)})};if(this.writableFinished)q();else this.once("finish",q)});else return new Promise((X,W)=>{X4.metadata(this.options,(q,Q)=>{if(q)W(F.nativeError(q,J));else X(Q)})})}function xY(Z){let J=Error();if(F.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),X4.stats(this.options,(X,W)=>{if(X)Z(F.nativeError(X,J));else Z(null,W)})});else X4.stats(this.options,(X,W)=>{if(X)Z(F.nativeError(X,J));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((X,W)=>{this.on("finish",function(){this._flattenBufferIn(),X4.stats(this.options,(q,Q)=>{if(q)W(F.nativeError(q,J));else X(Q)})})});else return new Promise((X,W)=>{X4.stats(this.options,(q,Q)=>{if(q)W(F.nativeError(q,J));else X(Q)})})}y8.exports=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:v8,_createInputDescriptor:jY,_write:_Y,_flattenBufferIn:CY,_isStreamInput:EY,metadata:OY,stats:xY}),Z.align=PY}});var c8=S((AB,d8)=>{/*!
216
+ */dK={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},cK=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function D3(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function v1(Z){return Z.width!==-1||Z.height!==-1}function tK(Z,X,q){if(v1(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(G.defined(Z))if(G.object(Z)&&!G.defined(q))q=Z;else if(G.integer(Z)&&Z>0)this.options.width=Z;else throw G.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(G.defined(X))if(G.integer(X)&&X>0)this.options.height=X;else throw G.invalidParameterError("height","positive integer",X);else this.options.height=-1;if(G.object(q)){if(G.defined(q.width))if(G.integer(q.width)&&q.width>0)this.options.width=q.width;else throw G.invalidParameterError("width","positive integer",q.width);if(G.defined(q.height))if(G.integer(q.height)&&q.height>0)this.options.height=q.height;else throw G.invalidParameterError("height","positive integer",q.height);if(G.defined(q.fit)){let W=oK[q.fit];if(G.string(W))this.options.canvas=W;else throw G.invalidParameterError("fit","valid fit",q.fit)}if(G.defined(q.position)){let W=G.integer(q.position)?q.position:LX[q.position]||MX[q.position]||AX[q.position];if(G.integer(W)&&(G.inRange(W,0,8)||G.inRange(W,16,17)))this.options.position=W;else throw G.invalidParameterError("position","valid position/gravity/strategy",q.position)}if(this._setBackgroundColourOption("resizeBackground",q.background),G.defined(q.kernel))if(G.string(w3[q.kernel]))this.options.kernel=w3[q.kernel];else throw G.invalidParameterError("kernel","valid kernel name",q.kernel);if(G.defined(q.withoutEnlargement))this._setBooleanOption("withoutEnlargement",q.withoutEnlargement);if(G.defined(q.withoutReduction))this._setBooleanOption("withoutReduction",q.withoutReduction);if(G.defined(q.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",q.fastShrinkOnLoad)}if(D3(this.options)&&v1(this.options))this.options.rotateBefore=!0;return this}function eK(Z){if(G.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(G.object(Z)){if(G.defined(Z.top))if(G.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw G.invalidParameterError("top","positive integer",Z.top);if(G.defined(Z.bottom))if(G.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw G.invalidParameterError("bottom","positive integer",Z.bottom);if(G.defined(Z.left))if(G.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw G.invalidParameterError("left","positive integer",Z.left);if(G.defined(Z.right))if(G.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw G.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),G.defined(Z.extendWith))if(G.string(FX[Z.extendWith]))this.options.extendWith=FX[Z.extendWith];else throw G.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw G.invalidParameterError("extend","integer or object",Z);return this}function ZV(Z){let X=v1(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${X}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(q){let W=Z[q];if(G.integer(W)&&W>=0)this.options[q+(q==="left"||q==="top"?"Offset":"")+X]=W;else throw G.invalidParameterError(q,"integer",W)},this),D3(this.options)&&!v1(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function XV(Z){if(this.options.trimThreshold=10,G.defined(Z))if(G.object(Z)){if(G.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(G.defined(Z.threshold))if(G.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw G.invalidParameterError("threshold","positive number",Z.threshold);if(G.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(G.defined(Z.margin))if(G.integer(Z.margin)&&Z.margin>=0)this.options.trimMargin=Z.margin;else throw G.invalidParameterError("margin","positive integer",Z.margin)}else throw G.invalidParameterError("trim","object",Z);if(D3(this.options))this.options.rotateBefore=!0;return this}var AX,MX,FX,LX,w3,sK,oK,IX=(Z)=>{Object.assign(Z.prototype,{resize:tK,extend:eK,extract:ZV,trim:XV}),Z.gravity=AX,Z.strategy=LX,Z.kernel=w3,Z.fit=sK,Z.position=MX};var wX=R(()=>{m0();/*!
212
217
  Copyright 2013 Lovell Fuller and others.
213
218
  SPDX-License-Identifier: Apache-2.0
214
- */var _=v0(),m8={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},f8={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},h8={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},u8={entropy:16,attention:17},p5={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},kY={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},SY={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function n5(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function F6(Z){return Z.width!==-1||Z.height!==-1}function bY(Z,J,X){if(F6(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(_.defined(Z))if(_.object(Z)&&!_.defined(X))X=Z;else if(_.integer(Z)&&Z>0)this.options.width=Z;else throw _.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(_.defined(J))if(_.integer(J)&&J>0)this.options.height=J;else throw _.invalidParameterError("height","positive integer",J);else this.options.height=-1;if(_.object(X)){if(_.defined(X.width))if(_.integer(X.width)&&X.width>0)this.options.width=X.width;else throw _.invalidParameterError("width","positive integer",X.width);if(_.defined(X.height))if(_.integer(X.height)&&X.height>0)this.options.height=X.height;else throw _.invalidParameterError("height","positive integer",X.height);if(_.defined(X.fit)){let W=SY[X.fit];if(_.string(W))this.options.canvas=W;else throw _.invalidParameterError("fit","valid fit",X.fit)}if(_.defined(X.position)){let W=_.integer(X.position)?X.position:u8[X.position]||f8[X.position]||m8[X.position];if(_.integer(W)&&(_.inRange(W,0,8)||_.inRange(W,16,17)))this.options.position=W;else throw _.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),_.defined(X.kernel))if(_.string(p5[X.kernel]))this.options.kernel=p5[X.kernel];else throw _.invalidParameterError("kernel","valid kernel name",X.kernel);if(_.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(_.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(_.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(n5(this.options)&&F6(this.options))this.options.rotateBefore=!0;return this}function vY(Z){if(_.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(_.object(Z)){if(_.defined(Z.top))if(_.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw _.invalidParameterError("top","positive integer",Z.top);if(_.defined(Z.bottom))if(_.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw _.invalidParameterError("bottom","positive integer",Z.bottom);if(_.defined(Z.left))if(_.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw _.invalidParameterError("left","positive integer",Z.left);if(_.defined(Z.right))if(_.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw _.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),_.defined(Z.extendWith))if(_.string(h8[Z.extendWith]))this.options.extendWith=h8[Z.extendWith];else throw _.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw _.invalidParameterError("extend","integer or object",Z);return this}function yY(Z){let J=F6(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${J}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let W=Z[X];if(_.integer(W)&&W>=0)this.options[X+(X==="left"||X==="top"?"Offset":"")+J]=W;else throw _.invalidParameterError(X,"integer",W)},this),n5(this.options)&&!F6(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function gY(Z){if(this.options.trimThreshold=10,_.defined(Z))if(_.object(Z)){if(_.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(_.defined(Z.threshold))if(_.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw _.invalidParameterError("threshold","positive number",Z.threshold);if(_.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt)}else throw _.invalidParameterError("trim","object",Z);if(n5(this.options))this.options.rotateBefore=!0;return this}d8.exports=(Z)=>{Object.assign(Z.prototype,{resize:bY,extend:vY,extract:yY,trim:gY}),Z.gravity=m8,Z.strategy=u8,Z.kernel=p5,Z.fit=kY,Z.position=f8}});var p8=S((LB,l8)=>{/*!
219
+ */AX={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},MX={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},FX={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},LX={entropy:16,attention:17},w3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},sK={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},oK={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function qV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((X)=>{if(!G.object(X))throw G.invalidParameterError("image to composite","object",X);let q=this._inputOptionsFromObject(X),W={input:this._createInputDescriptor(X.input,q,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(G.defined(X.blend))if(G.string(N3[X.blend]))W.blend=N3[X.blend];else throw G.invalidParameterError("blend","valid blend name",X.blend);if(G.defined(X.tile))if(G.bool(X.tile))W.tile=X.tile;else throw G.invalidParameterError("tile","boolean",X.tile);if(G.defined(X.left))if(G.integer(X.left))W.left=X.left;else throw G.invalidParameterError("left","integer",X.left);if(G.defined(X.top))if(G.integer(X.top))W.top=X.top;else throw G.invalidParameterError("top","integer",X.top);if(G.defined(X.top)!==G.defined(X.left))throw Error("Expected both left and top to be set");else W.hasOffset=G.integer(X.top)&&G.integer(X.left);if(G.defined(X.gravity))if(G.integer(X.gravity)&&G.inRange(X.gravity,0,8))W.gravity=X.gravity;else if(G.string(X.gravity)&&G.integer(this.constructor.gravity[X.gravity]))W.gravity=this.constructor.gravity[X.gravity];else throw G.invalidParameterError("gravity","valid gravity",X.gravity);if(G.defined(X.premultiplied))if(G.bool(X.premultiplied))W.premultiplied=X.premultiplied;else throw G.invalidParameterError("premultiplied","boolean",X.premultiplied);return W}),this}var N3,DX=(Z)=>{Z.prototype.composite=qV,Z.blend=N3};var NX=R(()=>{m0();/*!
215
220
  Copyright 2013 Lovell Fuller and others.
216
221
  SPDX-License-Identifier: Apache-2.0
217
- */var u=v0(),r5={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function hY(Z){if(!Array.isArray(Z))throw u.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((J)=>{if(!u.object(J))throw u.invalidParameterError("image to composite","object",J);let X=this._inputOptionsFromObject(J),W={input:this._createInputDescriptor(J.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(u.defined(J.blend))if(u.string(r5[J.blend]))W.blend=r5[J.blend];else throw u.invalidParameterError("blend","valid blend name",J.blend);if(u.defined(J.tile))if(u.bool(J.tile))W.tile=J.tile;else throw u.invalidParameterError("tile","boolean",J.tile);if(u.defined(J.left))if(u.integer(J.left))W.left=J.left;else throw u.invalidParameterError("left","integer",J.left);if(u.defined(J.top))if(u.integer(J.top))W.top=J.top;else throw u.invalidParameterError("top","integer",J.top);if(u.defined(J.top)!==u.defined(J.left))throw Error("Expected both left and top to be set");else W.hasOffset=u.integer(J.top)&&u.integer(J.left);if(u.defined(J.gravity))if(u.integer(J.gravity)&&u.inRange(J.gravity,0,8))W.gravity=J.gravity;else if(u.string(J.gravity)&&u.integer(this.constructor.gravity[J.gravity]))W.gravity=this.constructor.gravity[J.gravity];else throw u.invalidParameterError("gravity","valid gravity",J.gravity);if(u.defined(J.premultiplied))if(u.bool(J.premultiplied))W.premultiplied=J.premultiplied;else throw u.invalidParameterError("premultiplied","boolean",J.premultiplied);return W}),this}l8.exports=(Z)=>{Z.prototype.composite=hY,Z.blend=r5}});var s8=S((IB,a8)=>{/*!
222
+ */N3={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function WV(Z,X){if(!G.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(G.integer(Z)&&!(Z%90))this.options.angle=Z;else if(G.number(Z)){if(this.options.rotationAngle=Z,G.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw G.invalidParameterError("angle","numeric",Z);return this}function QV(){return this.options.input.autoOrient=!0,this}function JV(Z){return this.options.flip=G.bool(Z)?Z:!0,this}function zV(Z){return this.options.flop=G.bool(Z)?Z:!0,this}function GV(Z,X){let q=Array.isArray(Z)?[].concat(...Z):[];if(q.length===4&&q.every(G.number))this.options.affineMatrix=q;else throw G.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(G.defined(X))if(G.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),G.defined(X.idx))if(G.number(X.idx))this.options.affineIdx=X.idx;else throw G.invalidParameterError("options.idx","number",X.idx);if(G.defined(X.idy))if(G.number(X.idy))this.options.affineIdy=X.idy;else throw G.invalidParameterError("options.idy","number",X.idy);if(G.defined(X.odx))if(G.number(X.odx))this.options.affineOdx=X.odx;else throw G.invalidParameterError("options.odx","number",X.odx);if(G.defined(X.ody))if(G.number(X.ody))this.options.affineOdy=X.ody;else throw G.invalidParameterError("options.ody","number",X.ody);if(G.defined(X.interpolator))if(G.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw G.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw G.invalidParameterError("options","object",X);return this}function YV(Z){if(G.plainObject(Z)){if(G.number(Z.sigma)&&G.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw G.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(G.defined(Z.m1))if(G.number(Z.m1)&&G.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw G.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(G.defined(Z.m2))if(G.number(Z.m2)&&G.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw G.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(G.defined(Z.x1))if(G.number(Z.x1)&&G.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw G.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(G.defined(Z.y2))if(G.number(Z.y2)&&G.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw G.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(G.defined(Z.y3))if(G.number(Z.y3)&&G.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw G.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function UV(Z){if(!G.defined(Z))this.options.medianSize=3;else if(G.integer(Z)&&G.inRange(Z,1,1000))this.options.medianSize=Z;else throw G.invalidParameterError("size","integer between 1 and 1000",Z);return this}function KV(Z){let X;if(G.number(Z))X=Z;else if(G.plainObject(Z)){if(!G.number(Z.sigma))throw G.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if(G.string(TX[Z.precision]))this.options.precision=TX[Z.precision];else throw G.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(G.number(Z.minAmplitude)&&G.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw G.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!G.defined(Z))this.options.blurSigma=-1;else if(G.bool(Z))this.options.blurSigma=Z?-1:0;else if(G.number(X)&&G.inRange(X,0.3,1000))this.options.blurSigma=X;else throw G.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function RX(Z){if(!G.defined(Z))this.options.dilateWidth=1;else if(G.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw G.invalidParameterError("dilate","positive integer",RX);return this}function _X(Z){if(!G.defined(Z))this.options.erodeWidth=1;else if(G.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw G.invalidParameterError("erode","positive integer",_X);return this}function VV(Z){if(this.options.flatten=G.bool(Z)?Z:!0,G.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function BV(){return this.options.unflatten=!0,this}function HV(Z,X){if(!G.defined(Z))this.options.gamma=2.2;else if(G.number(Z)&&G.inRange(Z,1,3))this.options.gamma=Z;else throw G.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!G.defined(X))this.options.gammaOut=this.options.gamma;else if(G.number(X)&&G.inRange(X,1,3))this.options.gammaOut=X;else throw G.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function $V(Z){if(this.options.negate=G.bool(Z)?Z:!0,G.plainObject(Z)&&"alpha"in Z)if(!G.bool(Z.alpha))throw G.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function FV(Z){if(G.plainObject(Z)){if(G.defined(Z.lower))if(G.number(Z.lower)&&G.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw G.invalidParameterError("lower","number between 0 and 99",Z.lower);if(G.defined(Z.upper))if(G.number(Z.upper)&&G.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw G.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw G.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function AV(Z){return this.normalise(Z)}function MV(Z){if(G.plainObject(Z)){if(G.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw G.invalidParameterError("width","integer greater than zero",Z.width);if(G.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw G.invalidParameterError("height","integer greater than zero",Z.height);if(G.defined(Z.maxSlope))if(G.integer(Z.maxSlope)&&G.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw G.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw G.invalidParameterError("options","plain object",Z);return this}function LV(Z){if(!G.object(Z)||!Array.isArray(Z.kernel)||!G.integer(Z.width)||!G.integer(Z.height)||!G.inRange(Z.width,3,1001)||!G.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!G.integer(Z.scale))Z.scale=Z.kernel.reduce((X,q)=>X+q,0);if(Z.scale<1)Z.scale=1;if(!G.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function IV(Z,X){if(!G.defined(Z))this.options.threshold=128;else if(G.bool(Z))this.options.threshold=Z?128:0;else if(G.integer(Z)&&G.inRange(Z,0,255))this.options.threshold=Z;else throw G.invalidParameterError("threshold","integer between 0 and 255",Z);if(!G.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function wV(Z,X,q){if(this.options.boolean=this._createInputDescriptor(Z,q),G.string(X)&&G.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw G.invalidParameterError("operator","one of: and, or, eor",X);return this}function DV(Z,X){if(!G.defined(Z)&&G.number(X))Z=1;else if(G.number(Z)&&!G.defined(X))X=0;if(!G.defined(Z))this.options.linearA=[];else if(G.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(G.number))this.options.linearA=Z;else throw G.invalidParameterError("a","number or array of numbers",Z);if(!G.defined(X))this.options.linearB=[];else if(G.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every(G.number))this.options.linearB=X;else throw G.invalidParameterError("b","number or array of numbers",X);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function NV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw G.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let X=Z.flat().map(Number);if(X.length!==9&&X.length!==16)throw G.invalidParameterError("inputMatrix","cardinality of 9 or 16",X.length);return this.options.recombMatrix=X,this}function TV(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(G.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw G.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(G.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw G.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(G.integer(Z.hue))this.options.hue=Z.hue%360;else throw G.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(G.number(Z.lightness))this.options.lightness=Z.lightness;else throw G.invalidParameterError("lightness","number",Z.lightness);return this}var TX,PX=(Z)=>{Object.assign(Z.prototype,{autoOrient:QV,rotate:WV,flip:JV,flop:zV,affine:GV,sharpen:YV,erode:_X,dilate:RX,median:UV,blur:KV,flatten:VV,unflatten:BV,gamma:HV,negate:$V,normalise:FV,normalize:AV,clahe:MV,convolve:LV,threshold:IV,boolean:wV,linear:DV,recomb:NV,modulate:TV})};var jX=R(()=>{m0();/*!
218
223
  Copyright 2013 Lovell Fuller and others.
219
224
  SPDX-License-Identifier: Apache-2.0
220
- */var M=v0(),n8={integer:"integer",float:"float",approximate:"approximate"};function mY(Z,J){if(!M.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(M.integer(Z)&&!(Z%90))this.options.angle=Z;else if(M.number(Z)){if(this.options.rotationAngle=Z,M.object(J)&&J.background)this._setBackgroundColourOption("rotationBackground",J.background)}else throw M.invalidParameterError("angle","numeric",Z);return this}function fY(){return this.options.input.autoOrient=!0,this}function uY(Z){return this.options.flip=M.bool(Z)?Z:!0,this}function dY(Z){return this.options.flop=M.bool(Z)?Z:!0,this}function cY(Z,J){let X=[].concat(...Z);if(X.length===4&&X.every(M.number))this.options.affineMatrix=X;else throw M.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(M.defined(J))if(M.object(J)){if(this._setBackgroundColourOption("affineBackground",J.background),M.defined(J.idx))if(M.number(J.idx))this.options.affineIdx=J.idx;else throw M.invalidParameterError("options.idx","number",J.idx);if(M.defined(J.idy))if(M.number(J.idy))this.options.affineIdy=J.idy;else throw M.invalidParameterError("options.idy","number",J.idy);if(M.defined(J.odx))if(M.number(J.odx))this.options.affineOdx=J.odx;else throw M.invalidParameterError("options.odx","number",J.odx);if(M.defined(J.ody))if(M.number(J.ody))this.options.affineOdy=J.ody;else throw M.invalidParameterError("options.ody","number",J.ody);if(M.defined(J.interpolator))if(M.inArray(J.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=J.interpolator;else throw M.invalidParameterError("options.interpolator","valid interpolator name",J.interpolator)}else throw M.invalidParameterError("options","object",J);return this}function lY(Z,J,X){if(!M.defined(Z))this.options.sharpenSigma=-1;else if(M.bool(Z))this.options.sharpenSigma=Z?-1:0;else if(M.number(Z)&&M.inRange(Z,0.01,1e4)){if(this.options.sharpenSigma=Z,M.defined(J))if(M.number(J)&&M.inRange(J,0,1e4))this.options.sharpenM1=J;else throw M.invalidParameterError("flat","number between 0 and 10000",J);if(M.defined(X))if(M.number(X)&&M.inRange(X,0,1e4))this.options.sharpenM2=X;else throw M.invalidParameterError("jagged","number between 0 and 10000",X)}else if(M.plainObject(Z)){if(M.number(Z.sigma)&&M.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw M.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(M.defined(Z.m1))if(M.number(Z.m1)&&M.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw M.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(M.defined(Z.m2))if(M.number(Z.m2)&&M.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw M.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(M.defined(Z.x1))if(M.number(Z.x1)&&M.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw M.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(M.defined(Z.y2))if(M.number(Z.y2)&&M.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw M.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(M.defined(Z.y3))if(M.number(Z.y3)&&M.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw M.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else throw M.invalidParameterError("sigma","number between 0.01 and 10000",Z);return this}function pY(Z){if(!M.defined(Z))this.options.medianSize=3;else if(M.integer(Z)&&M.inRange(Z,1,1000))this.options.medianSize=Z;else throw M.invalidParameterError("size","integer between 1 and 1000",Z);return this}function nY(Z){let J;if(M.number(Z))J=Z;else if(M.plainObject(Z)){if(!M.number(Z.sigma))throw M.invalidParameterError("options.sigma","number between 0.3 and 1000",J);if(J=Z.sigma,"precision"in Z)if(M.string(n8[Z.precision]))this.options.precision=n8[Z.precision];else throw M.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(M.number(Z.minAmplitude)&&M.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw M.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!M.defined(Z))this.options.blurSigma=-1;else if(M.bool(Z))this.options.blurSigma=Z?-1:0;else if(M.number(J)&&M.inRange(J,0.3,1000))this.options.blurSigma=J;else throw M.invalidParameterError("sigma","number between 0.3 and 1000",J);return this}function r8(Z){if(!M.defined(Z))this.options.dilateWidth=1;else if(M.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw M.invalidParameterError("dilate","positive integer",r8);return this}function i8(Z){if(!M.defined(Z))this.options.erodeWidth=1;else if(M.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw M.invalidParameterError("erode","positive integer",i8);return this}function rY(Z){if(this.options.flatten=M.bool(Z)?Z:!0,M.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function iY(){return this.options.unflatten=!0,this}function aY(Z,J){if(!M.defined(Z))this.options.gamma=2.2;else if(M.number(Z)&&M.inRange(Z,1,3))this.options.gamma=Z;else throw M.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!M.defined(J))this.options.gammaOut=this.options.gamma;else if(M.number(J)&&M.inRange(J,1,3))this.options.gammaOut=J;else throw M.invalidParameterError("gammaOut","number between 1.0 and 3.0",J);return this}function sY(Z){if(this.options.negate=M.bool(Z)?Z:!0,M.plainObject(Z)&&"alpha"in Z)if(!M.bool(Z.alpha))throw M.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function oY(Z){if(M.plainObject(Z)){if(M.defined(Z.lower))if(M.number(Z.lower)&&M.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw M.invalidParameterError("lower","number between 0 and 99",Z.lower);if(M.defined(Z.upper))if(M.number(Z.upper)&&M.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw M.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw M.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function tY(Z){return this.normalise(Z)}function eY(Z){if(M.plainObject(Z)){if(M.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw M.invalidParameterError("width","integer greater than zero",Z.width);if(M.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw M.invalidParameterError("height","integer greater than zero",Z.height);if(M.defined(Z.maxSlope))if(M.integer(Z.maxSlope)&&M.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw M.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw M.invalidParameterError("options","plain object",Z);return this}function Zz(Z){if(!M.object(Z)||!Array.isArray(Z.kernel)||!M.integer(Z.width)||!M.integer(Z.height)||!M.inRange(Z.width,3,1001)||!M.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!M.integer(Z.scale))Z.scale=Z.kernel.reduce((J,X)=>J+X,0);if(Z.scale<1)Z.scale=1;if(!M.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function Jz(Z,J){if(!M.defined(Z))this.options.threshold=128;else if(M.bool(Z))this.options.threshold=Z?128:0;else if(M.integer(Z)&&M.inRange(Z,0,255))this.options.threshold=Z;else throw M.invalidParameterError("threshold","integer between 0 and 255",Z);if(!M.object(J)||J.greyscale===!0||J.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function Xz(Z,J,X){if(this.options.boolean=this._createInputDescriptor(Z,X),M.string(J)&&M.inArray(J,["and","or","eor"]))this.options.booleanOp=J;else throw M.invalidParameterError("operator","one of: and, or, eor",J);return this}function Wz(Z,J){if(!M.defined(Z)&&M.number(J))Z=1;else if(M.number(Z)&&!M.defined(J))J=0;if(!M.defined(Z))this.options.linearA=[];else if(M.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(M.number))this.options.linearA=Z;else throw M.invalidParameterError("a","number or array of numbers",Z);if(!M.defined(J))this.options.linearB=[];else if(M.number(J))this.options.linearB=[J];else if(Array.isArray(J)&&J.length&&J.every(M.number))this.options.linearB=J;else throw M.invalidParameterError("b","number or array of numbers",J);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function qz(Z){if(!Array.isArray(Z))throw M.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw M.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let J=Z.flat().map(Number);if(J.length!==9&&J.length!==16)throw M.invalidParameterError("inputMatrix","cardinality of 9 or 16",J.length);return this.options.recombMatrix=J,this}function Qz(Z){if(!M.plainObject(Z))throw M.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(M.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw M.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(M.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw M.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(M.integer(Z.hue))this.options.hue=Z.hue%360;else throw M.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(M.number(Z.lightness))this.options.lightness=Z.lightness;else throw M.invalidParameterError("lightness","number",Z.lightness);return this}a8.exports=(Z)=>{Object.assign(Z.prototype,{autoOrient:fY,rotate:mY,flip:uY,flop:dY,affine:cY,sharpen:lY,erode:i8,dilate:r8,median:pY,blur:nY,flatten:rY,unflatten:iY,gamma:aY,negate:sY,normalise:oY,normalize:tY,clahe:eY,convolve:Zz,threshold:Jz,boolean:Xz,linear:Wz,recomb:qz,modulate:Qz})}});var XZ=S((DB,JZ)=>{var{defineProperty:t5,getOwnPropertyDescriptor:Gz,getOwnPropertyNames:Yz}=Object,zz=Object.prototype.hasOwnProperty,Uz=(Z,J)=>{for(var X in J)t5(Z,X,{get:J[X],enumerable:!0})},Kz=(Z,J,X,W)=>{if(J&&typeof J==="object"||typeof J==="function"){for(let q of Yz(J))if(!zz.call(Z,q)&&q!==X)t5(Z,q,{get:()=>J[q],enumerable:!(W=Gz(J,q))||W.enumerable})}return Z},Vz=(Z)=>Kz(t5({},"__esModule",{value:!0}),Z),o8={};Uz(o8,{default:()=>Rz});JZ.exports=Vz(o8);var i5={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in i5)Object.freeze(i5[Z]);var f0=Object.freeze(i5),t8=Object.create(null);for(let Z in f0)if(Object.hasOwn(f0,Z))t8[f0[Z]]=Z;var A0={to:{},get:{}};A0.get=function(Z){let J=Z.slice(0,3).toLowerCase(),X,W;switch(J){case"hsl":{X=A0.get.hsl(Z),W="hsl";break}case"hwb":{X=A0.get.hwb(Z),W="hwb";break}default:{X=A0.get.rgb(Z),W="rgb";break}}if(!X)return null;return{model:W,value:X}};A0.get.rgb=function(Z){if(!Z)return null;let J=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,W=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,q=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,Q=/^(\w+)$/,G=[0,0,0,1],z,Y,U;if(z=Z.match(X)){U=z[2],z=z[1];for(Y=0;Y<3;Y++){let K=Y*2;G[Y]=Number.parseInt(z.slice(K,K+2),16)}if(U)G[3]=Number.parseInt(U,16)/255}else if(z=Z.match(J)){z=z[1],U=z[3];for(Y=0;Y<3;Y++)G[Y]=Number.parseInt(z[Y]+z[Y],16);if(U)G[3]=Number.parseInt(U+U,16)/255}else if(z=Z.match(W)){for(Y=0;Y<3;Y++)G[Y]=Number.parseFloat(z[Y+1]);if(z[4])G[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.match(q)){for(Y=0;Y<3;Y++)G[Y]=Math.round(Number.parseFloat(z[Y+1])*2.55);if(z[4])G[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.toLowerCase().match(Q)){if(z[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(f0,z[1]))return null;return G=f0[z[1]].slice(),G[3]=1,G}else return null;for(Y=0;Y<3;Y++)G[Y]=W4(G[Y],0,255);return G[3]=W4(G[3],0,1),G};A0.get.hsl=function(Z){if(!Z)return null;let J=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(J);if(X){let W=Number.parseFloat(X[4]),q=(Number.parseFloat(X[1])%360+360)%360,Q=W4(Number.parseFloat(X[2]),0,100),G=W4(Number.parseFloat(X[3]),0,100),z=W4(Number.isNaN(W)?1:W,0,1);return[q,Q,G,z]}return null};A0.get.hwb=function(Z){if(!Z)return null;let J=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(J);if(X){let W=Number.parseFloat(X[4]),q=(Number.parseFloat(X[1])%360+360)%360,Q=W4(Number.parseFloat(X[2]),0,100),G=W4(Number.parseFloat(X[3]),0,100),z=W4(Number.isNaN(W)?1:W,0,1);return[q,Q,G,z]}return null};A0.to.hex=function(...Z){return"#"+M6(Z[0])+M6(Z[1])+M6(Z[2])+(Z[3]<1?M6(Math.round(Z[3]*255)):"")};A0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};A0.to.rgb.percent=function(...Z){let J=Math.round(Z[0]/255*100),X=Math.round(Z[1]/255*100),W=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+J+"%, "+X+"%, "+W+"%)":"rgba("+J+"%, "+X+"%, "+W+"%, "+Z[3]+")"};A0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};A0.to.hwb=function(...Z){let J="";if(Z.length>=4&&Z[3]!==1)J=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+J+")"};A0.to.keyword=function(...Z){return t8[Z.slice(0,3)]};function W4(Z,J,X){return Math.min(Math.max(J,Z),X)}function M6(Z){let J=Math.round(Z).toString(16).toUpperCase();return J.length<2?"0"+J:J}var l4=A0,e8={};for(let Z of Object.keys(f0))e8[f0[Z]]=Z;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},D4=T,i0=0.008856451679035631;function n4(Z){let J=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,J),1)}function r4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(T)){if(!("channels"in T[Z]))throw Error("missing channels property: "+Z);if(!("labels"in T[Z]))throw Error("missing channel labels property: "+Z);if(T[Z].labels.length!==T[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:J,labels:X}=T[Z];delete T[Z].channels,delete T[Z].labels,Object.defineProperty(T[Z],"channels",{value:J}),Object.defineProperty(T[Z],"labels",{value:X})}T.rgb.hsl=function(Z){let J=Z[0]/255,X=Z[1]/255,W=Z[2]/255,q=Math.min(J,X,W),Q=Math.max(J,X,W),G=Q-q,z,Y;switch(Q){case q:{z=0;break}case J:{z=(X-W)/G;break}case X:{z=2+(W-J)/G;break}case W:{z=4+(J-X)/G;break}}if(z=Math.min(z*60,360),z<0)z+=360;let U=(q+Q)/2;if(Q===q)Y=0;else if(U<=0.5)Y=G/(Q+q);else Y=G/(2-Q-q);return[z,Y*100,U*100]};T.rgb.hsv=function(Z){let J,X,W,q,Q,G=Z[0]/255,z=Z[1]/255,Y=Z[2]/255,U=Math.max(G,z,Y),K=U-Math.min(G,z,Y),V=function(B){return(U-B)/6/K+0.5};if(K===0)q=0,Q=0;else{switch(Q=K/U,J=V(G),X=V(z),W=V(Y),U){case G:{q=W-X;break}case z:{q=0.3333333333333333+J-W;break}case Y:{q=0.6666666666666666+X-J;break}}if(q<0)q+=1;else if(q>1)q-=1}return[q*360,Q*100,U*100]};T.rgb.hwb=function(Z){let J=Z[0],X=Z[1],W=Z[2],q=T.rgb.hsl(Z)[0],Q=0.00392156862745098*Math.min(J,Math.min(X,W));return W=1-0.00392156862745098*Math.max(J,Math.max(X,W)),[q,Q*100,W*100]};T.rgb.oklab=function(Z){let J=r4(Z[0]/255),X=r4(Z[1]/255),W=r4(Z[2]/255),q=Math.cbrt(0.4122214708*J+0.5363325363*X+0.0514459929*W),Q=Math.cbrt(0.2119034982*J+0.6806995451*X+0.1073969566*W),G=Math.cbrt(0.0883024619*J+0.2817188376*X+0.6299787005*W),z=0.2104542553*q+0.793617785*Q-0.0040720468*G,Y=1.9779984951*q-2.428592205*Q+0.4505937099*G,U=0.0259040371*q+0.7827717662*Q-0.808675766*G;return[z*100,Y*100,U*100]};T.rgb.cmyk=function(Z){let J=Z[0]/255,X=Z[1]/255,W=Z[2]/255,q=Math.min(1-J,1-X,1-W),Q=(1-J-q)/(1-q)||0,G=(1-X-q)/(1-q)||0,z=(1-W-q)/(1-q)||0;return[Q*100,G*100,z*100,q*100]};function Hz(Z,J){return(Z[0]-J[0])**2+(Z[1]-J[1])**2+(Z[2]-J[2])**2}T.rgb.keyword=function(Z){let J=e8[Z];if(J)return J;let X=Number.POSITIVE_INFINITY,W;for(let q of Object.keys(f0)){let Q=f0[q],G=Hz(Z,Q);if(G<X)X=G,W=q}return W};T.keyword.rgb=function(Z){return[...f0[Z]]};T.rgb.xyz=function(Z){let J=r4(Z[0]/255),X=r4(Z[1]/255),W=r4(Z[2]/255),q=J*0.4124564+X*0.3575761+W*0.1804375,Q=J*0.2126729+X*0.7151522+W*0.072175,G=J*0.0193339+X*0.119192+W*0.9503041;return[q*100,Q*100,G*100]};T.rgb.lab=function(Z){let J=T.rgb.xyz(Z),X=J[0],W=J[1],q=J[2];X/=95.047,W/=100,q/=108.883,X=X>i0?X**0.3333333333333333:7.787*X+0.13793103448275862,W=W>i0?W**0.3333333333333333:7.787*W+0.13793103448275862,q=q>i0?q**0.3333333333333333:7.787*q+0.13793103448275862;let Q=116*W-16,G=500*(X-W),z=200*(W-q);return[Q,G,z]};T.hsl.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,W=Z[2]/100,q,Q;if(X===0)return Q=W*255,[Q,Q,Q];let G=W<0.5?W*(1+X):W+X-W*X,z=2*W-G,Y=[0,0,0];for(let U=0;U<3;U++){if(q=J+0.3333333333333333*-(U-1),q<0)q++;if(q>1)q--;if(6*q<1)Q=z+(G-z)*6*q;else if(2*q<1)Q=G;else if(3*q<2)Q=z+(G-z)*(0.6666666666666666-q)*6;else Q=z;Y[U]=Q*255}return Y};T.hsl.hsv=function(Z){let J=Z[0],X=Z[1]/100,W=Z[2]/100,q=X,Q=Math.max(W,0.01);W*=2,X*=W<=1?W:2-W,q*=Q<=1?Q:2-Q;let G=(W+X)/2,z=W===0?2*q/(Q+q):2*X/(W+X);return[J,z*100,G*100]};T.hsv.rgb=function(Z){let J=Z[0]/60,X=Z[1]/100,W=Z[2]/100,q=Math.floor(J)%6,Q=J-Math.floor(J),G=255*W*(1-X),z=255*W*(1-X*Q),Y=255*W*(1-X*(1-Q));switch(W*=255,q){case 0:return[W,Y,G];case 1:return[z,W,G];case 2:return[G,W,Y];case 3:return[G,z,W];case 4:return[Y,G,W];case 5:return[W,G,z]}};T.hsv.hsl=function(Z){let J=Z[0],X=Z[1]/100,W=Z[2]/100,q=Math.max(W,0.01),Q,G;G=(2-X)*W;let z=(2-X)*q;return Q=X*q,Q/=z<=1?z:2-z,Q=Q||0,G/=2,[J,Q*100,G*100]};T.hwb.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,W=Z[2]/100,q=X+W,Q;if(q>1)X/=q,W/=q;let G=Math.floor(6*J),z=1-W;if(Q=6*J-G,(G&1)!==0)Q=1-Q;let Y=X+Q*(z-X),U,K,V;switch(G){default:case 6:case 0:{U=z,K=Y,V=X;break}case 1:{U=Y,K=z,V=X;break}case 2:{U=X,K=z,V=Y;break}case 3:{U=X,K=Y,V=z;break}case 4:{U=Y,K=X,V=z;break}case 5:{U=z,K=X,V=Y;break}}return[U*255,K*255,V*255]};T.cmyk.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,W=Z[2]/100,q=Z[3]/100,Q=1-Math.min(1,J*(1-q)+q),G=1-Math.min(1,X*(1-q)+q),z=1-Math.min(1,W*(1-q)+q);return[Q*255,G*255,z*255]};T.xyz.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,W=Z[2]/100,q,Q,G;return q=J*3.2404542+X*-1.5371385+W*-0.4985314,Q=J*-0.969266+X*1.8760108+W*0.041556,G=J*0.0556434+X*-0.2040259+W*1.0572252,q=n4(q),Q=n4(Q),G=n4(G),[q*255,Q*255,G*255]};T.xyz.lab=function(Z){let J=Z[0],X=Z[1],W=Z[2];J/=95.047,X/=100,W/=108.883,J=J>i0?J**0.3333333333333333:7.787*J+0.13793103448275862,X=X>i0?X**0.3333333333333333:7.787*X+0.13793103448275862,W=W>i0?W**0.3333333333333333:7.787*W+0.13793103448275862;let q=116*X-16,Q=500*(J-X),G=200*(X-W);return[q,Q,G]};T.xyz.oklab=function(Z){let J=Z[0]/100,X=Z[1]/100,W=Z[2]/100,q=Math.cbrt(0.8189330101*J+0.3618667424*X-0.1288597137*W),Q=Math.cbrt(0.0329845436*J+0.9293118715*X+0.0361456387*W),G=Math.cbrt(0.0482003018*J+0.2643662691*X+0.633851707*W),z=0.2104542553*q+0.793617785*Q-0.0040720468*G,Y=1.9779984951*q-2.428592205*Q+0.4505937099*G,U=0.0259040371*q+0.7827717662*Q-0.808675766*G;return[z*100,Y*100,U*100]};T.oklab.oklch=function(Z){return T.lab.lch(Z)};T.oklab.xyz=function(Z){let J=Z[0]/100,X=Z[1]/100,W=Z[2]/100,q=(0.999999998*J+0.396337792*X+0.215803758*W)**3,Q=(1.000000008*J-0.105561342*X-0.063854175*W)**3,G=(1.000000055*J-0.089484182*X-1.291485538*W)**3,z=1.227013851*q-0.55779998*Q+0.281256149*G,Y=-0.040580178*q+1.11225687*Q-0.071676679*G,U=-0.076381285*q-0.421481978*Q+1.58616322*G;return[z*100,Y*100,U*100]};T.oklab.rgb=function(Z){let J=Z[0]/100,X=Z[1]/100,W=Z[2]/100,q=(J+0.3963377774*X+0.2158037573*W)**3,Q=(J-0.1055613458*X-0.0638541728*W)**3,G=(J-0.0894841775*X-1.291485548*W)**3,z=n4(4.0767416621*q-3.3077115913*Q+0.2309699292*G),Y=n4(-1.2684380046*q+2.6097574011*Q-0.3413193965*G),U=n4(-0.0041960863*q-0.7034186147*Q+1.707614701*G);return[z*255,Y*255,U*255]};T.oklch.oklab=function(Z){return T.lch.lab(Z)};T.lab.xyz=function(Z){let J=Z[0],X=Z[1],W=Z[2],q,Q,G;Q=(J+16)/116,q=X/500+Q,G=Q-W/200;let z=Q**3,Y=q**3,U=G**3;return Q=z>i0?z:(Q-0.13793103448275862)/7.787,q=Y>i0?Y:(q-0.13793103448275862)/7.787,G=U>i0?U:(G-0.13793103448275862)/7.787,q*=95.047,Q*=100,G*=108.883,[q,Q,G]};T.lab.lch=function(Z){let J=Z[0],X=Z[1],W=Z[2],q;if(q=Math.atan2(W,X)*360/2/Math.PI,q<0)q+=360;let G=Math.sqrt(X*X+W*W);return[J,G,q]};T.lch.lab=function(Z){let J=Z[0],X=Z[1],q=Z[2]/360*2*Math.PI,Q=X*Math.cos(q),G=X*Math.sin(q);return[J,Q,G]};T.rgb.ansi16=function(Z,J=null){let[X,W,q]=Z,Q=J===null?T.rgb.hsv(Z)[2]:J;if(Q=Math.round(Q/50),Q===0)return 30;let G=30+(Math.round(q/255)<<2|Math.round(W/255)<<1|Math.round(X/255));if(Q===2)G+=60;return G};T.hsv.ansi16=function(Z){return T.rgb.ansi16(T.hsv.rgb(Z),Z[2])};T.rgb.ansi256=function(Z){let J=Z[0],X=Z[1],W=Z[2];if(J>>4===X>>4&&X>>4===W>>4){if(J<8)return 16;if(J>248)return 231;return Math.round((J-8)/247*24)+232}return 16+36*Math.round(J/255*5)+6*Math.round(X/255*5)+Math.round(W/255*5)};T.ansi16.rgb=function(Z){Z=Z[0];let J=Z%10;if(J===0||J===7){if(Z>50)J+=3.5;return J=J/10.5*255,[J,J,J]}let X=(Math.trunc(Z>50)+1)*0.5,W=(J&1)*X*255,q=(J>>1&1)*X*255,Q=(J>>2&1)*X*255;return[W,q,Q]};T.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let Q=(Z-232)*10+8;return[Q,Q,Q]}Z-=16;let J,X=Math.floor(Z/36)/5*255,W=Math.floor((J=Z%36)/6)/5*255,q=J%6/5*255;return[X,W,q]};T.rgb.hex=function(Z){let X=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};T.hex.rgb=function(Z){let J=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!J)return[0,0,0];let X=J[0];if(J[0].length===3)X=[...X].map((z)=>z+z).join("");let W=Number.parseInt(X,16),q=W>>16&255,Q=W>>8&255,G=W&255;return[q,Q,G]};T.rgb.hcg=function(Z){let J=Z[0]/255,X=Z[1]/255,W=Z[2]/255,q=Math.max(Math.max(J,X),W),Q=Math.min(Math.min(J,X),W),G=q-Q,z,Y=G<1?Q/(1-G):0;if(G<=0)z=0;else if(q===J)z=(X-W)/G%6;else if(q===X)z=2+(W-J)/G;else z=4+(J-X)/G;return z/=6,z%=1,[z*360,G*100,Y*100]};T.hsl.hcg=function(Z){let J=Z[1]/100,X=Z[2]/100,W=X<0.5?2*J*X:2*J*(1-X),q=0;if(W<1)q=(X-0.5*W)/(1-W);return[Z[0],W*100,q*100]};T.hsv.hcg=function(Z){let J=Z[1]/100,X=Z[2]/100,W=J*X,q=0;if(W<1)q=(X-W)/(1-W);return[Z[0],W*100,q*100]};T.hcg.rgb=function(Z){let J=Z[0]/360,X=Z[1]/100,W=Z[2]/100;if(X===0)return[W*255,W*255,W*255];let q=[0,0,0],Q=J%1*6,G=Q%1,z=1-G,Y=0;switch(Math.floor(Q)){case 0:{q[0]=1,q[1]=G,q[2]=0;break}case 1:{q[0]=z,q[1]=1,q[2]=0;break}case 2:{q[0]=0,q[1]=1,q[2]=G;break}case 3:{q[0]=0,q[1]=z,q[2]=1;break}case 4:{q[0]=G,q[1]=0,q[2]=1;break}default:q[0]=1,q[1]=0,q[2]=z}return Y=(1-X)*W,[(X*q[0]+Y)*255,(X*q[1]+Y)*255,(X*q[2]+Y)*255]};T.hcg.hsv=function(Z){let J=Z[1]/100,X=Z[2]/100,W=J+X*(1-J),q=0;if(W>0)q=J/W;return[Z[0],q*100,W*100]};T.hcg.hsl=function(Z){let J=Z[1]/100,W=Z[2]/100*(1-J)+0.5*J,q=0;if(W>0&&W<0.5)q=J/(2*W);else if(W>=0.5&&W<1)q=J/(2*(1-W));return[Z[0],q*100,W*100]};T.hcg.hwb=function(Z){let J=Z[1]/100,X=Z[2]/100,W=J+X*(1-J);return[Z[0],(W-J)*100,(1-W)*100]};T.hwb.hcg=function(Z){let J=Z[1]/100,W=1-Z[2]/100,q=W-J,Q=0;if(q<1)Q=(W-q)/(1-q);return[Z[0],q*100,Q*100]};T.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};T.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};T.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};T.gray.hsl=function(Z){return[0,0,Z[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(Z){return[0,100,Z[0]]};T.gray.cmyk=function(Z){return[0,0,0,Z[0]]};T.gray.lab=function(Z){return[Z[0],0,0]};T.gray.hex=function(Z){let J=Math.round(Z[0]/100*255)&255,W=((J<<16)+(J<<8)+J).toString(16).toUpperCase();return"000000".slice(W.length)+W};T.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function Bz(){let Z={},J=Object.keys(D4);for(let{length:X}=J,W=0;W<X;W++)Z[J[W]]={distance:-1,parent:null};return Z}function $z(Z){let J=Bz(),X=[Z];J[Z].distance=0;while(X.length>0){let W=X.pop(),q=Object.keys(D4[W]);for(let{length:Q}=q,G=0;G<Q;G++){let z=q[G],Y=J[z];if(Y.distance===-1)Y.distance=J[W].distance+1,Y.parent=W,X.unshift(z)}}return J}function Fz(Z,J){return function(X){return J(Z(X))}}function Mz(Z,J){let X=[J[Z].parent,Z],W=D4[J[Z].parent][Z],q=J[Z].parent;while(J[q].parent)X.unshift(J[q].parent),W=Fz(D4[J[q].parent][q],W),q=J[q].parent;return W.conversion=X,W}function Az(Z){let J=$z(Z),X={},W=Object.keys(J);for(let{length:q}=W,Q=0;Q<q;Q++){let G=W[Q];if(J[G].parent===null)continue;X[G]=Mz(G,J)}return X}var Lz=Az,p4={},Iz=Object.keys(D4);function Dz(Z){let J=function(...X){let W=X[0];if(W===void 0||W===null)return W;if(W.length>1)X=W;return Z(X)};if("conversion"in Z)J.conversion=Z.conversion;return J}function wz(Z){let J=function(...X){let W=X[0];if(W===void 0||W===null)return W;if(W.length>1)X=W;let q=Z(X);if(typeof q==="object")for(let{length:Q}=q,G=0;G<Q;G++)q[G]=Math.round(q[G]);return q};if("conversion"in Z)J.conversion=Z.conversion;return J}for(let Z of Iz){p4[Z]={},Object.defineProperty(p4[Z],"channels",{value:D4[Z].channels}),Object.defineProperty(p4[Z],"labels",{value:D4[Z].labels});let J=Lz(Z),X=Object.keys(J);for(let W of X){let q=J[W];p4[Z][W]=wz(q),p4[Z][W].raw=Dz(q)}}var w0=p4,ZZ=["keyword","gray","hex"],a5={};for(let Z of Object.keys(w0))a5[[...w0[Z].labels].sort().join("")]=Z;var s5={};function J0(Z,J){if(!(this instanceof J0))return new J0(Z,J);if(J&&J in ZZ)J=null;if(J&&!(J in w0))throw Error("Unknown model: "+J);let X,W;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof J0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let q=l4.get(Z);if(q===null)throw Error("Unable to parse color from string: "+Z);this.model=q.model,W=w0[this.model].channels,this.color=q.value.slice(0,W),this.valpha=typeof q.value[W]==="number"?q.value[W]:1}else if(Z.length>0){this.model=J||"rgb",W=w0[this.model].channels;let q=Array.prototype.slice.call(Z,0,W);this.color=o5(q,W),this.valpha=typeof Z[W]==="number"?Z[W]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let q=Object.keys(Z);if("alpha"in Z)q.splice(q.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let Q=q.sort().join("");if(!(Q in a5))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=a5[Q];let{labels:G}=w0[this.model],z=[];for(X=0;X<G.length;X++)z.push(Z[G[X]]);this.color=o5(z)}if(s5[this.model]){W=w0[this.model].channels;for(X=0;X<W;X++){let q=s5[this.model][X];if(q)this.color[X]=q(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}J0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let J=this.model in l4.to?this:this.rgb();J=J.round(typeof Z==="number"?Z:1);let X=J.valpha===1?J.color:[...J.color,this.valpha];return l4.to[J.model](...X)},percentString(Z){let J=this.rgb().round(typeof Z==="number"?Z:1),X=J.valpha===1?J.color:[...J.color,this.valpha];return l4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:J}=w0[this.model],{labels:X}=w0[this.model];for(let W=0;W<J;W++)Z[X[W]]=this.color[W];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new J0([...this.color.map(Tz(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new J0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:n("rgb",0,e(255)),green:n("rgb",1,e(255)),blue:n("rgb",2,e(255)),hue:n(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:n("hsl",1,e(100)),lightness:n("hsl",2,e(100)),saturationv:n("hsv",1,e(100)),value:n("hsv",2,e(100)),chroma:n("hcg",1,e(100)),gray:n("hcg",2,e(100)),white:n("hwb",1,e(100)),wblack:n("hwb",2,e(100)),cyan:n("cmyk",0,e(100)),magenta:n("cmyk",1,e(100)),yellow:n("cmyk",2,e(100)),black:n("cmyk",3,e(100)),x:n("xyz",0,e(95.047)),y:n("xyz",1,e(100)),z:n("xyz",2,e(108.833)),l:n("lab",0,e(100)),a:n("lab",1),b:n("lab",2),keyword(Z){if(Z!==void 0)return new J0(Z);return w0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new J0(Z);return l4.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new J0(Z);let J=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return l4.to.hex(...J)+X},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,J=[];for(let[X,W]of Z.entries()){let q=W/255;J[X]=q<=0.04045?q/12.92:((q+0.055)/1.055)**2.4}return 0.2126*J[0]+0.7152*J[1]+0.0722*J[2]},contrast(Z){let J=this.luminosity(),X=Z.luminosity();if(J>X)return(J+0.05)/(X+0.05);return(X+0.05)/(J+0.05)},level(Z){let J=this.contrast(Z);if(J>=7)return"AAA";return J>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let J=0;J<3;J++)Z.color[J]=255-Z.color[J];return Z},lighten(Z){let J=this.hsl();return J.color[2]+=J.color[2]*Z,J},darken(Z){let J=this.hsl();return J.color[2]-=J.color[2]*Z,J},saturate(Z){let J=this.hsl();return J.color[1]+=J.color[1]*Z,J},desaturate(Z){let J=this.hsl();return J.color[1]-=J.color[1]*Z,J},whiten(Z){let J=this.hwb();return J.color[1]+=J.color[1]*Z,J},blacken(Z){let J=this.hwb();return J.color[2]+=J.color[2]*Z,J},grayscale(){let Z=this.rgb().color,J=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return J0.rgb(J,J,J)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let J=this.hsl(),X=J.color[0];return X=(X+Z)%360,X=X<0?360+X:X,J.color[0]=X,J},mix(Z,J){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let X=Z.rgb(),W=this.rgb(),q=J===void 0?0.5:J,Q=2*q-1,G=X.alpha()-W.alpha(),z=((Q*G===-1?Q:(Q+G)/(1+Q*G))+1)/2,Y=1-z;return J0.rgb(z*X.red()+Y*W.red(),z*X.green()+Y*W.green(),z*X.blue()+Y*W.blue(),X.alpha()*q+W.alpha()*(1-q))}};for(let Z of Object.keys(w0)){if(ZZ.includes(Z))continue;let{channels:J}=w0[Z];J0.prototype[Z]=function(...X){if(this.model===Z)return new J0(this);if(X.length>0)return new J0(X,Z);return new J0([...Pz(w0[this.model][Z].raw(this.color)),this.valpha],Z)},J0[Z]=function(...X){let W=X[0];if(typeof W==="number")W=o5(X,J);return new J0(W,Z)}}function Nz(Z,J){return Number(Z.toFixed(J))}function Tz(Z){return function(J){return Nz(J,Z)}}function n(Z,J,X){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(s5[W]||=[])[J]=X;return Z=Z[0],function(W){let q;if(W!==void 0){if(X)W=X(W);return q=this[Z](),q.color[J]=W,q}if(q=this[Z]().color[J],X)q=X(q);return q}}function e(Z){return function(J){return Math.max(0,Math.min(Z,J))}}function Pz(Z){return Array.isArray(Z)?Z:[Z]}function o5(Z,J){for(let X=0;X<J;X++)if(typeof Z[X]!=="number")Z[X]=0;return Z}var Rz=J0});var qZ=S((wB,WZ)=>{WZ.exports=XZ().default});var zZ=S((NB,YZ)=>{/*!
225
+ */TX={integer:"integer",float:"float",approximate:"approximate"}});var SX=E((pM,kX)=>{var{defineProperty:j3,getOwnPropertyDescriptor:RV,getOwnPropertyNames:_V}=Object,PV=Object.prototype.hasOwnProperty,jV=(Z,X)=>{for(var q in X)j3(Z,q,{get:X[q],enumerable:!0})},EV=(Z,X,q,W)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let Q of _V(X))if(!PV.call(Z,Q)&&Q!==q)j3(Z,Q,{get:()=>X[Q],enumerable:!(W=RV(X,Q))||W.enumerable})}return Z},CV=(Z)=>EV(j3({},"__esModule",{value:!0}),Z),EX={};jV(EX,{default:()=>cV});kX.exports=CV(EX);var T3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in T3)Object.freeze(T3[Z]);var p0=Object.freeze(T3),CX=Object.create(null);for(let Z in p0)if(Object.hasOwn(p0,Z))CX[p0[Z]]=Z;var A0={to:{},get:{}};A0.get=function(Z){let X=Z.slice(0,3).toLowerCase(),q,W;switch(X){case"hsl":{q=A0.get.hsl(Z),W="hsl";break}case"hwb":{q=A0.get.hwb(Z),W="hwb";break}default:{q=A0.get.rgb(Z),W="rgb";break}}if(!q)return null;return{model:W,value:q}};A0.get.rgb=function(Z){if(!Z)return null;let X=/^#([a-f\d]{3,4})$/i,q=/^#([a-f\d]{6})([a-f\d]{2})?$/i,W=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,Q=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,J=/^(\w+)$/,z=[0,0,0,1],Y,U,K;if(Y=Z.match(q)){K=Y[2],Y=Y[1];for(U=0;U<3;U++){let V=U*2;z[U]=Number.parseInt(Y.slice(V,V+2),16)}if(K)z[3]=Number.parseInt(K,16)/255}else if(Y=Z.match(X)){Y=Y[1],K=Y[3];for(U=0;U<3;U++)z[U]=Number.parseInt(Y[U]+Y[U],16);if(K)z[3]=Number.parseInt(K+K,16)/255}else if(Y=Z.match(W)){for(U=0;U<3;U++)z[U]=Number.parseFloat(Y[U+1]);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.match(Q)){for(U=0;U<3;U++)z[U]=Math.round(Number.parseFloat(Y[U+1])*2.55);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.toLowerCase().match(J)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(p0,Y[1]))return null;return z=p0[Y[1]].slice(),z[3]=1,z}else return null;for(U=0;U<3;U++)z[U]=F6(z[U],0,255);return z[3]=F6(z[3],0,1),z};A0.get.hsl=function(Z){if(!Z)return null;let X=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.get.hwb=function(Z){if(!Z)return null;let X=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.to.hex=function(...Z){return"#"+y1(Z[0])+y1(Z[1])+y1(Z[2])+(Z[3]<1?y1(Math.round(Z[3]*255)):"")};A0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};A0.to.rgb.percent=function(...Z){let X=Math.round(Z[0]/255*100),q=Math.round(Z[1]/255*100),W=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+X+"%, "+q+"%, "+W+"%)":"rgba("+X+"%, "+q+"%, "+W+"%, "+Z[3]+")"};A0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};A0.to.hwb=function(...Z){let X="";if(Z.length>=4&&Z[3]!==1)X=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+X+")"};A0.to.keyword=function(...Z){return CX[Z.slice(0,3)]};function F6(Z,X,q){return Math.min(Math.max(X,Z),q)}function y1(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var W4=A0,OX={};for(let Z of Object.keys(p0))OX[p0[Z]]=Z;var w={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},k6=w,W6=0.008856451679035631;function J4(Z){let X=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,X),1)}function z4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(w)){if(!("channels"in w[Z]))throw Error("missing channels property: "+Z);if(!("labels"in w[Z]))throw Error("missing channel labels property: "+Z);if(w[Z].labels.length!==w[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:q}=w[Z];delete w[Z].channels,delete w[Z].labels,Object.defineProperty(w[Z],"channels",{value:X}),Object.defineProperty(w[Z],"labels",{value:q})}w.rgb.hsl=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(X,q,W),J=Math.max(X,q,W),z=J-Q,Y,U;switch(J){case Q:{Y=0;break}case X:{Y=(q-W)/z;break}case q:{Y=2+(W-X)/z;break}case W:{Y=4+(X-q)/z;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let K=(Q+J)/2;if(J===Q)U=0;else if(K<=0.5)U=z/(J+Q);else U=z/(2-J-Q);return[Y,U*100,K*100]};w.rgb.hsv=function(Z){let X,q,W,Q,J,z=Z[0]/255,Y=Z[1]/255,U=Z[2]/255,K=Math.max(z,Y,U),V=K-Math.min(z,Y,U),B=function(H){return(K-H)/6/V+0.5};if(V===0)Q=0,J=0;else{switch(J=V/K,X=B(z),q=B(Y),W=B(U),K){case z:{Q=W-q;break}case Y:{Q=0.3333333333333333+X-W;break}case U:{Q=0.6666666666666666+q-X;break}}if(Q<0)Q+=1;else if(Q>1)Q-=1}return[Q*360,J*100,K*100]};w.rgb.hwb=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q=w.rgb.hsl(Z)[0],J=0.00392156862745098*Math.min(X,Math.min(q,W));return W=1-0.00392156862745098*Math.max(X,Math.max(q,W)),[Q,J*100,W*100]};w.rgb.oklab=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=Math.cbrt(0.4122214708*X+0.5363325363*q+0.0514459929*W),J=Math.cbrt(0.2119034982*X+0.6806995451*q+0.1073969566*W),z=Math.cbrt(0.0883024619*X+0.2817188376*q+0.6299787005*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.rgb.cmyk=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(1-X,1-q,1-W),J=(1-X-Q)/(1-Q)||0,z=(1-q-Q)/(1-Q)||0,Y=(1-W-Q)/(1-Q)||0;return[J*100,z*100,Y*100,Q*100]};function OV(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}w.rgb.keyword=function(Z){let X=OX[Z];if(X)return X;let q=Number.POSITIVE_INFINITY,W;for(let Q of Object.keys(p0)){let J=p0[Q],z=OV(Z,J);if(z<q)q=z,W=Q}return W};w.keyword.rgb=function(Z){return[...p0[Z]]};w.rgb.xyz=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=X*0.4124564+q*0.3575761+W*0.1804375,J=X*0.2126729+q*0.7151522+W*0.072175,z=X*0.0193339+q*0.119192+W*0.9503041;return[Q*100,J*100,z*100]};w.rgb.lab=function(Z){let X=w.rgb.xyz(Z),q=X[0],W=X[1],Q=X[2];q/=95.047,W/=100,Q/=108.883,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862,Q=Q>W6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*W-16,z=500*(q-W),Y=200*(W-Q);return[J,z,Y]};w.hsl.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q,J;if(q===0)return J=W*255,[J,J,J];let z=W<0.5?W*(1+q):W+q-W*q,Y=2*W-z,U=[0,0,0];for(let K=0;K<3;K++){if(Q=X+0.3333333333333333*-(K-1),Q<0)Q++;if(Q>1)Q--;if(6*Q<1)J=Y+(z-Y)*6*Q;else if(2*Q<1)J=z;else if(3*Q<2)J=Y+(z-Y)*(0.6666666666666666-Q)*6;else J=Y;U[K]=J*255}return U};w.hsl.hsv=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=q,J=Math.max(W,0.01);W*=2,q*=W<=1?W:2-W,Q*=J<=1?J:2-J;let z=(W+q)/2,Y=W===0?2*Q/(J+Q):2*q/(W+q);return[X,Y*100,z*100]};w.hsv.rgb=function(Z){let X=Z[0]/60,q=Z[1]/100,W=Z[2]/100,Q=Math.floor(X)%6,J=X-Math.floor(X),z=255*W*(1-q),Y=255*W*(1-q*J),U=255*W*(1-q*(1-J));switch(W*=255,Q){case 0:return[W,U,z];case 1:return[Y,W,z];case 2:return[z,W,U];case 3:return[z,Y,W];case 4:return[U,z,W];case 5:return[W,z,Y]}};w.hsv.hsl=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=Math.max(W,0.01),J,z;z=(2-q)*W;let Y=(2-q)*Q;return J=q*Q,J/=Y<=1?Y:2-Y,J=J||0,z/=2,[X,J*100,z*100]};w.hwb.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q=q+W,J;if(Q>1)q/=Q,W/=Q;let z=Math.floor(6*X),Y=1-W;if(J=6*X-z,(z&1)!==0)J=1-J;let U=q+J*(Y-q),K,V,B;switch(z){default:case 6:case 0:{K=Y,V=U,B=q;break}case 1:{K=U,V=Y,B=q;break}case 2:{K=q,V=Y,B=U;break}case 3:{K=q,V=U,B=Y;break}case 4:{K=U,V=q,B=Y;break}case 5:{K=Y,V=q,B=U;break}}return[K*255,V*255,B*255]};w.cmyk.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Z[3]/100,J=1-Math.min(1,X*(1-Q)+Q),z=1-Math.min(1,q*(1-Q)+Q),Y=1-Math.min(1,W*(1-Q)+Q);return[J*255,z*255,Y*255]};w.xyz.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q,J,z;return Q=X*3.2404542+q*-1.5371385+W*-0.4985314,J=X*-0.969266+q*1.8760108+W*0.041556,z=X*0.0556434+q*-0.2040259+W*1.0572252,Q=J4(Q),J=J4(J),z=J4(z),[Q*255,J*255,z*255]};w.xyz.lab=function(Z){let X=Z[0],q=Z[1],W=Z[2];X/=95.047,q/=100,W/=108.883,X=X>W6?X**0.3333333333333333:7.787*X+0.13793103448275862,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862;let Q=116*q-16,J=500*(X-q),z=200*(q-W);return[Q,J,z]};w.xyz.oklab=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Math.cbrt(0.8189330101*X+0.3618667424*q-0.1288597137*W),J=Math.cbrt(0.0329845436*X+0.9293118715*q+0.0361456387*W),z=Math.cbrt(0.0482003018*X+0.2643662691*q+0.633851707*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.oklab.oklch=function(Z){return w.lab.lch(Z)};w.oklab.xyz=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(0.999999998*X+0.396337792*q+0.215803758*W)**3,J=(1.000000008*X-0.105561342*q-0.063854175*W)**3,z=(1.000000055*X-0.089484182*q-1.291485538*W)**3,Y=1.227013851*Q-0.55779998*J+0.281256149*z,U=-0.040580178*Q+1.11225687*J-0.071676679*z,K=-0.076381285*Q-0.421481978*J+1.58616322*z;return[Y*100,U*100,K*100]};w.oklab.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(X+0.3963377774*q+0.2158037573*W)**3,J=(X-0.1055613458*q-0.0638541728*W)**3,z=(X-0.0894841775*q-1.291485548*W)**3,Y=J4(4.0767416621*Q-3.3077115913*J+0.2309699292*z),U=J4(-1.2684380046*Q+2.6097574011*J-0.3413193965*z),K=J4(-0.0041960863*Q-0.7034186147*J+1.707614701*z);return[Y*255,U*255,K*255]};w.oklch.oklab=function(Z){return w.lch.lab(Z)};w.lab.xyz=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q,J,z;J=(X+16)/116,Q=q/500+J,z=J-W/200;let Y=J**3,U=Q**3,K=z**3;return J=Y>W6?Y:(J-0.13793103448275862)/7.787,Q=U>W6?U:(Q-0.13793103448275862)/7.787,z=K>W6?K:(z-0.13793103448275862)/7.787,Q*=95.047,J*=100,z*=108.883,[Q,J,z]};w.lab.lch=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q;if(Q=Math.atan2(W,q)*360/2/Math.PI,Q<0)Q+=360;let z=Math.sqrt(q*q+W*W);return[X,z,Q]};w.lch.lab=function(Z){let X=Z[0],q=Z[1],Q=Z[2]/360*2*Math.PI,J=q*Math.cos(Q),z=q*Math.sin(Q);return[X,J,z]};w.rgb.ansi16=function(Z,X=null){let[q,W,Q]=Z,J=X===null?w.rgb.hsv(Z)[2]:X;if(J=Math.round(J/50),J===0)return 30;let z=30+(Math.round(Q/255)<<2|Math.round(W/255)<<1|Math.round(q/255));if(J===2)z+=60;return z};w.hsv.ansi16=function(Z){return w.rgb.ansi16(w.hsv.rgb(Z),Z[2])};w.rgb.ansi256=function(Z){let X=Z[0],q=Z[1],W=Z[2];if(X>>4===q>>4&&q>>4===W>>4){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(q/255*5)+Math.round(W/255*5)};w.ansi16.rgb=function(Z){Z=Z[0];let X=Z%10;if(X===0||X===7){if(Z>50)X+=3.5;return X=X/10.5*255,[X,X,X]}let q=(Math.trunc(Z>50)+1)*0.5,W=(X&1)*q*255,Q=(X>>1&1)*q*255,J=(X>>2&1)*q*255;return[W,Q,J]};w.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let J=(Z-232)*10+8;return[J,J,J]}Z-=16;let X,q=Math.floor(Z/36)/5*255,W=Math.floor((X=Z%36)/6)/5*255,Q=X%6/5*255;return[q,W,Q]};w.rgb.hex=function(Z){let q=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(q.length)+q};w.hex.rgb=function(Z){let X=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!X)return[0,0,0];let q=X[0];if(X[0].length===3)q=[...q].map((Y)=>Y+Y).join("");let W=Number.parseInt(q,16),Q=W>>16&255,J=W>>8&255,z=W&255;return[Q,J,z]};w.rgb.hcg=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.max(Math.max(X,q),W),J=Math.min(Math.min(X,q),W),z=Q-J,Y,U=z<1?J/(1-z):0;if(z<=0)Y=0;else if(Q===X)Y=(q-W)/z%6;else if(Q===q)Y=2+(W-X)/z;else Y=4+(X-q)/z;return Y/=6,Y%=1,[Y*360,z*100,U*100]};w.hsl.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=q<0.5?2*X*q:2*X*(1-q),Q=0;if(W<1)Q=(q-0.5*W)/(1-W);return[Z[0],W*100,Q*100]};w.hsv.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X*q,Q=0;if(W<1)Q=(q-W)/(1-W);return[Z[0],W*100,Q*100]};w.hcg.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100;if(q===0)return[W*255,W*255,W*255];let Q=[0,0,0],J=X%1*6,z=J%1,Y=1-z,U=0;switch(Math.floor(J)){case 0:{Q[0]=1,Q[1]=z,Q[2]=0;break}case 1:{Q[0]=Y,Q[1]=1,Q[2]=0;break}case 2:{Q[0]=0,Q[1]=1,Q[2]=z;break}case 3:{Q[0]=0,Q[1]=Y,Q[2]=1;break}case 4:{Q[0]=z,Q[1]=0,Q[2]=1;break}default:Q[0]=1,Q[1]=0,Q[2]=Y}return U=(1-q)*W,[(q*Q[0]+U)*255,(q*Q[1]+U)*255,(q*Q[2]+U)*255]};w.hcg.hsv=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X),Q=0;if(W>0)Q=X/W;return[Z[0],Q*100,W*100]};w.hcg.hsl=function(Z){let X=Z[1]/100,W=Z[2]/100*(1-X)+0.5*X,Q=0;if(W>0&&W<0.5)Q=X/(2*W);else if(W>=0.5&&W<1)Q=X/(2*(1-W));return[Z[0],Q*100,W*100]};w.hcg.hwb=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X);return[Z[0],(W-X)*100,(1-W)*100]};w.hwb.hcg=function(Z){let X=Z[1]/100,W=1-Z[2]/100,Q=W-X,J=0;if(Q<1)J=(W-Q)/(1-Q);return[Z[0],Q*100,J*100]};w.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};w.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};w.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};w.gray.hsl=function(Z){return[0,0,Z[0]]};w.gray.hsv=w.gray.hsl;w.gray.hwb=function(Z){return[0,100,Z[0]]};w.gray.cmyk=function(Z){return[0,0,0,Z[0]]};w.gray.lab=function(Z){return[Z[0],0,0]};w.gray.hex=function(Z){let X=Math.round(Z[0]/100*255)&255,W=((X<<16)+(X<<8)+X).toString(16).toUpperCase();return"000000".slice(W.length)+W};w.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function xV(){let Z={},X=Object.keys(k6);for(let{length:q}=X,W=0;W<q;W++)Z[X[W]]={distance:-1,parent:null};return Z}function kV(Z){let X=xV(),q=[Z];X[Z].distance=0;while(q.length>0){let W=q.pop(),Q=Object.keys(k6[W]);for(let{length:J}=Q,z=0;z<J;z++){let Y=Q[z],U=X[Y];if(U.distance===-1)U.distance=X[W].distance+1,U.parent=W,q.unshift(Y)}}return X}function SV(Z,X){return function(q){return X(Z(q))}}function bV(Z,X){let q=[X[Z].parent,Z],W=k6[X[Z].parent][Z],Q=X[Z].parent;while(X[Q].parent)q.unshift(X[Q].parent),W=SV(k6[X[Q].parent][Q],W),Q=X[Q].parent;return W.conversion=q,W}function vV(Z){let X=kV(Z),q={},W=Object.keys(X);for(let{length:Q}=W,J=0;J<Q;J++){let z=W[J];if(X[z].parent===null)continue;q[z]=bV(z,X)}return q}var yV=vV,Q4={},gV=Object.keys(k6);function hV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;return Z(q)};if("conversion"in Z)X.conversion=Z.conversion;return X}function mV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;let Q=Z(q);if(typeof Q==="object")for(let{length:J}=Q,z=0;z<J;z++)Q[z]=Math.round(Q[z]);return Q};if("conversion"in Z)X.conversion=Z.conversion;return X}for(let Z of gV){Q4[Z]={},Object.defineProperty(Q4[Z],"channels",{value:k6[Z].channels}),Object.defineProperty(Q4[Z],"labels",{value:k6[Z].labels});let X=yV(Z),q=Object.keys(X);for(let W of q){let Q=X[W];Q4[Z][W]=mV(Q),Q4[Z][W].raw=hV(Q)}}var D0=Q4,xX=["keyword","gray","hex"],R3={};for(let Z of Object.keys(D0))R3[[...D0[Z].labels].sort().join("")]=Z;var _3={};function Z0(Z,X){if(!(this instanceof Z0))return new Z0(Z,X);if(X&&X in xX)X=null;if(X&&!(X in D0))throw Error("Unknown model: "+X);let q,W;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof Z0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let Q=W4.get(Z);if(Q===null)throw Error("Unable to parse color from string: "+Z);this.model=Q.model,W=D0[this.model].channels,this.color=Q.value.slice(0,W),this.valpha=typeof Q.value[W]==="number"?Q.value[W]:1}else if(Z.length>0){this.model=X||"rgb",W=D0[this.model].channels;let Q=Array.prototype.slice.call(Z,0,W);this.color=P3(Q,W),this.valpha=typeof Z[W]==="number"?Z[W]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let Q=Object.keys(Z);if("alpha"in Z)Q.splice(Q.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let J=Q.sort().join("");if(!(J in R3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=R3[J];let{labels:z}=D0[this.model],Y=[];for(q=0;q<z.length;q++)Y.push(Z[z[q]]);this.color=P3(Y)}if(_3[this.model]){W=D0[this.model].channels;for(q=0;q<W;q++){let Q=_3[this.model][q];if(Q)this.color[q]=Q(this.color[q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}Z0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in W4.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to[X.model](...q)},percentString(Z){let X=this.rgb().round(typeof Z==="number"?Z:1),q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to.rgb.percent(...q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=D0[this.model],{labels:q}=D0[this.model];for(let W=0;W<X;W++)Z[q[W]]=this.color[W];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new Z0([...this.color.map(uV(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new Z0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:c("rgb",0,t(255)),green:c("rgb",1,t(255)),blue:c("rgb",2,t(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:c("hsl",1,t(100)),lightness:c("hsl",2,t(100)),saturationv:c("hsv",1,t(100)),value:c("hsv",2,t(100)),chroma:c("hcg",1,t(100)),gray:c("hcg",2,t(100)),white:c("hwb",1,t(100)),wblack:c("hwb",2,t(100)),cyan:c("cmyk",0,t(100)),magenta:c("cmyk",1,t(100)),yellow:c("cmyk",2,t(100)),black:c("cmyk",3,t(100)),x:c("xyz",0,t(95.047)),y:c("xyz",1,t(100)),z:c("xyz",2,t(108.833)),l:c("lab",0,t(100)),a:c("lab",1),b:c("lab",2),keyword(Z){if(Z!==void 0)return new Z0(Z);return D0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new Z0(Z);return W4.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new Z0(Z);let X=this.rgb().round().color,q=Math.round(this.valpha*255).toString(16).toUpperCase();if(q.length===1)q="0"+q;return W4.to.hex(...X)+q},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,X=[];for(let[q,W]of Z.entries()){let Q=W/255;X[q]=Q<=0.04045?Q/12.92:((Q+0.055)/1.055)**2.4}return 0.2126*X[0]+0.7152*X[1]+0.0722*X[2]},contrast(Z){let X=this.luminosity(),q=Z.luminosity();if(X>q)return(X+0.05)/(q+0.05);return(q+0.05)/(X+0.05)},level(Z){let X=this.contrast(Z);if(X>=7)return"AAA";return X>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let X=0;X<3;X++)Z.color[X]=255-Z.color[X];return Z},lighten(Z){let X=this.hsl();return X.color[2]+=X.color[2]*Z,X},darken(Z){let X=this.hsl();return X.color[2]-=X.color[2]*Z,X},saturate(Z){let X=this.hsl();return X.color[1]+=X.color[1]*Z,X},desaturate(Z){let X=this.hsl();return X.color[1]-=X.color[1]*Z,X},whiten(Z){let X=this.hwb();return X.color[1]+=X.color[1]*Z,X},blacken(Z){let X=this.hwb();return X.color[2]+=X.color[2]*Z,X},grayscale(){let Z=this.rgb().color,X=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return Z0.rgb(X,X,X)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let X=this.hsl(),q=X.color[0];return q=(q+Z)%360,q=q<0?360+q:q,X.color[0]=q,X},mix(Z,X){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let q=Z.rgb(),W=this.rgb(),Q=X===void 0?0.5:X,J=2*Q-1,z=q.alpha()-W.alpha(),Y=((J*z===-1?J:(J+z)/(1+J*z))+1)/2,U=1-Y;return Z0.rgb(Y*q.red()+U*W.red(),Y*q.green()+U*W.green(),Y*q.blue()+U*W.blue(),q.alpha()*Q+W.alpha()*(1-Q))}};for(let Z of Object.keys(D0)){if(xX.includes(Z))continue;let{channels:X}=D0[Z];Z0.prototype[Z]=function(...q){if(this.model===Z)return new Z0(this);if(q.length>0)return new Z0(q,Z);return new Z0([...dV(D0[this.model][Z].raw(this.color)),this.valpha],Z)},Z0[Z]=function(...q){let W=q[0];if(typeof W==="number")W=P3(q,X);return new Z0(W,Z)}}function fV(Z,X){return Number(Z.toFixed(X))}function uV(Z){return function(X){return fV(X,Z)}}function c(Z,X,q){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(_3[W]||=[])[X]=q;return Z=Z[0],function(W){let Q;if(W!==void 0){if(q)W=q(W);return Q=this[Z](),Q.color[X]=W,Q}if(Q=this[Z]().color[X],q)Q=q(Q);return Q}}function t(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function dV(Z){return Array.isArray(Z)?Z:[Z]}function P3(Z,X){for(let q=0;q<X;q++)if(typeof Z[q]!=="number")Z[q]=0;return Z}var cV=Z0});var vX=E((nM,bX)=>{bX.exports=SX().default});function lV(Z){return this._setBackgroundColourOption("tint",Z),this}function pV(Z){return this.options.greyscale=G.bool(Z)?Z:!0,this}function nV(Z){return this.greyscale(Z)}function iV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function rV(Z){return this.pipelineColourspace(Z)}function aV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function sV(Z){return this.toColourspace(Z)}function hX(Z){if(G.object(Z)||G.string(Z)&&Z.length>=3&&Z.length<=200){let X=gX.default(Z);return[X.red(),X.green(),X.blue(),Math.round(X.alpha()*255)]}else throw G.invalidParameterError("background","object or string",Z)}function oV(Z,X){if(G.defined(X))this.options[Z]=hX(X)}var gX,yX,mX=(Z)=>{Object.assign(Z.prototype,{tint:lV,greyscale:pV,grayscale:nV,pipelineColourspace:iV,pipelineColorspace:rV,toColourspace:aV,toColorspace:sV,_getBackgroundColourOption:hX,_setBackgroundColourOption:oV}),Z.colourspace=yX,Z.colorspace=yX};var fX=R(()=>{m0();gX=B4(vX(),1);/*!
221
226
  Copyright 2013 Lovell Fuller and others.
222
227
  SPDX-License-Identifier: Apache-2.0
223
- */var jz=qZ(),a0=v0(),QZ={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function _z(Z){return this._setBackgroundColourOption("tint",Z),this}function Cz(Z){return this.options.greyscale=a0.bool(Z)?Z:!0,this}function Ez(Z){return this.greyscale(Z)}function Oz(Z){if(!a0.string(Z))throw a0.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function xz(Z){return this.pipelineColourspace(Z)}function kz(Z){if(!a0.string(Z))throw a0.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function Sz(Z){return this.toColourspace(Z)}function GZ(Z){if(a0.object(Z)||a0.string(Z)&&Z.length>=3&&Z.length<=200){let J=jz(Z);return[J.red(),J.green(),J.blue(),Math.round(J.alpha()*255)]}else throw a0.invalidParameterError("background","object or string",Z)}function bz(Z,J){if(a0.defined(J))this.options[Z]=GZ(J)}YZ.exports=(Z)=>{Object.assign(Z.prototype,{tint:_z,greyscale:Cz,grayscale:Ez,pipelineColourspace:Oz,pipelineColorspace:xz,toColourspace:kz,toColorspace:Sz,_getBackgroundColourOption:GZ,_setBackgroundColourOption:bz}),Z.colourspace=QZ,Z.colorspace=QZ}});var KZ=S((TB,UZ)=>{/*!
228
+ */yX={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function eV(){return this.options.removeAlpha=!0,this}function ZB(Z){if(G.defined(Z))if(G.number(Z)&&G.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw G.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function XB(Z){let X={red:0,green:1,blue:2,alpha:3};if(Object.keys(X).includes(Z))Z=X[Z];if(G.integer(Z)&&G.inRange(Z,0,4))this.options.extractChannel=Z;else throw G.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function qB(Z,X){if(Array.isArray(Z))Z.forEach(function(q){this.options.joinChannelIn.push(this._createInputDescriptor(q,X))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,X));return this}function WB(Z){if(G.string(Z)&&G.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw G.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var tV,uX=(Z)=>{Object.assign(Z.prototype,{removeAlpha:eV,ensureAlpha:ZB,extractChannel:XB,joinChannel:qB,bandbool:WB}),Z.bool=tV};var dX=R(()=>{m0();/*!
224
229
  Copyright 2013 Lovell Fuller and others.
225
230
  SPDX-License-Identifier: Apache-2.0
226
- */var u0=v0(),vz={and:"and",or:"or",eor:"eor"};function yz(){return this.options.removeAlpha=!0,this}function gz(Z){if(u0.defined(Z))if(u0.number(Z)&&u0.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw u0.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function hz(Z){let J={red:0,green:1,blue:2,alpha:3};if(Object.keys(J).includes(Z))Z=J[Z];if(u0.integer(Z)&&u0.inRange(Z,0,4))this.options.extractChannel=Z;else throw u0.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function mz(Z,J){if(Array.isArray(Z))Z.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,J))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,J));return this}function fz(Z){if(u0.string(Z)&&u0.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw u0.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}UZ.exports=(Z)=>{Object.assign(Z.prototype,{removeAlpha:yz,ensureAlpha:gz,extractChannel:hz,joinChannel:mz,bandbool:fz}),Z.bool=vz}});var FZ=S((PB,$Z)=>{/*!
231
+ */tV={and:"and",or:"or",eor:"eor"}});import E3 from"node:path";function JB(Z,X){let q;if(!G.string(Z))q=Error("Missing output file path");else if(G.string(this.options.input.file)&&E3.resolve(this.options.input.file)===E3.resolve(Z))q=Error("Cannot use same file for input and output");else if(QB.test(E3.extname(Z))&&!this.constructor.format.jp2.output.file)q=lX();if(q)if(G.fn(X))X(q);else return Promise.reject(q);else{this.options.fileOut=Z;let W=Error();return this._pipeline(X,W)}return this}function zB(Z,X){if(G.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let q=Error();return this._pipeline(G.fn(Z)?Z:X,q)}function GB(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function YB(Z){if(G.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw G.invalidParameterError("density","positive number",Z);return this.keepExif()}function UB(){return this.options.keepMetadata|=1,this}function KB(Z){if(G.object(Z))for(let[X,q]of Object.entries(Z))if(G.object(q))for(let[W,Q]of Object.entries(q))if(G.string(Q))this.options.withExif[`exif-${X.toLowerCase()}-${W}`]=Q;else throw G.invalidParameterError(`${X}.${W}`,"string",Q);else throw G.invalidParameterError(X,"object",q);else throw G.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function VB(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function BB(){return this.options.keepMetadata|=8,this}function HB(Z,X){if(G.string(Z))this.options.withIccProfile=Z;else throw G.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),G.object(X)){if(G.defined(X.attach))if(G.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw G.invalidParameterError("attach","boolean",X.attach)}return this}function $B(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function FB(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function AB(){return this.options.keepMetadata|=2,this}function MB(Z){if(G.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw G.invalidParameterError("xmp","non-empty string",Z);return this}function LB(){return this.options.keepMetadata|=31,this}function IB(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),G.object(Z)){if(G.defined(Z.orientation))if(G.integer(Z.orientation)&&G.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw G.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(G.defined(Z.density))if(G.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw G.invalidParameterError("density","positive number",Z.density);if(G.defined(Z.icc))this.withIccProfile(Z.icc);if(G.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function wB(Z,X){let q=cX.get((G.object(Z)&&G.string(Z.id)?Z.id:Z).toLowerCase());if(!q)throw G.invalidParameterError("format",`one of: ${[...cX.keys()].join(", ")}`,Z);return this[q](X)}function DB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=G.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(G.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if(G.defined(Z.mozjpeg))if(G.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw G.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let q=G.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(G.defined(q))this._setBooleanOption("jpegTrellisQuantisation",q);if(G.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=G.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(G.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let Q=G.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(G.defined(Q))if(G.integer(Q)&&G.inRange(Q,0,8))this.options.jpegQuantisationTable=Q;else throw G.invalidParameterError("quantisationTable","integer between 0 and 8",Q)}return this._updateFormatOut("jpeg",Z)}function NB(Z){if(G.object(Z)){if(G.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(G.defined(Z.compressionLevel))if(G.integer(Z.compressionLevel)&&G.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw G.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(G.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.pngBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(G.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function TB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.alphaQuality))if(G.integer(Z.alphaQuality)&&G.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw G.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(G.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(G.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(G.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(G.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(G.defined(Z.preset))if(G.string(Z.preset)&&G.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw G.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(G.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(G.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(G.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return C3(Z,this.options),this._updateFormatOut("webp",Z)}function RB(Z){if(G.object(Z)){if(G.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(G.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.gifBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.effort))if(G.number(Z.effort)&&G.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(G.defined(Z.interFrameMaxError))if(G.number(Z.interFrameMaxError)&&G.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw G.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(G.defined(Z.interPaletteMaxError))if(G.number(Z.interPaletteMaxError)&&G.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw G.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(G.defined(Z.keepDuplicateFrames))if(G.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw G.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return C3(Z,this.options),this._updateFormatOut("gif",Z)}function _B(Z){if(!this.constructor.format.jp2.output.buffer)throw lX();if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&G.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&G.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function C3(Z,X){if(G.object(Z)&&G.defined(Z.loop))if(G.integer(Z.loop)&&G.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw G.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(G.object(Z)&&G.defined(Z.delay))if(G.integer(Z.delay)&&G.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(G.integer)&&Z.delay.every((q)=>G.inRange(q,0,65535)))X.delay=Z.delay;else throw G.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function PB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(G.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(G.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(G.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(G.defined(Z.xres))if(G.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw G.invalidParameterError("xres","number greater than zero",Z.xres);if(G.defined(Z.yres))if(G.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw G.invalidParameterError("yres","number greater than zero",Z.yres);if(G.defined(Z.compression))if(G.string(Z.compression)&&G.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw G.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(G.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(G.defined(Z.predictor))if(G.string(Z.predictor)&&G.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw G.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(G.defined(Z.resolutionUnit))if(G.string(Z.resolutionUnit)&&G.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw G.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function jB(Z){return this.heif({...Z,compression:"av1"})}function EB(Z){if(G.object(Z)){if(G.string(Z.compression)&&G.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw G.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(G.defined(Z.tune))if(G.string(Z.tune)&&G.inArray(Z.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&Z.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=Z.tune;else throw G.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw G.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function CB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(G.defined(Z.distance))if(G.number(Z.distance)&&G.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw G.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(G.defined(Z.decodingTier))if(G.integer(Z.decodingTier)&&G.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw G.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return C3(Z,this.options),this._updateFormatOut("jxl",Z)}function OB(Z){if(G.object(Z)){if(G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw G.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function xB(Z){if(G.object(Z)){if(G.defined(Z.size))if(G.integer(Z.size)&&G.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw G.invalidParameterError("size","integer between 1 and 8192",Z.size);if(G.defined(Z.overlap))if(G.integer(Z.overlap)&&G.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw G.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw G.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(G.defined(Z.container))if(G.string(Z.container)&&G.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw G.invalidParameterError("container","one of: fs, zip",Z.container);if(G.defined(Z.layout))if(G.string(Z.layout)&&G.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw G.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(G.defined(Z.angle))if(G.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw G.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw G.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(G.defined(Z.skipBlanks))if(G.integer(Z.skipBlanks)&&G.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw G.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(G.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=G.bool(Z.center)?Z.center:Z.centre;if(G.defined(X))this._setBooleanOption("tileCentre",X);if(G.defined(Z.id))if(G.string(Z.id))this.options.tileId=Z.id;else throw G.invalidParameterError("id","string",Z.id);if(G.defined(Z.basename))if(G.string(Z.basename))this.options.tileBasename=Z.basename;else throw G.invalidParameterError("basename","string",Z.basename)}if(G.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw G.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function kB(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","object",Z);if(G.integer(Z.seconds)&&G.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw G.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function SB(Z,X){if(!(G.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function bB(Z,X){if(G.bool(X))this.options[Z]=X;else throw G.invalidParameterError(Z,"boolean",X)}function vB(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function yB(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)})});else v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})});else return new Promise((q,W)=>{v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})}var cX,QB,lX=()=>Error("JP2 output requires libvips with support for OpenJPEG"),pX=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),nX=(Z)=>{Object.assign(Z.prototype,{toFile:JB,toBuffer:zB,toUint8Array:GB,withDensity:YB,keepExif:UB,withExif:KB,withExifMerge:VB,keepIccProfile:BB,withIccProfile:HB,keepGainMap:$B,withGainMap:FB,keepXmp:AB,withXmp:MB,keepMetadata:LB,withMetadata:IB,toFormat:wB,jpeg:DB,jp2:_B,png:NB,webp:TB,tiff:PB,avif:jB,heif:EB,jxl:CB,gif:RB,raw:OB,tile:xB,timeout:kB,_updateFormatOut:SB,_setBooleanOption:bB,_read:vB,_pipeline:yB})};var iX=R(()=>{m0();b4();/*!
227
232
  Copyright 2013 Lovell Fuller and others.
228
233
  SPDX-License-Identifier: Apache-2.0
229
- */var e5=h("node:path"),H=v0(),i4=w1(),VZ=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),uz=/\.(jp[2x]|j2[kc])$/i,HZ=()=>Error("JP2 output requires libvips with support for OpenJPEG"),BZ=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z)));function dz(Z,J){let X;if(!H.string(Z))X=Error("Missing output file path");else if(H.string(this.options.input.file)&&e5.resolve(this.options.input.file)===e5.resolve(Z))X=Error("Cannot use same file for input and output");else if(uz.test(e5.extname(Z))&&!this.constructor.format.jp2k.output.file)X=HZ();if(X)if(H.fn(J))J(X);else return Promise.reject(X);else{this.options.fileOut=Z;let W=Error();return this._pipeline(J,W)}return this}function cz(Z,J){if(H.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(H.fn(Z)?Z:J,X)}function lz(){return this.options.keepMetadata|=1,this}function pz(Z){if(H.object(Z))for(let[J,X]of Object.entries(Z))if(H.object(X))for(let[W,q]of Object.entries(X))if(H.string(q))this.options.withExif[`exif-${J.toLowerCase()}-${W}`]=q;else throw H.invalidParameterError(`${J}.${W}`,"string",q);else throw H.invalidParameterError(J,"object",X);else throw H.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function nz(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function rz(){return this.options.keepMetadata|=8,this}function iz(Z,J){if(H.string(Z))this.options.withIccProfile=Z;else throw H.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),H.object(J)){if(H.defined(J.attach))if(H.bool(J.attach)){if(!J.attach)this.options.keepMetadata&=-9}else throw H.invalidParameterError("attach","boolean",J.attach)}return this}function az(){return this.options.keepMetadata|=2,this}function sz(Z){if(H.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw H.invalidParameterError("xmp","non-empty string",Z);return this}function oz(){return this.options.keepMetadata=31,this}function tz(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),H.object(Z)){if(H.defined(Z.orientation))if(H.integer(Z.orientation)&&H.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw H.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(H.defined(Z.density))if(H.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw H.invalidParameterError("density","positive number",Z.density);if(H.defined(Z.icc))this.withIccProfile(Z.icc);if(H.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function ez(Z,J){let X=VZ.get((H.object(Z)&&H.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw H.invalidParameterError("format",`one of: ${[...VZ.keys()].join(", ")}`,Z);return this[X](J)}function ZU(Z){if(H.object(Z)){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(H.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(H.defined(Z.chromaSubsampling))if(H.string(Z.chromaSubsampling)&&H.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw H.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let J=H.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(H.defined(J))this._setBooleanOption("jpegOptimiseCoding",J);if(H.defined(Z.mozjpeg))if(H.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw H.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=H.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(H.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(H.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=H.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(H.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let q=H.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(H.defined(q))if(H.integer(q)&&H.inRange(q,0,8))this.options.jpegQuantisationTable=q;else throw H.invalidParameterError("quantisationTable","integer between 0 and 8",q)}return this._updateFormatOut("jpeg",Z)}function JU(Z){if(H.object(Z)){if(H.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(H.defined(Z.compressionLevel))if(H.integer(Z.compressionLevel)&&H.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw H.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(H.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let J=Z.colours||Z.colors;if(H.defined(J))if(H.integer(J)&&H.inRange(J,2,256))this.options.pngBitdepth=BZ(J);else throw H.invalidParameterError("colours","integer between 2 and 256",J);if(H.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(H.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw H.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(H.defined(Z.effort))if(H.integer(Z.effort)&&H.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw H.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(H.defined(Z.dither))if(H.number(Z.dither)&&H.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw H.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function XU(Z){if(H.object(Z)){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(H.defined(Z.alphaQuality))if(H.integer(Z.alphaQuality)&&H.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw H.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(H.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(H.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(H.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(H.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(H.defined(Z.preset))if(H.string(Z.preset)&&H.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw H.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(H.defined(Z.effort))if(H.integer(Z.effort)&&H.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw H.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(H.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(H.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed)}return Z7(Z,this.options),this._updateFormatOut("webp",Z)}function WU(Z){if(H.object(Z)){if(H.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(H.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let J=Z.colours||Z.colors;if(H.defined(J))if(H.integer(J)&&H.inRange(J,2,256))this.options.gifBitdepth=BZ(J);else throw H.invalidParameterError("colours","integer between 2 and 256",J);if(H.defined(Z.effort))if(H.number(Z.effort)&&H.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw H.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(H.defined(Z.dither))if(H.number(Z.dither)&&H.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw H.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(H.defined(Z.interFrameMaxError))if(H.number(Z.interFrameMaxError)&&H.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw H.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(H.defined(Z.interPaletteMaxError))if(H.number(Z.interPaletteMaxError)&&H.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw H.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(H.defined(Z.keepDuplicateFrames))if(H.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw H.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return Z7(Z,this.options),this._updateFormatOut("gif",Z)}function qU(Z){if(!this.constructor.format.jp2k.output.buffer)throw HZ();if(H.object(Z)){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(H.defined(Z.lossless))if(H.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw H.invalidParameterError("lossless","boolean",Z.lossless);if(H.defined(Z.tileWidth))if(H.integer(Z.tileWidth)&&H.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw H.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(H.defined(Z.tileHeight))if(H.integer(Z.tileHeight)&&H.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw H.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(H.defined(Z.chromaSubsampling))if(H.string(Z.chromaSubsampling)&&H.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw H.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function Z7(Z,J){if(H.object(Z)&&H.defined(Z.loop))if(H.integer(Z.loop)&&H.inRange(Z.loop,0,65535))J.loop=Z.loop;else throw H.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(H.object(Z)&&H.defined(Z.delay))if(H.integer(Z.delay)&&H.inRange(Z.delay,0,65535))J.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(H.integer)&&Z.delay.every((X)=>H.inRange(X,0,65535)))J.delay=Z.delay;else throw H.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function QU(Z){if(H.object(Z)){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(H.defined(Z.bitdepth))if(H.integer(Z.bitdepth)&&H.inArray(Z.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=Z.bitdepth;else throw H.invalidParameterError("bitdepth","1, 2, 4 or 8",Z.bitdepth);if(H.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(H.defined(Z.tileWidth))if(H.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw H.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(H.defined(Z.tileHeight))if(H.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw H.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(H.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(H.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(H.defined(Z.xres))if(H.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw H.invalidParameterError("xres","number greater than zero",Z.xres);if(H.defined(Z.yres))if(H.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw H.invalidParameterError("yres","number greater than zero",Z.yres);if(H.defined(Z.compression))if(H.string(Z.compression)&&H.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw H.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(H.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(H.defined(Z.predictor))if(H.string(Z.predictor)&&H.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw H.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(H.defined(Z.resolutionUnit))if(H.string(Z.resolutionUnit)&&H.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw H.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function GU(Z){return this.heif({...Z,compression:"av1"})}function YU(Z){if(H.object(Z)){if(H.string(Z.compression)&&H.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw H.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(H.defined(Z.lossless))if(H.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw H.invalidParameterError("lossless","boolean",Z.lossless);if(H.defined(Z.effort))if(H.integer(Z.effort)&&H.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw H.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(H.defined(Z.chromaSubsampling))if(H.string(Z.chromaSubsampling)&&H.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw H.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(H.defined(Z.bitdepth))if(H.integer(Z.bitdepth)&&H.inArray(Z.bitdepth,[8,10,12])){if(Z.bitdepth!==8&&this.constructor.versions.heif)throw H.invalidParameterError("bitdepth when using prebuilt binaries",8,Z.bitdepth);this.options.heifBitdepth=Z.bitdepth}else throw H.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth)}else throw H.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function zU(Z){if(H.object(Z)){if(H.defined(Z.quality))if(H.integer(Z.quality)&&H.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw H.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(H.defined(Z.distance))if(H.number(Z.distance)&&H.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw H.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(H.defined(Z.decodingTier))if(H.integer(Z.decodingTier)&&H.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw H.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(H.defined(Z.lossless))if(H.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw H.invalidParameterError("lossless","boolean",Z.lossless);if(H.defined(Z.effort))if(H.integer(Z.effort)&&H.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw H.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return Z7(Z,this.options),this._updateFormatOut("jxl",Z)}function UU(Z){if(H.object(Z)){if(H.defined(Z.depth))if(H.string(Z.depth)&&H.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw H.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function KU(Z){if(H.object(Z)){if(H.defined(Z.size))if(H.integer(Z.size)&&H.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw H.invalidParameterError("size","integer between 1 and 8192",Z.size);if(H.defined(Z.overlap))if(H.integer(Z.overlap)&&H.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw H.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw H.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(H.defined(Z.container))if(H.string(Z.container)&&H.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw H.invalidParameterError("container","one of: fs, zip",Z.container);if(H.defined(Z.layout))if(H.string(Z.layout)&&H.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw H.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(H.defined(Z.angle))if(H.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw H.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),H.defined(Z.depth))if(H.string(Z.depth)&&H.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw H.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(H.defined(Z.skipBlanks))if(H.integer(Z.skipBlanks)&&H.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw H.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(H.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let J=H.bool(Z.center)?Z.center:Z.centre;if(H.defined(J))this._setBooleanOption("tileCentre",J);if(H.defined(Z.id))if(H.string(Z.id))this.options.tileId=Z.id;else throw H.invalidParameterError("id","string",Z.id);if(H.defined(Z.basename))if(H.string(Z.basename))this.options.tileBasename=Z.basename;else throw H.invalidParameterError("basename","string",Z.basename)}if(H.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw H.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function VU(Z){if(!H.plainObject(Z))throw H.invalidParameterError("options","object",Z);if(H.integer(Z.seconds)&&H.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw H.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function HU(Z,J){if(!(H.object(J)&&J.force===!1))this.options.formatOut=Z;return this}function BU(Z,J){if(H.bool(J))this.options[Z]=J;else throw H.invalidParameterError(Z,"boolean",J)}function $U(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function FU(Z,J){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),i4.pipeline(this.options,(X,W,q)=>{if(X)Z(H.nativeError(X,J));else Z(null,W,q)})});else i4.pipeline(this.options,(X,W,q)=>{if(X)Z(H.nativeError(X,J));else Z(null,W,q)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),i4.pipeline(this.options,(X,W,q)=>{if(X)this.emit("error",H.nativeError(X,J));else this.emit("info",q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else i4.pipeline(this.options,(X,W,q)=>{if(X)this.emit("error",H.nativeError(X,J));else this.emit("info",q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,W)=>{this.once("finish",()=>{this._flattenBufferIn(),i4.pipeline(this.options,(q,Q,G)=>{if(q)W(H.nativeError(q,J));else if(this.options.resolveWithObject)X({data:Q,info:G});else X(Q)})})});else return new Promise((X,W)=>{i4.pipeline(this.options,(q,Q,G)=>{if(q)W(H.nativeError(q,J));else if(this.options.resolveWithObject)X({data:Q,info:G});else X(Q)})})}$Z.exports=(Z)=>{Object.assign(Z.prototype,{toFile:dz,toBuffer:cz,keepExif:lz,withExif:pz,withExifMerge:nz,keepIccProfile:rz,withIccProfile:iz,keepXmp:az,withXmp:sz,keepMetadata:oz,withMetadata:tz,toFormat:ez,jpeg:ZU,jp2:qU,png:JU,webp:XU,tiff:QU,avif:GU,heif:YU,jxl:zU,gif:WU,raw:UU,tile:KU,timeout:VU,_updateFormatOut:HU,_setBooleanOption:BU,_read:$U,_pipeline:FU})}});var IZ=S((RB,LZ)=>{/*!
234
+ */cX=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),QB=/\.(jp[2x]|j2[kc])$/i});import gB from"node:events";import{createRequire as hB}from"node:module";import{availableParallelism as mB}from"node:os";function aX(Z){if(G.bool(Z))if(Z)return v.cache(50,20,100);else return v.cache(0,0,0);else if(G.object(Z))return v.cache(Z.memory,Z.files,Z.items);else return v.cache()}function uB(Z){return v.concurrency(G.integer(Z)?Z:null)}function cB(){return v.counters()}function lB(Z){return v.simd(G.bool(Z)?Z:null)}function pB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!0);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}function nB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!1);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}var v4,O3,rX,x3,A6,fB,G4,dB,sX=(Z)=>{Z.cache=aX,Z.concurrency=uB,Z.counters=cB,Z.simd=lB,Z.format=A6,Z.interpolators=fB,Z.versions=G4,Z.queue=dB,Z.block=pB,Z.unblock=nB};var oX=R(()=>{m0();L3();b4();k1();v4=B4(L1(),1);/*!
230
235
  Copyright 2013 Lovell Fuller and others.
231
236
  SPDX-License-Identifier: Apache-2.0
232
- */var MU=h("node:events"),A6=W6(),j0=v0(),{runtimePlatformArch:AU}=d5(),H0=w1(),MZ=AU(),J7=H0.libvipsVersion(),q4=H0.format();q4.heif.output.alias=["avif","heic"];q4.jpeg.output.alias=["jpe","jpg"];q4.tiff.output.alias=["tif"];q4.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var LU={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},a4={vips:J7.semver};if(!J7.isGlobal)if(!J7.isWasm)try{a4=h(`@img/sharp-${MZ}/versions`)}catch(Z){try{a4=h(`@img/sharp-libvips-${MZ}/versions`)}catch(J){}}else try{a4=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(Z){}a4.sharp=f5().version;if(a4.heif&&q4.heif)q4.heif.input.fileSuffix=[".avif"],q4.heif.output.alias=["avif"];function AZ(Z){if(j0.bool(Z))if(Z)return H0.cache(50,20,100);else return H0.cache(0,0,0);else if(j0.object(Z))return H0.cache(Z.memory,Z.files,Z.items);else return H0.cache()}AZ(!0);function IU(Z){return H0.concurrency(j0.integer(Z)?Z:null)}if(A6.familySync()===A6.GLIBC&&!H0._isUsingJemalloc())H0.concurrency(1);else if(A6.familySync()===A6.MUSL&&H0.concurrency()===1024)H0.concurrency(h("node:os").availableParallelism());var DU=new MU.EventEmitter;function wU(){return H0.counters()}function NU(Z){return H0.simd(j0.bool(Z)?Z:null)}function TU(Z){if(j0.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(j0.string))H0.block(Z.operation,!0);else throw j0.invalidParameterError("operation","Array<string>",Z.operation);else throw j0.invalidParameterError("options","object",Z)}function PU(Z){if(j0.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(j0.string))H0.block(Z.operation,!1);else throw j0.invalidParameterError("operation","Array<string>",Z.operation);else throw j0.invalidParameterError("options","object",Z)}LZ.exports=(Z)=>{Z.cache=AZ,Z.concurrency=IU,Z.counters=wU,Z.simd=NU,Z.format=q4,Z.interpolators=LU,Z.versions=a4,Z.queue=DU,Z.block=TU,Z.unblock=PU}});var X7=S((_B,DZ)=>{/*!
237
+ */O3=hB(import.meta.url),rX=S1.runtimePlatformArch(),x3=v.libvipsVersion(),A6=v.format();A6.heif.output.alias=["avif","heic"];A6.jpeg.output.alias=["jpe","jpg"];A6.tiff.output.alias=["tif"];A6.jp2.output.alias=["j2c","j2k","jp2","jpx"];fB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},G4={vips:x3.semver};if(!x3.isGlobal)if(!x3.isWasm)try{G4=O3(`@img/sharp-${rX}/versions`)}catch(Z){try{G4=O3(`@img/sharp-libvips-${rX}/versions`)}catch(X){}}else try{G4=O3("@img/sharp-wasm32/versions")}catch(Z){}G4.sharp=q6.version;if(G4.heif&&A6.heif)A6.heif.input.fileSuffix=[".avif"],A6.heif.output.alias=["avif"];aX(!0);if(v4.default.familySync()===v4.default.GLIBC&&!v._isUsingJemalloc())v.concurrency(1);else if(v4.default.familySync()===v4.default.MUSL&&v.concurrency()===1024)v.concurrency(mB());dB=new gB.EventEmitter});var k3={};f4(k3,{default:()=>iB});var iB;var S3=R(()=>{VX();$X();wX();NX();jX();fX();dX();iX();oX();/*!
233
238
  Copyright 2013 Lovell Fuller and others.
234
239
  SPDX-License-Identifier: Apache-2.0
235
- */var s0=b8();g8()(s0);c8()(s0);p8()(s0);s8()(s0);zZ()(s0);KZ()(s0);FZ()(s0);IZ()(s0);DZ.exports=s0});import{createHash as wZ}from"node:crypto";import{readFileSync as RU,mkdirSync as jU,existsSync as _U}from"node:fs";import{resolve as W7,basename as CU,extname as EU}from"node:path";import{createRequire as OU}from"node:module";async function NZ(){if(s4)return s4;try{return s4=(await Promise.resolve().then(() => B7(X7(),1))).default,s4}catch{}try{return s4=OU(W7(process.cwd(),"package.json"))("sharp"),s4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${Z.message}`)}}async function q7(Z){let X=await(await NZ())(Z).metadata();return{width:X.width??0,height:X.height??0,format:X.format??"unknown"}}function N1(Z){let J=RU(Z);return wZ("md5").update(J).digest("hex").slice(0,8)}function Q7(Z){let J=JSON.stringify({widths:Z.widths,formats:Z.formats,quality:Z.quality});return wZ("md5").update(J).digest("hex").slice(0,8)}function kU(Z,J,X,W){return`${Z}-${J}-${X}.${W}`}async function TZ(Z,J,X){let W=await NZ(),q=await q7(Z),Q=N1(Z),G=CU(Z,EU(Z)),z=W7(J,"_optimized");jU(z,{recursive:!0});let Y=[],U=X.widths.filter((B)=>B<=q.width);if(U.length===0||!U.includes(q.width))U.push(q.width);U.sort((B,$)=>B-$);let K=[];for(let B of U)for(let $ of X.formats){let A=kU(G,B,Q,$),D=`/${xU}/${A}`,L=W7(z,A);if(Y.push({width:B,format:$,outputPath:D,absolutePath:L}),_U(L))continue;let w=X.quality[$]??80,I=W(Z).resize(B).toFormat($,{quality:w}).toFile(L).then(()=>{});K.push(I)}let V=4;for(let B=0;B<K.length;B+=V)await Promise.all(K.slice(B,B+V));return{original:{width:q.width,height:q.height,format:q.format},variants:Y,contentHash:Q}}function G7(Z,J){return Z.filter((X)=>X.format===J).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var s4=null,xU="images/_optimized";var Y7=()=>{};import{readFileSync as SU,writeFileSync as bU,mkdirSync as vU,existsSync as yU}from"node:fs";import{resolve as L6,basename as gU}from"node:path";import{execSync as hU}from"node:child_process";import{tmpdir as mU}from"node:os";function o4(Z){if(T1===void 0)try{let J=hU("npm config get cache",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],cwd:mU()}).trim();T1=J&&J!=="undefined"?J:null}catch{T1=null}if(T1)return L6(T1,"jxsuite-images",gU(Z));return L6(Z,".cache/images")}function PZ(Z){let J=L6(o4(Z),"manifest.json");if(!yU(J))return{version:1,entries:{}};try{return JSON.parse(SU(J,"utf8"))}catch{return{version:1,entries:{}}}}function RZ(Z,J){let X=o4(Z);vU(X,{recursive:!0}),bU(L6(X,"manifest.json"),JSON.stringify(J,null,2),"utf8")}function jZ(Z,J){let X=Z.entries[J];if(!X)return null;return X.manifest}function _Z(Z,J,X,W){Z.entries[J]={source:X,manifest:W,timestamp:Date.now()}}var T1=void 0;var z7=O(()=>{Y7()});import{existsSync as U7}from"node:fs";import{resolve as CZ,extname as EZ,basename as fU}from"node:path";async function xZ(Z,J){let X=J.get(Z);if(!X){let W=await q7(Z);X={width:W.width,height:W.height,hash:N1(Z)},J.set(Z,X)}return X}function I6(Z,J,X,W){let q=J.quality?.webp??80,Q=Z.startsWith("/")?"":"/",G=W?`?v=${W}`:"";return J.widths.filter((z)=>z<=X).sort((z,Y)=>z-Y).map((z)=>`/cdn-cgi/image/width=${z},quality=${q},fit=scale-down,format=auto${Q}${Z}${G} ${z}w`).join(", ")}async function kZ(Z,J,X,W,q){let Q=`${N1(Z)}:${Q7(X)}`,G=jZ(q,Q);if(G){if(G.variants.every((U)=>U7(U.absolutePath)))return G}if(!G)console.log(` Optimizing ${fU(Z)}...`);let z=await TZ(Z,o4(W),X);return _Z(q,Q,J,z),z}function SZ(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(uU.some((J)=>Z.startsWith(J)))return!0;if(OZ.has(EZ(Z).toLowerCase()))return!0;return!1}function bZ(Z,J){if(J.service!=="cloudflare")return!1;if(!J.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let X=new URL(Z);if(OZ.has(EZ(X.pathname).toLowerCase()))return!1;return J.remoteDomains.includes(X.hostname)}catch{return!1}}function vZ(Z,J){if(Z.startsWith("/"))return CZ(J,"public",Z.slice(1));return CZ(J,Z)}async function yZ(Z,J,X,W,q){let Q=new Map;if(!J.optimize)return{imageRefs:Q};return await gZ(Z,J,X,W,q??new Map,Q),{imageRefs:Q}}async function gZ(Z,J,X,W,q,Q){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await dU(Z,J,X,W,q,Q);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await rU(Z.innerHTML,J,X,W,q,Q);if(Array.isArray(Z.children))for(let G of Z.children){if(typeof G==="string")continue;await gZ(G,J,X,W,q,Q)}}async function dU(Z,J,X,W,q,Q){if(!Z.attributes)Z.attributes={};let G=Z.attributes.src??Z.src,z=bZ(G,J);if(!z&&SZ(G))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let Y=z?null:vZ(G,X);if(Y&&!U7(Y))return;let U,K;if(z)U=I6(G,J,1/0,null);else if(J.service==="cloudflare"){let V=await xZ(Y,q);U=I6(G,J,V.width,V.hash),K=V}else{let V=Q.get(Y);if(!V)V=await kZ(Y,G,J,X,W),Q.set(Y,V);let B=J.formats.includes("avif")?"avif":J.formats[0];U=G7(V.variants,B),K=V.original}if(U)Z.attributes.srcset=U,Z.attributes.sizes=Z.attributes.sizes??J.sizes;if(!Z.attributes.width&&K?.width)Z.attributes.width=String(K.width);if(!Z.attributes.height&&K?.height)Z.attributes.height=String(K.height);if(J.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function rU(Z,J,X,W,q,Q){let G=[];for(let Y of Z.matchAll(cU)){let U=Y[0],K=Y[1];if(pU.test(K))continue;if(nU.test(K))continue;let V=K.match(lU);if(!V)continue;let B=V[1].replaceAll("&amp;","&"),$=bZ(B,J);if(!$&&SZ(B))continue;let A=$?null:vZ(B,X);if(A&&!U7(A))continue;let D,L;if($)D=I6(B,J,1/0,null);else if(J.service==="cloudflare"){let I=await xZ(A,q);D=I6(B,J,I.width,I.hash),L=I}else{let I=Q.get(A);if(!I)I=await kZ(A,B,J,X,W),Q.set(A,I);let j=J.formats.includes("avif")?"avif":J.formats[0];D=G7(I.variants,j),L=I.original}if(!D)continue;let w=` srcset="${D}" sizes="${J.sizes}"`;if(!/\bwidth=/.test(K)&&L?.width)w+=` width="${L.width}"`;if(!/\bheight=/.test(K)&&L?.height)w+=` height="${L.height}"`;if(J.lazyLoad&&!/\bloading="eager"/.test(K)){if(!/\bloading=/.test(K))w+=' loading="lazy"';if(!/\bdecoding=/.test(K))w+=' decoding="async"'}G.push({match:U,replacement:`<img${K}${w}>`})}let z=Z;for(let{match:Y,replacement:U}of G)z=z.replace(Y,U);return z}var OZ,uU,cU,lU,pU,nU;var hZ=O(()=>{Y7();z7();OZ=new Set([".svg",".gif"]),uU=["http://","https://","data:","//"];cU=/<img\b([^>]*)>/gi,lU=/\bsrc="([^"]*)"/,pU=/\bsrcset="/,nU=/\bdata-no-optimize\b/});var dZ={};P6(dZ,{buildSite:()=>oU});import{writeFileSync as d0,copyFileSync as iU,mkdirSync as Q4,existsSync as t4,rmSync as aU,cpSync as K7,readdirSync as sU}from"node:fs";import{resolve as Z0,dirname as e4,join as w6}from"node:path";async function oU(Z,J={}){let{clean:X=!0,verbose:W=!1}=J,q=[],Q=W?console.log.bind(console):()=>{};Q("Loading project.json...");let{config:G}=g9(Z),z=Z0(Z,G.build.outDir),Y=Z0(Z,"pages"),U=Z0(Z,"public"),K=G.build.trailingSlash??"always",V=await B1(Z,G);if(V.entries.length>0)Q(` Registered ${V.entries.length} format(s): ${V.entries.map((N)=>N.name).join(", ")}`);if(X&&t4(z))aU(z,{recursive:!0,force:!0});if(Q4(z,{recursive:!0}),!t4(Y))throw Error(`pages/ directory not found in ${Z}`);Q("Discovering pages...");let B=await f9(Y,V);Q(` Found ${B.length} page(s)`),Q("Loading content types...");let $=await t9(Z,G,V);if($.size>0){Q(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let N=C5(Z,G);if(N)e9($,N.config)}let A=await d9(B,Z,$,V);Q(` ${A.length} route(s) after expansion`);let D=0,L=Z0(Z,"components"),w=[],I=new Map,j=new Map;if(t4(L)){Q("Compiling components...");let N=[".json",...V.documentExtensions("component")],k=sU(L).filter((d)=>N.some((c)=>d.endsWith(c))),f=Z0(z,"components");Q4(f,{recursive:!0});for(let d of k)try{let c=Z0(L,d),X0=await o1(c,{$media:G.$media,formats:V});for(let G0 of X0.files){let N6=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(d0(Z0(f,N6),G0.content,"utf8"),G0.tagName)w.push(G0.tagName);D++}let r=await F1(c,V);if(r.tagName){j.set(r.tagName,r);let G0=P7(r.tagName,r.style,r,G.$media??{});if(G0)I.set(r.tagName,G0),d0(Z0(f,`${r.tagName}.css`),G0,"utf8"),D++}}catch(c){let X0=c;q.push(`Error compiling component ${d}: ${X0.message}`),console.error(`Error compiling component ${d}: ${X0.message}`)}Q(` Compiled ${w.length} component(s): ${w.join(", ")}`)}let v=[];if(G.build.adapter)for(let[,N]of j){let k=E1(N);for(let f of k){let d="./components/"+f.src.replace(/^\.\//,"");v.push({exportName:f.exportName,src:d})}}let y=G.images.optimize&&G.images.service==="cloudflare",E=G.images.optimize&&!y?PZ(Z):null,g=y?new Map:null;if(y)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let N of A)try{Q(` Compiling ${N.urlPattern} ...`);let k=await tU(N,G,Z,$,E,j,g,V),f=new Set;for(let[c,X0]of j)if(S6(X0))f.add(c);if(w.length>0)k.html=JK(k.html,w,I,f);let d=uZ(N.urlPattern,z,K);Q4(e4(d),{recursive:!0}),d0(d,k.html,"utf8"),D++;for(let c of V.withCapability("serialize")){if(!c.exportTarget)continue;try{let X0=await c.call("serialize",k.doc,{mode:"export",componentDefs:j,evaluateTemplate:(r,G0)=>{if(!b(r))return;return Y0(r,G0)??r},buildScope:(r)=>j4(r,null)});if(X0){let r=d.replace(/\.html$/,c.extensions[0]);d0(r,X0,"utf8"),D++}}catch(X0){let r=X0;q.push(`Error exporting ${c.name} for ${N.urlPattern}: ${r.message}`)}}for(let c of k.files){let X0=Z0(e4(d),c.path);Q4(e4(X0),{recursive:!0}),d0(X0,c.content,"utf8"),D++}if(k.serverHandler){let c=Z0(e4(d),"_server.js");d0(c,k.serverHandler,"utf8"),D++}}catch(k){let f=k,d=`Error compiling ${N.urlPattern}: ${f.message}`;q.push(d),console.error(d)}if(E&&G.images.optimize){RZ(Z,E);let N=Z0(o4(Z),"_optimized");if(t4(N)){let f=Z0(z,"images/_optimized");Q4(f,{recursive:!0}),K7(N,f,{recursive:!0})}let k=Object.keys(E.entries).length;if(k>0)Q(` Optimized ${k} image(s)`)}if(G.build.adapter){let N=G.build.adapter;Q("Generating site-wide server worker...");let k=new Map;for(let c of v)if(!k.has(c.exportName))k.set(c.exportName,c);let d=N==="cloudflare-pages"&&k.size===0?null:M5([...k.values()],{adapter:N});if(d){let c=N==="cloudflare-pages"?"_worker.js":"worker.js";if(d0(Z0(z,c),d,"utf8"),D++,Q(` Generated dist/${c} (${k.size} server function(s))`),N==="cloudflare-pages")d0(Z0(z,"_routes.json"),JSON.stringify({version:1,include:["/_jx/*"],exclude:[]},null,2)+`
236
- `,"utf8"),D++;let X0=Z0(z,"components");Q4(X0,{recursive:!0});for(let{src:r}of k.values()){let G0=Z0(Z,r.replace(/^\.\//,"")),N6=Z0(X0,r.replace(/^\.\/components\//,""));if(t4(G0))iU(G0,N6)}}}if(G.redirects&&Object.keys(G.redirects).length>0){Q("Generating redirects...");let N=qK(G.redirects,z);D+=N}if(t4(U))Q("Copying public/ assets..."),K7(U,z,{recursive:!0});if(G.copy){Q("Copying mapped files...");for(let[N,k]of Object.entries(G.copy)){let f=Z0(Z,N),d=Z0(z,k);Q4(e4(d),{recursive:!0}),K7(f,d)}}if(Q(`
237
- Build complete: ${A.length} routes, ${D} files`),q.length>0)Q(` ${q.length} error(s)`);return{routes:A.length,files:D,errors:q}}async function tU(Z,J,X,W=new Map,q=null,Q=new Map,G=null,z){let Y=await F1(Z.sourcePath,z),U=R5(Y,J,X),K=Y.$head??U._pageHead??[],V=U.$head??[],B=Y.title??U._pageTitle??null;delete U._pageHead,delete U._pageTitle,i9(U,J,Z,W,X),await J2(U,Z,X,{config:J,contentTypes:W});let $=j4(U.state??{}),A=B??J.name??"Jx Site";if(typeof A==="string"&&b(A))A=Y0(A,$)??A;let D=mZ(K,$),L=mZ(V,$);if(P1(U,$),H7(U,Q),U.state)for(let[E,g]of Object.entries(U.state)){if(E==="$site"||E==="$page")continue;if(g&&typeof g==="object"&&!Array.isArray(g)&&g.timing==="compiler")delete U.state[E];else if(Array.isArray(g))delete U.state[E]}let w=eU(J.$head??[]),I=n9(w,L,D,{title:A,charset:J.defaults?.charset??"utf-8",...J.name!=null&&{siteName:J.name},...J.url!=null&&{siteUrl:J.url},pageUrl:Z.urlPattern});if(J.$media)U.$media={...J.$media,...U.$media};if(J.images?.optimize&&(q||G))await yZ(U,J.images,X,q,G??void 0);let j=await T5(U,{title:A,lang:J.defaults?.lang??"en",projectStyle:J.style??null});j.html=WK(j.html,I,J.defaults?.lang??"en");let v=(U.$elements??[]).filter((E)=>typeof E==="string"&&!E.startsWith("./")&&!E.startsWith("../"));if(v.length>0)j.html=XK(j.html,v);let y=null;if(!J.build?.adapter)try{let E=await r1(Z.sourcePath);if(E)y=E}catch{}return{html:j.html,files:j.files,serverHandler:y,doc:U}}function mZ(Z,J){return Z.map((X)=>{if(!X||typeof X!=="object")return X;let W={...X};if(W.attributes){W.attributes={...W.attributes};for(let[q,Q]of Object.entries(W.attributes))if(typeof Q==="string"&&b(Q))W.attributes[q]=Y0(Q,J)??Q}if(typeof W.textContent==="string"&&b(W.textContent))W.textContent=Y0(W.textContent,J)??W.textContent;return W})}function eU(Z){return Z.map((J)=>{if(!J||typeof J!=="object"||!J.attributes)return J;let X={...J,attributes:{...J.attributes}};for(let W of["href","src"]){let q=X.attributes[W];if(typeof q==="string"&&ZK(q))X.attributes[W]=`/node_modules/${q}`}return X})}function ZK(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function fZ(Z,J){if(!Z||typeof Z!=="object")return Z;let X={};for(let[W,q]of Object.entries(Z))if(W==="children"&&Array.isArray(q))X.children=q.map((Q)=>{if(typeof Q==="string")return Q;return fZ(Q,J)});else if(W==="style"&&q&&typeof q==="object"){let Q={...q};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&b(z))Q[G]=D6(z,J)??z;X.style=Q}else if(W==="attributes"&&q&&typeof q==="object"){let Q={...q};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&b(z))Q[G]=D6(z,J)??z;X.attributes=Q}else if(W==="$props"&&q&&typeof q==="object"){let Q={...q};for(let[G,z]of Object.entries(Q))if(typeof z==="string"&&b(z)){let Y=D6(z,J);Q[G]=Y!==null?Y??null:z}X.$props=Q}else if(typeof q==="string"&&b(q))X[W]=D6(q,J)??q;else X[W]=q;return X}function D6(Z,J){try{let X=J.$map?.item,W=J.$map?.index,q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map","item","index",`return (${q[1]})`)(J,J.$map,X,W);return Function("state","$map","item","index",`return \`${Z}\``)(J,J.$map,X,W)}catch{return null}}function P1(Z,J){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&b(Z.innerHTML)){let W=Y0(Z.innerHTML,J);if(W!=null)Z.innerHTML=String(W).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&b(Z.textContent))Z.textContent=Y0(Z.textContent,J)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,q]of Object.entries(Z.style))if(typeof q==="string"&&b(q))Z.style[W]=Y0(q,J)??q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,q]of Object.entries(Z.attributes))if(typeof q==="string"&&b(q))Z.attributes[W]=Y0(q,J)??q}if(Z.$props&&typeof Z.$props==="object"){for(let[W,q]of Object.entries(Z.$props))if(typeof q==="string"&&b(q))Z.$props[W]=Y0(q,J)??q}let X=Z.children;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.$prototype==="Array"){let W=X,q=W.items,Q=null;if(q&&typeof q==="object"&&q.$ref){let G=q.$ref;Q=k6(G,J)}else if(Array.isArray(q))Q=q;if(Array.isArray(Q)&&W.map){Z.children=Q.map((G,z)=>{let Y=Object.create(J);Y.$map={item:G,index:z},Y["$map/item"]=G,Y["$map/index"]=z;let U=fZ(W.map,Y);return P1(U,Y),U});return}}if(typeof X==="string"&&b(X)){let W=Y0(X,J);if(Array.isArray(W)){let q=W;Z.children=q;for(let Q of q)P1(Q,J)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let q=Z.children[W];if(typeof q==="string"&&b(q)){let Q=Y0(q,J);if(Array.isArray(Q)){let G=Q;Z.children.splice(W,1,...G);for(let z of G)P1(z,J);W+=G.length;continue}}P1(q,J),W++}}}function H7(Z,J){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){Z.forEach((W)=>H7(W,J));return}if(Array.isArray(Z.children))for(let W of Z.children)H7(W,J);let X=J.get(Z.tagName);if(X){let W=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((G)=>Z1(G,{},null)).join(`
238
- `):null,q=T7(X,Z.$props||null,W),Q=S6(X);if(Z.innerHTML=q,delete Z.children,X.style&&Z.$props){let G={...X.state};for(let[U,K]of Object.entries(Z.$props))if(U in G)G[U]=K;else G[U]=K;let z=j4(G,null),Y={};for(let[U,K]of Object.entries(X.style))if(typeof K==="string"&&b(K)){let V=a(K,z);if(V!=null)Y[U]=V}if(Object.keys(Y).length>0)Z.style={...Z.style,...Y}}if(delete Z.$props,Q)Z.$static=!0;else Z.$prerendered=!0}}function JK(Z,J,X=new Map,W=new Set){let q=J.filter((V)=>Z.includes(`<${V}`));if(q.length===0)return Z;let Q=q.filter((V)=>X.has(V)).map((V)=>`<link rel="stylesheet" href="/components/${V}.css">`).join(`
239
- `);if(Q)Z=Z.replace("</head>",` ${Q}
240
- </head>`);let G=q.filter((V)=>!W.has(V));if(G.length===0)return Z;let z=`<script type="importmap">
240
+ */HX(l0);IX(l0);DX(l0);PX(l0);mX(l0);uX(l0);nX(l0);sX(l0);iB=l0});import{createHash as tX}from"node:crypto";import{existsSync as rB,mkdirSync as aB,readFileSync as sB}from"node:fs";import{basename as oB,extname as tB,resolve as b3}from"node:path";import{createRequire as eB}from"node:module";async function eX(){if(Y4)return Y4;try{return Y4=(await Promise.resolve().then(() => (S3(),k3))).default,Y4}catch{}try{return Y4=eB(b3(process.cwd(),"package.json"))("sharp"),Y4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${t0(Z)}`,{cause:Z})}}async function v3(Z){let q=await(await eX())(Z).metadata();return{format:q.format??"unknown",height:q.height??0,width:q.width??0}}function y4(Z){let X=sB(Z);return tX("md5").update(X).digest("hex").slice(0,8)}function y3(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return tX("md5").update(X).digest("hex").slice(0,8)}function XH(Z,X,q,W){return`${Z}-${X}-${q}.${W}`}async function Zq(Z,X,q){let W=await eX(),Q=await v3(Z),J=y4(Z),z=oB(Z,tB(Z)),Y=b3(X,"_optimized");aB(Y,{recursive:!0});let U=[],K=q.widths.filter((H)=>H<=Q.width);if(K.length===0||!K.includes(Q.width))K.push(Q.width);K.sort((H,$)=>H-$);let V=[];for(let H of K)for(let $ of q.formats){let F=XH(z,H,J,$),L=`/${ZH}/${F}`,A=b3(Y,F);if(U.push({absolutePath:A,format:$,outputPath:L,width:H}),rB(A))continue;let I=q.quality[$]??80,M=W(Z).resize(H).toFormat($,{quality:I}).toFile(A).then(()=>{});V.push(M)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:J,original:{format:Q.format,height:Q.height,width:Q.width},variants:U}}function g3(Z,X){return Z.filter((q)=>q.format===X).map((q)=>`${q.outputPath} ${q.width}w`).join(", ")}var Y4=null,ZH="images/_optimized";var h3=R(()=>{e0()});import{existsSync as qH,mkdirSync as WH,readFileSync as QH,writeFileSync as JH}from"node:fs";import{basename as zH,resolve as g1}from"node:path";import{execSync as GH}from"node:child_process";import{tmpdir as YH}from"node:os";function U4(Z){if(g4===void 0)try{let X=GH("npm config get cache",{cwd:YH(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();g4=X&&X!=="undefined"?X:null}catch{g4=null}if(g4)return g1(g4,"jxsuite-images",zH(Z));return g1(Z,".cache/images")}function Xq(Z){let X=g1(U4(Z),"manifest.json");if(!qH(X))return{entries:{},version:1};try{return JSON.parse(QH(X,"utf8"))}catch{return{entries:{},version:1}}}function qq(Z,X){let q=U4(Z);WH(q,{recursive:!0}),JH(g1(q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function Wq(Z,X){let q=Z.entries[X];if(!q)return null;return q.manifest}function Qq(Z,X,q,W){Z.entries[X]={manifest:W,source:q,timestamp:Date.now()}}var g4;var m3=R(()=>{h3()});import{existsSync as f3}from"node:fs";import{basename as UH,extname as Gq,resolve as Jq}from"node:path";async function Uq(Z,X){let q=X.get(Z);if(!q){let W=y4(Z);try{let Q=await v3(Z);q={width:Q.width,height:Q.height,hash:W}}catch(Q){if(!zq)zq=!0,console.warn(`Could not read image dimensions (${Q.message}) — `+"emitting srcsets without width/height attributes.");q={width:null,height:null,hash:W}}X.set(Z,q)}return q}function h1(Z,X,q,W){let Q=X.quality?.webp??80,J=Z.startsWith("/")?"":"/",z=W?`?v=${W}`:"";return X.widths.filter((Y)=>Y<=q).toSorted((Y,U)=>Y-U).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${Q},fit=scale-down,format=auto${J}${Z}${z} ${Y}w`).join(", ")}async function Kq(Z,X,q,W,Q){let J=`${y4(Z)}:${y3(q)}`,z=Wq(Q,J);if(z){if(z.variants.every((K)=>f3(K.absolutePath)))return z}if(!z)console.log(` Optimizing ${UH(Z)}...`);let Y=await Zq(Z,U4(W),q);return Qq(Q,J,X,Y),Y}function Vq(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(KH.some((X)=>Z.startsWith(X)))return!0;if(Yq.has(Gq(Z).toLowerCase()))return!0;return!1}function Bq(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let q=new URL(Z);if(Yq.has(Gq(q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(q.hostname)}catch{return!1}}function Hq(Z,X){if(Z.startsWith("/"))return Jq(X,"public",Z.slice(1));return Jq(X,Z)}async function $q(Z,X,q,W,Q){let J=new Map;if(!X.optimize)return{imageRefs:J};return await Fq(Z,X,q,W,Q??new Map,J),{imageRefs:J}}async function Fq(Z,X,q,W,Q,J){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await VH(Z,X,q,W,Q,J);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await AH(Z.innerHTML,X,q,W,Q,J);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await Fq(z,X,q,W,Q,J)}}async function VH(Z,X,q,W,Q,J){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let Y=Bq(z,X);if(!Y&&Vq(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let U,K;if(Y)U=h1(z,X,1/0,null);else{let V=Hq(z,q);if(!f3(V))return;if(X.service==="cloudflare"){let B=await Uq(V,Q);if(U=h1(z,X,B.width??1/0,B.hash),B.width!=null&&B.height!=null)K={width:B.width,height:B.height}}else{let B=J.get(V);if(!B)B=await Kq(V,z,X,q,W),J.set(V,B);let H=X.formats.includes("avif")?"avif":X.formats[0];U=g3(B.variants,H),{original:K}=B}}if(U)Z.attributes.srcset=U,Z.attributes.sizes??=X.sizes;if(!Z.attributes.width&&K?.width)Z.attributes.width=String(K.width);if(!Z.attributes.height&&K?.height)Z.attributes.height=String(K.height);if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function AH(Z,X,q,W,Q,J){let z=[];for(let U of Z.matchAll(BH)){let[K]=U,[,V]=U;if($H.test(V))continue;if(FH.test(V))continue;let B=V.match(HH);if(!B)continue;let H=B[1].replaceAll("&amp;","&"),$=Bq(H,X);if(!$&&Vq(H))continue;let F=$?null:Hq(H,q);if(F&&!f3(F))continue;let L,A;if($)L=h1(H,X,1/0,null);else if(X.service==="cloudflare"){let M=await Uq(F,Q);if(L=h1(H,X,M.width??1/0,M.hash),M.width!=null&&M.height!=null)A={width:M.width,height:M.height}}else{let M=J.get(F);if(!M)M=await Kq(F,H,X,q,W),J.set(F,M);let _=X.formats.includes("avif")?"avif":X.formats[0];L=g3(M.variants,_),{original:A}=M}if(!L)continue;let I=` srcset="${L}" sizes="${X.sizes}"`;if(!/\bwidth=/.test(V)&&A?.width)I+=` width="${A.width}"`;if(!/\bheight=/.test(V)&&A?.height)I+=` height="${A.height}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))I+=' loading="lazy"';if(!/\bdecoding=/.test(V))I+=' decoding="async"'}z.push({match:K,replacement:`<img${V}${I}>`})}let Y=Z;for(let{match:U,replacement:K}of z)Y=Y.replace(U,K);return Y}var Yq,KH,zq=!1,BH,HH,$H,FH;var Aq=R(()=>{h3();m3();Yq=new Set([".svg",".gif"]),KH=["http://","https://","data:","//"];BH=/<img\b([^>]*)>/gi,HH=/\bsrc="([^"]*)"/,$H=/\bsrcset="/,FH=/\bdata-no-optimize\b/});var wq={};f4(wq,{buildSite:()=>wH});import{copyFileSync as MH,cpSync as u3,existsSync as K4,mkdirSync as M6,readdirSync as LH,rmSync as IH,writeFileSync as n0}from"node:fs";import{dirname as V4,join as f1,resolve as e}from"node:path";async function wH(Z,X={}){let{clean:q=!0,verbose:W=!1}=X,Q=[],J=W?console.log.bind(console):()=>{};J("Loading project.json...");let{config:z}=w7(Z),Y=e(Z,z.build.outDir),U=e(Z,"pages"),K=e(Z,"public"),V=z.build.trailingSlash??"always",B=await T4(Z,z);if(B.entries.length>0)J(` Registered ${B.entries.length} format(s): ${B.entries.map((j)=>j.name).join(", ")}`);if(q&&K4(Y))IH(Y,{force:!0,recursive:!0});if(M6(Y,{recursive:!0}),!K4(U))throw Error(`pages/ directory not found in ${Z}`);J("Discovering pages...");let H=await T7(U,B);J(` Found ${H.length} page(s)`),J("Loading content types...");let $=await v7(Z,z,B);if($.size>0){J(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let j=a5(Z,z);if(j)y7($,j.config)}let F=await _7(H,Z,$,B);J(` ${F.length} route(s) after expansion`);let L=0,A=e(Z,"components"),I=[],M=new Map,_=new Map;if(K4(A)){J("Compiling components...");let j=[".json",...B.documentExtensions("component")],S=LH(A).filter((f)=>j.some((h)=>f.endsWith(h))),g=e(Y,"components");M6(g,{recursive:!0});for(let f of S)try{let h=e(A,f),X0=await B1(h,{...z.$media?{$media:z.$media}:{},formats:B});for(let G0 of X0.files){let u1=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(n0(e(g,u1),G0.content,"utf8"),G0.tagName)I.push(G0.tagName);L+=1}let l=await _4(h,B);if(l.tagName){_.set(l.tagName,l);let G0=W8(l.tagName,l.style,l,z.$media??{});if(G0)M.set(l.tagName,G0),n0(e(g,`${l.tagName}.css`),G0,"utf8"),L+=1}}catch(h){let X0=h;Q.push(`Error compiling component ${f}: ${X0.message}`),console.error(`Error compiling component ${f}: ${X0.message}`)}J(` Compiled ${I.length} component(s): ${I.join(", ")}`)}let k=[];if(z.build.adapter)for(let[,j]of _){let S=l4(j);for(let g of S){let f=`./components/${g.src.replace(/^\.\//,"")}`;k.push({exportName:g.exportName,src:f})}}let b=z.images.optimize&&z.images.service==="cloudflare",C=z.images.optimize&&!b?Xq(Z):null,T=b?new Map:null;if(b)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let j of F)try{J(` Compiling ${j.urlPattern} ...`);let S=await DH(j,z,Z,$,C,_,T,B),g=new Set;for(let[h,X0]of _)if(e1(X0))g.add(h);if(I.length>0)S.html=RH(S.html,I,M,g);let f=Iq(j.urlPattern,Y,V);M6(V4(f),{recursive:!0}),n0(f,S.html,"utf8"),L+=1;for(let h of B.withCapability("serialize")){if(!h.exportTarget)continue;try{let X0=await h.call("serialize",S.doc,{buildScope:(l)=>m6(l,null),componentDefs:_,evaluateTemplate:(l,G0)=>{if(!x(l))return;return Y0(l,G0)??l},mode:"export"});if(X0){let l=f.replace(/\.html$/,h.extensions[0]);n0(l,X0,"utf8"),L+=1}}catch(X0){let l=X0;Q.push(`Error exporting ${h.name} for ${j.urlPattern}: ${l.message}`)}}for(let h of S.files){let X0=e(V4(f),h.path);M6(V4(X0),{recursive:!0}),n0(X0,h.content,"utf8"),L+=1}if(S.serverHandler){let h=e(V4(f),"_server.js");n0(h,S.serverHandler,"utf8"),L+=1}}catch(S){let g=S,f=`Error compiling ${j.urlPattern}: ${g.message}`;Q.push(f),console.error(f)}if(C&&z.images.optimize){qq(Z,C);let j=e(U4(Z),"_optimized");if(K4(j)){let g=e(Y,"images/_optimized");M6(g,{recursive:!0}),u3(j,g,{recursive:!0})}let S=Object.keys(C.entries).length;if(S>0)J(` Optimized ${S} image(s)`)}if(z.build.adapter){let{adapter:j}=z.build;J("Generating site-wide server worker...");let S=new Map;for(let h of k)if(!S.has(h.exportName))S.set(h.exportName,h);let f=j==="cloudflare-pages"&&S.size===0?null:y5([...S.values()],{adapter:j});if(f){let h=j==="cloudflare-pages"?"_worker.js":"worker.js";if(n0(e(Y,h),f,"utf8"),L+=1,J(` Generated dist/${h} (${S.size} server function(s))`),j==="cloudflare-pages")n0(e(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
241
+ `,"utf8"),L+=1;let X0=e(Y,"components");M6(X0,{recursive:!0});for(let{src:l}of S.values()){let G0=e(Z,l.replace(/^\.\//,"")),u1=e(X0,l.replace(/^\.\/components\//,""));if(K4(G0))MH(G0,u1)}}}if(z.redirects&&Object.keys(z.redirects).length>0){J("Generating redirects...");let j=jH(z.redirects,Y);L+=j}if(K4(K))J("Copying public/ assets..."),u3(K,Y,{recursive:!0});if(z.copy){J("Copying mapped files...");for(let[j,S]of Object.entries(z.copy)){let g=e(Z,j),f=e(Y,S);M6(V4(f),{recursive:!0}),u3(g,f)}}if(J(`
242
+ Build complete: ${F.length} routes, ${L} files`),Q.length>0)J(` ${Q.length} error(s)`);return{errors:Q,files:L,routes:F.length}}async function DH(Z,X,q,W=new Map,Q=null,J=new Map,z=null,Y){let U=await _4(Z.sourcePath,Y),K=n5(U,X,q),V=U.$head??K._pageHead??[],B=K.$head??[],H=U.title??K._pageTitle??null;delete K._pageHead,delete K._pageTitle,x7(K,X,Z,W,q),await h7(K,Z,q,{config:X,contentTypes:W});let $=m6(K.state??{}),F=H??X.name??"Jx Site";if(typeof F==="string"&&x(F))F=Y0(F,$)??F;let L=Mq(V,$),A=Mq(B,$);h4(K,$);let I={counter:{n:0},media:{...X.$media,...K.$media},rules:[]};if(c3(K,J,I),K.state)for(let[T,j]of Object.entries(K.state)){if(T==="$site"||T==="$page")continue;if(j&&typeof j==="object"&&!Array.isArray(j)&&j.timing==="compiler")delete K.state[T];else if(Array.isArray(j))delete K.state[T]}let M=NH(X.$head??[]),_=C7(M,A,L,{title:F,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)K.$media={...X.$media,...K.$media};if(X.images?.optimize&&(Q||z))await $q(K,X.images,q,Q,z??void 0);let k=await l5(K,{lang:X.defaults?.lang??"en",projectStyle:X.style??null,title:F});if(I.rules.length>0)k.html=k.html.replace("</head>",`<style>
243
+ ${I.rules.join(`
244
+ `)}
245
+ </style>
246
+ </head>`);k.html=PH(k.html,_,X.defaults?.lang??"en");let b=(K.$elements??[]).filter((T)=>typeof T==="string"&&!T.startsWith("./")&&!T.startsWith("../"));if(b.length>0)k.html=_H(k.html,b);let C=null;if(!X.build?.adapter)try{let T=await Y1(Z.sourcePath);if(T)C=T}catch{}return{doc:K,files:k.files,html:k.html,serverHandler:C}}function Mq(Z,X){return Z.map((q)=>{if(!q||typeof q!=="object")return q;let W={...q};if(W.attributes){W.attributes={...W.attributes};for(let[Q,J]of Object.entries(W.attributes))if(typeof J==="string"&&x(J))W.attributes[Q]=Y0(J,X)??J}if(typeof W.textContent==="string"&&x(W.textContent))W.textContent=Y0(W.textContent,X)??W.textContent;return W})}function NH(Z){return Z.map((X)=>{if(!X||typeof X!=="object"||!X.attributes)return X;let q={...X,attributes:{...X.attributes}};for(let W of["href","src"]){let Q=q.attributes[W];if(typeof Q==="string"&&TH(Q))q.attributes[W]=`/node_modules/${Q}`}return q})}function TH(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function Lq(Z,X){if(!Z||typeof Z!=="object")return Z;let q={};for(let[W,Q]of Object.entries(Z))if(W==="children"&&Array.isArray(Q))q.children=Q.map((J)=>{if(typeof J==="string")return J;return Lq(J,X)});else if(W==="style"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.style=J}else if(W==="attributes"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.attributes=J}else if(W==="$props"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y)){let U=m1(Y,X);J[z]=U!==null?U??null:Y}q.$props=J}else if(typeof Q==="string"&&x(Q))q[W]=m1(Q,X)??Q;else q[W]=Q;return q}function m1(Z,X){try{let q=X.$map?.item,W=X.$map?.index,Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map","item","index",`return (${Q[1]})`)(X,X.$map,q,W);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,q,W)}catch{return null}}function h4(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&x(Z.innerHTML)){let W=Y0(Z.innerHTML,X);if(W!=null)Z.innerHTML=String(W).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&x(Z.textContent))Z.textContent=Y0(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,Q]of Object.entries(Z.style))if(typeof Q==="string"&&x(Q))Z.style[W]=Y0(Q,X)??Q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,Q]of Object.entries(Z.attributes))if(typeof Q==="string"&&x(Q))Z.attributes[W]=Y0(Q,X)??Q}if(Z.$props&&typeof Z.$props==="object"){for(let[W,Q]of Object.entries(Z.$props))if(typeof Q==="string"&&x(Q))Z.$props[W]=Y0(Q,X)??Q}let q=Z.children;if(w6(q)){let W=q.items,Q=null;if(L0(W))Q=t1(W.$ref,X);else if(Array.isArray(W))Q=W;let J=q.map;if(Array.isArray(Q)&&J){Z.children=Q.map((z,Y)=>{let U=Object.create(X);U.$map={index:Y,item:z},U["$map/item"]=z,U["$map/index"]=Y;let K=Lq(J,U);return h4(K,U),K});return}}if(typeof q==="string"&&x(q)){let W=Y0(q,X);if(Array.isArray(W)){let Q=W;Z.children=Q;for(let J of Q)h4(J,X)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let Q=Z.children[W];if(typeof Q==="string"&&x(Q)){let J=Y0(Q,X);if(Array.isArray(J)){let z=J;Z.children.splice(W,1,...z);for(let Y of z)h4(Y,X);W+=z.length;continue}}h4(Q,X),W+=1}}}function c3(Z,X,q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let Q of Z)c3(Q,X,q);return}if(Array.isArray(Z.children))for(let Q of Z.children)c3(Q,X,q);let W=X.get(Z.tagName);if(W){let Q=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((Y)=>{if(q&&Y&&typeof Y==="object")G6(Y,q.rules,q.media,"",q.counter,"jxs");return b6(Y,{},null)}).join(`
247
+ `):null,J=q8(W,Z.$props||null,Q),z=e1(W);if(Z.innerHTML=J,delete Z.children,W.style&&Z.$props){let Y={...W.state};for(let[V,B]of Object.entries(Z.$props))Y[V]=V in Y?B:B;let U=m6(Y,null),K={};for(let[V,B]of Object.entries(W.style))if(typeof B==="string"&&x(B)){let H=p(B,U);if(H!=null)K[V]=H}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function RH(Z,X,q=new Map,W=new Set){let Q=X.filter((H)=>Z.includes(`<${H}`));if(Q.length===0)return Z;let J=Q.filter((H)=>q.has(H)).map((H)=>`<link rel="stylesheet" href="/components/${H}.css">`).join(`
248
+ `),z=Z;if(J)z=z.replace("</head>",` ${J}
249
+ </head>`);let Y=Q.filter((H)=>!W.has(H));if(Y.length===0)return z;let U=`<script type="importmap">
241
250
  {
242
251
  "imports": {
243
- "@vue/reactivity": "${N4}",
244
- "lit-html": "${T4}"
252
+ "@vue/reactivity": "${y6}",
253
+ "lit-html": "${g6}"
245
254
  }
246
255
  }
247
- </script>`,Y=G.map((V)=>`<script type="module" src="/components/${V}.js"></script>`).join(`
248
- `),K=(Z.includes('<script type="importmap">')?"":`${z}
249
- `)+Y;return Z.replace("</body>",` ${K}
250
- </body>`)}function XK(Z,J){let X=J.map((W)=>`<script type="module" src="/node_modules/${W}"></script>`).join(`
251
- `);return Z.replace("</body>",` ${X}
252
- </body>`)}function WK(Z,J,X){let W=r9(J),q=/<head>([\s\S]*?)<\/head>/i,Q=Z.match(q),G="";if(Q){let z=Q[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)G+=`
253
- `+z.join(`
254
- `);let Y=Q[1].match(/<script[\s\S]*?<\/script>/gi);if(Y)G+=`
255
- `+Y.join(`
256
- `)}if(q.test(Z))Z=Z.replace(q,`<head>
257
- ${W}${G}
258
- </head>`);return Z=Z.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Z}function uZ(Z,J,X){if(Z==="/")return w6(J,"index.html");let W=Z.replace(/^\//,"");if(X==="always")return w6(J,W,"index.html");return w6(J,`${W}.html`)}function qK(Z,J){let X=0,W=[];for(let[q,Q]of Object.entries(Z)){let G=typeof Q==="object"?Q.destination:Q,z=typeof Q==="object"?Q.status??301:301;if(q.includes(":")||q.includes("*")){W.push(`${q} ${G} ${z}`);continue}let Y=uZ(q,J,"always"),U=`<!DOCTYPE html>
256
+ </script>`,K=Y.map((H)=>`<script type="module" src="/components/${H}.js"></script>`).join(`
257
+ `),B=(z.includes('<script type="importmap">')?"":`${U}
258
+ `)+K;return z.replace("</body>",` ${B}
259
+ </body>`)}function _H(Z,X){let q=X.map((W)=>`<script type="module" src="/node_modules/${W}"></script>`).join(`
260
+ `);return Z.replace("</body>",` ${q}
261
+ </body>`)}function PH(Z,X,q){let W=O7(X),Q=/<head>([\s\S]*?)<\/head>/i,J=Z.match(Q),z="";if(J){let U=J[1].match(/<style>[\s\S]*?<\/style>/gi);if(U)z+=`
262
+ ${U.join(`
263
+ `)}`;let K=J[1].match(/<script[\s\S]*?<\/script>/gi);if(K)z+=`
264
+ ${K.join(`
265
+ `)}`}let Y=Z;if(Q.test(Y))Y=Y.replace(Q,`<head>
266
+ ${W}${z}
267
+ </head>`);return Y=Y.replace(/<html\s[^>]*>/i,(U)=>{if(/lang=/.test(U))return U.replace(/lang="[^"]*"/,`lang="${q}"`);return U.replace("<html",`<html lang="${q}"`)}),Y}function Iq(Z,X,q){if(Z==="/")return f1(X,"index.html");let W=Z.replace(/^\//,"");if(q==="always")return f1(X,W,"index.html");return f1(X,`${W}.html`)}function jH(Z,X){let q=0,W=[];for(let[Q,J]of Object.entries(Z)){let z=typeof J==="object"?J.destination:J,Y=typeof J==="object"?J.status??301:301;if(Q.includes(":")||Q.includes("*")){W.push(`${Q} ${z} ${Y}`);continue}let U=Iq(Q,X,"always"),K=`<!DOCTYPE html>
259
268
  <html>
260
269
  <head>
261
270
  <meta charset="utf-8">
262
- <meta http-equiv="refresh" content="0;url=${V7(G)}">
263
- <link rel="canonical" href="${V7(G)}">
271
+ <meta http-equiv="refresh" content="0;url=${d3(z)}">
272
+ <link rel="canonical" href="${d3(z)}">
264
273
  <title>Redirecting...</title>
265
274
  </head>
266
275
  <body>
267
- <p>Redirecting to <a href="${V7(G)}">${QK(G)}</a>...</p>
276
+ <p>Redirecting to <a href="${d3(z)}">${EH(z)}</a>...</p>
268
277
  </body>
269
- </html>`;Q4(e4(Y),{recursive:!0}),d0(Y,U,"utf8"),X++,W.push(`${q} ${G} ${z}`)}if(W.length>0)d0(w6(J,"_redirects"),W.join(`
270
- `)+`
271
- `,"utf8"),X++;return X}function QK(Z){return String(Z).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function V7(Z){return String(Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var cZ=O(()=>{h9();c9();g4();p9();a9();v9();t1();U4();Z2();X2();hZ();z7()});import{resolve as GK}from"node:path";var lZ=process.argv.slice(2),R1=lZ[0];if(!R1||R1==="--help"||R1==="-h")console.log(`Usage: jx <command> [options]
278
+ </html>`;M6(V4(U),{recursive:!0}),n0(U,K,"utf8"),q+=1,W.push(`${Q} ${z} ${Y}`)}if(W.length>0)n0(f1(X,"_redirects"),`${W.join(`
279
+ `)}
280
+ `,"utf8"),q+=1;return q}function EH(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function d3(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var Dq=R(()=>{S0();D7();P7();s6();E7();k7();L7();H1();T6();g7();m7();Aq();m3()});import{resolve as CH}from"node:path";var Nq=process.argv.slice(2),[m4]=Nq;if(!m4||m4==="--help"||m4==="-h")console.log(`Usage: jx <command> [options]
272
281
 
273
282
  Commands:
274
283
  build [root] Build a Jx site to dist/
275
284
 
276
285
  Options:
277
286
  --verbose Print detailed build progress
278
- --no-clean Don't clean outDir before building`),process.exit(0);if(R1==="build"){let Z=lZ.slice(1),J=new Set(Z.filter((G)=>G.startsWith("--"))),X=Z.filter((G)=>!G.startsWith("--")),W=GK(X[0]??"."),q=J.has("--verbose"),Q=!J.has("--no-clean");console.log(`Building site from ${W}...`);try{let{buildSite:G}=await Promise.resolve().then(() => (cZ(),dZ)),z=await G(W,{verbose:q,clean:Q});if(z.errors.length>0){console.error(`
279
- Build completed with ${z.errors.length} error(s):`);for(let Y of z.errors)console.error(` - ${Y}`);process.exit(1)}console.log(`
280
- Done: ${z.routes} routes → ${z.files} files`)}catch(G){console.error(`Build failed: ${G.message}`),process.exit(1)}}else console.error(`Unknown command: ${R1}
287
+ --no-clean Don't clean outDir before building`),process.exit(0);if(m4==="build"){let Z=Nq.slice(1),X=new Set(Z.filter((z)=>z.startsWith("--"))),q=Z.find((z)=>!z.startsWith("--")),W=CH(q??"."),Q=X.has("--verbose"),J=!X.has("--no-clean");console.log(`Building site from ${W}...`);try{let{buildSite:z}=await Promise.resolve().then(() => (Dq(),wq)),Y=await z(W,{clean:J,verbose:Q});if(Y.errors.length>0){console.error(`
288
+ Build completed with ${Y.errors.length} error(s):`);for(let U of Y.errors)console.error(` - ${U}`);process.exit(1)}console.log(`
289
+ Done: ${Y.routes} routes → ${Y.files} files`)}catch(z){console.error(`Build failed: ${z.message}`),process.exit(1)}}else console.error(`Unknown command: ${m4}
281
290
  Run "jx --help" for usage.`),process.exit(1);