likec4 1.46.0 → 1.46.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.
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import{h as ve,r as vc,k as De,l as ns,m as et,u as y,w as ss,o as $c,p as bc,q as ge,s as os,v as gt,x as Te,y as Ec,d as is,z as as,A as Rc,c as Sc,L as ye,B as Ac,j as cs,C as _c,D as tt,E as tr,F as Cc,G as us,H as yt,I as ls,J as xc,K as Tc,M as Lc,O as kc,P as Ic,Q as Le,R as Oc,S as Pc,U as Nc,V as jc,W as Dc,X as qc,Y as Hc,Z as Mc,e as Uc,_ as Me,$ as rr,a0 as Ue,a1 as nr,a2 as sr,a3 as fs,a4 as ps}from"../shared/likec4.pKvQjtrp.mjs";import V,{existsSync as _e,copyFileSync as ds,readdirSync as Fc,
3
- rmSync as or,statSync as Gc}from"node:fs";import se,{hrtime as Bc,cwd as wt,exit as hs,argv as Vc,stdout as Wc}from"node:process";import{b as ms,t as gs,a as zc,d as rt}from"../shared/likec4.CB2-Uaub.mjs";import{env as ys,isMinimal as Xc,nodeENV as Kc,isDevelopment as Jc}from"std-env";import Yc from"yargs";import{hideBin as Qc}from"yargs/helpers";import X,{resolve as W,dirname as Re,join as nt,relative as Ce,sep as ws,extname as st,isAbsolute as ir,basename as vt}from"node:path";import vs,{mkdtemp as $t,
4
- writeFile as ke,mkdir as Se,stat as ar,copyFile as Zc,rm as eu}from"node:fs/promises";import ot,{tmpdir as bt}from"node:os";import{fileURLToPath as $s}from"node:url";import cr from"@vitejs/plugin-react";import bs from"util";import ur,{resolve as Fe}from"path";import{j as Es,e as Rs,C as tu,t as Ss,N as Ge,L as lr,g as ru,a as nu,b as su}from"../shared/likec4.Bp7Gn9yO.mjs";import{build as it,createServer as ou,preview as iu}from"vite";import au from"node:module";import cu from"node:net";import{setTimeout as uu}from"node:timers/promises";
5
- import{invariant as fr,nonexhaustive as pr}from"@likec4/core";import{promisify as ae,isDeepStrictEqual as lu}from"node:util";import at from"node:crypto";import fu from"node:assert";import{a as Be}from"../shared/likec4.DASl7M77.mjs";import{isDeploymentRelationModel as pu,isRelationModel as du,isDeploymentElementModel as hu,isLikeC4ViewModel as mu,isElementModel as gu}from"@likec4/core/model";import{compareNatural as yu,sortNaturalByFqn as wu,invariant as vu,delay as As}from"@likec4/core/utils";let dr;
6
- function $u(){try{return V.statSync("/.dockerenv"),!0}catch{return!1}}function bu(){try{return V.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Eu(){return dr===void 0&&(dr=$u()||bu()),dr}let hr;const Ru=()=>{try{return V.statSync("/run/.containerenv"),!0}catch{return!1}};function Ie(){return hr===void 0&&(hr=Ru()||Eu()),hr}const pe={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:W},he={alias:"\
7
- use-dot-bin",boolean:!0,type:"boolean",desc:Ie()?"enabled in container, disable by --no-use-dot":'use graphviz binaries ("dot" should be on PATH)',default:Ie()},_s={boolean:!0,type:"boolean",desc:"use `@likec4/core` package in types",default:!1},Cs={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},Et={alias:"o",type:"string",desc:"output directory",normalize:!0,nargs:1,coerce:W},mr={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c\
8
- 4" generates <c4-view ../>',default:"likec4",nargs:1},xs={alias:"t",type:"string",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4",nargs:1},Ts={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},Su={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Au={alias:"l",type:"string",...Ie()?{desc:"listen 0.0.0.0 by default in container",default:"0.0.0.0"}:{desc:"\
9
- ip address of the network interface to listen on"},nargs:1},_u={type:"number",desc:"port number for the dev server (default is 5173, or PORT environment variable)",nargs:1},ct={alias:"p",type:"string",desc:'LikeC4 project, name eg. "my-project" or path to the project folder',nargs:1},Ls=t=>t instanceof URL?$s(t):t;function Cu(t,{cwd:e=se.cwd(),type:r="file",stopAt:n}={}){let o=X.resolve(Ls(e)??"");const{root:u}=X.parse(o);for(n=X.resolve(o,Ls(n)??u);o&&o!==n&&o!==u;){const s=X.isAbsolute(t)?t:X.
10
- join(o,t);try{const i=V.statSync(s,{throwIfNoEntry:!1});if(r==="file"&&i?.isFile()||r==="directory"&&i?.isDirectory())return s}catch{}o=X.dirname(o)}}function xu({cwd:t=se.cwd()}={}){return Cu("package.json",{cwd:t})}const Tu=ve("vite"),Rt=Re($s(import.meta.url)),Lu=`
2
+ import{h as ve,r as _c,k as He,l as cs,m as rt,u as y,w as us,o as Cc,p as xc,q as ge,s as ls,v as yt,x as Te,y as Tc,d as fs,z as ps,A as Ic,c as Oc,L as ye,B as Lc,j as ds,C as kc,D as nt,E as sr,F as Nc,G as hs,H as wt,I as ms,J as Pc,K as jc,M as Dc,O as qc,P as Hc,Q as Ie,R as Mc,S as Uc,U as Fc,V as Gc,W as Bc,X as Vc,Y as zc,Z as Wc,e as Xc,_ as Ge,$ as ir,a0 as Be,a1 as or,a2 as ar,a3 as gs,a4 as ys}from"../shared/likec4.4c1Hb6hc.mjs";import B,{existsSync as _e,copyFileSync as ws,readdirSync as Kc,
3
+ rmSync as cr,statSync as Yc}from"node:fs";import re,{hrtime as Jc,cwd as vt,exit as vs,argv as Qc,stdout as Zc}from"node:process";import{b as $s,t as bs,a as eu,d as st}from"../shared/likec4.CB2-Uaub.mjs";import{env as Es,isMinimal as tu,nodeENV as ru,isDevelopment as nu}from"std-env";import su from"yargs";import{hideBin as iu}from"yargs/helpers";import W,{resolve as z,dirname as Re,join as it,relative as Ce,sep as Rs,extname as ot,isAbsolute as ur,basename as $t}from"node:path";import Ss,{mkdtemp as bt,
4
+ writeFile as Oe,mkdir as Se,stat as lr,copyFile as ou,rm as au}from"node:fs/promises";import at,{tmpdir as Et}from"node:os";import{fileURLToPath as As}from"node:url";import fr from"@vitejs/plugin-react";import _s from"util";import pr,{resolve as Ve}from"path";import{j as Cs,e as xs,C as cu,t as Ts,N as ze,L as dr,g as uu,a as lu,b as fu}from"../shared/likec4.fwpDnke2.mjs";import{build as ct,createServer as pu,preview as du}from"vite";import hu from"node:module";import mu from"node:net";import{setTimeout as gu}from"node:timers/promises";
5
+ import{invariant as hr,nonexhaustive as mr}from"@likec4/core";import{promisify as ae,isDeepStrictEqual as Is}from"node:util";import Me from"node:crypto";import Os from"node:assert";import{a as We}from"../shared/likec4.DASl7M77.mjs";import{isDeploymentRelationModel as yu,isRelationModel as wu,isDeploymentElementModel as vu,isLikeC4ViewModel as $u,isElementModel as bu}from"@likec4/core/model";import{compareNatural as Eu,sortNaturalByFqn as Ru,invariant as Su,delay as Ls}from"@likec4/core/utils";let gr;
6
+ function Au(){try{return B.statSync("/.dockerenv"),!0}catch{return!1}}function _u(){try{return B.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Cu(){return gr===void 0&&(gr=Au()||_u()),gr}let yr;const xu=()=>{try{return B.statSync("/run/.containerenv"),!0}catch{return!1}};function Le(){return yr===void 0&&(yr=xu()||Cu()),yr}const pe={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:z},he={alias:"\
7
+ use-dot-bin",boolean:!0,type:"boolean",desc:Le()?"enabled in container, disable by --no-use-dot":'use graphviz binaries ("dot" should be on PATH)',default:Le()},ks={boolean:!0,type:"boolean",desc:"use `@likec4/core` package in types",default:!1},Ns={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},Rt={alias:"o",type:"string",desc:"output directory",normalize:!0,nargs:1,coerce:z},wr={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c\
8
+ 4" generates <c4-view ../>',default:"likec4",nargs:1},Ps={alias:"t",type:"string",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4",nargs:1},js={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},Tu={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Iu={alias:"l",type:"string",...Le()?{desc:"listen 0.0.0.0 by default in container",default:"0.0.0.0"}:{desc:"\
9
+ ip address of the network interface to listen on"},nargs:1},Ou={type:"number",desc:"port number for the dev server (default is 5173, or PORT environment variable)",nargs:1},ut={alias:"p",type:"string",desc:'LikeC4 project, name eg. "my-project" or path to the project folder',nargs:1},Ds=t=>t instanceof URL?As(t):t;function Lu(t,{cwd:e=re.cwd(),type:r="file",stopAt:n}={}){let i=W.resolve(Ds(e)??"");const{root:a}=W.parse(i);for(n=W.resolve(i,Ds(n)??a);i&&i!==n&&i!==a;){const s=W.isAbsolute(t)?t:W.
10
+ join(i,t);try{const o=B.statSync(s,{throwIfNoEntry:!1});if(r==="file"&&o?.isFile()||r==="directory"&&o?.isDirectory())return s}catch{}i=W.dirname(i)}}function ku({cwd:t=re.cwd()}={}){return Lu("package.json",{cwd:t})}const Nu=ve("vite"),St=Re(As(import.meta.url)),Pu=`
11
11
  /* prettier-ignore-start */
12
12
  /* eslint-disable */
13
13
 
@@ -16,118 +16,118 @@ join(o,t);try{const i=V.statSync(s,{throwIfNoEntry:!1});if(r==="file"&&i?.isFile
16
16
  * DO NOT EDIT MANUALLY!
17
17
  ******************************************************************************/
18
18
 
19
- `.trimStart(),ku=`
19
+ `.trimStart(),ju=`
20
20
 
21
21
  /* prettier-ignore-end */
22
- `,gr={banner:Lu,footer:ku};function ks(){const t=xu({cwd:Rt});if(!t)throw new Error("likec4 package folder not found");return Re(t)}function yr(){const t=ks(),e=[W(t,"__app__"),W(Rt,"../__app__"),W(Rt,"../../__app__"),W(Rt,"../../dist/__app__")],r=vc(e,_e);if(!r)throw De.error(`likec4 app root does not exist, tried:
22
+ `,vr={banner:Pu,footer:ju};function qs(){const t=ku({cwd:St});if(!t)throw new Error("likec4 package folder not found");return Re(t)}function $r(){const t=qs(),e=[z(t,"__app__"),z(St,"../__app__"),z(St,"../../__app__"),z(St,"../../dist/__app__")],r=_c(e,_e);if(!r)throw He.error(`likec4 app root does not exist, tried:
23
23
  ${e.join(`
24
- `)}`),new Error("likec4 app root does not exist");return r}async function wr(){const t=await $t(nt(bt(),".likec4-public-"));return await ke(nt(t,"likec4-views.js"),`// generated by likec4
25
- `),t}const vr=1e4;function $r(){const t=ks();return{"likec4/icons":W(t,"icons"),"likec4/react":W(t,"react/index.js"),"likec4/model":W(t,"dist/model/index.mjs"),"likec4/vite-plugin/internal":W(t,"dist/vite-plugin/internal.mjs")}}var br={},Is;function Er(){return Is||(Is=1,(function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,o)=>o===!1||!t.isInteger(e)||!t.
26
- isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=o,t.escapeNode=(e,r=0,n)=>{const o=e.nodes[r];o&&(n&&o.type===n||o.type==="open"||o.type==="close")&&o.escaped!==!0&&(o.value="\\"+o.value,o.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1,t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||
27
- e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=o=>{for(let u=0;u<o.length;u++){const s=o[u];if(Array.isArray(s)){n(s);continue}s!==void 0&&r.push(s)}return r};return n(e),r}})(br)),br}var Rr,Os;function Sr(){if(Os)return Rr;Os=1;const t=Er();return Rr=(e,r={})=>{const n=(o,u={})=>{const s=r.escapeInvalid&&t.isInvalidBrace(u),i=o.invalid===!0&&r.escapeInvalid===!0;let c="";if(o.value)return(s||i)&&
28
- t.isOpenOrClose(o)?"\\"+o.value:o.value;if(o.value)return o.value;if(o.nodes)for(const a of o.nodes)c+=n(a);return c};return n(e)},Rr}var Ar,Ps;function Iu(){return Ps||(Ps=1,Ar=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),Ar}var _r,Ns;function Ou(){if(Ns)return _r;Ns=1;const t=Iu(),e=(m,g,T)=>{if(t(m)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||m===g)return String(
29
- m);if(t(g)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...T};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let S=String(d.relaxZeros),E=String(d.shorthand),A=String(d.capture),b=String(d.wrap),x=m+":"+g+"="+S+E+A+b;if(e.cache.hasOwnProperty(x))return e.cache[x].result;let q=Math.min(m,g),M=Math.max(m,g);if(Math.abs(q-M)===1){let C=m+"|"+g;return d.capture?`(${C})`:d.wrap===!1?C:`(?:${C})`}let B=v(m)||v(g),F={min:m,
30
- max:g,a:q,b:M},I=[],L=[];if(B&&(F.isPadded=B,F.maxLen=String(F.max).length),q<0){let C=M<0?Math.abs(M):1;L=u(C,Math.abs(q),F,d),q=F.a=0}return M>=0&&(I=u(q,M,F,d)),F.negatives=L,F.positives=I,F.result=r(L,I),d.capture===!0?F.result=`(${F.result})`:d.wrap!==!1&&I.length+L.length>1&&(F.result=`(?:${F.result})`),e.cache[x]=F,F.result};function r(m,g,T){let d=s(m,g,"-",!1)||[],S=s(g,m,"",!1)||[],E=s(m,g,"-?",!0)||[];return d.concat(E).concat(S).join("|")}function n(m,g){let T=1,d=1,S=l(m,T),E=new Set(
31
- [g]);for(;m<=S&&S<=g;)E.add(S),T+=1,S=l(m,T);for(S=f(g+1,d)-1;m<S&&S<=g;)E.add(S),d+=1,S=f(g+1,d)-1;return E=[...E],E.sort(c),E}function o(m,g,T){if(m===g)return{pattern:m,count:[],digits:0};let d=i(m,g),S=d.length,E="",A=0;for(let b=0;b<S;b++){let[x,q]=d[b];x===q?E+=x:x!=="0"||q!=="9"?E+=h(x,q):A++}return A&&(E+=T.shorthand===!0?"\\d":"[0-9]"),{pattern:E,count:[A],digits:S}}function u(m,g,T,d){let S=n(m,g),E=[],A=m,b;for(let x=0;x<S.length;x++){let q=S[x],M=o(String(A),String(q),d),B="";if(!T.isPadded&&
32
- b&&b.pattern===M.pattern){b.count.length>1&&b.count.pop(),b.count.push(M.count[0]),b.string=b.pattern+p(b.count),A=q+1;continue}T.isPadded&&(B=w(q,T,d)),M.string=B+M.pattern+p(M.count),E.push(M),A=q+1,b=M}return E}function s(m,g,T,d,S){let E=[];for(let A of m){let{string:b}=A;!d&&!a(g,"string",b)&&E.push(T+b),d&&a(g,"string",b)&&E.push(T+b)}return E}function i(m,g){let T=[];for(let d=0;d<m.length;d++)T.push([m[d],g[d]]);return T}function c(m,g){return m>g?1:g>m?-1:0}function a(m,g,T){return m.some(
24
+ `)}`),new Error("likec4 app root does not exist");return r}async function br(){const t=await bt(it(Et(),".likec4-public-"));return await Oe(it(t,"likec4-views.js"),`// generated by likec4
25
+ `),t}const Er=1e4;function Rr(){const t=qs();return{"likec4/icons":z(t,"icons"),"likec4/react":z(t,"react/index.js"),"likec4/model":z(t,"dist/model/index.mjs"),"likec4/vite-plugin/internal":z(t,"dist/vite-plugin/internal.mjs")}}var Sr={},Hs;function Ar(){return Hs||(Hs=1,(function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,i)=>i===!1||!t.isInteger(e)||!t.
26
+ isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=i,t.escapeNode=(e,r=0,n)=>{const i=e.nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1,t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||
27
+ e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=i=>{for(let a=0;a<i.length;a++){const s=i[a];if(Array.isArray(s)){n(s);continue}s!==void 0&&r.push(s)}return r};return n(e),r}})(Sr)),Sr}var _r,Ms;function Cr(){if(Ms)return _r;Ms=1;const t=Ar();return _r=(e,r={})=>{const n=(i,a={})=>{const s=r.escapeInvalid&&t.isInvalidBrace(a),o=i.invalid===!0&&r.escapeInvalid===!0;let c="";if(i.value)return(s||o)&&
28
+ t.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const u of i.nodes)c+=n(u);return c};return n(e)},_r}var xr,Us;function Du(){return Us||(Us=1,xr=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),xr}var Tr,Fs;function qu(){if(Fs)return Tr;Fs=1;const t=Du(),e=(m,g,T)=>{if(t(m)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||m===g)return String(
29
+ m);if(t(g)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...T};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let S=String(d.relaxZeros),E=String(d.shorthand),A=String(d.capture),b=String(d.wrap),x=m+":"+g+"="+S+E+A+b;if(e.cache.hasOwnProperty(x))return e.cache[x].result;let q=Math.min(m,g),M=Math.max(m,g);if(Math.abs(q-M)===1){let C=m+"|"+g;return d.capture?`(${C})`:d.wrap===!1?C:`(?:${C})`}let V=v(m)||v(g),F={min:m,
30
+ max:g,a:q,b:M},L=[],I=[];if(V&&(F.isPadded=V,F.maxLen=String(F.max).length),q<0){let C=M<0?Math.abs(M):1;I=a(C,Math.abs(q),F,d),q=F.a=0}return M>=0&&(L=a(q,M,F,d)),F.negatives=I,F.positives=L,F.result=r(I,L),d.capture===!0?F.result=`(${F.result})`:d.wrap!==!1&&L.length+I.length>1&&(F.result=`(?:${F.result})`),e.cache[x]=F,F.result};function r(m,g,T){let d=s(m,g,"-",!1)||[],S=s(g,m,"",!1)||[],E=s(m,g,"-?",!0)||[];return d.concat(E).concat(S).join("|")}function n(m,g){let T=1,d=1,S=l(m,T),E=new Set(
31
+ [g]);for(;m<=S&&S<=g;)E.add(S),T+=1,S=l(m,T);for(S=f(g+1,d)-1;m<S&&S<=g;)E.add(S),d+=1,S=f(g+1,d)-1;return E=[...E],E.sort(c),E}function i(m,g,T){if(m===g)return{pattern:m,count:[],digits:0};let d=o(m,g),S=d.length,E="",A=0;for(let b=0;b<S;b++){let[x,q]=d[b];x===q?E+=x:x!=="0"||q!=="9"?E+=h(x,q):A++}return A&&(E+=T.shorthand===!0?"\\d":"[0-9]"),{pattern:E,count:[A],digits:S}}function a(m,g,T,d){let S=n(m,g),E=[],A=m,b;for(let x=0;x<S.length;x++){let q=S[x],M=i(String(A),String(q),d),V="";if(!T.isPadded&&
32
+ b&&b.pattern===M.pattern){b.count.length>1&&b.count.pop(),b.count.push(M.count[0]),b.string=b.pattern+p(b.count),A=q+1;continue}T.isPadded&&(V=w(q,T,d)),M.string=V+M.pattern+p(M.count),E.push(M),A=q+1,b=M}return E}function s(m,g,T,d,S){let E=[];for(let A of m){let{string:b}=A;!d&&!u(g,"string",b)&&E.push(T+b),d&&u(g,"string",b)&&E.push(T+b)}return E}function o(m,g){let T=[];for(let d=0;d<m.length;d++)T.push([m[d],g[d]]);return T}function c(m,g){return m>g?1:g>m?-1:0}function u(m,g,T){return m.some(
33
33
  d=>d[g]===T)}function l(m,g){return Number(String(m).slice(0,-g)+"9".repeat(g))}function f(m,g){return m-m%Math.pow(10,g)}function p(m){let[g=0,T=""]=m;return T||g>1?`{${g+(T?","+T:"")}}`:""}function h(m,g,T){return`[${m}${g-m===1?"":"-"}${g}]`}function v(m){return/^-?(0+)\d/.test(m)}function w(m,g,T){if(!g.isPadded)return m;let d=Math.abs(g.maxLen-String(m).length),S=T.relaxZeros!==!1;switch(d){case 0:return"";case 1:return S?"0?":"0";case 2:return S?"0{0,2}":"00";default:return S?`0{0,${d}}`:`\
34
- 0{${d}}`}}return e.cache={},e.clearCache=()=>e.cache={},_r=e,_r}var Cr,js;function Ds(){if(js)return Cr;js=1;const t=bs,e=Ou(),r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),n=d=>S=>d===!0?Number(S):String(S),o=d=>typeof d=="number"||typeof d=="string"&&d!=="",u=d=>Number.isInteger(+d),s=d=>{let S=`${d}`,E=-1;if(S[0]==="-"&&(S=S.slice(1)),S==="0")return!1;for(;S[++E]==="0";);return E>0},i=(d,S,E)=>typeof d=="string"||typeof S=="string"?!0:E.stringify===!0,c=(d,S,E)=>{if(S>0){let A=d[0]==="\
35
- -"?"-":"";A&&(d=d.slice(1)),d=A+d.padStart(A?S-1:S,"0")}return E===!1?String(d):d},a=(d,S)=>{let E=d[0]==="-"?"-":"";for(E&&(d=d.slice(1),S--);d.length<S;)d="0"+d;return E?"-"+d:d},l=(d,S,E)=>{d.negatives.sort((M,B)=>M<B?-1:M>B?1:0),d.positives.sort((M,B)=>M<B?-1:M>B?1:0);let A=S.capture?"":"?:",b="",x="",q;return d.positives.length&&(b=d.positives.map(M=>a(String(M),E)).join("|")),d.negatives.length&&(x=`-(${A}${d.negatives.map(M=>a(String(M),E)).join("|")})`),b&&x?q=`${b}|${x}`:q=b||x,S.wrap?`\
34
+ 0{${d}}`}}return e.cache={},e.clearCache=()=>e.cache={},Tr=e,Tr}var Ir,Gs;function Bs(){if(Gs)return Ir;Gs=1;const t=_s,e=qu(),r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),n=d=>S=>d===!0?Number(S):String(S),i=d=>typeof d=="number"||typeof d=="string"&&d!=="",a=d=>Number.isInteger(+d),s=d=>{let S=`${d}`,E=-1;if(S[0]==="-"&&(S=S.slice(1)),S==="0")return!1;for(;S[++E]==="0";);return E>0},o=(d,S,E)=>typeof d=="string"||typeof S=="string"?!0:E.stringify===!0,c=(d,S,E)=>{if(S>0){let A=d[0]==="\
35
+ -"?"-":"";A&&(d=d.slice(1)),d=A+d.padStart(A?S-1:S,"0")}return E===!1?String(d):d},u=(d,S)=>{let E=d[0]==="-"?"-":"";for(E&&(d=d.slice(1),S--);d.length<S;)d="0"+d;return E?"-"+d:d},l=(d,S,E)=>{d.negatives.sort((M,V)=>M<V?-1:M>V?1:0),d.positives.sort((M,V)=>M<V?-1:M>V?1:0);let A=S.capture?"":"?:",b="",x="",q;return d.positives.length&&(b=d.positives.map(M=>u(String(M),E)).join("|")),d.negatives.length&&(x=`-(${A}${d.negatives.map(M=>u(String(M),E)).join("|")})`),b&&x?q=`${b}|${x}`:q=b||x,S.wrap?`\
36
36
  (${A}${q})`:q},f=(d,S,E,A)=>{if(E)return e(d,S,{wrap:!1,...A});let b=String.fromCharCode(d);if(d===S)return b;let x=String.fromCharCode(S);return`[${b}-${x}]`},p=(d,S,E)=>{if(Array.isArray(d)){let A=E.wrap===!0,b=E.capture?"":"?:";return A?`(${b}${d.join("|")})`:d.join("|")}return e(d,S,E)},h=(...d)=>new RangeError("Invalid range arguments: "+t.inspect(...d)),v=(d,S,E)=>{if(E.strictRanges===!0)throw h([d,S]);return[]},w=(d,S)=>{if(S.strictRanges===!0)throw new TypeError(`Expected step "${d}" to \
37
- be a number`);return[]},m=(d,S,E=1,A={})=>{let b=Number(d),x=Number(S);if(!Number.isInteger(b)||!Number.isInteger(x)){if(A.strictRanges===!0)throw h([d,S]);return[]}b===0&&(b=0),x===0&&(x=0);let q=b>x,M=String(d),B=String(S),F=String(E);E=Math.max(Math.abs(E),1);let I=s(M)||s(B)||s(F),L=I?Math.max(M.length,B.length,F.length):0,C=I===!1&&i(d,S,A)===!1,O=A.transform||n(C);if(A.toRegex&&E===1)return f(a(d,L),a(S,L),!0,A);let k={negatives:[],positives:[]},N=$=>k[$<0?"negatives":"positives"].push(Math.
38
- abs($)),D=[],H=0;for(;q?b>=x:b<=x;)A.toRegex===!0&&E>1?N(b):D.push(c(O(b,H),L,C)),b=q?b-E:b+E,H++;return A.toRegex===!0?E>1?l(k,A,L):p(D,null,{wrap:!1,...A}):D},g=(d,S,E=1,A={})=>{if(!u(d)&&d.length>1||!u(S)&&S.length>1)return v(d,S,A);let b=A.transform||(C=>String.fromCharCode(C)),x=`${d}`.charCodeAt(0),q=`${S}`.charCodeAt(0),M=x>q,B=Math.min(x,q),F=Math.max(x,q);if(A.toRegex&&E===1)return f(B,F,!1,A);let I=[],L=0;for(;M?x>=q:x<=q;)I.push(b(x,L)),x=M?x-E:x+E,L++;return A.toRegex===!0?p(I,null,{
39
- wrap:!1,options:A}):I},T=(d,S,E,A={})=>{if(S==null&&o(d))return[d];if(!o(d)||!o(S))return v(d,S,A);if(typeof E=="function")return T(d,S,1,{transform:E});if(r(E))return T(d,S,0,E);let b={...A};return b.capture===!0&&(b.wrap=!0),E=E||b.step||1,u(E)?u(d)&&u(S)?m(d,S,E,b):g(d,S,Math.max(Math.abs(E),1),b):E!=null&&!r(E)?w(E,b):T(d,S,1,E)};return Cr=T,Cr}var xr,qs;function Pu(){if(qs)return xr;qs=1;const t=Ds(),e=Er();return xr=(n,o={})=>{const u=(s,i={})=>{const c=e.isInvalidBrace(i),a=s.invalid===!0&&
40
- o.escapeInvalid===!0,l=c===!0||a===!0,f=o.escapeInvalid===!0?"\\":"";let p="";if(s.isOpen===!0)return f+s.value;if(s.isClose===!0)return console.log("node.isClose",f,s.value),f+s.value;if(s.type==="open")return l?f+s.value:"(";if(s.type==="close")return l?f+s.value:")";if(s.type==="comma")return s.prev.type==="comma"?"":l?s.value:"|";if(s.value)return s.value;if(s.nodes&&s.ranges>0){const h=e.reduce(s.nodes),v=t(...h,{...o,wrap:!1,toRegex:!0,strictZeros:!0});if(v.length!==0)return h.length>1&&v.
41
- length>1?`(${v})`:v}if(s.nodes)for(const h of s.nodes)p+=u(h,s);return p};return u(n)},xr}var Tr,Hs;function Nu(){if(Hs)return Tr;Hs=1;const t=Ds(),e=Sr(),r=Er(),n=(u="",s="",i=!1)=>{const c=[];if(u=[].concat(u),s=[].concat(s),!s.length)return u;if(!u.length)return i?r.flatten(s).map(a=>`{${a}}`):s;for(const a of u)if(Array.isArray(a))for(const l of a)c.push(n(l,s,i));else for(let l of s)i===!0&&typeof l=="string"&&(l=`{${l}}`),c.push(Array.isArray(l)?n(a,l,i):a+l);return r.flatten(c)};return Tr=
42
- (u,s={})=>{const i=s.rangeLimit===void 0?1e3:s.rangeLimit,c=(a,l={})=>{a.queue=[];let f=l,p=l.queue;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,p=f.queue;if(a.invalid||a.dollar){p.push(n(p.pop(),e(a,s)));return}if(a.type==="brace"&&a.invalid!==!0&&a.nodes.length===2){p.push(n(p.pop(),["{}"]));return}if(a.nodes&&a.ranges>0){const m=r.reduce(a.nodes);if(r.exceedsLimit(...m,s.step,i))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase\
43
- or disable the limit.");let g=t(...m,s);g.length===0&&(g=e(a,s)),p.push(n(p.pop(),g)),a.nodes=[];return}const h=r.encloseBrace(a);let v=a.queue,w=a;for(;w.type!=="brace"&&w.type!=="root"&&w.parent;)w=w.parent,v=w.queue;for(let m=0;m<a.nodes.length;m++){const g=a.nodes[m];if(g.type==="comma"&&a.type==="brace"){m===1&&v.push(""),v.push("");continue}if(g.type==="close"){p.push(n(p.pop(),v,h));continue}if(g.value&&g.type!=="open"){v.push(n(v.pop(),g.value));continue}g.nodes&&c(g,a)}return v};return r.
44
- flatten(c(u))},Tr}var Lr,Ms;function ju(){return Ms||(Ms=1,Lr={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\
37
+ be a number`);return[]},m=(d,S,E=1,A={})=>{let b=Number(d),x=Number(S);if(!Number.isInteger(b)||!Number.isInteger(x)){if(A.strictRanges===!0)throw h([d,S]);return[]}b===0&&(b=0),x===0&&(x=0);let q=b>x,M=String(d),V=String(S),F=String(E);E=Math.max(Math.abs(E),1);let L=s(M)||s(V)||s(F),I=L?Math.max(M.length,V.length,F.length):0,C=L===!1&&o(d,S,A)===!1,k=A.transform||n(C);if(A.toRegex&&E===1)return f(u(d,I),u(S,I),!0,A);let O={negatives:[],positives:[]},P=$=>O[$<0?"negatives":"positives"].push(Math.
38
+ abs($)),D=[],H=0;for(;q?b>=x:b<=x;)A.toRegex===!0&&E>1?P(b):D.push(c(k(b,H),I,C)),b=q?b-E:b+E,H++;return A.toRegex===!0?E>1?l(O,A,I):p(D,null,{wrap:!1,...A}):D},g=(d,S,E=1,A={})=>{if(!a(d)&&d.length>1||!a(S)&&S.length>1)return v(d,S,A);let b=A.transform||(C=>String.fromCharCode(C)),x=`${d}`.charCodeAt(0),q=`${S}`.charCodeAt(0),M=x>q,V=Math.min(x,q),F=Math.max(x,q);if(A.toRegex&&E===1)return f(V,F,!1,A);let L=[],I=0;for(;M?x>=q:x<=q;)L.push(b(x,I)),x=M?x-E:x+E,I++;return A.toRegex===!0?p(L,null,{
39
+ wrap:!1,options:A}):L},T=(d,S,E,A={})=>{if(S==null&&i(d))return[d];if(!i(d)||!i(S))return v(d,S,A);if(typeof E=="function")return T(d,S,1,{transform:E});if(r(E))return T(d,S,0,E);let b={...A};return b.capture===!0&&(b.wrap=!0),E=E||b.step||1,a(E)?a(d)&&a(S)?m(d,S,E,b):g(d,S,Math.max(Math.abs(E),1),b):E!=null&&!r(E)?w(E,b):T(d,S,1,E)};return Ir=T,Ir}var Or,Vs;function Hu(){if(Vs)return Or;Vs=1;const t=Bs(),e=Ar();return Or=(n,i={})=>{const a=(s,o={})=>{const c=e.isInvalidBrace(o),u=s.invalid===!0&&
40
+ i.escapeInvalid===!0,l=c===!0||u===!0,f=i.escapeInvalid===!0?"\\":"";let p="";if(s.isOpen===!0)return f+s.value;if(s.isClose===!0)return console.log("node.isClose",f,s.value),f+s.value;if(s.type==="open")return l?f+s.value:"(";if(s.type==="close")return l?f+s.value:")";if(s.type==="comma")return s.prev.type==="comma"?"":l?s.value:"|";if(s.value)return s.value;if(s.nodes&&s.ranges>0){const h=e.reduce(s.nodes),v=t(...h,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if(v.length!==0)return h.length>1&&v.
41
+ length>1?`(${v})`:v}if(s.nodes)for(const h of s.nodes)p+=a(h,s);return p};return a(n)},Or}var Lr,zs;function Mu(){if(zs)return Lr;zs=1;const t=Bs(),e=Cr(),r=Ar(),n=(a="",s="",o=!1)=>{const c=[];if(a=[].concat(a),s=[].concat(s),!s.length)return a;if(!a.length)return o?r.flatten(s).map(u=>`{${u}}`):s;for(const u of a)if(Array.isArray(u))for(const l of u)c.push(n(l,s,o));else for(let l of s)o===!0&&typeof l=="string"&&(l=`{${l}}`),c.push(Array.isArray(l)?n(u,l,o):u+l);return r.flatten(c)};return Lr=
42
+ (a,s={})=>{const o=s.rangeLimit===void 0?1e3:s.rangeLimit,c=(u,l={})=>{u.queue=[];let f=l,p=l.queue;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,p=f.queue;if(u.invalid||u.dollar){p.push(n(p.pop(),e(u,s)));return}if(u.type==="brace"&&u.invalid!==!0&&u.nodes.length===2){p.push(n(p.pop(),["{}"]));return}if(u.nodes&&u.ranges>0){const m=r.reduce(u.nodes);if(r.exceedsLimit(...m,s.step,o))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase\
43
+ or disable the limit.");let g=t(...m,s);g.length===0&&(g=e(u,s)),p.push(n(p.pop(),g)),u.nodes=[];return}const h=r.encloseBrace(u);let v=u.queue,w=u;for(;w.type!=="brace"&&w.type!=="root"&&w.parent;)w=w.parent,v=w.queue;for(let m=0;m<u.nodes.length;m++){const g=u.nodes[m];if(g.type==="comma"&&u.type==="brace"){m===1&&v.push(""),v.push("");continue}if(g.type==="close"){p.push(n(p.pop(),v,h));continue}if(g.value&&g.type!=="open"){v.push(n(v.pop(),g.value));continue}g.nodes&&c(g,u)}return v};return r.
44
+ flatten(c(a))},Lr}var kr,Ws;function Uu(){return Ws||(Ws=1,kr={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\
45
45
  \f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
46
- `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),Lr}var kr,Us;function Du(){if(Us)return kr;Us=1;const t=Sr(),{MAX_LENGTH:e,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:o,CHAR_DOT:u,CHAR_LEFT_PARENTHESES:s,CHAR_RIGHT_PARENTHESES:i,
47
- CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:a,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:v,CHAR_ZERO_WIDTH_NOBREAK_SPACE:w}=ju();return kr=(g,T={})=>{if(typeof g!="string")throw new TypeError("Expected a string");const d=T||{},S=typeof d.maxLength=="number"?Math.min(e,d.maxLength):e;if(g.length>S)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${S})`);const E={type:"root",input:g,nodes:[]},A=[E];
48
- let b=E,x=E,q=0;const M=g.length;let B=0,F=0,I;const L=()=>g[B++],C=O=>{if(O.type==="text"&&x.type==="dot"&&(x.type="text"),x&&x.type==="text"&&O.type==="text"){x.value+=O.value;return}return b.nodes.push(O),O.parent=b,O.prev=x,x=O,O};for(C({type:"bos"});B<M;)if(b=A[A.length-1],I=L(),!(I===w||I===v)){if(I===r){C({type:"text",value:(T.keepEscaping?I:"")+L()});continue}if(I===f){C({type:"text",value:"\\"+I});continue}if(I===l){q++;let O;for(;B<M&&(O=L());){if(I+=O,O===l){q++;continue}if(O===r){I+=
49
- L();continue}if(O===f&&(q--,q===0))break}C({type:"text",value:I});continue}if(I===s){b=C({type:"paren",nodes:[]}),A.push(b),C({type:"text",value:I});continue}if(I===i){if(b.type!=="paren"){C({type:"text",value:I});continue}b=A.pop(),C({type:"text",value:I}),b=A[A.length-1];continue}if(I===p||I===h||I===n){const O=I;let k;for(T.keepQuotes!==!0&&(I="");B<M&&(k=L());){if(k===r){I+=k+L();continue}if(k===O){T.keepQuotes===!0&&(I+=k);break}I+=k}C({type:"text",value:I});continue}if(I===c){F++;const k={
50
- type:"brace",open:!0,close:!1,dollar:x.value&&x.value.slice(-1)==="$"||b.dollar===!0,depth:F,commas:0,ranges:0,nodes:[]};b=C(k),A.push(b),C({type:"open",value:I});continue}if(I===a){if(b.type!=="brace"){C({type:"text",value:I});continue}const O="close";b=A.pop(),b.close=!0,C({type:O,value:I}),F--,b=A[A.length-1];continue}if(I===o&&F>0){if(b.ranges>0){b.ranges=0;const O=b.nodes.shift();b.nodes=[O,{type:"text",value:t(b)}]}C({type:"comma",value:I}),b.commas++;continue}if(I===u&&F>0&&b.commas===0){
51
- const O=b.nodes;if(F===0||O.length===0){C({type:"text",value:I});continue}if(x.type==="dot"){if(b.range=[],x.value+=I,x.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,x.type="text";continue}b.ranges++,b.args=[];continue}if(x.type==="range"){O.pop();const k=O[O.length-1];k.value+=x.value+I,x=k,b.ranges--;continue}C({type:"dot",value:I});continue}C({type:"text",value:I})}do if(b=A.pop(),b.type!=="root"){b.nodes.forEach(N=>{N.nodes||(N.type==="open"&&(N.isOpen=!0),N.type===
52
- "close"&&(N.isClose=!0),N.nodes||(N.type="text"),N.invalid=!0)});const O=A[A.length-1],k=O.nodes.indexOf(b);O.nodes.splice(k,1,...b.nodes)}while(A.length>0);return C({type:"eos"}),E},kr}var Ir,Fs;function qu(){if(Fs)return Ir;Fs=1;const t=Sr(),e=Pu(),r=Nu(),n=Du(),o=(u,s={})=>{let i=[];if(Array.isArray(u))for(const c of u){const a=o.create(c,s);Array.isArray(a)?i.push(...a):i.push(a)}else i=[].concat(o.create(u,s));return s&&s.expand===!0&&s.nodupes===!0&&(i=[...new Set(i)]),i};return o.parse=(u,s={})=>n(
53
- u,s),o.stringify=(u,s={})=>t(typeof u=="string"?o.parse(u,s):u,s),o.compile=(u,s={})=>(typeof u=="string"&&(u=o.parse(u,s)),e(u,s)),o.expand=(u,s={})=>{typeof u=="string"&&(u=o.parse(u,s));let i=r(u,s);return s.noempty===!0&&(i=i.filter(Boolean)),s.nodupes===!0&&(i=[...new Set(i)]),i},o.create=(u,s={})=>u===""||u.length<3?[u]:s.expand!==!0?o.compile(u,s):o.expand(u,s),Ir=o,Ir}var Or={},Pr,Gs;function St(){if(Gs)return Pr;Gs=1;const t=ur,e="\\\\/",r=`[^${e}]`,n="\\.",o="\\+",u="\\?",s="\\/",i="(?\
54
- =.)",c="[^/]",a=`(?:${s}|$)`,l=`(?:^|${s})`,f=`${n}{1,2}${a}`,p=`(?!${n})`,h=`(?!${l}${f})`,v=`(?!${n}{0,1}${a})`,w=`(?!${f})`,m=`[^.${s}]`,g=`${c}*?`,T={DOT_LITERAL:n,PLUS_LITERAL:o,QMARK_LITERAL:u,SLASH_LITERAL:s,ONE_CHAR:i,QMARK:c,END_ANCHOR:a,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:h,NO_DOT_SLASH:v,NO_DOTS_SLASH:w,QMARK_NO_DOT:m,STAR:g,START_ANCHOR:l},d={...T,SLASH_LITERAL:`[${e}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
55
- NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},S={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Pr={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:S,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
46
+ `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),kr}var Nr,Xs;function Fu(){if(Xs)return Nr;Xs=1;const t=Cr(),{MAX_LENGTH:e,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:a,CHAR_LEFT_PARENTHESES:s,CHAR_RIGHT_PARENTHESES:o,
47
+ CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:p,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:v,CHAR_ZERO_WIDTH_NOBREAK_SPACE:w}=Uu();return Nr=(g,T={})=>{if(typeof g!="string")throw new TypeError("Expected a string");const d=T||{},S=typeof d.maxLength=="number"?Math.min(e,d.maxLength):e;if(g.length>S)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${S})`);const E={type:"root",input:g,nodes:[]},A=[E];
48
+ let b=E,x=E,q=0;const M=g.length;let V=0,F=0,L;const I=()=>g[V++],C=k=>{if(k.type==="text"&&x.type==="dot"&&(x.type="text"),x&&x.type==="text"&&k.type==="text"){x.value+=k.value;return}return b.nodes.push(k),k.parent=b,k.prev=x,x=k,k};for(C({type:"bos"});V<M;)if(b=A[A.length-1],L=I(),!(L===w||L===v)){if(L===r){C({type:"text",value:(T.keepEscaping?L:"")+I()});continue}if(L===f){C({type:"text",value:"\\"+L});continue}if(L===l){q++;let k;for(;V<M&&(k=I());){if(L+=k,k===l){q++;continue}if(k===r){L+=
49
+ I();continue}if(k===f&&(q--,q===0))break}C({type:"text",value:L});continue}if(L===s){b=C({type:"paren",nodes:[]}),A.push(b),C({type:"text",value:L});continue}if(L===o){if(b.type!=="paren"){C({type:"text",value:L});continue}b=A.pop(),C({type:"text",value:L}),b=A[A.length-1];continue}if(L===p||L===h||L===n){const k=L;let O;for(T.keepQuotes!==!0&&(L="");V<M&&(O=I());){if(O===r){L+=O+I();continue}if(O===k){T.keepQuotes===!0&&(L+=O);break}L+=O}C({type:"text",value:L});continue}if(L===c){F++;const O={
50
+ type:"brace",open:!0,close:!1,dollar:x.value&&x.value.slice(-1)==="$"||b.dollar===!0,depth:F,commas:0,ranges:0,nodes:[]};b=C(O),A.push(b),C({type:"open",value:L});continue}if(L===u){if(b.type!=="brace"){C({type:"text",value:L});continue}const k="close";b=A.pop(),b.close=!0,C({type:k,value:L}),F--,b=A[A.length-1];continue}if(L===i&&F>0){if(b.ranges>0){b.ranges=0;const k=b.nodes.shift();b.nodes=[k,{type:"text",value:t(b)}]}C({type:"comma",value:L}),b.commas++;continue}if(L===a&&F>0&&b.commas===0){
51
+ const k=b.nodes;if(F===0||k.length===0){C({type:"text",value:L});continue}if(x.type==="dot"){if(b.range=[],x.value+=L,x.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,x.type="text";continue}b.ranges++,b.args=[];continue}if(x.type==="range"){k.pop();const O=k[k.length-1];O.value+=x.value+L,x=O,b.ranges--;continue}C({type:"dot",value:L});continue}C({type:"text",value:L})}do if(b=A.pop(),b.type!=="root"){b.nodes.forEach(P=>{P.nodes||(P.type==="open"&&(P.isOpen=!0),P.type===
52
+ "close"&&(P.isClose=!0),P.nodes||(P.type="text"),P.invalid=!0)});const k=A[A.length-1],O=k.nodes.indexOf(b);k.nodes.splice(O,1,...b.nodes)}while(A.length>0);return C({type:"eos"}),E},Nr}var Pr,Ks;function Gu(){if(Ks)return Pr;Ks=1;const t=Cr(),e=Hu(),r=Mu(),n=Fu(),i=(a,s={})=>{let o=[];if(Array.isArray(a))for(const c of a){const u=i.create(c,s);Array.isArray(u)?o.push(...u):o.push(u)}else o=[].concat(i.create(a,s));return s&&s.expand===!0&&s.nodupes===!0&&(o=[...new Set(o)]),o};return i.parse=(a,s={})=>n(
53
+ a,s),i.stringify=(a,s={})=>t(typeof a=="string"?i.parse(a,s):a,s),i.compile=(a,s={})=>(typeof a=="string"&&(a=i.parse(a,s)),e(a,s)),i.expand=(a,s={})=>{typeof a=="string"&&(a=i.parse(a,s));let o=r(a,s);return s.noempty===!0&&(o=o.filter(Boolean)),s.nodupes===!0&&(o=[...new Set(o)]),o},i.create=(a,s={})=>a===""||a.length<3?[a]:s.expand!==!0?i.compile(a,s):i.expand(a,s),Pr=i,Pr}var jr={},Dr,Ys;function At(){if(Ys)return Dr;Ys=1;const t=pr,e="\\\\/",r=`[^${e}]`,n="\\.",i="\\+",a="\\?",s="\\/",o="(?\
54
+ =.)",c="[^/]",u=`(?:${s}|$)`,l=`(?:^|${s})`,f=`${n}{1,2}${u}`,p=`(?!${n})`,h=`(?!${l}${f})`,v=`(?!${n}{0,1}${u})`,w=`(?!${f})`,m=`[^.${s}]`,g=`${c}*?`,T={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:a,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:c,END_ANCHOR:u,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:h,NO_DOT_SLASH:v,NO_DOTS_SLASH:w,QMARK_NO_DOT:m,STAR:g,START_ANCHOR:l},d={...T,SLASH_LITERAL:`[${e}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
55
+ NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},S={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Dr={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:S,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
56
56
  REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,
57
57
  CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,
58
- CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?d:T}},Pr}var Bs;function At(){return Bs||(Bs=1,(function(t){const e=ur,r=process.
59
- platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_GLOBAL:s}=St();t.isObject=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),t.hasRegexChars=i=>u.test(i),t.isRegexChar=i=>i.length===1&&t.hasRegexChars(i),t.escapeRegex=i=>i.replace(s,"\\$1"),t.toPosixSlashes=i=>i.replace(n,"/"),t.removeBackslashes=i=>i.replace(o,c=>c==="\\"?"":c),t.supportsLookbehinds=()=>{const i=process.version.slice(1).split(".").map(Number);return i.length===3&&i[0]>=9||
60
- i[0]===8&&i[1]>=10},t.isWindows=i=>i&&typeof i.windows=="boolean"?i.windows:r===!0||e.sep==="\\",t.escapeLast=(i,c,a)=>{const l=i.lastIndexOf(c,a);return l===-1?i:i[l-1]==="\\"?t.escapeLast(i,c,l-1):`${i.slice(0,l)}\\${i.slice(l)}`},t.removePrefix=(i,c={})=>{let a=i;return a.startsWith("./")&&(a=a.slice(2),c.prefix="./"),a},t.wrapOutput=(i,c={},a={})=>{const l=a.contains?"":"^",f=a.contains?"":"$";let p=`${l}(?:${i})${f}`;return c.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Or)),Or}var Nr,Vs;function Hu(){
61
- if(Vs)return Nr;Vs=1;const t=At(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:o,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:s,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:a,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:w}=St(),m=d=>d===i||d===n,g=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return Nr=(d,S)=>{const E=S||{},A=d.length-1,b=E.parts===!0||E.scanToEnd===!0,x=[],q=[],
62
- M=[];let B=d,F=-1,I=0,L=0,C=!1,O=!1,k=!1,N=!1,D=!1,H=!1,$=!1,U=!1,Y=!1,Q=!1,R=0,_,K,z={value:"",depth:0,isGlob:!1};const me=()=>F>=A,Ae=()=>B.charCodeAt(F+1),re=()=>(_=K,B.charCodeAt(++F));for(;F<A;){K=re();let G;if(K===n){$=z.backslashes=!0,K=re(),K===c&&(H=!0);continue}if(H===!0||K===c){for(R++;me()!==!0&&(K=re());){if(K===n){$=z.backslashes=!0,re();continue}if(K===c){R++;continue}if(H!==!0&&K===u&&(K=re())===u){if(C=z.isBrace=!0,k=z.isGlob=!0,Q=!0,b===!0)continue;break}if(H!==!0&&K===o){if(C=
63
- z.isBrace=!0,k=z.isGlob=!0,Q=!0,b===!0)continue;break}if(K===h&&(R--,R===0)){H=!1,C=z.isBrace=!0,Q=!0;break}}if(b===!0)continue;break}if(K===i){if(x.push(F),q.push(z),z={value:"",depth:0,isGlob:!1},Q===!0)continue;if(_===u&&F===I+1){I+=2;continue}L=F+1;continue}if(E.noext!==!0&&(K===f||K===r||K===e||K===p||K===s)===!0&&Ae()===a){if(k=z.isGlob=!0,N=z.isExtglob=!0,Q=!0,K===s&&F===I&&(Y=!0),b===!0){for(;me()!==!0&&(K=re());){if(K===n){$=z.backslashes=!0,K=re();continue}if(K===v){k=z.isGlob=!0,Q=!0;
64
- break}}continue}break}if(K===e){if(_===e&&(D=z.isGlobstar=!0),k=z.isGlob=!0,Q=!0,b===!0)continue;break}if(K===p){if(k=z.isGlob=!0,Q=!0,b===!0)continue;break}if(K===l){for(;me()!==!0&&(G=re());){if(G===n){$=z.backslashes=!0,re();continue}if(G===w){O=z.isBracket=!0,k=z.isGlob=!0,Q=!0;break}}if(b===!0)continue;break}if(E.nonegate!==!0&&K===s&&F===I){U=z.negated=!0,I++;continue}if(E.noparen!==!0&&K===a){if(k=z.isGlob=!0,b===!0){for(;me()!==!0&&(K=re());){if(K===a){$=z.backslashes=!0,K=re();continue}
65
- if(K===v){Q=!0;break}}continue}break}if(k===!0){if(Q=!0,b===!0)continue;break}}E.noext===!0&&(N=!1,k=!1);let ne=B,Ze="",$e="";I>0&&(Ze=B.slice(0,I),B=B.slice(I),L-=I),ne&&k===!0&&L>0?(ne=B.slice(0,L),$e=B.slice(L)):k===!0?(ne="",$e=B):ne=B,ne&&ne!==""&&ne!=="/"&&ne!==B&&m(ne.charCodeAt(ne.length-1))&&(ne=ne.slice(0,-1)),E.unescape===!0&&($e&&($e=t.removeBackslashes($e)),ne&&$===!0&&(ne=t.removeBackslashes(ne)));const le={prefix:Ze,input:d,start:I,base:ne,glob:$e,isBrace:C,isBracket:O,isGlob:k,isExtglob:N,
66
- isGlobstar:D,negated:U,negatedExtglob:Y};if(E.tokens===!0&&(le.maxDepth=0,m(K)||q.push(z),le.tokens=q),E.parts===!0||E.tokens===!0){let G;for(let oe=0;oe<x.length;oe++){const Zt=G?G+1:I,j=x[oe],Z=d.slice(Zt,j);E.tokens&&(oe===0&&I!==0?(q[oe].isPrefix=!0,q[oe].value=Ze):q[oe].value=Z,g(q[oe]),le.maxDepth+=q[oe].depth),(oe!==0||Z!=="")&&M.push(Z),G=j}if(G&&G+1<d.length){const oe=d.slice(G+1);M.push(oe),E.tokens&&(q[q.length-1].value=oe,g(q[q.length-1]),le.maxDepth+=q[q.length-1].depth)}le.slashes=
67
- x,le.parts=M}return le},Nr}var jr,Ws;function Mu(){if(Ws)return jr;Ws=1;const t=St(),e=At(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:s}=t,i=(l,f)=>{if(typeof f.expandRange=="function")return f.expandRange(...l,f);l.sort();const p=`[${l.join("-")}]`;try{new RegExp(p)}catch{return l.map(v=>e.escapeRegex(v)).join("..")}return p},c=(l,f)=>`Missing ${l}: "${f}" - use "\\\\${f}" to match literal characters`,a=(l,f)=>{if(typeof l!="string")
68
- throw new TypeError("Expected a string");l=s[l]||l;const p={...f},h=typeof p.maxLength=="number"?Math.min(r,p.maxLength):r;let v=l.length;if(v>h)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${h}`);const w={type:"bos",value:"",output:p.prepend||""},m=[w],g=p.capture?"":"?:",T=e.isWindows(f),d=t.globChars(T),S=t.extglobChars(d),{DOT_LITERAL:E,PLUS_LITERAL:A,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:q,NO_DOT:M,NO_DOT_SLASH:B,NO_DOTS_SLASH:F,QMARK:I,QMARK_NO_DOT:L,STAR:C,START_ANCHOR:O}=d,
69
- k=j=>`(${g}(?:(?!${O}${j.dot?q:E}).)*?)`,N=p.dot?"":M,D=p.dot?I:L;let H=p.bash===!0?k(p):C;p.capture&&(H=`(${H})`),typeof p.noext=="boolean"&&(p.noextglob=p.noext);const $={input:l,index:-1,start:0,dot:p.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=e.removePrefix(l,$),v=l.length;const U=[],Y=[],Q=[];let R=w,_;const K=()=>$.index===v-1,z=$.peek=(j=1)=>l[$.index+j],me=$.advance=()=>l[++$.index]||"",Ae=()=>l.slice($.index+
70
- 1),re=(j="",Z=0)=>{$.consumed+=j,$.index+=Z},ne=j=>{$.output+=j.output!=null?j.output:j.value,re(j.value)},Ze=()=>{let j=1;for(;z()==="!"&&(z(2)!=="("||z(3)==="?");)me(),$.start++,j++;return j%2===0?!1:($.negated=!0,$.start++,!0)},$e=j=>{$[j]++,Q.push(j)},le=j=>{$[j]--,Q.pop()},G=j=>{if(R.type==="globstar"){const Z=$.braces>0&&(j.type==="comma"||j.type==="brace"),P=j.extglob===!0||U.length&&(j.type==="pipe"||j.type==="paren");j.type!=="slash"&&j.type!=="paren"&&!Z&&!P&&($.output=$.output.slice(0,
71
- -R.output.length),R.type="star",R.value="*",R.output=H,$.output+=R.output)}if(U.length&&j.type!=="paren"&&(U[U.length-1].inner+=j.value),(j.value||j.output)&&ne(j),R&&R.type==="text"&&j.type==="text"){R.value+=j.value,R.output=(R.output||"")+j.value;return}j.prev=R,m.push(j),R=j},oe=(j,Z)=>{const P={...S[Z],conditions:1,inner:""};P.prev=R,P.parens=$.parens,P.output=$.output;const J=(p.capture?"(":"")+P.open;$e("parens"),G({type:j,value:Z,output:$.output?"":x}),G({type:"paren",extglob:!0,value:me(),
72
- output:J}),U.push(P)},Zt=j=>{let Z=j.close+(p.capture?")":""),P;if(j.type==="negate"){let J=H;if(j.inner&&j.inner.length>1&&j.inner.includes("/")&&(J=k(p)),(J!==H||K()||/^\)+$/.test(Ae()))&&(Z=j.close=`)$))${J}`),j.inner.includes("*")&&(P=Ae())&&/^\.[^\\/.]+$/.test(P)){const te=a(P,{...f,fastpaths:!1}).output;Z=j.close=`)${te})${J})`}j.prev.type==="bos"&&($.negatedExtglob=!0)}G({type:"paren",extglob:!0,value:_,output:Z}),le("parens")};if(p.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let j=!1,
73
- Z=l.replace(u,(P,J,te,fe,ie,er)=>fe==="\\"?(j=!0,P):fe==="?"?J?J+fe+(ie?I.repeat(ie.length):""):er===0?D+(ie?I.repeat(ie.length):""):I.repeat(te.length):fe==="."?E.repeat(te.length):fe==="*"?J?J+fe+(ie?H:""):H:J?P:`\\${P}`);return j===!0&&(p.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),Z===l&&p.contains===!0?($.output=l,$):($.output=e.wrapOutput(Z,$,f),$)}for(;!K();){if(_=me(),_==="\0")continue;if(_==="\\"){const P=z();if(P==="/"&&p.bash!==!0||P==="\
74
- ."||P===";")continue;if(!P){_+="\\",G({type:"text",value:_});continue}const J=/^\\+/.exec(Ae());let te=0;if(J&&J[0].length>2&&(te=J[0].length,$.index+=te,te%2!==0&&(_+="\\")),p.unescape===!0?_=me():_+=me(),$.brackets===0){G({type:"text",value:_});continue}}if($.brackets>0&&(_!=="]"||R.value==="["||R.value==="[^")){if(p.posix!==!1&&_===":"){const P=R.value.slice(1);if(P.includes("[")&&(R.posix=!0,P.includes(":"))){const J=R.value.lastIndexOf("["),te=R.value.slice(0,J),fe=R.value.slice(J+2),ie=n[fe];
75
- if(ie){R.value=te+ie,$.backtrack=!0,me(),!w.output&&m.indexOf(R)===1&&(w.output=x);continue}}}(_==="["&&z()!==":"||_==="-"&&z()==="]")&&(_=`\\${_}`),_==="]"&&(R.value==="["||R.value==="[^")&&(_=`\\${_}`),p.posix===!0&&_==="!"&&R.value==="["&&(_="^"),R.value+=_,ne({value:_});continue}if($.quotes===1&&_!=='"'){_=e.escapeRegex(_),R.value+=_,ne({value:_});continue}if(_==='"'){$.quotes=$.quotes===1?0:1,p.keepQuotes===!0&&G({type:"text",value:_});continue}if(_==="("){$e("parens"),G({type:"paren",value:_});
76
- continue}if(_===")"){if($.parens===0&&p.strictBrackets===!0)throw new SyntaxError(c("opening","("));const P=U[U.length-1];if(P&&$.parens===P.parens+1){Zt(U.pop());continue}G({type:"paren",value:_,output:$.parens?")":"\\)"}),le("parens");continue}if(_==="["){if(p.nobracket===!0||!Ae().includes("]")){if(p.nobracket!==!0&&p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));_=`\\${_}`}else $e("brackets");G({type:"bracket",value:_});continue}if(_==="]"){if(p.nobracket===!0||R&&R.type==="bra\
77
- cket"&&R.value.length===1){G({type:"text",value:_,output:`\\${_}`});continue}if($.brackets===0){if(p.strictBrackets===!0)throw new SyntaxError(c("opening","["));G({type:"text",value:_,output:`\\${_}`});continue}le("brackets");const P=R.value.slice(1);if(R.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(_=`/${_}`),R.value+=_,ne({value:_}),p.literalBrackets===!1||e.hasRegexChars(P))continue;const J=e.escapeRegex(R.value);if($.output=$.output.slice(0,-R.value.length),p.literalBrackets===!0){$.output+=J,
78
- R.value=J;continue}R.value=`(${g}${J}|${R.value})`,$.output+=R.value;continue}if(_==="{"&&p.nobrace!==!0){$e("braces");const P={type:"brace",value:_,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};Y.push(P),G(P);continue}if(_==="}"){const P=Y[Y.length-1];if(p.nobrace===!0||!P){G({type:"text",value:_,output:_});continue}let J=")";if(P.dots===!0){const te=m.slice(),fe=[];for(let ie=te.length-1;ie>=0&&(m.pop(),te[ie].type!=="brace");ie--)te[ie].type!=="dots"&&fe.unshift(te[ie].value);
79
- J=i(fe,p),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const te=$.output.slice(0,P.outputIndex),fe=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",_=J="\\}",$.output=te;for(const ie of fe)$.output+=ie.output||ie.value}G({type:"brace",value:_,output:J}),le("braces"),Y.pop();continue}if(_==="|"){U.length>0&&U[U.length-1].conditions++,G({type:"text",value:_});continue}if(_===","){let P=_;const J=Y[Y.length-1];J&&Q[Q.length-1]==="braces"&&(J.comma=!0,P="|"),G({type:"comma",value:_,output:P});continue}
80
- if(_==="/"){if(R.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",m.pop(),R=w;continue}G({type:"slash",value:_,output:b});continue}if(_==="."){if($.braces>0&&R.type==="dot"){R.value==="."&&(R.output=E);const P=Y[Y.length-1];R.type="dots",R.output+=_,R.value+=_,P.dots=!0;continue}if($.braces+$.parens===0&&R.type!=="bos"&&R.type!=="slash"){G({type:"text",value:_,output:E});continue}G({type:"dot",value:_,output:E});continue}if(_==="?"){if(!(R&&R.value==="(")&&p.noextglob!==
81
- !0&&z()==="("&&z(2)!=="?"){oe("qmark",_);continue}if(R&&R.type==="paren"){const J=z();let te=_;if(J==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(R.value==="("&&!/[!=<:]/.test(J)||J==="<"&&!/<([!=]|\w+>)/.test(Ae()))&&(te=`\\${_}`),G({type:"text",value:_,output:te});continue}if(p.dot!==!0&&(R.type==="slash"||R.type==="bos")){G({type:"qmark",value:_,output:L});continue}G({type:"qmark",value:_,output:I});continue}if(_==="!"){if(p.noextglob!==
82
- !0&&z()==="("&&(z(2)!=="?"||!/[!=<:]/.test(z(3)))){oe("negate",_);continue}if(p.nonegate!==!0&&$.index===0){Ze();continue}}if(_==="+"){if(p.noextglob!==!0&&z()==="("&&z(2)!=="?"){oe("plus",_);continue}if(R&&R.value==="("||p.regex===!1){G({type:"plus",value:_,output:A});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||$.parens>0){G({type:"plus",value:_});continue}G({type:"plus",value:A});continue}if(_==="@"){if(p.noextglob!==!0&&z()==="("&&z(2)!=="?"){G({type:"at",extglob:!0,
83
- value:_,output:""});continue}G({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);const P=o.exec(Ae());P&&(_+=P[0],$.index+=P[0].length),G({type:"text",value:_});continue}if(R&&(R.type==="globstar"||R.star===!0)){R.type="star",R.star=!0,R.value+=_,R.output=H,$.backtrack=!0,$.globstar=!0,re(_);continue}let j=Ae();if(p.noextglob!==!0&&/^\([^?]/.test(j)){oe("star",_);continue}if(R.type==="star"){if(p.noglobstar===!0){re(_);continue}const P=R.prev,J=P.prev,te=P.type==="slas\
84
- h"||P.type==="bos",fe=J&&(J.type==="star"||J.type==="globstar");if(p.bash===!0&&(!te||j[0]&&j[0]!=="/")){G({type:"star",value:_,output:""});continue}const ie=$.braces>0&&(P.type==="comma"||P.type==="brace"),er=U.length&&(P.type==="pipe"||P.type==="paren");if(!te&&P.type!=="paren"&&!ie&&!er){G({type:"star",value:_,output:""});continue}for(;j.slice(0,3)==="/**";){const mt=l[$.index+4];if(mt&&mt!=="/")break;j=j.slice(3),re("/**",3)}if(P.type==="bos"&&K()){R.type="globstar",R.value+=_,R.output=k(p),
85
- $.output=R.output,$.globstar=!0,re(_);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!fe&&K()){$.output=$.output.slice(0,-(P.output+R.output).length),P.output=`(?:${P.output}`,R.type="globstar",R.output=k(p)+(p.strictSlashes?")":"|$)"),R.value+=_,$.globstar=!0,$.output+=P.output+R.output,re(_);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&j[0]==="/"){const mt=j[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(P.output+R.output).length),P.output=`(?:${P.output}`,R.type="globstar",R.output=
86
- `${k(p)}${b}|${b}${mt})`,R.value+=_,$.output+=P.output+R.output,$.globstar=!0,re(_+me()),G({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&j[0]==="/"){R.type="globstar",R.value+=_,R.output=`(?:^|${b}|${k(p)}${b})`,$.output=R.output,$.globstar=!0,re(_+me()),G({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-R.output.length),R.type="globstar",R.output=k(p),R.value+=_,$.output+=R.output,$.globstar=!0,re(_);continue}const Z={type:"star",value:_,output:H};if(p.bash===
87
- !0){Z.output=".*?",(R.type==="bos"||R.type==="slash")&&(Z.output=N+Z.output),G(Z);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&p.regex===!0){Z.output=_,G(Z);continue}($.index===$.start||R.type==="slash"||R.type==="dot")&&(R.type==="dot"?($.output+=B,R.output+=B):p.dot===!0?($.output+=F,R.output+=F):($.output+=N,R.output+=N),z()!=="*"&&($.output+=x,R.output+=x)),G(Z)}for(;$.brackets>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));$.output=e.escapeLast($.output,"["),
58
+ CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?d:T}},Dr}var Js;function _t(){return Js||(Js=1,(function(t){const e=pr,r=process.
59
+ platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:s}=At();t.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),t.hasRegexChars=o=>a.test(o),t.isRegexChar=o=>o.length===1&&t.hasRegexChars(o),t.escapeRegex=o=>o.replace(s,"\\$1"),t.toPosixSlashes=o=>o.replace(n,"/"),t.removeBackslashes=o=>o.replace(i,c=>c==="\\"?"":c),t.supportsLookbehinds=()=>{const o=process.version.slice(1).split(".").map(Number);return o.length===3&&o[0]>=9||
60
+ o[0]===8&&o[1]>=10},t.isWindows=o=>o&&typeof o.windows=="boolean"?o.windows:r===!0||e.sep==="\\",t.escapeLast=(o,c,u)=>{const l=o.lastIndexOf(c,u);return l===-1?o:o[l-1]==="\\"?t.escapeLast(o,c,l-1):`${o.slice(0,l)}\\${o.slice(l)}`},t.removePrefix=(o,c={})=>{let u=o;return u.startsWith("./")&&(u=u.slice(2),c.prefix="./"),u},t.wrapOutput=(o,c={},u={})=>{const l=u.contains?"":"^",f=u.contains?"":"$";let p=`${l}(?:${o})${f}`;return c.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(jr)),jr}var qr,Qs;function Bu(){
61
+ if(Qs)return qr;Qs=1;const t=_t(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:s,CHAR_FORWARD_SLASH:o,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:p,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:w}=At(),m=d=>d===o||d===n,g=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return qr=(d,S)=>{const E=S||{},A=d.length-1,b=E.parts===!0||E.scanToEnd===!0,x=[],q=[],
62
+ M=[];let V=d,F=-1,L=0,I=0,C=!1,k=!1,O=!1,P=!1,D=!1,H=!1,$=!1,U=!1,J=!1,Q=!1,R=0,_,K,X={value:"",depth:0,isGlob:!1};const me=()=>F>=A,Ae=()=>V.charCodeAt(F+1),ne=()=>(_=K,V.charCodeAt(++F));for(;F<A;){K=ne();let G;if(K===n){$=X.backslashes=!0,K=ne(),K===c&&(H=!0);continue}if(H===!0||K===c){for(R++;me()!==!0&&(K=ne());){if(K===n){$=X.backslashes=!0,ne();continue}if(K===c){R++;continue}if(H!==!0&&K===a&&(K=ne())===a){if(C=X.isBrace=!0,O=X.isGlob=!0,Q=!0,b===!0)continue;break}if(H!==!0&&K===i){if(C=
63
+ X.isBrace=!0,O=X.isGlob=!0,Q=!0,b===!0)continue;break}if(K===h&&(R--,R===0)){H=!1,C=X.isBrace=!0,Q=!0;break}}if(b===!0)continue;break}if(K===o){if(x.push(F),q.push(X),X={value:"",depth:0,isGlob:!1},Q===!0)continue;if(_===a&&F===L+1){L+=2;continue}I=F+1;continue}if(E.noext!==!0&&(K===f||K===r||K===e||K===p||K===s)===!0&&Ae()===u){if(O=X.isGlob=!0,P=X.isExtglob=!0,Q=!0,K===s&&F===L&&(J=!0),b===!0){for(;me()!==!0&&(K=ne());){if(K===n){$=X.backslashes=!0,K=ne();continue}if(K===v){O=X.isGlob=!0,Q=!0;
64
+ break}}continue}break}if(K===e){if(_===e&&(D=X.isGlobstar=!0),O=X.isGlob=!0,Q=!0,b===!0)continue;break}if(K===p){if(O=X.isGlob=!0,Q=!0,b===!0)continue;break}if(K===l){for(;me()!==!0&&(G=ne());){if(G===n){$=X.backslashes=!0,ne();continue}if(G===w){k=X.isBracket=!0,O=X.isGlob=!0,Q=!0;break}}if(b===!0)continue;break}if(E.nonegate!==!0&&K===s&&F===L){U=X.negated=!0,L++;continue}if(E.noparen!==!0&&K===u){if(O=X.isGlob=!0,b===!0){for(;me()!==!0&&(K=ne());){if(K===u){$=X.backslashes=!0,K=ne();continue}
65
+ if(K===v){Q=!0;break}}continue}break}if(O===!0){if(Q=!0,b===!0)continue;break}}E.noext===!0&&(P=!1,O=!1);let se=V,tt="",$e="";L>0&&(tt=V.slice(0,L),V=V.slice(L),I-=L),se&&O===!0&&I>0?(se=V.slice(0,I),$e=V.slice(I)):O===!0?(se="",$e=V):se=V,se&&se!==""&&se!=="/"&&se!==V&&m(se.charCodeAt(se.length-1))&&(se=se.slice(0,-1)),E.unescape===!0&&($e&&($e=t.removeBackslashes($e)),se&&$===!0&&(se=t.removeBackslashes(se)));const le={prefix:tt,input:d,start:L,base:se,glob:$e,isBrace:C,isBracket:k,isGlob:O,isExtglob:P,
66
+ isGlobstar:D,negated:U,negatedExtglob:J};if(E.tokens===!0&&(le.maxDepth=0,m(K)||q.push(X),le.tokens=q),E.parts===!0||E.tokens===!0){let G;for(let ie=0;ie<x.length;ie++){const rr=G?G+1:L,j=x[ie],Z=d.slice(rr,j);E.tokens&&(ie===0&&L!==0?(q[ie].isPrefix=!0,q[ie].value=tt):q[ie].value=Z,g(q[ie]),le.maxDepth+=q[ie].depth),(ie!==0||Z!=="")&&M.push(Z),G=j}if(G&&G+1<d.length){const ie=d.slice(G+1);M.push(ie),E.tokens&&(q[q.length-1].value=ie,g(q[q.length-1]),le.maxDepth+=q[q.length-1].depth)}le.slashes=
67
+ x,le.parts=M}return le},qr}var Hr,Zs;function Vu(){if(Zs)return Hr;Zs=1;const t=At(),e=_t(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:s}=t,o=(l,f)=>{if(typeof f.expandRange=="function")return f.expandRange(...l,f);l.sort();const p=`[${l.join("-")}]`;try{new RegExp(p)}catch{return l.map(v=>e.escapeRegex(v)).join("..")}return p},c=(l,f)=>`Missing ${l}: "${f}" - use "\\\\${f}" to match literal characters`,u=(l,f)=>{if(typeof l!="string")
68
+ throw new TypeError("Expected a string");l=s[l]||l;const p={...f},h=typeof p.maxLength=="number"?Math.min(r,p.maxLength):r;let v=l.length;if(v>h)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${h}`);const w={type:"bos",value:"",output:p.prepend||""},m=[w],g=p.capture?"":"?:",T=e.isWindows(f),d=t.globChars(T),S=t.extglobChars(d),{DOT_LITERAL:E,PLUS_LITERAL:A,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:q,NO_DOT:M,NO_DOT_SLASH:V,NO_DOTS_SLASH:F,QMARK:L,QMARK_NO_DOT:I,STAR:C,START_ANCHOR:k}=d,
69
+ O=j=>`(${g}(?:(?!${k}${j.dot?q:E}).)*?)`,P=p.dot?"":M,D=p.dot?L:I;let H=p.bash===!0?O(p):C;p.capture&&(H=`(${H})`),typeof p.noext=="boolean"&&(p.noextglob=p.noext);const $={input:l,index:-1,start:0,dot:p.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};l=e.removePrefix(l,$),v=l.length;const U=[],J=[],Q=[];let R=w,_;const K=()=>$.index===v-1,X=$.peek=(j=1)=>l[$.index+j],me=$.advance=()=>l[++$.index]||"",Ae=()=>l.slice($.index+
70
+ 1),ne=(j="",Z=0)=>{$.consumed+=j,$.index+=Z},se=j=>{$.output+=j.output!=null?j.output:j.value,ne(j.value)},tt=()=>{let j=1;for(;X()==="!"&&(X(2)!=="("||X(3)==="?");)me(),$.start++,j++;return j%2===0?!1:($.negated=!0,$.start++,!0)},$e=j=>{$[j]++,Q.push(j)},le=j=>{$[j]--,Q.pop()},G=j=>{if(R.type==="globstar"){const Z=$.braces>0&&(j.type==="comma"||j.type==="brace"),N=j.extglob===!0||U.length&&(j.type==="pipe"||j.type==="paren");j.type!=="slash"&&j.type!=="paren"&&!Z&&!N&&($.output=$.output.slice(0,
71
+ -R.output.length),R.type="star",R.value="*",R.output=H,$.output+=R.output)}if(U.length&&j.type!=="paren"&&(U[U.length-1].inner+=j.value),(j.value||j.output)&&se(j),R&&R.type==="text"&&j.type==="text"){R.value+=j.value,R.output=(R.output||"")+j.value;return}j.prev=R,m.push(j),R=j},ie=(j,Z)=>{const N={...S[Z],conditions:1,inner:""};N.prev=R,N.parens=$.parens,N.output=$.output;const Y=(p.capture?"(":"")+N.open;$e("parens"),G({type:j,value:Z,output:$.output?"":x}),G({type:"paren",extglob:!0,value:me(),
72
+ output:Y}),U.push(N)},rr=j=>{let Z=j.close+(p.capture?")":""),N;if(j.type==="negate"){let Y=H;if(j.inner&&j.inner.length>1&&j.inner.includes("/")&&(Y=O(p)),(Y!==H||K()||/^\)+$/.test(Ae()))&&(Z=j.close=`)$))${Y}`),j.inner.includes("*")&&(N=Ae())&&/^\.[^\\/.]+$/.test(N)){const te=u(N,{...f,fastpaths:!1}).output;Z=j.close=`)${te})${Y})`}j.prev.type==="bos"&&($.negatedExtglob=!0)}G({type:"paren",extglob:!0,value:_,output:Z}),le("parens")};if(p.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let j=!1,
73
+ Z=l.replace(a,(N,Y,te,fe,oe,nr)=>fe==="\\"?(j=!0,N):fe==="?"?Y?Y+fe+(oe?L.repeat(oe.length):""):nr===0?D+(oe?L.repeat(oe.length):""):L.repeat(te.length):fe==="."?E.repeat(te.length):fe==="*"?Y?Y+fe+(oe?H:""):H:Y?N:`\\${N}`);return j===!0&&(p.unescape===!0?Z=Z.replace(/\\/g,""):Z=Z.replace(/\\+/g,N=>N.length%2===0?"\\\\":N?"\\":"")),Z===l&&p.contains===!0?($.output=l,$):($.output=e.wrapOutput(Z,$,f),$)}for(;!K();){if(_=me(),_==="\0")continue;if(_==="\\"){const N=X();if(N==="/"&&p.bash!==!0||N==="\
74
+ ."||N===";")continue;if(!N){_+="\\",G({type:"text",value:_});continue}const Y=/^\\+/.exec(Ae());let te=0;if(Y&&Y[0].length>2&&(te=Y[0].length,$.index+=te,te%2!==0&&(_+="\\")),p.unescape===!0?_=me():_+=me(),$.brackets===0){G({type:"text",value:_});continue}}if($.brackets>0&&(_!=="]"||R.value==="["||R.value==="[^")){if(p.posix!==!1&&_===":"){const N=R.value.slice(1);if(N.includes("[")&&(R.posix=!0,N.includes(":"))){const Y=R.value.lastIndexOf("["),te=R.value.slice(0,Y),fe=R.value.slice(Y+2),oe=n[fe];
75
+ if(oe){R.value=te+oe,$.backtrack=!0,me(),!w.output&&m.indexOf(R)===1&&(w.output=x);continue}}}(_==="["&&X()!==":"||_==="-"&&X()==="]")&&(_=`\\${_}`),_==="]"&&(R.value==="["||R.value==="[^")&&(_=`\\${_}`),p.posix===!0&&_==="!"&&R.value==="["&&(_="^"),R.value+=_,se({value:_});continue}if($.quotes===1&&_!=='"'){_=e.escapeRegex(_),R.value+=_,se({value:_});continue}if(_==='"'){$.quotes=$.quotes===1?0:1,p.keepQuotes===!0&&G({type:"text",value:_});continue}if(_==="("){$e("parens"),G({type:"paren",value:_});
76
+ continue}if(_===")"){if($.parens===0&&p.strictBrackets===!0)throw new SyntaxError(c("opening","("));const N=U[U.length-1];if(N&&$.parens===N.parens+1){rr(U.pop());continue}G({type:"paren",value:_,output:$.parens?")":"\\)"}),le("parens");continue}if(_==="["){if(p.nobracket===!0||!Ae().includes("]")){if(p.nobracket!==!0&&p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));_=`\\${_}`}else $e("brackets");G({type:"bracket",value:_});continue}if(_==="]"){if(p.nobracket===!0||R&&R.type==="bra\
77
+ cket"&&R.value.length===1){G({type:"text",value:_,output:`\\${_}`});continue}if($.brackets===0){if(p.strictBrackets===!0)throw new SyntaxError(c("opening","["));G({type:"text",value:_,output:`\\${_}`});continue}le("brackets");const N=R.value.slice(1);if(R.posix!==!0&&N[0]==="^"&&!N.includes("/")&&(_=`/${_}`),R.value+=_,se({value:_}),p.literalBrackets===!1||e.hasRegexChars(N))continue;const Y=e.escapeRegex(R.value);if($.output=$.output.slice(0,-R.value.length),p.literalBrackets===!0){$.output+=Y,
78
+ R.value=Y;continue}R.value=`(${g}${Y}|${R.value})`,$.output+=R.value;continue}if(_==="{"&&p.nobrace!==!0){$e("braces");const N={type:"brace",value:_,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};J.push(N),G(N);continue}if(_==="}"){const N=J[J.length-1];if(p.nobrace===!0||!N){G({type:"text",value:_,output:_});continue}let Y=")";if(N.dots===!0){const te=m.slice(),fe=[];for(let oe=te.length-1;oe>=0&&(m.pop(),te[oe].type!=="brace");oe--)te[oe].type!=="dots"&&fe.unshift(te[oe].value);
79
+ Y=o(fe,p),$.backtrack=!0}if(N.comma!==!0&&N.dots!==!0){const te=$.output.slice(0,N.outputIndex),fe=$.tokens.slice(N.tokensIndex);N.value=N.output="\\{",_=Y="\\}",$.output=te;for(const oe of fe)$.output+=oe.output||oe.value}G({type:"brace",value:_,output:Y}),le("braces"),J.pop();continue}if(_==="|"){U.length>0&&U[U.length-1].conditions++,G({type:"text",value:_});continue}if(_===","){let N=_;const Y=J[J.length-1];Y&&Q[Q.length-1]==="braces"&&(Y.comma=!0,N="|"),G({type:"comma",value:_,output:N});continue}
80
+ if(_==="/"){if(R.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",m.pop(),R=w;continue}G({type:"slash",value:_,output:b});continue}if(_==="."){if($.braces>0&&R.type==="dot"){R.value==="."&&(R.output=E);const N=J[J.length-1];R.type="dots",R.output+=_,R.value+=_,N.dots=!0;continue}if($.braces+$.parens===0&&R.type!=="bos"&&R.type!=="slash"){G({type:"text",value:_,output:E});continue}G({type:"dot",value:_,output:E});continue}if(_==="?"){if(!(R&&R.value==="(")&&p.noextglob!==
81
+ !0&&X()==="("&&X(2)!=="?"){ie("qmark",_);continue}if(R&&R.type==="paren"){const Y=X();let te=_;if(Y==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(R.value==="("&&!/[!=<:]/.test(Y)||Y==="<"&&!/<([!=]|\w+>)/.test(Ae()))&&(te=`\\${_}`),G({type:"text",value:_,output:te});continue}if(p.dot!==!0&&(R.type==="slash"||R.type==="bos")){G({type:"qmark",value:_,output:I});continue}G({type:"qmark",value:_,output:L});continue}if(_==="!"){if(p.noextglob!==
82
+ !0&&X()==="("&&(X(2)!=="?"||!/[!=<:]/.test(X(3)))){ie("negate",_);continue}if(p.nonegate!==!0&&$.index===0){tt();continue}}if(_==="+"){if(p.noextglob!==!0&&X()==="("&&X(2)!=="?"){ie("plus",_);continue}if(R&&R.value==="("||p.regex===!1){G({type:"plus",value:_,output:A});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||$.parens>0){G({type:"plus",value:_});continue}G({type:"plus",value:A});continue}if(_==="@"){if(p.noextglob!==!0&&X()==="("&&X(2)!=="?"){G({type:"at",extglob:!0,
83
+ value:_,output:""});continue}G({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);const N=i.exec(Ae());N&&(_+=N[0],$.index+=N[0].length),G({type:"text",value:_});continue}if(R&&(R.type==="globstar"||R.star===!0)){R.type="star",R.star=!0,R.value+=_,R.output=H,$.backtrack=!0,$.globstar=!0,ne(_);continue}let j=Ae();if(p.noextglob!==!0&&/^\([^?]/.test(j)){ie("star",_);continue}if(R.type==="star"){if(p.noglobstar===!0){ne(_);continue}const N=R.prev,Y=N.prev,te=N.type==="slas\
84
+ h"||N.type==="bos",fe=Y&&(Y.type==="star"||Y.type==="globstar");if(p.bash===!0&&(!te||j[0]&&j[0]!=="/")){G({type:"star",value:_,output:""});continue}const oe=$.braces>0&&(N.type==="comma"||N.type==="brace"),nr=U.length&&(N.type==="pipe"||N.type==="paren");if(!te&&N.type!=="paren"&&!oe&&!nr){G({type:"star",value:_,output:""});continue}for(;j.slice(0,3)==="/**";){const gt=l[$.index+4];if(gt&&gt!=="/")break;j=j.slice(3),ne("/**",3)}if(N.type==="bos"&&K()){R.type="globstar",R.value+=_,R.output=O(p),
85
+ $.output=R.output,$.globstar=!0,ne(_);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&!fe&&K()){$.output=$.output.slice(0,-(N.output+R.output).length),N.output=`(?:${N.output}`,R.type="globstar",R.output=O(p)+(p.strictSlashes?")":"|$)"),R.value+=_,$.globstar=!0,$.output+=N.output+R.output,ne(_);continue}if(N.type==="slash"&&N.prev.type!=="bos"&&j[0]==="/"){const gt=j[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(N.output+R.output).length),N.output=`(?:${N.output}`,R.type="globstar",R.output=
86
+ `${O(p)}${b}|${b}${gt})`,R.value+=_,$.output+=N.output+R.output,$.globstar=!0,ne(_+me()),G({type:"slash",value:"/",output:""});continue}if(N.type==="bos"&&j[0]==="/"){R.type="globstar",R.value+=_,R.output=`(?:^|${b}|${O(p)}${b})`,$.output=R.output,$.globstar=!0,ne(_+me()),G({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-R.output.length),R.type="globstar",R.output=O(p),R.value+=_,$.output+=R.output,$.globstar=!0,ne(_);continue}const Z={type:"star",value:_,output:H};if(p.bash===
87
+ !0){Z.output=".*?",(R.type==="bos"||R.type==="slash")&&(Z.output=P+Z.output),G(Z);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&p.regex===!0){Z.output=_,G(Z);continue}($.index===$.start||R.type==="slash"||R.type==="dot")&&(R.type==="dot"?($.output+=V,R.output+=V):p.dot===!0?($.output+=F,R.output+=F):($.output+=P,R.output+=P),X()!=="*"&&($.output+=x,R.output+=x)),G(Z)}for(;$.brackets>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing","]"));$.output=e.escapeLast($.output,"["),
88
88
  le("brackets")}for(;$.parens>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing",")"));$.output=e.escapeLast($.output,"("),le("parens")}for(;$.braces>0;){if(p.strictBrackets===!0)throw new SyntaxError(c("closing","}"));$.output=e.escapeLast($.output,"{"),le("braces")}if(p.strictSlashes!==!0&&(R.type==="star"||R.type==="bracket")&&G({type:"maybe_slash",value:"",output:`${b}?`}),$.backtrack===!0){$.output="";for(const j of $.tokens)$.output+=j.output!=null?j.output:j.value,j.suffix&&($.
89
- output+=j.suffix)}return $};return a.fastpaths=(l,f)=>{const p={...f},h=typeof p.maxLength=="number"?Math.min(r,p.maxLength):r,v=l.length;if(v>h)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${h}`);l=s[l]||l;const w=e.isWindows(f),{DOT_LITERAL:m,SLASH_LITERAL:g,ONE_CHAR:T,DOTS_SLASH:d,NO_DOT:S,NO_DOTS:E,NO_DOTS_SLASH:A,STAR:b,START_ANCHOR:x}=t.globChars(w),q=p.dot?E:S,M=p.dot?A:S,B=p.capture?"":"?:",F={negated:!1,prefix:""};let I=p.bash===!0?".*?":b;p.capture&&(I=`(${I}\
90
- )`);const L=N=>N.noglobstar===!0?I:`(${B}(?:(?!${x}${N.dot?d:m}).)*?)`,C=N=>{switch(N){case"*":return`${q}${T}${I}`;case".*":return`${m}${T}${I}`;case"*.*":return`${q}${I}${m}${T}${I}`;case"*/*":return`${q}${I}${g}${T}${M}${I}`;case"**":return q+L(p);case"**/*":return`(?:${q}${L(p)}${g})?${M}${T}${I}`;case"**/*.*":return`(?:${q}${L(p)}${g})?${M}${I}${m}${T}${I}`;case"**/.*":return`(?:${q}${L(p)}${g})?${m}${T}${I}`;default:{const D=/^(.*?)\.(\w+)$/.exec(N);if(!D)return;const H=C(D[1]);return H?H+
91
- m+D[2]:void 0}}},O=e.removePrefix(l,F);let k=C(O);return k&&p.strictSlashes!==!0&&(k+=`${g}?`),k},jr=a,jr}var Dr,zs;function Uu(){if(zs)return Dr;zs=1;const t=ur,e=Hu(),r=Mu(),n=At(),o=St(),u=i=>i&&typeof i=="object"&&!Array.isArray(i),s=(i,c,a=!1)=>{if(Array.isArray(i)){const g=i.map(d=>s(d,c,a));return d=>{for(const S of g){const E=S(d);if(E)return E}return!1}}const l=u(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!l)throw new TypeError("Expected pattern to be a non-empty string");const f=c||
92
- {},p=n.isWindows(c),h=l?s.compileRe(i,c):s.makeRe(i,c,!1,!0),v=h.state;delete h.state;let w=()=>!1;if(f.ignore){const g={...c,ignore:null,onMatch:null,onResult:null};w=s(f.ignore,g,a)}const m=(g,T=!1)=>{const{isMatch:d,match:S,output:E}=s.test(g,h,c,{glob:i,posix:p}),A={glob:i,state:v,regex:h,posix:p,input:g,output:E,match:S,isMatch:d};return typeof f.onResult=="function"&&f.onResult(A),d===!1?(A.isMatch=!1,T?A:!1):w(g)?(typeof f.onIgnore=="function"&&f.onIgnore(A),A.isMatch=!1,T?A:!1):(typeof f.
93
- onMatch=="function"&&f.onMatch(A),T?A:!0)};return a&&(m.state=v),m};return s.test=(i,c,a,{glob:l,posix:f}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const p=a||{},h=p.format||(f?n.toPosixSlashes:null);let v=i===l,w=v&&h?h(i):i;return v===!1&&(w=h?h(i):i,v=w===l),(v===!1||p.capture===!0)&&(p.matchBase===!0||p.basename===!0?v=s.matchBase(i,c,a,f):v=c.exec(w)),{isMatch:!!v,match:v,output:w}},s.matchBase=(i,c,a,l=n.isWindows(
94
- a))=>(c instanceof RegExp?c:s.makeRe(c,a)).test(t.basename(i)),s.isMatch=(i,c,a)=>s(c,a)(i),s.parse=(i,c)=>Array.isArray(i)?i.map(a=>s.parse(a,c)):r(i,{...c,fastpaths:!1}),s.scan=(i,c)=>e(i,c),s.compileRe=(i,c,a=!1,l=!1)=>{if(a===!0)return i.output;const f=c||{},p=f.contains?"":"^",h=f.contains?"":"$";let v=`${p}(?:${i.output})${h}`;i&&i.negated===!0&&(v=`^(?!${v}).*$`);const w=s.toRegex(v,c);return l===!0&&(w.state=i),w},s.makeRe=(i,c={},a=!1,l=!1)=>{if(!i||typeof i!="string")throw new TypeError(
95
- "Expected a non-empty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(f.output=r.fastpaths(i,c)),f.output||(f=r(i,c)),s.compileRe(f,c,a,l)},s.toRegex=(i,c)=>{try{const a=c||{};return new RegExp(i,a.flags||(a.nocase?"i":""))}catch(a){if(c&&c.debug===!0)throw a;return/$^/}},s.constants=o,Dr=s,Dr}var qr,Xs;function Fu(){return Xs||(Xs=1,qr=Uu()),qr}var Hr,Ks;function Gu(){if(Ks)return Hr;Ks=1;const t=bs,e=qu(),r=Fu(),n=At(),o=i=>i===""||i==="./",u=i=>{const c=i.
96
- indexOf("{");return c>-1&&i.indexOf("}",c)>-1},s=(i,c,a)=>{c=[].concat(c),i=[].concat(i);let l=new Set,f=new Set,p=new Set,h=0,v=g=>{p.add(g.output),a&&a.onResult&&a.onResult(g)};for(let g=0;g<c.length;g++){let T=r(String(c[g]),{...a,onResult:v},!0),d=T.state.negated||T.state.negatedExtglob;d&&h++;for(let S of i){let E=T(S,!0);(d?!E.isMatch:E.isMatch)&&(d?l.add(E.output):(l.delete(E.output),f.add(E.output)))}}let m=(h===c.length?[...p]:[...f]).filter(g=>!l.has(g));if(a&&m.length===0){if(a.failglob===
97
- !0)throw new Error(`No matches found for "${c.join(", ")}"`);if(a.nonull===!0||a.nullglob===!0)return a.unescape?c.map(g=>g.replace(/\\/g,"")):c}return m};return s.match=s,s.matcher=(i,c)=>r(i,c),s.isMatch=(i,c,a)=>r(c,a)(i),s.any=s.isMatch,s.not=(i,c,a={})=>{c=[].concat(c).map(String);let l=new Set,f=[],p=v=>{a.onResult&&a.onResult(v),f.push(v.output)},h=new Set(s(i,c,{...a,onResult:p}));for(let v of f)h.has(v)||l.add(v);return[...l]},s.contains=(i,c,a)=>{if(typeof i!="string")throw new TypeError(
98
- `Expected a string: "${t.inspect(i)}"`);if(Array.isArray(c))return c.some(l=>s.contains(i,l,a));if(typeof c=="string"){if(o(i)||o(c))return!1;if(i.includes(c)||i.startsWith("./")&&i.slice(2).includes(c))return!0}return s.isMatch(i,c,{...a,contains:!0})},s.matchKeys=(i,c,a)=>{if(!n.isObject(i))throw new TypeError("Expected the first argument to be an object");let l=s(Object.keys(i),c,a),f={};for(let p of l)f[p]=i[p];return f},s.some=(i,c,a)=>{let l=[].concat(i);for(let f of[].concat(c)){let p=r(String(
99
- f),a);if(l.some(h=>p(h)))return!0}return!1},s.every=(i,c,a)=>{let l=[].concat(i);for(let f of[].concat(c)){let p=r(String(f),a);if(!l.every(h=>p(h)))return!1}return!0},s.all=(i,c,a)=>{if(typeof i!="string")throw new TypeError(`Expected a string: "${t.inspect(i)}"`);return[].concat(c).every(l=>r(l,a)(i))},s.capture=(i,c,a)=>{let l=n.isWindows(a),p=r.makeRe(String(i),{...a,capture:!0}).exec(l?n.toPosixSlashes(c):c);if(p)return p.slice(1).map(h=>h===void 0?"":h)},s.makeRe=(...i)=>r.makeRe(...i),s.scan=
100
- (...i)=>r.scan(...i),s.parse=(i,c)=>{let a=[];for(let l of[].concat(i||[]))for(let f of e(String(l),c))a.push(r.parse(f,c));return a},s.braces=(i,c)=>{if(typeof i!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!u(i)?[i]:e(i,c)},s.braceExpand=(i,c)=>{if(typeof i!="string")throw new TypeError("Expected a string");return s.braces(i,{...c,expand:!0})},s.hasBraces=u,Hr=s,Hr}var Bu=Gu();const Js=ns(Bu),Vu={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
101
- function Wu(t,e,r,n=!1){const o=e.replaceAll(".","\\."),u=new RegExp(`<script([^>]*?) src="(?:[^"]*?/)?${o}"([^>]*)></script>`),s=/"?__VITE_PRELOAD__"?/g,i=r.replace(s,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),c=t.replace(u,(a,l,f)=>`<script${l}${f}>${i.trim()}</script>`);return n?Qu(c):c}function zu(t,e,r){const n=e.replaceAll(".","\\."),o=new RegExp(`<link([^>]*?) href="(?:[^"]*?/)?${n}"([^>]*)>`),u=r.replace('@charset "UTF-8";',"");return t.replace(o,(i,c,a)=>`<style${c}${a}>${u.trim()}\
102
- </style>`)}const Xu=/\.[mc]?js$/,Ku=/\.css$/,Ju=/\.html?$/;function Yu({useRecommendedBuildConfig:t=!0,removeViteModuleLoader:e=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0,overrideConfig:o={}}=Vu){return{name:"vite:singlefile",config:t?s=>{s.build||(s.build={}),s.build.assetsInlineLimit=()=>!0,s.build.chunkSizeWarningLimit=1e8,s.build.cssCodeSplit=!1,s.base="./",s.build.assetsDir="",s.build.rollupOptions||(s.build.rollupOptions={}),s.build.rollupOptions.output||(s.build.rollupOptions.output={});
103
- const i=c=>{c.inlineDynamicImports=!0};if(Array.isArray(s.build.rollupOptions.output))for(const c of s.build.rollupOptions.output)i(c);else i(s.build.rollupOptions.output);Object.assign(s,o)}:void 0,enforce:"post",generateBundle(s,i){const c=f=>this.info(`NOTE: asset not inlined: ${f}`);this.info(`
104
- `);const a={html:[],css:[],js:[],other:[]};for(const f of Object.keys(i))Ju.test(f)?a.html.push(f):Ku.test(f)?a.css.push(f):Xu.test(f)?a.js.push(f):a.other.push(f);const l=[];for(const f of a.html){const p=i[f];let h=p.source;for(const v of a.js){if(r.length&&!Js.isMatch(v,r)){c(v);continue}const w=i[v];w.code!=null&&(this.info(`Inlining: ${v}`),l.push(v),h=Wu(h,w.fileName,w.code,e))}for(const v of a.css){if(r.length&&!Js.isMatch(v,r)){c(v);continue}const w=i[v];this.info(`Inlining: ${v}`),l.push(
105
- v),h=zu(h,w.fileName,w.source)}p.source=h}if(n)for(const f of l)delete i[f];for(const f of a.other)c(f)}}}const Qu=t=>t.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">');function Ve(t){return t.length===0?"never":t.sort(yu).map(e=>` | ${JSON.stringify(e)}`).join(`
106
- `).trimStart()}function Ys(t){const e=ms(t);return e.length===0?"never":gs(e,wu,zc(r=>` | ${JSON.stringify(r.id)}`)).join(`
107
- `).trimStart()}function Qs(t,e={}){const{useCorePackage:r=!1}=e;return`
89
+ output+=j.suffix)}return $};return u.fastpaths=(l,f)=>{const p={...f},h=typeof p.maxLength=="number"?Math.min(r,p.maxLength):r,v=l.length;if(v>h)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${h}`);l=s[l]||l;const w=e.isWindows(f),{DOT_LITERAL:m,SLASH_LITERAL:g,ONE_CHAR:T,DOTS_SLASH:d,NO_DOT:S,NO_DOTS:E,NO_DOTS_SLASH:A,STAR:b,START_ANCHOR:x}=t.globChars(w),q=p.dot?E:S,M=p.dot?A:S,V=p.capture?"":"?:",F={negated:!1,prefix:""};let L=p.bash===!0?".*?":b;p.capture&&(L=`(${L}\
90
+ )`);const I=P=>P.noglobstar===!0?L:`(${V}(?:(?!${x}${P.dot?d:m}).)*?)`,C=P=>{switch(P){case"*":return`${q}${T}${L}`;case".*":return`${m}${T}${L}`;case"*.*":return`${q}${L}${m}${T}${L}`;case"*/*":return`${q}${L}${g}${T}${M}${L}`;case"**":return q+I(p);case"**/*":return`(?:${q}${I(p)}${g})?${M}${T}${L}`;case"**/*.*":return`(?:${q}${I(p)}${g})?${M}${L}${m}${T}${L}`;case"**/.*":return`(?:${q}${I(p)}${g})?${m}${T}${L}`;default:{const D=/^(.*?)\.(\w+)$/.exec(P);if(!D)return;const H=C(D[1]);return H?H+
91
+ m+D[2]:void 0}}},k=e.removePrefix(l,F);let O=C(k);return O&&p.strictSlashes!==!0&&(O+=`${g}?`),O},Hr=u,Hr}var Mr,ei;function zu(){if(ei)return Mr;ei=1;const t=pr,e=Bu(),r=Vu(),n=_t(),i=At(),a=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,c,u=!1)=>{if(Array.isArray(o)){const g=o.map(d=>s(d,c,u));return d=>{for(const S of g){const E=S(d);if(E)return E}return!1}}const l=a(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!l)throw new TypeError("Expected pattern to be a non-empty string");const f=c||
92
+ {},p=n.isWindows(c),h=l?s.compileRe(o,c):s.makeRe(o,c,!1,!0),v=h.state;delete h.state;let w=()=>!1;if(f.ignore){const g={...c,ignore:null,onMatch:null,onResult:null};w=s(f.ignore,g,u)}const m=(g,T=!1)=>{const{isMatch:d,match:S,output:E}=s.test(g,h,c,{glob:o,posix:p}),A={glob:o,state:v,regex:h,posix:p,input:g,output:E,match:S,isMatch:d};return typeof f.onResult=="function"&&f.onResult(A),d===!1?(A.isMatch=!1,T?A:!1):w(g)?(typeof f.onIgnore=="function"&&f.onIgnore(A),A.isMatch=!1,T?A:!1):(typeof f.
93
+ onMatch=="function"&&f.onMatch(A),T?A:!0)};return u&&(m.state=v),m};return s.test=(o,c,u,{glob:l,posix:f}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const p=u||{},h=p.format||(f?n.toPosixSlashes:null);let v=o===l,w=v&&h?h(o):o;return v===!1&&(w=h?h(o):o,v=w===l),(v===!1||p.capture===!0)&&(p.matchBase===!0||p.basename===!0?v=s.matchBase(o,c,u,f):v=c.exec(w)),{isMatch:!!v,match:v,output:w}},s.matchBase=(o,c,u,l=n.isWindows(
94
+ u))=>(c instanceof RegExp?c:s.makeRe(c,u)).test(t.basename(o)),s.isMatch=(o,c,u)=>s(c,u)(o),s.parse=(o,c)=>Array.isArray(o)?o.map(u=>s.parse(u,c)):r(o,{...c,fastpaths:!1}),s.scan=(o,c)=>e(o,c),s.compileRe=(o,c,u=!1,l=!1)=>{if(u===!0)return o.output;const f=c||{},p=f.contains?"":"^",h=f.contains?"":"$";let v=`${p}(?:${o.output})${h}`;o&&o.negated===!0&&(v=`^(?!${v}).*$`);const w=s.toRegex(v,c);return l===!0&&(w.state=o),w},s.makeRe=(o,c={},u=!1,l=!1)=>{if(!o||typeof o!="string")throw new TypeError(
95
+ "Expected a non-empty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(f.output=r.fastpaths(o,c)),f.output||(f=r(o,c)),s.compileRe(f,c,u,l)},s.toRegex=(o,c)=>{try{const u=c||{};return new RegExp(o,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},s.constants=i,Mr=s,Mr}var Ur,ti;function Wu(){return ti||(ti=1,Ur=zu()),Ur}var Fr,ri;function Xu(){if(ri)return Fr;ri=1;const t=_s,e=Gu(),r=Wu(),n=_t(),i=o=>o===""||o==="./",a=o=>{const c=o.
96
+ indexOf("{");return c>-1&&o.indexOf("}",c)>-1},s=(o,c,u)=>{c=[].concat(c),o=[].concat(o);let l=new Set,f=new Set,p=new Set,h=0,v=g=>{p.add(g.output),u&&u.onResult&&u.onResult(g)};for(let g=0;g<c.length;g++){let T=r(String(c[g]),{...u,onResult:v},!0),d=T.state.negated||T.state.negatedExtglob;d&&h++;for(let S of o){let E=T(S,!0);(d?!E.isMatch:E.isMatch)&&(d?l.add(E.output):(l.delete(E.output),f.add(E.output)))}}let m=(h===c.length?[...p]:[...f]).filter(g=>!l.has(g));if(u&&m.length===0){if(u.failglob===
97
+ !0)throw new Error(`No matches found for "${c.join(", ")}"`);if(u.nonull===!0||u.nullglob===!0)return u.unescape?c.map(g=>g.replace(/\\/g,"")):c}return m};return s.match=s,s.matcher=(o,c)=>r(o,c),s.isMatch=(o,c,u)=>r(c,u)(o),s.any=s.isMatch,s.not=(o,c,u={})=>{c=[].concat(c).map(String);let l=new Set,f=[],p=v=>{u.onResult&&u.onResult(v),f.push(v.output)},h=new Set(s(o,c,{...u,onResult:p}));for(let v of f)h.has(v)||l.add(v);return[...l]},s.contains=(o,c,u)=>{if(typeof o!="string")throw new TypeError(
98
+ `Expected a string: "${t.inspect(o)}"`);if(Array.isArray(c))return c.some(l=>s.contains(o,l,u));if(typeof c=="string"){if(i(o)||i(c))return!1;if(o.includes(c)||o.startsWith("./")&&o.slice(2).includes(c))return!0}return s.isMatch(o,c,{...u,contains:!0})},s.matchKeys=(o,c,u)=>{if(!n.isObject(o))throw new TypeError("Expected the first argument to be an object");let l=s(Object.keys(o),c,u),f={};for(let p of l)f[p]=o[p];return f},s.some=(o,c,u)=>{let l=[].concat(o);for(let f of[].concat(c)){let p=r(String(
99
+ f),u);if(l.some(h=>p(h)))return!0}return!1},s.every=(o,c,u)=>{let l=[].concat(o);for(let f of[].concat(c)){let p=r(String(f),u);if(!l.every(h=>p(h)))return!1}return!0},s.all=(o,c,u)=>{if(typeof o!="string")throw new TypeError(`Expected a string: "${t.inspect(o)}"`);return[].concat(c).every(l=>r(l,u)(o))},s.capture=(o,c,u)=>{let l=n.isWindows(u),p=r.makeRe(String(o),{...u,capture:!0}).exec(l?n.toPosixSlashes(c):c);if(p)return p.slice(1).map(h=>h===void 0?"":h)},s.makeRe=(...o)=>r.makeRe(...o),s.scan=
100
+ (...o)=>r.scan(...o),s.parse=(o,c)=>{let u=[];for(let l of[].concat(o||[]))for(let f of e(String(l),c))u.push(r.parse(f,c));return u},s.braces=(o,c)=>{if(typeof o!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!a(o)?[o]:e(o,c)},s.braceExpand=(o,c)=>{if(typeof o!="string")throw new TypeError("Expected a string");return s.braces(o,{...c,expand:!0})},s.hasBraces=a,Fr=s,Fr}var Ku=Xu();const ni=cs(Ku),Yu={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
101
+ function Ju(t,e,r,n=!1){const i=e.replaceAll(".","\\."),a=new RegExp(`<script([^>]*?) src="(?:[^"]*?/)?${i}"([^>]*)></script>`),s=/"?__VITE_PRELOAD__"?/g,o=r.replace(s,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),c=t.replace(a,(u,l,f)=>`<script${l}${f}>${o.trim()}</script>`);return n?nl(c):c}function Qu(t,e,r){const n=e.replaceAll(".","\\."),i=new RegExp(`<link([^>]*?) href="(?:[^"]*?/)?${n}"([^>]*)>`),a=r.replace('@charset "UTF-8";',"");return t.replace(i,(o,c,u)=>`<style${c}${u}>${a.trim()}\
102
+ </style>`)}const Zu=/\.[mc]?js$/,el=/\.css$/,tl=/\.html?$/;function rl({useRecommendedBuildConfig:t=!0,removeViteModuleLoader:e=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0,overrideConfig:i={}}=Yu){return{name:"vite:singlefile",config:t?s=>{s.build||(s.build={}),s.build.assetsInlineLimit=()=>!0,s.build.chunkSizeWarningLimit=1e8,s.build.cssCodeSplit=!1,s.base="./",s.build.assetsDir="",s.build.rollupOptions||(s.build.rollupOptions={}),s.build.rollupOptions.output||(s.build.rollupOptions.output={});
103
+ const o=c=>{c.inlineDynamicImports=!0};if(Array.isArray(s.build.rollupOptions.output))for(const c of s.build.rollupOptions.output)o(c);else o(s.build.rollupOptions.output);Object.assign(s,i)}:void 0,enforce:"post",generateBundle(s,o){const c=f=>this.info(`NOTE: asset not inlined: ${f}`);this.info(`
104
+ `);const u={html:[],css:[],js:[],other:[]};for(const f of Object.keys(o))tl.test(f)?u.html.push(f):el.test(f)?u.css.push(f):Zu.test(f)?u.js.push(f):u.other.push(f);const l=[];for(const f of u.html){const p=o[f];let h=p.source;for(const v of u.js){if(r.length&&!ni.isMatch(v,r)){c(v);continue}const w=o[v];w.code!=null&&(this.info(`Inlining: ${v}`),l.push(v),h=Ju(h,w.fileName,w.code,e))}for(const v of u.css){if(r.length&&!ni.isMatch(v,r)){c(v);continue}const w=o[v];this.info(`Inlining: ${v}`),l.push(
105
+ v),h=Qu(h,w.fileName,w.source)}p.source=h}if(n)for(const f of l)delete o[f];for(const f of u.other)c(f)}}}const nl=t=>t.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">');function Xe(t){return t.length===0?"never":t.sort(Eu).map(e=>` | ${JSON.stringify(e)}`).join(`
106
+ `).trimStart()}function si(t){const e=$s(t);return e.length===0?"never":bs(e,Ru,eu(r=>` | ${JSON.stringify(r.id)}`)).join(`
107
+ `).trimStart()}function ii(t,e={}){const{useCorePackage:r=!1}=e;return`
108
108
  import type { Aux, SpecAux } from '${r?"@likec4/core/types":"likec4/model"}';
109
109
 
110
110
  export type $Specs = SpecAux<
111
111
  // Element kinds
112
- ${Ve(et(t.specification.elements))},
112
+ ${Xe(rt(t.specification.elements))},
113
113
  // Deployment kinds
114
- ${Ve(et(t.specification.deployments??{}))},
114
+ ${Xe(rt(t.specification.deployments??{}))},
115
115
  // Relationship kinds
116
- ${Ve(et(t.specification.relationships??{}))},
116
+ ${Xe(rt(t.specification.relationships??{}))},
117
117
  // Tags
118
- ${Ve(et(t.specification.tags??{}))},
118
+ ${Xe(rt(t.specification.tags??{}))},
119
119
  // Metadata keys
120
- ${Ve(t.specification.metadataKeys??[])}
120
+ ${Xe(t.specification.metadataKeys??[])}
121
121
  >
122
122
 
123
123
  export type $Aux = Aux<
124
124
  ${JSON.stringify(t.stage)},
125
125
  // Elements
126
- ${Ys(t.$data.elements)},
126
+ ${si(t.$data.elements)},
127
127
  // Deployments
128
- ${Ys(t.$data.deployments.elements)},
128
+ ${si(t.$data.deployments.elements)},
129
129
  // Views
130
- ${Ve(et(t.$data.views))},
130
+ ${Xe(rt(t.$data.views))},
131
131
  // Project ID
132
132
  ${JSON.stringify(t.projectId)},
133
133
  $Specs
@@ -143,7 +143,7 @@ export type $DeploymentKind = $Aux['DeploymentKind']
143
143
  export type $Tag = $Aux['Tag']
144
144
  export type $Tags = readonly $Aux['Tag'][]
145
145
  export type $MetadataKey = $Aux['MetadataKey']
146
- `.trimStart()}function Zu(t,e={}){const r=Qs(t,e),{useCorePackage:n=!1}=e;return`
146
+ `.trimStart()}function sl(t,e={}){const r=ii(t,e),{useCorePackage:n=!1}=e;return`
147
147
  /* prettier-ignore-start */
148
148
  /* eslint-disable */
149
149
 
@@ -155,10 +155,10 @@ export type $MetadataKey = $Aux['MetadataKey']
155
155
  import { LikeC4Model } from '${n?"@likec4/core":"likec4"}/model'
156
156
  ${r}
157
157
 
158
- export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${Be.stringify(t.$data,{space:2,quote:"'"})} as any) as any
158
+ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${We.stringify(t.$data,{space:2,quote:"'"})} as any) as any
159
159
 
160
160
  /* prettier-ignore-end */
161
- `.trimStart()}function el(t){return Es(t,e=>Rs`${Be.stringify(e.id)}`,{separator:" | "})}function tl(t){const e=Array.from(t),r=new tu;return r.appendTemplate`
161
+ `.trimStart()}function il(t){return Cs(t,e=>xs`${We.stringify(e.id)}`,{separator:" | "})}function ol(t){const e=Array.from(t),r=new cu;return r.appendTemplate`
162
162
  /******************************************************************************
163
163
  * This file was generated
164
164
  * DO NOT EDIT MANUALLY!
@@ -169,10 +169,10 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${Be.stringify(t.$
169
169
  // @ts-nocheck
170
170
 
171
171
  import type { DiagramView } from 'likec4'
172
- `.append(Ge,Ge),e.length===0?(r.append("export {}",Ge),Ss(r)):(r.appendTemplate`
173
- export type LikeC4ViewId = ${el(e)};
172
+ `.append(ze,ze),e.length===0?(r.append("export {}",ze),Ts(r)):(r.appendTemplate`
173
+ export type LikeC4ViewId = ${il(e)};
174
174
  export const LikeC4Views = {
175
- `.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(e.length>1).append(Es(e,o=>Rs`${Be.stringify(o.id)}: (${Be.stringify(o)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",Ge,Ge).appendTemplate`
175
+ `.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(e.length>1).append(Cs(e,i=>xs`${We.stringify(i.id)}: (${We.stringify(i)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",ze,ze).appendTemplate`
176
176
  export type LikeC4Views = typeof LikeC4Views
177
177
 
178
178
  export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
@@ -184,7 +184,7 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(${Be.stringify(t.$
184
184
  }
185
185
 
186
186
  /* prettier-ignore-end */
187
- `.append(Ge),Ss(r))}function rl(t,e={}){const{useCorePackage:r=!1}=e;vu(!t.isParsed(),"can not generate react types for parsed model");const n=Qs(t,e);return`
187
+ `.append(ze),Ts(r))}function al(t,e={}){const{useCorePackage:r=!1}=e;Su(!t.isParsed(),"can not generate react types for parsed model");const n=ii(t,e);return`
188
188
  /* prettier-ignore-start */
189
189
  /* eslint-disable */
190
190
 
@@ -240,254 +240,261 @@ export {
240
240
  ReactLikeC4
241
241
  }
242
242
  /* prettier-ignore-end */
243
- `.trimStart()}const Mr=async({languageServices:t,likec4AssetsDir:e,...r})=>{const n=r.customLogger??Tu,o=yr(),u=r?.useOverviewGraph===!0;n.info(`${y.cyan("likec4 app root")} ${y.dim(o)}`);const s=r.outputDir??W(t.workspace,"dist");n.info(y.cyan("outDir")+" "+y.dim(s));let i="/";r.base&&(i=ss(r.base),!$c(i)&&i!=="./"&&(i=bc(i))),i!=="/"&&n.info(`${y.green("app base url")} ${y.dim(i)}`);const c=r.webcomponentPrefix??"likec4",a=r.title??"LikeC4",l=r.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:e,
244
- webcomponentPrefix:c,title:a,root:o,languageServices:t,clearScreen:!1,base:i,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...$r(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/styles","@likec4/core/compute-view/relationships","@likec4/core/u\
245
- tils","@likec4/core","likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(c),PAGE_TITLE:JSON.stringify(a),__USE_OVERVIEW_GRAPH__:u?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:s,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:vr,rollupOptions:{
246
- treeshake:{preset:"recommended"},...!l&&{input:[W(o,"index.html"),W(o,"src","main.js"),W(o,"src","fonts.css"),W(o,"src","style.css")],output:{manualChunks:f=>{if(!(f.endsWith(".css")||f.endsWith(".html")||f.includes("likec4/icons"))){if(f.includes("__app__")){let p=f.match(/__app__\/src\/([\w]+)\.js/)?.[1];return p?p[1]:void 0}if(f.includes("node_modules/likec4")||f.includes("node_modules/@likec4"))return"likec4";if(f.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[cr(),lr(
247
- {languageServices:t.languageServices,useOverviewGraph:u}),l?Yu():void 0].filter(Boolean)}};async function Ur({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:o="likec4-views.js"}){const u=ve(["vite","webcomponent"]),s=yr();return u.info(y.cyan("outDir")+" "+y.dim(e)),{root:s,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:$r(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/cl\
248
- ient"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...gr,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:vr,lib:{entry:"src/webcomponent.js",fileName(i,c){return o},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:u,plugins:[
249
- cr(),lr({languageServices:t.languageServices,useOverviewGraph:!1})]}}const nl=["favicon.ico","robots.txt"],sl=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",title:r,languageServices:n,likec4AssetsDir:o,outputSingleFile:u,...s})=>{o??=await $t(nt(bt(),".likec4-assets-"));const i=await Mr({...s,languageServices:n,likec4AssetsDir:o,webcomponentPrefix:e,title:r,outputSingleFile:u}),c=await wr();for(const l of nl){const f=W(i.root,l);_e(f)&&ds(f,W(c,l))}const a=n.languageServices.projects();
250
- if(a.length===1){const l=await n.viewsService.computedViews(),f=await n.diagrams();if(f.length===0)throw process.exitCode=1,new Error("no views found");f.length===l.length?i.customLogger.info(`${y.dim("workspace:")} ${y.green("\u2713 all views layouted")}`):i.customLogger.warn(`${y.dim("workspace:")} ${y.yellow(`\u2717 layouted ${f.length} of ${l.length} views`)}`),f.forEach(p=>{(p.hasLayoutDrift||p.drifts&&p.drifts.length>0)&&i.customLogger.warn(y.dim("view")+" "+y.red(p.id)+" "+y.yellow("is ou\
251
- t of date, layout drift detected"))})}else for(const l of a){const f=await n.viewsService.computedViews(l.id);f.length===0?i.customLogger.warn(`${y.dim("project:")} ${l.id} ${y.yellow("\u2717 no views found")}`):i.customLogger.info(`${y.dim("project:")} ${l.id} ${y.green(`${f.length} views`)}`)}if(t){const l=await Ur({webcomponentPrefix:e,languageServices:n,outDir:c,base:i.base});await it(l)}if(await it({...i,publicDir:c,mode:"production"}),u)for(let l of Fc(W(i.build.outDir)).filter(f=>f!=="ind\
252
- ex.html"))or(W(i.build.outDir,l),{recursive:!0});else{const l=W(i.build.outDir,"index.html");_e(l)&&ds(l,W(i.build.outDir,"404.html"))}};function Fr(t,e){return r=>r.length>1?[t,e,r[0],"--",...r.slice(1)]:[t,e,r[0]]}function ol(){return t=>["deno","run",`npm:${t[0]}`,...t.slice(1)]}const il={agent:["npm",0],run:Fr("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,dedupe:["npm","dedupe",0],execute:[
253
- "npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninstall","-g",0]},Zs={agent:["yarn",0],run:["yarn","run",0],install:["yarn","install",0],frozen:["yarn","install","--frozen-lockfile",0],global:["yarn","global","add",0],add:["yarn","add",0],upgrade:["yarn","upgrade",0],"upgrade-interactive":["yarn","upgrade-interactive",0],dedupe:null,execute:["npx",0],"execute-local":Fr("yarn","exec"),uninstall:["yarn","remove",0],global_uninstall:["yarn","global","re\
254
- move",0]},al={...Zs,frozen:["yarn","install","--immutable",0],upgrade:["yarn","up",0],"upgrade-interactive":["yarn","up","-i",0],dedupe:["yarn","dedupe",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},eo={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:["pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interactive":["pnpm",
255
- "update","-i",0],dedupe:["pnpm","dedupe",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remove","--global",0]},cl={agent:["bun",0],run:["bun","run",0],install:["bun","install",0],frozen:["bun","install","--frozen-lockfile",0],global:["bun","add","-g",0],add:["bun","add",0],upgrade:["bun","update",0],"upgrade-interactive":["bun","update","-i",0],dedupe:null,execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:["bun","\
256
- remove",0],global_uninstall:["bun","remove","-g",0]},ul={agent:["deno",0],run:["deno","task",0],install:["deno","install",0],frozen:["deno","install","--frozen",0],global:["deno","install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],dedupe:null,execute:ol(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:["deno","uninstall","-g",0]},ll={npm:il,yarn:Zs,"yarn@berry":al,pnpm:eo,
257
- "pnpm@6":{...eo,run:Fr("pnpm","run")},bun:cl,deno:ul};function fl(t,e,r){const n=ll[t][e];return pl(n,r)}function pl(t,e){if(t==null)return null;const r=typeof t=="function"?t(e):t.flatMap(n=>typeof n=="number"?e:[n]);return{command:r[0],args:r.slice(1)}}const dl=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],to={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"\
258
- npm"},ro={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function Gr(t,e){try{const r=await vs.stat(t);return e==="file"?r.isFile():r.isDirectory()}catch{return!1}}function*hl(t=se.cwd()){let e=X.resolve(t);const{root:r}=X.parse(e);for(;e&&e!==r;)yield e,e=X.dirname(e)}async function no(t,e){return!t||
259
- !await Gr(t,"file")?null:await yl(t,e)}async function ml(t={}){const{cwd:e,strategies:r=["lockfile","packageManager-field","devEngines-field"]}=t;let n;if(typeof t.stopDir=="string"){const o=X.resolve(t.stopDir);n=u=>u===o}else n=t.stopDir;for(const o of hl(e)){for(const u of r)switch(u){case"lockfile":{for(const s of Object.keys(to))if(await Gr(X.join(o,s),"file")){const i=to[s],c=await no(X.join(o,"package.json"),t);return c||{name:i,agent:i}}break}case"packageManager-field":case"devEngines-fi\
260
- eld":{const s=await no(X.join(o,"package.json"),t);if(s)return s;break}case"install-metadata":{for(const s of Object.keys(ro)){const i=s.endsWith("/")?"dir":"file";if(await Gr(X.join(o,s),i)){const c=ro[s],a=c==="yarn"?wl(s)?"yarn":"yarn@berry":c;return{name:c,agent:a}}}break}}if(n?.(o))break}return null}function gl(t){const e=r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r;if(typeof t.packageManager=="string"){const[r,n]=t.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:e(n)}}if(typeof t.devEngines?.
261
- packageManager?.name=="string")return{name:t.devEngines.packageManager.name,ver:e(t.devEngines.packageManager.version)}}async function yl(t,e){try{const r=await vs.readFile(t,"utf8"),n=e.packageJsonParser?await e.packageJsonParser(r,t):JSON.parse(r);let o;const u=gl(n);if(u){const s=u.name,i=u.ver;let c=i;return s==="yarn"&&i&&Number.parseInt(i)>1?(o="yarn@berry",c="berry",{name:s,agent:o,version:c}):s==="pnpm"&&i&&Number.parseInt(i)<7?(o="pnpm@6",{name:s,agent:o,version:c}):dl.includes(s)?(o=s,
262
- {name:s,agent:o,version:c}):e.onUnknown?.(n.packageManager)??null}}catch{}return null}function wl(t){return t.endsWith(".yarn_integrity")}function so(t){try{return!!au.createRequire(import.meta.url).resolve(t)}catch(e){return ge.debug(gt(e)),!1}}async function ut(){if(so("react")&&so("react-dom")){ge.debug("react already installed");return}ge.debug("react not installed");const t=await ml();t||(ge.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,
263
- process.exit(1));const e=fl(t.agent,"add",["react","react-dom"]);e||(ge.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await os(e.command,e.args,{stdio:"inherit"})}catch(r){ge.debug(gt(r)),ge.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1)}}function oo(t){if(t.resolvedUrls)return is(t.resolvedUrls.network)??is(t.resolvedUrls.local)}function io(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no re\
243
+ `.trimStart()}const Gr=async({languageServices:t,likec4AssetsDir:e,...r})=>{const n=r.customLogger??Nu,i=$r(),a=r?.useOverviewGraph===!0;n.info(`${y.cyan("likec4 app root")} ${y.dim(i)}`);const s=r.outputDir??z(t.workspace,"dist");n.info(y.cyan("outDir")+" "+y.dim(s));let o="/";r.base&&(o=us(r.base),!Cc(o)&&o!=="./"&&(o=xc(o))),o!=="/"&&n.info(`${y.green("app base url")} ${y.dim(o)}`);const c=r.webcomponentPrefix??"likec4",u=r.title??"LikeC4",l=r.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:e,
244
+ webcomponentPrefix:c,title:u,root:i,languageServices:t,clearScreen:!1,base:o,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...Rr(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/styles","@likec4/core/compute-view/relationships","@likec4/core/u\
245
+ tils","@likec4/core","likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(c),PAGE_TITLE:JSON.stringify(u),__USE_OVERVIEW_GRAPH__:a?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:s,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Er,rollupOptions:{
246
+ treeshake:{preset:"recommended"},...!l&&{input:[z(i,"index.html"),z(i,"src","main.js"),z(i,"src","fonts.css"),z(i,"src","style.css")],output:{manualChunks:f=>{if(!(f.endsWith(".css")||f.endsWith(".html")||f.includes("likec4/icons"))){if(f.includes("__app__")){let p=f.match(/__app__\/src\/([\w]+)\.js/)?.[1];return p?p[1]:void 0}if(f.includes("node_modules/likec4")||f.includes("node_modules/@likec4"))return"likec4";if(f.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[fr(),dr(
247
+ {languageServices:t.languageServices,useOverviewGraph:a}),l?rl():void 0].filter(Boolean)}};async function Br({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const a=ve(["vite","webcomponent"]),s=$r();return a.info(y.cyan("outDir")+" "+y.dim(e)),{root:s,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Rr(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/cl\
248
+ ient"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...vr,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Er,lib:{entry:"src/webcomponent.js",fileName(o,c){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:a,plugins:[
249
+ fr(),dr({languageServices:t.languageServices,useOverviewGraph:!1})]}}const cl=["favicon.ico","robots.txt"],ul=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:a,...s})=>{i??=await bt(it(Et(),".likec4-assets-"));const o=await Gr({...s,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:e,title:r,outputSingleFile:a}),c=await br();for(const l of cl){const f=z(o.root,l);_e(f)&&ws(f,z(c,l))}const u=n.languageServices.projects();
250
+ if(u.length===1){const l=await n.viewsService.computedViews(),f=await n.diagrams();if(f.length===0)throw process.exitCode=1,new Error("no views found");f.length===l.length?o.customLogger.info(`${y.dim("workspace:")} ${y.green("\u2713 all views layouted")}`):o.customLogger.warn(`${y.dim("workspace:")} ${y.yellow(`\u2717 layouted ${f.length} of ${l.length} views`)}`),f.forEach(p=>{(p.hasLayoutDrift||p.drifts&&p.drifts.length>0)&&o.customLogger.warn(y.dim("view")+" "+y.red(p.id)+" "+y.yellow("is ou\
251
+ t of date, layout drift detected"))})}else for(const l of u){const f=await n.viewsService.computedViews(l.id);f.length===0?o.customLogger.warn(`${y.dim("project:")} ${l.id} ${y.yellow("\u2717 no views found")}`):o.customLogger.info(`${y.dim("project:")} ${l.id} ${y.green(`${f.length} views`)}`)}if(t){const l=await Br({webcomponentPrefix:e,languageServices:n,outDir:c,base:o.base});await ct(l)}if(await ct({...o,publicDir:c,mode:"production"}),a)for(let l of Kc(z(o.build.outDir)).filter(f=>f!=="ind\
252
+ ex.html"))cr(z(o.build.outDir,l),{recursive:!0});else{const l=z(o.build.outDir,"index.html");_e(l)&&ws(l,z(o.build.outDir,"404.html"))}};function Vr(t,e){return r=>r.length>1?[t,e,r[0],"--",...r.slice(1)]:[t,e,r[0]]}function ll(){return t=>["deno","run",`npm:${t[0]}`,...t.slice(1)]}const fl={agent:["npm",0],run:Vr("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,dedupe:["npm","dedupe",0],execute:[
253
+ "npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninstall","-g",0]},oi={agent:["yarn",0],run:["yarn","run",0],install:["yarn","install",0],frozen:["yarn","install","--frozen-lockfile",0],global:["yarn","global","add",0],add:["yarn","add",0],upgrade:["yarn","upgrade",0],"upgrade-interactive":["yarn","upgrade-interactive",0],dedupe:null,execute:["npx",0],"execute-local":Vr("yarn","exec"),uninstall:["yarn","remove",0],global_uninstall:["yarn","global","re\
254
+ move",0]},pl={...oi,frozen:["yarn","install","--immutable",0],upgrade:["yarn","up",0],"upgrade-interactive":["yarn","up","-i",0],dedupe:["yarn","dedupe",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},ai={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:["pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interactive":["pnpm",
255
+ "update","-i",0],dedupe:["pnpm","dedupe",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remove","--global",0]},dl={agent:["bun",0],run:["bun","run",0],install:["bun","install",0],frozen:["bun","install","--frozen-lockfile",0],global:["bun","add","-g",0],add:["bun","add",0],upgrade:["bun","update",0],"upgrade-interactive":["bun","update","-i",0],dedupe:null,execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:["bun","\
256
+ remove",0],global_uninstall:["bun","remove","-g",0]},hl={agent:["deno",0],run:["deno","task",0],install:["deno","install",0],frozen:["deno","install","--frozen",0],global:["deno","install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],dedupe:null,execute:ll(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:["deno","uninstall","-g",0]},ml={npm:fl,yarn:oi,"yarn@berry":pl,pnpm:ai,
257
+ "pnpm@6":{...ai,run:Vr("pnpm","run")},bun:dl,deno:hl};function gl(t,e,r){const n=ml[t][e];return yl(n,r)}function yl(t,e){if(t==null)return null;const r=typeof t=="function"?t(e):t.flatMap(n=>typeof n=="number"?e:[n]);return{command:r[0],args:r.slice(1)}}const wl=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],ci={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"\
258
+ npm"},ui={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function zr(t,e){try{const r=await Ss.stat(t);return e==="file"?r.isFile():r.isDirectory()}catch{return!1}}function*vl(t=re.cwd()){let e=W.resolve(t);const{root:r}=W.parse(e);for(;e&&e!==r;)yield e,e=W.dirname(e)}async function li(t,e){return!t||
259
+ !await zr(t,"file")?null:await El(t,e)}async function $l(t={}){const{cwd:e,strategies:r=["lockfile","packageManager-field","devEngines-field"]}=t;let n;if(typeof t.stopDir=="string"){const i=W.resolve(t.stopDir);n=a=>a===i}else n=t.stopDir;for(const i of vl(e)){for(const a of r)switch(a){case"lockfile":{for(const s of Object.keys(ci))if(await zr(W.join(i,s),"file")){const o=ci[s],c=await li(W.join(i,"package.json"),t);return c||{name:o,agent:o}}break}case"packageManager-field":case"devEngines-fi\
260
+ eld":{const s=await li(W.join(i,"package.json"),t);if(s)return s;break}case"install-metadata":{for(const s of Object.keys(ui)){const o=s.endsWith("/")?"dir":"file";if(await zr(W.join(i,s),o)){const c=ui[s],u=c==="yarn"?Rl(s)?"yarn":"yarn@berry":c;return{name:c,agent:u}}}break}}if(n?.(i))break}return null}function bl(t){const e=r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r;if(typeof t.packageManager=="string"){const[r,n]=t.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:e(n)}}if(typeof t.devEngines?.
261
+ packageManager?.name=="string")return{name:t.devEngines.packageManager.name,ver:e(t.devEngines.packageManager.version)}}async function El(t,e){try{const r=await Ss.readFile(t,"utf8"),n=e.packageJsonParser?await e.packageJsonParser(r,t):JSON.parse(r);let i;const a=bl(n);if(a){const s=a.name,o=a.ver;let c=o;return s==="yarn"&&o&&Number.parseInt(o)>1?(i="yarn@berry",c="berry",{name:s,agent:i,version:c}):s==="pnpm"&&o&&Number.parseInt(o)<7?(i="pnpm@6",{name:s,agent:i,version:c}):wl.includes(s)?(i=s,
262
+ {name:s,agent:i,version:c}):e.onUnknown?.(n.packageManager)??null}}catch{}return null}function Rl(t){return t.endsWith(".yarn_integrity")}function fi(t){try{return!!hu.createRequire(import.meta.url).resolve(t)}catch(e){return ge.debug(yt(e)),!1}}async function lt(){if(fi("react")&&fi("react-dom")){ge.debug("react already installed");return}ge.debug("react not installed");const t=await $l();t||(ge.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,
263
+ process.exit(1));const e=gl(t.agent,"add",["react","react-dom"]);e||(ge.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await ls(e.command,e.args,{stdio:"inherit"})}catch(r){ge.debug(yt(r)),ge.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1)}}function pi(t){if(t.resolvedUrls)return fs(t.resolvedUrls.network)??fs(t.resolvedUrls.local)}function di(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no re\
264
264
  solvedUrls");Te([y.green("LikeC4 served at:"),"",y.dim("Local: ")+t.resolvedUrls.local.join(`
265
265
  `+"".padEnd(9," ")),t.resolvedUrls.network.length?y.dim("Network: ")+t.resolvedUrls.network.join(`
266
- `+"".padEnd(9," ")):void 0].filter(e=>Ec(e)).join(`
267
- `))}class ao extends Error{constructor(e){super(`${e} is locked`)}}const We={old:new Set,young:new Set},vl=1e3*15,_t=1024,Ct=65535;let lt;const $l=()=>{const t=ot.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},co=t=>new Promise((e,r)=>{const n=cu.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:o}=n.address();n.close(()=>{e(o)})})}),uo=async(t,e)=>{if(t.host||t.port===0)return co(t);for(const r of e)
268
- try{await co({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},bl=function*(t){t&&(yield*t),yield 0};async function Br(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const o=t.exclude;if(typeof o[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const u of o){if(typeof u!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
269
- responding to the port you want excluded.");if(!Number.isSafeInteger(u))throw new TypeError(`Number ${u} in the exclude option is not a safe integer and can't be used`)}r=new Set(o)}lt===void 0&&(lt=setTimeout(()=>{lt=void 0,We.old=We.young,We.young=new Set},vl),lt.unref&&lt.unref());const n=$l();for(const o of bl(e))try{if(r.has(o))continue;let u=await uo({...t,port:o},n);for(;We.old.has(u)||We.young.has(u);){if(o!==0)throw new ao(o);u=await uo({...t,port:o},n)}return We.young.add(u),u}catch(u){
270
- if(!["EADDRINUSE","EACCES"].includes(u.code)&&!(u instanceof ao))throw u}throw new Error("No available ports found")}function xt(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<_t||t>Ct)throw new RangeError(`'from' must be between ${_t} and ${Ct}`);if(e<_t||e>Ct)throw new RangeError(`'to' must be between ${_t} and ${Ct}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,o){for(let u=n;u<=
271
- o;u++)yield u}(t,e)}async function lo({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",title:n,languageServices:o,likec4AssetsDir:u,openBrowser:s,listen:i,port:c,...a}){u??=await $t(nt(bt(),".likec4-assets-"));const{isDev:l,...f}=await Mr({...a,languageServices:o,likec4AssetsDir:u,webcomponentPrefix:r,title:n}),p=f.customLogger;c??=ys.PORT?parseInt(ys.PORT,10):void 0,c||(c=await Br({port:[5173,5174,...xt(61e3,61010),...xt(62002,62010)]}));const h=await Br({port:xt(24678,24690)}),v=await wr(),
272
- w=i??(Ie()?"0.0.0.0":"localhost");e?(p.info(`Enabling HMR: localhost:${h}`),Ie()&&p.info(y.yellow(`ensure port ${h} is published from container`))):p.info("Disabling HMR");const m=await ou({...f,define:e?{...f.define,"process.env.NODE_ENV":'"development"'}:f.define,mode:e?"development":f.mode,publicDir:v,server:{host:w,allowedHosts:!0,port:c,hmr:e&&{overlay:!0,port:h},fs:{strict:!1},open:s??(!l&&!Ie())}});return t?(p.info("Building webcomponent"),Ur({webcomponentPrefix:r,languageServices:o,outDir:v,
273
- base:f.base}).then(g=>it({...g,logLevel:"warn"})).catch(g=>{p.warn(gt(g)),p.warn("webcomponent build failed, ignoring error and continue")})):p.info("Skip webcomponent build"),await m.listen(),m}async function El({browserContext:t,views:e,output:r,logger:n,timeout:o,maxAttempts:u,dynamicVariant:s,outputType:i,theme:c}){let a;const l=e.map(h=>({view:h,attempt:1})),f=[];let p;for(;p=l.shift();){const{view:h,attempt:v}=p,w=`export/${encodeURIComponent(h.id)}/`;try{if(v>1){a&&(a.close({runBeforeUnload:!0}).
274
- catch(E=>n.error(`failed to close page: ${E}`)),a=void 0);const S=as(v*200,{min:200,max:1e3});n.info(y.cyan(w)+y.dim(` attempt ${v} of ${u} after ${S}ms`)),await uu(S)}else h.hasLayoutDrift&&n.warn(y.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+y.red(h.id));let m=".";i==="relative"&&(m=h.sourcePath??".",m.includes("/")?m=m.slice(0,m.lastIndexOf("/")):m=".");const g=W(r,m,`${h.id}.png`);a??=await t.newPage();let T=h.bounds;s==="sequence"&&h._type==="dynamic"&&
275
- (T=h.sequenceLayout.bounds);const d=20;await a.setViewportSize({width:T.width+40+d,height:T.height+40+d}),await a.goto(Rc(w,{padding:20,theme:c,dynamic:s})),n.info(y.cyan(w)+y.dim(` -> ${Ce(r,g)}`)),await a.waitForSelector(".react-flow.initialized"),h.nodes.some(S=>Sc(S.icon)&&S.icon.toLowerCase().startsWith("http"))&&await Rl(a,o),await a.getByTestId("export-page").screenshot({animations:"disabled",path:g,omitBackground:!0}),f.push({view:h,path:g})}catch(m){a?.close({runBeforeUnload:!0}).catch(
266
+ `+"".padEnd(9," ")):void 0].filter(e=>Tc(e)).join(`
267
+ `))}class hi extends Error{constructor(e){super(`${e} is locked`)}}const Ke={old:new Set,young:new Set},Sl=1e3*15,Ct=1024,xt=65535;let ft;const Al=()=>{const t=at.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},mi=t=>new Promise((e,r)=>{const n=mu.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:i}=n.address();n.close(()=>{e(i)})})}),gi=async(t,e)=>{if(t.host||t.port===0)return mi(t);for(const r of e)
268
+ try{await mi({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},_l=function*(t){t&&(yield*t),yield 0};async function Wr(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const a of i){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
269
+ responding to the port you want excluded.");if(!Number.isSafeInteger(a))throw new TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}ft===void 0&&(ft=setTimeout(()=>{ft=void 0,Ke.old=Ke.young,Ke.young=new Set},Sl),ft.unref&&ft.unref());const n=Al();for(const i of _l(e))try{if(r.has(i))continue;let a=await gi({...t,port:i},n);for(;Ke.old.has(a)||Ke.young.has(a);){if(i!==0)throw new hi(i);a=await gi({...t,port:i},n)}return Ke.young.add(a),a}catch(a){
270
+ if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof hi))throw a}throw new Error("No available ports found")}function Tt(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<Ct||t>xt)throw new RangeError(`'from' must be between ${Ct} and ${xt}`);if(e<Ct||e>xt)throw new RangeError(`'to' must be between ${Ct} and ${xt}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let a=n;a<=
271
+ i;a++)yield a}(t,e)}async function yi({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",title:n,languageServices:i,likec4AssetsDir:a,openBrowser:s,listen:o,port:c,...u}){a??=await bt(it(Et(),".likec4-assets-"));const{isDev:l,...f}=await Gr({...u,languageServices:i,likec4AssetsDir:a,webcomponentPrefix:r,title:n}),p=f.customLogger;c??=Es.PORT?parseInt(Es.PORT,10):void 0,c||(c=await Wr({port:[5173,5174,...Tt(61e3,61010),...Tt(62002,62010)]}));const h=await Wr({port:Tt(24678,24690)}),v=await br(),
272
+ w=o??(Le()?"0.0.0.0":"localhost");e?(p.info(`Enabling HMR: localhost:${h}`),Le()&&p.info(y.yellow(`ensure port ${h} is published from container`))):p.info("Disabling HMR");const m=await pu({...f,define:e?{...f.define,"process.env.NODE_ENV":'"development"'}:f.define,mode:e?"development":f.mode,publicDir:v,server:{host:w,allowedHosts:!0,port:c,hmr:e&&{overlay:!0,port:h},fs:{strict:!1},open:s??(!l&&!Le())}});return t?(p.info("Building webcomponent"),Br({webcomponentPrefix:r,languageServices:i,outDir:v,
273
+ base:f.base}).then(g=>ct({...g,logLevel:"warn"})).catch(g=>{p.warn(yt(g)),p.warn("webcomponent build failed, ignoring error and continue")})):p.info("Skip webcomponent build"),await m.listen(),m}async function Cl({browserContext:t,views:e,output:r,logger:n,timeout:i,maxAttempts:a,dynamicVariant:s,outputType:o,theme:c}){let u;const l=e.map(h=>({view:h,attempt:1})),f=[];let p;for(;p=l.shift();){const{view:h,attempt:v}=p,w=`export/${encodeURIComponent(h.id)}/`;try{if(v>1){u&&(u.close({runBeforeUnload:!0}).
274
+ catch(E=>n.error(`failed to close page: ${E}`)),u=void 0);const S=ps(v*200,{min:200,max:1e3});n.info(y.cyan(w)+y.dim(` attempt ${v} of ${a} after ${S}ms`)),await gu(S)}else h.hasLayoutDrift&&n.warn(y.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+y.red(h.id));let m=".";o==="relative"&&(m=h.sourcePath??".",m.includes("/")?m=m.slice(0,m.lastIndexOf("/")):m=".");const g=z(r,m,`${h.id}.png`);u??=await t.newPage();let T=h.bounds;s==="sequence"&&h._type==="dynamic"&&
275
+ (T=h.sequenceLayout.bounds);const d=20;await u.setViewportSize({width:T.width+40+d,height:T.height+40+d}),await u.goto(Ic(w,{padding:20,theme:c,dynamic:s})),n.info(y.cyan(w)+y.dim(` -> ${Ce(r,g)}`)),await u.waitForSelector(".react-flow.initialized"),h.nodes.some(S=>Oc(S.icon)&&S.icon.toLowerCase().startsWith("http"))&&await xl(u,i),await u.getByTestId("export-page").screenshot({animations:"disabled",path:g,omitBackground:!0}),f.push({view:h,path:g})}catch(m){u?.close({runBeforeUnload:!0}).catch(
276
276
  g=>n.error(`failed to close page: ${g}`)),n.error(y.red("failed "+w+`
277
- `+m)),v<u&&(l.push({view:h,attempt:v+1}),n.info(y.dim(`retry ${w}`))),a=void 0}}return f}async function Rl(t,e){let r=await t.locator("//img").all();if(!r.length)return;const n=r.map(o=>o.evaluate(u=>u.complete||new Promise(s=>{u.onload=s,u.onerror=s}),{timeout:Math.max(15e3,e)}));await Promise.allSettled(n)}var fo=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),po=t=>{throw TypeError(t)},Sl=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&po("Object expected");var n,o;n=e[fo("asyn\
278
- cDispose")],n===void 0&&(n=e[fo("dispose")],o=n),typeof n!="function"&&po("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push([r]);return e},Al=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},o=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])
279
- return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){o(c)}if(r)throw e};return u()};async function ho({logger:t,serverUrl:e,theme:r="light",timeoutMs:n=15e3,views:o,output:u,outputType:s="relative",maxAttempts:i=3,chromiumSandbox:c=!1,sequence:a=!1}){t.info(`${y.dim("output")} ${u}`),t.info(`${y.dim("base url")} ${e}
277
+ `+m)),v<a&&(l.push({view:h,attempt:v+1}),n.info(y.dim(`retry ${w}`))),u=void 0}}return f}async function xl(t,e){let r=await t.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(a=>a.complete||new Promise(s=>{a.onload=s,a.onerror=s}),{timeout:Math.max(15e3,e)}));await Promise.allSettled(n)}var wi=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),vi=t=>{throw TypeError(t)},Tl=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&vi("Object expected");var n,i;n=e[wi("asyn\
278
+ cDispose")],n===void 0&&(n=e[wi("dispose")],i=n),typeof n!="function"&&vi("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push([r]);return e},Il=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=s,u.suppressed=o,u},i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])
279
+ return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){i(c)}if(r)throw e};return a()};async function $i({logger:t,serverUrl:e,theme:r="light",timeoutMs:n=15e3,views:i,output:a,outputType:s="relative",maxAttempts:o=3,chromiumSandbox:c=!1,sequence:u=!1}){t.info(`${y.dim("output")} ${a}`),t.info(`${y.dim("base url")} ${e}
280
280
  `);const{chromium:l}=await import("playwright"),f=l.executablePath();t.info(y.cyan("Start chromium")+" "+y.dim(f));const p=await l.launch({chromiumSandbox:c,headless:!0});t.info(y.cyan("Color scheme: ")+r+`
281
- `);const h=await p.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:e,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});h.setDefaultNavigationTimeout(n),h.setDefaultTimeout(n);try{return await El({browserContext:h,views:o,output:u,outputType:s,logger:t,maxAttempts:i,dynamicVariant:a?"sequence":"diagram",timeout:n,theme:r})}finally{t.info(y.cyan("close chromium")),await h.close(),await p.close()}}async function mo({path:t,useDotBin:e,project:r,theme:n="light",output:o,outputType:u,serverUrl:s,
282
- ignore:i=!1,timeoutMs:c=1e4,maxAttempts:a=3,filter:l,sequence:f=!1,chromiumSandbox:p=!1}){var h=[];try{const g=ve("export"),T=Bc(),d=Sl(h,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),!0);o??=d.workspace;let S,E=[...d.languageServices.projects()];if(r&&!E.some(A=>A.id===r))throw g.error(`project not found: ${r}`),new Error(`project not found: ${r}`);if(!s&&(g.info(y.cyan("start preview server")),S=await lo({languageServices:d,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,
283
- hmr:!1}),s=oo(S),!s))throw g.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");for(const A of E){if(r&&A.id!==r)continue;E.length>1&&(g.info(y.dim("---------")),g.info(`${y.dim("project:")} ${A.id}`),g.info(`${y.dim("folder:")} ${A.folder.fsPath}`));let b=await d.diagrams(A.id);if(l&&rt(l,1)&&rt(b,1)){const F=Ac(l);g.info(`${y.cyan("filter")} ${y.dim(JSON.stringify(l))}`),b=b.filter(I=>F(I.id)?(g.info(`${y.green("include")} ${I.id} \u2705`),
284
- !0):(g.info(`${y.gray("skip")} ${y.dim(I.id)}`),!1))}if(!rt(b,1)){g.warn("no views found");continue}let x=E.length>1?ss(cs(s,"project",A.id)):s,q=E.length>1?cs(o,A.id):o;const M=await ho({logger:g,serverUrl:x,theme:n,timeoutMs:c,views:b,output:q,outputType:u,maxAttempts:a,sequence:f,chromiumSandbox:p}),{pretty:B}=_c(T);if(M.length>0&&g.info(y.green(`exported ${M.length} views in ${B}`)+`
285
- `),M.length!==b.length&&(i&&M.length>0?g.info(y.dim("ignore")+" "+y.red(`failed ${b.length-M.length} out of ${b.length} views`)):g.error(y.red(`failed ${b.length-M.length} out of ${b.length} views`))),M.length!==b.length&&(M.length===0||!i))throw new Error(`Failed ${b.length-M.length} out of ${b.length} views`)}S&&(g.info(y.cyan("stop server")),await S.close().catch(A=>{g.error(A)}))}catch(g){var v=g,w=!0}finally{var m=Al(h,v,w);m&&await m}}var go=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yo=t=>{
286
- throw TypeError(t)},_l=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&yo("Object expected");var n,o;n=e[go("asyncDispose")],n===void 0&&(n=e[go("dispose")],o=n),typeof n!="function"&&yo("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push([r]);return e},Cl=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},
287
- o=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){o(c)}if(r)throw e};return u()};const{cyan:wo,dim:vo}=y;async function xl({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,title:o,useOverview:u=!1,output:s,outputSingleFile:i,base:c}){var a=[];try{await ut();const h=ve("c4:build"),v=_l(a,await ye.fromWorkspace(t,{graphviz:e?"binary":"wasm",logger:"vi\
288
- te",watch:!1}),!0),w=s??W(v.workspace,"dist");let m=W(w,"assets");if(u)try{m=W(w,"assets","previews"),await Se(m,{recursive:!0}),h.info(`${wo("Generate previews")} ${vo(m)}
289
- `),await mo({path:t,useDotBin:e,project:void 0,output:m,outputType:"flat",ignore:!0})}catch(g){h.error(y.red("Failed to generate previews")),h.error(g),h.warn(y.yellow("Ignore previews and continue build")),or(m,{recursive:!0,force:!0}),u=!1}await sl({base:c,useHashHistory:i||r,customLogger:h,useOverviewGraph:u,webcomponentPrefix:n,title:o,languageServices:v,likec4AssetsDir:m,outputDir:s,outputSingleFile:i}),u&&(h.info(`${wo("clean previews")} ${vo(m)}`),or(m,{recursive:!0,force:!0}))}catch(h){var l=h,
290
- f=!0}finally{var p=Cl(a,l,f);p&&await p}}const Tl=t=>t.command({command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:e=>e.positional("path",pe).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:W}).option("base",Ts).option("use-hash-history",Cs).option("use-dot",he).option("webcomponent-prefix",mr).option("title",xs).option("output-single-file",Su).example(`${y.green("$0 build -o ./build ./src")}`,y.gray("Sear\
291
- ch for likec4 files in 'src' and output static site to 'build'")),handler:async e=>{await xl({path:e.path,output:e.output,base:e.base,useHashHistory:e["use-hash-history"],useDotBin:e["use-dot"],webcomponentPrefix:e["webcomponent-prefix"],title:e.title,outputSingleFile:e["output-single-file"]??!1})}}),qe=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},Vr=new Set(["__proto__","prototype","constructor"]),Ll=new Set("0123456789");function Tt(t){const e=[];let r="",n="start",o=!1;
292
- for(const u of t)switch(u){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");o&&(r+=u),n="property",o=!o;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(o){o=!1,r+=u;break}if(Vr.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}
293
- if(o){o=!1,r+=u;break}if(n==="property"){if(Vr.has(r))return[];e.push(r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Ll.has(u))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),o&&(o=!1,r+="\\"),r+=u}}switch(o&&(r+="\\"),n){case"property":{if(Vr.has(r))
294
- return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Wr(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function $o(t,e){if(Wr(t,e))throw new Error("Cannot use string index")}function kl(t,e,r){if(!qe(t)||typeof e!="string")return r===void 0?t:r;const n=Tt(e);if(n.length===0)return r;for(let o=0;o<n.length;o++){const u=n[o];if(Wr(t,u)?t=o===n.length-
295
- 1?void 0:null:t=t[u],t==null){if(o!==n.length-1)return r;break}}return t===void 0?r:t}function bo(t,e,r){if(!qe(t)||typeof e!="string")return t;const n=t,o=Tt(e);for(let u=0;u<o.length;u++){const s=o[u];$o(t,s),u===o.length-1?t[s]=r:qe(t[s])||(t[s]=typeof o[u+1]=="number"?[]:{}),t=t[s]}return n}function Il(t,e){if(!qe(t)||typeof e!="string")return!1;const r=Tt(e);for(let n=0;n<r.length;n++){const o=r[n];if($o(t,o),n===r.length-1)return delete t[o],!0;if(t=t[o],!qe(t))return!1}}function Ol(t,e){if(!qe(
296
- t)||typeof e!="string")return!1;const r=Tt(e);if(r.length===0)return!1;for(const n of r){if(!qe(t)||!(n in t)||Wr(t,n))return!1;t=t[n]}return!0}const Oe=ot.homedir(),zr=ot.tmpdir(),{env:ze}=se,Pl=t=>{const e=X.join(Oe,"Library");return{data:X.join(e,"Application Support",t),config:X.join(e,"Preferences",t),cache:X.join(e,"Caches",t),log:X.join(e,"Logs",t),temp:X.join(zr,t)}},Nl=t=>{const e=ze.APPDATA||X.join(Oe,"AppData","Roaming"),r=ze.LOCALAPPDATA||X.join(Oe,"AppData","Local");return{data:X.join(
297
- r,t,"Data"),config:X.join(e,t,"Config"),cache:X.join(r,t,"Cache"),log:X.join(r,t,"Log"),temp:X.join(zr,t)}},jl=t=>{const e=X.basename(Oe);return{data:X.join(ze.XDG_DATA_HOME||X.join(Oe,".local","share"),t),config:X.join(ze.XDG_CONFIG_HOME||X.join(Oe,".config"),t),cache:X.join(ze.XDG_CACHE_HOME||X.join(Oe,".cache"),t),log:X.join(ze.XDG_STATE_HOME||X.join(Oe,".local","state"),t),temp:X.join(zr,e,t)}};function Dl(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string\
298
- , got ${typeof t}`);return e&&(t+=`-${e}`),se.platform==="darwin"?Pl(t):se.platform==="win32"?Nl(t):jl(t)}const Pe=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},xe=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(o){return e(o)}},ql=se.getuid?!se.getuid():!1,Hl=1e4,we=()=>{},ee={isChangeErrorOk:t=>{if(!ee.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!ql&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!ee.isNodeError(t))return!1;
299
- const{code:e}=t;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!ee.isNodeError(t))throw t;if(!ee.isChangeErrorOk(t))throw t}};class Ml{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Hl,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.
300
- intervalId)},this.add=e=>{this.queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{const r=()=>this.remove(n),n=()=>e(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),
301
- e()}}}}}const Ul=new Ml,Ne=(t,e)=>function(n){return function o(...u){return Ul.schedule().then(s=>{const i=a=>(s(),a),c=a=>{if(s(),Date.now()>=n)throw a;if(e(a)){const l=Math.round(100*Math.random());return new Promise(p=>setTimeout(p,l)).then(()=>o.apply(void 0,u))}throw a};return t.apply(void 0,u).then(i,c)})}},je=(t,e)=>function(n){return function o(...u){try{return t.apply(void 0,u)}catch(s){if(Date.now()>n)throw s;if(e(s))return o.apply(void 0,u);throw s}}},ce={attempt:{chmod:Pe(ae(V.chmod),
302
- ee.onChangeError),chown:Pe(ae(V.chown),ee.onChangeError),close:Pe(ae(V.close),we),fsync:Pe(ae(V.fsync),we),mkdir:Pe(ae(V.mkdir),we),realpath:Pe(ae(V.realpath),we),stat:Pe(ae(V.stat),we),unlink:Pe(ae(V.unlink),we),chmodSync:xe(V.chmodSync,ee.onChangeError),chownSync:xe(V.chownSync,ee.onChangeError),closeSync:xe(V.closeSync,we),existsSync:xe(V.existsSync,we),fsyncSync:xe(V.fsync,we),mkdirSync:xe(V.mkdirSync,we),realpathSync:xe(V.realpathSync,we),statSync:xe(V.statSync,we),unlinkSync:xe(V.unlinkSync,
303
- we)},retry:{close:Ne(ae(V.close),ee.isRetriableError),fsync:Ne(ae(V.fsync),ee.isRetriableError),open:Ne(ae(V.open),ee.isRetriableError),readFile:Ne(ae(V.readFile),ee.isRetriableError),rename:Ne(ae(V.rename),ee.isRetriableError),stat:Ne(ae(V.stat),ee.isRetriableError),write:Ne(ae(V.write),ee.isRetriableError),writeFile:Ne(ae(V.writeFile),ee.isRetriableError),closeSync:je(V.closeSync,ee.isRetriableError),fsyncSync:je(V.fsyncSync,ee.isRetriableError),openSync:je(V.openSync,ee.isRetriableError),readFileSync:je(
304
- V.readFileSync,ee.isRetriableError),renameSync:je(V.renameSync,ee.isRetriableError),statSync:je(V.statSync,ee.isRetriableError),writeSync:je(V.writeSync,ee.isRetriableError),writeFileSync:je(V.writeFileSync,ee.isRetriableError)}},Fl="utf8",Eo=438,Gl=511,Bl={},Vl=ot.userInfo().uid,Wl=ot.userInfo().gid,zl=1e3,Xl=!!se.getuid;se.getuid&&se.getuid();const Ro=128,Kl=t=>t instanceof Error&&"code"in t,So=t=>typeof t=="string",Xr=t=>t===void 0,Jl=se.platform==="linux",Ao=se.platform==="win32",Kr=["SIGABR\
305
- T","SIGALRM","SIGHUP","SIGINT","SIGTERM"];Ao||Kr.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),Jl&&Kr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Yl{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(Ao&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?se.kill(se.pid,"SIGTERM"):se.kill(se.pid,e))}},this.hook=()=>{se.once("exit",()=>this.exit());for(const e of Kr)
306
- try{se.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const Ql=new Yl,Zl=Ql.register,ue={store:{},create:t=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),o=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${o}`},get:(t,e,r=!0)=>{const n=ue.truncate(e(t));return n in ue.store?ue.get(t,e,r):(ue.store[n]=r,[n,()=>delete ue.store[n]])},purge:t=>{ue.store[t]&&(delete ue.store[t],ce.attempt.
307
- unlink(t))},purgeSync:t=>{ue.store[t]&&(delete ue.store[t],ce.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in ue.store)ue.purgeSync(t)},truncate:t=>{const e=X.basename(t);if(e.length<=Ro)return t;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;const n=e.length-Ro;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Zl(ue.purgeSyncAll);function _o(t,e,r=Bl){if(So(r))return _o(t,e,{encoding:r});const n=Date.now()+((r.timeout??zl)||-1);
308
- let o=null,u=null,s=null;try{const i=ce.attempt.realpathSync(t),c=!!i;t=i||t,[u,o]=ue.get(t,r.tmpCreate||ue.create,r.tmpPurge!==!1);const a=Xl&&Xr(r.chown),l=Xr(r.mode);if(c&&(a||l)){const f=ce.attempt.statSync(t);f&&(r={...r},a&&(r.chown={uid:f.uid,gid:f.gid}),l&&(r.mode=f.mode))}if(!c){const f=X.dirname(t);ce.attempt.mkdirSync(f,{mode:Gl,recursive:!0})}s=ce.retry.openSync(n)(u,"w",r.mode||Eo),r.tmpCreated&&r.tmpCreated(u),So(e)?ce.retry.writeSync(n)(s,e,0,r.encoding||Fl):Xr(e)||ce.retry.writeSync(
309
- n)(s,e,0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?ce.retry.fsyncSync(n)(s):ce.attempt.fsync(s)),ce.retry.closeSync(n)(s),s=null,r.chown&&(r.chown.uid!==Vl||r.chown.gid!==Wl)&&ce.attempt.chownSync(u,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Eo&&ce.attempt.chmodSync(u,r.mode);try{ce.retry.renameSync(n)(u,t)}catch(f){if(!Kl(f)||f.code!=="ENAMETOOLONG")throw f;ce.retry.renameSync(n)(u,ue.truncate(t))}o(),u=null}finally{s&&ce.attempt.closeSync(s),u&&ue.purge(u)}}var Lt={exports:{}},kt={},It={},Xe={},
310
- Co;function xo(){if(Co)return Xe;Co=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.dynamicAnchor=void 0;const t=tt(),e=tr(),r=Cc(),n=us(),o={keyword:"$dynamicAnchor",schemaType:"string",code:i=>u(i,i.schema)};function u(i,c){const{gen:a,it:l}=i;l.schemaEnv.root.dynamicAnchors[c]=!0;const f=(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(c)}`,p=l.errSchemaPath==="#"?l.validateName:s(i);a.if((0,t._)`!${f}`,()=>a.assign(f,p))}Xe.dynamicAnchor=u;function s(i){const{schemaEnv:c,schema:a,
311
- self:l}=i.it,{root:f,baseId:p,localRefs:h,meta:v}=c.root,{schemaId:w}=l.opts,m=new r.SchemaEnv({schema:a,schemaId:w,root:f,baseId:p,localRefs:h,meta:v});return r.compileSchema.call(l,m),(0,n.getValidate)(i,m)}return Xe.default=o,Xe}var Ke={},To;function Lo(){if(To)return Ke;To=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.dynamicRef=void 0;const t=tt(),e=tr(),r=us(),n={keyword:"$dynamicRef",schemaType:"string",code:u=>o(u,u.schema)};function o(u,s){const{gen:i,keyword:c,it:a}=u;if(s[0]!==
312
- "#")throw new Error(`"${c}" only supports hash fragment reference`);const l=s.slice(1);if(a.allErrors)f();else{const h=i.let("valid",!1);f(h),u.ok(h)}function f(h){if(a.schemaEnv.root.dynamicAnchors[l]){const v=i.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(l)}`);i.if(v,p(v,h),p(a.validateName,h))}else p(a.validateName,h)()}function p(h,v){return v?()=>i.block(()=>{(0,r.callRef)(u,h),i.let(v,!0)}):()=>(0,r.callRef)(u,h)}}return Ke.dynamicRef=o,Ke.default=n,Ke}var Ot={},ko;function ef(){
313
- if(ko)return Ot;ko=1,Object.defineProperty(Ot,"__esModule",{value:!0});const t=xo(),e=yt(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,e.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return Ot.default=r,Ot}var Pt={},Io;function tf(){if(Io)return Pt;Io=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t=Lo(),e={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,t.dynamicRef)(r,r.schema)};return Pt.default=e,Pt}var Oo;
314
- function rf(){if(Oo)return It;Oo=1,Object.defineProperty(It,"__esModule",{value:!0});const t=xo(),e=Lo(),r=ef(),n=tf(),o=[t.default,e.default,r.default,n.default];return It.default=o,It}var Nt={},jt={},Po;function nf(){if(Po)return jt;Po=1,Object.defineProperty(jt,"__esModule",{value:!0});const t=ls(),e={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return jt.default=e,jt}var Dt={},No;function sf(){if(No)return Dt;No=1,Object.defineProperty(
315
- Dt,"__esModule",{value:!0});const t=ls(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,t.validateSchemaDeps)(r)};return Dt.default=e,Dt}var qt={},jo;function of(){if(jo)return qt;jo=1,Object.defineProperty(qt,"__esModule",{value:!0});const t=yt(),e={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:o}){n.contains===void 0&&(0,t.checkStrictMode)(o,`"${r}" without "contains" is ignored`)}};return qt.default=e,qt}var Do;
316
- function af(){if(Do)return Nt;Do=1,Object.defineProperty(Nt,"__esModule",{value:!0});const t=nf(),e=sf(),r=of(),n=[t.default,e.default,r.default];return Nt.default=n,Nt}var Ht={},Mt={},qo;function cf(){if(qo)return Mt;qo=1,Object.defineProperty(Mt,"__esModule",{value:!0});const t=tt(),e=yt(),r=tr(),o={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:u})=>(0,t._)`{unevaluatedProperty: ${u.
317
- unevaluatedProperty}}`},code(u){const{gen:s,schema:i,data:c,errsCount:a,it:l}=u;if(!a)throw new Error("ajv implementation error");const{allErrors:f,props:p}=l;p instanceof t.Name?s.if((0,t._)`${p} !== true`,()=>s.forIn("key",c,m=>s.if(v(p,m),()=>h(m)))):p!==!0&&s.forIn("key",c,m=>p===void 0?h(m):s.if(w(p,m),()=>h(m))),l.props=!0,u.ok((0,t._)`${a} === ${r.default.errors}`);function h(m){if(i===!1){u.setParams({unevaluatedProperty:m}),u.error(),f||s.break();return}if(!(0,e.alwaysValidSchema)(l,i)){
318
- const g=s.name("valid");u.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:e.Type.Str},g),f||s.if((0,t.not)(g),()=>s.break())}}function v(m,g){return(0,t._)`!${m} || !${m}[${g}]`}function w(m,g){const T=[];for(const d in m)m[d]===!0&&T.push((0,t._)`${g} !== ${d}`);return(0,t.and)(...T)}}};return Mt.default=o,Mt}var Ut={},Ho;function uf(){if(Ho)return Ut;Ho=1,Object.defineProperty(Ut,"__esModule",{value:!0});const t=tt(),e=yt(),n={keyword:"unevaluatedItems",type:"array",schemaType:[
319
- "boolean","object"],error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{gen:u,schema:s,data:i,it:c}=o,a=c.items||0;if(a===!0)return;const l=u.const("len",(0,t._)`${i}.length`);if(s===!1)o.setParams({len:a}),o.fail((0,t._)`${l} > ${a}`);else if(typeof s=="object"&&!(0,e.alwaysValidSchema)(c,s)){const p=u.var("valid",(0,t._)`${l} <= ${a}`);u.if((0,t.not)(p),()=>f(p,a)),o.ok(p)}c.items=!0;function f(p,h){u.
320
- forRange("i",h,l,v=>{o.subschema({keyword:"unevaluatedItems",dataProp:v,dataPropType:e.Type.Num},p),c.allErrors||u.if((0,t.not)(p),()=>u.break())})}}};return Ut.default=n,Ut}var Mo;function lf(){if(Mo)return Ht;Mo=1,Object.defineProperty(Ht,"__esModule",{value:!0});const t=cf(),e=uf(),r=[t.default,e.default];return Ht.default=r,Ht}var Uo;function ff(){if(Uo)return kt;Uo=1,Object.defineProperty(kt,"__esModule",{value:!0});const t=xc(),e=Tc(),r=Lc(),n=rf(),o=af(),u=lf(),s=kc(),i=Ic(),c=[n.default,
321
- t.default,e.default,(0,r.default)(!0),s.default,i.metadataVocabulary,i.contentVocabulary,o.default,u.default];return kt.default=c,kt}var Ft={};const Fo="https://json-schema.org/draft/2020-12/schema",Go="https://json-schema.org/draft/2020-12/schema",Bo={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://jso\
322
- n-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Vo="meta",Wo="Core and Validation specifications meta-schema",zo=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Xo=["object","boolean"],Ko="This meta-schema also defines keywords that have appeared in\
323
- previous drafts in order to prevent incompatible extensions as they remain in common use.",Jo={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs\
324
- /stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},pf={$schema:Fo,$id:Go,$vocabulary:Bo,$dynamicAnchor:Vo,title:Wo,allOf:zo,type:Xo,$comment:Ko,properties:Jo},df={__proto__:null,$comment:Ko,$dynamicAnchor:Vo,$id:Go,$schema:Fo,$vocabulary:Bo,
325
- allOf:zo,default:pf,properties:Jo,title:Wo,type:Xo},hf=Le(df),Yo="https://json-schema.org/draft/2020-12/schema",Qo="https://json-schema.org/draft/2020-12/meta/applicator",Zo={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},ei="meta",ti="Applicator vocabulary meta-schema",ri=["object","boolean"],ni={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{
326
- $dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},si={schemaArray:{
327
- type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},mf={$schema:Yo,$id:Qo,$vocabulary:Zo,$dynamicAnchor:ei,title:ti,type:ri,properties:ni,$defs:si},gf={__proto__:null,$defs:si,$dynamicAnchor:ei,$id:Qo,$schema:Yo,$vocabulary:Zo,default:mf,properties:ni,title:ti,type:ri},yf=Le(gf),oi="https://json-schema.org/draft/2020-12/schema",ii="https://json-schema.org/draft/2020-12/meta/unevaluated",ai={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},ci="meta",ui="Unevaluated applicator vocab\
328
- ulary meta-schema",li=["object","boolean"],fi={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},wf={$schema:oi,$id:ii,$vocabulary:ai,$dynamicAnchor:ci,title:ui,type:li,properties:fi},vf={__proto__:null,$dynamicAnchor:ci,$id:ii,$schema:oi,$vocabulary:ai,default:wf,properties:fi,title:ui,type:li},$f=Le(vf),pi="https://json-schema.org/draft/2020-12/schema",di="https://json-schema.org/draft/2020-12/meta/content",hi={"https://json-schema.org/draft/2020-12/vocab/cont\
329
- ent":!0},mi="meta",gi="Content vocabulary meta-schema",yi=["object","boolean"],wi={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},bf={$schema:pi,$id:di,$vocabulary:hi,$dynamicAnchor:mi,title:gi,type:yi,properties:wi},Ef={__proto__:null,$dynamicAnchor:mi,$id:di,$schema:pi,$vocabulary:hi,default:bf,properties:wi,title:gi,type:yi},Rf=Le(Ef),vi="https://json-schema.org/draft/2020-12/schema",$i="https://json-schema.org/draft/2020-12/meta/core",bi={
330
- "https://json-schema.org/draft/2020-12/vocab/core":!0},Ei="meta",Ri="Core vocabulary meta-schema",Si=["object","boolean"],Ai={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriStri\
331
- ng"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},_i={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},Sf={$schema:vi,$id:$i,$vocabulary:bi,$dynamicAnchor:Ei,title:Ri,type:Si,properties:Ai,$defs:_i},Af={__proto__:null,$defs:_i,$dynamicAnchor:Ei,$id:$i,$schema:vi,$vocabulary:bi,default:Sf,properties:Ai,
332
- title:Ri,type:Si},_f=Le(Af),Ci="https://json-schema.org/draft/2020-12/schema",xi="https://json-schema.org/draft/2020-12/meta/format-annotation",Ti={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Li="meta",ki="Format vocabulary meta-schema for annotation results",Ii=["object","boolean"],Oi={format:{type:"string"}},Cf={$schema:Ci,$id:xi,$vocabulary:Ti,$dynamicAnchor:Li,title:ki,type:Ii,properties:Oi},xf={__proto__:null,$dynamicAnchor:Li,$id:xi,$schema:Ci,$vocabulary:Ti,default:Cf,
333
- properties:Oi,title:ki,type:Ii},Tf=Le(xf),Pi="https://json-schema.org/draft/2020-12/schema",Ni="https://json-schema.org/draft/2020-12/meta/meta-data",ji={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Di="meta",qi="Meta-data vocabulary meta-schema",Hi=["object","boolean"],Mi={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},Lf={
334
- $schema:Pi,$id:Ni,$vocabulary:ji,$dynamicAnchor:Di,title:qi,type:Hi,properties:Mi},kf={__proto__:null,$dynamicAnchor:Di,$id:Ni,$schema:Pi,$vocabulary:ji,default:Lf,properties:Mi,title:qi,type:Hi},If=Le(kf),Ui="https://json-schema.org/draft/2020-12/schema",Fi="https://json-schema.org/draft/2020-12/meta/validation",Gi={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Bi="meta",Vi="Validation vocabulary meta-schema",Wi=["object","boolean"],zi={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{
281
+ `);const h=await p.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:e,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});h.setDefaultNavigationTimeout(n),h.setDefaultTimeout(n);try{return await Cl({browserContext:h,views:i,output:a,outputType:s,logger:t,maxAttempts:o,dynamicVariant:u?"sequence":"diagram",timeout:n,theme:r})}finally{t.info(y.cyan("close chromium")),await h.close(),await p.close()}}async function bi({path:t,useDotBin:e,project:r,theme:n="light",output:i,outputType:a,serverUrl:s,
282
+ ignore:o=!1,timeoutMs:c=1e4,maxAttempts:u=3,filter:l,sequence:f=!1,chromiumSandbox:p=!1}){var h=[];try{const g=ve("export"),T=Jc(),d=Tl(h,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),!0);i??=d.workspace;let S,E=[...d.languageServices.projects()];if(r&&!E.some(A=>A.id===r))throw g.error(`project not found: ${r}`),new Error(`project not found: ${r}`);if(!s&&(g.info(y.cyan("start preview server")),S=await yi({languageServices:d,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,
283
+ hmr:!1}),s=pi(S),!s))throw g.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");for(const A of E){if(r&&A.id!==r)continue;E.length>1&&(g.info(y.dim("---------")),g.info(`${y.dim("project:")} ${A.id}`),g.info(`${y.dim("folder:")} ${A.folder.fsPath}`));let b=await d.diagrams(A.id);if(l&&st(l,1)&&st(b,1)){const F=Lc(l);g.info(`${y.cyan("filter")} ${y.dim(JSON.stringify(l))}`),b=b.filter(L=>F(L.id)?(g.info(`${y.green("include")} ${L.id} \u2705`),
284
+ !0):(g.info(`${y.gray("skip")} ${y.dim(L.id)}`),!1))}if(!st(b,1)){g.warn("no views found");continue}let x=E.length>1?us(ds(s,"project",A.id)):s,q=E.length>1?ds(i,A.id):i;const M=await $i({logger:g,serverUrl:x,theme:n,timeoutMs:c,views:b,output:q,outputType:a,maxAttempts:u,sequence:f,chromiumSandbox:p}),{pretty:V}=kc(T);if(M.length>0&&g.info(y.green(`exported ${M.length} views in ${V}`)+`
285
+ `),M.length!==b.length&&(o&&M.length>0?g.info(y.dim("ignore")+" "+y.red(`failed ${b.length-M.length} out of ${b.length} views`)):g.error(y.red(`failed ${b.length-M.length} out of ${b.length} views`))),M.length!==b.length&&(M.length===0||!o))throw new Error(`Failed ${b.length-M.length} out of ${b.length} views`)}S&&(g.info(y.cyan("stop server")),await S.close().catch(A=>{g.error(A)}))}catch(g){var v=g,w=!0}finally{var m=Il(h,v,w);m&&await m}}var Ei=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ri=t=>{
286
+ throw TypeError(t)},Ol=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&Ri("Object expected");var n,i;n=e[Ei("asyncDispose")],n===void 0&&(n=e[Ei("dispose")],i=n),typeof n!="function"&&Ri("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push([r]);return e},Ll=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=s,u.suppressed=o,u},
287
+ i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){i(c)}if(r)throw e};return a()};const{cyan:Si,dim:Ai}=y;async function kl({path:t,useDotBin:e,useHashHistory:r,webcomponentPrefix:n,title:i,useOverview:a=!1,output:s,outputSingleFile:o,base:c}){var u=[];try{await lt();const h=ve("c4:build"),v=Ol(u,await ye.fromWorkspace(t,{graphviz:e?"binary":"wasm",logger:"vi\
288
+ te",watch:!1}),!0),w=s??z(v.workspace,"dist");let m=z(w,"assets");if(a)try{m=z(w,"assets","previews"),await Se(m,{recursive:!0}),h.info(`${Si("Generate previews")} ${Ai(m)}
289
+ `),await bi({path:t,useDotBin:e,project:void 0,output:m,outputType:"flat",ignore:!0})}catch(g){h.error(y.red("Failed to generate previews")),h.error(g),h.warn(y.yellow("Ignore previews and continue build")),cr(m,{recursive:!0,force:!0}),a=!1}await ul({base:c,useHashHistory:o||r,customLogger:h,useOverviewGraph:a,webcomponentPrefix:n,title:i,languageServices:v,likec4AssetsDir:m,outputDir:s,outputSingleFile:o}),a&&(h.info(`${Si("clean previews")} ${Ai(m)}`),cr(m,{recursive:!0,force:!0}))}catch(h){var l=h,
290
+ f=!0}finally{var p=Ll(u,l,f);p&&await p}}const Nl=t=>t.command({command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:e=>e.positional("path",pe).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:z}).option("base",js).option("use-hash-history",Ns).option("use-dot",he).option("webcomponent-prefix",wr).option("title",Ps).option("output-single-file",Tu).example(`${y.green("$0 build -o ./build ./src")}`,y.gray("Sear\
291
+ ch for likec4 files in 'src' and output static site to 'build'")),handler:async e=>{await kl({path:e.path,output:e.output,base:e.base,useHashHistory:e["use-hash-history"],useDotBin:e["use-dot"],webcomponentPrefix:e["webcomponent-prefix"],title:e.title,outputSingleFile:e["output-single-file"]??!1})}}),Ue=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},_i=new Set(["__proto__","prototype","constructor"]),Ci=1e6,Pl=t=>t>="0"&&t<="9";function xi(t){if(t==="0")return!0;if(/^[1-9]\d*$/.
292
+ test(t)){const e=Number.parseInt(t,10);return e<=Number.MAX_SAFE_INTEGER&&e<=Ci}return!1}function Xr(t,e){return _i.has(t)?!1:(t&&xi(t)?e.push(Number.parseInt(t,10)):e.push(t),!0)}function jl(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);const e=[];let r="",n="start",i=!1,a=0;for(const s of t){if(a++,i){r+=s,i=!1;continue}if(s==="\\"){if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${a}`);if(n==="indexEnd")throw new Error(`Inv\
293
+ alid character '${s}' after an index at position ${a}`);i=!0,n=n==="start"?"property":n;continue}switch(s){case".":{if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${a}`);if(n==="indexEnd"){n="property";break}if(!Xr(r,e))return[];r="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${a}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((r||n==="property")&&!Xr(r,e))return[];r=""}n=
294
+ "index";break}case"]":{if(n==="index"){if(r==="")r=(e.pop()||"")+"[]",n="property";else{const o=Number.parseInt(r,10);!Number.isNaN(o)&&Number.isFinite(o)&&o>=0&&o<=Number.MAX_SAFE_INTEGER&&o<=Ci&&r===String(o)?e.push(o):e.push(r),r="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${a}`);r+=s;break}default:{if(n==="index"&&!Pl(s))throw new Error(`Invalid character '${s}' in an index at position ${a}`);if(n==="indexEnd")throw new Error(`\
295
+ Invalid character '${s}' after an index at position ${a}`);n==="start"&&(n="property"),r+=s}}}switch(i&&(r+="\\"),n){case"property":{if(!Xr(r,e))return[];break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function It(t){if(typeof t=="string")return jl(t);if(Array.isArray(t)){const e=[];for(const[r,n]of t.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${r}, got ${typeof n}`);
296
+ if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${r} must be a finite number, got ${n}`);if(_i.has(n))return[];typeof n=="string"&&xi(n)?e.push(Number.parseInt(n,10)):e.push(n)}return e}return[]}function Ti(t,e,r){if(!Ue(t)||typeof e!="string"&&!Array.isArray(e))return r===void 0?t:r;const n=It(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){const a=n[i];if(t=t[a],t==null){if(i!==n.length-1)return r;break}}return t===void 0?r:t}function Ot(t,e,r){if(!Ue(
297
+ t)||typeof e!="string"&&!Array.isArray(e))return t;const n=t,i=It(e);if(i.length===0)return t;for(let a=0;a<i.length;a++){const s=i[a];if(a===i.length-1)t[s]=r;else if(!Ue(t[s])){const c=typeof i[a+1]=="number";t[s]=c?[]:{}}t=t[s]}return n}function Dl(t,e){if(!Ue(t)||typeof e!="string"&&!Array.isArray(e))return!1;const r=It(e);if(r.length===0)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(n===r.length-1)return Object.hasOwn(t,i)?(delete t[i],!0):!1;if(t=t[i],!Ue(t))return!1}}function Kr(t,e){
298
+ if(!Ue(t)||typeof e!="string"&&!Array.isArray(e))return!1;const r=It(e);if(r.length===0)return!1;for(const n of r){if(!Ue(t)||!(n in t))return!1;t=t[n]}return!0}const ke=at.homedir(),Yr=at.tmpdir(),{env:Ye}=re,ql=t=>{const e=W.join(ke,"Library");return{data:W.join(e,"Application Support",t),config:W.join(e,"Preferences",t),cache:W.join(e,"Caches",t),log:W.join(e,"Logs",t),temp:W.join(Yr,t)}},Hl=t=>{const e=Ye.APPDATA||W.join(ke,"AppData","Roaming"),r=Ye.LOCALAPPDATA||W.join(ke,"AppData","Local");
299
+ return{data:W.join(r,t,"Data"),config:W.join(e,t,"Config"),cache:W.join(r,t,"Cache"),log:W.join(r,t,"Log"),temp:W.join(Yr,t)}},Ml=t=>{const e=W.basename(ke);return{data:W.join(Ye.XDG_DATA_HOME||W.join(ke,".local","share"),t),config:W.join(Ye.XDG_CONFIG_HOME||W.join(ke,".config"),t),cache:W.join(Ye.XDG_CACHE_HOME||W.join(ke,".cache"),t),log:W.join(Ye.XDG_STATE_HOME||W.join(ke,".local","state"),t),temp:W.join(Yr,e,t)}};function Ul(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(
300
+ `Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),re.platform==="darwin"?ql(t):re.platform==="win32"?Hl(t):Ml(t)}const Ne=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},xe=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(i){return e(i)}},Fl=re.getuid?!re.getuid():!1,Gl=1e4,we=()=>{},ee={isChangeErrorOk:t=>{if(!ee.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!Fl&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!ee.
301
+ isNodeError(t))return!1;const{code:e}=t;return e==="EMFILE"||e==="ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!ee.isNodeError(t))throw t;if(!ee.isChangeErrorOk(t))throw t}};class Bl{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Gl,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(
302
+ this.intervalId),delete this.intervalId)},this.add=e=>{this.queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{const r=()=>this.remove(n),n=()=>e(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(
303
+ e),this.queueActive.add(e),e()}}}}}const Vl=new Bl,Pe=(t,e)=>function(n){return function i(...a){return Vl.schedule().then(s=>{const o=u=>(s(),u),c=u=>{if(s(),Date.now()>=n)throw u;if(e(u)){const l=Math.round(100*Math.random());return new Promise(p=>setTimeout(p,l)).then(()=>i.apply(void 0,a))}throw u};return t.apply(void 0,a).then(o,c)})}},je=(t,e)=>function(n){return function i(...a){try{return t.apply(void 0,a)}catch(s){if(Date.now()>n)throw s;if(e(s))return i.apply(void 0,a);throw s}}},ce={attempt:{
304
+ chmod:Ne(ae(B.chmod),ee.onChangeError),chown:Ne(ae(B.chown),ee.onChangeError),close:Ne(ae(B.close),we),fsync:Ne(ae(B.fsync),we),mkdir:Ne(ae(B.mkdir),we),realpath:Ne(ae(B.realpath),we),stat:Ne(ae(B.stat),we),unlink:Ne(ae(B.unlink),we),chmodSync:xe(B.chmodSync,ee.onChangeError),chownSync:xe(B.chownSync,ee.onChangeError),closeSync:xe(B.closeSync,we),existsSync:xe(B.existsSync,we),fsyncSync:xe(B.fsync,we),mkdirSync:xe(B.mkdirSync,we),realpathSync:xe(B.realpathSync,we),statSync:xe(B.statSync,we),unlinkSync:xe(
305
+ B.unlinkSync,we)},retry:{close:Pe(ae(B.close),ee.isRetriableError),fsync:Pe(ae(B.fsync),ee.isRetriableError),open:Pe(ae(B.open),ee.isRetriableError),readFile:Pe(ae(B.readFile),ee.isRetriableError),rename:Pe(ae(B.rename),ee.isRetriableError),stat:Pe(ae(B.stat),ee.isRetriableError),write:Pe(ae(B.write),ee.isRetriableError),writeFile:Pe(ae(B.writeFile),ee.isRetriableError),closeSync:je(B.closeSync,ee.isRetriableError),fsyncSync:je(B.fsyncSync,ee.isRetriableError),openSync:je(B.openSync,ee.isRetriableError),
306
+ readFileSync:je(B.readFileSync,ee.isRetriableError),renameSync:je(B.renameSync,ee.isRetriableError),statSync:je(B.statSync,ee.isRetriableError),writeSync:je(B.writeSync,ee.isRetriableError),writeFileSync:je(B.writeFileSync,ee.isRetriableError)}},zl="utf8",Ii=438,Wl=511,Xl={},Kl=at.userInfo().uid,Yl=at.userInfo().gid,Jl=1e3,Ql=!!re.getuid;re.getuid&&re.getuid();const Oi=128,Zl=t=>t instanceof Error&&"code"in t,Li=t=>typeof t=="string",Jr=t=>t===void 0,ef=re.platform==="linux",ki=re.platform==="wi\
307
+ n32",Qr=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];ki||Qr.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),ef&&Qr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class tf{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(ki&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?re.kill(re.pid,"SIGTERM"):re.kill(re.pid,e))}},this.hook=()=>{re.once("exit",()=>this.exit());
308
+ for(const e of Qr)try{re.once(e,()=>this.exit(e))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const rf=new tf,nf=rf.register,ue={store:{},create:t=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${t}${i}`},get:(t,e,r=!0)=>{const n=ue.truncate(e(t));return n in ue.store?ue.get(t,e,r):(ue.store[n]=r,[n,()=>delete ue.store[n]])},purge:t=>{ue.store[t]&&(delete ue.store[t],
309
+ ce.attempt.unlink(t))},purgeSync:t=>{ue.store[t]&&(delete ue.store[t],ce.attempt.unlinkSync(t))},purgeSyncAll:()=>{for(const t in ue.store)ue.purgeSync(t)},truncate:t=>{const e=W.basename(t);if(e.length<=Oi)return t;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!r)return t;const n=e.length-Oi;return`${t.slice(0,-e.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};nf(ue.purgeSyncAll);function Ni(t,e,r=Xl){if(Li(r))return Ni(t,e,{encoding:r});const n=Date.now()+((r.timeout??
310
+ Jl)||-1);let i=null,a=null,s=null;try{const o=ce.attempt.realpathSync(t),c=!!o;t=o||t,[a,i]=ue.get(t,r.tmpCreate||ue.create,r.tmpPurge!==!1);const u=Ql&&Jr(r.chown),l=Jr(r.mode);if(c&&(u||l)){const f=ce.attempt.statSync(t);f&&(r={...r},u&&(r.chown={uid:f.uid,gid:f.gid}),l&&(r.mode=f.mode))}if(!c){const f=W.dirname(t);ce.attempt.mkdirSync(f,{mode:Wl,recursive:!0})}s=ce.retry.openSync(n)(a,"w",r.mode||Ii),r.tmpCreated&&r.tmpCreated(a),Li(e)?ce.retry.writeSync(n)(s,e,0,r.encoding||zl):Jr(e)||ce.retry.
311
+ writeSync(n)(s,e,0,e.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?ce.retry.fsyncSync(n)(s):ce.attempt.fsync(s)),ce.retry.closeSync(n)(s),s=null,r.chown&&(r.chown.uid!==Kl||r.chown.gid!==Yl)&&ce.attempt.chownSync(a,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Ii&&ce.attempt.chmodSync(a,r.mode);try{ce.retry.renameSync(n)(a,t)}catch(f){if(!Zl(f)||f.code!=="ENAMETOOLONG")throw f;ce.retry.renameSync(n)(a,ue.truncate(t))}i(),a=null}finally{s&&ce.attempt.closeSync(s),a&&ue.purge(a)}}var Lt={exports:{}},kt={},
312
+ Nt={},Je={},Pi;function ji(){if(Pi)return Je;Pi=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.dynamicAnchor=void 0;const t=nt(),e=sr(),r=Nc(),n=hs(),i={keyword:"$dynamicAnchor",schemaType:"string",code:o=>a(o,o.schema)};function a(o,c){const{gen:u,it:l}=o;l.schemaEnv.root.dynamicAnchors[c]=!0;const f=(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(c)}`,p=l.errSchemaPath==="#"?l.validateName:s(o);u.if((0,t._)`!${f}`,()=>u.assign(f,p))}Je.dynamicAnchor=a;function s(o){const{schemaEnv:c,
313
+ schema:u,self:l}=o.it,{root:f,baseId:p,localRefs:h,meta:v}=c.root,{schemaId:w}=l.opts,m=new r.SchemaEnv({schema:u,schemaId:w,root:f,baseId:p,localRefs:h,meta:v});return r.compileSchema.call(l,m),(0,n.getValidate)(o,m)}return Je.default=i,Je}var Qe={},Di;function qi(){if(Di)return Qe;Di=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.dynamicRef=void 0;const t=nt(),e=sr(),r=hs(),n={keyword:"$dynamicRef",schemaType:"string",code:a=>i(a,a.schema)};function i(a,s){const{gen:o,keyword:c,it:u}=a;
314
+ if(s[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const l=s.slice(1);if(u.allErrors)f();else{const h=o.let("valid",!1);f(h),a.ok(h)}function f(h){if(u.schemaEnv.root.dynamicAnchors[l]){const v=o.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(l)}`);o.if(v,p(v,h),p(u.validateName,h))}else p(u.validateName,h)()}function p(h,v){return v?()=>o.block(()=>{(0,r.callRef)(a,h),o.let(v,!0)}):()=>(0,r.callRef)(a,h)}}return Qe.dynamicRef=i,Qe.default=n,Qe}var Pt={},
315
+ Hi;function sf(){if(Hi)return Pt;Hi=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t=ji(),e=wt(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,t.dynamicAnchor)(n,""):(0,e.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return Pt.default=r,Pt}var jt={},Mi;function of(){if(Mi)return jt;Mi=1,Object.defineProperty(jt,"__esModule",{value:!0});const t=qi(),e={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,t.dynamicRef)(r,r.schema)};return jt.default=
316
+ e,jt}var Ui;function af(){if(Ui)return Nt;Ui=1,Object.defineProperty(Nt,"__esModule",{value:!0});const t=ji(),e=qi(),r=sf(),n=of(),i=[t.default,e.default,r.default,n.default];return Nt.default=i,Nt}var Dt={},qt={},Fi;function cf(){if(Fi)return qt;Fi=1,Object.defineProperty(qt,"__esModule",{value:!0});const t=ms(),e={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:r=>(0,t.validatePropertyDeps)(r)};return qt.default=e,qt}var Ht={},Gi;function uf(){if(Gi)return Ht;Gi=
317
+ 1,Object.defineProperty(Ht,"__esModule",{value:!0});const t=ms(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,t.validateSchemaDeps)(r)};return Ht.default=e,Ht}var Mt={},Bi;function lf(){if(Bi)return Mt;Bi=1,Object.defineProperty(Mt,"__esModule",{value:!0});const t=wt(),e={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Mt.
318
+ default=e,Mt}var Vi;function ff(){if(Vi)return Dt;Vi=1,Object.defineProperty(Dt,"__esModule",{value:!0});const t=cf(),e=uf(),r=lf(),n=[t.default,e.default,r.default];return Dt.default=n,Dt}var Ut={},Ft={},zi;function pf(){if(zi)return Ft;zi=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=nt(),e=wt(),r=sr(),i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:a})=>(0,t._)`{unevaluatedProperty: ${a.
319
+ unevaluatedProperty}}`},code(a){const{gen:s,schema:o,data:c,errsCount:u,it:l}=a;if(!u)throw new Error("ajv implementation error");const{allErrors:f,props:p}=l;p instanceof t.Name?s.if((0,t._)`${p} !== true`,()=>s.forIn("key",c,m=>s.if(v(p,m),()=>h(m)))):p!==!0&&s.forIn("key",c,m=>p===void 0?h(m):s.if(w(p,m),()=>h(m))),l.props=!0,a.ok((0,t._)`${u} === ${r.default.errors}`);function h(m){if(o===!1){a.setParams({unevaluatedProperty:m}),a.error(),f||s.break();return}if(!(0,e.alwaysValidSchema)(l,o)){
320
+ const g=s.name("valid");a.subschema({keyword:"unevaluatedProperties",dataProp:m,dataPropType:e.Type.Str},g),f||s.if((0,t.not)(g),()=>s.break())}}function v(m,g){return(0,t._)`!${m} || !${m}[${g}]`}function w(m,g){const T=[];for(const d in m)m[d]===!0&&T.push((0,t._)`${g} !== ${d}`);return(0,t.and)(...T)}}};return Ft.default=i,Ft}var Gt={},Wi;function df(){if(Wi)return Gt;Wi=1,Object.defineProperty(Gt,"__esModule",{value:!0});const t=nt(),e=wt(),n={keyword:"unevaluatedItems",type:"array",schemaType:[
321
+ "boolean","object"],error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{gen:a,schema:s,data:o,it:c}=i,u=c.items||0;if(u===!0)return;const l=a.const("len",(0,t._)`${o}.length`);if(s===!1)i.setParams({len:u}),i.fail((0,t._)`${l} > ${u}`);else if(typeof s=="object"&&!(0,e.alwaysValidSchema)(c,s)){const p=a.var("valid",(0,t._)`${l} <= ${u}`);a.if((0,t.not)(p),()=>f(p,u)),i.ok(p)}c.items=!0;function f(p,h){a.
322
+ forRange("i",h,l,v=>{i.subschema({keyword:"unevaluatedItems",dataProp:v,dataPropType:e.Type.Num},p),c.allErrors||a.if((0,t.not)(p),()=>a.break())})}}};return Gt.default=n,Gt}var Xi;function hf(){if(Xi)return Ut;Xi=1,Object.defineProperty(Ut,"__esModule",{value:!0});const t=pf(),e=df(),r=[t.default,e.default];return Ut.default=r,Ut}var Ki;function mf(){if(Ki)return kt;Ki=1,Object.defineProperty(kt,"__esModule",{value:!0});const t=Pc(),e=jc(),r=Dc(),n=af(),i=ff(),a=hf(),s=qc(),o=Hc(),c=[n.default,
323
+ t.default,e.default,(0,r.default)(!0),s.default,o.metadataVocabulary,o.contentVocabulary,i.default,a.default];return kt.default=c,kt}var Bt={};const Yi="https://json-schema.org/draft/2020-12/schema",Ji="https://json-schema.org/draft/2020-12/schema",Qi={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://jso\
324
+ n-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Zi="meta",eo="Core and Validation specifications meta-schema",to=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],ro=["object","boolean"],no="This meta-schema also defines keywords that have appeared in\
325
+ previous drafts in order to prevent incompatible extensions as they remain in common use.",so={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs\
326
+ /stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},gf={$schema:Yi,$id:Ji,$vocabulary:Qi,$dynamicAnchor:Zi,title:eo,allOf:to,type:ro,$comment:no,properties:so},yf={__proto__:null,$comment:no,$dynamicAnchor:Zi,$id:Ji,$schema:Yi,$vocabulary:Qi,
327
+ allOf:to,default:gf,properties:so,title:eo,type:ro},wf=Ie(yf),io="https://json-schema.org/draft/2020-12/schema",oo="https://json-schema.org/draft/2020-12/meta/applicator",ao={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},co="meta",uo="Applicator vocabulary meta-schema",lo=["object","boolean"],fo={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{
328
+ $dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},po={schemaArray:{
329
+ type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},vf={$schema:io,$id:oo,$vocabulary:ao,$dynamicAnchor:co,title:uo,type:lo,properties:fo,$defs:po},$f={__proto__:null,$defs:po,$dynamicAnchor:co,$id:oo,$schema:io,$vocabulary:ao,default:vf,properties:fo,title:uo,type:lo},bf=Ie($f),ho="https://json-schema.org/draft/2020-12/schema",mo="https://json-schema.org/draft/2020-12/meta/unevaluated",go={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},yo="meta",wo="Unevaluated applicator vocab\
330
+ ulary meta-schema",vo=["object","boolean"],$o={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Ef={$schema:ho,$id:mo,$vocabulary:go,$dynamicAnchor:yo,title:wo,type:vo,properties:$o},Rf={__proto__:null,$dynamicAnchor:yo,$id:mo,$schema:ho,$vocabulary:go,default:Ef,properties:$o,title:wo,type:vo},Sf=Ie(Rf),bo="https://json-schema.org/draft/2020-12/schema",Eo="https://json-schema.org/draft/2020-12/meta/content",Ro={"https://json-schema.org/draft/2020-12/vocab/cont\
331
+ ent":!0},So="meta",Ao="Content vocabulary meta-schema",_o=["object","boolean"],Co={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Af={$schema:bo,$id:Eo,$vocabulary:Ro,$dynamicAnchor:So,title:Ao,type:_o,properties:Co},_f={__proto__:null,$dynamicAnchor:So,$id:Eo,$schema:bo,$vocabulary:Ro,default:Af,properties:Co,title:Ao,type:_o},Cf=Ie(_f),xo="https://json-schema.org/draft/2020-12/schema",To="https://json-schema.org/draft/2020-12/meta/core",Io={
332
+ "https://json-schema.org/draft/2020-12/vocab/core":!0},Oo="meta",Lo="Core vocabulary meta-schema",ko=["object","boolean"],No={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriStri\
333
+ ng"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Po={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},xf={$schema:xo,$id:To,$vocabulary:Io,$dynamicAnchor:Oo,title:Lo,type:ko,properties:No,$defs:Po},Tf={__proto__:null,$defs:Po,$dynamicAnchor:Oo,$id:To,$schema:xo,$vocabulary:Io,default:xf,properties:No,
334
+ title:Lo,type:ko},If=Ie(Tf),jo="https://json-schema.org/draft/2020-12/schema",Do="https://json-schema.org/draft/2020-12/meta/format-annotation",qo={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Ho="meta",Mo="Format vocabulary meta-schema for annotation results",Uo=["object","boolean"],Fo={format:{type:"string"}},Of={$schema:jo,$id:Do,$vocabulary:qo,$dynamicAnchor:Ho,title:Mo,type:Uo,properties:Fo},Lf={__proto__:null,$dynamicAnchor:Ho,$id:Do,$schema:jo,$vocabulary:qo,default:Of,
335
+ properties:Fo,title:Mo,type:Uo},kf=Ie(Lf),Go="https://json-schema.org/draft/2020-12/schema",Bo="https://json-schema.org/draft/2020-12/meta/meta-data",Vo={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},zo="meta",Wo="Meta-data vocabulary meta-schema",Xo=["object","boolean"],Ko={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},Nf={
336
+ $schema:Go,$id:Bo,$vocabulary:Vo,$dynamicAnchor:zo,title:Wo,type:Xo,properties:Ko},Pf={__proto__:null,$dynamicAnchor:zo,$id:Bo,$schema:Go,$vocabulary:Vo,default:Nf,properties:Ko,title:Wo,type:Xo},jf=Ie(Pf),Yo="https://json-schema.org/draft/2020-12/schema",Jo="https://json-schema.org/draft/2020-12/meta/validation",Qo={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Zo="meta",ea="Validation vocabulary meta-schema",ta=["object","boolean"],ra={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{
335
337
  type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntege\
336
- rDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Xi={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",
337
- default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Of={$schema:Ui,$id:Fi,$vocabulary:Gi,$dynamicAnchor:Bi,title:Vi,type:Wi,properties:zi,$defs:Xi},Pf={__proto__:null,$defs:Xi,$dynamicAnchor:Bi,$id:Fi,$schema:Ui,$vocabulary:Gi,default:Of,properties:zi,title:Vi,type:Wi},Nf=Le(Pf);var Ki;function jf(){if(Ki)return Ft;Ki=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=hf,
338
- e=yf,r=$f,n=Rf,o=_f,u=Tf,s=If,i=Nf,c=["/properties"];function a(l){return[t,e,r,n,o,f(this,u),s,f(this,i)].forEach(p=>this.addMetaSchema(p,void 0,!1)),this;function f(p,h){return l?p.$dataMetaSchema(h,c):h}}return Ft.default=a,Ft}var Ji;function Df(){return Ji||(Ji=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;const r=Oc(),n=ff(),o=Pc(),u=jf(),s="https://json-schema.\
339
- org/draft/2020-12/schema";class i extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:v}=this.opts;v&&(u.default.call(this,h),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(
340
- s)?s:void 0)}}e.Ajv2020=i,t.exports=e=i,t.exports.Ajv2020=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var c=Nc();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var a=tt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(e,"nil",{
341
- enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});var l=jc();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var f=Dc();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(Lt,Lt.exports)),Lt.exports}var qf=Df();const Hf=(t,e,r,n)=>{if(r==="length"||r==="pro\
342
- totype"||r==="arguments"||r==="caller")return;const o=Object.getOwnPropertyDescriptor(t,r),u=Object.getOwnPropertyDescriptor(e,r);!Mf(o,u)&&n||Object.defineProperty(t,r,u)},Mf=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Uf=(t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},Ff=(t,e)=>`/* Wrapped ${t}*/
343
- ${e}`,Gf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Bf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Vf=(t,e,r)=>{const n=r===""?"":`with ${r.trim()}() `,o=Ff.bind(null,n,e.toString());Object.defineProperty(o,"name",Bf);const{writable:u,enumerable:s,configurable:i}=Gf;Object.defineProperty(t,"toString",{value:o,writable:u,enumerable:s,configurable:i})};function Wf(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:n}=t;for(const o of Reflect.ownKeys(e))Hf(t,
344
- e,o,r);return Uf(t,e),Vf(t,e,n),t}const Yi=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:o=!1,after:u=!0}=e;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!o&&!u)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let s,i,c;const a=function(...l){const f=this,p=()=>{s=void 0,i&&(clearTimeout(i),i=
345
- void 0),u&&(c=t.apply(f,l))},h=()=>{i=void 0,s&&(clearTimeout(s),s=void 0),u&&(c=t.apply(f,l))},v=o&&!s;return clearTimeout(s),s=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!i&&(i=setTimeout(h,n)),v&&(c=t.apply(f,l)),c};return Wf(a,t),a.cancel=()=>{s&&(clearTimeout(s),s=void 0),i&&(clearTimeout(i),i=void 0)},a};var Gt={exports:{}},Jr,Qi;function Bt(){if(Qi)return Jr;Qi=1;const t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=e-6;return Jr={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,
346
- MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Jr}var Yr,Zi;function Vt(){return Zi||(Zi=1,Yr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Yr}var ea;function ft(){return ea||(ea=1,(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
347
- MAX_LENGTH:o}=Bt(),u=Vt();e=t.exports={};const s=e.re=[],i=e.safeRe=[],c=e.src=[],a=e.safeSrc=[],l=e.t={};let f=0;const p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[p,n]],v=m=>{for(const[g,T]of h)m=m.split(`${g}*`).join(`${g}{0,${T}}`).split(`${g}+`).join(`${g}{1,${T}}`);return m},w=(m,g,T)=>{const d=v(g),S=f++;u(m,S,g),l[m]=S,c[S]=g,a[S]=d,s[S]=new RegExp(g,T?"g":void 0),i[S]=new RegExp(d,T?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",
338
+ rDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},na={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",
339
+ default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Df={$schema:Yo,$id:Jo,$vocabulary:Qo,$dynamicAnchor:Zo,title:ea,type:ta,properties:ra,$defs:na},qf={__proto__:null,$defs:na,$dynamicAnchor:Zo,$id:Jo,$schema:Yo,$vocabulary:Qo,default:Df,properties:ra,title:ea,type:ta},Hf=Ie(qf);var sa;function Mf(){if(sa)return Bt;sa=1,Object.defineProperty(Bt,"__esModule",{value:!0});const t=wf,
340
+ e=bf,r=Sf,n=Cf,i=If,a=kf,s=jf,o=Hf,c=["/properties"];function u(l){return[t,e,r,n,i,f(this,a),s,f(this,o)].forEach(p=>this.addMetaSchema(p,void 0,!1)),this;function f(p,h){return l?p.$dataMetaSchema(h,c):h}}return Bt.default=u,Bt}var ia;function Uf(){return ia||(ia=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;const r=Mc(),n=mf(),i=Uc(),a=Mf(),s="https://json-schema.\
341
+ org/draft/2020-12/schema";class o extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:v}=this.opts;v&&(a.default.call(this,h),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(
342
+ s)?s:void 0)}}e.Ajv2020=o,t.exports=e=o,t.exports.Ajv2020=o,Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var c=Fc();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=nt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{
343
+ enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=Gc();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var f=Bc();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(Lt,Lt.exports)),Lt.exports}var Ff=Uf();const Gf=(t,e,r,n)=>{if(r==="length"||r==="pro\
344
+ totype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(t,r),a=Object.getOwnPropertyDescriptor(e,r);!Bf(i,a)&&n||Object.defineProperty(t,r,a)},Bf=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Vf=(t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},zf=(t,e)=>`/* Wrapped ${t}*/
345
+ ${e}`,Wf=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Xf=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Kf=(t,e,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=zf.bind(null,n,e.toString());Object.defineProperty(i,"name",Xf);const{writable:a,enumerable:s,configurable:o}=Wf;Object.defineProperty(t,"toString",{value:i,writable:a,enumerable:s,configurable:o})};function Yf(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:n}=t;for(const i of Reflect.ownKeys(e))Gf(t,
346
+ e,i,r);return Vf(t,e),Kf(t,e,n),t}const oa=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:a=!0}=e;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!a)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let s,o,c;const u=function(...l){const f=this,p=()=>{s=void 0,o&&(clearTimeout(o),o=
347
+ void 0),a&&(c=t.apply(f,l))},h=()=>{o=void 0,s&&(clearTimeout(s),s=void 0),a&&(c=t.apply(f,l))},v=i&&!s;return clearTimeout(s),s=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!o&&(o=setTimeout(h,n)),v&&(c=t.apply(f,l)),c};return Yf(u,t),u.cancel=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)},u};var Vt={exports:{}},Zr,aa;function zt(){if(aa)return Zr;aa=1;const t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=e-6;return Zr={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,
348
+ MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Zr}var en,ca;function Wt(){return ca||(ca=1,en=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),en}var ua;function pt(){return ua||(ua=1,(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
349
+ MAX_LENGTH:i}=zt(),a=Wt();e=t.exports={};const s=e.re=[],o=e.safeRe=[],c=e.src=[],u=e.safeSrc=[],l=e.t={};let f=0;const p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[p,n]],v=m=>{for(const[g,T]of h)m=m.split(`${g}*`).join(`${g}{0,${T}}`).split(`${g}+`).join(`${g}{1,${T}}`);return m},w=(m,g,T)=>{const d=v(g),S=f++;a(m,S,g),l[m]=S,c[S]=g,u[S]=d,s[S]=new RegExp(g,T?"g":void 0),o[S]=new RegExp(d,T?"g":void 0)};w("NUMERICIDENTIFIER","0|[1-9]\\d*"),w("NUMERICIDENTIFIERLOOSE","\\d+"),w("NONNUMERICIDENTIFIER",
348
350
  `\\d*[a-zA-Z-]${p}*`),w("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),w("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),w("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),w("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.
349
351
  PRERELEASEIDENTIFIER]})*))`),w("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),w("BUILDIDENTIFIER",`${p}+`),w("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),w("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),w("FULL",`^${c[l.FULLPLAIN]}$`),w("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),w("LOOSE",`^${c[l.LOOSEPLAIN]}$`),w("GTLT","((?:<|>)?=?)"),w("XRAN\
350
352
  GEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),w("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),w("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),w("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),w("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}\
351
353
  $`),w("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),w("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),w("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),w("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),w("COERCERTL",c[l.COERCE],!0),w("COERCERTLFULL",c[l.COERCEFULL],!0),w("LONETILDE","(?:~>?)"),w("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",w("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}\
352
354
  $`),w("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),w("LONECARET","(?:\\^)"),w("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",w("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),w("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),w("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),w("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),w("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=
353
- "$1$2$3",w("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Gt,Gt.exports)),Gt.exports}var Qr,ta;function Zr(){if(ta)return Qr;ta=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return Qr=n=>n?typeof n!="object"?t:n:e,Qr}var en,ra;function na(){if(ra)return en;
354
- ra=1;const t=/^[0-9]+$/,e=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const u=t.test(n),s=t.test(o);return u&&s&&(n=+n,o=+o),n===o?0:u&&!s?-1:s&&!u?1:n<o?-1:1};return en={compareIdentifiers:e,rcompareIdentifiers:(n,o)=>e(o,n)},en}var tn,sa;function de(){if(sa)return tn;sa=1;const t=Vt(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Bt(),{safeRe:n,t:o}=ft(),u=Zr(),{compareIdentifiers:s}=na();class i{constructor(a,l){if(l=u(l),a instanceof i){if(a.loose===!!l.loose&&a.includePrerelease===
355
- !!l.includePrerelease)return a;a=a.version}else if(typeof a!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",a,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=a.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>
355
+ "$1$2$3",w("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),w("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),w("STAR","(<|>)?=?\\s*\\*"),w("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),w("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Vt,Vt.exports)),Vt.exports}var tn,la;function rn(){if(la)return tn;la=1;const t=Object.freeze({loose:!0}),e=Object.freeze({});return tn=n=>n?typeof n!="object"?t:n:e,tn}var nn,fa;function pa(){if(fa)return nn;
356
+ fa=1;const t=/^[0-9]+$/,e=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const a=t.test(n),s=t.test(i);return a&&s&&(n=+n,i=+i),n===i?0:a&&!s?-1:s&&!a?1:n<i?-1:1};return nn={compareIdentifiers:e,rcompareIdentifiers:(n,i)=>e(i,n)},nn}var sn,da;function de(){if(da)return sn;da=1;const t=Wt(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=zt(),{safeRe:n,t:i}=pt(),a=rn(),{compareIdentifiers:s}=pa();class o{constructor(u,l){if(l=a(l),u instanceof o){if(u.loose===!!l.loose&&u.includePrerelease===
357
+ !!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[i.LOOSE]:n[i.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>
356
358
  r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const h=+p;if(h>=0&&h<r)return h}return p}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=
357
- `-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(a){if(t("SemVer.compare",this.version,this.options,a),!(a instanceof i)){if(typeof a=="string"&&a===this.version)return 0;a=new i(a,this.options)}return a.version===this.version?0:this.compareMain(a)||this.comparePre(a)}compareMain(a){return a instanceof i||(a=new i(a,this.options)),this.major<a.major?-1:this.major>a.major?1:this.minor<a.minor?-1:this.minor>a.minor?1:this.patch<a.patch?-1:this.patch>a.patch?1:0}comparePre(a){
358
- if(a instanceof i||(a=new i(a,this.options)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],p=a.prerelease[l];if(t("prerelease compare",l,f,p),f===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(f===void 0)return-1;if(f===p)continue;return s(f,p)}while(++l)}compareBuild(a){a instanceof i||(a=new i(a,this.options));let l=0;do{const f=this.
359
- build[l],p=a.build[l];if(t("build compare",l,f,p),f===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(f===void 0)return-1;if(f===p)continue;return s(f,p)}while(++l)}inc(a,l,f){if(a.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const p=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!p||p[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.
359
+ `-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(t("SemVer.compare",this.version,this.options,u),!(u instanceof o)){if(typeof u=="string"&&u===this.version)return 0;u=new o(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof o||(u=new o(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){
360
+ if(u instanceof o||(u=new o(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],p=u.prerelease[l];if(t("prerelease compare",l,f,p),f===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(f===void 0)return-1;if(f===p)continue;return s(f,p)}while(++l)}compareBuild(u){u instanceof o||(u=new o(u,this.options));let l=0;do{const f=this.
361
+ build[l],p=u.build[l];if(t("build compare",l,f,p),f===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(f===void 0)return-1;if(f===p)continue;return s(f,p)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const p=`-${l}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!p||p[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.
360
362
  minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.
361
363
  prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(l===this.prerelease.
362
- join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(l){let h=[l,p];f===!1&&(h=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${a}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return tn=i,tn}var rn,oa;function Je(){if(oa)return rn;oa=1;const t=de();return rn=(r,n,o=!1)=>{if(r instanceof
363
- t)return r;try{return new t(r,n)}catch(u){if(!o)return null;throw u}},rn}var nn,ia;function zf(){if(ia)return nn;ia=1;const t=Je();return nn=(r,n)=>{const o=t(r,n);return o?o.version:null},nn}var sn,aa;function Xf(){if(aa)return sn;aa=1;const t=Je();return sn=(r,n)=>{const o=t(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},sn}var on,ca;function Kf(){if(ca)return on;ca=1;const t=de();return on=(r,n,o,u,s)=>{typeof o=="string"&&(s=u,u=o,o=void 0);try{return new t(r instanceof t?r.version:
364
- r,o).inc(n,u,s).version}catch{return null}},on}var an,ua;function Jf(){if(ua)return an;ua=1;const t=Je();return an=(r,n)=>{const o=t(r,null,!0),u=t(n,null,!0),s=o.compare(u);if(s===0)return null;const i=s>0,c=i?o:u,a=i?u:o,l=!!c.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(c)===0)return a.minor&&!a.patch?"minor":"patch"}const p=l?"pre":"";return o.major!==u.major?p+"major":o.minor!==u.minor?p+"minor":o.patch!==u.patch?p+"patch":"prerelease"},
365
- an}var cn,la;function Yf(){if(la)return cn;la=1;const t=de();return cn=(r,n)=>new t(r,n).major,cn}var un,fa;function Qf(){if(fa)return un;fa=1;const t=de();return un=(r,n)=>new t(r,n).minor,un}var ln,pa;function Zf(){if(pa)return ln;pa=1;const t=de();return ln=(r,n)=>new t(r,n).patch,ln}var fn,da;function ep(){if(da)return fn;da=1;const t=Je();return fn=(r,n)=>{const o=t(r,n);return o&&o.prerelease.length?o.prerelease:null},fn}var pn,ha;function be(){if(ha)return pn;ha=1;const t=de();return pn=(r,n,o)=>new t(
366
- r,o).compare(new t(n,o)),pn}var dn,ma;function tp(){if(ma)return dn;ma=1;const t=be();return dn=(r,n,o)=>t(n,r,o),dn}var hn,ga;function rp(){if(ga)return hn;ga=1;const t=be();return hn=(r,n)=>t(r,n,!0),hn}var mn,ya;function gn(){if(ya)return mn;ya=1;const t=de();return mn=(r,n,o)=>{const u=new t(r,o),s=new t(n,o);return u.compare(s)||u.compareBuild(s)},mn}var yn,wa;function np(){if(wa)return yn;wa=1;const t=gn();return yn=(r,n)=>r.sort((o,u)=>t(o,u,n)),yn}var wn,va;function sp(){if(va)return wn;
367
- va=1;const t=gn();return wn=(r,n)=>r.sort((o,u)=>t(u,o,n)),wn}var vn,$a;function Wt(){if($a)return vn;$a=1;const t=be();return vn=(r,n,o)=>t(r,n,o)>0,vn}var $n,ba;function bn(){if(ba)return $n;ba=1;const t=be();return $n=(r,n,o)=>t(r,n,o)<0,$n}var En,Ea;function Ra(){if(Ea)return En;Ea=1;const t=be();return En=(r,n,o)=>t(r,n,o)===0,En}var Rn,Sa;function Aa(){if(Sa)return Rn;Sa=1;const t=be();return Rn=(r,n,o)=>t(r,n,o)!==0,Rn}var Sn,_a;function An(){if(_a)return Sn;_a=1;const t=be();return Sn=(r,n,o)=>t(
368
- r,n,o)>=0,Sn}var _n,Ca;function Cn(){if(Ca)return _n;Ca=1;const t=be();return _n=(r,n,o)=>t(r,n,o)<=0,_n}var xn,xa;function Ta(){if(xa)return xn;xa=1;const t=Ra(),e=Aa(),r=Wt(),n=An(),o=bn(),u=Cn();return xn=(i,c,a,l)=>{switch(c){case"===":return typeof i=="object"&&(i=i.version),typeof a=="object"&&(a=a.version),i===a;case"!==":return typeof i=="object"&&(i=i.version),typeof a=="object"&&(a=a.version),i!==a;case"":case"=":case"==":return t(i,a,l);case"!=":return e(i,a,l);case">":return r(i,a,l);case"\
369
- >=":return n(i,a,l);case"<":return o(i,a,l);case"<=":return u(i,a,l);default:throw new TypeError(`Invalid operator: ${c}`)}},xn}var Tn,La;function op(){if(La)return Tn;La=1;const t=de(),e=Je(),{safeRe:r,t:n}=ft();return Tn=(u,s)=>{if(u instanceof t)return u;if(typeof u=="number"&&(u=String(u)),typeof u!="string")return null;s=s||{};let i=null;if(!s.rtl)i=u.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const h=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let v;for(;(v=h.exec(
370
- u))&&(!i||i.index+i[0].length!==u.length);)(!i||v.index+v[0].length!==i.index+i[0].length)&&(i=v),h.lastIndex=v.index+v[1].length+v[2].length;h.lastIndex=-1}if(i===null)return null;const c=i[2],a=i[3]||"0",l=i[4]||"0",f=s.includePrerelease&&i[5]?`-${i[5]}`:"",p=s.includePrerelease&&i[6]?`+${i[6]}`:"";return e(`${c}.${a}.${l}${f}${p}`,s)},Tn}var Ln,ka;function ip(){if(ka)return Ln;ka=1;class t{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
371
- delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const u=this.map.keys().next().value;this.delete(u)}this.map.set(r,n)}return this}}return Ln=t,Ln}var kn,Ia;function Ee(){if(Ia)return kn;Ia=1;const t=/\s+/g;class e{constructor(C,O){if(O=o(O),C instanceof e)return C.loose===!!O.loose&&C.includePrerelease===!!O.includePrerelease?C:new e(C.raw,O);if(C instanceof u)return this.raw=C.value,this.set=[[C]],this.formatted=
372
- void 0,this;if(this.options=O,this.loose=!!O.loose,this.includePrerelease=!!O.includePrerelease,this.raw=C.trim().replace(t," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(N=>!w(N[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&m(N[0])){this.set=[N];break}}}
373
- this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let C=0;C<this.set.length;C++){C>0&&(this.formatted+="||");const O=this.set[C];for(let k=0;k<O.length;k++)k>0&&(this.formatted+=" "),this.formatted+=O[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(C){const k=((this.options.includePrerelease&&h)|(this.options.loose&&v))+":"+C,N=n.get(k);if(N)return N;const D=this.options.loose,H=D?c[a.HYPHENRANGELOOSE]:
374
- c[a.HYPHENRANGE];C=C.replace(H,F(this.options.includePrerelease)),s("hyphen replace",C),C=C.replace(c[a.COMPARATORTRIM],l),s("comparator trim",C),C=C.replace(c[a.TILDETRIM],f),s("tilde trim",C),C=C.replace(c[a.CARETTRIM],p),s("caret trim",C);let $=C.split(" ").map(R=>T(R,this.options)).join(" ").split(/\s+/).map(R=>B(R,this.options));D&&($=$.filter(R=>(s("loose invalid filter",R,this.options),!!R.match(c[a.COMPARATORLOOSE])))),s("range list",$);const U=new Map,Y=$.map(R=>new u(R,this.options));for(const R of Y){
375
- if(w(R))return[R];U.set(R.value,R)}U.size>1&&U.has("")&&U.delete("");const Q=[...U.values()];return n.set(k,Q),Q}intersects(C,O){if(!(C instanceof e))throw new TypeError("a Range is required");return this.set.some(k=>g(k,O)&&C.set.some(N=>g(N,O)&&k.every(D=>N.every(H=>D.intersects(H,O)))))}test(C){if(!C)return!1;if(typeof C=="string")try{C=new i(C,this.options)}catch{return!1}for(let O=0;O<this.set.length;O++)if(I(this.set[O],C,this.options))return!0;return!1}}kn=e;const r=ip(),n=new r,o=Zr(),u=zt(),
376
- s=Vt(),i=de(),{safeRe:c,t:a,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:p}=ft(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:v}=Bt(),w=L=>L.value==="<0.0.0-0",m=L=>L.value==="",g=(L,C)=>{let O=!0;const k=L.slice();let N=k.pop();for(;O&&k.length;)O=k.every(D=>N.intersects(D,C)),N=k.pop();return O},T=(L,C)=>(L=L.replace(c[a.BUILD],""),s("comp",L,C),L=A(L,C),s("caret",L),L=S(L,C),s("tildes",L),L=x(L,C),s("xrange",L),L=M(L,C),s("stars",L),L),d=L=>!L||L.toLowerCase()==="x"||L==="*",S=(L,C)=>L.
377
- trim().split(/\s+/).map(O=>E(O,C)).join(" "),E=(L,C)=>{const O=C.loose?c[a.TILDELOOSE]:c[a.TILDE];return L.replace(O,(k,N,D,H,$)=>{s("tilde",L,k,N,D,H,$);let U;return d(N)?U="":d(D)?U=`>=${N}.0.0 <${+N+1}.0.0-0`:d(H)?U=`>=${N}.${D}.0 <${N}.${+D+1}.0-0`:$?(s("replaceTilde pr",$),U=`>=${N}.${D}.${H}-${$} <${N}.${+D+1}.0-0`):U=`>=${N}.${D}.${H} <${N}.${+D+1}.0-0`,s("tilde return",U),U})},A=(L,C)=>L.trim().split(/\s+/).map(O=>b(O,C)).join(" "),b=(L,C)=>{s("caret",L,C);const O=C.loose?c[a.CARETLOOSE]:
378
- c[a.CARET],k=C.includePrerelease?"-0":"";return L.replace(O,(N,D,H,$,U)=>{s("caret",L,N,D,H,$,U);let Y;return d(D)?Y="":d(H)?Y=`>=${D}.0.0${k} <${+D+1}.0.0-0`:d($)?D==="0"?Y=`>=${D}.${H}.0${k} <${D}.${+H+1}.0-0`:Y=`>=${D}.${H}.0${k} <${+D+1}.0.0-0`:U?(s("replaceCaret pr",U),D==="0"?H==="0"?Y=`>=${D}.${H}.${$}-${U} <${D}.${H}.${+$+1}-0`:Y=`>=${D}.${H}.${$}-${U} <${D}.${+H+1}.0-0`:Y=`>=${D}.${H}.${$}-${U} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?H==="0"?Y=`>=${D}.${H}.${$}${k} <${D}.${H}.${+$+1}-0`:Y=
379
- `>=${D}.${H}.${$}${k} <${D}.${+H+1}.0-0`:Y=`>=${D}.${H}.${$} <${+D+1}.0.0-0`),s("caret return",Y),Y})},x=(L,C)=>(s("replaceXRanges",L,C),L.split(/\s+/).map(O=>q(O,C)).join(" ")),q=(L,C)=>{L=L.trim();const O=C.loose?c[a.XRANGELOOSE]:c[a.XRANGE];return L.replace(O,(k,N,D,H,$,U)=>{s("xRange",L,k,N,D,H,$,U);const Y=d(D),Q=Y||d(H),R=Q||d($),_=R;return N==="="&&_&&(N=""),U=C.includePrerelease?"-0":"",Y?N===">"||N==="<"?k="<0.0.0-0":k="*":N&&_?(Q&&(H=0),$=0,N===">"?(N=">=",Q?(D=+D+1,H=0,$=0):(H=+H+1,$=
380
- 0)):N==="<="&&(N="<",Q?D=+D+1:H=+H+1),N==="<"&&(U="-0"),k=`${N+D}.${H}.${$}${U}`):Q?k=`>=${D}.0.0${U} <${+D+1}.0.0-0`:R&&(k=`>=${D}.${H}.0${U} <${D}.${+H+1}.0-0`),s("xRange return",k),k})},M=(L,C)=>(s("replaceStars",L,C),L.trim().replace(c[a.STAR],"")),B=(L,C)=>(s("replaceGTE0",L,C),L.trim().replace(c[C.includePrerelease?a.GTE0PRE:a.GTE0],"")),F=L=>(C,O,k,N,D,H,$,U,Y,Q,R,_)=>(d(k)?O="":d(N)?O=`>=${k}.0.0${L?"-0":""}`:d(D)?O=`>=${k}.${N}.0${L?"-0":""}`:H?O=`>=${O}`:O=`>=${O}${L?"-0":""}`,d(Y)?U="":
381
- d(Q)?U=`<${+Y+1}.0.0-0`:d(R)?U=`<${Y}.${+Q+1}.0-0`:_?U=`<=${Y}.${Q}.${R}-${_}`:L?U=`<${Y}.${Q}.${+R+1}-0`:U=`<=${U}`,`${O} ${U}`.trim()),I=(L,C,O)=>{for(let k=0;k<L.length;k++)if(!L[k].test(C))return!1;if(C.prerelease.length&&!O.includePrerelease){for(let k=0;k<L.length;k++)if(s(L[k].semver),L[k].semver!==u.ANY&&L[k].semver.prerelease.length>0){const N=L[k].semver;if(N.major===C.major&&N.minor===C.minor&&N.patch===C.patch)return!0}return!1}return!0};return kn}var In,Oa;function zt(){if(Oa)return In;
382
- Oa=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,f){if(f=r(f),l instanceof e){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),s("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],p=l.match(f);if(!p)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
383
- p[1]!==void 0?p[1]:"",this.operator==="="&&(this.operator=""),p[2]?this.semver=new i(p[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(s("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new i(l,this.options)}catch{return!1}return u(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).
384
- test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||u(this.semver,"<",l.semver,f)&&this.
385
- operator.startsWith(">")&&l.operator.startsWith("<")||u(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}In=e;const r=Zr(),{safeRe:n,t:o}=ft(),u=Ta(),s=Vt(),i=de(),c=Ee();return In}var On,Pa;function Xt(){if(Pa)return On;Pa=1;const t=Ee();return On=(r,n,o)=>{try{n=new t(n,o)}catch{return!1}return n.test(r)},On}var Pn,Na;function ap(){if(Na)return Pn;Na=1;const t=Ee();return Pn=(r,n)=>new t(r,n).set.map(o=>o.map(u=>u.value).join(" ").trim().split(" ")),Pn}
386
- var Nn,ja;function cp(){if(ja)return Nn;ja=1;const t=de(),e=Ee();return Nn=(n,o,u)=>{let s=null,i=null,c=null;try{c=new e(o,u)}catch{return null}return n.forEach(a=>{c.test(a)&&(!s||i.compare(a)===-1)&&(s=a,i=new t(s,u))}),s},Nn}var jn,Da;function up(){if(Da)return jn;Da=1;const t=de(),e=Ee();return jn=(n,o,u)=>{let s=null,i=null,c=null;try{c=new e(o,u)}catch{return null}return n.forEach(a=>{c.test(a)&&(!s||i.compare(a)===1)&&(s=a,i=new t(s,u))}),s},jn}var Dn,qa;function lp(){if(qa)return Dn;qa=
387
- 1;const t=de(),e=Ee(),r=Wt();return Dn=(o,u)=>{o=new e(o,u);let s=new t("0.0.0");if(o.test(s)||(s=new t("0.0.0-0"),o.test(s)))return s;s=null;for(let i=0;i<o.set.length;++i){const c=o.set[i];let a=null;c.forEach(l=>{const f=new t(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!a||r(f,a))&&(a=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),a&&(!s||r(s,a))&&(s=a)}
388
- return s&&o.test(s)?s:null},Dn}var qn,Ha;function fp(){if(Ha)return qn;Ha=1;const t=Ee();return qn=(r,n)=>{try{return new t(r,n).range||"*"}catch{return null}},qn}var Hn,Ma;function Mn(){if(Ma)return Hn;Ma=1;const t=de(),e=zt(),{ANY:r}=e,n=Ee(),o=Xt(),u=Wt(),s=bn(),i=Cn(),c=An();return Hn=(l,f,p,h)=>{l=new t(l,h),f=new n(f,h);let v,w,m,g,T;switch(p){case">":v=u,w=i,m=s,g=">",T=">=";break;case"<":v=s,w=c,m=u,g="<",T="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(
389
- l,f,h))return!1;for(let d=0;d<f.set.length;++d){const S=f.set[d];let E=null,A=null;if(S.forEach(b=>{b.semver===r&&(b=new e(">=0.0.0")),E=E||b,A=A||b,v(b.semver,E.semver,h)?E=b:m(b.semver,A.semver,h)&&(A=b)}),E.operator===g||E.operator===T||(!A.operator||A.operator===g)&&w(l,A.semver))return!1;if(A.operator===T&&m(l,A.semver))return!1}return!0},Hn}var Un,Ua;function pp(){if(Ua)return Un;Ua=1;const t=Mn();return Un=(r,n,o)=>t(r,n,">",o),Un}var Fn,Fa;function dp(){if(Fa)return Fn;Fa=1;const t=Mn();
390
- return Fn=(r,n,o)=>t(r,n,"<",o),Fn}var Gn,Ga;function hp(){if(Ga)return Gn;Ga=1;const t=Ee();return Gn=(r,n,o)=>(r=new t(r,o),n=new t(n,o),r.intersects(n,o)),Gn}var Bn,Ba;function mp(){if(Ba)return Bn;Ba=1;const t=Xt(),e=be();return Bn=(r,n,o)=>{const u=[];let s=null,i=null;const c=r.sort((p,h)=>e(p,h,o));for(const p of c)t(p,n,o)?(i=p,s||(s=p)):(i&&u.push([s,i]),i=null,s=null);s&&u.push([s,null]);const a=[];for(const[p,h]of u)p===h?a.push(p):!h&&p===c[0]?a.push("*"):h?p===c[0]?a.push(`<=${h}`):
391
- a.push(`${p} - ${h}`):a.push(`>=${p}`);const l=a.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},Bn}var Vn,Va;function gp(){if(Va)return Vn;Va=1;const t=Ee(),e=zt(),{ANY:r}=e,n=Xt(),o=be(),u=(f,p,h={})=>{if(f===p)return!0;f=new t(f,h),p=new t(p,h);let v=!1;e:for(const w of f.set){for(const m of p.set){const g=c(w,m,h);if(v=v||g!==null,g)continue e}if(v)return!1}return!0},s=[new e(">=0.0.0-0")],i=[new e(">=0.0.0")],c=(f,p,h)=>{if(f===p)return!0;if(f.length===1&&
392
- f[0].semver===r){if(p.length===1&&p[0].semver===r)return!0;h.includePrerelease?f=s:f=i}if(p.length===1&&p[0].semver===r){if(h.includePrerelease)return!0;p=i}const v=new Set;let w,m;for(const x of f)x.operator===">"||x.operator===">="?w=a(w,x,h):x.operator==="<"||x.operator==="<="?m=l(m,x,h):v.add(x.semver);if(v.size>1)return null;let g;if(w&&m){if(g=o(w.semver,m.semver,h),g>0)return null;if(g===0&&(w.operator!==">="||m.operator!=="<="))return null}for(const x of v){if(w&&!n(x,String(w),h)||m&&!n(
364
+ join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(l){let h=[l,p];f===!1&&(h=[l]),s(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return sn=o,sn}var on,ha;function Ze(){if(ha)return on;ha=1;const t=de();return on=(r,n,i=!1)=>{if(r instanceof
365
+ t)return r;try{return new t(r,n)}catch(a){if(!i)return null;throw a}},on}var an,ma;function Jf(){if(ma)return an;ma=1;const t=Ze();return an=(r,n)=>{const i=t(r,n);return i?i.version:null},an}var cn,ga;function Qf(){if(ga)return cn;ga=1;const t=Ze();return cn=(r,n)=>{const i=t(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},cn}var un,ya;function Zf(){if(ya)return un;ya=1;const t=de();return un=(r,n,i,a,s)=>{typeof i=="string"&&(s=a,a=i,i=void 0);try{return new t(r instanceof t?r.version:
366
+ r,i).inc(n,a,s).version}catch{return null}},un}var ln,wa;function ep(){if(wa)return ln;wa=1;const t=Ze();return ln=(r,n)=>{const i=t(r,null,!0),a=t(n,null,!0),s=i.compare(a);if(s===0)return null;const o=s>0,c=o?i:a,u=o?a:i,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const p=l?"pre":"";return i.major!==a.major?p+"major":i.minor!==a.minor?p+"minor":i.patch!==a.patch?p+"patch":"prerelease"},
367
+ ln}var fn,va;function tp(){if(va)return fn;va=1;const t=de();return fn=(r,n)=>new t(r,n).major,fn}var pn,$a;function rp(){if($a)return pn;$a=1;const t=de();return pn=(r,n)=>new t(r,n).minor,pn}var dn,ba;function np(){if(ba)return dn;ba=1;const t=de();return dn=(r,n)=>new t(r,n).patch,dn}var hn,Ea;function sp(){if(Ea)return hn;Ea=1;const t=Ze();return hn=(r,n)=>{const i=t(r,n);return i&&i.prerelease.length?i.prerelease:null},hn}var mn,Ra;function be(){if(Ra)return mn;Ra=1;const t=de();return mn=(r,n,i)=>new t(
368
+ r,i).compare(new t(n,i)),mn}var gn,Sa;function ip(){if(Sa)return gn;Sa=1;const t=be();return gn=(r,n,i)=>t(n,r,i),gn}var yn,Aa;function op(){if(Aa)return yn;Aa=1;const t=be();return yn=(r,n)=>t(r,n,!0),yn}var wn,_a;function vn(){if(_a)return wn;_a=1;const t=de();return wn=(r,n,i)=>{const a=new t(r,i),s=new t(n,i);return a.compare(s)||a.compareBuild(s)},wn}var $n,Ca;function ap(){if(Ca)return $n;Ca=1;const t=vn();return $n=(r,n)=>r.sort((i,a)=>t(i,a,n)),$n}var bn,xa;function cp(){if(xa)return bn;
369
+ xa=1;const t=vn();return bn=(r,n)=>r.sort((i,a)=>t(a,i,n)),bn}var En,Ta;function Xt(){if(Ta)return En;Ta=1;const t=be();return En=(r,n,i)=>t(r,n,i)>0,En}var Rn,Ia;function Sn(){if(Ia)return Rn;Ia=1;const t=be();return Rn=(r,n,i)=>t(r,n,i)<0,Rn}var An,Oa;function La(){if(Oa)return An;Oa=1;const t=be();return An=(r,n,i)=>t(r,n,i)===0,An}var _n,ka;function Na(){if(ka)return _n;ka=1;const t=be();return _n=(r,n,i)=>t(r,n,i)!==0,_n}var Cn,Pa;function xn(){if(Pa)return Cn;Pa=1;const t=be();return Cn=(r,n,i)=>t(
370
+ r,n,i)>=0,Cn}var Tn,ja;function In(){if(ja)return Tn;ja=1;const t=be();return Tn=(r,n,i)=>t(r,n,i)<=0,Tn}var On,Da;function qa(){if(Da)return On;Da=1;const t=La(),e=Na(),r=Xt(),n=xn(),i=Sn(),a=In();return On=(o,c,u,l)=>{switch(c){case"===":return typeof o=="object"&&(o=o.version),typeof u=="object"&&(u=u.version),o===u;case"!==":return typeof o=="object"&&(o=o.version),typeof u=="object"&&(u=u.version),o!==u;case"":case"=":case"==":return t(o,u,l);case"!=":return e(o,u,l);case">":return r(o,u,l);case"\
371
+ >=":return n(o,u,l);case"<":return i(o,u,l);case"<=":return a(o,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},On}var Ln,Ha;function up(){if(Ha)return Ln;Ha=1;const t=de(),e=Ze(),{safeRe:r,t:n}=pt();return Ln=(a,s)=>{if(a instanceof t)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;s=s||{};let o=null;if(!s.rtl)o=a.match(s.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const h=s.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let v;for(;(v=h.exec(
372
+ a))&&(!o||o.index+o[0].length!==a.length);)(!o||v.index+v[0].length!==o.index+o[0].length)&&(o=v),h.lastIndex=v.index+v[1].length+v[2].length;h.lastIndex=-1}if(o===null)return null;const c=o[2],u=o[3]||"0",l=o[4]||"0",f=s.includePrerelease&&o[5]?`-${o[5]}`:"",p=s.includePrerelease&&o[6]?`+${o[6]}`:"";return e(`${c}.${u}.${l}${f}${p}`,s)},Ln}var kn,Ma;function lp(){if(Ma)return kn;Ma=1;class t{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
373
+ delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return kn=t,kn}var Nn,Ua;function Ee(){if(Ua)return Nn;Ua=1;const t=/\s+/g;class e{constructor(C,k){if(k=i(k),C instanceof e)return C.loose===!!k.loose&&C.includePrerelease===!!k.includePrerelease?C:new e(C.raw,k);if(C instanceof a)return this.raw=C.value,this.set=[[C]],this.formatted=
374
+ void 0,this;if(this.options=k,this.loose=!!k.loose,this.includePrerelease=!!k.includePrerelease,this.raw=C.trim().replace(t," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(P=>!w(P[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&m(P[0])){this.set=[P];break}}}
375
+ this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let C=0;C<this.set.length;C++){C>0&&(this.formatted+="||");const k=this.set[C];for(let O=0;O<k.length;O++)O>0&&(this.formatted+=" "),this.formatted+=k[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(C){const O=((this.options.includePrerelease&&h)|(this.options.loose&&v))+":"+C,P=n.get(O);if(P)return P;const D=this.options.loose,H=D?c[u.HYPHENRANGELOOSE]:
376
+ c[u.HYPHENRANGE];C=C.replace(H,F(this.options.includePrerelease)),s("hyphen replace",C),C=C.replace(c[u.COMPARATORTRIM],l),s("comparator trim",C),C=C.replace(c[u.TILDETRIM],f),s("tilde trim",C),C=C.replace(c[u.CARETTRIM],p),s("caret trim",C);let $=C.split(" ").map(R=>T(R,this.options)).join(" ").split(/\s+/).map(R=>V(R,this.options));D&&($=$.filter(R=>(s("loose invalid filter",R,this.options),!!R.match(c[u.COMPARATORLOOSE])))),s("range list",$);const U=new Map,J=$.map(R=>new a(R,this.options));for(const R of J){
377
+ if(w(R))return[R];U.set(R.value,R)}U.size>1&&U.has("")&&U.delete("");const Q=[...U.values()];return n.set(O,Q),Q}intersects(C,k){if(!(C instanceof e))throw new TypeError("a Range is required");return this.set.some(O=>g(O,k)&&C.set.some(P=>g(P,k)&&O.every(D=>P.every(H=>D.intersects(H,k)))))}test(C){if(!C)return!1;if(typeof C=="string")try{C=new o(C,this.options)}catch{return!1}for(let k=0;k<this.set.length;k++)if(L(this.set[k],C,this.options))return!0;return!1}}Nn=e;const r=lp(),n=new r,i=rn(),a=Kt(),
378
+ s=Wt(),o=de(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:p}=pt(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:v}=zt(),w=I=>I.value==="<0.0.0-0",m=I=>I.value==="",g=(I,C)=>{let k=!0;const O=I.slice();let P=O.pop();for(;k&&O.length;)k=O.every(D=>P.intersects(D,C)),P=O.pop();return k},T=(I,C)=>(I=I.replace(c[u.BUILD],""),s("comp",I,C),I=A(I,C),s("caret",I),I=S(I,C),s("tildes",I),I=x(I,C),s("xrange",I),I=M(I,C),s("stars",I),I),d=I=>!I||I.toLowerCase()==="x"||I==="*",S=(I,C)=>I.
379
+ trim().split(/\s+/).map(k=>E(k,C)).join(" "),E=(I,C)=>{const k=C.loose?c[u.TILDELOOSE]:c[u.TILDE];return I.replace(k,(O,P,D,H,$)=>{s("tilde",I,O,P,D,H,$);let U;return d(P)?U="":d(D)?U=`>=${P}.0.0 <${+P+1}.0.0-0`:d(H)?U=`>=${P}.${D}.0 <${P}.${+D+1}.0-0`:$?(s("replaceTilde pr",$),U=`>=${P}.${D}.${H}-${$} <${P}.${+D+1}.0-0`):U=`>=${P}.${D}.${H} <${P}.${+D+1}.0-0`,s("tilde return",U),U})},A=(I,C)=>I.trim().split(/\s+/).map(k=>b(k,C)).join(" "),b=(I,C)=>{s("caret",I,C);const k=C.loose?c[u.CARETLOOSE]:
380
+ c[u.CARET],O=C.includePrerelease?"-0":"";return I.replace(k,(P,D,H,$,U)=>{s("caret",I,P,D,H,$,U);let J;return d(D)?J="":d(H)?J=`>=${D}.0.0${O} <${+D+1}.0.0-0`:d($)?D==="0"?J=`>=${D}.${H}.0${O} <${D}.${+H+1}.0-0`:J=`>=${D}.${H}.0${O} <${+D+1}.0.0-0`:U?(s("replaceCaret pr",U),D==="0"?H==="0"?J=`>=${D}.${H}.${$}-${U} <${D}.${H}.${+$+1}-0`:J=`>=${D}.${H}.${$}-${U} <${D}.${+H+1}.0-0`:J=`>=${D}.${H}.${$}-${U} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?H==="0"?J=`>=${D}.${H}.${$}${O} <${D}.${H}.${+$+1}-0`:J=
381
+ `>=${D}.${H}.${$}${O} <${D}.${+H+1}.0-0`:J=`>=${D}.${H}.${$} <${+D+1}.0.0-0`),s("caret return",J),J})},x=(I,C)=>(s("replaceXRanges",I,C),I.split(/\s+/).map(k=>q(k,C)).join(" ")),q=(I,C)=>{I=I.trim();const k=C.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return I.replace(k,(O,P,D,H,$,U)=>{s("xRange",I,O,P,D,H,$,U);const J=d(D),Q=J||d(H),R=Q||d($),_=R;return P==="="&&_&&(P=""),U=C.includePrerelease?"-0":"",J?P===">"||P==="<"?O="<0.0.0-0":O="*":P&&_?(Q&&(H=0),$=0,P===">"?(P=">=",Q?(D=+D+1,H=0,$=0):(H=+H+1,$=
382
+ 0)):P==="<="&&(P="<",Q?D=+D+1:H=+H+1),P==="<"&&(U="-0"),O=`${P+D}.${H}.${$}${U}`):Q?O=`>=${D}.0.0${U} <${+D+1}.0.0-0`:R&&(O=`>=${D}.${H}.0${U} <${D}.${+H+1}.0-0`),s("xRange return",O),O})},M=(I,C)=>(s("replaceStars",I,C),I.trim().replace(c[u.STAR],"")),V=(I,C)=>(s("replaceGTE0",I,C),I.trim().replace(c[C.includePrerelease?u.GTE0PRE:u.GTE0],"")),F=I=>(C,k,O,P,D,H,$,U,J,Q,R,_)=>(d(O)?k="":d(P)?k=`>=${O}.0.0${I?"-0":""}`:d(D)?k=`>=${O}.${P}.0${I?"-0":""}`:H?k=`>=${k}`:k=`>=${k}${I?"-0":""}`,d(J)?U="":
383
+ d(Q)?U=`<${+J+1}.0.0-0`:d(R)?U=`<${J}.${+Q+1}.0-0`:_?U=`<=${J}.${Q}.${R}-${_}`:I?U=`<${J}.${Q}.${+R+1}-0`:U=`<=${U}`,`${k} ${U}`.trim()),L=(I,C,k)=>{for(let O=0;O<I.length;O++)if(!I[O].test(C))return!1;if(C.prerelease.length&&!k.includePrerelease){for(let O=0;O<I.length;O++)if(s(I[O].semver),I[O].semver!==a.ANY&&I[O].semver.prerelease.length>0){const P=I[O].semver;if(P.major===C.major&&P.minor===C.minor&&P.patch===C.patch)return!0}return!1}return!0};return Nn}var Pn,Fa;function Kt(){if(Fa)return Pn;
384
+ Fa=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,f){if(f=r(f),l instanceof e){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),s("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(l){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],p=l.match(f);if(!p)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
385
+ p[1]!==void 0?p[1]:"",this.operator==="="&&(this.operator=""),p[2]?this.semver=new o(p[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(s("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new o(l,this.options)}catch{return!1}return a(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).
386
+ test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||a(this.semver,"<",l.semver,f)&&this.
387
+ operator.startsWith(">")&&l.operator.startsWith("<")||a(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}Pn=e;const r=rn(),{safeRe:n,t:i}=pt(),a=qa(),s=Wt(),o=de(),c=Ee();return Pn}var jn,Ga;function Yt(){if(Ga)return jn;Ga=1;const t=Ee();return jn=(r,n,i)=>{try{n=new t(n,i)}catch{return!1}return n.test(r)},jn}var Dn,Ba;function fp(){if(Ba)return Dn;Ba=1;const t=Ee();return Dn=(r,n)=>new t(r,n).set.map(i=>i.map(a=>a.value).join(" ").trim().split(" ")),Dn}
388
+ var qn,Va;function pp(){if(Va)return qn;Va=1;const t=de(),e=Ee();return qn=(n,i,a)=>{let s=null,o=null,c=null;try{c=new e(i,a)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||o.compare(u)===-1)&&(s=u,o=new t(s,a))}),s},qn}var Hn,za;function dp(){if(za)return Hn;za=1;const t=de(),e=Ee();return Hn=(n,i,a)=>{let s=null,o=null,c=null;try{c=new e(i,a)}catch{return null}return n.forEach(u=>{c.test(u)&&(!s||o.compare(u)===1)&&(s=u,o=new t(s,a))}),s},Hn}var Mn,Wa;function hp(){if(Wa)return Mn;Wa=
389
+ 1;const t=de(),e=Ee(),r=Xt();return Mn=(i,a)=>{i=new e(i,a);let s=new t("0.0.0");if(i.test(s)||(s=new t("0.0.0-0"),i.test(s)))return s;s=null;for(let o=0;o<i.set.length;++o){const c=i.set[o];let u=null;c.forEach(l=>{const f=new t(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!s||r(s,u))&&(s=u)}
390
+ return s&&i.test(s)?s:null},Mn}var Un,Xa;function mp(){if(Xa)return Un;Xa=1;const t=Ee();return Un=(r,n)=>{try{return new t(r,n).range||"*"}catch{return null}},Un}var Fn,Ka;function Gn(){if(Ka)return Fn;Ka=1;const t=de(),e=Kt(),{ANY:r}=e,n=Ee(),i=Yt(),a=Xt(),s=Sn(),o=In(),c=xn();return Fn=(l,f,p,h)=>{l=new t(l,h),f=new n(f,h);let v,w,m,g,T;switch(p){case">":v=a,w=o,m=s,g=">",T=">=";break;case"<":v=s,w=c,m=a,g="<",T="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(
391
+ l,f,h))return!1;for(let d=0;d<f.set.length;++d){const S=f.set[d];let E=null,A=null;if(S.forEach(b=>{b.semver===r&&(b=new e(">=0.0.0")),E=E||b,A=A||b,v(b.semver,E.semver,h)?E=b:m(b.semver,A.semver,h)&&(A=b)}),E.operator===g||E.operator===T||(!A.operator||A.operator===g)&&w(l,A.semver))return!1;if(A.operator===T&&m(l,A.semver))return!1}return!0},Fn}var Bn,Ya;function gp(){if(Ya)return Bn;Ya=1;const t=Gn();return Bn=(r,n,i)=>t(r,n,">",i),Bn}var Vn,Ja;function yp(){if(Ja)return Vn;Ja=1;const t=Gn();
392
+ return Vn=(r,n,i)=>t(r,n,"<",i),Vn}var zn,Qa;function wp(){if(Qa)return zn;Qa=1;const t=Ee();return zn=(r,n,i)=>(r=new t(r,i),n=new t(n,i),r.intersects(n,i)),zn}var Wn,Za;function vp(){if(Za)return Wn;Za=1;const t=Yt(),e=be();return Wn=(r,n,i)=>{const a=[];let s=null,o=null;const c=r.sort((p,h)=>e(p,h,i));for(const p of c)t(p,n,i)?(o=p,s||(s=p)):(o&&a.push([s,o]),o=null,s=null);s&&a.push([s,null]);const u=[];for(const[p,h]of a)p===h?u.push(p):!h&&p===c[0]?u.push("*"):h?p===c[0]?u.push(`<=${h}`):
393
+ u.push(`${p} - ${h}`):u.push(`>=${p}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},Wn}var Xn,ec;function $p(){if(ec)return Xn;ec=1;const t=Ee(),e=Kt(),{ANY:r}=e,n=Yt(),i=be(),a=(f,p,h={})=>{if(f===p)return!0;f=new t(f,h),p=new t(p,h);let v=!1;e:for(const w of f.set){for(const m of p.set){const g=c(w,m,h);if(v=v||g!==null,g)continue e}if(v)return!1}return!0},s=[new e(">=0.0.0-0")],o=[new e(">=0.0.0")],c=(f,p,h)=>{if(f===p)return!0;if(f.length===1&&
394
+ f[0].semver===r){if(p.length===1&&p[0].semver===r)return!0;h.includePrerelease?f=s:f=o}if(p.length===1&&p[0].semver===r){if(h.includePrerelease)return!0;p=o}const v=new Set;let w,m;for(const x of f)x.operator===">"||x.operator===">="?w=u(w,x,h):x.operator==="<"||x.operator==="<="?m=l(m,x,h):v.add(x.semver);if(v.size>1)return null;let g;if(w&&m){if(g=i(w.semver,m.semver,h),g>0)return null;if(g===0&&(w.operator!==">="||m.operator!=="<="))return null}for(const x of v){if(w&&!n(x,String(w),h)||m&&!n(
393
395
  x,String(m),h))return null;for(const q of p)if(!n(x,String(q),h))return!1;return!0}let T,d,S,E,A=m&&!h.includePrerelease&&m.semver.prerelease.length?m.semver:!1,b=w&&!h.includePrerelease&&w.semver.prerelease.length?w.semver:!1;A&&A.prerelease.length===1&&m.operator==="<"&&A.prerelease[0]===0&&(A=!1);for(const x of p){if(E=E||x.operator===">"||x.operator===">=",S=S||x.operator==="<"||x.operator==="<=",w){if(b&&x.semver.prerelease&&x.semver.prerelease.length&&x.semver.major===b.major&&x.semver.minor===
394
- b.minor&&x.semver.patch===b.patch&&(b=!1),x.operator===">"||x.operator===">="){if(T=a(w,x,h),T===x&&T!==w)return!1}else if(w.operator===">="&&!n(w.semver,String(x),h))return!1}if(m){if(A&&x.semver.prerelease&&x.semver.prerelease.length&&x.semver.major===A.major&&x.semver.minor===A.minor&&x.semver.patch===A.patch&&(A=!1),x.operator==="<"||x.operator==="<="){if(d=l(m,x,h),d===x&&d!==m)return!1}else if(m.operator==="<="&&!n(m.semver,String(x),h))return!1}if(!x.operator&&(m||w)&&g!==0)return!1}return!(w&&
395
- S&&!m&&g!==0||m&&E&&!w&&g!==0||b||A)},a=(f,p,h)=>{if(!f)return p;const v=o(f.semver,p.semver,h);return v>0?f:v<0||p.operator===">"&&f.operator===">="?p:f},l=(f,p,h)=>{if(!f)return p;const v=o(f.semver,p.semver,h);return v<0?f:v>0||p.operator==="<"&&f.operator==="<="?p:f};return Vn=u,Vn}var Wn,Wa;function yp(){if(Wa)return Wn;Wa=1;const t=ft(),e=Bt(),r=de(),n=na(),o=Je(),u=zf(),s=Xf(),i=Kf(),c=Jf(),a=Yf(),l=Qf(),f=Zf(),p=ep(),h=be(),v=tp(),w=rp(),m=gn(),g=np(),T=sp(),d=Wt(),S=bn(),E=Ra(),A=Aa(),b=An(),
396
- x=Cn(),q=Ta(),M=op(),B=zt(),F=Ee(),I=Xt(),L=ap(),C=cp(),O=up(),k=lp(),N=fp(),D=Mn(),H=pp(),$=dp(),U=hp(),Y=mp(),Q=gp();return Wn={parse:o,valid:u,clean:s,inc:i,diff:c,major:a,minor:l,patch:f,prerelease:p,compare:h,rcompare:v,compareLoose:w,compareBuild:m,sort:g,rsort:T,gt:d,lt:S,eq:E,neq:A,gte:b,lte:x,cmp:q,coerce:M,Comparator:B,Range:F,satisfies:I,toComparators:L,maxSatisfying:C,minSatisfying:O,minVersion:k,validRange:N,outside:D,gtr:H,ltr:$,intersects:U,simplifyRange:Y,subset:Q,SemVer:r,re:t.re,
397
- src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Wn}var zn=yp();const Ye=ns(zn),wp=Object.prototype.toString,vp="[object Uint8Array]",$p="[object ArrayBuffer]";function za(t,e,r){return t?t.constructor===e?!0:wp.call(t)===r:!1}function Xa(t){return za(t,Uint8Array,vp)}function bp(t){return za(t,ArrayBuffer,$p)}function Ep(t){return Xa(t)||bp(t)}function Rp(t){if(!Xa(t))throw new TypeError(
398
- `Expected \`Uint8Array\`, got \`${typeof t}\``)}function Sp(t){if(!Ep(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function Ka(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((o,u)=>o+u.length,0);const r=new Uint8Array(e);let n=0;for(const o of t)Rp(o),r.set(o,n),n+=o.length;return r}const Ja={utf8:new globalThis.TextDecoder("utf8")};function Ya(t,e="utf8"){return Sp(t),Ja[e]??=new globalThis.TextDecoder(e),Ja[e].decode(t)}function Ap(t){if(typeof t!=
399
- "string")throw new TypeError(`Expected \`string\`, got \`${typeof t}\``)}const _p=new globalThis.TextEncoder;function Xn(t){return Ap(t),_p.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const Cp=qc.default,Qa="aes-256-cbc",Qe=()=>Object.create(null),xp=t=>t!=null,Tp=(t,e)=>{const r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},Kt="_\
400
- _internal__",Kn=`${Kt}.migrations.version`;class Lp{path;events;#s;#n;#t;#r={};constructor(e={}){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Dl(r.projectName,{suffix:r.projectSuffix}).config}if(this.#t=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError(
401
- "The `schema` option must be an object.");const s=new qf.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});Cp(s);const i={...r.rootSchema,type:"object",properties:r.schema};this.#s=s.compile(i);for(const[c,a]of Object.entries(r.schema??{}))a?.default&&(this.#r[c]=a.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#n=r.encryptionKey;const n=r.fileExtension?`.${r.
402
- fileExtension}`:"";this.path=X.resolve(r.cwd,`${r.configName??"config"}${n}`);const o=this.store,u=Object.assign(Qe(),r.defaults,o);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(u);try{fu.deepEqual(o,u)}catch{this.store=u}r.watch&&this._watch()}get(e,r){if(this.#t.accessPropertiesByDotNotation)return this._get(e,r);const{store:n}=this;return e in n?n[e]:r}set(e,r){
403
- if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${Kt} key, as it's used to manage this module internal operations.`);const{store:n}=this,o=(u,s)=>{Tp(u,s),this.#t.accessPropertiesByDotNotation?bo(n,u,s):n[u]=s};if(typeof e=="object"){const u=e;for(const[
404
- s,i]of Object.entries(u))o(s,i)}else o(e,r);this.store=n}has(e){return this.#t.accessPropertiesByDotNotation?Ol(this.store,e):e in this.store}reset(...e){for(const r of e)xp(this.#r[r])&&this.set(r,this.#r[r])}delete(e){const{store:r}=this;this.#t.accessPropertiesByDotNotation?Il(r,e):delete r[e],this.store=r}clear(){this.store=Qe();for(const e of Object.keys(this.#r))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);
405
- if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{const e=V.readFileSync(this.path,this.#n?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this.
406
- _validate(n),Object.assign(Qe(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Qe();if(this.#t.clearInvalidConfig&&e.name==="SyntaxError")return Qe();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#n)return typeof e=="string"?e:Ya(e);try{const r=e.slice(0,16),n=at.pbkdf2Sync(this.#n,r.toString(),1e4,32,
407
- "sha512"),o=at.createDecipheriv(Qa,n,r),u=e.slice(17),s=typeof u=="string"?Xn(u):u;return Ya(Ka([o.update(s),o.final()]))}catch{}return e.toString()}_handleChange(e,r){let n=e();const o=()=>{const u=n,s=e();lu(s,u)||(n=s,r.call(this,s,u))};return this.events.addEventListener("change",o),()=>{this.events.removeEventListener("change",o)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#s||this.#s(e)||!this.#s.errors)return;const n=this.#s.errors.map(({
408
- instancePath:o,message:u=""})=>`\`${o.slice(1)}\` ${u}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){V.mkdirSync(X.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#n){const n=at.randomBytes(16),o=at.pbkdf2Sync(this.#n,n.toString(),1e4,32,"sha512"),u=at.createCipheriv(Qa,o,n);r=Ka([n,Xn(":"),u.update(Xn(r)),u.final()])}if(se.env.SNAP)V.writeFileSync(this.path,r,{mode:this.#t.configFileMode});else try{_o(this.path,r,{mode:this.#t.configFileMode})}catch(n){
409
- if(n?.code==="EXDEV"){V.writeFileSync(this.path,r,{mode:this.#t.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),V.existsSync(this.path)||this._write(Qe()),se.platform==="win32"?V.watch(this.path,{persistent:!1},Yi(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):V.watchFile(this.path,{persistent:!1},Yi(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,r,n){let o=this._get(Kn,"0.0.0");const u=Object.keys(e).filter(i=>this._shouldPerformMigration(
410
- i,o,r));let s={...this.store};for(const i of u)try{n&&n(this,{fromVersion:o,toVersion:i,finalVersion:r,versions:u});const c=e[i];c?.(this),this._set(Kn,i),o=i,s={...this.store}}catch(c){throw this.store=s,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(o)||!Ye.eq(o,r))&&this._set(Kn,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Kt?!0:typeof e!="string"?
411
- !1:this.#t.accessPropertiesByDotNotation?!!e.startsWith(`${Kt}.`):!1}_isVersionInRangeFormat(e){return Ye.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Ye.satisfies(r,e)?!1:Ye.satisfies(n,e):!(Ye.lte(e,r)||Ye.gt(e,n))}_get(e,r){return kl(this.store,e,r)}_set(e,r){const{store:n}=this;bo(n,e,r),this.store=n}}class Jn extends Error{response;request;options;constructor(e,r,n){const o=e.status||e.status===0?e.status:"",u=e.statusText??"",s=`${o} ${u}`.
412
- trim(),i=s?`status code ${s}`:"an unknown error";super(`Request failed with ${i}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class Za extends Error{name="NonError";value;constructor(e){let r="Non-error value was thrown";try{typeof e=="string"?r=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(r=e.message)}catch{}super(r),this.value=e}}class Yn extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const r=e?.
413
- cause?e.cause instanceof Error?e.cause:new Za(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",r?{cause:r}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}const ec=(()=>{let t=!1,e=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content\
414
- -Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),kp=typeof globalThis.AbortController=="function",tc=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Ip=typeof globalThis.ReadableStream=="function",Op=typeof globalThis.FormData=="function",rc=["get","post","put","patch","head","delete"],Pp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"\
415
- */*"},Qn=2147483647,Np=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,nc=Symbol("stop");class sc{options;constructor(e){this.options=e}}const jp=t=>new sc(t),Dp={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},qp={next:!0},Hp={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,
416
- keepalive:!0,signal:!0,window:!0,duplex:!0},Mp=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[r,n]of t)e+=Np,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).
417
- length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{const e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},oc=(t,e,r)=>{let n,o=0;return t.pipeThrough(new TransformStream({transform(u,s){if(s.enqueue(u),n){o+=n.byteLength;let i=e===0?0:o/e;i>=1&&(i=1-Number.EPSILON),r?.({percent:i,totalBytes:Math.max(e,o),transferredBytes:o},n)}n=u},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},n))}}))},
418
- Up=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const r=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(oc(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Fp=(t,e,r)=>{if(!t.body)return t;const n=Mp(r??t.body);return new Request(t,{duplex:"half",body:oc(t.body,n,e)})},He=t=>t!==null&&typeof t=="object",Jt=(...t)=>{for(const e of t)if((!He(e)||Array.isArray(e))&&
419
- e!==void 0)throw new TypeError("The `options` argument must be an object");return Zn({},...t)},ic=(t={},e={})=>{const r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(const[u,s]of o.entries())n&&s==="undefined"||s===void 0?r.delete(u):r.set(u,s);return r};function Yt(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Zn(t[r]??[],e[r]??[])}const ac=(t={},e={})=>({beforeRequest:Yt(t,e,"beforeRequest"),beforeRetry:Yt(t,e,"beforeRetry"),afterResponse:Yt(t,
420
- e,"afterResponse"),beforeError:Yt(t,e,"beforeError")}),Gp=(t,e)=>{const r=new URLSearchParams;for(const n of[t,e])if(n!==void 0)if(n instanceof URLSearchParams)for(const[o,u]of n.entries())r.append(o,u);else if(Array.isArray(n))for(const o of n){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(o[0]),String(o[1]))}else if(He(n))for(const[o,u]of Object.entries(n))u!==void 0&&r.append(o,String(u));else{const o=new URLSearchParams(
421
- n);for(const[u,s]of o.entries())r.append(u,s)}return r},Zn=(...t)=>{let e={},r={},n={},o;const u=[];for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(He(s)){for(let[i,c]of Object.entries(s)){if(i==="signal"&&c instanceof globalThis.AbortSignal){u.push(c);continue}if(i==="context"){if(c!=null&&(!He(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(i==="searchParams"){c==
422
- null?o=void 0:o=o===void 0?c:Gp(o,c);continue}He(c)&&i in e&&(c=Zn(e[i],c)),e={...e,[i]:c}}He(s.hooks)&&(n=ac(n,s.hooks),e.hooks=n),He(s.headers)&&(r=ic(r,s.headers),e.headers=r)}return o!==void 0&&(e.searchParams=o),u.length>0&&(u.length===1?e.signal=u[0]:tc?e.signal=AbortSignal.any(u):e.signal=u.at(-1)),e.context===void 0&&(e.context={}),e},Bp=t=>rc.includes(t)?t.toUpperCase():t,Vp=["get","put","head","delete","options","trace"],Wp=[408,413,429,500,502,503,504],zp=[413,429,503],cc={limit:2,methods:Vp,
423
- statusCodes:Wp,afterStatusCodes:zp,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Xp=(t={})=>{if(typeof t=="number")return{...cc,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...cc,...t}};class es extends Error{request;constructor(e){super(`Request t\
424
- imed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}async function Kp(t,e,r,n){return new Promise((o,u)=>{const s=setTimeout(()=>{r&&r.abort(),u(new es(t))},n.timeout);n.fetch(t,e).then(o).catch(u).then(()=>{clearTimeout(s)})})}async function Jp(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(u),n(e.reason)}const u=setTimeout(()=>{e?.removeEventListener("abort",o),r()},t)})}const Yp=(t,e)=>{const r={};
425
- for(const n in e)Object.hasOwn(e,n)&&!(n in Hp)&&!(n in Dp)&&(!(n in t)||n in qp)&&(r[n]=e[n]);return r},Qp=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;function Zp(t){return t instanceof Jn||t?.name===Jn.name}function ed(t){return t instanceof es||t?.name===es.name}class ht{static create(e,r){const n=new ht(e,r),o=async()=>{if(typeof n.#e.timeout=="number"&&n.#e.timeout>Qn)throw new RangeError(
426
- `The \`timeout\` option cannot be greater than ${Qn}`);await Promise.resolve();let s=await n.#m();for(const i of n.#e.hooks.afterResponse){const c=n.#f(s.clone()),a=await i(n.request,n.#c(),c,{retryCount:n.#t});if(a instanceof globalThis.Response&&(s=a),a instanceof sc)throw await Promise.all([c.body?.cancel(),s.body?.cancel()]),new Yn(a.options)}if(n.#f(s),!s.ok&&(typeof n.#e.throwHttpErrors=="function"?n.#e.throwHttpErrors(s.status):n.#e.throwHttpErrors)){let i=new Jn(s,n.request,n.#c());for(const c of n.#e.
427
- hooks.beforeError)i=await c(i,{retryCount:n.#t});throw i}if(n.#e.onDownloadProgress){if(typeof n.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Ip)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Up(s.clone(),n.#e.onDownloadProgress)}return s},u=n.#p(o).finally(async()=>{const s=n.#i,i=[];s&&!s.bodyUsed&&i.push(s.body?.cancel()),n.request.bodyUsed||i.push(n.request.body?.cancel()),
428
- await Promise.all(i)});for(const[s,i]of Object.entries(Pp))s==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(u[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||i);const c=await u;if(s==="json"){if(c.status===204)return"";const a=await c.text();return a===""?"":r.parseJson?r.parseJson(a):JSON.parse(a)}return c[s]()});return u}static#s(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(
429
- e).filter(([,r])=>r!==void 0)):e}request;#n;#t=0;#r;#e;#i;#o;#a;constructor(e,r={}){if(this.#r=e,this.#e={...r,headers:ic(this.#r.headers,r.headers),hooks:ac({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Bp(r.method??this.#r.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Xp(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#r!="string"&&!(this.#r instanceof
430
- URL||this.#r instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#r=="string"){if(this.#r.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#r=this.#e.prefixUrl+this.#r}kp&&tc&&(this.#o=this.#e.signal??this.#r.signal,this.#n=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#n.signal]):
431
- this.#n.signal),ec&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#r instanceof globalThis.Request&&(Op&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=
432
- new globalThis.Request(this.#r,this.#e),Qp(this.#e.searchParams)){const u="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(ht.#s(this.#e.searchParams)).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,u);this.request=new globalThis.Request(s,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!ec)throw new Error("Request stream\
433
- s are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#d(this.request,this.#e.body??void 0)}}#u(){const e=this.#e.retry.delay(this.#t);let r=e;return this.#e.retry.jitter===!0?r=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(e),(!Number.isFinite(r)||r<0)&&(r=e)),Math.min(this.#e.retry.backoffLimit,r)}async#h(e){if(this.#t++,this.#t>this.#e.retry.limit)throw e;const r=e instanceof Error?e:new Za(e);if(r instanceof
434
- Yn)return r.customDelay??this.#u();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){const n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#t});if(n===!1)throw e;if(n===!0)return this.#u()}if(ed(e)&&!this.#e.retry.retryOnTimeout)throw e;if(Zp(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.
435
- get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(n)*1e3;Number.isNaN(o)?o=Date.parse(n)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());const u=this.#e.retry.maxRetryAfter??o;return o<u?o:u}if(e.response.status===413)throw e}return this.#u()}#f(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}async#p(e){try{
436
- return await e()}catch(r){const n=Math.min(await this.#h(r),Qn);if(this.#t<1)throw r;if(await Jp(n,this.#o?{signal:this.#o}:{}),r instanceof Yn&&r.customRequest){const o=this.#e.signal?new globalThis.Request(r.customRequest,{signal:this.#e.signal}):new globalThis.Request(r.customRequest);this.#l(o)}for(const o of this.#e.hooks.beforeRetry){const u=await o({request:this.request,options:this.#c(),error:r,retryCount:this.#t});if(u instanceof globalThis.Request){this.#l(u);break}if(u instanceof globalThis.
437
- Response)return u;if(u===nc)return}return this.#p(e)}}async#m(){this.#n?.signal.aborted&&(this.#n=new globalThis.AbortController,this.#e.signal=this.#o?AbortSignal.any([this.#o,this.#n.signal]):this.#n.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const r of this.#e.hooks.beforeRequest){const n=await r(this.request,this.#c(),{retryCount:this.#t});if(n instanceof Response)return n;if(n instanceof globalThis.Request){this.#l(n);break}}const e=Yp(this.request,
438
- this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,e):Kp(this.#i,e,this.#n,this.#e)}#c(){if(!this.#a){const{hooks:e,...r}=this.#e;this.#a=Object.freeze(r)}return this.#a}#l(e){this.#a=void 0,this.request=this.#d(e)}#d(e,r){return!this.#e.onUploadProgress||!e.body?e:Fp(e,this.#e.onUploadProgress,r??this.#e.body??void 0)}}const ts=t=>{const e=(r,n)=>ht.create(r,Jt(t,n));for(const r of rc)e[r]=(n,o)=>ht.create(n,Jt(t,o,{method:r}));return e.
439
- create=r=>ts(Jt(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),ts(Jt(t,r))),e.stop=nc,e.retry=jp,e},td=ts(),rs=new Lp({projectName:Hc,serialize:t=>Be.stringify(t,null,2),deserialize:t=>Be.parse(t)}),rd=1e3*60*60*24,uc="check-update";function nd(){if(Xc||Kc===uc)return;const t=rs.get("lastUpdateCheck"),e=rs.get("latestVersion");if(Mc(e)||Uc(t)||t+rd<Date.now())try{os("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:uc}}).catch(()=>{})}catch{}e&&zn.gt(e,Me)&&
440
- Te(["Update available: ",y.dim(Me),y.reset(" \u2192 "),y.green(e)].join(""))}async function sd(){try{const t=await od();fr(t,"No version found in latest npm"),rs.set({lastUpdateCheck:Date.now(),latestVersion:t}),zn.gt(t,Me)?Te(["Update available: ",y.dim(Me),y.reset(" \u2192 "),y.green(t)].join("")):Te(y.dim("Up to date: ")+" "+y.green(Me))}catch(t){ge.error(gt(t))}}async function od(){return(await td("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+jso\
441
- n; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).json()).version}const id=t=>t.command({command:"check-update",describe:"Check for updates",handler:async()=>{await sd()}});function ad(t,e){if(!e)return t.languageServices.projectsManager.ensureProjectId();const r=W(e);if(r===t.workspace)return t.languageServices.projectsManager.ensureProjectId();if(_e(r)&&Gc(r).isDirectory()){ge.debug`Project path exists: ${r}`;const n=rr.file(r.endsWith(ws)?r:r+ws),o=t.languageServices.projects().find(u=>u.
442
- folder.fsPath===n.fsPath);if(o)return ge.debug`Found project ${o.id} at path: ${r}`,o.id;ge.debug`No project registered at path: ${r}`}return t.languageServices.projectsManager.ensureProjectId(e)}function Qt(t,e){const r=ad(t,e),n=t.languageServices.projectsManager.getProject(r);return t.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var lc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),fc=t=>{throw TypeError(t)},cd=(t,e,r)=>{if(e!=
443
- null){typeof e!="object"&&typeof e!="function"&&fc("Object expected");var n,o;n=e[lc("asyncDispose")],n===void 0&&(n=e[lc("dispose")],o=n),typeof n!="function"&&fc("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push([r]);return e},ud=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},o=s=>e=r?new n(s,e,"An error was suppr\
444
- essed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){o(c)}if(r)throw e};return u()};const pt=ge.getChild("generator");async function pc({name:t,path:e,useDotBin:r,project:n}){var o=[];try{const c=Ue(pt),a=cd(o,await ye.fromWorkspace(e,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:l,config:f}=Qt(a,n);n&&pt.info(`${y.dim("project")} ${y.green(l)}`);const p=f.generators?.[t];if(!p)
445
- throw pt.error(y.red(`generator ${t} does not exist in project config`)),new Error(`generator ${t} does not exist in project config`);pt.info(`${y.dim("generator")} ${y.green(t)}`);const h=await a.layoutedModel(l);await ld({likec4:a,model:h,generator:p,logger:pt.getChild(t)}),c.stopAndLog()}catch(c){var u=c,s=!0}finally{var i=ud(o,u,s);i&&await i}}async function ld({likec4:t,model:e,generator:r,logger:n}){const o=t.languageServices,u=new Set,s=o.project(e.project.id),i=e.project.id;n.debug(`${y.
446
- dim("runnig for project:")} ${y.green(s.id)}`),await Promise.resolve().then(()=>r({likec4model:e,ctx:{workspace:t.languageServices.workspaceUri,project:s,locate:c=>{let a=null;switch(!0){case gu(c):a=o.locate({element:c.id,projectId:i});break;case mu(c):a=o.locate({view:c.id,projectId:i});break;case hu(c):a=o.locate({deployment:c.id,projectId:i});break;case du(c):case pu(c):a=o.locate({relation:c.id,projectId:i});break;default:pr(c)}if(!a)throw n.error(`Cannot locate ${c.id}`,{target:c}),new Error(
447
- `Cannot locate ${c.id}`);const l=rr.parse(a.uri);return{range:a.range,document:l,relativePath:nr.relative(s.folder,l),folder:nr.dirname(l).fsPath,filename:nr.basename(l)}},write:async({path:c,content:a})=>{let l;rr.isUri(c)?l=c.fsPath:l=W(s.folder.fsPath,...Array.isArray(c)?c:[c]);const f=Re(l);u.has(f)||(_e(f)||(n.debug(`${y.dim("create directory")} ${f}`),await Se(f,{recursive:!0})),u.add(f)),n.debug(`${y.dim("write")} ${l}`),await ke(l,a)},abort:c=>{throw n.error(c||"Generator aborted"),new Error(
448
- c||"Generator aborted")}}}))}async function fd(t,e,r){e=e??W(t.workspace,"likec4.generated.ts"),st(e)!==".ts"&&(e=e+".ts"),await Se(Re(e),{recursive:!0});const n=await t.diagrams(),o=tl([...n]);await ke(e,o),r.info(`${y.dim("generated")} ${Ce(process.cwd(),e)}`)}async function pd(t,e,r){await Se(e,{recursive:!0}),r.info(`${y.dim("format")} ${y.green("dot")}`),r.info(`${y.dim("outdir")} ${e}`);const n=new Set,o=t.computedModel(),u=ms(o.$data.views);let s=0;for(const i of u)try{const c=await t.viewsService.
449
- layouter.dot({view:i,styles:o.$styles});let a=".";i.sourcePath&&(a=Re(i.sourcePath)),a=W(e,a),n.has(a)||(await Se(a,{recursive:!0}),n.add(a));const l=W(a,i.id+".dot");await ke(l,c),r.info(`${y.dim("generated")} ${Ce(process.cwd(),l)}`),s++}catch(c){ge.error(`error while generating ${i.id}`,{error:c})}s>0&&r.info(`${y.dim("total")} ${s} files`)}async function dd(t,e,r,n){await Se(r,{recursive:!0}),n.info(`${y.dim("format")} ${y.green(e)}`),n.info(`${y.dim("outdir")} ${r}`);let o,u;switch(e){case"\
450
- d2":o=".d2",u=su;break;case"mermaid":o=".mmd",u=nu;break;case"plantuml":o=".puml",u=ru;break;default:pr(e)}const s=new Set,i=await t.layoutedModel();let c=0;for(const a of i.views()){const l=a.$view;try{let f=".";l.sourcePath&&(f=Re(l.sourcePath)),f=W(r,f),s.has(f)||(await Se(f,{recursive:!0}),s.add(f));const p=W(f,l.id+o),h=u(a);await ke(p,h),n.info(`${y.dim("generated")} ${Ce(process.cwd(),p)}`),c++}catch(f){n.error(`error while generating ${l.id}`,{error:f})}}c>0&&n.info(`${y.dim("total")} ${c}\
451
- files`)}async function dt({path:t,useDotBin:e,...r}){const n=ve("c4:codegen"),o=Ue(n),u=await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if(u.ensureSingleProject(),(await u.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await fd(u,r.outfile,n);break}case"dot":{await pd(u,r.outdir??t,n);break}case"d2":case"mermaid":case"plantuml":{await dd(u,r.format,r.outdir??t,n);break}default:
452
- pr(r)}o.stopAndLog()}var dc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),hc=t=>{throw TypeError(t)},hd=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&hc("Object expected");var n,o;n=e[dc("asyncDispose")],n===void 0&&(n=e[dc("dispose")],o=n),typeof n!="function"&&hc("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push([r]);return e},md=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){
453
- return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},o=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){o(c)}if(r)throw e};return u()};async function gd({path:t,useDotBin:e,useCorePackage:r,outfile:n,project:o}){var u=[];try{const a=ve("c4:codegen"),l=Ue(a),f=hd(u,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),
454
- !0),{projectId:p,projectFolder:h}=Qt(f,o);o&&a.info(`${y.dim("project")} ${y.green(p)}`),a.info(`${y.dim("format")} ${y.green("model")}`);const v=await f.layoutedModel(p);for(const d of v.views())d.hasLayoutDrifts&&a.warn(y.yellow("layout drift detected, view:")+" "+y.red(d.id));let w=W(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-model.ts");if(n&&(w=ir(n)?n:W(n),_e(n)&&(await ar(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const m=vt(w);a.info(`${y.dim(
455
- "filename")} ${m}`);const g=st(m).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(g))throw a.error(`output file ${n} has extension "${g}"`),new Error(`output file ${n} must be a .ts, .mts or .cts file`);const T=Re(w);a.info(`${y.dim("outdir")} ${T}`),await Se(T,{recursive:!0}),await ke(w,Zu(v,{useCorePackage:r}),{encoding:"utf-8"}),l.stopAndLog(),Te(sr(`
396
+ b.minor&&x.semver.patch===b.patch&&(b=!1),x.operator===">"||x.operator===">="){if(T=u(w,x,h),T===x&&T!==w)return!1}else if(w.operator===">="&&!n(w.semver,String(x),h))return!1}if(m){if(A&&x.semver.prerelease&&x.semver.prerelease.length&&x.semver.major===A.major&&x.semver.minor===A.minor&&x.semver.patch===A.patch&&(A=!1),x.operator==="<"||x.operator==="<="){if(d=l(m,x,h),d===x&&d!==m)return!1}else if(m.operator==="<="&&!n(m.semver,String(x),h))return!1}if(!x.operator&&(m||w)&&g!==0)return!1}return!(w&&
397
+ S&&!m&&g!==0||m&&E&&!w&&g!==0||b||A)},u=(f,p,h)=>{if(!f)return p;const v=i(f.semver,p.semver,h);return v>0?f:v<0||p.operator===">"&&f.operator===">="?p:f},l=(f,p,h)=>{if(!f)return p;const v=i(f.semver,p.semver,h);return v<0?f:v>0||p.operator==="<"&&f.operator==="<="?p:f};return Xn=a,Xn}var Kn,tc;function bp(){if(tc)return Kn;tc=1;const t=pt(),e=zt(),r=de(),n=pa(),i=Ze(),a=Jf(),s=Qf(),o=Zf(),c=ep(),u=tp(),l=rp(),f=np(),p=sp(),h=be(),v=ip(),w=op(),m=vn(),g=ap(),T=cp(),d=Xt(),S=Sn(),E=La(),A=Na(),b=xn(),
398
+ x=In(),q=qa(),M=up(),V=Kt(),F=Ee(),L=Yt(),I=fp(),C=pp(),k=dp(),O=hp(),P=mp(),D=Gn(),H=gp(),$=yp(),U=wp(),J=vp(),Q=$p();return Kn={parse:i,valid:a,clean:s,inc:o,diff:c,major:u,minor:l,patch:f,prerelease:p,compare:h,rcompare:v,compareLoose:w,compareBuild:m,sort:g,rsort:T,gt:d,lt:S,eq:E,neq:A,gte:b,lte:x,cmp:q,coerce:M,Comparator:V,Range:F,satisfies:L,toComparators:I,maxSatisfying:C,minSatisfying:k,minVersion:O,validRange:P,outside:D,gtr:H,ltr:$,intersects:U,simplifyRange:J,subset:Q,SemVer:r,re:t.re,
399
+ src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Kn}var Yn=bp();const et=cs(Yn),Ep=Object.prototype.toString,Rp="[object Uint8Array]",Sp="[object ArrayBuffer]";function rc(t,e,r){return t?t.constructor===e?!0:Ep.call(t)===r:!1}function nc(t){return rc(t,Uint8Array,Rp)}function Ap(t){return rc(t,ArrayBuffer,Sp)}function _p(t){return nc(t)||Ap(t)}function Cp(t){if(!nc(t))throw new TypeError(
400
+ `Expected \`Uint8Array\`, got \`${typeof t}\``)}function xp(t){if(!_p(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function Jn(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(e);let n=0;for(const i of t)Cp(i),r.set(i,n),n+=i.length;return r}const sc={utf8:new globalThis.TextDecoder("utf8")};function Jt(t,e="utf8"){return xp(t),sc[e]??=new globalThis.TextDecoder(e),sc[e].decode(t)}function Tp(t){if(typeof t!=
401
+ "string")throw new TypeError(`Expected \`string\`, got \`${typeof t}\``)}const Ip=new globalThis.TextEncoder;function Qt(t){return Tp(t),Ip.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const Qn="aes-256-cbc",De=()=>Object.create(null),ic=t=>t!==void 0,Zn=(t,e)=>{const r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},qe="__internal__",
402
+ es=`${qe}.migrations.version`;class Op{path;events;#a;#n;#r;#t={};#e=!1;#o;#i;#s;constructor(e={}){const r=this.#u(e);this.#r=r,this.#h(r),this.#p(r),this.#m(r),this.events=new EventTarget,this.#n=r.encryptionKey,this.path=this.#c(r),this.#l(r),r.watch&&this._watch()}get(e,r){if(this.#r.accessPropertiesByDotNotation)return this._get(e,r);const{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`objec\
403
+ t\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${qe} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(a,s)=>{if(Zn(a,s),this.#r.accessPropertiesByDotNotation)Ot(n,a,s);else{if(a==="__proto__"||a==="constructor"||a==="prototype")return;n[a]=s}};if(typeof e=="object"){const a=e;for(const[s,o]of Object.entries(a))i(s,o)}else i(
404
+ e,r);this.store=n}has(e){return this.#r.accessPropertiesByDotNotation?Kr(this.store,e):e in this.store}appendToArray(e,r){Zn(e,r);const n=this.#r.accessPropertiesByDotNotation?this._get(e,[]):e in this.store?this.store[e]:[];if(!Array.isArray(n))throw new TypeError(`The key \`${e}\` is already set to a non-array value`);this.set(e,[...n,r])}reset(...e){for(const r of e)ic(this.#t[r])&&this.set(r,this.#t[r])}delete(e){const{store:r}=this;this.#r.accessPropertiesByDotNotation?Dl(r,e):delete r[e],this.
405
+ store=r}clear(){const e=De();for(const r of Object.keys(this.#t))ic(this.#t[r])&&(Zn(r,this.#t[r]),this.#r.accessPropertiesByDotNotation?Ot(e,r,this.#t[r]):e[r]=this.#t[r]);this.store=e}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleValueChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!=
406
+ "function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleStoreChange(e)}get size(){return Object.keys(this.store).filter(r=>!this._isReservedKeyPath(r)).length}get store(){try{const e=B.readFileSync(this.path,this.#n?null:"utf8"),r=this._decryptData(e),n=this._deserialize(r);return this.#e||this._validate(n),Object.assign(De(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),De();if(this.#r.clearInvalidConfig){const r=e;
407
+ if(r.name==="SyntaxError"||r.message?.startsWith("Config schema violation:"))return De()}throw e}}set store(e){if(this._ensureDirectory(),!Kr(e,qe))try{const r=B.readFileSync(this.path,this.#n?null:"utf8"),n=this._decryptData(r),i=this._deserialize(n);Kr(i,qe)&&Ot(e,qe,Ti(i,qe))}catch{}this.#e||this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))this._isReservedKeyPath(e)||(yield[e,r])}_closeWatcher(){this.#o&&
408
+ (this.#o.close(),this.#o=void 0),this.#i&&(B.unwatchFile(this.path),this.#i=!1),this.#s=void 0}_decryptData(e){if(!this.#n)return typeof e=="string"?e:Jt(e);try{const r=e.slice(0,16),n=Me.pbkdf2Sync(this.#n,r,1e4,32,"sha512"),i=Me.createDecipheriv(Qn,n,r),a=e.slice(17),s=typeof a=="string"?Qt(a):a;return Jt(Jn([i.update(s),i.final()]))}catch{try{const r=e.slice(0,16),n=Me.pbkdf2Sync(this.#n,r.toString(),1e4,32,"sha512"),i=Me.createDecipheriv(Qn,n,r),a=e.slice(17),s=typeof a=="string"?Qt(a):a;return Jt(
409
+ Jn([i.update(s),i.final()]))}catch{}}return typeof e=="string"?e:Jt(e)}_handleStoreChange(e){let r=this.store;const n=()=>{const i=r,a=this.store;Is(a,i)||(r=a,e.call(this,a,i))};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_handleValueChange(e,r){let n=e();const i=()=>{const a=n,s=e();Is(s,a)||(n=s,r.call(this,s,a))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.
410
+ stringify(e,void 0," ");_validate(e){if(!this.#a||this.#a(e)||!this.#a.errors)return;const n=this.#a.errors.map(({instancePath:i,message:a=""})=>`\`${i.slice(1)}\` ${a}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){B.mkdirSync(W.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#n){const n=Me.randomBytes(16),i=Me.pbkdf2Sync(this.#n,n,1e4,32,"sha512"),a=Me.createCipheriv(Qn,i,n);r=Jn([n,Qt(":"),a.update(Qt(r)),a.final()])}if(re.env.SNAP)
411
+ B.writeFileSync(this.path,r,{mode:this.#r.configFileMode});else try{Ni(this.path,r,{mode:this.#r.configFileMode})}catch(n){if(n?.code==="EXDEV"){B.writeFileSync(this.path,r,{mode:this.#r.configFileMode});return}throw n}}_watch(){if(this._ensureDirectory(),B.existsSync(this.path)||this._write(De()),re.platform==="win32"||re.platform==="darwin"){this.#s??=oa(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100});const e=W.dirname(this.path),r=W.basename(this.path);this.#o=B.watch(e,{persistent:!1,
412
+ encoding:"utf8"},(n,i)=>{i&&i!==r||typeof this.#s=="function"&&this.#s()})}else this.#s??=oa(()=>{this.events.dispatchEvent(new Event("change"))},{wait:1e3}),B.watchFile(this.path,{persistent:!1},(e,r)=>{typeof this.#s=="function"&&this.#s()}),this.#i=!0}_migrate(e,r,n){let i=this._get(es,"0.0.0");const a=Object.keys(e).filter(o=>this._shouldPerformMigration(o,i,r));let s=structuredClone(this.store);for(const o of a)try{n&&n(this,{fromVersion:i,toVersion:o,finalVersion:r,versions:a});const c=e[o];
413
+ c?.(this),this._set(es,o),i=o,s=structuredClone(this.store)}catch(c){this.store=s;try{this._write(s)}catch{}const u=c instanceof Error?c.message:String(c);throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!et.eq(i,r))&&this._set(es,r)}_containsReservedKey(e){return typeof e=="string"?this._isReservedKeyPath(e):!e||typeof e!="object"?!1:this._objectContainsReservedKey(e)}_objectContainsReservedKey(e){
414
+ if(!e||typeof e!="object")return!1;for(const[r,n]of Object.entries(e))if(this._isReservedKeyPath(r)||this._objectContainsReservedKey(n))return!0;return!1}_isReservedKeyPath(e){return e===qe||e.startsWith(`${qe}.`)}_isVersionInRangeFormat(e){return et.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&et.satisfies(r,e)?!1:et.satisfies(n,e):!(et.lte(e,r)||et.gt(e,n))}_get(e,r){return Ti(this.store,e,r)}_set(e,r){const{store:n}=this;Ot(n,e,r),this.store=
415
+ n}#u(e){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Ul(r.projectName,{suffix:r.projectSuffix}).config}return typeof r.fileExtension=="string"&&(r.fileExtension=r.fileExtension.replace(/^\.+/,"")),r}#h(e){if(!(e.schema??e.ajvOptions??e.rootSchema))return;if(e.schema&&typeof e.schema!="object")throw new TypeError(
416
+ "The `schema` option must be an object.");const r=Vc.default,n=new Ff.Ajv2020({allErrors:!0,useDefaults:!0,...e.ajvOptions});r(n);const i={...e.rootSchema,type:"object",properties:e.schema};this.#a=n.compile(i),this.#f(e.schema)}#f(e){const r=Object.entries(e??{});for(const[n,i]of r){if(!i||typeof i!="object"||!Object.hasOwn(i,"default"))continue;const{default:a}=i;a!==void 0&&(this.#t[n]=a)}}#p(e){e.defaults&&Object.assign(this.#t,e.defaults)}#m(e){e.serialize&&(this._serialize=e.serialize),e.deserialize&&
417
+ (this._deserialize=e.deserialize)}#c(e){const r=typeof e.fileExtension=="string"?e.fileExtension:void 0,n=r?`.${r}`:"";return W.resolve(e.cwd,`${e.configName??"config"}${n}`)}#l(e){if(e.migrations){this.#d(e),this._validate(this.store);return}const r=this.store,n=Object.assign(De(),e.defaults??{},r);this._validate(n);try{Os.deepEqual(r,n)}catch{this.store=n}}#d(e){const{migrations:r,projectVersion:n}=e;if(r){if(!n)throw new Error("Please specify the `projectVersion` option.");this.#e=!0;try{const i=this.
418
+ store,a=Object.assign(De(),e.defaults??{},i);try{Os.deepEqual(i,a)}catch{this._write(a)}this._migrate(r,n,e.beforeEachMigration)}finally{this.#e=!1}}}}class ts extends Error{response;request;options;constructor(e,r,n){const i=e.status||e.status===0?e.status:"",a=e.statusText??"",s=`${i} ${a}`.trim(),o=s?`status code ${s}`:"an unknown error";super(`Request failed with ${o}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class oc extends Error{name="Non\
419
+ Error";value;constructor(e){let r="Non-error value was thrown";try{typeof e=="string"?r=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(r=e.message)}catch{}super(r),this.value=e}}class rs extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const r=e?.cause?e.cause instanceof Error?e.cause:new oc(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",r?{cause:r}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=
420
+ e?.request}}const ac=(()=>{let t=!1,e=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),Lp=typeof globalThis.AbortController=="function",cc=typeof globalThis.AbortSignal=="fu\
421
+ nction"&&typeof globalThis.AbortSignal.any=="function",kp=typeof globalThis.ReadableStream=="function",Np=typeof globalThis.FormData=="function",uc=["get","post","put","patch","head","delete"],Pp={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},ns=2147483647,jp=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,lc=Symbol("stop");class fc{options;constructor(e){this.options=e}}const Dp=t=>new fc(t),qp={json:!0,
422
+ parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Hp={next:!0},Mp={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Up=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(const[r,n]of t)e+=jp,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).
423
+ length,e+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{const e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},pc=(t,e,r)=>{let n,
424
+ i=0;return t.pipeThrough(new TransformStream({transform(a,s){if(s.enqueue(a),n){i+=n.byteLength;let o=e===0?0:i/e;o>=1&&(o=1-Number.EPSILON),r?.({percent:o,totalBytes:Math.max(e,i),transferredBytes:i},n)}n=a},flush(){n&&(i+=n.byteLength,r?.({percent:1,totalBytes:Math.max(e,i),transferredBytes:i},n))}}))},Fp=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});const r=Math.max(0,Number(t.headers.get("content-length"))||
425
+ 0);return new Response(pc(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Gp=(t,e,r)=>{if(!t.body)return t;const n=Up(r??t.body);return new Request(t,{duplex:"half",body:pc(t.body,n,e)})},Fe=t=>t!==null&&typeof t=="object",Zt=(...t)=>{for(const e of t)if((!Fe(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return ss({},...t)},dc=(t={},e={})=>{const r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.
426
+ Headers(e);for(const[a,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(a):r.set(a,s);return r};function er(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:ss(t[r]??[],e[r]??[])}const hc=(t={},e={})=>({beforeRequest:er(t,e,"beforeRequest"),beforeRetry:er(t,e,"beforeRetry"),afterResponse:er(t,e,"afterResponse"),beforeError:er(t,e,"beforeError")}),Bp=(t,e)=>{const r=new URLSearchParams;for(const n of[t,e])if(n!==void 0)if(n instanceof URLSearchParams)for(const[i,a]of n.entries())r.append(
427
+ i,a);else if(Array.isArray(n))for(const i of n){if(!Array.isArray(i)||i.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(i[0]),String(i[1]))}else if(Fe(n))for(const[i,a]of Object.entries(n))a!==void 0&&r.append(i,String(a));else{const i=new URLSearchParams(n);for(const[a,s]of i.entries())r.append(a,s)}return r},ss=(...t)=>{let e={},r={},n={},i;const a=[];for(const s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(Fe(
428
+ s)){for(let[o,c]of Object.entries(s)){if(o==="signal"&&c instanceof globalThis.AbortSignal){a.push(c);continue}if(o==="context"){if(c!=null&&(!Fe(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(o==="searchParams"){c==null?i=void 0:i=i===void 0?c:Bp(i,c);continue}Fe(c)&&o in e&&(c=ss(e[o],c)),e={...e,[o]:c}}Fe(s.hooks)&&(n=hc(n,s.hooks),e.hooks=n),Fe(s.headers)&&(r=dc(r,s.headers),e.headers=r)}return i!==
429
+ void 0&&(e.searchParams=i),a.length>0&&(a.length===1?e.signal=a[0]:cc?e.signal=AbortSignal.any(a):e.signal=a.at(-1)),e.context===void 0&&(e.context={}),e},Vp=t=>uc.includes(t)?t.toUpperCase():t,zp=["get","put","head","delete","options","trace"],Wp=[408,413,429,500,502,503,504],Xp=[413,429,503],mc={limit:2,methods:zp,statusCodes:Wp,afterStatusCodes:Xp,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Kp=(t={})=>{
430
+ if(typeof t=="number")return{...mc,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");const e=Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0));return{...mc,...e}};class is extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}async function Yp(t,e,r,n){return new Promise(
431
+ (i,a)=>{const s=setTimeout(()=>{r&&r.abort(),a(new is(t))},n.timeout);n.fetch(t,e).then(i).catch(a).then(()=>{clearTimeout(s)})})}async function Jp(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(e.reason)}const a=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}const Qp=(t,e)=>{const r={};for(const n in e)Object.hasOwn(e,n)&&!(n in Mp)&&!(n in qp)&&(!(n in t)||n in Hp)&&(r[n]=e[n]);return r},Zp=t=>t===
432
+ void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;function ed(t){return t instanceof ts||t?.name===ts.name}function td(t){return t instanceof is||t?.name===is.name}class mt{static create(e,r){const n=new mt(e,r),i=async()=>{if(typeof n.#e.timeout=="number"&&n.#e.timeout>ns)throw new RangeError(`The \`timeout\` option cannot be greater than ${ns}`);await Promise.resolve();let s=await n.#m();
433
+ for(const o of n.#e.hooks.afterResponse){const c=n.#f(s.clone()),u=await o(n.request,n.#c(),c,{retryCount:n.#r});if(u instanceof globalThis.Response&&(s=u),u instanceof fc)throw await Promise.all([c.body?.cancel(),s.body?.cancel()]),new rs(u.options)}if(n.#f(s),!s.ok&&(typeof n.#e.throwHttpErrors=="function"?n.#e.throwHttpErrors(s.status):n.#e.throwHttpErrors)){let o=new ts(s,n.request,n.#c());for(const c of n.#e.hooks.beforeError)o=await c(o,{retryCount:n.#r});throw o}if(n.#e.onDownloadProgress){
434
+ if(typeof n.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!kp)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Fp(s.clone(),n.#e.onDownloadProgress)}return s},a=n.#p(i).finally(async()=>{const s=n.#o,o=[];s&&!s.bodyUsed&&o.push(s.body?.cancel()),n.request.bodyUsed||o.push(n.request.body?.cancel()),await Promise.all(o)});for(const[s,o]of Object.entries(Pp))s==="bytes"&&typeof globalThis.
435
+ Response?.prototype?.bytes!="function"||(a[s]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const c=await a;if(s==="json"){if(c.status===204)return"";const u=await c.text();return u===""?"":r.parseJson?r.parseJson(u):JSON.parse(u)}return c[s]()});return a}static#a(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)):e}request;#n;#r=0;#t;#e;#o;#i;#s;constructor(e,r={}){if(this.#t=
436
+ e,this.#e={...r,headers:dc(this.#t.headers,r.headers),hooks:hc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Vp(r.method??this.#t.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Kp(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a stri\
437
+ ng, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Lp&&cc&&(this.#i=this.#e.signal??this.#t.signal,this.#n=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#n.signal]):this.#n.signal),ac&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=
438
+ this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(Np&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!n&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),Zp(this.#e.searchParams)){const a="?"+
439
+ (typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(mt.#a(this.#e.searchParams)).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,a);this.request=new globalThis.Request(s,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!ac)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is \
440
+ not available.");this.request=this.#d(this.request,this.#e.body??void 0)}}#u(){const e=this.#e.retry.delay(this.#r);let r=e;this.#e.retry.jitter===!0?r=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(e),(!Number.isFinite(r)||r<0)&&(r=e));const n=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(n,r)}async#h(e){if(this.#r++,this.#r>this.#e.retry.limit)throw e;const r=e instanceof Error?e:new oc(e);if(r instanceof rs)return r.customDelay??this.#u();
441
+ if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){const n=await this.#e.retry.shouldRetry({error:r,retryCount:this.#r});if(n===!1)throw e;if(n===!0)return this.#u()}if(td(e)&&!this.#e.retry.retryOnTimeout)throw e;if(ed(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.
442
+ headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const a=this.#e.retry.maxRetryAfter??i;return i<a?i:a}if(e.response.status===413)throw e}return this.#u()}#f(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}async#p(e){try{return await e()}catch(r){const n=Math.min(
443
+ await this.#h(r),ns);if(this.#r<1)throw r;if(await Jp(n,this.#i?{signal:this.#i}:{}),r instanceof rs&&r.customRequest){const i=this.#e.signal?new globalThis.Request(r.customRequest,{signal:this.#e.signal}):new globalThis.Request(r.customRequest);this.#l(i)}for(const i of this.#e.hooks.beforeRetry){const a=await i({request:this.request,options:this.#c(),error:r,retryCount:this.#r});if(a instanceof globalThis.Request){this.#l(a);break}if(a instanceof globalThis.Response)return a;if(a===lc)return}return this.#p(
444
+ e)}}async#m(){this.#n?.signal.aborted&&(this.#n=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#n.signal]):this.#n.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(const r of this.#e.hooks.beforeRequest){const n=await r(this.request,this.#c(),{retryCount:this.#r});if(n instanceof Response)return n;if(n instanceof globalThis.Request){this.#l(n);break}}const e=Qp(this.request,this.#e);return this.#o=this.request,this.request=
445
+ this.#o.clone(),this.#e.timeout===!1?this.#e.fetch(this.#o,e):Yp(this.#o,e,this.#n,this.#e)}#c(){if(!this.#s){const{hooks:e,...r}=this.#e;this.#s=Object.freeze(r)}return this.#s}#l(e){this.#s=void 0,this.request=this.#d(e)}#d(e,r){return!this.#e.onUploadProgress||!e.body?e:Gp(e,this.#e.onUploadProgress,r??this.#e.body??void 0)}}const os=t=>{const e=(r,n)=>mt.create(r,Zt(t,n));for(const r of uc)e[r]=(n,i)=>mt.create(n,Zt(t,i,{method:r}));return e.create=r=>os(Zt(r)),e.extend=r=>(typeof r=="functi\
446
+ on"&&(r=r(t??{})),os(Zt(t,r))),e.stop=lc,e.retry=Dp,e},rd=os(),as=new Op({projectName:zc,serialize:t=>We.stringify(t,null,2),deserialize:t=>We.parse(t)}),nd=1e3*60*60*24,gc="check-update";function sd(){if(tu||ru===gc)return;const t=as.get("lastUpdateCheck"),e=as.get("latestVersion");if(Wc(e)||Xc(t)||t+nd<Date.now())try{ls("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:gc}}).catch(()=>{})}catch{}e&&Yn.gt(e,Ge)&&Te(["Update available: ",y.dim(Ge),y.reset(" \u2192 "),
447
+ y.green(e)].join(""))}async function id(){try{const t=await od();hr(t,"No version found in latest npm"),as.set({lastUpdateCheck:Date.now(),latestVersion:t}),Yn.gt(t,Ge)?Te(["Update available: ",y.dim(Ge),y.reset(" \u2192 "),y.green(t)].join("")):Te(y.dim("Up to date: ")+" "+y.green(Ge))}catch(t){ge.error(yt(t))}}async function od(){return(await rd("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).
448
+ json()).version}const ad=t=>t.command({command:"check-update",describe:"Check for updates",handler:async()=>{await id()}});function cd(t,e){if(!e)return t.languageServices.projectsManager.ensureProjectId();const r=z(e);if(r===t.workspace)return t.languageServices.projectsManager.ensureProjectId();if(_e(r)&&Yc(r).isDirectory()){ge.debug`Project path exists: ${r}`;const n=ir.file(r.endsWith(Rs)?r:r+Rs),i=t.languageServices.projects().find(a=>a.folder.fsPath===n.fsPath);if(i)return ge.debug`Found project ${i.
449
+ id} at path: ${r}`,i.id;ge.debug`No project registered at path: ${r}`}return t.languageServices.projectsManager.ensureProjectId(e)}function tr(t,e){const r=cd(t,e),n=t.languageServices.projectsManager.getProject(r);return t.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var yc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),wc=t=>{throw TypeError(t)},ud=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&wc("Object ex\
450
+ pected");var n,i;n=e[yc("asyncDispose")],n===void 0&&(n=e[yc("dispose")],i=n),typeof n!="function"&&wc("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push([r]);return e},ld=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=s,u.suppressed=o,u},i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&
451
+ s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){i(c)}if(r)throw e};return a()};const dt=ge.getChild("generator");async function vc({name:t,path:e,useDotBin:r,project:n}){var i=[];try{const c=Be(dt),u=ud(i,await ye.fromWorkspace(e,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:l,config:f}=tr(u,n);n&&dt.info(`${y.dim("project")} ${y.green(l)}`);const p=f.generators?.[t];if(!p)throw dt.error(y.red(`generator ${t} does not exist in project config`)),
452
+ new Error(`generator ${t} does not exist in project config`);dt.info(`${y.dim("generator")} ${y.green(t)}`);const h=await u.layoutedModel(l);await fd({likec4:u,model:h,generator:p,logger:dt.getChild(t)}),c.stopAndLog()}catch(c){var a=c,s=!0}finally{var o=ld(i,a,s);o&&await o}}async function fd({likec4:t,model:e,generator:r,logger:n}){const i=t.languageServices,a=new Set,s=i.project(e.project.id),o=e.project.id;n.debug(`${y.dim("runnig for project:")} ${y.green(s.id)}`),await Promise.resolve().then(
453
+ ()=>r({likec4model:e,ctx:{workspace:t.languageServices.workspaceUri,project:s,locate:c=>{let u=null;switch(!0){case bu(c):u=i.locate({element:c.id,projectId:o});break;case $u(c):u=i.locate({view:c.id,projectId:o});break;case vu(c):u=i.locate({deployment:c.id,projectId:o});break;case wu(c):case yu(c):u=i.locate({relation:c.id,projectId:o});break;default:mr(c)}if(!u)throw n.error(`Cannot locate ${c.id}`,{target:c}),new Error(`Cannot locate ${c.id}`);const l=ir.parse(u.uri);return{range:u.range,document:l,
454
+ relativePath:or.relative(s.folder,l),folder:or.dirname(l).fsPath,filename:or.basename(l)}},write:async({path:c,content:u})=>{let l;ir.isUri(c)?l=c.fsPath:l=z(s.folder.fsPath,...Array.isArray(c)?c:[c]);const f=Re(l);a.has(f)||(_e(f)||(n.debug(`${y.dim("create directory")} ${f}`),await Se(f,{recursive:!0})),a.add(f)),n.debug(`${y.dim("write")} ${l}`),await Oe(l,u)},abort:c=>{throw n.error(c||"Generator aborted"),new Error(c||"Generator aborted")}}}))}async function pd(t,e,r){e=e??z(t.workspace,"li\
455
+ kec4.generated.ts"),ot(e)!==".ts"&&(e=e+".ts"),await Se(Re(e),{recursive:!0});const n=await t.diagrams(),i=ol([...n]);await Oe(e,i),r.info(`${y.dim("generated")} ${Ce(process.cwd(),e)}`)}async function dd(t,e,r){await Se(e,{recursive:!0}),r.info(`${y.dim("format")} ${y.green("dot")}`),r.info(`${y.dim("outdir")} ${e}`);const n=new Set,i=t.computedModel(),a=$s(i.$data.views);let s=0;for(const o of a)try{const c=await t.viewsService.layouter.dot({view:o,styles:i.$styles});let u=".";o.sourcePath&&(u=
456
+ Re(o.sourcePath)),u=z(e,u),n.has(u)||(await Se(u,{recursive:!0}),n.add(u));const l=z(u,o.id+".dot");await Oe(l,c),r.info(`${y.dim("generated")} ${Ce(process.cwd(),l)}`),s++}catch(c){ge.error(`error while generating ${o.id}`,{error:c})}s>0&&r.info(`${y.dim("total")} ${s} files`)}async function hd(t,e,r,n){await Se(r,{recursive:!0}),n.info(`${y.dim("format")} ${y.green(e)}`),n.info(`${y.dim("outdir")} ${r}`);let i,a;switch(e){case"d2":i=".d2",a=fu;break;case"mermaid":i=".mmd",a=lu;break;case"plant\
457
+ uml":i=".puml",a=uu;break;default:mr(e)}const s=new Set,o=await t.layoutedModel();let c=0;for(const u of o.views()){const l=u.$view;try{let f=".";l.sourcePath&&(f=Re(l.sourcePath)),f=z(r,f),s.has(f)||(await Se(f,{recursive:!0}),s.add(f));const p=z(f,l.id+i),h=a(u);await Oe(p,h),n.info(`${y.dim("generated")} ${Ce(process.cwd(),p)}`),c++}catch(f){n.error(`error while generating ${l.id}`,{error:f})}}c>0&&n.info(`${y.dim("total")} ${c} files`)}async function ht({path:t,useDotBin:e,...r}){const n=ve(
458
+ "c4:codegen"),i=Be(n),a=await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if(a.ensureSingleProject(),(await a.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await pd(a,r.outfile,n);break}case"dot":{await dd(a,r.outdir??t,n);break}case"d2":case"mermaid":case"plantuml":{await hd(a,r.format,r.outdir??t,n);break}default:mr(r)}i.stopAndLog()}var $c=(t,e)=>(e=Symbol[t])?e:Symbol.for(
459
+ "Symbol."+t),bc=t=>{throw TypeError(t)},md=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&bc("Object expected");var n,i;n=e[$c("asyncDispose")],n===void 0&&(n=e[$c("dispose")],i=n),typeof n!="function"&&bc("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push([r]);return e},gd=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=
460
+ s,u.suppressed=o,u},i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){i(c)}if(r)throw e};return a()};async function yd({path:t,useDotBin:e,useCorePackage:r,outfile:n,project:i}){var a=[];try{const u=ve("c4:codegen"),l=Be(u),f=md(a,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),!0),{projectId:p,projectFolder:h}=tr(f,i);i&&u.info(
461
+ `${y.dim("project")} ${y.green(p)}`),u.info(`${y.dim("format")} ${y.green("model")}`);const v=await f.layoutedModel(p);for(const d of v.views())d.hasLayoutDrifts&&u.warn(y.yellow("layout drift detected, view:")+" "+y.red(d.id));let w=z(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-model.ts");if(n&&(w=ur(n)?n:z(n),_e(n)&&(await lr(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const m=$t(w);u.info(`${y.dim("filename")} ${m}`);const g=ot(m).toLocaleLowerCase();
462
+ if(![".ts",".mts",".cts"].includes(g))throw u.error(`output file ${n} has extension "${g}"`),new Error(`output file ${n} must be a .ts, .mts or .cts file`);const T=Re(w);u.info(`${y.dim("outdir")} ${T}`),await Se(T,{recursive:!0}),await Oe(w,sl(v,{useCorePackage:r}),{encoding:"utf-8"}),l.stopAndLog(),Te(ar(`
456
463
  ${y.dim("Source generated:")}
457
- ${Ce(wt(),w)}
464
+ ${Ce(vt(),w)}
458
465
 
459
466
  ${y.dim("How to use:")}
460
467
  ${y.underline("https://likec4.dev/tooling/code-generation/model/")}
461
- `).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(a){var s=a,i=!0}finally{var c=md(u,s,i);c&&await c}}async function yd({languageServices:t,outDir:e,filename:r="likec4-react.mjs"}){const n=ve(["vite","react"]),o=yr();return n.info(`${y.cyan("likec4 app root")} ${y.dim(o)}`),n.info(y.cyan("outDir")+" "+y.dim(e)),{customLogger:n,root:o,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:$r()},esbuild:{banner:`'use client'
462
- `+gr.banner,footer:gr.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:vr,lib:{entry:"react/likec4.tsx",fileName(u,s){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/mode\
463
- l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(u,s){u.code!=="SOURCEMAP_ERROR"&&s(u)}}},plugins:[cr({}),lr({languageServices:t.languageServices,useOverviewGraph:!1})]}}var mc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),gc=t=>{throw TypeError(t)},wd=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&gc("Object expected");var n,o;n=e[mc("asyncDispose")],n===void 0&&(n=e[mc("dispose")],o=n),typeof n!=
464
- "function"&&gc("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push([r]);return e},vd=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},o=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){
465
- o(c)}if(r)throw e};return u()};async function $d({path:t,useDotBin:e,useCorePackage:r,outfile:n,project:o}){var u=[];try{await ut();const a=ve("c4:codegen"),l=Ue(a),f=wd(u,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),!0),{projectId:p,projectFolder:h}=Qt(f,o);o&&a.info(`${y.dim("project")} ${y.green(p)}`),a.info(`${y.dim("format")} ${y.green("react")}`);const v=await f.diagrams(p);if(v.length===0)throw process.exitCode=1,new Error("no views found");v.forEach(A=>{if(A.
466
- drifts&&A.drifts.length>0){a.info(y.yellow("layout drift detected, view:")+" "+y.red(A.id));return}if(A.hasLayoutDrift){a.warn(y.yellow("drift detected, manual layout can not be applied, view:")+" "+y.red(A.id));return}});let w=W(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-views.js");if(n&&(w=ir(n)?n:W(n),_e(n)&&(await ar(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const m=Re(w);a.info(`${y.dim("outdir")} ${m}`);const g=vt(w);a.info(`${y.dim("filename")}\
467
- ${g}`);const T=st(g).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(T))throw a.error(`output file ${n} has extension "${T}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await yd({languageServices:f,outDir:m,filename:g});await it({...d,logLevel:"warn"});const S=await f.layoutedModel(p),E=W(m,vt(w,T)+(T===".mjs"?".d.mts":".d.ts"));await ke(E,rl(S,{useCorePackage:r})),l.stopAndLog(),Te(sr(`
468
+ `).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(u){var s=u,o=!0}finally{var c=gd(a,s,o);c&&await c}}async function wd({languageServices:t,outDir:e,filename:r="likec4-react.mjs"}){const n=ve(["vite","react"]),i=$r();return n.info(`${y.cyan("likec4 app root")} ${y.dim(i)}`),n.info(y.cyan("outDir")+" "+y.dim(e)),{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Rr()},esbuild:{banner:`'use client'
469
+ `+vr.banner,footer:vr.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:Er,lib:{entry:"react/likec4.tsx",fileName(a,s){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/mode\
470
+ l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(a,s){a.code!=="SOURCEMAP_ERROR"&&s(a)}}},plugins:[fr({}),dr({languageServices:t.languageServices,useOverviewGraph:!1})]}}var Ec=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Rc=t=>{throw TypeError(t)},vd=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&Rc("Object expected");var n,i;n=e[Ec("asyncDispose")],n===void 0&&(n=e[Ec("dispose")],i=n),typeof n!=
471
+ "function"&&Rc("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push([r]);return e},$d=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=s,u.suppressed=o,u},i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){
472
+ i(c)}if(r)throw e};return a()};async function bd({path:t,useDotBin:e,useCorePackage:r,outfile:n,project:i}){var a=[];try{await lt();const u=ve("c4:codegen"),l=Be(u),f=vd(a,await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1}),!0),{projectId:p,projectFolder:h}=tr(f,i);i&&u.info(`${y.dim("project")} ${y.green(p)}`),u.info(`${y.dim("format")} ${y.green("react")}`);const v=await f.diagrams(p);if(v.length===0)throw process.exitCode=1,new Error("no views found");v.forEach(A=>{if(A.
473
+ drifts&&A.drifts.length>0){u.info(y.yellow("layout drift detected, view:")+" "+y.red(A.id));return}if(A.hasLayoutDrift){u.warn(y.yellow("drift detected, manual layout can not be applied, view:")+" "+y.red(A.id));return}});let w=z(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-views.js");if(n&&(w=ur(n)?n:z(n),_e(n)&&(await lr(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const m=Re(w);u.info(`${y.dim("outdir")} ${m}`);const g=$t(w);u.info(`${y.dim("filename")}\
474
+ ${g}`);const T=ot(g).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(T))throw u.error(`output file ${n} has extension "${T}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await wd({languageServices:f,outDir:m,filename:g});await ct({...d,logLevel:"warn"});const S=await f.layoutedModel(p),E=z(m,$t(w,T)+(T===".mjs"?".d.mts":".d.ts"));await Oe(E,al(S,{useCorePackage:r})),l.stopAndLog(),Te(ar(`
468
475
  ${y.dim("Sources generated:")}
469
- ${Ce(wt(),w)}
470
- ${Ce(wt(),E)}
476
+ ${Ce(vt(),w)}
477
+ ${Ce(vt(),E)}
471
478
 
472
479
  ${y.dim("How to use:")}
473
480
  ${y.underline("https://likec4.dev/tooling/code-generation/react/")}
474
- `),{padding:1,borderColor:"green",borderStyle:"round"})}catch(a){var s=a,i=!0}finally{var c=vd(u,s,i);c&&await c}}var yc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),wc=t=>{throw TypeError(t)},bd=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&wc("Object expected");var n,o;n=e[yc("asyncDispose")],n===void 0&&(n=e[yc("dispose")],o=n),typeof n!="function"&&wc("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(u){return Promise.reject(u)}}),t.push([r,n,e])}else t.push(
475
- [r]);return e},Ed=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,i,c,a){return a=Error(c),a.name="SuppressedError",a.error=s,a.suppressed=i,a},o=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),u=s=>{for(;s=t.pop();)try{var i=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(i).then(u,c=>(o(c),u()))}catch(c){o(c)}if(r)throw e};return u()};async function Rd({project:t,path:e,useDotBin:r,webcomponentPrefix:n="likec4",outfile:o}){var u=[];try{await ut();
476
- const a=ve("c4:codegen"),l=Ue(a),f=bd(u,await ye.fromWorkspace(e,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:p,projectFolder:h}=Qt(f,t);t&&a.info(`${y.dim("project")} ${y.green(p)}`),a.info(`${y.dim("format")} ${y.green("webcomponent")}`);const v=await f.diagrams(p);if(!rt(v,1))throw a.warn("no views found"),process.exitCode=1,new Error("no views found");v.forEach(E=>{E.hasLayoutDrift&&a.warn(y.yellow("drift detected, manual layout can not be applied, view:")+" "+y.red(E.
477
- id))});let w=W(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-views.js");if(o&&(w=ir(o)?o:W(o),_e(o)&&(await ar(o)).isDirectory()))throw new Error(`output file is a directory: ${o}`);De.debug(`${y.dim("outfilepath")} ${w}`);const m=vt(w);De.debug(`${y.dim("filename")} ${m}`);const g=st(m).toLocaleLowerCase();if(g!==".js"&&g!==".mjs")throw De.warn(`output file ${o} has extension "${g}"`),new Error(`output file ${o} must be a .js or .mjs`);const T=await wr();De.debug(`${y.dim("creat\
478
- ed temp public")} ${T}`);const d=await Ur({languageServices:f,outDir:T,filename:m,webcomponentPrefix:n,base:"/"});De.debug(`${y.dim("vite build webcomponent")}`),await it({...d,logLevel:"warn"});const S=W(T,m);if(!_e(S))throw new Error(`output file not found: ${S}`);await Se(Re(w),{recursive:!0}),await Zc(S,w),a.info(`${y.dim("generated")} ${w}`),De.debug(`${y.dim("remove temp public")}`),await eu(T,{recursive:!0,force:!0}),l.stopAndLog(),Te(sr(`
481
+ `),{padding:1,borderColor:"green",borderStyle:"round"})}catch(u){var s=u,o=!0}finally{var c=$d(a,s,o);c&&await c}}var Sc=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ac=t=>{throw TypeError(t)},Ed=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&Ac("Object expected");var n,i;n=e[Sc("asyncDispose")],n===void 0&&(n=e[Sc("dispose")],i=n),typeof n!="function"&&Ac("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.push([r,n,e])}else t.push(
482
+ [r]);return e},Rd=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(s,o,c,u){return u=Error(c),u.name="SuppressedError",u.error=s,u.suppressed=o,u},i=s=>e=r?new n(s,e,"An error was suppressed during disposal"):(r=!0,s),a=s=>{for(;s=t.pop();)try{var o=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(o).then(a,c=>(i(c),a()))}catch(c){i(c)}if(r)throw e};return a()};async function Sd({project:t,path:e,useDotBin:r,webcomponentPrefix:n="likec4",outfile:i}){var a=[];try{await lt();
483
+ const u=ve("c4:codegen"),l=Be(u),f=Ed(a,await ye.fromWorkspace(e,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:p,projectFolder:h}=tr(f,t);t&&u.info(`${y.dim("project")} ${y.green(p)}`),u.info(`${y.dim("format")} ${y.green("webcomponent")}`);const v=await f.diagrams(p);if(!st(v,1))throw u.warn("no views found"),process.exitCode=1,new Error("no views found");v.forEach(E=>{E.hasLayoutDrift&&u.warn(y.yellow("drift detected, manual layout can not be applied, view:")+" "+y.red(E.
484
+ id))});let w=z(f.projectsManager.hasMultipleProjects()?h:f.workspace,"likec4-views.js");if(i&&(w=ur(i)?i:z(i),_e(i)&&(await lr(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);He.debug(`${y.dim("outfilepath")} ${w}`);const m=$t(w);He.debug(`${y.dim("filename")} ${m}`);const g=ot(m).toLocaleLowerCase();if(g!==".js"&&g!==".mjs")throw He.warn(`output file ${i} has extension "${g}"`),new Error(`output file ${i} must be a .js or .mjs`);const T=await br();He.debug(`${y.dim("creat\
485
+ ed temp public")} ${T}`);const d=await Br({languageServices:f,outDir:T,filename:m,webcomponentPrefix:n,base:"/"});He.debug(`${y.dim("vite build webcomponent")}`),await ct({...d,logLevel:"warn"});const S=z(T,m);if(!_e(S))throw new Error(`output file not found: ${S}`);await Se(Re(w),{recursive:!0}),await ou(S,w),u.info(`${y.dim("generated")} ${w}`),He.debug(`${y.dim("remove temp public")}`),await au(T,{recursive:!0,force:!0}),l.stopAndLog(),Te(ar(`
479
486
  ${y.dim("Webcomponents generated to:")}
480
- ${Ce(wt(),w)}
487
+ ${Ce(vt(),w)}
481
488
 
482
489
  ${y.dim("Setup and usage instructions:")}
483
490
  ${y.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
484
- `))}catch(a){var s=a,i=!0}finally{var c=Ed(u,s,i);c&&await c}}const Sd=t=>t.command({command:"gen <command> [path]",aliases:["generate","codegen"],describe:"Generate various artifacts from LikeC4 sources",builder:e=>e.positional("path",pe).command("react [path]","generate react component to render likec4 view",r=>r.positional("path",pe).option("project",ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:Fe}).option("use-dot",
485
- he).option("use-core-package",_s),async r=>{await $d({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,useCorePackage:r.useCorePackage})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:r=>r.positional("path",pe).option("project",ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:Fe}).option("webcomponent-prefix",mr).option("use-dot",he),handler:async r=>{
486
- await Rd({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,webcomponentPrefix:r.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:r=>r.positional("path",pe).option("project",ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:Fe}).option("use-dot",he).option("use-core-package",_s),handler:async r=>{await gd({path:r.path,useDotBin:r.useDotBin,useCorePackage:r.
487
- useCorePackage,outfile:r.outfile,project:r.project})}}).command({command:"views-data [path]",aliases:["views"],describe:"{deprecated} use codegen model",deprecated:!0,builder:r=>r.positional("path",pe).option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:Fe}).option("use-dot",he),handler:async r=>{await dt({format:"views",path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:r=>r.
488
- positional("path",pe).option("outdir",Et).option("use-dot",he),handler:async r=>{await dt({format:"dot",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:r=>r.positional("path",pe).option("outdir",Et).option("use-dot",he),handler:async r=>{await dt({format:"d2",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:r=>r.positional(
489
- "path",pe).option("outdir",Et).option("use-dot",he),handler:async r=>{await dt({format:"mermaid",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"plantuml [path]",aliases:["puml"],describe:"generate PlantUML files (.puml)",builder:r=>r.positional("path",pe).option("outdir",Et).option("use-dot",he),handler:async r=>{await dt({format:"plantuml",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"<custom> [path]",describe:"run custom generator from likec\
490
- 4 config",builder:r=>r.positional("path",pe).option("project",ct).option("use-dot",he),handler:async r=>{await pc({name:"custom",path:r.path,project:r.project,useDotBin:r.useDotBin})}}).epilog(`${y.bold("Examples:")}
491
+ `))}catch(u){var s=u,o=!0}finally{var c=Rd(a,s,o);c&&await c}}const Ad=t=>t.command({command:"gen <command> [path]",aliases:["generate","codegen"],describe:"Generate various artifacts from LikeC4 sources",builder:e=>e.positional("path",pe).command("react [path]","generate react component to render likec4 view",r=>r.positional("path",pe).option("project",ut).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:Ve}).option("use-dot",
492
+ he).option("use-core-package",ks),async r=>{await bd({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,useCorePackage:r.useCorePackage})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:r=>r.positional("path",pe).option("project",ut).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:Ve}).option("webcomponent-prefix",wr).option("use-dot",he),handler:async r=>{
493
+ await Sd({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,webcomponentPrefix:r.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:r=>r.positional("path",pe).option("project",ut).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:Ve}).option("use-dot",he).option("use-core-package",ks),handler:async r=>{await yd({path:r.path,useDotBin:r.useDotBin,useCorePackage:r.
494
+ useCorePackage,outfile:r.outfile,project:r.project})}}).command({command:"views-data [path]",aliases:["views"],describe:"{deprecated} use codegen model",deprecated:!0,builder:r=>r.positional("path",pe).option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:Ve}).option("use-dot",he),handler:async r=>{await ht({format:"views",path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:r=>r.
495
+ positional("path",pe).option("outdir",Rt).option("use-dot",he),handler:async r=>{await ht({format:"dot",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:r=>r.positional("path",pe).option("outdir",Rt).option("use-dot",he),handler:async r=>{await ht({format:"d2",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:r=>r.positional(
496
+ "path",pe).option("outdir",Rt).option("use-dot",he),handler:async r=>{await ht({format:"mermaid",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"plantuml [path]",aliases:["puml"],describe:"generate PlantUML files (.puml)",builder:r=>r.positional("path",pe).option("outdir",Rt).option("use-dot",he),handler:async r=>{await ht({format:"plantuml",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"<custom> [path]",describe:"run custom generator from likec\
497
+ 4 config",builder:r=>r.positional("path",pe).option("project",ut).option("use-dot",he),handler:async r=>{await vc({name:"custom",path:r.path,project:r.project,useDotBin:r.useDotBin})}}).epilog(`${y.bold("Examples:")}
491
498
  likec4 gen react -o dist/likec4-views.mjs ./src/likec4
492
499
  likec4 gen model -o likec4-model.ts
493
500
  likec4 gen ts --outfile likec4-model.ts
@@ -495,8 +502,8 @@ positional("path",pe).option("outdir",Et).option("use-dot",he),handler:async r=>
495
502
  likec4 gen mmd --outdir assets/
496
503
  likec4 gen plantuml --outdir assets/
497
504
  likec4 gen dot -o out .
498
- `),handler:async e=>{await pc({name:e.command,path:e.path,project:e.project,useDotBin:e.useDotBin})}});async function Ad({path:t,useDotBin:e,outfile:r}){const n=ve("c4:export"),o=Ue(n),u=await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});u.ensureSingleProject();const s=await u.layoutedModel();st(r)!==".json"&&(r=r+".json"),await Se(Re(r),{recursive:!0});const i=JSON.stringify(s.$data,null,2);await ke(r,i),n.info(`${y.dim("generated")} ${Ce(process.cwd(),r)}`),o.stopAndLog(
499
- "\u2713 export in ")}const _d=t=>t.command({command:"export <format> [path]",describe:"Export to images or JSON",builder:e=>e.usage(`${y.bold("Usage:")} $0 export <format> [path]`).positional("path",pe).command({command:"png [path]",describe:"export views to PNG",builder:r=>r.options({output:{alias:["o","outdir"],type:"string",desc:"output directory, if not specified, images are saved next to sources",normalize:!0,nargs:1,coerce:W},project:ct,theme:{choices:["light","dark"],desc:"color-scheme to\
505
+ `),handler:async e=>{await vc({name:e.command,path:e.path,project:e.project,useDotBin:e.useDotBin})}});async function _d({path:t,useDotBin:e,outfile:r}){const n=ve("c4:export"),i=Be(n),a=await ye.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});a.ensureSingleProject();const s=await a.layoutedModel();ot(r)!==".json"&&(r=r+".json"),await Se(Re(r),{recursive:!0});const o=JSON.stringify(s.$data,null,2);await Oe(r,o),n.info(`${y.dim("generated")} ${Ce(process.cwd(),r)}`),i.stopAndLog(
506
+ "\u2713 export in ")}const Cd=t=>t.command({command:"export <format> [path]",describe:"Export to images or JSON",builder:e=>e.usage(`${y.bold("Usage:")} $0 export <format> [path]`).positional("path",pe).command({command:"png [path]",describe:"export views to PNG",builder:r=>r.options({output:{alias:["o","outdir"],type:"string",desc:"output directory, if not specified, images are saved next to sources",normalize:!0,nargs:1,coerce:z},project:ut,theme:{choices:["light","dark"],desc:"color-scheme to\
500
507
  use, defaults to light",conflicts:["dark","light"],nargs:1},dark:{type:"boolean",desc:"use dark theme, shortcut for --theme=dark",conflicts:["theme","light"]},light:{type:"boolean",desc:"use light theme, shortcut for --theme=light",conflicts:["theme","dark"]},"use-dot":he,seq:{boolean:!0,alias:["sequence"],type:"boolean",desc:"use sequence layout for dynamic views"},flat:{alias:["flatten"],boolean:!0,type:"boolean",desc:"flatten all images in output directory ignoring sources structure"},filter:{
501
508
  alias:"f",array:!0,string:!0,desc:`include views with ids matching given patterns
502
509
  multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"continue if export fails for some views"},timeout:{type:"number",alias:"t",desc:"timeout for playwright (in seconds)",default:15,nargs:1},"max-attempts":{type:"number",desc:"max attempts to export failing view, 1 means no retry",default:3,nargs:1},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server",nargs:1},"chromium-sandbox":{boolean:!0,desc:"enable chromium sandbox (see Playwright docs\
@@ -512,14 +519,14 @@ multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"cont
512
519
 
513
520
  ${y.green('$0 export png -f "use-case*" --sequence src/likec4')}
514
521
  ${y.gray("Export views matching use-case* using sequence layout")}
515
- `),handler:async r=>{fr(r.timeout>=1,"timeout must be >= 1"),fr(r["max-attempts"]>=1,"max-attempts must be >= 1"),await ut();const n=r.theme??(r.dark?"dark":"light");await mo({path:r.path,useDotBin:r["use-dot"],output:r.output,project:r.project,timeoutMs:r.timeout*1e3,maxAttempts:r.maxAttempts,ignore:r.ignore===!0,outputType:r.flat?"flat":"relative",serverUrl:r.serverUrl,theme:n,filter:r.filter,sequence:r.seq,chromiumSandbox:r["chromium-sandbox"]})}}).command({command:"json [path]",describe:"exp\
516
- ort model to JSON",builder:r=>r.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:W}).option("use-dot",he).epilog(`${y.bold("Examples:")}
522
+ `),handler:async r=>{hr(r.timeout>=1,"timeout must be >= 1"),hr(r["max-attempts"]>=1,"max-attempts must be >= 1"),await lt();const n=r.theme??(r.dark?"dark":"light");await bi({path:r.path,useDotBin:r["use-dot"],output:r.output,project:r.project,timeoutMs:r.timeout*1e3,maxAttempts:r.maxAttempts,ignore:r.ignore===!0,outputType:r.flat?"flat":"relative",serverUrl:r.serverUrl,theme:n,filter:r.filter,sequence:r.seq,chromiumSandbox:r["chromium-sandbox"]})}}).command({command:"json [path]",describe:"exp\
523
+ ort model to JSON",builder:r=>r.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:z}).option("use-dot",he).epilog(`${y.bold("Examples:")}
517
524
  ${y.green("$0 export json")}
518
525
  ${y.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
519
526
 
520
527
  ${y.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
521
528
  ${y.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
522
- `),handler:async r=>{await Ad({path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).updateStrings({"Commands:":y.bold("Formats:")}),handler:()=>{}}),Cd=t=>t.command({command:"mcp [path]",aliases:[],describe:"Start MCP server",builder:e=>e.usage(`${y.bold("Usage:")} $0 mcp [path]`).positional("path",pe).option("stdio",{boolean:!0,description:"use stdio transport",conflicts:["http","port"]}).option("http",{boolean:!0,description:"use streamable http transport (use 33335 port by default)",conflicts:"\
529
+ `),handler:async r=>{await _d({path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).updateStrings({"Commands:":y.bold("Formats:")}),handler:()=>{}}),xd=t=>t.command({command:"mcp [path]",aliases:[],describe:"Start MCP server",builder:e=>e.usage(`${y.bold("Usage:")} $0 mcp [path]`).positional("path",pe).option("stdio",{boolean:!0,description:"use stdio transport",conflicts:["http","port"]}).option("http",{boolean:!0,description:"use streamable http transport (use 33335 port by default)",conflicts:"\
523
530
  stdio"}).option("port",{alias:"p",number:!0,description:"enables http transport and sets the port",conflicts:"stdio"}).option("use-dot",he).epilog(`${y.bold("Examples:")}
524
531
  ${y.green("$0 mcp")}
525
532
  ${y.gray("Start MCP with default stdio transport")}
@@ -527,7 +534,7 @@ ${y.green("$0 mcp --http ./src")}
527
534
  ${y.gray("Start MCP with streamable http transport on port 33335 at ./src folder")}
528
535
  ${y.green("$0 mcp -p 1234")}
529
536
  ${y.gray("Start MCP with streamable http transport on port 1234")}
530
- `),handler:async e=>{e.http||e.port?await xd(e.path,e.useDot,e.port):await Td(e.path,e.useDot)}});async function xd(t,e,r=33335){await ye.fromWorkspace(t,{mcp:{port:r},watch:!0,graphviz:e?"binary":"wasm"}),Te([y.green("LikeC4 MCP served at:"),`
537
+ `),handler:async e=>{e.http||e.port?await Td(e.path,e.useDot,e.port):await Id(e.path,e.useDot)}});async function Td(t,e,r=33335){await ye.fromWorkspace(t,{mcp:{port:r},watch:!0,graphviz:e?"binary":"wasm"}),Te([y.green("LikeC4 MCP served at:"),`
531
538
  {
532
539
  "mcpServers": {
533
540
  "likec4": {
@@ -539,14 +546,14 @@ ${y.green("$0 mcp -p 1234")}
539
546
  ${y.dim("Documentation:")}
540
547
  ${y.underline("https://likec4.dev/tooling/mcp/#using-extension")}
541
548
  `].join(`
542
- `))}async function Td(t,e){await ye.fromWorkspace(t,{mcp:"stdio",watch:!0,graphviz:e?"binary":"wasm"})}async function Ld(t){const e=await Mr({...t,likec4AssetsDir:"",webcomponentPrefix:void 0}),r=await Br({port:xt(62001,62010)}),n=t?.open??!1;return await iu({...e,mode:"production",preview:{host:t.listen??"127.0.0.1",allowedHosts:!0,port:r,open:n}})}async function kd({path:t,output:e,base:r,listen:n}){const o=await ye.fromWorkspace(t,{logger:"vite",watch:!1}),u=await Ld({base:r,languageServices:o,
543
- outputDir:e,open:!Ie(),listen:n});io(u)}const Id=t=>t.command({command:"preview [path]",describe:"Start local server to preview production build",builder:e=>e.positional("path",{type:"string",desc:`Directory with LikeC4 source files
544
- if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],Fe).default("path",Fe("."),".").default("listen","127.0.0.1","localhost"),handler:async e=>{await kd(e)}});async function Od({path:t,useDotBin:e,webcomponentPrefix:r,
545
- title:n,useHashHistory:o,useOverview:u=!1,enableWebcomponent:s=!0,enableHMR:i=!0,base:c,listen:a,port:l}){i&&(process.env.NODE_ENV="development");const f=await ye.fromWorkspace(t,{graphviz:e?"binary":"wasm",watch:i}),p=await $t(nt(bt(),".likec4-assets-")),h=await lo({buildWebcomponent:s,hmr:i,base:c,webcomponentPrefix:r,title:n,languageServices:f,useHashHistory:o,useOverviewGraph:u,likec4AssetsDir:p,listen:a,port:l});if(h.config.logger.clearScreen("info"),io(h),!u)return;const v=await f.diagrams();
546
- if(rt(v,1)){const w=ve("c4:export"),m=oo(h);if(!m){w.error("no preview server url");return}w.info(y.cyan("wait 5sec before generating previews")),await As(5e3);try{await ho({serverUrl:m,logger:w,views:v,theme:"light",output:p,outputType:"flat"}),await As(1e3),w.info(y.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(g){w.error(y.red("Failed to generate previews")),w.error(g)}}else h.config.logger.warn("no views found, no previews generated")}const Pd=t=>t.
547
- command({command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:e=>e.positional("path",pe).option("base",Ts).option("webcomponent-prefix",mr).option("title",xs).option("use-hash-history",Cs).option("use-dot",he).option("listen",Au).option("port",_u).options({"react-hmr":{type:"boolean",default:!0,describe:"Enable/Disable React HMR"},"build-webcomponent":{type:"boolean",default:!0,describe:"Enable/Disable Webcomponent build"}}),handler:async e=>{
548
- await ut(),await Od({path:e.path,useDotBin:e["use-dot"],base:e.base,webcomponentPrefix:e["webcomponent-prefix"],title:e.title,useHashHistory:e["use-hash-history"],listen:e.listen,port:e.port,enableHMR:e["react-hmr"],enableWebcomponent:e["build-webcomponent"]})}});async function Nd({path:t,ignoreLayout:e}){const r=await ye.fromWorkspace(t,{logger:"vite",watch:!1}),n=ve("c4:views");let o=u(r);return o=o&&(e||await s(r,n)),o?0:hs(1);function u(i){return i.getErrors().length===0}async function s(i,c){
549
- const a=await i.diagrams();let l=!1;for(const f of a)f.hasLayoutDrift===!0&&(l=!0,c.error(y.red(`Layout drift detected on view '${f.id}' at ${W(t,f.sourcePath??".")}`)));return!l}}const jd=t=>t.command({command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:e=>e.positional("path",pe).option("ignore-layout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async e=>{await Nd({path:e.path,ignoreLayout:e["ig\
550
- nore-layout"]})}});fs({sinks:{console:ps()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:Jc?"debug":"info"}]});async function Dd(){!Ie()&&nd(),await gs(Yc(Qc(Vc)),Pd,Tl,Sd,_d,Id,jd,Cd,id,t=>t.command({command:"completion",describe:"Generate completion script",handler:()=>{t.showCompletionScript()}})).scriptName("likec4").usage("Usage: $0 <command>").version(Me).alias("v","version").alias("h","help").help("help").option("verbose",{type:"boolean",default:!1,describe:"verbose logging",
551
- global:!0}).demandCommand(1,"Please run with valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":y.bold("Options:"),"Positionals:":y.bold("Arguments:"),"Commands:":y.bold("Commands:"),"Examples:":y.bold("Examples:")}).wrap(as(Wc.columns-10,{min:80,max:150})).middleware(t=>{t.verbose&&fs({sinks:{console:ps()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]})}).parseAsync()}Dd().catch(()=>{hs(1)}),process.on("unhandledRejection",t=>{console.error("U\
549
+ `))}async function Id(t,e){await ye.fromWorkspace(t,{mcp:"stdio",watch:!0,graphviz:e?"binary":"wasm"})}async function Od(t){const e=await Gr({...t,likec4AssetsDir:"",webcomponentPrefix:void 0}),r=await Wr({port:Tt(62001,62010)}),n=t?.open??!1;return await du({...e,mode:"production",preview:{host:t.listen??"127.0.0.1",allowedHosts:!0,port:r,open:n}})}async function Ld({path:t,output:e,base:r,listen:n}){const i=await ye.fromWorkspace(t,{logger:"vite",watch:!1}),a=await Od({base:r,languageServices:i,
550
+ outputDir:e,open:!Le(),listen:n});di(a)}const kd=t=>t.command({command:"preview [path]",describe:"Start local server to preview production build",builder:e=>e.positional("path",{type:"string",desc:`Directory with LikeC4 source files
551
+ if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],Ve).default("path",Ve("."),".").default("listen","127.0.0.1","localhost"),handler:async e=>{await Ld(e)}});async function Nd({path:t,useDotBin:e,webcomponentPrefix:r,
552
+ title:n,useHashHistory:i,useOverview:a=!1,enableWebcomponent:s=!0,enableHMR:o=!0,base:c,listen:u,port:l}){o&&(process.env.NODE_ENV="development");const f=await ye.fromWorkspace(t,{graphviz:e?"binary":"wasm",watch:o}),p=await bt(it(Et(),".likec4-assets-")),h=await yi({buildWebcomponent:s,hmr:o,base:c,webcomponentPrefix:r,title:n,languageServices:f,useHashHistory:i,useOverviewGraph:a,likec4AssetsDir:p,listen:u,port:l});if(h.config.logger.clearScreen("info"),di(h),!a)return;const v=await f.diagrams();
553
+ if(st(v,1)){const w=ve("c4:export"),m=pi(h);if(!m){w.error("no preview server url");return}w.info(y.cyan("wait 5sec before generating previews")),await Ls(5e3);try{await $i({serverUrl:m,logger:w,views:v,theme:"light",output:p,outputType:"flat"}),await Ls(1e3),w.info(y.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(g){w.error(y.red("Failed to generate previews")),w.error(g)}}else h.config.logger.warn("no views found, no previews generated")}const Pd=t=>t.
554
+ command({command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:e=>e.positional("path",pe).option("base",js).option("webcomponent-prefix",wr).option("title",Ps).option("use-hash-history",Ns).option("use-dot",he).option("listen",Iu).option("port",Ou).options({"react-hmr":{type:"boolean",default:!0,describe:"Enable/Disable React HMR"},"build-webcomponent":{type:"boolean",default:!0,describe:"Enable/Disable Webcomponent build"}}),handler:async e=>{
555
+ await lt(),await Nd({path:e.path,useDotBin:e["use-dot"],base:e.base,webcomponentPrefix:e["webcomponent-prefix"],title:e.title,useHashHistory:e["use-hash-history"],listen:e.listen,port:e.port,enableHMR:e["react-hmr"],enableWebcomponent:e["build-webcomponent"]})}});async function jd({path:t,ignoreLayout:e}){const r=await ye.fromWorkspace(t,{logger:"vite",watch:!1}),n=ve("c4:views");let i=a(r);return i=i&&(e||await s(r,n)),i?0:vs(1);function a(o){return o.getErrors().length===0}async function s(o,c){
556
+ const u=await o.diagrams();let l=!1;for(const f of u)f.hasLayoutDrift===!0&&(l=!0,c.error(y.red(`Layout drift detected on view '${f.id}' at ${z(t,f.sourcePath??".")}`)));return!l}}const Dd=t=>t.command({command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:e=>e.positional("path",pe).option("ignore-layout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async e=>{await jd({path:e.path,ignoreLayout:e["ig\
557
+ nore-layout"]})}});gs({sinks:{console:ys()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:nu?"debug":"info"}]});async function qd(){!Le()&&sd(),await bs(su(iu(Qc)),Pd,Nl,Ad,Cd,kd,Dd,xd,ad,t=>t.command({command:"completion",describe:"Generate completion script",handler:()=>{t.showCompletionScript()}})).scriptName("likec4").usage("Usage: $0 <command>").version(Ge).alias("v","version").alias("h","help").help("help").option("verbose",{type:"boolean",default:!1,describe:"verbose logging",
558
+ global:!0}).demandCommand(1,"Please run with valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":y.bold("Options:"),"Positionals:":y.bold("Arguments:"),"Commands:":y.bold("Commands:"),"Examples:":y.bold("Examples:")}).wrap(ps(Zc.columns-10,{min:80,max:150})).middleware(t=>{t.verbose&&gs({sinks:{console:ys()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]})}).parseAsync()}qd().catch(()=>{vs(1)}),process.on("unhandledRejection",t=>{console.error("U\
552
559
  nhandled rejection",t)});