likec4 1.20.2 → 1.20.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,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const LikeC4=require("../shared/likec4.DpEZnw1B.cjs"),process$1=require("node:process"),assert=require("assert"),require$$0=require("path"),require$$0$1=require("fs"),require$$0$2=require("util"),require$$0$3=require("url"),path$1=require("node:path"),fs=require("node:fs"),fsPromises=require("node:fs/promises"),os=require("node:os"),node_url=require("node:url"),c$1=require("@vitejs/plugin-react-swc"),core=require("@likec4/core"),vite=require("vite"),playwright=require("playwright"),net=require("node:net"),promises=require("node:timers/promises");require("tty"),require("node:util"),require("os"),require("crypto"),require("net"),require("child_process"),require("node:tty"),require("@hpcc-js/wasm-graphviz"),require("buffer"),require("@likec4/core/compute-view"),require("node:child_process"),require("node:string_decoder"),require("node:events"),require("node:v8"),require("node:stream"),require("node:buffer"),require("node:stream/promises"),require("@likec4/core/model");var _documentCurrentScript=typeof document<"u"?document.currentScript:null;function _interopDefaultCompat(i){return i&&typeof i=="object"&&"default"in i?i.default:i}const process__default=_interopDefaultCompat(process$1),path__default=_interopDefaultCompat(path$1),fs__default=_interopDefaultCompat(fs),os__default=_interopDefaultCompat(os),c__default=_interopDefaultCompat(c$1),net__default=_interopDefaultCompat(net),align={right:alignRight,center:alignCenter},top=0,right=1,bottom=2,left=3;class UI{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){const t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);const t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split(`
3
- `).map(s=>s.split(" "));let n=0;return t.forEach(s=>{s.length>1&&mixin$1.stringWidth(s[0])>n&&(n=Math.min(Math.floor(this.width*.5),mixin$1.stringWidth(s[0])))}),t.forEach(s=>{this.div(...s.map((o,a)=>({text:o.trim(),padding:this.measurePadding(o),width:a===0&&s.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=mixin$1.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
4
- `)}rowToString(e,t){return this.rasterize(e).forEach((n,s)=>{let o="";n.forEach((a,l)=>{const{width:d}=e[l],B=this.negatePadding(e[l]);let w=a;if(B>mixin$1.stringWidth(a)&&(w+=" ".repeat(B-mixin$1.stringWidth(a))),e[l].align&&e[l].align!=="left"&&this.wrap){const _=align[e[l].align];w=_(w,B),mixin$1.stringWidth(w)<B&&(w+=" ".repeat((d||0)-mixin$1.stringWidth(w)-1))}const E=e[l].padding||[0,0,0,0];E[left]&&(o+=" ".repeat(E[left])),o+=addBorder(e[l],w,"| "),o+=w,o+=addBorder(e[l],w," |"),E[right]&&(o+=" ".repeat(E[right])),s===0&&t.length>0&&(o=this.renderInline(o,t[t.length-1]))}),t.push({text:o.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){const n=e.match(/^ */),s=n?n[0].length:0,o=t.text,a=mixin$1.stringWidth(o.trimRight());return t.span?this.wrap?s<a?e:(t.hidden=!0,o.trimRight()+" ".repeat(s-a)+e.trimLeft()):(t.hidden=!0,o+e):e}rasterize(e){const t=[],n=this.columnWidths(e);let s;return e.forEach((o,a)=>{o.width=n[a],this.wrap?s=mixin$1.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
5
- `):s=o.text.split(`
6
- `),o.border&&(s.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(s.unshift(...new Array(o.padding[top]||0).fill("")),s.push(...new Array(o.padding[bottom]||0).fill(""))),s.forEach((l,d)=>{t[d]||t.push([]);const B=t[d];for(let w=0;w<a;w++)B[w]===void 0&&B.push("");B.push(l)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[left]||0)+(e.padding[right]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(a=>a.width||mixin$1.stringWidth(a.text));let t=e.length,n=this.width;const s=e.map(a=>{if(a.width)return t--,n-=a.width,a.width}),o=t?Math.floor(n/t):0;return s.map((a,l)=>a===void 0?Math.max(o,_minWidth(e[l])):a)}}function addBorder(i,e,t){return i.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function _minWidth(i){const e=i.padding||[],t=1+(e[left]||0)+(e[right]||0);return i.border?t+4:t}function getWindowWidth(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function alignRight(i,e){i=i.trim();const t=mixin$1.stringWidth(i);return t<e?" ".repeat(e-t)+i:i}function alignCenter(i,e){i=i.trim();const t=mixin$1.stringWidth(i);return t>=e?i:" ".repeat(e-t>>1)+i}let mixin$1;function cliui(i,e){return mixin$1=e,new UI({width:i?.width||getWindowWidth(),wrap:i?.wrap})}const ansi=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function stripAnsi(i){return i.replace(ansi,"")}function wrap(i,e){const[t,n]=i.match(ansi)||["",""];i=stripAnsi(i);let s="";for(let o=0;o<i.length;o++)o!==0&&o%e===0&&(s+=`
7
- `),s+=i.charAt(o);return t&&n&&(s=`${t}${s}${n}`),s}function ui(i){return cliui(i,{stringWidth:e=>[...e].length,stripAnsi,wrap})}function escalade(i,e){let t=require$$0.resolve(".",i),n;for(require$$0$1.statSync(t).isDirectory()||(t=require$$0.dirname(t));;){if(n=e(t,require$$0$1.readdirSync(t)),n)return require$$0.resolve(t,n);if(t=require$$0.dirname(n=t),n===t)break}}function camelCase(i){if(i!==i.toLowerCase()&&i!==i.toUpperCase()||(i=i.toLowerCase()),i.indexOf("-")===-1&&i.indexOf("_")===-1)return i;{let t="",n=!1;const s=i.match(/^-+/);for(let o=s?s[0].length:0;o<i.length;o++){let a=i.charAt(o);n&&(n=!1,a=a.toUpperCase()),o!==0&&(a==="-"||a==="_")?n=!0:a!=="-"&&a!=="_"&&(t+=a)}return t}}function decamelize(i,e){const t=i.toLowerCase();e=e||"-";let n="";for(let s=0;s<i.length;s++){const o=t.charAt(s),a=i.charAt(s);o!==a&&s>0?n+=`${e}${t.charAt(s)}`:n+=a}return n}function looksLikeNumber(i){return i==null?!1:typeof i=="number"||/^0x[0-9a-f]+$/i.test(i)?!0:/^0[^.]/.test(i)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i)}function tokenizeArgString(i){if(Array.isArray(i))return i.map(a=>typeof a!="string"?a+"":a);i=i.trim();let e=0,t=null,n=null,s=null;const o=[];for(let a=0;a<i.length;a++){if(t=n,n=i.charAt(a),n===" "&&!s){t!==" "&&e++;continue}n===s?s=null:(n==="'"||n==='"')&&!s&&(s=n),o[e]||(o[e]=""),o[e]+=n}return o}var DefaultValuesForTypeKey;(function(i){i.BOOLEAN="boolean",i.STRING="string",i.NUMBER="number",i.ARRAY="array"})(DefaultValuesForTypeKey||(DefaultValuesForTypeKey={}));let mixin;class YargsParser{constructor(e){mixin=e}parse(e,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),s=tokenizeArgString(e),o=typeof e=="string",a=combineAliases(Object.assign(Object.create(null),n.alias)),l=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),d=Object.assign(Object.create(null),n.default),B=n.configObjects||[],w=n.envPrefix,E=l["populate--"],_=E?"--":"_",U=Object.create(null),H=Object.create(null),W=n.__||mixin.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},K=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ee=new RegExp("^--"+l["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(y){const T=typeof y=="object"?y.key:y,Q=Object.keys(y).map(function(z){return{boolean:"bools",string:"strings",number:"numbers"}[z]}).filter(Boolean).pop();Q&&(L[Q][T]=!0),L.arrays[T]=!0,L.keys.push(T)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(y){L.bools[y]=!0,L.keys.push(y)}),[].concat(n.string||[]).filter(Boolean).forEach(function(y){L.strings[y]=!0,L.keys.push(y)}),[].concat(n.number||[]).filter(Boolean).forEach(function(y){L.numbers[y]=!0,L.keys.push(y)}),[].concat(n.count||[]).filter(Boolean).forEach(function(y){L.counts[y]=!0,L.keys.push(y)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(y){L.normalize[y]=!0,L.keys.push(y)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([y,T])=>{typeof T=="number"&&(L.nargs[y]=T,L.keys.push(y))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([y,T])=>{typeof T=="function"&&(L.coercions[y]=T,L.keys.push(y))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(y){L.configs[y]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([y,T])=>{(typeof T=="boolean"||typeof T=="function")&&(L.configs[y]=T)})),Ie(n.key,a,n.default,L.arrays),Object.keys(d).forEach(function(y){(L.aliases[y]||[]).forEach(function(T){d[T]=d[y]})});let ae=null;Le();let se=[];const ce=Object.assign(Object.create(null),{_:[]}),Fe={};for(let y=0;y<s.length;y++){const T=s[y],Q=T.replace(/^-{3,}/,"---");let z,N,ne,Z,re,be;if(T!=="--"&&/^-/.test(T)&&De(T))ve(T);else if(Q.match(/^---+(=|$)/)){ve(T);continue}else if(T.match(/^--.+=/)||!l["short-option-groups"]&&T.match(/^-.+=/))Z=T.match(/^--?([^=]+)=([\s\S]*)$/),Z!==null&&Array.isArray(Z)&&Z.length>=3&&(oe(Z[1],L.arrays)?y=xe(y,Z[1],s,Z[2]):oe(Z[1],L.nargs)!==!1?y=je(y,Z[1],s,Z[2]):pe(Z[1],Z[2],!0));else if(T.match(ee)&&l["boolean-negation"])Z=T.match(ee),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(N=Z[1],pe(N,oe(N,L.arrays)?[!1]:!1));else if(T.match(/^--.+/)||!l["short-option-groups"]&&T.match(/^-[^-]+/))Z=T.match(/^--?(.+)/),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(N=Z[1],oe(N,L.arrays)?y=xe(y,N,s):oe(N,L.nargs)!==!1?y=je(y,N,s):(re=s[y+1],re!==void 0&&(!re.match(/^-/)||re.match(K))&&!oe(N,L.bools)&&!oe(N,L.counts)||/^(true|false)$/.test(re)?(pe(N,re),y++):pe(N,Ce(N))));else if(T.match(/^-.\..+=/))Z=T.match(/^-([^=]+)=([\s\S]*)$/),Z!==null&&Array.isArray(Z)&&Z.length>=3&&pe(Z[1],Z[2]);else if(T.match(/^-.\..+/)&&!T.match(K))re=s[y+1],Z=T.match(/^-(.\..+)/),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(N=Z[1],re!==void 0&&!re.match(/^-/)&&!oe(N,L.bools)&&!oe(N,L.counts)?(pe(N,re),y++):pe(N,Ce(N)));else if(T.match(/^-[^-]+/)&&!T.match(K)){ne=T.slice(1,-1).split(""),z=!1;for(let ye=0;ye<ne.length;ye++){if(re=T.slice(ye+2),ne[ye+1]&&ne[ye+1]==="="){be=T.slice(ye+3),N=ne[ye],oe(N,L.arrays)?y=xe(y,N,s,be):oe(N,L.nargs)!==!1?y=je(y,N,s,be):pe(N,be),z=!0;break}if(re==="-"){pe(ne[ye],re);continue}if(/[A-Za-z]/.test(ne[ye])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(re)&&oe(re,L.bools)===!1){pe(ne[ye],re),z=!0;break}if(ne[ye+1]&&ne[ye+1].match(/\W/)){pe(ne[ye],re),z=!0;break}else pe(ne[ye],Ce(ne[ye]))}N=T.slice(-1)[0],!z&&N!=="-"&&(oe(N,L.arrays)?y=xe(y,N,s):oe(N,L.nargs)!==!1?y=je(y,N,s):(re=s[y+1],re!==void 0&&(!/^(-|--)[^-]/.test(re)||re.match(K))&&!oe(N,L.bools)&&!oe(N,L.counts)||/^(true|false)$/.test(re)?(pe(N,re),y++):pe(N,Ce(N))))}else if(T.match(/^-[0-9]$/)&&T.match(K)&&oe(T.slice(1),L.bools))N=T.slice(1),pe(N,Ce(N));else if(T==="--"){se=s.slice(y+1);break}else if(l["halt-at-non-option"]){se=s.slice(y);break}else ve(T)}de(ce,!0),de(ce,!1),le(ce),Ae(),ge(ce,L.aliases,d,!0),Ee(ce),l["set-placeholder-key"]&&$e(ce),Object.keys(L.counts).forEach(function(y){Oe(ce,y.split("."))||pe(y,0)}),E&&se.length&&(ce[_]=[]),se.forEach(function(y){ce[_].push(y)}),l["camel-case-expansion"]&&l["strip-dashed"]&&Object.keys(ce).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete ce[y]}),l["strip-aliased"]&&[].concat(...Object.keys(a).map(y=>a[y])).forEach(y=>{l["camel-case-expansion"]&&y.includes("-")&&delete ce[y.split(".").map(T=>camelCase(T)).join(".")],delete ce[y]});function ve(y){const T=te("_",y);(typeof T=="string"||typeof T=="number")&&ce._.push(T)}function je(y,T,Q,z){let N,ne=oe(T,L.nargs);if(ne=typeof ne!="number"||isNaN(ne)?1:ne,ne===0)return _e(z)||(ae=Error(W("Argument unexpected for: %s",T))),pe(T,Ce(T)),y;let Z=_e(z)?0:1;if(l["nargs-eats-options"])Q.length-(y+1)+Z<ne&&(ae=Error(W("Not enough arguments following: %s",T))),Z=ne;else{for(N=y+1;N<Q.length&&(!Q[N].match(/^-[^0-9]/)||Q[N].match(K)||De(Q[N]));N++)Z++;Z<ne&&(ae=Error(W("Not enough arguments following: %s",T)))}let re=Math.min(Z,ne);for(!_e(z)&&re>0&&(pe(T,z),re--),N=y+1;N<re+y+1;N++)pe(T,Q[N]);return y+re}function xe(y,T,Q,z){let N=[],ne=z||Q[y+1];const Z=oe(T,L.nargs);if(oe(T,L.bools)&&!/^(true|false)$/.test(ne))N.push(!0);else if(_e(ne)||_e(z)&&/^-/.test(ne)&&!K.test(ne)&&!De(ne)){if(d[T]!==void 0){const re=d[T];N=Array.isArray(re)?re:[re]}}else{_e(z)||N.push(X(T,z,!0));for(let re=y+1;re<Q.length&&!(!l["greedy-arrays"]&&N.length>0||Z&&typeof Z=="number"&&N.length>=Z||(ne=Q[re],/^-/.test(ne)&&!K.test(ne)&&!De(ne)));re++)y=re,N.push(X(T,ne,o))}return typeof Z=="number"&&(Z&&N.length<Z||isNaN(Z)&&N.length===0)&&(ae=Error(W("Not enough arguments following: %s",T))),pe(T,N),y}function pe(y,T,Q=o){if(/-/.test(y)&&l["camel-case-expansion"]){const ne=y.split(".").map(function(Z){return camelCase(Z)}).join(".");ie(y,ne)}const z=X(y,T,Q),N=y.split(".");Se(ce,N,z),L.aliases[y]&&L.aliases[y].forEach(function(ne){const Z=ne.split(".");Se(ce,Z,z)}),N.length>1&&l["dot-notation"]&&(L.aliases[N[0]]||[]).forEach(function(ne){let Z=ne.split(".");const re=[].concat(N);re.shift(),Z=Z.concat(re),(L.aliases[y]||[]).includes(Z.join("."))||Se(ce,Z,z)}),oe(y,L.normalize)&&!oe(y,L.arrays)&&[y].concat(L.aliases[y]||[]).forEach(function(Z){Object.defineProperty(Fe,Z,{enumerable:!0,get(){return T},set(re){T=typeof re=="string"?mixin.normalize(re):re}})})}function ie(y,T){L.aliases[y]&&L.aliases[y].length||(L.aliases[y]=[T],U[T]=!0),L.aliases[T]&&L.aliases[T].length||ie(T,y)}function X(y,T,Q){Q&&(T=stripQuotes(T)),(oe(y,L.bools)||oe(y,L.counts))&&typeof T=="string"&&(T=T==="true");let z=Array.isArray(T)?T.map(function(N){return te(y,N)}):te(y,T);return oe(y,L.counts)&&(_e(z)||typeof z=="boolean")&&(z=increment()),oe(y,L.normalize)&&oe(y,L.arrays)&&(Array.isArray(T)?z=T.map(N=>mixin.normalize(N)):z=mixin.normalize(T)),z}function te(y,T){return!l["parse-positional-numbers"]&&y==="_"||!oe(y,L.strings)&&!oe(y,L.bools)&&!Array.isArray(T)&&(looksLikeNumber(T)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!_e(T)&&oe(y,L.numbers))&&(T=Number(T)),T}function le(y){const T=Object.create(null);ge(T,L.aliases,d),Object.keys(L.configs).forEach(function(Q){const z=y[Q]||T[Q];if(z)try{let N=null;const ne=mixin.resolve(mixin.cwd(),z),Z=L.configs[Q];if(typeof Z=="function"){try{N=Z(ne)}catch(re){N=re}if(N instanceof Error){ae=N;return}}else N=mixin.require(ne);he(N)}catch(N){N.name==="PermissionDenied"?ae=N:y[Q]&&(ae=Error(W("Invalid JSON config file: %s",z)))}})}function he(y,T){Object.keys(y).forEach(function(Q){const z=y[Q],N=T?T+"."+Q:Q;typeof z=="object"&&z!==null&&!Array.isArray(z)&&l["dot-notation"]?he(z,N):(!Oe(ce,N.split("."))||oe(N,L.arrays)&&l["combine-arrays"])&&pe(N,z)})}function Ae(){typeof B<"u"&&B.forEach(function(y){he(y)})}function de(y,T){if(typeof w>"u")return;const Q=typeof w=="string"?w:"",z=mixin.env();Object.keys(z).forEach(function(N){if(Q===""||N.lastIndexOf(Q,0)===0){const ne=N.split("__").map(function(Z,re){return re===0&&(Z=Z.substring(Q.length)),camelCase(Z)});(T&&L.configs[ne.join(".")]||!T)&&!Oe(y,ne)&&pe(ne.join("."),z[N])}})}function Ee(y){let T;const Q=new Set;Object.keys(y).forEach(function(z){if(!Q.has(z)&&(T=oe(z,L.coercions),typeof T=="function"))try{const N=te(z,T(y[z]));[].concat(L.aliases[z]||[],z).forEach(ne=>{Q.add(ne),y[ne]=N})}catch(N){ae=N}})}function $e(y){return L.keys.forEach(T=>{~T.indexOf(".")||typeof y[T]>"u"&&(y[T]=void 0)}),y}function ge(y,T,Q,z=!1){Object.keys(Q).forEach(function(N){Oe(y,N.split("."))||(Se(y,N.split("."),Q[N]),z&&(H[N]=!0),(T[N]||[]).forEach(function(ne){Oe(y,ne.split("."))||Se(y,ne.split("."),Q[N])}))})}function Oe(y,T){let Q=y;l["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(N){Q=Q[N]||{}});const z=T[T.length-1];return typeof Q!="object"?!1:z in Q}function Se(y,T,Q){let z=y;l["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(be){be=sanitizeKey(be),typeof z=="object"&&z[be]===void 0&&(z[be]={}),typeof z[be]!="object"||Array.isArray(z[be])?(Array.isArray(z[be])?z[be].push({}):z[be]=[z[be],{}],z=z[be][z[be].length-1]):z=z[be]});const N=sanitizeKey(T[T.length-1]),ne=oe(T.join("."),L.arrays),Z=Array.isArray(Q);let re=l["duplicate-arguments-array"];!re&&oe(N,L.nargs)&&(re=!0,(!_e(z[N])&&L.nargs[N]===1||Array.isArray(z[N])&&z[N].length===L.nargs[N])&&(z[N]=void 0)),Q===increment()?z[N]=increment(z[N]):Array.isArray(z[N])?re&&ne&&Z?z[N]=l["flatten-duplicate-arrays"]?z[N].concat(Q):(Array.isArray(z[N][0])?z[N]:[z[N]]).concat([Q]):!re&&!!ne==!!Z?z[N]=Q:z[N]=z[N].concat([Q]):z[N]===void 0&&ne?z[N]=Z?Q:[Q]:re&&!(z[N]===void 0||oe(N,L.counts)||oe(N,L.bools))?z[N]=[z[N],Q]:z[N]=Q}function Ie(...y){y.forEach(function(T){Object.keys(T||{}).forEach(function(Q){L.aliases[Q]||(L.aliases[Q]=[].concat(a[Q]||[]),L.aliases[Q].concat(Q).forEach(function(z){if(/-/.test(z)&&l["camel-case-expansion"]){const N=camelCase(z);N!==Q&&L.aliases[Q].indexOf(N)===-1&&(L.aliases[Q].push(N),U[N]=!0)}}),L.aliases[Q].concat(Q).forEach(function(z){if(z.length>1&&/[A-Z]/.test(z)&&l["camel-case-expansion"]){const N=decamelize(z,"-");N!==Q&&L.aliases[Q].indexOf(N)===-1&&(L.aliases[Q].push(N),U[N]=!0)}}),L.aliases[Q].forEach(function(z){L.aliases[z]=[Q].concat(L.aliases[Q].filter(function(N){return z!==N}))}))})})}function oe(y,T){const Q=[].concat(L.aliases[y]||[],y),z=Object.keys(T),N=Q.find(ne=>z.includes(ne));return N?T[N]:!1}function Pe(y){const T=Object.keys(L);return[].concat(T.map(z=>L[z])).some(function(z){return Array.isArray(z)?z.includes(y):z[y]})}function ue(y,...T){return[].concat(...T).some(function(z){const N=y.match(z);return N&&Pe(N[1])})}function me(y){if(y.match(K)||!y.match(/^-[^-]+/))return!1;let T=!0,Q;const z=y.slice(1).split("");for(let N=0;N<z.length;N++){if(Q=y.slice(N+2),!Pe(z[N])){T=!1;break}if(z[N+1]&&z[N+1]==="="||Q==="-"||/[A-Za-z]/.test(z[N])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(Q)||z[N+1]&&z[N+1].match(/\W/))break}return T}function De(y){return l["unknown-options-as-args"]&&fe(y)}function fe(y){return y=y.replace(/^-{3,}/,"--"),y.match(K)||me(y)?!1:!ue(y,/^-+([^=]+?)=[\s\S]*$/,ee,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Ce(y){return!oe(y,L.bools)&&!oe(y,L.counts)&&`${y}`in d?d[y]:we(Be(y))}function we(y){return{[DefaultValuesForTypeKey.BOOLEAN]:!0,[DefaultValuesForTypeKey.STRING]:"",[DefaultValuesForTypeKey.NUMBER]:void 0,[DefaultValuesForTypeKey.ARRAY]:[]}[y]}function Be(y){let T=DefaultValuesForTypeKey.BOOLEAN;return oe(y,L.strings)?T=DefaultValuesForTypeKey.STRING:oe(y,L.numbers)?T=DefaultValuesForTypeKey.NUMBER:oe(y,L.bools)?T=DefaultValuesForTypeKey.BOOLEAN:oe(y,L.arrays)&&(T=DefaultValuesForTypeKey.ARRAY),T}function _e(y){return y===void 0}function Le(){Object.keys(L.counts).find(y=>oe(y,L.arrays)?(ae=Error(W("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):oe(y,L.nargs)?(ae=Error(W("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},L.aliases),argv:Object.assign(Fe,ce),configuration:l,defaulted:Object.assign({},H),error:ae,newAliases:Object.assign({},U)}}}function combineAliases(i){const e=[],t=Object.create(null);let n=!0;for(Object.keys(i).forEach(function(s){e.push([].concat(i[s],s))});n;){n=!1;for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++)if(e[s].filter(function(l){return e[o].indexOf(l)!==-1}).length){e[s]=e[s].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(s){s=s.filter(function(a,l,d){return d.indexOf(a)===l});const o=s.pop();o!==void 0&&typeof o=="string"&&(t[o]=s)}),t}function increment(i){return i!==void 0?i+1:1}function sanitizeKey(i){return i==="__proto__"?"___proto___":i}function stripQuotes(i){return typeof i=="string"&&(i[0]==="'"||i[0]==='"')&&i[i.length-1]===i[0]?i.substring(1,i.length-1):i}var _a,_b,_c;const minNodeVersion=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,nodeVersion=(_b=(_a=process==null?void 0:process.versions)===null||_a===void 0?void 0:_a.node)!==null&&_b!==void 0?_b:(_c=process==null?void 0:process.version)===null||_c===void 0?void 0:_c.slice(1);if(nodeVersion&&Number(nodeVersion.match(/^([^.]+)/)[1])<minNodeVersion)throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const env=process?process.env:{},parser=new YargsParser({cwd:process.cwd,env:()=>env,format:require$$0$2.format,normalize:require$$0.normalize,resolve:require$$0.resolve,require:i=>{if(typeof require<"u")return require(i);if(i.match(/\.json$/))return JSON.parse(require$$0$1.readFileSync(i,"utf8"));throw Error("only .json config files are supported in ESM")}}),yargsParser=function(e,t){return parser.parse(e.slice(),t).argv};yargsParser.detailed=function(i,e){return parser.parse(i.slice(),e)},yargsParser.camelCase=camelCase,yargsParser.decamelize=decamelize,yargsParser.looksLikeNumber=looksLikeNumber;function getProcessArgvBinIndex(){return isBundledElectronApp()?0:1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(i){return i.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}class YError extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,YError)}}const shim$3={fs:{readFileSync:require$$0$1.readFileSync,writeFile:require$$0$1.writeFile},format:require$$0$2.format,resolve:require$$0.resolve,exists:i=>{try{return require$$0$1.statSync(i).isFile()}catch{return!1}}};let shim$2;class Y18N{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const t=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),shim$2.format.apply(shim$2.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),s=e.shift();let o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=s===1?t:n;this.cache[this.locale][t]&&(a=this.cache[this.locale][t][s===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();const l=[a];return~a.indexOf("%d")&&l.push(s),shim$2.format.apply(shim$2.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(s,o){const a=t[o+1];n+=s,typeof a<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const e=this,t=this.writeQueue[0],n=t.directory,s=t.locale,o=t.cb,a=this._resolveLocaleFile(n,s),l=JSON.stringify(this.cache[s],null,2);shim$2.fs.writeFile(a,l,"utf-8",function(d){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(d)})}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{shim$2.fs.readFileSync&&(e=JSON.parse(shim$2.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=shim$2.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){const s=shim$2.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){return shim$2.exists(e)}}function y18n$1(i,e){shim$2=e;const t=new Y18N(i);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}const y18n=i=>y18n$1(i,shim$3),REQUIRE_ERROR="require is not supported by ESM",REQUIRE_DIRECTORY_ERROR="loading a directory of commands is not supported yet for ESM";let __dirname$1;try{__dirname$1=require$$0$3.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.tagName.toUpperCase()==="SCRIPT"&&_documentCurrentScript.src||new URL("cli/index.cjs",document.baseURI).href)}catch{__dirname$1=process.cwd()}const mainFilename=__dirname$1.substring(0,__dirname$1.lastIndexOf("node_modules")),shim$1={assert:{notStrictEqual:assert.notStrictEqual,strictEqual:assert.strictEqual},cliui:ui,findUp:escalade,getEnv:i=>process.env[i],inspect:require$$0$2.inspect,getCallerFile:()=>{throw new YError(REQUIRE_DIRECTORY_ERROR)},getProcessArgvBin,mainFilename:mainFilename||process.cwd(),Parser:yargsParser,path:{basename:require$$0.basename,dirname:require$$0.dirname,extname:require$$0.extname,relative:require$$0.relative,resolve:require$$0.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(i,e)=>process.emitWarning(i,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:require$$0$1.readFileSync,require:()=>{throw new YError(REQUIRE_ERROR)},requireDirectory:()=>{throw new YError(REQUIRE_DIRECTORY_ERROR)},stringWidth:i=>[...i].length,y18n:y18n({directory:require$$0.resolve(__dirname$1,"../../../locales"),updateFiles:!1})};function assertNotStrictEqual(i,e,t,n){t.assert.notStrictEqual(i,e,n)}function assertSingleKey(i,e){e.assert.strictEqual(typeof i,"string")}function objectKeys(i){return Object.keys(i)}function isPromise(i){return!!i&&!!i.then&&typeof i.then=="function"}function parseCommand(i){const t=i.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=t.shift();if(!s)throw new Error(`No command found in: ${i}`);const o={cmd:s.replace(n,""),demanded:[],optional:[]};return t.forEach((a,l)=>{let d=!1;a=a.replace(/\s/g,""),/\.+[\]>]/.test(a)&&l===t.length-1&&(d=!0),/^\[/.test(a)?o.optional.push({cmd:a.replace(n,"").split("|"),variadic:d}):o.demanded.push({cmd:a.replace(n,"").split("|"),variadic:d})}),o}const positionName=["first","second","third","fourth","fifth","sixth"];function argsert(i,e,t){function n(){return typeof i=="object"?[{demanded:[],optional:[]},i,e]:[parseCommand(`cmd ${i}`),e,t]}try{let s=0;const[o,a,l]=n(),d=[].slice.call(a);for(;d.length&&d[d.length-1]===void 0;)d.pop();const B=l||d.length;if(B<o.demanded.length)throw new YError(`Not enough arguments provided. Expected ${o.demanded.length} but received ${d.length}.`);const w=o.demanded.length+o.optional.length;if(B>w)throw new YError(`Too many arguments provided. Expected max ${w} but received ${B}.`);o.demanded.forEach(E=>{const _=d.shift(),U=guessType(_);E.cmd.filter(W=>W===U||W==="*").length===0&&argumentTypeError(U,E.cmd,s),s+=1}),o.optional.forEach(E=>{if(d.length===0)return;const _=d.shift(),U=guessType(_);E.cmd.filter(W=>W===U||W==="*").length===0&&argumentTypeError(U,E.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function guessType(i){return Array.isArray(i)?"array":i===null?"null":typeof i}function argumentTypeError(i,e,t){throw new YError(`Invalid ${positionName[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${i}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,s=!1){if(argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");const a=e[o];a.applyBeforeValidation=t,a.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){const o=e;o.applyBeforeValidation=t,o.global=n,o.mutates=s,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const o=[...n[t]||[],t];return s.option?!o.includes(s.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}}function commandMiddlewareFactory(i){return i?i.map(e=>(e.applyBeforeValidation=!1,e)):[]}function applyMiddleware(i,e,t,n){return t.reduce((s,o)=>{if(o.applyBeforeValidation!==n)return s;if(o.mutates){if(o.applied)return s;o.applied=!0}if(isPromise(s))return s.then(a=>Promise.all([a,o(a,e)])).then(([a,l])=>Object.assign(a,l));{const a=o(s,e);return isPromise(a)?a.then(l=>Object.assign(s,l)):Object.assign(s,a)}},i)}function maybeAsyncResult(i,e,t=n=>{throw n}){try{const n=isFunction(i)?i():i;return isPromise(n)?n.then(s=>e(s)):e(n)}catch(n){return t(n)}}function isFunction(i){return typeof i=="function"}function whichModule(i){if(typeof require>"u")return null;for(let e=0,t=Object.keys(require.cache),n;e<t.length;e++)if(n=require.cache[t[e]],n.exports===i)return n;return null}const DEFAULT_MARKER=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const o=typeof s.visit=="function"?s.visit:a=>a;s.visit=(a,l,d)=>{const B=o(a,l,d);if(B){if(this.requireCache.has(l))return B;this.requireCache.add(l),this.addHandler(B)}return B},this.shim.requireDirectory({require:t,filename:n},e,s)}addHandler(e,t,n,s,o,a){let l=[];const d=commandMiddlewareFactory(o);if(s=s||(()=>{}),Array.isArray(e))if(isCommandAndAliases(e))[e,...l]=e;else for(const B of e)this.addHandler(B);else if(isCommandHandlerDefinition(e)){let B=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(B=[].concat(B).concat(e.aliases)),this.addHandler(B,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(n)){this.addHandler([e].concat(l),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){const B=parseCommand(e);l=l.map(_=>parseCommand(_).cmd);let w=!1;const E=[B.cmd].concat(l).filter(_=>DEFAULT_MARKER.test(_)?(w=!0,!1):!0);E.length===0&&w&&E.push("$0"),w&&(B.cmd=E[0],l=E.slice(1),e=e.replace(DEFAULT_MARKER,B.cmd)),l.forEach(_=>{this.aliasMap[_]=B.cmd}),t!==!1&&this.usage.command(e,t,w,l,a),this.handlers[B.cmd]={original:e,description:t,handler:s,builder:n||{},middlewares:d,deprecated:a,demanded:B.demanded,optional:B.optional},w&&(this.defaultCommand=this.handlers[B.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,s,o,a){const l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,d=t.getInternalMethods().getContext(),B=d.commands.slice(),w=!e;e&&(d.commands.push(e),d.fullCommands.push(l.original));const E=this.applyBuilderUpdateUsageAndParse(w,l,t,n.aliases,B,s,o,a);return isPromise(E)?E.then(_=>this.applyMiddlewareAndGetResult(w,l,_.innerArgv,d,o,_.aliases,t)):this.applyMiddlewareAndGetResult(w,l,E.innerArgv,d,o,E.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,s,o,a,l,d){const B=t.builder;let w=n;if(isCommandBuilderCallback(B)){n.getInternalMethods().getUsageInstance().freeze();const E=B(n.getInternalMethods().reset(s),d);if(isPromise(E))return E.then(_=>(w=isYargsInstance(_)?_:n,this.parseAndUpdateUsage(e,t,w,o,a,l)))}else isCommandBuilderOptionDefinitions(B)&&(n.getInternalMethods().getUsageInstance().freeze(),w=n.getInternalMethods().reset(s),Object.keys(t.builder).forEach(E=>{w.option(E,B[E])}));return this.parseAndUpdateUsage(e,t,w,o,a,l)}parseAndUpdateUsage(e,t,n,s,o,a){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,t),t.description);const l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,a);return isPromise(l)?l.then(d=>({aliases:n.parsed.aliases,innerArgv:d})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const n=DEFAULT_MARKER.test(t.original)?t.original.replace(DEFAULT_MARKER,"").trim():t.original,s=e.filter(o=>!DEFAULT_MARKER.test(o));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(e,t,n,s,o,a,l,d){if(!a.getInternalMethods().getHasOutput()){const B=a.getInternalMethods().runValidation(o,d,a.parsed.error,e);n=maybeAsyncResult(n,w=>(B(w),w))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();const B=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(n,B,!1,!1),n=applyMiddleware(n,a,l,!1),n=maybeAsyncResult(n,w=>{const E=t.handler(w);return isPromise(E)?E.then(()=>w):w}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),isPromise(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(w=>{try{a.getInternalMethods().getUsageInstance().fail(null,w)}catch{}})}return e||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,s,o,a,l){let d={};if(o)return n;l.getInternalMethods().getHasOutput()||(d=this.populatePositionals(t,n,s,l));const B=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),w=applyMiddleware(n,l,B,!0);return isPromise(w)?w.then(E=>this.handleValidationAndGetResult(e,t,E,s,a,l,B,d)):this.handleValidationAndGetResult(e,t,w,s,a,l,B,d)}populatePositionals(e,t,n,s){t._=t._.slice(n.commands.length);const o=e.demanded.slice(0),a=e.optional.slice(0),l={};for(this.validation.positionalCount(o.length,t._.length);o.length;){const d=o.shift();this.populatePositional(d,t,l)}for(;a.length;){const d=a.shift();this.populatePositional(d,t,l)}return t._=n.commands.concat(t._.map(d=>""+d)),this.postProcessPositionals(t,l,this.cmdToParseOptions(e.original),s),l}populatePositional(e,t,n){const s=e.cmd[0];e.variadic?n[s]=t._.splice(0).map(String):t._.length&&(n[s]=[String(t._.shift())])}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}},n=parseCommand(e);return n.demanded.forEach(s=>{const[o,...a]=s.cmd;s.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=a,t.demand[o]=!0}),n.optional.forEach(s=>{const[o,...a]=s.cmd;s.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=a}),t}postProcessPositionals(e,t,n,s){const o=Object.assign({},s.getOptions());o.default=Object.assign(n.default,o.default);for(const B of Object.keys(n.alias))o.alias[B]=(o.alias[B]||[]).concat(n.alias[B]);o.array=o.array.concat(n.array),o.config={};const a=[];if(Object.keys(t).forEach(B=>{t[B].map(w=>{o.configuration["unknown-options-as-args"]&&(o.key[B]=!0),a.push(`--${B}`),a.push(w)})}),!a.length)return;const l=Object.assign({},o.configuration,{"populate--":!1}),d=this.shim.Parser.detailed(a,Object.assign({},o,{configuration:l}));if(d.error)s.getInternalMethods().getUsageInstance().fail(d.error.message,d.error);else{const B=Object.keys(t);Object.keys(t).forEach(w=>{B.push(...d.aliases[w])}),Object.keys(d.argv).forEach(w=>{B.includes(w)&&(t[w]||(t[w]=d.argv[w]),!this.isInConfigs(s,w)&&!this.isDefaulted(s,w)&&Object.prototype.hasOwnProperty.call(e,w)&&Object.prototype.hasOwnProperty.call(d.argv,w)&&(Array.isArray(e[w])||Array.isArray(d.argv[w]))?e[w]=[].concat(e[w],d.argv[w]):e[w]=d.argv[w])})}}isDefaulted(e,t){const{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:n}=e.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,t))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=DEFAULT_MARKER.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t))return t(e,!0);isCommandBuilderDefinition(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){const t=whichModule(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(const s of[e,t,n]){if(typeof s=="string"||s===!1)return s;assertNotStrictEqual(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function command(i,e,t,n){return new CommandInstance(i,e,t,n)}function isCommandBuilderDefinition(i){return typeof i=="object"&&!!i.builder&&typeof i.handler=="function"}function isCommandAndAliases(i){return i.every(e=>typeof e=="string")}function isCommandBuilderCallback(i){return typeof i=="function"}function isCommandBuilderOptionDefinitions(i){return typeof i=="object"}function isCommandHandlerDefinition(i){return typeof i=="object"&&!Array.isArray(i)}function objFilter(i={},e=()=>!0){const t={};return objectKeys(i).forEach(n=>{e(n,i[n])&&(t[n]=i[n])}),t}function setBlocking(i){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(i)})}function isBoolean(i){return typeof i=="boolean"}function usage(i,e){const t=e.y18n.__,n={},s=[];n.failFn=function(X){s.push(X)};let o=null,a=null,l=!0;n.showHelpOnFail=function(X=!0,te){const[le,he]=typeof X=="string"?[!0,X]:[X,te];return i.getInternalMethods().isGlobalContext()&&(a=he),o=he,l=le,n};let d=!1;n.fail=function(X,te){const le=i.getInternalMethods().getLoggerInstance();if(s.length)for(let he=s.length-1;he>=0;--he){const Ae=s[he];if(isBoolean(Ae)){if(te)throw te;if(X)throw Error(X)}else Ae(X,te,n)}else{if(i.getExitProcess()&&setBlocking(!0),!d){d=!0,l&&(i.showHelp("error"),le.error()),(X||te)&&le.error(X||te);const he=o||a;he&&((X||te)&&le.error(""),le.error(he))}if(te=te||new YError(X),i.getExitProcess())return i.exit(1);if(i.getInternalMethods().hasParseCallback())return i.exit(1,te);throw te}};let B=[],w=!1;n.usage=(ie,X)=>ie===null?(w=!0,B=[],n):(w=!1,B.push([ie,X||""]),n),n.getUsage=()=>B,n.getUsageDisabled=()=>w,n.getPositionalGroupName=()=>t("Positionals:");let E=[];n.example=(ie,X)=>{E.push([ie,X||""])};let _=[];n.command=function(X,te,le,he,Ae=!1){le&&(_=_.map(de=>(de[2]=!1,de))),_.push([X,te||"",le,he,Ae])},n.getCommands=()=>_;let U={};n.describe=function(X,te){Array.isArray(X)?X.forEach(le=>{n.describe(le,te)}):typeof X=="object"?Object.keys(X).forEach(le=>{n.describe(le,X[le])}):U[X]=te},n.getDescriptions=()=>U;let H=[];n.epilog=ie=>{H.push(ie)};let W=!1,L;n.wrap=ie=>{W=!0,L=ie},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(W||(L=je(),W=!0),L);const K="__yargsString__:";n.deferY18nLookup=ie=>K+ie,n.help=function(){if(se)return se;ae();const X=i.customScriptName?i.$0:e.path.basename(i.$0),te=i.getDemandedOptions(),le=i.getDemandedCommands(),he=i.getDeprecatedOptions(),Ae=i.getGroups(),de=i.getOptions();let Ee=[];Ee=Ee.concat(Object.keys(U)),Ee=Ee.concat(Object.keys(te)),Ee=Ee.concat(Object.keys(le)),Ee=Ee.concat(Object.keys(de.default)),Ee=Ee.filter(Fe),Ee=Object.keys(Ee.reduce((ue,me)=>(me!=="_"&&(ue[me]=!0),ue),{}));const $e=n.getWrap(),ge=e.cliui({width:$e,wrap:!!$e});if(!w){if(B.length)B.forEach(ue=>{ge.div({text:`${ue[0].replace(/\$0/g,X)}`}),ue[1]&&ge.div({text:`${ue[1]}`,padding:[1,0,0,0]})}),ge.div();else if(_.length){let ue=null;le._?ue=`${X} <${t("command")}>
8
- `:ue=`${X} [${t("command")}]
9
- `,ge.div(`${ue}`)}}if(_.length>1||_.length===1&&!_[0][2]){ge.div(t("Commands:"));const ue=i.getInternalMethods().getContext(),me=ue.commands.length?`${ue.commands.join(" ")} `:"";i.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(_=_.sort((fe,Ce)=>fe[0].localeCompare(Ce[0])));const De=X?`${X} `:"";_.forEach(fe=>{const Ce=`${De}${me}${fe[0].replace(/^\$0 ?/,"")}`;ge.span({text:Ce,padding:[0,2,0,2],width:ee(_,$e,`${X}${me}`)+4},{text:fe[1]});const we=[];fe[2]&&we.push(`[${t("default")}]`),fe[3]&&fe[3].length&&we.push(`[${t("aliases:")} ${fe[3].join(", ")}]`),fe[4]&&(typeof fe[4]=="string"?we.push(`[${t("deprecated: %s",fe[4])}]`):we.push(`[${t("deprecated")}]`)),we.length?ge.div({text:we.join(" "),padding:[0,0,0,2],align:"right"}):ge.div()}),ge.div()}const Oe=(Object.keys(de.alias)||[]).concat(Object.keys(i.parsed.newAliases)||[]);Ee=Ee.filter(ue=>!i.parsed.newAliases[ue]&&Oe.every(me=>(de.alias[me]||[]).indexOf(ue)===-1));const Se=t("Options:");Ae[Se]||(Ae[Se]=[]),ce(Ee,de.alias,Ae,Se);const Ie=ue=>/^--/.test(getText(ue)),oe=Object.keys(Ae).filter(ue=>Ae[ue].length>0).map(ue=>{const me=Ae[ue].filter(Fe).map(De=>{if(Oe.includes(De))return De;for(let fe=0,Ce;(Ce=Oe[fe])!==void 0;fe++)if((de.alias[Ce]||[]).includes(De))return Ce;return De});return{groupName:ue,normalizedKeys:me}}).filter(({normalizedKeys:ue})=>ue.length>0).map(({groupName:ue,normalizedKeys:me})=>{const De=me.reduce((fe,Ce)=>(fe[Ce]=[Ce].concat(de.alias[Ce]||[]).map(we=>ue===n.getPositionalGroupName()?we:(/^[0-9]$/.test(we)?de.boolean.includes(Ce)?"-":"--":we.length>1?"--":"-")+we).sort((we,Be)=>Ie(we)===Ie(Be)?0:Ie(we)?1:-1).join(", "),fe),{});return{groupName:ue,normalizedKeys:me,switches:De}});if(oe.filter(({groupName:ue})=>ue!==n.getPositionalGroupName()).some(({normalizedKeys:ue,switches:me})=>!ue.every(De=>Ie(me[De])))&&oe.filter(({groupName:ue})=>ue!==n.getPositionalGroupName()).forEach(({normalizedKeys:ue,switches:me})=>{ue.forEach(De=>{Ie(me[De])&&(me[De]=addIndentation(me[De],4))})}),oe.forEach(({groupName:ue,normalizedKeys:me,switches:De})=>{ge.div(ue),me.forEach(fe=>{const Ce=De[fe];let we=U[fe]||"",Be=null;we.includes(K)&&(we=t(we.substring(K.length))),de.boolean.includes(fe)&&(Be=`[${t("boolean")}]`),de.count.includes(fe)&&(Be=`[${t("count")}]`),de.string.includes(fe)&&(Be=`[${t("string")}]`),de.normalize.includes(fe)&&(Be=`[${t("string")}]`),de.array.includes(fe)&&(Be=`[${t("array")}]`),de.number.includes(fe)&&(Be=`[${t("number")}]`);const _e=T=>typeof T=="string"?`[${t("deprecated: %s",T)}]`:`[${t("deprecated")}]`,Le=[fe in he?_e(he[fe]):null,Be,fe in te?`[${t("required")}]`:null,de.choices&&de.choices[fe]?`[${t("choices:")} ${n.stringifiedValues(de.choices[fe])}]`:null,ve(de.default[fe],de.defaultDescription[fe])].filter(Boolean).join(" ");ge.span({text:getText(Ce),padding:[0,2,0,2+getIndentation(Ce)],width:ee(De,$e)+4},we);const y=i.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Le&&!y?ge.div({text:Le,padding:[0,0,0,2],align:"right"}):ge.div()}),ge.div()}),E.length&&(ge.div(t("Examples:")),E.forEach(ue=>{ue[0]=ue[0].replace(/\$0/g,X)}),E.forEach(ue=>{ue[1]===""?ge.div({text:ue[0],padding:[0,2,0,2]}):ge.div({text:ue[0],padding:[0,2,0,2],width:ee(E,$e)+4},{text:ue[1]})}),ge.div()),H.length>0){const ue=H.map(me=>me.replace(/\$0/g,X)).join(`
10
- `);ge.div(`${ue}
11
- `)}return ge.toString().replace(/\s*$/,"")};function ee(ie,X,te){let le=0;return Array.isArray(ie)||(ie=Object.values(ie).map(he=>[he])),ie.forEach(he=>{le=Math.max(e.stringWidth(te?`${te} ${getText(he[0])}`:getText(he[0]))+getIndentation(he[0]),le)}),X&&(le=Math.min(le,parseInt((X*.5).toString(),10))),le}function ae(){const ie=i.getDemandedOptions(),X=i.getOptions();(Object.keys(X.alias)||[]).forEach(te=>{X.alias[te].forEach(le=>{U[le]&&n.describe(te,U[le]),le in ie&&i.demandOption(te,ie[le]),X.boolean.includes(le)&&i.boolean(te),X.count.includes(le)&&i.count(te),X.string.includes(le)&&i.string(te),X.normalize.includes(le)&&i.normalize(te),X.array.includes(le)&&i.array(te),X.number.includes(le)&&i.number(te)})})}let se;n.cacheHelpMessage=function(){se=this.help()},n.clearCachedHelpMessage=function(){se=void 0},n.hasCachedHelpMessage=function(){return!!se};function ce(ie,X,te,le){let he=[],Ae=null;return Object.keys(te).forEach(de=>{he=he.concat(te[de])}),ie.forEach(de=>{Ae=[de].concat(X[de]),Ae.some(Ee=>he.indexOf(Ee)!==-1)||te[le].push(de)}),he}function Fe(ie){return i.getOptions().hiddenOptions.indexOf(ie)<0||i.parsed.argv[i.getOptions().showHiddenOpt]}n.showHelp=ie=>{const X=i.getInternalMethods().getLoggerInstance();ie||(ie="error"),(typeof ie=="function"?ie:X[ie])(n.help())},n.functionDescription=ie=>["(",ie.name?e.Parser.decamelize(ie.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(X,te){let le="";const he=te||", ",Ae=[].concat(X);return!X||!Ae.length||Ae.forEach(de=>{le.length&&(le+=he),le+=JSON.stringify(de)}),le};function ve(ie,X){let te=`[${t("default:")} `;if(ie===void 0&&!X)return null;if(X)te+=X;else switch(typeof ie){case"string":te+=`"${ie}"`;break;case"object":te+=JSON.stringify(ie);break;default:te+=ie}return`${te}]`}function je(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let xe=null;n.version=ie=>{xe=ie},n.showVersion=ie=>{const X=i.getInternalMethods().getLoggerInstance();ie||(ie="error"),(typeof ie=="function"?ie:X[ie])(xe)},n.reset=function(X){return o=null,d=!1,B=[],w=!1,H=[],E=[],_=[],U=objFilter(U,te=>!X[te]),n};const pe=[];return n.freeze=function(){pe.push({failMessage:o,failureOutput:d,usages:B,usageDisabled:w,epilogs:H,examples:E,commands:_,descriptions:U})},n.unfreeze=function(X=!1){const te=pe.pop();te&&(X?(U={...te.descriptions,...U},_=[...te.commands,..._],B=[...te.usages,...B],E=[...te.examples,...E],H=[...te.epilogs,...H]):{failMessage:o,failureOutput:d,usages:B,usageDisabled:w,epilogs:H,examples:E,commands:_,descriptions:U}=te)},n}function isIndentedText(i){return typeof i=="object"}function addIndentation(i,e){return isIndentedText(i)?{text:i.text,indentation:i.indentation+e}:{text:i,indentation:e}}function getIndentation(i){return isIndentedText(i)?i.indentation:0}function getText(i){return isIndentedText(i)?i.text:i}const completionShTemplate=`###-begin-{{app_name}}-completions-###
2
+ "use strict";const LikeC4=require("../shared/likec4.32ndthTo.cjs"),process$1=require("node:process"),assert=require("assert"),require$$0=require("path"),require$$0$1=require("fs"),require$$0$2=require("util"),require$$0$3=require("url"),path$1=require("node:path"),fs=require("node:fs"),fsPromises=require("node:fs/promises"),os=require("node:os"),node_url=require("node:url"),c$1=require("@vitejs/plugin-react-swc"),core=require("@likec4/core"),vite=require("vite"),playwright=require("playwright"),net=require("node:net"),promises=require("node:timers/promises");require("tty"),require("node:util"),require("os"),require("crypto"),require("net"),require("child_process"),require("node:tty"),require("@likec4/core/types"),require("events"),require("buffer"),require("@hpcc-js/wasm-graphviz"),require("@likec4/core/compute-view"),require("node:child_process"),require("node:string_decoder"),require("node:events"),require("node:v8"),require("node:stream"),require("node:buffer"),require("node:stream/promises"),require("@likec4/core/model");var _documentCurrentScript=typeof document<"u"?document.currentScript:null;function _interopDefaultCompat(i){return i&&typeof i=="object"&&"default"in i?i.default:i}const process__default=_interopDefaultCompat(process$1),require$$0__default$1=_interopDefaultCompat(require$$0),require$$0__default=_interopDefaultCompat(require$$0$2),path__default=_interopDefaultCompat(path$1),fs__default=_interopDefaultCompat(fs),os__default=_interopDefaultCompat(os),c__default=_interopDefaultCompat(c$1),net__default=_interopDefaultCompat(net),align={right:alignRight,center:alignCenter},top=0,right=1,bottom=2,left=3;class UI{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){const t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);const t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split(`
3
+ `).map(s=>s.split(" "));let n=0;return t.forEach(s=>{s.length>1&&mixin$1.stringWidth(s[0])>n&&(n=Math.min(Math.floor(this.width*.5),mixin$1.stringWidth(s[0])))}),t.forEach(s=>{this.div(...s.map((a,o)=>({text:a.trim(),padding:this.measurePadding(a),width:o===0&&s.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=mixin$1.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
4
+ `)}rowToString(e,t){return this.rasterize(e).forEach((n,s)=>{let a="";n.forEach((o,l)=>{const{width:f}=e[l],E=this.negatePadding(e[l]);let w=o;if(E>mixin$1.stringWidth(o)&&(w+=" ".repeat(E-mixin$1.stringWidth(o))),e[l].align&&e[l].align!=="left"&&this.wrap){const d=align[e[l].align];w=d(w,E),mixin$1.stringWidth(w)<E&&(w+=" ".repeat((f||0)-mixin$1.stringWidth(w)-1))}const y=e[l].padding||[0,0,0,0];y[left]&&(a+=" ".repeat(y[left])),a+=addBorder(e[l],w,"| "),a+=w,a+=addBorder(e[l],w," |"),y[right]&&(a+=" ".repeat(y[right])),s===0&&t.length>0&&(a=this.renderInline(a,t[t.length-1]))}),t.push({text:a.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){const n=e.match(/^ */),s=n?n[0].length:0,a=t.text,o=mixin$1.stringWidth(a.trimRight());return t.span?this.wrap?s<o?e:(t.hidden=!0,a.trimRight()+" ".repeat(s-o)+e.trimLeft()):(t.hidden=!0,a+e):e}rasterize(e){const t=[],n=this.columnWidths(e);let s;return e.forEach((a,o)=>{a.width=n[o],this.wrap?s=mixin$1.wrap(a.text,this.negatePadding(a),{hard:!0}).split(`
5
+ `):s=a.text.split(`
6
+ `),a.border&&(s.unshift("."+"-".repeat(this.negatePadding(a)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(a)+2)+"'")),a.padding&&(s.unshift(...new Array(a.padding[top]||0).fill("")),s.push(...new Array(a.padding[bottom]||0).fill(""))),s.forEach((l,f)=>{t[f]||t.push([]);const E=t[f];for(let w=0;w<o;w++)E[w]===void 0&&E.push("");E.push(l)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[left]||0)+(e.padding[right]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||mixin$1.stringWidth(o.text));let t=e.length,n=this.width;const s=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),a=t?Math.floor(n/t):0;return s.map((o,l)=>o===void 0?Math.max(a,_minWidth(e[l])):o)}}function addBorder(i,e,t){return i.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function _minWidth(i){const e=i.padding||[],t=1+(e[left]||0)+(e[right]||0);return i.border?t+4:t}function getWindowWidth(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function alignRight(i,e){i=i.trim();const t=mixin$1.stringWidth(i);return t<e?" ".repeat(e-t)+i:i}function alignCenter(i,e){i=i.trim();const t=mixin$1.stringWidth(i);return t>=e?i:" ".repeat(e-t>>1)+i}let mixin$1;function cliui(i,e){return mixin$1=e,new UI({width:i?.width||getWindowWidth(),wrap:i?.wrap})}const ansi=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function stripAnsi(i){return i.replace(ansi,"")}function wrap(i,e){const[t,n]=i.match(ansi)||["",""];i=stripAnsi(i);let s="";for(let a=0;a<i.length;a++)a!==0&&a%e===0&&(s+=`
7
+ `),s+=i.charAt(a);return t&&n&&(s=`${t}${s}${n}`),s}function ui(i){return cliui(i,{stringWidth:e=>[...e].length,stripAnsi,wrap})}function escalade(i,e){let t=require$$0.resolve(".",i),n;for(require$$0$1.statSync(t).isDirectory()||(t=require$$0.dirname(t));;){if(n=e(t,require$$0$1.readdirSync(t)),n)return require$$0.resolve(t,n);if(t=require$$0.dirname(n=t),n===t)break}}function camelCase(i){if(i!==i.toLowerCase()&&i!==i.toUpperCase()||(i=i.toLowerCase()),i.indexOf("-")===-1&&i.indexOf("_")===-1)return i;{let t="",n=!1;const s=i.match(/^-+/);for(let a=s?s[0].length:0;a<i.length;a++){let o=i.charAt(a);n&&(n=!1,o=o.toUpperCase()),a!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function decamelize(i,e){const t=i.toLowerCase();e=e||"-";let n="";for(let s=0;s<i.length;s++){const a=t.charAt(s),o=i.charAt(s);a!==o&&s>0?n+=`${e}${t.charAt(s)}`:n+=o}return n}function looksLikeNumber(i){return i==null?!1:typeof i=="number"||/^0x[0-9a-f]+$/i.test(i)?!0:/^0[^.]/.test(i)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i)}function tokenizeArgString(i){if(Array.isArray(i))return i.map(o=>typeof o!="string"?o+"":o);i=i.trim();let e=0,t=null,n=null,s=null;const a=[];for(let o=0;o<i.length;o++){if(t=n,n=i.charAt(o),n===" "&&!s){t!==" "&&e++;continue}n===s?s=null:(n==="'"||n==='"')&&!s&&(s=n),a[e]||(a[e]=""),a[e]+=n}return a}var DefaultValuesForTypeKey;(function(i){i.BOOLEAN="boolean",i.STRING="string",i.NUMBER="number",i.ARRAY="array"})(DefaultValuesForTypeKey||(DefaultValuesForTypeKey={}));let mixin;class YargsParser{constructor(e){mixin=e}parse(e,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),s=tokenizeArgString(e),a=typeof e=="string",o=combineAliases(Object.assign(Object.create(null),n.alias)),l=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),f=Object.assign(Object.create(null),n.default),E=n.configObjects||[],w=n.envPrefix,y=l["populate--"],d=y?"--":"_",H=Object.create(null),Q=Object.create(null),W=n.__||mixin.format,_={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},U=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,te=new RegExp("^--"+l["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(L){const N=typeof L=="object"?L.key:L,oe=Object.keys(L).map(function(ie){return{boolean:"bools",string:"strings",number:"numbers"}[ie]}).filter(Boolean).pop();oe&&(_[oe][N]=!0),_.arrays[N]=!0,_.keys.push(N)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(L){_.bools[L]=!0,_.keys.push(L)}),[].concat(n.string||[]).filter(Boolean).forEach(function(L){_.strings[L]=!0,_.keys.push(L)}),[].concat(n.number||[]).filter(Boolean).forEach(function(L){_.numbers[L]=!0,_.keys.push(L)}),[].concat(n.count||[]).filter(Boolean).forEach(function(L){_.counts[L]=!0,_.keys.push(L)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(L){_.normalize[L]=!0,_.keys.push(L)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([L,N])=>{typeof N=="number"&&(_.nargs[L]=N,_.keys.push(L))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([L,N])=>{typeof N=="function"&&(_.coercions[L]=N,_.keys.push(L))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(L){_.configs[L]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([L,N])=>{(typeof N=="boolean"||typeof N=="function")&&(_.configs[L]=N)})),Re(n.key,o,n.default,_.arrays),Object.keys(f).forEach(function(L){(_.aliases[L]||[]).forEach(function(N){f[N]=f[L]})});let T=null;Ne();let X=[];const K=Object.assign(Object.create(null),{_:[]}),le={};for(let L=0;L<s.length;L++){const N=s[L],oe=N.replace(/^-{3,}/,"---");let ie,B,fe,Z,ce,ve;if(N!=="--"&&/^-/.test(N)&&Ee(N))re(N);else if(oe.match(/^---+(=|$)/)){re(N);continue}else if(N.match(/^--.+=/)||!l["short-option-groups"]&&N.match(/^-.+=/))Z=N.match(/^--?([^=]+)=([\s\S]*)$/),Z!==null&&Array.isArray(Z)&&Z.length>=3&&(Ce(Z[1],_.arrays)?L=De(L,Z[1],s,Z[2]):Ce(Z[1],_.nargs)!==!1?L=he(L,Z[1],s,Z[2]):ge(Z[1],Z[2],!0));else if(N.match(te)&&l["boolean-negation"])Z=N.match(te),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(B=Z[1],ge(B,Ce(B,_.arrays)?[!1]:!1));else if(N.match(/^--.+/)||!l["short-option-groups"]&&N.match(/^-[^-]+/))Z=N.match(/^--?(.+)/),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(B=Z[1],Ce(B,_.arrays)?L=De(L,B,s):Ce(B,_.nargs)!==!1?L=he(L,B,s):(ce=s[L+1],ce!==void 0&&(!ce.match(/^-/)||ce.match(U))&&!Ce(B,_.bools)&&!Ce(B,_.counts)||/^(true|false)$/.test(ce)?(ge(B,ce),L++):ge(B,xe(B))));else if(N.match(/^-.\..+=/))Z=N.match(/^-([^=]+)=([\s\S]*)$/),Z!==null&&Array.isArray(Z)&&Z.length>=3&&ge(Z[1],Z[2]);else if(N.match(/^-.\..+/)&&!N.match(U))ce=s[L+1],Z=N.match(/^-(.\..+)/),Z!==null&&Array.isArray(Z)&&Z.length>=2&&(B=Z[1],ce!==void 0&&!ce.match(/^-/)&&!Ce(B,_.bools)&&!Ce(B,_.counts)?(ge(B,ce),L++):ge(B,xe(B)));else if(N.match(/^-[^-]+/)&&!N.match(U)){fe=N.slice(1,-1).split(""),ie=!1;for(let $e=0;$e<fe.length;$e++){if(ce=N.slice($e+2),fe[$e+1]&&fe[$e+1]==="="){ve=N.slice($e+3),B=fe[$e],Ce(B,_.arrays)?L=De(L,B,s,ve):Ce(B,_.nargs)!==!1?L=he(L,B,s,ve):ge(B,ve),ie=!0;break}if(ce==="-"){ge(fe[$e],ce);continue}if(/[A-Za-z]/.test(fe[$e])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ce)&&Ce(ce,_.bools)===!1){ge(fe[$e],ce),ie=!0;break}if(fe[$e+1]&&fe[$e+1].match(/\W/)){ge(fe[$e],ce),ie=!0;break}else ge(fe[$e],xe(fe[$e]))}B=N.slice(-1)[0],!ie&&B!=="-"&&(Ce(B,_.arrays)?L=De(L,B,s):Ce(B,_.nargs)!==!1?L=he(L,B,s):(ce=s[L+1],ce!==void 0&&(!/^(-|--)[^-]/.test(ce)||ce.match(U))&&!Ce(B,_.bools)&&!Ce(B,_.counts)||/^(true|false)$/.test(ce)?(ge(B,ce),L++):ge(B,xe(B))))}else if(N.match(/^-[0-9]$/)&&N.match(U)&&Ce(N.slice(1),_.bools))B=N.slice(1),ge(B,xe(B));else if(N==="--"){X=s.slice(L+1);break}else if(l["halt-at-non-option"]){X=s.slice(L);break}else re(N)}pe(K,!0),pe(K,!1),de(K),we(),ye(K,_.aliases,f,!0),Fe(K),l["set-placeholder-key"]&&Oe(K),Object.keys(_.counts).forEach(function(L){ne(K,L.split("."))||ge(L,0)}),y&&X.length&&(K[d]=[]),X.forEach(function(L){K[d].push(L)}),l["camel-case-expansion"]&&l["strip-dashed"]&&Object.keys(K).filter(L=>L!=="--"&&L.includes("-")).forEach(L=>{delete K[L]}),l["strip-aliased"]&&[].concat(...Object.keys(o).map(L=>o[L])).forEach(L=>{l["camel-case-expansion"]&&L.includes("-")&&delete K[L.split(".").map(N=>camelCase(N)).join(".")],delete K[L]});function re(L){const N=ee("_",L);(typeof N=="string"||typeof N=="number")&&K._.push(N)}function he(L,N,oe,ie){let B,fe=Ce(N,_.nargs);if(fe=typeof fe!="number"||isNaN(fe)?1:fe,fe===0)return Le(ie)||(T=Error(W("Argument unexpected for: %s",N))),ge(N,xe(N)),L;let Z=Le(ie)?0:1;if(l["nargs-eats-options"])oe.length-(L+1)+Z<fe&&(T=Error(W("Not enough arguments following: %s",N))),Z=fe;else{for(B=L+1;B<oe.length&&(!oe[B].match(/^-[^0-9]/)||oe[B].match(U)||Ee(oe[B]));B++)Z++;Z<fe&&(T=Error(W("Not enough arguments following: %s",N)))}let ce=Math.min(Z,fe);for(!Le(ie)&&ce>0&&(ge(N,ie),ce--),B=L+1;B<ce+L+1;B++)ge(N,oe[B]);return L+ce}function De(L,N,oe,ie){let B=[],fe=ie||oe[L+1];const Z=Ce(N,_.nargs);if(Ce(N,_.bools)&&!/^(true|false)$/.test(fe))B.push(!0);else if(Le(fe)||Le(ie)&&/^-/.test(fe)&&!U.test(fe)&&!Ee(fe)){if(f[N]!==void 0){const ce=f[N];B=Array.isArray(ce)?ce:[ce]}}else{Le(ie)||B.push(ue(N,ie,!0));for(let ce=L+1;ce<oe.length&&!(!l["greedy-arrays"]&&B.length>0||Z&&typeof Z=="number"&&B.length>=Z||(fe=oe[ce],/^-/.test(fe)&&!U.test(fe)&&!Ee(fe)));ce++)L=ce,B.push(ue(N,fe,a))}return typeof Z=="number"&&(Z&&B.length<Z||isNaN(Z)&&B.length===0)&&(T=Error(W("Not enough arguments following: %s",N))),ge(N,B),L}function ge(L,N,oe=a){if(/-/.test(L)&&l["camel-case-expansion"]){const fe=L.split(".").map(function(Z){return camelCase(Z)}).join(".");ae(L,fe)}const ie=ue(L,N,oe),B=L.split(".");Be(K,B,ie),_.aliases[L]&&_.aliases[L].forEach(function(fe){const Z=fe.split(".");Be(K,Z,ie)}),B.length>1&&l["dot-notation"]&&(_.aliases[B[0]]||[]).forEach(function(fe){let Z=fe.split(".");const ce=[].concat(B);ce.shift(),Z=Z.concat(ce),(_.aliases[L]||[]).includes(Z.join("."))||Be(K,Z,ie)}),Ce(L,_.normalize)&&!Ce(L,_.arrays)&&[L].concat(_.aliases[L]||[]).forEach(function(Z){Object.defineProperty(le,Z,{enumerable:!0,get(){return N},set(ce){N=typeof ce=="string"?mixin.normalize(ce):ce}})})}function ae(L,N){_.aliases[L]&&_.aliases[L].length||(_.aliases[L]=[N],H[N]=!0),_.aliases[N]&&_.aliases[N].length||ae(N,L)}function ue(L,N,oe){oe&&(N=stripQuotes(N)),(Ce(L,_.bools)||Ce(L,_.counts))&&typeof N=="string"&&(N=N==="true");let ie=Array.isArray(N)?N.map(function(B){return ee(L,B)}):ee(L,N);return Ce(L,_.counts)&&(Le(ie)||typeof ie=="boolean")&&(ie=increment()),Ce(L,_.normalize)&&Ce(L,_.arrays)&&(Array.isArray(N)?ie=N.map(B=>mixin.normalize(B)):ie=mixin.normalize(N)),ie}function ee(L,N){return!l["parse-positional-numbers"]&&L==="_"||!Ce(L,_.strings)&&!Ce(L,_.bools)&&!Array.isArray(N)&&(looksLikeNumber(N)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${N}`)))||!Le(N)&&Ce(L,_.numbers))&&(N=Number(N)),N}function de(L){const N=Object.create(null);ye(N,_.aliases,f),Object.keys(_.configs).forEach(function(oe){const ie=L[oe]||N[oe];if(ie)try{let B=null;const fe=mixin.resolve(mixin.cwd(),ie),Z=_.configs[oe];if(typeof Z=="function"){try{B=Z(fe)}catch(ce){B=ce}if(B instanceof Error){T=B;return}}else B=mixin.require(fe);me(B)}catch(B){B.name==="PermissionDenied"?T=B:L[oe]&&(T=Error(W("Invalid JSON config file: %s",ie)))}})}function me(L,N){Object.keys(L).forEach(function(oe){const ie=L[oe],B=N?N+"."+oe:oe;typeof ie=="object"&&ie!==null&&!Array.isArray(ie)&&l["dot-notation"]?me(ie,B):(!ne(K,B.split("."))||Ce(B,_.arrays)&&l["combine-arrays"])&&ge(B,ie)})}function we(){typeof E<"u"&&E.forEach(function(L){me(L)})}function pe(L,N){if(typeof w>"u")return;const oe=typeof w=="string"?w:"",ie=mixin.env();Object.keys(ie).forEach(function(B){if(oe===""||B.lastIndexOf(oe,0)===0){const fe=B.split("__").map(function(Z,ce){return ce===0&&(Z=Z.substring(oe.length)),camelCase(Z)});(N&&_.configs[fe.join(".")]||!N)&&!ne(L,fe)&&ge(fe.join("."),ie[B])}})}function Fe(L){let N;const oe=new Set;Object.keys(L).forEach(function(ie){if(!oe.has(ie)&&(N=Ce(ie,_.coercions),typeof N=="function"))try{const B=ee(ie,N(L[ie]));[].concat(_.aliases[ie]||[],ie).forEach(fe=>{oe.add(fe),L[fe]=B})}catch(B){T=B}})}function Oe(L){return _.keys.forEach(N=>{~N.indexOf(".")||typeof L[N]>"u"&&(L[N]=void 0)}),L}function ye(L,N,oe,ie=!1){Object.keys(oe).forEach(function(B){ne(L,B.split("."))||(Be(L,B.split("."),oe[B]),ie&&(Q[B]=!0),(N[B]||[]).forEach(function(fe){ne(L,fe.split("."))||Be(L,fe.split("."),oe[B])}))})}function ne(L,N){let oe=L;l["dot-notation"]||(N=[N.join(".")]),N.slice(0,-1).forEach(function(B){oe=oe[B]||{}});const ie=N[N.length-1];return typeof oe!="object"?!1:ie in oe}function Be(L,N,oe){let ie=L;l["dot-notation"]||(N=[N.join(".")]),N.slice(0,-1).forEach(function(ve){ve=sanitizeKey(ve),typeof ie=="object"&&ie[ve]===void 0&&(ie[ve]={}),typeof ie[ve]!="object"||Array.isArray(ie[ve])?(Array.isArray(ie[ve])?ie[ve].push({}):ie[ve]=[ie[ve],{}],ie=ie[ve][ie[ve].length-1]):ie=ie[ve]});const B=sanitizeKey(N[N.length-1]),fe=Ce(N.join("."),_.arrays),Z=Array.isArray(oe);let ce=l["duplicate-arguments-array"];!ce&&Ce(B,_.nargs)&&(ce=!0,(!Le(ie[B])&&_.nargs[B]===1||Array.isArray(ie[B])&&ie[B].length===_.nargs[B])&&(ie[B]=void 0)),oe===increment()?ie[B]=increment(ie[B]):Array.isArray(ie[B])?ce&&fe&&Z?ie[B]=l["flatten-duplicate-arrays"]?ie[B].concat(oe):(Array.isArray(ie[B][0])?ie[B]:[ie[B]]).concat([oe]):!ce&&!!fe==!!Z?ie[B]=oe:ie[B]=ie[B].concat([oe]):ie[B]===void 0&&fe?ie[B]=Z?oe:[oe]:ce&&!(ie[B]===void 0||Ce(B,_.counts)||Ce(B,_.bools))?ie[B]=[ie[B],oe]:ie[B]=oe}function Re(...L){L.forEach(function(N){Object.keys(N||{}).forEach(function(oe){_.aliases[oe]||(_.aliases[oe]=[].concat(o[oe]||[]),_.aliases[oe].concat(oe).forEach(function(ie){if(/-/.test(ie)&&l["camel-case-expansion"]){const B=camelCase(ie);B!==oe&&_.aliases[oe].indexOf(B)===-1&&(_.aliases[oe].push(B),H[B]=!0)}}),_.aliases[oe].concat(oe).forEach(function(ie){if(ie.length>1&&/[A-Z]/.test(ie)&&l["camel-case-expansion"]){const B=decamelize(ie,"-");B!==oe&&_.aliases[oe].indexOf(B)===-1&&(_.aliases[oe].push(B),H[B]=!0)}}),_.aliases[oe].forEach(function(ie){_.aliases[ie]=[oe].concat(_.aliases[oe].filter(function(B){return ie!==B}))}))})})}function Ce(L,N){const oe=[].concat(_.aliases[L]||[],L),ie=Object.keys(N),B=oe.find(fe=>ie.includes(fe));return B?N[B]:!1}function se(L){const N=Object.keys(_);return[].concat(N.map(ie=>_[ie])).some(function(ie){return Array.isArray(ie)?ie.includes(L):ie[L]})}function z(L,...N){return[].concat(...N).some(function(ie){const B=L.match(ie);return B&&se(B[1])})}function Ae(L){if(L.match(U)||!L.match(/^-[^-]+/))return!1;let N=!0,oe;const ie=L.slice(1).split("");for(let B=0;B<ie.length;B++){if(oe=L.slice(B+2),!se(ie[B])){N=!1;break}if(ie[B+1]&&ie[B+1]==="="||oe==="-"||/[A-Za-z]/.test(ie[B])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(oe)||ie[B+1]&&ie[B+1].match(/\W/))break}return N}function Ee(L){return l["unknown-options-as-args"]&&be(L)}function be(L){return L=L.replace(/^-{3,}/,"--"),L.match(U)||Ae(L)?!1:!z(L,/^-+([^=]+?)=[\s\S]*$/,te,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function xe(L){return!Ce(L,_.bools)&&!Ce(L,_.counts)&&`${L}`in f?f[L]:_e(Se(L))}function _e(L){return{[DefaultValuesForTypeKey.BOOLEAN]:!0,[DefaultValuesForTypeKey.STRING]:"",[DefaultValuesForTypeKey.NUMBER]:void 0,[DefaultValuesForTypeKey.ARRAY]:[]}[L]}function Se(L){let N=DefaultValuesForTypeKey.BOOLEAN;return Ce(L,_.strings)?N=DefaultValuesForTypeKey.STRING:Ce(L,_.numbers)?N=DefaultValuesForTypeKey.NUMBER:Ce(L,_.bools)?N=DefaultValuesForTypeKey.BOOLEAN:Ce(L,_.arrays)&&(N=DefaultValuesForTypeKey.ARRAY),N}function Le(L){return L===void 0}function Ne(){Object.keys(_.counts).find(L=>Ce(L,_.arrays)?(T=Error(W("Invalid configuration: %s, opts.count excludes opts.array.",L)),!0):Ce(L,_.nargs)?(T=Error(W("Invalid configuration: %s, opts.count excludes opts.narg.",L)),!0):!1)}return{aliases:Object.assign({},_.aliases),argv:Object.assign(le,K),configuration:l,defaulted:Object.assign({},Q),error:T,newAliases:Object.assign({},H)}}}function combineAliases(i){const e=[],t=Object.create(null);let n=!0;for(Object.keys(i).forEach(function(s){e.push([].concat(i[s],s))});n;){n=!1;for(let s=0;s<e.length;s++)for(let a=s+1;a<e.length;a++)if(e[s].filter(function(l){return e[a].indexOf(l)!==-1}).length){e[s]=e[s].concat(e[a]),e.splice(a,1),n=!0;break}}return e.forEach(function(s){s=s.filter(function(o,l,f){return f.indexOf(o)===l});const a=s.pop();a!==void 0&&typeof a=="string"&&(t[a]=s)}),t}function increment(i){return i!==void 0?i+1:1}function sanitizeKey(i){return i==="__proto__"?"___proto___":i}function stripQuotes(i){return typeof i=="string"&&(i[0]==="'"||i[0]==='"')&&i[i.length-1]===i[0]?i.substring(1,i.length-1):i}var _a,_b,_c;const minNodeVersion=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,nodeVersion=(_b=(_a=process==null?void 0:process.versions)===null||_a===void 0?void 0:_a.node)!==null&&_b!==void 0?_b:(_c=process==null?void 0:process.version)===null||_c===void 0?void 0:_c.slice(1);if(nodeVersion&&Number(nodeVersion.match(/^([^.]+)/)[1])<minNodeVersion)throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const env=process?process.env:{},parser=new YargsParser({cwd:process.cwd,env:()=>env,format:require$$0$2.format,normalize:require$$0.normalize,resolve:require$$0.resolve,require:i=>{if(typeof require<"u")return require(i);if(i.match(/\.json$/))return JSON.parse(require$$0$1.readFileSync(i,"utf8"));throw Error("only .json config files are supported in ESM")}}),yargsParser=function(e,t){return parser.parse(e.slice(),t).argv};yargsParser.detailed=function(i,e){return parser.parse(i.slice(),e)},yargsParser.camelCase=camelCase,yargsParser.decamelize=decamelize,yargsParser.looksLikeNumber=looksLikeNumber;function getProcessArgvBinIndex(){return isBundledElectronApp()?0:1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(i){return i.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}class YError extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,YError)}}const shim$3={fs:{readFileSync:require$$0$1.readFileSync,writeFile:require$$0$1.writeFile},format:require$$0$2.format,resolve:require$$0.resolve,exists:i=>{try{return require$$0$1.statSync(i).isFile()}catch{return!1}}};let shim$2;class Y18N{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const t=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),shim$2.format.apply(shim$2.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),s=e.shift();let a=function(){};typeof e[e.length-1]=="function"&&(a=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=s===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][s===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:a})):a();const l=[o];return~o.indexOf("%d")&&l.push(s),shim$2.format.apply(shim$2.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(s,a){const o=t[a+1];n+=s,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const e=this,t=this.writeQueue[0],n=t.directory,s=t.locale,a=t.cb,o=this._resolveLocaleFile(n,s),l=JSON.stringify(this.cache[s],null,2);shim$2.fs.writeFile(o,l,"utf-8",function(f){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),a(f)})}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{shim$2.fs.readFileSync&&(e=JSON.parse(shim$2.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=shim$2.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){const s=shim$2.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){return shim$2.exists(e)}}function y18n$1(i,e){shim$2=e;const t=new Y18N(i);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}const y18n=i=>y18n$1(i,shim$3),REQUIRE_ERROR="require is not supported by ESM",REQUIRE_DIRECTORY_ERROR="loading a directory of commands is not supported yet for ESM";let __dirname$1;try{__dirname$1=require$$0$3.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.tagName.toUpperCase()==="SCRIPT"&&_documentCurrentScript.src||new URL("cli/index.cjs",document.baseURI).href)}catch{__dirname$1=process.cwd()}const mainFilename=__dirname$1.substring(0,__dirname$1.lastIndexOf("node_modules")),shim$1={assert:{notStrictEqual:assert.notStrictEqual,strictEqual:assert.strictEqual},cliui:ui,findUp:escalade,getEnv:i=>process.env[i],inspect:require$$0$2.inspect,getCallerFile:()=>{throw new YError(REQUIRE_DIRECTORY_ERROR)},getProcessArgvBin,mainFilename:mainFilename||process.cwd(),Parser:yargsParser,path:{basename:require$$0.basename,dirname:require$$0.dirname,extname:require$$0.extname,relative:require$$0.relative,resolve:require$$0.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(i,e)=>process.emitWarning(i,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:require$$0$1.readFileSync,require:()=>{throw new YError(REQUIRE_ERROR)},requireDirectory:()=>{throw new YError(REQUIRE_DIRECTORY_ERROR)},stringWidth:i=>[...i].length,y18n:y18n({directory:require$$0.resolve(__dirname$1,"../../../locales"),updateFiles:!1})};function assertNotStrictEqual(i,e,t,n){t.assert.notStrictEqual(i,e,n)}function assertSingleKey(i,e){e.assert.strictEqual(typeof i,"string")}function objectKeys(i){return Object.keys(i)}function isPromise(i){return!!i&&!!i.then&&typeof i.then=="function"}function parseCommand(i){const t=i.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=t.shift();if(!s)throw new Error(`No command found in: ${i}`);const a={cmd:s.replace(n,""),demanded:[],optional:[]};return t.forEach((o,l)=>{let f=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&l===t.length-1&&(f=!0),/^\[/.test(o)?a.optional.push({cmd:o.replace(n,"").split("|"),variadic:f}):a.demanded.push({cmd:o.replace(n,"").split("|"),variadic:f})}),a}const positionName=["first","second","third","fourth","fifth","sixth"];function argsert(i,e,t){function n(){return typeof i=="object"?[{demanded:[],optional:[]},i,e]:[parseCommand(`cmd ${i}`),e,t]}try{let s=0;const[a,o,l]=n(),f=[].slice.call(o);for(;f.length&&f[f.length-1]===void 0;)f.pop();const E=l||f.length;if(E<a.demanded.length)throw new YError(`Not enough arguments provided. Expected ${a.demanded.length} but received ${f.length}.`);const w=a.demanded.length+a.optional.length;if(E>w)throw new YError(`Too many arguments provided. Expected max ${w} but received ${E}.`);a.demanded.forEach(y=>{const d=f.shift(),H=guessType(d);y.cmd.filter(W=>W===H||W==="*").length===0&&argumentTypeError(H,y.cmd,s),s+=1}),a.optional.forEach(y=>{if(f.length===0)return;const d=f.shift(),H=guessType(d);y.cmd.filter(W=>W===H||W==="*").length===0&&argumentTypeError(H,y.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function guessType(i){return Array.isArray(i)?"array":i===null?"null":typeof i}function argumentTypeError(i,e,t){throw new YError(`Invalid ${positionName[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${i}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,s=!1){if(argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let a=0;a<e.length;a++){if(typeof e[a]!="function")throw Error("middleware must be a function");const o=e[a];o.applyBeforeValidation=t,o.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){const a=e;a.applyBeforeValidation=t,a.global=n,a.mutates=s,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(s=>{const a=[...n[t]||[],t];return s.option?!a.includes(s.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}}function commandMiddlewareFactory(i){return i?i.map(e=>(e.applyBeforeValidation=!1,e)):[]}function applyMiddleware(i,e,t,n){return t.reduce((s,a)=>{if(a.applyBeforeValidation!==n)return s;if(a.mutates){if(a.applied)return s;a.applied=!0}if(isPromise(s))return s.then(o=>Promise.all([o,a(o,e)])).then(([o,l])=>Object.assign(o,l));{const o=a(s,e);return isPromise(o)?o.then(l=>Object.assign(s,l)):Object.assign(s,o)}},i)}function maybeAsyncResult(i,e,t=n=>{throw n}){try{const n=isFunction(i)?i():i;return isPromise(n)?n.then(s=>e(s)):e(n)}catch(n){return t(n)}}function isFunction(i){return typeof i=="function"}function whichModule(i){if(typeof require>"u")return null;for(let e=0,t=Object.keys(require.cache),n;e<t.length;e++)if(n=require.cache[t[e]],n.exports===i)return n;return null}const DEFAULT_MARKER=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const a=typeof s.visit=="function"?s.visit:o=>o;s.visit=(o,l,f)=>{const E=a(o,l,f);if(E){if(this.requireCache.has(l))return E;this.requireCache.add(l),this.addHandler(E)}return E},this.shim.requireDirectory({require:t,filename:n},e,s)}addHandler(e,t,n,s,a,o){let l=[];const f=commandMiddlewareFactory(a);if(s=s||(()=>{}),Array.isArray(e))if(isCommandAndAliases(e))[e,...l]=e;else for(const E of e)this.addHandler(E);else if(isCommandHandlerDefinition(e)){let E=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(E=[].concat(E).concat(e.aliases)),this.addHandler(E,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(n)){this.addHandler([e].concat(l),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){const E=parseCommand(e);l=l.map(d=>parseCommand(d).cmd);let w=!1;const y=[E.cmd].concat(l).filter(d=>DEFAULT_MARKER.test(d)?(w=!0,!1):!0);y.length===0&&w&&y.push("$0"),w&&(E.cmd=y[0],l=y.slice(1),e=e.replace(DEFAULT_MARKER,E.cmd)),l.forEach(d=>{this.aliasMap[d]=E.cmd}),t!==!1&&this.usage.command(e,t,w,l,o),this.handlers[E.cmd]={original:e,description:t,handler:s,builder:n||{},middlewares:f,deprecated:o,demanded:E.demanded,optional:E.optional},w&&(this.defaultCommand=this.handlers[E.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,s,a,o){const l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,f=t.getInternalMethods().getContext(),E=f.commands.slice(),w=!e;e&&(f.commands.push(e),f.fullCommands.push(l.original));const y=this.applyBuilderUpdateUsageAndParse(w,l,t,n.aliases,E,s,a,o);return isPromise(y)?y.then(d=>this.applyMiddlewareAndGetResult(w,l,d.innerArgv,f,a,d.aliases,t)):this.applyMiddlewareAndGetResult(w,l,y.innerArgv,f,a,y.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,s,a,o,l,f){const E=t.builder;let w=n;if(isCommandBuilderCallback(E)){n.getInternalMethods().getUsageInstance().freeze();const y=E(n.getInternalMethods().reset(s),f);if(isPromise(y))return y.then(d=>(w=isYargsInstance(d)?d:n,this.parseAndUpdateUsage(e,t,w,a,o,l)))}else isCommandBuilderOptionDefinitions(E)&&(n.getInternalMethods().getUsageInstance().freeze(),w=n.getInternalMethods().reset(s),Object.keys(t.builder).forEach(y=>{w.option(y,E[y])}));return this.parseAndUpdateUsage(e,t,w,a,o,l)}parseAndUpdateUsage(e,t,n,s,a,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,t),t.description);const l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,a,o);return isPromise(l)?l.then(f=>({aliases:n.parsed.aliases,innerArgv:f})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const n=DEFAULT_MARKER.test(t.original)?t.original.replace(DEFAULT_MARKER,"").trim():t.original,s=e.filter(a=>!DEFAULT_MARKER.test(a));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(e,t,n,s,a,o,l,f){if(!o.getInternalMethods().getHasOutput()){const E=o.getInternalMethods().runValidation(a,f,o.parsed.error,e);n=maybeAsyncResult(n,w=>(E(w),w))}if(t.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const E=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(n,E,!1,!1),n=applyMiddleware(n,o,l,!1),n=maybeAsyncResult(n,w=>{const y=t.handler(w);return isPromise(y)?y.then(()=>w):w}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),isPromise(n)&&!o.getInternalMethods().hasParseCallback()&&n.catch(w=>{try{o.getInternalMethods().getUsageInstance().fail(null,w)}catch{}})}return e||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,s,a,o,l){let f={};if(a)return n;l.getInternalMethods().getHasOutput()||(f=this.populatePositionals(t,n,s,l));const E=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),w=applyMiddleware(n,l,E,!0);return isPromise(w)?w.then(y=>this.handleValidationAndGetResult(e,t,y,s,o,l,E,f)):this.handleValidationAndGetResult(e,t,w,s,o,l,E,f)}populatePositionals(e,t,n,s){t._=t._.slice(n.commands.length);const a=e.demanded.slice(0),o=e.optional.slice(0),l={};for(this.validation.positionalCount(a.length,t._.length);a.length;){const f=a.shift();this.populatePositional(f,t,l)}for(;o.length;){const f=o.shift();this.populatePositional(f,t,l)}return t._=n.commands.concat(t._.map(f=>""+f)),this.postProcessPositionals(t,l,this.cmdToParseOptions(e.original),s),l}populatePositional(e,t,n){const s=e.cmd[0];e.variadic?n[s]=t._.splice(0).map(String):t._.length&&(n[s]=[String(t._.shift())])}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}},n=parseCommand(e);return n.demanded.forEach(s=>{const[a,...o]=s.cmd;s.variadic&&(t.array.push(a),t.default[a]=[]),t.alias[a]=o,t.demand[a]=!0}),n.optional.forEach(s=>{const[a,...o]=s.cmd;s.variadic&&(t.array.push(a),t.default[a]=[]),t.alias[a]=o}),t}postProcessPositionals(e,t,n,s){const a=Object.assign({},s.getOptions());a.default=Object.assign(n.default,a.default);for(const E of Object.keys(n.alias))a.alias[E]=(a.alias[E]||[]).concat(n.alias[E]);a.array=a.array.concat(n.array),a.config={};const o=[];if(Object.keys(t).forEach(E=>{t[E].map(w=>{a.configuration["unknown-options-as-args"]&&(a.key[E]=!0),o.push(`--${E}`),o.push(w)})}),!o.length)return;const l=Object.assign({},a.configuration,{"populate--":!1}),f=this.shim.Parser.detailed(o,Object.assign({},a,{configuration:l}));if(f.error)s.getInternalMethods().getUsageInstance().fail(f.error.message,f.error);else{const E=Object.keys(t);Object.keys(t).forEach(w=>{E.push(...f.aliases[w])}),Object.keys(f.argv).forEach(w=>{E.includes(w)&&(t[w]||(t[w]=f.argv[w]),!this.isInConfigs(s,w)&&!this.isDefaulted(s,w)&&Object.prototype.hasOwnProperty.call(e,w)&&Object.prototype.hasOwnProperty.call(f.argv,w)&&(Array.isArray(e[w])||Array.isArray(f.argv[w]))?e[w]=[].concat(e[w],f.argv[w]):e[w]=f.argv[w])})}}isDefaulted(e,t){const{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:n}=e.getOptions();return n.some(s=>Object.prototype.hasOwnProperty.call(s,t))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=DEFAULT_MARKER.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t))return t(e,!0);isCommandBuilderDefinition(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){const t=whichModule(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(const s of[e,t,n]){if(typeof s=="string"||s===!1)return s;assertNotStrictEqual(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function command(i,e,t,n){return new CommandInstance(i,e,t,n)}function isCommandBuilderDefinition(i){return typeof i=="object"&&!!i.builder&&typeof i.handler=="function"}function isCommandAndAliases(i){return i.every(e=>typeof e=="string")}function isCommandBuilderCallback(i){return typeof i=="function"}function isCommandBuilderOptionDefinitions(i){return typeof i=="object"}function isCommandHandlerDefinition(i){return typeof i=="object"&&!Array.isArray(i)}function objFilter(i={},e=()=>!0){const t={};return objectKeys(i).forEach(n=>{e(n,i[n])&&(t[n]=i[n])}),t}function setBlocking(i){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(i)})}function isBoolean(i){return typeof i=="boolean"}function usage(i,e){const t=e.y18n.__,n={},s=[];n.failFn=function(ue){s.push(ue)};let a=null,o=null,l=!0;n.showHelpOnFail=function(ue=!0,ee){const[de,me]=typeof ue=="string"?[!0,ue]:[ue,ee];return i.getInternalMethods().isGlobalContext()&&(o=me),a=me,l=de,n};let f=!1;n.fail=function(ue,ee){const de=i.getInternalMethods().getLoggerInstance();if(s.length)for(let me=s.length-1;me>=0;--me){const we=s[me];if(isBoolean(we)){if(ee)throw ee;if(ue)throw Error(ue)}else we(ue,ee,n)}else{if(i.getExitProcess()&&setBlocking(!0),!f){f=!0,l&&(i.showHelp("error"),de.error()),(ue||ee)&&de.error(ue||ee);const me=a||o;me&&((ue||ee)&&de.error(""),de.error(me))}if(ee=ee||new YError(ue),i.getExitProcess())return i.exit(1);if(i.getInternalMethods().hasParseCallback())return i.exit(1,ee);throw ee}};let E=[],w=!1;n.usage=(ae,ue)=>ae===null?(w=!0,E=[],n):(w=!1,E.push([ae,ue||""]),n),n.getUsage=()=>E,n.getUsageDisabled=()=>w,n.getPositionalGroupName=()=>t("Positionals:");let y=[];n.example=(ae,ue)=>{y.push([ae,ue||""])};let d=[];n.command=function(ue,ee,de,me,we=!1){de&&(d=d.map(pe=>(pe[2]=!1,pe))),d.push([ue,ee||"",de,me,we])},n.getCommands=()=>d;let H={};n.describe=function(ue,ee){Array.isArray(ue)?ue.forEach(de=>{n.describe(de,ee)}):typeof ue=="object"?Object.keys(ue).forEach(de=>{n.describe(de,ue[de])}):H[ue]=ee},n.getDescriptions=()=>H;let Q=[];n.epilog=ae=>{Q.push(ae)};let W=!1,_;n.wrap=ae=>{W=!0,_=ae},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(W||(_=he(),W=!0),_);const U="__yargsString__:";n.deferY18nLookup=ae=>U+ae,n.help=function(){if(X)return X;T();const ue=i.customScriptName?i.$0:e.path.basename(i.$0),ee=i.getDemandedOptions(),de=i.getDemandedCommands(),me=i.getDeprecatedOptions(),we=i.getGroups(),pe=i.getOptions();let Fe=[];Fe=Fe.concat(Object.keys(H)),Fe=Fe.concat(Object.keys(ee)),Fe=Fe.concat(Object.keys(de)),Fe=Fe.concat(Object.keys(pe.default)),Fe=Fe.filter(le),Fe=Object.keys(Fe.reduce((z,Ae)=>(Ae!=="_"&&(z[Ae]=!0),z),{}));const Oe=n.getWrap(),ye=e.cliui({width:Oe,wrap:!!Oe});if(!w){if(E.length)E.forEach(z=>{ye.div({text:`${z[0].replace(/\$0/g,ue)}`}),z[1]&&ye.div({text:`${z[1]}`,padding:[1,0,0,0]})}),ye.div();else if(d.length){let z=null;de._?z=`${ue} <${t("command")}>
8
+ `:z=`${ue} [${t("command")}]
9
+ `,ye.div(`${z}`)}}if(d.length>1||d.length===1&&!d[0][2]){ye.div(t("Commands:"));const z=i.getInternalMethods().getContext(),Ae=z.commands.length?`${z.commands.join(" ")} `:"";i.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((be,xe)=>be[0].localeCompare(xe[0])));const Ee=ue?`${ue} `:"";d.forEach(be=>{const xe=`${Ee}${Ae}${be[0].replace(/^\$0 ?/,"")}`;ye.span({text:xe,padding:[0,2,0,2],width:te(d,Oe,`${ue}${Ae}`)+4},{text:be[1]});const _e=[];be[2]&&_e.push(`[${t("default")}]`),be[3]&&be[3].length&&_e.push(`[${t("aliases:")} ${be[3].join(", ")}]`),be[4]&&(typeof be[4]=="string"?_e.push(`[${t("deprecated: %s",be[4])}]`):_e.push(`[${t("deprecated")}]`)),_e.length?ye.div({text:_e.join(" "),padding:[0,0,0,2],align:"right"}):ye.div()}),ye.div()}const ne=(Object.keys(pe.alias)||[]).concat(Object.keys(i.parsed.newAliases)||[]);Fe=Fe.filter(z=>!i.parsed.newAliases[z]&&ne.every(Ae=>(pe.alias[Ae]||[]).indexOf(z)===-1));const Be=t("Options:");we[Be]||(we[Be]=[]),K(Fe,pe.alias,we,Be);const Re=z=>/^--/.test(getText(z)),Ce=Object.keys(we).filter(z=>we[z].length>0).map(z=>{const Ae=we[z].filter(le).map(Ee=>{if(ne.includes(Ee))return Ee;for(let be=0,xe;(xe=ne[be])!==void 0;be++)if((pe.alias[xe]||[]).includes(Ee))return xe;return Ee});return{groupName:z,normalizedKeys:Ae}}).filter(({normalizedKeys:z})=>z.length>0).map(({groupName:z,normalizedKeys:Ae})=>{const Ee=Ae.reduce((be,xe)=>(be[xe]=[xe].concat(pe.alias[xe]||[]).map(_e=>z===n.getPositionalGroupName()?_e:(/^[0-9]$/.test(_e)?pe.boolean.includes(xe)?"-":"--":_e.length>1?"--":"-")+_e).sort((_e,Se)=>Re(_e)===Re(Se)?0:Re(_e)?1:-1).join(", "),be),{});return{groupName:z,normalizedKeys:Ae,switches:Ee}});if(Ce.filter(({groupName:z})=>z!==n.getPositionalGroupName()).some(({normalizedKeys:z,switches:Ae})=>!z.every(Ee=>Re(Ae[Ee])))&&Ce.filter(({groupName:z})=>z!==n.getPositionalGroupName()).forEach(({normalizedKeys:z,switches:Ae})=>{z.forEach(Ee=>{Re(Ae[Ee])&&(Ae[Ee]=addIndentation(Ae[Ee],4))})}),Ce.forEach(({groupName:z,normalizedKeys:Ae,switches:Ee})=>{ye.div(z),Ae.forEach(be=>{const xe=Ee[be];let _e=H[be]||"",Se=null;_e.includes(U)&&(_e=t(_e.substring(U.length))),pe.boolean.includes(be)&&(Se=`[${t("boolean")}]`),pe.count.includes(be)&&(Se=`[${t("count")}]`),pe.string.includes(be)&&(Se=`[${t("string")}]`),pe.normalize.includes(be)&&(Se=`[${t("string")}]`),pe.array.includes(be)&&(Se=`[${t("array")}]`),pe.number.includes(be)&&(Se=`[${t("number")}]`);const Le=N=>typeof N=="string"?`[${t("deprecated: %s",N)}]`:`[${t("deprecated")}]`,Ne=[be in me?Le(me[be]):null,Se,be in ee?`[${t("required")}]`:null,pe.choices&&pe.choices[be]?`[${t("choices:")} ${n.stringifiedValues(pe.choices[be])}]`:null,re(pe.default[be],pe.defaultDescription[be])].filter(Boolean).join(" ");ye.span({text:getText(xe),padding:[0,2,0,2+getIndentation(xe)],width:te(Ee,Oe)+4},_e);const L=i.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ne&&!L?ye.div({text:Ne,padding:[0,0,0,2],align:"right"}):ye.div()}),ye.div()}),y.length&&(ye.div(t("Examples:")),y.forEach(z=>{z[0]=z[0].replace(/\$0/g,ue)}),y.forEach(z=>{z[1]===""?ye.div({text:z[0],padding:[0,2,0,2]}):ye.div({text:z[0],padding:[0,2,0,2],width:te(y,Oe)+4},{text:z[1]})}),ye.div()),Q.length>0){const z=Q.map(Ae=>Ae.replace(/\$0/g,ue)).join(`
10
+ `);ye.div(`${z}
11
+ `)}return ye.toString().replace(/\s*$/,"")};function te(ae,ue,ee){let de=0;return Array.isArray(ae)||(ae=Object.values(ae).map(me=>[me])),ae.forEach(me=>{de=Math.max(e.stringWidth(ee?`${ee} ${getText(me[0])}`:getText(me[0]))+getIndentation(me[0]),de)}),ue&&(de=Math.min(de,parseInt((ue*.5).toString(),10))),de}function T(){const ae=i.getDemandedOptions(),ue=i.getOptions();(Object.keys(ue.alias)||[]).forEach(ee=>{ue.alias[ee].forEach(de=>{H[de]&&n.describe(ee,H[de]),de in ae&&i.demandOption(ee,ae[de]),ue.boolean.includes(de)&&i.boolean(ee),ue.count.includes(de)&&i.count(ee),ue.string.includes(de)&&i.string(ee),ue.normalize.includes(de)&&i.normalize(ee),ue.array.includes(de)&&i.array(ee),ue.number.includes(de)&&i.number(ee)})})}let X;n.cacheHelpMessage=function(){X=this.help()},n.clearCachedHelpMessage=function(){X=void 0},n.hasCachedHelpMessage=function(){return!!X};function K(ae,ue,ee,de){let me=[],we=null;return Object.keys(ee).forEach(pe=>{me=me.concat(ee[pe])}),ae.forEach(pe=>{we=[pe].concat(ue[pe]),we.some(Fe=>me.indexOf(Fe)!==-1)||ee[de].push(pe)}),me}function le(ae){return i.getOptions().hiddenOptions.indexOf(ae)<0||i.parsed.argv[i.getOptions().showHiddenOpt]}n.showHelp=ae=>{const ue=i.getInternalMethods().getLoggerInstance();ae||(ae="error"),(typeof ae=="function"?ae:ue[ae])(n.help())},n.functionDescription=ae=>["(",ae.name?e.Parser.decamelize(ae.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(ue,ee){let de="";const me=ee||", ",we=[].concat(ue);return!ue||!we.length||we.forEach(pe=>{de.length&&(de+=me),de+=JSON.stringify(pe)}),de};function re(ae,ue){let ee=`[${t("default:")} `;if(ae===void 0&&!ue)return null;if(ue)ee+=ue;else switch(typeof ae){case"string":ee+=`"${ae}"`;break;case"object":ee+=JSON.stringify(ae);break;default:ee+=ae}return`${ee}]`}function he(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let De=null;n.version=ae=>{De=ae},n.showVersion=ae=>{const ue=i.getInternalMethods().getLoggerInstance();ae||(ae="error"),(typeof ae=="function"?ae:ue[ae])(De)},n.reset=function(ue){return a=null,f=!1,E=[],w=!1,Q=[],y=[],d=[],H=objFilter(H,ee=>!ue[ee]),n};const ge=[];return n.freeze=function(){ge.push({failMessage:a,failureOutput:f,usages:E,usageDisabled:w,epilogs:Q,examples:y,commands:d,descriptions:H})},n.unfreeze=function(ue=!1){const ee=ge.pop();ee&&(ue?(H={...ee.descriptions,...H},d=[...ee.commands,...d],E=[...ee.usages,...E],y=[...ee.examples,...y],Q=[...ee.epilogs,...Q]):{failMessage:a,failureOutput:f,usages:E,usageDisabled:w,epilogs:Q,examples:y,commands:d,descriptions:H}=ee)},n}function isIndentedText(i){return typeof i=="object"}function addIndentation(i,e){return isIndentedText(i)?{text:i.text,indentation:i.indentation+e}:{text:i,indentation:e}}function getIndentation(i){return isIndentedText(i)?i.indentation:0}function getText(i){return isIndentedText(i)?i.text:i}const completionShTemplate=`###-begin-{{app_name}}-completions-###
12
12
  #
13
13
  # yargs command completion script
14
14
  #
@@ -55,14 +55,14 @@ _{{app_name}}_yargs_completions()
55
55
  }
56
56
  compdef _{{app_name}}_yargs_completions {{app_name}}
57
57
  ###-end-{{app_name}}-completions-###
58
- `;class Completion{constructor(e,t,n,s){var o,a,l;this.yargs=e,this.usage=t,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((a=this.shim.getEnv("ZSH_NAME"))===null||a===void 0?void 0:a.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,t,n,s){const o=this.command.getCommandHandlers();for(let l=0,d=e.length;l<d;++l)if(o[e[l]]&&o[e[l]].builder){const B=o[e[l]].builder;if(isCommandBuilderCallback(B)){this.indexAfterLastReset=l+1;const w=this.yargs.getInternalMethods().reset();return B(w,!0),w.argv}}const a=[];this.commandCompletions(a,e,n),this.optionCompletions(a,e,t,n),this.choicesFromOptionsCompletions(a,e,t,n),this.choicesFromPositionalsCompletions(a,e,t,n),s(null,a)}commandCompletions(e,t,n){const s=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&s[s.length-1]!==n&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(o=>{const a=parseCommand(o[0]).cmd;if(t.indexOf(a)===-1)if(!this.zshShell)e.push(a);else{const l=o[1]||"";e.push(a.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,t,n,s){if((s.match(/^-/)||s===""&&e.length===0)&&!this.previousArgHasChoices(t)){const o=this.yargs.getOptions(),a=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(l=>{const d=!!o.configuration["boolean-negation"]&&o.boolean.includes(l);!a.includes(l)&&!o.hiddenOptions.includes(l)&&!this.argsContainKey(t,l,d)&&this.completeOptionKey(l,e,s,d&&!!o.default[l])})}}choicesFromOptionsCompletions(e,t,n,s){if(this.previousArgHasChoices(t)){const o=this.getPreviousArgChoices(t);o&&o.length>0&&e.push(...o.map(a=>a.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,n,s){if(s===""&&e.length>0&&this.previousArgHasChoices(t))return;const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],a=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=o[n._.length-a-1];if(!l)return;const d=this.yargs.getOptions().choices[l]||[];for(const B of d)B.startsWith(s)&&e.push(B.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n="";if(!t.startsWith("-")&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith("-"))return;const s=t.replace(/^-+/,""),o=this.yargs.getOptions(),a=[s,...this.yargs.getAliases()[s]||[]];let l;for(const d of a)if(Object.prototype.hasOwnProperty.call(o.key,d)&&Array.isArray(o.choices[d])){l=o.choices[d];break}if(l)return l.filter(d=>!n||d.startsWith(n))}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){const s=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(s(t)||n&&s(`no-${t}`))return!0;if(this.aliases){for(const o of this.aliases[t])if(s(o))return!0}return!1}completeOptionKey(e,t,n,s){var o,a,l,d;let B=e;if(this.zshShell){const U=this.usage.getDescriptions(),H=(a=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||a===void 0?void 0:a.find(K=>{const ee=U[K];return typeof ee=="string"&&ee.length>0}),W=H?U[H]:void 0,L=(d=(l=U[e])!==null&&l!==void 0?l:W)!==null&&d!==void 0?d:"";B=`${e.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const w=U=>/^--/.test(U),E=U=>/^[^0-9]$/.test(U),_=!w(n)&&E(e)?"-":"--";t.push(_+B),s&&t.push(_+"no-"+B)}customCompletion(e,t,n,s){if(assertNotStrictEqual(this.customCompletionFunction,null,this.shim),isSyncCompletionFunction(this.customCompletionFunction)){const o=this.customCompletionFunction(n,t);return isPromise(o)?o.then(a=>{this.shim.process.nextTick(()=>{s(null,a)})}).catch(a=>{this.shim.process.nextTick(()=>{s(a,void 0)})}):s(null,o)}else return isFallbackCompletionFunction(this.customCompletionFunction)?this.customCompletionFunction(n,t,(o=s)=>this.defaultCompletion(e,t,n,o),o=>{s(null,o)}):this.customCompletionFunction(n,t,o=>{s(null,o)})}getCompletion(e,t){const n=e.length?e[e.length-1]:"",s=this.yargs.parse(e,!0),o=this.customCompletionFunction?a=>this.customCompletion(e,a,n,t):a=>this.defaultCompletion(e,a,n,t);return isPromise(s)?s.then(o):o(s)}generateCompletionScript(e,t){let n=this.zshShell?completionZshTemplate:completionShTemplate;const s=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(i,e,t,n){return new Completion(i,e,t,n)}function isSyncCompletionFunction(i){return i.length<3}function isFallbackCompletionFunction(i){return i.length>3}function levenshtein(i,e){if(i.length===0)return e.length;if(e.length===0)return i.length;const t=[];let n;for(n=0;n<=e.length;n++)t[n]=[n];let s;for(s=0;s<=i.length;s++)t[0][s]=s;for(n=1;n<=e.length;n++)for(s=1;s<=i.length;s++)e.charAt(n-1)===i.charAt(s-1)?t[n][s]=t[n-1][s-1]:n>1&&s>1&&e.charAt(n-2)===i.charAt(s-1)&&e.charAt(n-1)===i.charAt(s-2)?t[n][s]=t[n-2][s-2]+1:t[n][s]=Math.min(t[n-1][s-1]+1,Math.min(t[n][s-1]+1,t[n-1][s]+1));return t[e.length][i.length]}const specialKeys=["$0","--","_"];function validation(i,e,t){const n=t.y18n.__,s=t.y18n.__n,o={};o.nonOptionCount=function(E){const _=i.getDemandedCommands(),H=E._.length+(E["--"]?E["--"].length:0)-i.getInternalMethods().getContext().commands.length;_._&&(H<_._.min||H>_._.max)&&(H<_._.min?_._.minMsg!==void 0?e.fail(_._.minMsg?_._.minMsg.replace(/\$0/g,H.toString()).replace(/\$1/,_._.min.toString()):null):e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",H,H.toString(),_._.min.toString())):H>_._.max&&(_._.maxMsg!==void 0?e.fail(_._.maxMsg?_._.maxMsg.replace(/\$0/g,H.toString()).replace(/\$1/,_._.max.toString()):null):e.fail(s("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",H,H.toString(),_._.max.toString()))))},o.positionalCount=function(E,_){_<E&&e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",_,_+"",E+""))},o.requiredArguments=function(E,_){let U=null;for(const H of Object.keys(_))(!Object.prototype.hasOwnProperty.call(E,H)||typeof E[H]>"u")&&(U=U||{},U[H]=_[H]);if(U){const H=[];for(const L of Object.keys(U)){const K=U[L];K&&H.indexOf(K)<0&&H.push(K)}const W=H.length?`
59
- ${H.join(`
60
- `)}`:"";e.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys(U).length,Object.keys(U).join(", ")+W))}},o.unknownArguments=function(E,_,U,H,W=!0){var L;const K=i.getInternalMethods().getCommandInstance().getCommands(),ee=[],ae=i.getInternalMethods().getContext();if(Object.keys(E).forEach(se=>{!specialKeys.includes(se)&&!Object.prototype.hasOwnProperty.call(U,se)&&!Object.prototype.hasOwnProperty.call(i.getInternalMethods().getParseContext(),se)&&!o.isValidAndSomeAliasIsNotNew(se,_)&&ee.push(se)}),W&&(ae.commands.length>0||K.length>0||H)&&E._.slice(ae.commands.length).forEach(se=>{K.includes(""+se)||ee.push(""+se)}),W){const ce=((L=i.getDemandedCommands()._)===null||L===void 0?void 0:L.max)||0,Fe=ae.commands.length+ce;Fe<E._.length&&E._.slice(Fe).forEach(ve=>{ve=String(ve),!ae.commands.includes(ve)&&!ee.includes(ve)&&ee.push(ve)})}ee.length&&e.fail(s("Unknown argument: %s","Unknown arguments: %s",ee.length,ee.map(se=>se.trim()?se:`"${se}"`).join(", ")))},o.unknownCommands=function(E){const _=i.getInternalMethods().getCommandInstance().getCommands(),U=[],H=i.getInternalMethods().getContext();return(H.commands.length>0||_.length>0)&&E._.slice(H.commands.length).forEach(W=>{_.includes(""+W)||U.push(""+W)}),U.length>0?(e.fail(s("Unknown command: %s","Unknown commands: %s",U.length,U.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(E,_){if(!Object.prototype.hasOwnProperty.call(_,E))return!1;const U=i.parsed.newAliases;return[E,..._[E]].some(H=>!Object.prototype.hasOwnProperty.call(U,H)||!U[E])},o.limitedChoices=function(E){const _=i.getOptions(),U={};if(!Object.keys(_.choices).length)return;Object.keys(E).forEach(L=>{specialKeys.indexOf(L)===-1&&Object.prototype.hasOwnProperty.call(_.choices,L)&&[].concat(E[L]).forEach(K=>{_.choices[L].indexOf(K)===-1&&K!==void 0&&(U[L]=(U[L]||[]).concat(K))})});const H=Object.keys(U);if(!H.length)return;let W=n("Invalid values:");H.forEach(L=>{W+=`
61
- ${n("Argument: %s, Given: %s, Choices: %s",L,e.stringifiedValues(U[L]),e.stringifiedValues(_.choices[L]))}`}),e.fail(W)};let a={};o.implies=function(E,_){argsert("<string|object> [array|number|string]",[E,_],arguments.length),typeof E=="object"?Object.keys(E).forEach(U=>{o.implies(U,E[U])}):(i.global(E),a[E]||(a[E]=[]),Array.isArray(_)?_.forEach(U=>o.implies(E,U)):(assertNotStrictEqual(_,void 0,t),a[E].push(_)))},o.getImplied=function(){return a};function l(w,E){const _=Number(E);return E=isNaN(_)?E:_,typeof E=="number"?E=w._.length>=E:E.match(/^--no-.+/)?(E=E.match(/^--no-(.+)/)[1],E=!Object.prototype.hasOwnProperty.call(w,E)):E=Object.prototype.hasOwnProperty.call(w,E),E}o.implications=function(E){const _=[];if(Object.keys(a).forEach(U=>{const H=U;(a[U]||[]).forEach(W=>{let L=H;const K=W;L=l(E,L),W=l(E,W),L&&!W&&_.push(` ${H} -> ${K}`)})}),_.length){let U=`${n("Implications failed:")}
62
- `;_.forEach(H=>{U+=H}),e.fail(U)}};let d={};o.conflicts=function(E,_){argsert("<string|object> [array|string]",[E,_],arguments.length),typeof E=="object"?Object.keys(E).forEach(U=>{o.conflicts(U,E[U])}):(i.global(E),d[E]||(d[E]=[]),Array.isArray(_)?_.forEach(U=>o.conflicts(E,U)):d[E].push(_))},o.getConflicting=()=>d,o.conflicting=function(E){Object.keys(E).forEach(_=>{d[_]&&d[_].forEach(U=>{U&&E[_]!==void 0&&E[U]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",_,U))})}),i.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(d).forEach(_=>{d[_].forEach(U=>{U&&E[t.Parser.camelCase(_)]!==void 0&&E[t.Parser.camelCase(U)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",_,U))})})},o.recommendCommands=function(E,_){_=_.sort((L,K)=>K.length-L.length);let H=null,W=1/0;for(let L=0,K;(K=_[L])!==void 0;L++){const ee=levenshtein(E,K);ee<=3&&ee<W&&(W=ee,H=K)}H&&e.fail(n("Did you mean %s?",H))},o.reset=function(E){return a=objFilter(a,_=>!E[_]),d=objFilter(d,_=>!E[_]),o};const B=[];return o.freeze=function(){B.push({implied:a,conflicting:d})},o.unfreeze=function(){const E=B.pop();assertNotStrictEqual(E,void 0,t),{implied:a,conflicting:d}=E},o}let previouslyVisitedConfigs=[],shim;function applyExtends(i,e,t,n){shim=n;let s={};if(Object.prototype.hasOwnProperty.call(i,"extends")){if(typeof i.extends!="string")return s;const o=/\.json|\..*rc$/.test(i.extends);let a=null;if(o)a=getPathToDefaultConfig(e,i.extends);else try{a=require.resolve(i.extends)}catch{return i}checkForCircularExtends(a),previouslyVisitedConfigs.push(a),s=o?JSON.parse(shim.readFileSync(a,"utf8")):require(i.extends),delete i.extends,s=applyExtends(s,shim.path.dirname(a),t,shim)}return previouslyVisitedConfigs=[],t?mergeDeep(s,i):Object.assign({},s,i)}function checkForCircularExtends(i){if(previouslyVisitedConfigs.indexOf(i)>-1)throw new YError(`Circular extended configurations: '${i}'.`)}function getPathToDefaultConfig(i,e){return shim.path.resolve(i,e)}function mergeDeep(i,e){const t={};function n(s){return s&&typeof s=="object"&&!Array.isArray(s)}Object.assign(t,i);for(const s of Object.keys(e))n(e[s])&&n(t[s])?t[s]=mergeDeep(i[s],e[s]):t[s]=e[s];return t}var __classPrivateFieldSet=function(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},__classPrivateFieldGet=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},_YargsInstance_command,_YargsInstance_cwd,_YargsInstance_context,_YargsInstance_completion,_YargsInstance_completionCommand,_YargsInstance_defaultShowHiddenOpt,_YargsInstance_exitError,_YargsInstance_detectLocale,_YargsInstance_emittedWarnings,_YargsInstance_exitProcess,_YargsInstance_frozens,_YargsInstance_globalMiddleware,_YargsInstance_groups,_YargsInstance_hasOutput,_YargsInstance_helpOpt,_YargsInstance_isGlobalContext,_YargsInstance_logger,_YargsInstance_output,_YargsInstance_options,_YargsInstance_parentRequire,_YargsInstance_parserConfig,_YargsInstance_parseFn,_YargsInstance_parseContext,_YargsInstance_pkgs,_YargsInstance_preservedGroups,_YargsInstance_processArgs,_YargsInstance_recommendCommands,_YargsInstance_shim,_YargsInstance_strict,_YargsInstance_strictCommands,_YargsInstance_strictOptions,_YargsInstance_usage,_YargsInstance_usageConfig,_YargsInstance_versionOpt,_YargsInstance_validation;function YargsFactory(i){return(e=[],t=i.process.cwd(),n)=>{const s=new YargsInstance(e,t,n,i);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s}}const kCopyDoubleDash=Symbol("copyDoubleDash"),kCreateLogger=Symbol("copyDoubleDash"),kDeleteFromParserHintObject=Symbol("deleteFromParserHintObject"),kEmitWarning=Symbol("emitWarning"),kFreeze=Symbol("freeze"),kGetDollarZero=Symbol("getDollarZero"),kGetParserConfiguration=Symbol("getParserConfiguration"),kGetUsageConfiguration=Symbol("getUsageConfiguration"),kGuessLocale=Symbol("guessLocale"),kGuessVersion=Symbol("guessVersion"),kParsePositionalNumbers=Symbol("parsePositionalNumbers"),kPkgUp=Symbol("pkgUp"),kPopulateParserHintArray=Symbol("populateParserHintArray"),kPopulateParserHintSingleValueDictionary=Symbol("populateParserHintSingleValueDictionary"),kPopulateParserHintArrayDictionary=Symbol("populateParserHintArrayDictionary"),kPopulateParserHintDictionary=Symbol("populateParserHintDictionary"),kSanitizeKey=Symbol("sanitizeKey"),kSetKey=Symbol("setKey"),kUnfreeze=Symbol("unfreeze"),kValidateAsync=Symbol("validateAsync"),kGetCommandInstance=Symbol("getCommandInstance"),kGetContext=Symbol("getContext"),kGetHasOutput=Symbol("getHasOutput"),kGetLoggerInstance=Symbol("getLoggerInstance"),kGetParseContext=Symbol("getParseContext"),kGetUsageInstance=Symbol("getUsageInstance"),kGetValidationInstance=Symbol("getValidationInstance"),kHasParseCallback=Symbol("hasParseCallback"),kIsGlobalContext=Symbol("isGlobalContext"),kPostProcess=Symbol("postProcess"),kRebase=Symbol("rebase"),kReset=Symbol("reset"),kRunYargsParserAndExecuteCommands=Symbol("runYargsParserAndExecuteCommands"),kRunValidation=Symbol("runValidation"),kSetHasOutput=Symbol("setHasOutput"),kTrackManuallySetKeys=Symbol("kTrackManuallySetKeys");class YargsInstance{constructor(e=[],t,n,s){this.customScriptName=!1,this.parsed=!1,_YargsInstance_command.set(this,void 0),_YargsInstance_cwd.set(this,void 0),_YargsInstance_context.set(this,{commands:[],fullCommands:[]}),_YargsInstance_completion.set(this,null),_YargsInstance_completionCommand.set(this,null),_YargsInstance_defaultShowHiddenOpt.set(this,"show-hidden"),_YargsInstance_exitError.set(this,null),_YargsInstance_detectLocale.set(this,!0),_YargsInstance_emittedWarnings.set(this,{}),_YargsInstance_exitProcess.set(this,!0),_YargsInstance_frozens.set(this,[]),_YargsInstance_globalMiddleware.set(this,void 0),_YargsInstance_groups.set(this,{}),_YargsInstance_hasOutput.set(this,!1),_YargsInstance_helpOpt.set(this,null),_YargsInstance_isGlobalContext.set(this,!0),_YargsInstance_logger.set(this,void 0),_YargsInstance_output.set(this,""),_YargsInstance_options.set(this,void 0),_YargsInstance_parentRequire.set(this,void 0),_YargsInstance_parserConfig.set(this,{}),_YargsInstance_parseFn.set(this,null),_YargsInstance_parseContext.set(this,null),_YargsInstance_pkgs.set(this,{}),_YargsInstance_preservedGroups.set(this,{}),_YargsInstance_processArgs.set(this,void 0),_YargsInstance_recommendCommands.set(this,!1),_YargsInstance_shim.set(this,void 0),_YargsInstance_strict.set(this,!1),_YargsInstance_strictCommands.set(this,!1),_YargsInstance_strictOptions.set(this,!1),_YargsInstance_usage.set(this,void 0),_YargsInstance_usageConfig.set(this,{}),_YargsInstance_versionOpt.set(this,null),_YargsInstance_validation.set(this,void 0),__classPrivateFieldSet(this,_YargsInstance_shim,s,"f"),__classPrivateFieldSet(this,_YargsInstance_processArgs,e,"f"),__classPrivateFieldSet(this,_YargsInstance_cwd,t,"f"),__classPrivateFieldSet(this,_YargsInstance_parentRequire,n,"f"),__classPrivateFieldSet(this,_YargsInstance_globalMiddleware,new GlobalMiddleware(this),"f"),this.$0=this[kGetDollarZero](),this[kReset](),__classPrivateFieldSet(this,_YargsInstance_command,__classPrivateFieldGet(this,_YargsInstance_command,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_usage,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_validation,__classPrivateFieldGet(this,_YargsInstance_validation,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_options,__classPrivateFieldGet(this,_YargsInstance_options,"f"),"f"),__classPrivateFieldGet(this,_YargsInstance_options,"f").showHiddenOpt=__classPrivateFieldGet(this,_YargsInstance_defaultShowHiddenOpt,"f"),__classPrivateFieldSet(this,_YargsInstance_logger,this[kCreateLogger](),"f")}addHelpOpt(e,t){const n="help";return argsert("[string|boolean] [string]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&(this[kDeleteFromParserHintObject](__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")),__classPrivateFieldSet(this,_YargsInstance_helpOpt,null,"f")),e===!1&&t===void 0?this:(__classPrivateFieldSet(this,_YargsInstance_helpOpt,typeof e=="string"?e:n,"f"),this.boolean(__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")),this.describe(__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f"),t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(argsert("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;const n=typeof e=="string"?e:__classPrivateFieldGet(this,_YargsInstance_defaultShowHiddenOpt,"f");return this.boolean(n),this.describe(n,t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show hidden options")),__classPrivateFieldGet(this,_YargsInstance_options,"f").showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return argsert("<object|string|array> [string|array]",[e,t],arguments.length),this[kPopulateParserHintArrayDictionary](this.alias.bind(this),"alias",e,t),this}array(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("array",e),this[kTrackManuallySetKeys](e),this}boolean(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("boolean",e),this[kTrackManuallySetKeys](e),this}check(e,t){return argsert("<function> [boolean]",[e,t],arguments.length),this.middleware((n,s)=>maybeAsyncResult(()=>e(n,s.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(o.toString(),o):__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(o.message?o.message:o.toString(),o),n)),!1,t),this}choices(e,t){return argsert("<object|string|array> [string|array]",[e,t],arguments.length),this[kPopulateParserHintArrayDictionary](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(argsert("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new YError("coerce callback must be provided");for(const n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(const n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new YError("coerce callback must be provided");return __classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").addCoerceMiddleware((n,s)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?maybeAsyncResult(()=>(o=s.getAliases(),t(n[e])),l=>{n[e]=l;const d=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&d!==!0)for(const B of o[e])n[B]=l;return n},l=>{throw new YError(l.message)}):n},e),this}conflicts(e,t){return argsert("<string|object> [string|array]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_validation,"f").conflicts(e,t),this}config(e="config",t,n){return argsert("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=applyExtends(e,__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),this[kGetParserConfiguration]()["deep-merge-config"]||!1,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=(__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(s=>{__classPrivateFieldGet(this,_YargsInstance_options,"f").config[s]=n||!0}),this)}completion(e,t,n){return argsert("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),__classPrivateFieldSet(this,_YargsInstance_completionCommand,e||__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"),t),n&&__classPrivateFieldGet(this,_YargsInstance_completion,"f").registerFunction(n),this}command(e,t,n,s,o,a){return argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,s,o,a],arguments.length),__classPrivateFieldGet(this,_YargsInstance_command,"f").addHandler(e,t,n,s,o,a),this}commands(e,t,n,s,o,a){return this.command(e,t,n,s,o,a)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const n=__classPrivateFieldGet(this,_YargsInstance_parentRequire,"f")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").require;return __classPrivateFieldGet(this,_YargsInstance_command,"f").addDirectory(e,n,__classPrivateFieldGet(this,_YargsInstance_shim,"f").getCallerFile(),t),this}count(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("count",e),this[kTrackManuallySetKeys](e),this}default(e,t,n){return argsert("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(assertSingleKey(e,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=n),typeof t=="function"&&(assertSingleKey(e,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]||(__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=__classPrivateFieldGet(this,_YargsInstance_usage,"f").functionDescription(t)),t=t.call()),this[kPopulateParserHintSingleValueDictionary](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,s){return argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,s],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedCommands._={min:e,max:t,minMsg:n,maxMsg:s},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(s=>{assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandOption(s,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(s=>{assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandOption(s,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return argsert("<object|string|array> [string]",[e,t],arguments.length),this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return argsert("<string> [string|boolean]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_options,"f").deprecatedOptions[e]=t,this}describe(e,t){return argsert("<object|string|array> [string]",[e,t],arguments.length),this[kSetKey](e,!0),__classPrivateFieldGet(this,_YargsInstance_usage,"f").describe(e,t),this}detectLocale(e){return argsert("<boolean>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_detectLocale,e,"f"),this}env(e){return argsert("[string|boolean]",[e],arguments.length),e===!1?delete __classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix:__classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix=e||"",this}epilogue(e){return argsert("<string>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return argsert("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):__classPrivateFieldGet(this,_YargsInstance_usage,"f").example(e,t),this}exit(e,t){__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),__classPrivateFieldSet(this,_YargsInstance_exitError,t,"f"),__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.exit(e)}exitProcess(e=!0){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_exitProcess,e,"f"),this}fail(e){if(argsert("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new YError("Invalid first argument. Expected function or boolean 'false'");return __classPrivateFieldGet(this,_YargsInstance_usage,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return argsert("<array> [function]",[e,t],arguments.length),t?__classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(e,t):new Promise((n,s)=>{__classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(e,(o,a)=>{o?s(o):n(a)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,_YargsInstance_detectLocale,"f")}getExitProcess(){return __classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")}getGroups(){return Object.assign({},__classPrivateFieldGet(this,_YargsInstance_groups,"f"),__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f"))}getHelp(){if(__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),!__classPrivateFieldGet(this,_YargsInstance_usage,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}const e=__classPrivateFieldGet(this,_YargsInstance_command,"f").runDefaultBuilderOn(this);if(isPromise(e))return e.then(()=>__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}return Promise.resolve(__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}getOptions(){return __classPrivateFieldGet(this,_YargsInstance_options,"f")}getStrict(){return __classPrivateFieldGet(this,_YargsInstance_strict,"f")}getStrictCommands(){return __classPrivateFieldGet(this,_YargsInstance_strictCommands,"f")}getStrictOptions(){return __classPrivateFieldGet(this,_YargsInstance_strictOptions,"f")}global(e,t){return argsert("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?__classPrivateFieldGet(this,_YargsInstance_options,"f").local=__classPrivateFieldGet(this,_YargsInstance_options,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{__classPrivateFieldGet(this,_YargsInstance_options,"f").local.includes(n)||__classPrivateFieldGet(this,_YargsInstance_options,"f").local.push(n)}),this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const n=__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t]||__classPrivateFieldGet(this,_YargsInstance_groups,"f")[t];__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t]&&delete __classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t];const s={};return __classPrivateFieldGet(this,_YargsInstance_groups,"f")[t]=(n||[]).concat(e).filter(o=>s[o]?!1:s[o]=!0),this}hide(e){return argsert("<string>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_options,"f").hiddenOptions.push(e),this}implies(e,t){return argsert("<string|object> [number|string|array]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_validation,"f").implies(e,t),this}locale(e){return argsert("[string]",[e],arguments.length),e===void 0?(this[kGuessLocale](),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.getLocale()):(__classPrivateFieldSet(this,_YargsInstance_detectLocale,!1,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.setLocale(e),this)}middleware(e,t,n){return __classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").addMiddleware(e,!!t,n)}nargs(e,t){return argsert("<string|object|array> [number]",[e,t],arguments.length),this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this),"narg",e,t),this}normalize(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("normalize",e),this}number(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("number",e),this[kTrackManuallySetKeys](e),this}option(e,t){if(argsert("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),this[kTrackManuallySetKeys](e),__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&(e==="version"||t?.alias==="version")&&this[kEmitWarning](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
63
- `),void 0,"versionWarning"),__classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);const n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);const s=t.demand||t.required||t.require;s&&this.demand(e,s),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);const o=t.describe||t.description||t.desc,a=__classPrivateFieldGet(this,_YargsInstance_usage,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(a,e)||typeof o=="string")&&this.describe(e,o),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){argsert("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[kFreeze](),typeof e>"u"&&(e=__classPrivateFieldGet(this,_YargsInstance_processArgs,"f")),typeof t=="object"&&(__classPrivateFieldSet(this,_YargsInstance_parseContext,t,"f"),t=n),typeof t=="function"&&(__classPrivateFieldSet(this,_YargsInstance_parseFn,t,"f"),t=!1),t||__classPrivateFieldSet(this,_YargsInstance_processArgs,e,"f"),__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldSet(this,_YargsInstance_exitProcess,!1,"f");const s=this[kRunYargsParserAndExecuteCommands](e,!!t),o=this.parsed;return __classPrivateFieldGet(this,_YargsInstance_completion,"f").setParsed(this.parsed),isPromise(s)?s.then(a=>(__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f").call(this,__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),a,__classPrivateFieldGet(this,_YargsInstance_output,"f")),a)).catch(a=>{throw __classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")(a,this.parsed.argv,__classPrivateFieldGet(this,_YargsInstance_output,"f")),a}).finally(()=>{this[kUnfreeze](),this.parsed=o}):(__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f").call(this,__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),s,__classPrivateFieldGet(this,_YargsInstance_output,"f")),this[kUnfreeze](),this.parsed=o,s)}parseAsync(e,t,n){const s=this.parse(e,t,n);return isPromise(s)?s:Promise.resolve(s)}parseSync(e,t,n){const s=this.parse(e,t,n);if(isPromise(s))throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_parserConfig,e,"f"),this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let n=null;const s=this[kPkgUp](t||__classPrivateFieldGet(this,_YargsInstance_cwd,"f"));return s[e]&&typeof s[e]=="object"&&(n=applyExtends(s[e],t||__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),this[kGetParserConfiguration]()["deep-merge-config"]||!1,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=(__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[]).concat(n)),this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,(a,l)=>a==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(a));const s=__classPrivateFieldGet(this,_YargsInstance_context,"f").fullCommands[__classPrivateFieldGet(this,_YargsInstance_context,"f").fullCommands.length-1],o=s?__classPrivateFieldGet(this,_YargsInstance_command,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return objectKeys(o).forEach(a=>{const l=o[a];Array.isArray(l)?l.indexOf(e)!==-1&&(t[a]=!0):l[e]&&!(a in t)&&(t[a]=l[e])}),this.group(e,__classPrivateFieldGet(this,_YargsInstance_usage,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_recommendCommands,e,"f"),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return argsert("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&__classPrivateFieldGet(this,_YargsInstance_options,"f").narg[e]?this:(this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return argsert("[string] [string]",[e,t],arguments.length),e=e||this.$0,__classPrivateFieldGet(this,_YargsInstance_logger,"f").log(__classPrivateFieldGet(this,_YargsInstance_completion,"f").generateCompletionScript(e,t||__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")||"completion")),this}showHelp(e){if(argsert("[string|function]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),!__classPrivateFieldGet(this,_YargsInstance_usage,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e)}),this}const t=__classPrivateFieldGet(this,_YargsInstance_command,"f").runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>{__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e)}),this}return __classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return argsert("[boolean|string] [string]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelpOnFail(e,t),this}showVersion(e){return argsert("[string|function]",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").showVersion(e),this}skipValidation(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("skipValidation",e),this}strict(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strict,e!==!1,"f"),this}strictCommands(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strictCommands,e!==!1,"f"),this}strictOptions(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strictOptions,e!==!1,"f"),this}string(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("string",e),this[kTrackManuallySetKeys](e),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_detectLocale,!1,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.updateLocale(e),this}usage(e,t,n,s){if(argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,s],arguments.length),t!==void 0){if(assertNotStrictEqual(e,null,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,s);throw new YError(".usage() description must start with $0 if being used as alias for .command()")}else return __classPrivateFieldGet(this,_YargsInstance_usage,"f").usage(e),this}usageConfiguration(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_usageConfig,e,"f"),this}version(e,t,n){const s="version";if(argsert("[boolean|string] [string] [string]",[e,t,n],arguments.length),__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&(this[kDeleteFromParserHintObject](__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")),__classPrivateFieldGet(this,_YargsInstance_usage,"f").version(void 0),__classPrivateFieldSet(this,_YargsInstance_versionOpt,null,"f")),arguments.length===0)n=this[kGuessVersion](),e=s;else if(arguments.length===1){if(e===!1)return this;n=e,e=s}else arguments.length===2&&(n=t,t=void 0);return __classPrivateFieldSet(this,_YargsInstance_versionOpt,typeof e=="string"?e:s,"f"),t=t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show version number"),__classPrivateFieldGet(this,_YargsInstance_usage,"f").version(n||void 0),this.boolean(__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")),this.describe(__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f"),t),this}wrap(e){return argsert("<number|null|undefined>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").wrap(e),this}[(_YargsInstance_command=new WeakMap,_YargsInstance_cwd=new WeakMap,_YargsInstance_context=new WeakMap,_YargsInstance_completion=new WeakMap,_YargsInstance_completionCommand=new WeakMap,_YargsInstance_defaultShowHiddenOpt=new WeakMap,_YargsInstance_exitError=new WeakMap,_YargsInstance_detectLocale=new WeakMap,_YargsInstance_emittedWarnings=new WeakMap,_YargsInstance_exitProcess=new WeakMap,_YargsInstance_frozens=new WeakMap,_YargsInstance_globalMiddleware=new WeakMap,_YargsInstance_groups=new WeakMap,_YargsInstance_hasOutput=new WeakMap,_YargsInstance_helpOpt=new WeakMap,_YargsInstance_isGlobalContext=new WeakMap,_YargsInstance_logger=new WeakMap,_YargsInstance_output=new WeakMap,_YargsInstance_options=new WeakMap,_YargsInstance_parentRequire=new WeakMap,_YargsInstance_parserConfig=new WeakMap,_YargsInstance_parseFn=new WeakMap,_YargsInstance_parseContext=new WeakMap,_YargsInstance_pkgs=new WeakMap,_YargsInstance_preservedGroups=new WeakMap,_YargsInstance_processArgs=new WeakMap,_YargsInstance_recommendCommands=new WeakMap,_YargsInstance_shim=new WeakMap,_YargsInstance_strict=new WeakMap,_YargsInstance_strictCommands=new WeakMap,_YargsInstance_strictOptions=new WeakMap,_YargsInstance_usage=new WeakMap,_YargsInstance_usageConfig=new WeakMap,_YargsInstance_versionOpt=new WeakMap,_YargsInstance_validation=new WeakMap,kCopyDoubleDash)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[kCreateLogger](){return{log:(...e)=>{this[kHasParseCallback]()||console.log(...e),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),__classPrivateFieldGet(this,_YargsInstance_output,"f").length&&__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+`
58
+ `;class Completion{constructor(e,t,n,s){var a,o,l;this.yargs=e,this.usage=t,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((a=this.shim.getEnv("SHELL"))===null||a===void 0?void 0:a.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,t,n,s){const a=this.command.getCommandHandlers();for(let l=0,f=e.length;l<f;++l)if(a[e[l]]&&a[e[l]].builder){const E=a[e[l]].builder;if(isCommandBuilderCallback(E)){this.indexAfterLastReset=l+1;const w=this.yargs.getInternalMethods().reset();return E(w,!0),w.argv}}const o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),this.choicesFromOptionsCompletions(o,e,t,n),this.choicesFromPositionalsCompletions(o,e,t,n),s(null,o)}commandCompletions(e,t,n){const s=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&s[s.length-1]!==n&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(a=>{const o=parseCommand(a[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{const l=a[1]||"";e.push(o.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,t,n,s){if((s.match(/^-/)||s===""&&e.length===0)&&!this.previousArgHasChoices(t)){const a=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(a.key).forEach(l=>{const f=!!a.configuration["boolean-negation"]&&a.boolean.includes(l);!o.includes(l)&&!a.hiddenOptions.includes(l)&&!this.argsContainKey(t,l,f)&&this.completeOptionKey(l,e,s,f&&!!a.default[l])})}}choicesFromOptionsCompletions(e,t,n,s){if(this.previousArgHasChoices(t)){const a=this.getPreviousArgChoices(t);a&&a.length>0&&e.push(...a.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,n,s){if(s===""&&e.length>0&&this.previousArgHasChoices(t))return;const a=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=a[n._.length-o-1];if(!l)return;const f=this.yargs.getOptions().choices[l]||[];for(const E of f)E.startsWith(s)&&e.push(E.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n="";if(!t.startsWith("-")&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith("-"))return;const s=t.replace(/^-+/,""),a=this.yargs.getOptions(),o=[s,...this.yargs.getAliases()[s]||[]];let l;for(const f of o)if(Object.prototype.hasOwnProperty.call(a.key,f)&&Array.isArray(a.choices[f])){l=a.choices[f];break}if(l)return l.filter(f=>!n||f.startsWith(n))}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){const s=a=>e.indexOf((/^[^0-9]$/.test(a)?"-":"--")+a)!==-1;if(s(t)||n&&s(`no-${t}`))return!0;if(this.aliases){for(const a of this.aliases[t])if(s(a))return!0}return!1}completeOptionKey(e,t,n,s){var a,o,l,f;let E=e;if(this.zshShell){const H=this.usage.getDescriptions(),Q=(o=(a=this===null||this===void 0?void 0:this.aliases)===null||a===void 0?void 0:a[e])===null||o===void 0?void 0:o.find(U=>{const te=H[U];return typeof te=="string"&&te.length>0}),W=Q?H[Q]:void 0,_=(f=(l=H[e])!==null&&l!==void 0?l:W)!==null&&f!==void 0?f:"";E=`${e.replace(/:/g,"\\:")}:${_.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const w=H=>/^--/.test(H),y=H=>/^[^0-9]$/.test(H),d=!w(n)&&y(e)?"-":"--";t.push(d+E),s&&t.push(d+"no-"+E)}customCompletion(e,t,n,s){if(assertNotStrictEqual(this.customCompletionFunction,null,this.shim),isSyncCompletionFunction(this.customCompletionFunction)){const a=this.customCompletionFunction(n,t);return isPromise(a)?a.then(o=>{this.shim.process.nextTick(()=>{s(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{s(o,void 0)})}):s(null,a)}else return isFallbackCompletionFunction(this.customCompletionFunction)?this.customCompletionFunction(n,t,(a=s)=>this.defaultCompletion(e,t,n,a),a=>{s(null,a)}):this.customCompletionFunction(n,t,a=>{s(null,a)})}getCompletion(e,t){const n=e.length?e[e.length-1]:"",s=this.yargs.parse(e,!0),a=this.customCompletionFunction?o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return isPromise(s)?s.then(a):a(s)}generateCompletionScript(e,t){let n=this.zshShell?completionZshTemplate:completionShTemplate;const s=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(i,e,t,n){return new Completion(i,e,t,n)}function isSyncCompletionFunction(i){return i.length<3}function isFallbackCompletionFunction(i){return i.length>3}function levenshtein(i,e){if(i.length===0)return e.length;if(e.length===0)return i.length;const t=[];let n;for(n=0;n<=e.length;n++)t[n]=[n];let s;for(s=0;s<=i.length;s++)t[0][s]=s;for(n=1;n<=e.length;n++)for(s=1;s<=i.length;s++)e.charAt(n-1)===i.charAt(s-1)?t[n][s]=t[n-1][s-1]:n>1&&s>1&&e.charAt(n-2)===i.charAt(s-1)&&e.charAt(n-1)===i.charAt(s-2)?t[n][s]=t[n-2][s-2]+1:t[n][s]=Math.min(t[n-1][s-1]+1,Math.min(t[n][s-1]+1,t[n-1][s]+1));return t[e.length][i.length]}const specialKeys=["$0","--","_"];function validation(i,e,t){const n=t.y18n.__,s=t.y18n.__n,a={};a.nonOptionCount=function(y){const d=i.getDemandedCommands(),Q=y._.length+(y["--"]?y["--"].length:0)-i.getInternalMethods().getContext().commands.length;d._&&(Q<d._.min||Q>d._.max)&&(Q<d._.min?d._.minMsg!==void 0?e.fail(d._.minMsg?d._.minMsg.replace(/\$0/g,Q.toString()).replace(/\$1/,d._.min.toString()):null):e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",Q,Q.toString(),d._.min.toString())):Q>d._.max&&(d._.maxMsg!==void 0?e.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,Q.toString()).replace(/\$1/,d._.max.toString()):null):e.fail(s("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",Q,Q.toString(),d._.max.toString()))))},a.positionalCount=function(y,d){d<y&&e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",d,d+"",y+""))},a.requiredArguments=function(y,d){let H=null;for(const Q of Object.keys(d))(!Object.prototype.hasOwnProperty.call(y,Q)||typeof y[Q]>"u")&&(H=H||{},H[Q]=d[Q]);if(H){const Q=[];for(const _ of Object.keys(H)){const U=H[_];U&&Q.indexOf(U)<0&&Q.push(U)}const W=Q.length?`
59
+ ${Q.join(`
60
+ `)}`:"";e.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys(H).length,Object.keys(H).join(", ")+W))}},a.unknownArguments=function(y,d,H,Q,W=!0){var _;const U=i.getInternalMethods().getCommandInstance().getCommands(),te=[],T=i.getInternalMethods().getContext();if(Object.keys(y).forEach(X=>{!specialKeys.includes(X)&&!Object.prototype.hasOwnProperty.call(H,X)&&!Object.prototype.hasOwnProperty.call(i.getInternalMethods().getParseContext(),X)&&!a.isValidAndSomeAliasIsNotNew(X,d)&&te.push(X)}),W&&(T.commands.length>0||U.length>0||Q)&&y._.slice(T.commands.length).forEach(X=>{U.includes(""+X)||te.push(""+X)}),W){const K=((_=i.getDemandedCommands()._)===null||_===void 0?void 0:_.max)||0,le=T.commands.length+K;le<y._.length&&y._.slice(le).forEach(re=>{re=String(re),!T.commands.includes(re)&&!te.includes(re)&&te.push(re)})}te.length&&e.fail(s("Unknown argument: %s","Unknown arguments: %s",te.length,te.map(X=>X.trim()?X:`"${X}"`).join(", ")))},a.unknownCommands=function(y){const d=i.getInternalMethods().getCommandInstance().getCommands(),H=[],Q=i.getInternalMethods().getContext();return(Q.commands.length>0||d.length>0)&&y._.slice(Q.commands.length).forEach(W=>{d.includes(""+W)||H.push(""+W)}),H.length>0?(e.fail(s("Unknown command: %s","Unknown commands: %s",H.length,H.join(", "))),!0):!1},a.isValidAndSomeAliasIsNotNew=function(y,d){if(!Object.prototype.hasOwnProperty.call(d,y))return!1;const H=i.parsed.newAliases;return[y,...d[y]].some(Q=>!Object.prototype.hasOwnProperty.call(H,Q)||!H[y])},a.limitedChoices=function(y){const d=i.getOptions(),H={};if(!Object.keys(d.choices).length)return;Object.keys(y).forEach(_=>{specialKeys.indexOf(_)===-1&&Object.prototype.hasOwnProperty.call(d.choices,_)&&[].concat(y[_]).forEach(U=>{d.choices[_].indexOf(U)===-1&&U!==void 0&&(H[_]=(H[_]||[]).concat(U))})});const Q=Object.keys(H);if(!Q.length)return;let W=n("Invalid values:");Q.forEach(_=>{W+=`
61
+ ${n("Argument: %s, Given: %s, Choices: %s",_,e.stringifiedValues(H[_]),e.stringifiedValues(d.choices[_]))}`}),e.fail(W)};let o={};a.implies=function(y,d){argsert("<string|object> [array|number|string]",[y,d],arguments.length),typeof y=="object"?Object.keys(y).forEach(H=>{a.implies(H,y[H])}):(i.global(y),o[y]||(o[y]=[]),Array.isArray(d)?d.forEach(H=>a.implies(y,H)):(assertNotStrictEqual(d,void 0,t),o[y].push(d)))},a.getImplied=function(){return o};function l(w,y){const d=Number(y);return y=isNaN(d)?y:d,typeof y=="number"?y=w._.length>=y:y.match(/^--no-.+/)?(y=y.match(/^--no-(.+)/)[1],y=!Object.prototype.hasOwnProperty.call(w,y)):y=Object.prototype.hasOwnProperty.call(w,y),y}a.implications=function(y){const d=[];if(Object.keys(o).forEach(H=>{const Q=H;(o[H]||[]).forEach(W=>{let _=Q;const U=W;_=l(y,_),W=l(y,W),_&&!W&&d.push(` ${Q} -> ${U}`)})}),d.length){let H=`${n("Implications failed:")}
62
+ `;d.forEach(Q=>{H+=Q}),e.fail(H)}};let f={};a.conflicts=function(y,d){argsert("<string|object> [array|string]",[y,d],arguments.length),typeof y=="object"?Object.keys(y).forEach(H=>{a.conflicts(H,y[H])}):(i.global(y),f[y]||(f[y]=[]),Array.isArray(d)?d.forEach(H=>a.conflicts(y,H)):f[y].push(d))},a.getConflicting=()=>f,a.conflicting=function(y){Object.keys(y).forEach(d=>{f[d]&&f[d].forEach(H=>{H&&y[d]!==void 0&&y[H]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",d,H))})}),i.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(f).forEach(d=>{f[d].forEach(H=>{H&&y[t.Parser.camelCase(d)]!==void 0&&y[t.Parser.camelCase(H)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",d,H))})})},a.recommendCommands=function(y,d){d=d.sort((_,U)=>U.length-_.length);let Q=null,W=1/0;for(let _=0,U;(U=d[_])!==void 0;_++){const te=levenshtein(y,U);te<=3&&te<W&&(W=te,Q=U)}Q&&e.fail(n("Did you mean %s?",Q))},a.reset=function(y){return o=objFilter(o,d=>!y[d]),f=objFilter(f,d=>!y[d]),a};const E=[];return a.freeze=function(){E.push({implied:o,conflicting:f})},a.unfreeze=function(){const y=E.pop();assertNotStrictEqual(y,void 0,t),{implied:o,conflicting:f}=y},a}let previouslyVisitedConfigs=[],shim;function applyExtends(i,e,t,n){shim=n;let s={};if(Object.prototype.hasOwnProperty.call(i,"extends")){if(typeof i.extends!="string")return s;const a=/\.json|\..*rc$/.test(i.extends);let o=null;if(a)o=getPathToDefaultConfig(e,i.extends);else try{o=require.resolve(i.extends)}catch{return i}checkForCircularExtends(o),previouslyVisitedConfigs.push(o),s=a?JSON.parse(shim.readFileSync(o,"utf8")):require(i.extends),delete i.extends,s=applyExtends(s,shim.path.dirname(o),t,shim)}return previouslyVisitedConfigs=[],t?mergeDeep(s,i):Object.assign({},s,i)}function checkForCircularExtends(i){if(previouslyVisitedConfigs.indexOf(i)>-1)throw new YError(`Circular extended configurations: '${i}'.`)}function getPathToDefaultConfig(i,e){return shim.path.resolve(i,e)}function mergeDeep(i,e){const t={};function n(s){return s&&typeof s=="object"&&!Array.isArray(s)}Object.assign(t,i);for(const s of Object.keys(e))n(e[s])&&n(t[s])?t[s]=mergeDeep(i[s],e[s]):t[s]=e[s];return t}var __classPrivateFieldSet=function(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},__classPrivateFieldGet=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},_YargsInstance_command,_YargsInstance_cwd,_YargsInstance_context,_YargsInstance_completion,_YargsInstance_completionCommand,_YargsInstance_defaultShowHiddenOpt,_YargsInstance_exitError,_YargsInstance_detectLocale,_YargsInstance_emittedWarnings,_YargsInstance_exitProcess,_YargsInstance_frozens,_YargsInstance_globalMiddleware,_YargsInstance_groups,_YargsInstance_hasOutput,_YargsInstance_helpOpt,_YargsInstance_isGlobalContext,_YargsInstance_logger,_YargsInstance_output,_YargsInstance_options,_YargsInstance_parentRequire,_YargsInstance_parserConfig,_YargsInstance_parseFn,_YargsInstance_parseContext,_YargsInstance_pkgs,_YargsInstance_preservedGroups,_YargsInstance_processArgs,_YargsInstance_recommendCommands,_YargsInstance_shim,_YargsInstance_strict,_YargsInstance_strictCommands,_YargsInstance_strictOptions,_YargsInstance_usage,_YargsInstance_usageConfig,_YargsInstance_versionOpt,_YargsInstance_validation;function YargsFactory(i){return(e=[],t=i.process.cwd(),n)=>{const s=new YargsInstance(e,t,n,i);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s}}const kCopyDoubleDash=Symbol("copyDoubleDash"),kCreateLogger=Symbol("copyDoubleDash"),kDeleteFromParserHintObject=Symbol("deleteFromParserHintObject"),kEmitWarning=Symbol("emitWarning"),kFreeze=Symbol("freeze"),kGetDollarZero=Symbol("getDollarZero"),kGetParserConfiguration=Symbol("getParserConfiguration"),kGetUsageConfiguration=Symbol("getUsageConfiguration"),kGuessLocale=Symbol("guessLocale"),kGuessVersion=Symbol("guessVersion"),kParsePositionalNumbers=Symbol("parsePositionalNumbers"),kPkgUp=Symbol("pkgUp"),kPopulateParserHintArray=Symbol("populateParserHintArray"),kPopulateParserHintSingleValueDictionary=Symbol("populateParserHintSingleValueDictionary"),kPopulateParserHintArrayDictionary=Symbol("populateParserHintArrayDictionary"),kPopulateParserHintDictionary=Symbol("populateParserHintDictionary"),kSanitizeKey=Symbol("sanitizeKey"),kSetKey=Symbol("setKey"),kUnfreeze=Symbol("unfreeze"),kValidateAsync=Symbol("validateAsync"),kGetCommandInstance=Symbol("getCommandInstance"),kGetContext=Symbol("getContext"),kGetHasOutput=Symbol("getHasOutput"),kGetLoggerInstance=Symbol("getLoggerInstance"),kGetParseContext=Symbol("getParseContext"),kGetUsageInstance=Symbol("getUsageInstance"),kGetValidationInstance=Symbol("getValidationInstance"),kHasParseCallback=Symbol("hasParseCallback"),kIsGlobalContext=Symbol("isGlobalContext"),kPostProcess=Symbol("postProcess"),kRebase=Symbol("rebase"),kReset=Symbol("reset"),kRunYargsParserAndExecuteCommands=Symbol("runYargsParserAndExecuteCommands"),kRunValidation=Symbol("runValidation"),kSetHasOutput=Symbol("setHasOutput"),kTrackManuallySetKeys=Symbol("kTrackManuallySetKeys");class YargsInstance{constructor(e=[],t,n,s){this.customScriptName=!1,this.parsed=!1,_YargsInstance_command.set(this,void 0),_YargsInstance_cwd.set(this,void 0),_YargsInstance_context.set(this,{commands:[],fullCommands:[]}),_YargsInstance_completion.set(this,null),_YargsInstance_completionCommand.set(this,null),_YargsInstance_defaultShowHiddenOpt.set(this,"show-hidden"),_YargsInstance_exitError.set(this,null),_YargsInstance_detectLocale.set(this,!0),_YargsInstance_emittedWarnings.set(this,{}),_YargsInstance_exitProcess.set(this,!0),_YargsInstance_frozens.set(this,[]),_YargsInstance_globalMiddleware.set(this,void 0),_YargsInstance_groups.set(this,{}),_YargsInstance_hasOutput.set(this,!1),_YargsInstance_helpOpt.set(this,null),_YargsInstance_isGlobalContext.set(this,!0),_YargsInstance_logger.set(this,void 0),_YargsInstance_output.set(this,""),_YargsInstance_options.set(this,void 0),_YargsInstance_parentRequire.set(this,void 0),_YargsInstance_parserConfig.set(this,{}),_YargsInstance_parseFn.set(this,null),_YargsInstance_parseContext.set(this,null),_YargsInstance_pkgs.set(this,{}),_YargsInstance_preservedGroups.set(this,{}),_YargsInstance_processArgs.set(this,void 0),_YargsInstance_recommendCommands.set(this,!1),_YargsInstance_shim.set(this,void 0),_YargsInstance_strict.set(this,!1),_YargsInstance_strictCommands.set(this,!1),_YargsInstance_strictOptions.set(this,!1),_YargsInstance_usage.set(this,void 0),_YargsInstance_usageConfig.set(this,{}),_YargsInstance_versionOpt.set(this,null),_YargsInstance_validation.set(this,void 0),__classPrivateFieldSet(this,_YargsInstance_shim,s,"f"),__classPrivateFieldSet(this,_YargsInstance_processArgs,e,"f"),__classPrivateFieldSet(this,_YargsInstance_cwd,t,"f"),__classPrivateFieldSet(this,_YargsInstance_parentRequire,n,"f"),__classPrivateFieldSet(this,_YargsInstance_globalMiddleware,new GlobalMiddleware(this),"f"),this.$0=this[kGetDollarZero](),this[kReset](),__classPrivateFieldSet(this,_YargsInstance_command,__classPrivateFieldGet(this,_YargsInstance_command,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_usage,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_validation,__classPrivateFieldGet(this,_YargsInstance_validation,"f"),"f"),__classPrivateFieldSet(this,_YargsInstance_options,__classPrivateFieldGet(this,_YargsInstance_options,"f"),"f"),__classPrivateFieldGet(this,_YargsInstance_options,"f").showHiddenOpt=__classPrivateFieldGet(this,_YargsInstance_defaultShowHiddenOpt,"f"),__classPrivateFieldSet(this,_YargsInstance_logger,this[kCreateLogger](),"f")}addHelpOpt(e,t){const n="help";return argsert("[string|boolean] [string]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&(this[kDeleteFromParserHintObject](__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")),__classPrivateFieldSet(this,_YargsInstance_helpOpt,null,"f")),e===!1&&t===void 0?this:(__classPrivateFieldSet(this,_YargsInstance_helpOpt,typeof e=="string"?e:n,"f"),this.boolean(__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")),this.describe(__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f"),t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(argsert("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;const n=typeof e=="string"?e:__classPrivateFieldGet(this,_YargsInstance_defaultShowHiddenOpt,"f");return this.boolean(n),this.describe(n,t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show hidden options")),__classPrivateFieldGet(this,_YargsInstance_options,"f").showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return argsert("<object|string|array> [string|array]",[e,t],arguments.length),this[kPopulateParserHintArrayDictionary](this.alias.bind(this),"alias",e,t),this}array(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("array",e),this[kTrackManuallySetKeys](e),this}boolean(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("boolean",e),this[kTrackManuallySetKeys](e),this}check(e,t){return argsert("<function> [boolean]",[e,t],arguments.length),this.middleware((n,s)=>maybeAsyncResult(()=>e(n,s.getOptions()),a=>(a?(typeof a=="string"||a instanceof Error)&&__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(a.toString(),a):__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.__("Argument check failed: %s",e.toString())),n),a=>(__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(a.message?a.message:a.toString(),a),n)),!1,t),this}choices(e,t){return argsert("<object|string|array> [string|array]",[e,t],arguments.length),this[kPopulateParserHintArrayDictionary](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(argsert("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new YError("coerce callback must be provided");for(const n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(const n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new YError("coerce callback must be provided");return __classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").addCoerceMiddleware((n,s)=>{let a;return Object.prototype.hasOwnProperty.call(n,e)?maybeAsyncResult(()=>(a=s.getAliases(),t(n[e])),l=>{n[e]=l;const f=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(a[e]&&f!==!0)for(const E of a[e])n[E]=l;return n},l=>{throw new YError(l.message)}):n},e),this}conflicts(e,t){return argsert("<string|object> [string|array]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_validation,"f").conflicts(e,t),this}config(e="config",t,n){return argsert("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=applyExtends(e,__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),this[kGetParserConfiguration]()["deep-merge-config"]||!1,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=(__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(s=>{__classPrivateFieldGet(this,_YargsInstance_options,"f").config[s]=n||!0}),this)}completion(e,t,n){return argsert("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),__classPrivateFieldSet(this,_YargsInstance_completionCommand,e||__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"),t),n&&__classPrivateFieldGet(this,_YargsInstance_completion,"f").registerFunction(n),this}command(e,t,n,s,a,o){return argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,s,a,o],arguments.length),__classPrivateFieldGet(this,_YargsInstance_command,"f").addHandler(e,t,n,s,a,o),this}commands(e,t,n,s,a,o){return this.command(e,t,n,s,a,o)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const n=__classPrivateFieldGet(this,_YargsInstance_parentRequire,"f")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").require;return __classPrivateFieldGet(this,_YargsInstance_command,"f").addDirectory(e,n,__classPrivateFieldGet(this,_YargsInstance_shim,"f").getCallerFile(),t),this}count(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("count",e),this[kTrackManuallySetKeys](e),this}default(e,t,n){return argsert("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(assertSingleKey(e,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=n),typeof t=="function"&&(assertSingleKey(e,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]||(__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=__classPrivateFieldGet(this,_YargsInstance_usage,"f").functionDescription(t)),t=t.call()),this[kPopulateParserHintSingleValueDictionary](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,s){return argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,s],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedCommands._={min:e,max:t,minMsg:n,maxMsg:s},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(s=>{assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandOption(s,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(s=>{assertNotStrictEqual(n,!0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),this.demandOption(s,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return argsert("<object|string|array> [string]",[e,t],arguments.length),this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return argsert("<string> [string|boolean]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_options,"f").deprecatedOptions[e]=t,this}describe(e,t){return argsert("<object|string|array> [string]",[e,t],arguments.length),this[kSetKey](e,!0),__classPrivateFieldGet(this,_YargsInstance_usage,"f").describe(e,t),this}detectLocale(e){return argsert("<boolean>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_detectLocale,e,"f"),this}env(e){return argsert("[string|boolean]",[e],arguments.length),e===!1?delete __classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix:__classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix=e||"",this}epilogue(e){return argsert("<string>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return argsert("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):__classPrivateFieldGet(this,_YargsInstance_usage,"f").example(e,t),this}exit(e,t){__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),__classPrivateFieldSet(this,_YargsInstance_exitError,t,"f"),__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.exit(e)}exitProcess(e=!0){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_exitProcess,e,"f"),this}fail(e){if(argsert("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new YError("Invalid first argument. Expected function or boolean 'false'");return __classPrivateFieldGet(this,_YargsInstance_usage,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return argsert("<array> [function]",[e,t],arguments.length),t?__classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(e,t):new Promise((n,s)=>{__classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(e,(a,o)=>{a?s(a):n(o)})})}getDemandedOptions(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedOptions}getDemandedCommands(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").demandedCommands}getDeprecatedOptions(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_options,"f").deprecatedOptions}getDetectLocale(){return __classPrivateFieldGet(this,_YargsInstance_detectLocale,"f")}getExitProcess(){return __classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")}getGroups(){return Object.assign({},__classPrivateFieldGet(this,_YargsInstance_groups,"f"),__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f"))}getHelp(){if(__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),!__classPrivateFieldGet(this,_YargsInstance_usage,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),void 0,void 0,0,!0);if(isPromise(t))return t.then(()=>__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}const e=__classPrivateFieldGet(this,_YargsInstance_command,"f").runDefaultBuilderOn(this);if(isPromise(e))return e.then(()=>__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}return Promise.resolve(__classPrivateFieldGet(this,_YargsInstance_usage,"f").help())}getOptions(){return __classPrivateFieldGet(this,_YargsInstance_options,"f")}getStrict(){return __classPrivateFieldGet(this,_YargsInstance_strict,"f")}getStrictCommands(){return __classPrivateFieldGet(this,_YargsInstance_strictCommands,"f")}getStrictOptions(){return __classPrivateFieldGet(this,_YargsInstance_strictOptions,"f")}global(e,t){return argsert("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?__classPrivateFieldGet(this,_YargsInstance_options,"f").local=__classPrivateFieldGet(this,_YargsInstance_options,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{__classPrivateFieldGet(this,_YargsInstance_options,"f").local.includes(n)||__classPrivateFieldGet(this,_YargsInstance_options,"f").local.push(n)}),this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const n=__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t]||__classPrivateFieldGet(this,_YargsInstance_groups,"f")[t];__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t]&&delete __classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f")[t];const s={};return __classPrivateFieldGet(this,_YargsInstance_groups,"f")[t]=(n||[]).concat(e).filter(a=>s[a]?!1:s[a]=!0),this}hide(e){return argsert("<string>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_options,"f").hiddenOptions.push(e),this}implies(e,t){return argsert("<string|object> [number|string|array]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_validation,"f").implies(e,t),this}locale(e){return argsert("[string]",[e],arguments.length),e===void 0?(this[kGuessLocale](),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.getLocale()):(__classPrivateFieldSet(this,_YargsInstance_detectLocale,!1,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.setLocale(e),this)}middleware(e,t,n){return __classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").addMiddleware(e,!!t,n)}nargs(e,t){return argsert("<string|object|array> [number]",[e,t],arguments.length),this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this),"narg",e,t),this}normalize(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("normalize",e),this}number(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("number",e),this[kTrackManuallySetKeys](e),this}option(e,t){if(argsert("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),this[kTrackManuallySetKeys](e),__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&(e==="version"||t?.alias==="version")&&this[kEmitWarning](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
63
+ `),void 0,"versionWarning"),__classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);const n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);const s=t.demand||t.required||t.require;s&&this.demand(e,s),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(__classPrivateFieldGet(this,_YargsInstance_options,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);const a=t.describe||t.description||t.desc,o=__classPrivateFieldGet(this,_YargsInstance_usage,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof a=="string")&&this.describe(e,a),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){argsert("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[kFreeze](),typeof e>"u"&&(e=__classPrivateFieldGet(this,_YargsInstance_processArgs,"f")),typeof t=="object"&&(__classPrivateFieldSet(this,_YargsInstance_parseContext,t,"f"),t=n),typeof t=="function"&&(__classPrivateFieldSet(this,_YargsInstance_parseFn,t,"f"),t=!1),t||__classPrivateFieldSet(this,_YargsInstance_processArgs,e,"f"),__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldSet(this,_YargsInstance_exitProcess,!1,"f");const s=this[kRunYargsParserAndExecuteCommands](e,!!t),a=this.parsed;return __classPrivateFieldGet(this,_YargsInstance_completion,"f").setParsed(this.parsed),isPromise(s)?s.then(o=>(__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f").call(this,__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),o,__classPrivateFieldGet(this,_YargsInstance_output,"f")),o)).catch(o=>{throw __classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")(o,this.parsed.argv,__classPrivateFieldGet(this,_YargsInstance_output,"f")),o}).finally(()=>{this[kUnfreeze](),this.parsed=a}):(__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")&&__classPrivateFieldGet(this,_YargsInstance_parseFn,"f").call(this,__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),s,__classPrivateFieldGet(this,_YargsInstance_output,"f")),this[kUnfreeze](),this.parsed=a,s)}parseAsync(e,t,n){const s=this.parse(e,t,n);return isPromise(s)?s:Promise.resolve(s)}parseSync(e,t,n){const s=this.parse(e,t,n);if(isPromise(s))throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_parserConfig,e,"f"),this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let n=null;const s=this[kPkgUp](t||__classPrivateFieldGet(this,_YargsInstance_cwd,"f"));return s[e]&&typeof s[e]=="object"&&(n=applyExtends(s[e],t||__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),this[kGetParserConfiguration]()["deep-merge-config"]||!1,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=(__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[]).concat(n)),this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,(o,l)=>o==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(o));const s=__classPrivateFieldGet(this,_YargsInstance_context,"f").fullCommands[__classPrivateFieldGet(this,_YargsInstance_context,"f").fullCommands.length-1],a=s?__classPrivateFieldGet(this,_YargsInstance_command,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return objectKeys(a).forEach(o=>{const l=a[o];Array.isArray(l)?l.indexOf(e)!==-1&&(t[o]=!0):l[e]&&!(o in t)&&(t[o]=l[e])}),this.group(e,__classPrivateFieldGet(this,_YargsInstance_usage,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_recommendCommands,e,"f"),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return argsert("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&__classPrivateFieldGet(this,_YargsInstance_options,"f").narg[e]?this:(this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return argsert("[string] [string]",[e,t],arguments.length),e=e||this.$0,__classPrivateFieldGet(this,_YargsInstance_logger,"f").log(__classPrivateFieldGet(this,_YargsInstance_completion,"f").generateCompletionScript(e,t||__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")||"completion")),this}showHelp(e){if(argsert("[string|function]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),!__classPrivateFieldGet(this,_YargsInstance_usage,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),void 0,void 0,0,!0);if(isPromise(n))return n.then(()=>{__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e)}),this}const t=__classPrivateFieldGet(this,_YargsInstance_command,"f").runDefaultBuilderOn(this);if(isPromise(t))return t.then(()=>{__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e)}),this}return __classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return argsert("[boolean|string] [string]",[e,t],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").showHelpOnFail(e,t),this}showVersion(e){return argsert("[string|function]",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").showVersion(e),this}skipValidation(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("skipValidation",e),this}strict(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strict,e!==!1,"f"),this}strictCommands(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strictCommands,e!==!1,"f"),this}strictOptions(e){return argsert("[boolean]",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_strictOptions,e!==!1,"f"),this}string(e){return argsert("<array|string>",[e],arguments.length),this[kPopulateParserHintArray]("string",e),this[kTrackManuallySetKeys](e),this}terminalWidth(){return argsert([],0),__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_detectLocale,!1,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.updateLocale(e),this}usage(e,t,n,s){if(argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,s],arguments.length),t!==void 0){if(assertNotStrictEqual(e,null,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,s);throw new YError(".usage() description must start with $0 if being used as alias for .command()")}else return __classPrivateFieldGet(this,_YargsInstance_usage,"f").usage(e),this}usageConfiguration(e){return argsert("<object>",[e],arguments.length),__classPrivateFieldSet(this,_YargsInstance_usageConfig,e,"f"),this}version(e,t,n){const s="version";if(argsert("[boolean|string] [string] [string]",[e,t,n],arguments.length),__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&(this[kDeleteFromParserHintObject](__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")),__classPrivateFieldGet(this,_YargsInstance_usage,"f").version(void 0),__classPrivateFieldSet(this,_YargsInstance_versionOpt,null,"f")),arguments.length===0)n=this[kGuessVersion](),e=s;else if(arguments.length===1){if(e===!1)return this;n=e,e=s}else arguments.length===2&&(n=t,t=void 0);return __classPrivateFieldSet(this,_YargsInstance_versionOpt,typeof e=="string"?e:s,"f"),t=t||__classPrivateFieldGet(this,_YargsInstance_usage,"f").deferY18nLookup("Show version number"),__classPrivateFieldGet(this,_YargsInstance_usage,"f").version(n||void 0),this.boolean(__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")),this.describe(__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f"),t),this}wrap(e){return argsert("<number|null|undefined>",[e],arguments.length),__classPrivateFieldGet(this,_YargsInstance_usage,"f").wrap(e),this}[(_YargsInstance_command=new WeakMap,_YargsInstance_cwd=new WeakMap,_YargsInstance_context=new WeakMap,_YargsInstance_completion=new WeakMap,_YargsInstance_completionCommand=new WeakMap,_YargsInstance_defaultShowHiddenOpt=new WeakMap,_YargsInstance_exitError=new WeakMap,_YargsInstance_detectLocale=new WeakMap,_YargsInstance_emittedWarnings=new WeakMap,_YargsInstance_exitProcess=new WeakMap,_YargsInstance_frozens=new WeakMap,_YargsInstance_globalMiddleware=new WeakMap,_YargsInstance_groups=new WeakMap,_YargsInstance_hasOutput=new WeakMap,_YargsInstance_helpOpt=new WeakMap,_YargsInstance_isGlobalContext=new WeakMap,_YargsInstance_logger=new WeakMap,_YargsInstance_output=new WeakMap,_YargsInstance_options=new WeakMap,_YargsInstance_parentRequire=new WeakMap,_YargsInstance_parserConfig=new WeakMap,_YargsInstance_parseFn=new WeakMap,_YargsInstance_parseContext=new WeakMap,_YargsInstance_pkgs=new WeakMap,_YargsInstance_preservedGroups=new WeakMap,_YargsInstance_processArgs=new WeakMap,_YargsInstance_recommendCommands=new WeakMap,_YargsInstance_shim=new WeakMap,_YargsInstance_strict=new WeakMap,_YargsInstance_strictCommands=new WeakMap,_YargsInstance_strictOptions=new WeakMap,_YargsInstance_usage=new WeakMap,_YargsInstance_usageConfig=new WeakMap,_YargsInstance_versionOpt=new WeakMap,_YargsInstance_validation=new WeakMap,kCopyDoubleDash)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[kCreateLogger](){return{log:(...e)=>{this[kHasParseCallback]()||console.log(...e),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),__classPrivateFieldGet(this,_YargsInstance_output,"f").length&&__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+`
64
64
  `,"f"),__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+e.join(" "),"f")},error:(...e)=>{this[kHasParseCallback]()||console.error(...e),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f"),__classPrivateFieldGet(this,_YargsInstance_output,"f").length&&__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+`
65
- `,"f"),__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+e.join(" "),"f")}}}[kDeleteFromParserHintObject](e){objectKeys(__classPrivateFieldGet(this,_YargsInstance_options,"f")).forEach(t=>{if((s=>s==="configObjects")(t))return;const n=__classPrivateFieldGet(this,_YargsInstance_options,"f")[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete __classPrivateFieldGet(this,_YargsInstance_usage,"f").getDescriptions()[e]}[kEmitWarning](e,t,n){__classPrivateFieldGet(this,_YargsInstance_emittedWarnings,"f")[n]||(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.emitWarning(e,t),__classPrivateFieldGet(this,_YargsInstance_emittedWarnings,"f")[n]=!0)}[kFreeze](){__classPrivateFieldGet(this,_YargsInstance_frozens,"f").push({options:__classPrivateFieldGet(this,_YargsInstance_options,"f"),configObjects:__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f"),groups:__classPrivateFieldGet(this,_YargsInstance_groups,"f"),strict:__classPrivateFieldGet(this,_YargsInstance_strict,"f"),strictCommands:__classPrivateFieldGet(this,_YargsInstance_strictCommands,"f"),strictOptions:__classPrivateFieldGet(this,_YargsInstance_strictOptions,"f"),completionCommand:__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"),output:__classPrivateFieldGet(this,_YargsInstance_output,"f"),exitError:__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),hasOutput:__classPrivateFieldGet(this,_YargsInstance_hasOutput,"f"),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,_YargsInstance_parseFn,"f"),parseContext:__classPrivateFieldGet(this,_YargsInstance_parseContext,"f")}),__classPrivateFieldGet(this,_YargsInstance_usage,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_validation,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_command,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").freeze()}[kGetDollarZero](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv()[0])?t=__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv().slice(1,2):t=__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv().slice(0,1),e=t.map(n=>{const s=this[kRebase](__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_")&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").getProcessArgvBin()===__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_")&&(e=__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_").replace(`${__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.dirname(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.execPath())}/`,"")),e}[kGetParserConfiguration](){return __classPrivateFieldGet(this,_YargsInstance_parserConfig,"f")}[kGetUsageConfiguration](){return __classPrivateFieldGet(this,_YargsInstance_usageConfig,"f")}[kGuessLocale](){if(!__classPrivateFieldGet(this,_YargsInstance_detectLocale,"f"))return;const e=__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LC_ALL")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LC_MESSAGES")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LANG")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[kGuessVersion](){return this[kPkgUp]().version||"unknown"}[kParsePositionalNumbers](e){const t=e["--"]?e["--"]:e._;for(let n=0,s;(s=t[n])!==void 0;n++)__classPrivateFieldGet(this,_YargsInstance_shim,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(t[n]=Number(s));return e}[kPkgUp](e){const t=e||"*";if(__classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t])return __classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t];let n={};try{let s=e||__classPrivateFieldGet(this,_YargsInstance_shim,"f").mainFilename;!e&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.extname(s)&&(s=__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.dirname(s));const o=__classPrivateFieldGet(this,_YargsInstance_shim,"f").findUp(s,(a,l)=>{if(l.includes("package.json"))return"package.json"});assertNotStrictEqual(o,void 0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),n=JSON.parse(__classPrivateFieldGet(this,_YargsInstance_shim,"f").readFileSync(o,"utf8"))}catch{}return __classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t]=n||{},__classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t]}[kPopulateParserHintArray](e,t){t=[].concat(t),t.forEach(n=>{n=this[kSanitizeKey](n),__classPrivateFieldGet(this,_YargsInstance_options,"f")[e].push(n)})}[kPopulateParserHintSingleValueDictionary](e,t,n,s){this[kPopulateParserHintDictionary](e,t,n,s,(o,a,l)=>{__classPrivateFieldGet(this,_YargsInstance_options,"f")[o][a]=l})}[kPopulateParserHintArrayDictionary](e,t,n,s){this[kPopulateParserHintDictionary](e,t,n,s,(o,a,l)=>{__classPrivateFieldGet(this,_YargsInstance_options,"f")[o][a]=(__classPrivateFieldGet(this,_YargsInstance_options,"f")[o][a]||[]).concat(l)})}[kPopulateParserHintDictionary](e,t,n,s,o){if(Array.isArray(n))n.forEach(a=>{e(a,s)});else if((a=>typeof a=="object")(n))for(const a of objectKeys(n))e(a,n[a]);else o(t,this[kSanitizeKey](n),s)}[kSanitizeKey](e){return e==="__proto__"?"___proto___":e}[kSetKey](e,t){return this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this),"key",e,t),this}[kUnfreeze](){var e,t,n,s,o,a,l,d,B,w,E,_;const U=__classPrivateFieldGet(this,_YargsInstance_frozens,"f").pop();assertNotStrictEqual(U,void 0,__classPrivateFieldGet(this,_YargsInstance_shim,"f"));let H;e=this,t=this,n=this,s=this,o=this,a=this,l=this,d=this,B=this,w=this,E=this,_=this,{options:{set value(W){__classPrivateFieldSet(e,_YargsInstance_options,W,"f")}}.value,configObjects:H,exitProcess:{set value(W){__classPrivateFieldSet(t,_YargsInstance_exitProcess,W,"f")}}.value,groups:{set value(W){__classPrivateFieldSet(n,_YargsInstance_groups,W,"f")}}.value,output:{set value(W){__classPrivateFieldSet(s,_YargsInstance_output,W,"f")}}.value,exitError:{set value(W){__classPrivateFieldSet(o,_YargsInstance_exitError,W,"f")}}.value,hasOutput:{set value(W){__classPrivateFieldSet(a,_YargsInstance_hasOutput,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){__classPrivateFieldSet(l,_YargsInstance_strict,W,"f")}}.value,strictCommands:{set value(W){__classPrivateFieldSet(d,_YargsInstance_strictCommands,W,"f")}}.value,strictOptions:{set value(W){__classPrivateFieldSet(B,_YargsInstance_strictOptions,W,"f")}}.value,completionCommand:{set value(W){__classPrivateFieldSet(w,_YargsInstance_completionCommand,W,"f")}}.value,parseFn:{set value(W){__classPrivateFieldSet(E,_YargsInstance_parseFn,W,"f")}}.value,parseContext:{set value(W){__classPrivateFieldSet(_,_YargsInstance_parseContext,W,"f")}}.value}=U,__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=H,__classPrivateFieldGet(this,_YargsInstance_usage,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_validation,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_command,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").unfreeze()}[kValidateAsync](e,t){return maybeAsyncResult(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[kGetCommandInstance].bind(this),getContext:this[kGetContext].bind(this),getHasOutput:this[kGetHasOutput].bind(this),getLoggerInstance:this[kGetLoggerInstance].bind(this),getParseContext:this[kGetParseContext].bind(this),getParserConfiguration:this[kGetParserConfiguration].bind(this),getUsageConfiguration:this[kGetUsageConfiguration].bind(this),getUsageInstance:this[kGetUsageInstance].bind(this),getValidationInstance:this[kGetValidationInstance].bind(this),hasParseCallback:this[kHasParseCallback].bind(this),isGlobalContext:this[kIsGlobalContext].bind(this),postProcess:this[kPostProcess].bind(this),reset:this[kReset].bind(this),runValidation:this[kRunValidation].bind(this),runYargsParserAndExecuteCommands:this[kRunYargsParserAndExecuteCommands].bind(this),setHasOutput:this[kSetHasOutput].bind(this)}}[kGetCommandInstance](){return __classPrivateFieldGet(this,_YargsInstance_command,"f")}[kGetContext](){return __classPrivateFieldGet(this,_YargsInstance_context,"f")}[kGetHasOutput](){return __classPrivateFieldGet(this,_YargsInstance_hasOutput,"f")}[kGetLoggerInstance](){return __classPrivateFieldGet(this,_YargsInstance_logger,"f")}[kGetParseContext](){return __classPrivateFieldGet(this,_YargsInstance_parseContext,"f")||{}}[kGetUsageInstance](){return __classPrivateFieldGet(this,_YargsInstance_usage,"f")}[kGetValidationInstance](){return __classPrivateFieldGet(this,_YargsInstance_validation,"f")}[kHasParseCallback](){return!!__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")}[kIsGlobalContext](){return __classPrivateFieldGet(this,_YargsInstance_isGlobalContext,"f")}[kPostProcess](e,t,n,s){return n||isPromise(e)||(t||(e=this[kCopyDoubleDash](e)),(this[kGetParserConfiguration]()["parse-positional-numbers"]||this[kGetParserConfiguration]()["parse-positional-numbers"]===void 0)&&(e=this[kParsePositionalNumbers](e)),s&&(e=applyMiddleware(e,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!1))),e}[kReset](e={}){__classPrivateFieldSet(this,_YargsInstance_options,__classPrivateFieldGet(this,_YargsInstance_options,"f")||{},"f");const t={};t.local=__classPrivateFieldGet(this,_YargsInstance_options,"f").local||[],t.configObjects=__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[];const n={};t.local.forEach(a=>{n[a]=!0,(e[a]||[]).forEach(l=>{n[l]=!0})}),Object.assign(__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f"),Object.keys(__classPrivateFieldGet(this,_YargsInstance_groups,"f")).reduce((a,l)=>{const d=__classPrivateFieldGet(this,_YargsInstance_groups,"f")[l].filter(B=>!(B in n));return d.length>0&&(a[l]=d),a},{})),__classPrivateFieldSet(this,_YargsInstance_groups,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(a=>{t[a]=(__classPrivateFieldGet(this,_YargsInstance_options,"f")[a]||[]).filter(l=>!n[l])}),o.forEach(a=>{t[a]=objFilter(__classPrivateFieldGet(this,_YargsInstance_options,"f")[a],l=>!n[l])}),t.envPrefix=__classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix,__classPrivateFieldSet(this,_YargsInstance_options,t,"f"),__classPrivateFieldSet(this,_YargsInstance_usage,__classPrivateFieldGet(this,_YargsInstance_usage,"f")?__classPrivateFieldGet(this,_YargsInstance_usage,"f").reset(n):usage(this,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldSet(this,_YargsInstance_validation,__classPrivateFieldGet(this,_YargsInstance_validation,"f")?__classPrivateFieldGet(this,_YargsInstance_validation,"f").reset(n):validation(this,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldSet(this,_YargsInstance_command,__classPrivateFieldGet(this,_YargsInstance_command,"f")?__classPrivateFieldGet(this,_YargsInstance_command,"f").reset():command(__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_validation,"f"),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldGet(this,_YargsInstance_completion,"f")||__classPrivateFieldSet(this,_YargsInstance_completion,completion(this,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_command,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").reset(),__classPrivateFieldSet(this,_YargsInstance_completionCommand,null,"f"),__classPrivateFieldSet(this,_YargsInstance_output,"","f"),__classPrivateFieldSet(this,_YargsInstance_exitError,null,"f"),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!1,"f"),this.parsed=!1,this}[kRebase](e,t){return __classPrivateFieldGet(this,_YargsInstance_shim,"f").path.relative(e,t)}[kRunYargsParserAndExecuteCommands](e,t,n,s=0,o=!1){let a=!!n||o;e=e||__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),__classPrivateFieldGet(this,_YargsInstance_options,"f").__=__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.__,__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration=this[kGetParserConfiguration]();const l=!!__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration["populate--"],d=Object.assign({},__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration,{"populate--":!0}),B=__classPrivateFieldGet(this,_YargsInstance_shim,"f").Parser.detailed(e,Object.assign({},__classPrivateFieldGet(this,_YargsInstance_options,"f"),{configuration:{"parse-positional-numbers":!1,...d}})),w=Object.assign(B.argv,__classPrivateFieldGet(this,_YargsInstance_parseContext,"f"));let E;const _=B.aliases;let U=!1,H=!1;Object.keys(w).forEach(W=>{W===__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&w[W]?U=!0:W===__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&w[W]&&(H=!0)}),w.$0=this.$0,this.parsed=B,s===0&&__classPrivateFieldGet(this,_YargsInstance_usage,"f").clearCachedHelpMessage();try{if(this[kGuessLocale](),t)return this[kPostProcess](w,l,!!n,!1);__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&[__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")].concat(_[__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")]||[]).filter(ae=>ae.length>1).includes(""+w._[w._.length-1])&&(w._.pop(),U=!0),__classPrivateFieldSet(this,_YargsInstance_isGlobalContext,!1,"f");const W=__classPrivateFieldGet(this,_YargsInstance_command,"f").getCommands(),L=__classPrivateFieldGet(this,_YargsInstance_completion,"f").completionKey in w,K=U||L||o;if(w._.length){if(W.length){let ee;for(let ae=s||0,se;w._[ae]!==void 0;ae++)if(se=String(w._[ae]),W.includes(se)&&se!==__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")){const ce=__classPrivateFieldGet(this,_YargsInstance_command,"f").runCommand(se,this,B,ae+1,o,U||H||o);return this[kPostProcess](ce,l,!!n,!1)}else if(!ee&&se!==__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")){ee=se;break}!__classPrivateFieldGet(this,_YargsInstance_command,"f").hasDefaultCommand()&&__classPrivateFieldGet(this,_YargsInstance_recommendCommands,"f")&&ee&&!K&&__classPrivateFieldGet(this,_YargsInstance_validation,"f").recommendCommands(ee,W)}__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")&&w._.includes(__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"))&&!L&&(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,_YargsInstance_command,"f").hasDefaultCommand()&&!K){const ee=__classPrivateFieldGet(this,_YargsInstance_command,"f").runCommand(null,this,B,0,o,U||H||o);return this[kPostProcess](ee,l,!!n,!1)}if(L){__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),e=[].concat(e);const ee=e.slice(e.indexOf(`--${__classPrivateFieldGet(this,_YargsInstance_completion,"f").completionKey}`)+1);return __classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(ee,(ae,se)=>{if(ae)throw new YError(ae.message);(se||[]).forEach(ce=>{__classPrivateFieldGet(this,_YargsInstance_logger,"f").log(ce)}),this.exit(0)}),this[kPostProcess](w,!l,!!n,!1)}if(__classPrivateFieldGet(this,_YargsInstance_hasOutput,"f")||(U?(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),a=!0,this.showHelp("log"),this.exit(0)):H&&(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),a=!0,__classPrivateFieldGet(this,_YargsInstance_usage,"f").showVersion("log"),this.exit(0))),!a&&__classPrivateFieldGet(this,_YargsInstance_options,"f").skipValidation.length>0&&(a=Object.keys(w).some(ee=>__classPrivateFieldGet(this,_YargsInstance_options,"f").skipValidation.indexOf(ee)>=0&&w[ee]===!0)),!a){if(B.error)throw new YError(B.error.message);if(!L){const ee=this[kRunValidation](_,{},B.error);n||(E=applyMiddleware(w,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!0)),E=this[kValidateAsync](ee,E??w),isPromise(E)&&!n&&(E=E.then(()=>applyMiddleware(w,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!1)))}}}catch(W){if(W instanceof YError)__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(W.message,W);else throw W}return this[kPostProcess](E??w,l,!!n,!0)}[kRunValidation](e,t,n,s){const o={...this.getDemandedOptions()};return a=>{if(n)throw new YError(n.message);__classPrivateFieldGet(this,_YargsInstance_validation,"f").nonOptionCount(a),__classPrivateFieldGet(this,_YargsInstance_validation,"f").requiredArguments(a,o);let l=!1;__classPrivateFieldGet(this,_YargsInstance_strictCommands,"f")&&(l=__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownCommands(a)),__classPrivateFieldGet(this,_YargsInstance_strict,"f")&&!l?__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownArguments(a,e,t,!!s):__classPrivateFieldGet(this,_YargsInstance_strictOptions,"f")&&__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownArguments(a,e,{},!1,!1),__classPrivateFieldGet(this,_YargsInstance_validation,"f").limitedChoices(a),__classPrivateFieldGet(this,_YargsInstance_validation,"f").implications(a),__classPrivateFieldGet(this,_YargsInstance_validation,"f").conflicting(a)}}[kSetHasOutput](){__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f")}[kTrackManuallySetKeys](e){if(typeof e=="string")__classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0;else for(const t of e)__classPrivateFieldGet(this,_YargsInstance_options,"f").key[t]=!0}}function isYargsInstance(i){return!!i&&typeof i.getInternalMethods=="function"}const Yargs=YargsFactory(shim$1),path={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:path$1.resolve},useDotBin={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},useHashHistory={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},outdir={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:path$1.resolve},webcomponentPrefix={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},base={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},useOverview={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1},toPath=i=>i instanceof URL?node_url.fileURLToPath(i):i;function findUpSync(i,{cwd:e=process__default.cwd(),type:t="file",stopAt:n}={}){let s=path__default.resolve(toPath(e)??"");const{root:o}=path__default.parse(s);for(n=path__default.resolve(s,toPath(n)??o);s&&s!==n&&s!==o;){const a=path__default.isAbsolute(i)?i:path__default.join(s,i);try{const l=fs__default.statSync(a,{throwIfNoEntry:!1});if(t==="file"&&l?.isFile()||t==="directory"&&l?.isDirectory())return a}catch{}s=path__default.dirname(s)}}function packageUpSync({cwd:i=process__default.cwd()}={}){return findUpSync("package.json",{cwd:i})}const r=path$1.dirname(node_url.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.tagName.toUpperCase()==="SCRIPT"&&_documentCurrentScript.src||new URL("cli/index.cjs",document.baseURI).href)),k=`
65
+ `,"f"),__classPrivateFieldSet(this,_YargsInstance_output,__classPrivateFieldGet(this,_YargsInstance_output,"f")+e.join(" "),"f")}}}[kDeleteFromParserHintObject](e){objectKeys(__classPrivateFieldGet(this,_YargsInstance_options,"f")).forEach(t=>{if((s=>s==="configObjects")(t))return;const n=__classPrivateFieldGet(this,_YargsInstance_options,"f")[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete __classPrivateFieldGet(this,_YargsInstance_usage,"f").getDescriptions()[e]}[kEmitWarning](e,t,n){__classPrivateFieldGet(this,_YargsInstance_emittedWarnings,"f")[n]||(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.emitWarning(e,t),__classPrivateFieldGet(this,_YargsInstance_emittedWarnings,"f")[n]=!0)}[kFreeze](){__classPrivateFieldGet(this,_YargsInstance_frozens,"f").push({options:__classPrivateFieldGet(this,_YargsInstance_options,"f"),configObjects:__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects.slice(0),exitProcess:__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f"),groups:__classPrivateFieldGet(this,_YargsInstance_groups,"f"),strict:__classPrivateFieldGet(this,_YargsInstance_strict,"f"),strictCommands:__classPrivateFieldGet(this,_YargsInstance_strictCommands,"f"),strictOptions:__classPrivateFieldGet(this,_YargsInstance_strictOptions,"f"),completionCommand:__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"),output:__classPrivateFieldGet(this,_YargsInstance_output,"f"),exitError:__classPrivateFieldGet(this,_YargsInstance_exitError,"f"),hasOutput:__classPrivateFieldGet(this,_YargsInstance_hasOutput,"f"),parsed:this.parsed,parseFn:__classPrivateFieldGet(this,_YargsInstance_parseFn,"f"),parseContext:__classPrivateFieldGet(this,_YargsInstance_parseContext,"f")}),__classPrivateFieldGet(this,_YargsInstance_usage,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_validation,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_command,"f").freeze(),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").freeze()}[kGetDollarZero](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv()[0])?t=__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv().slice(1,2):t=__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.argv().slice(0,1),e=t.map(n=>{const s=this[kRebase](__classPrivateFieldGet(this,_YargsInstance_cwd,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_")&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").getProcessArgvBin()===__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_")&&(e=__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("_").replace(`${__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.dirname(__classPrivateFieldGet(this,_YargsInstance_shim,"f").process.execPath())}/`,"")),e}[kGetParserConfiguration](){return __classPrivateFieldGet(this,_YargsInstance_parserConfig,"f")}[kGetUsageConfiguration](){return __classPrivateFieldGet(this,_YargsInstance_usageConfig,"f")}[kGuessLocale](){if(!__classPrivateFieldGet(this,_YargsInstance_detectLocale,"f"))return;const e=__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LC_ALL")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LC_MESSAGES")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LANG")||__classPrivateFieldGet(this,_YargsInstance_shim,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[kGuessVersion](){return this[kPkgUp]().version||"unknown"}[kParsePositionalNumbers](e){const t=e["--"]?e["--"]:e._;for(let n=0,s;(s=t[n])!==void 0;n++)__classPrivateFieldGet(this,_YargsInstance_shim,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(t[n]=Number(s));return e}[kPkgUp](e){const t=e||"*";if(__classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t])return __classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t];let n={};try{let s=e||__classPrivateFieldGet(this,_YargsInstance_shim,"f").mainFilename;!e&&__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.extname(s)&&(s=__classPrivateFieldGet(this,_YargsInstance_shim,"f").path.dirname(s));const a=__classPrivateFieldGet(this,_YargsInstance_shim,"f").findUp(s,(o,l)=>{if(l.includes("package.json"))return"package.json"});assertNotStrictEqual(a,void 0,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),n=JSON.parse(__classPrivateFieldGet(this,_YargsInstance_shim,"f").readFileSync(a,"utf8"))}catch{}return __classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t]=n||{},__classPrivateFieldGet(this,_YargsInstance_pkgs,"f")[t]}[kPopulateParserHintArray](e,t){t=[].concat(t),t.forEach(n=>{n=this[kSanitizeKey](n),__classPrivateFieldGet(this,_YargsInstance_options,"f")[e].push(n)})}[kPopulateParserHintSingleValueDictionary](e,t,n,s){this[kPopulateParserHintDictionary](e,t,n,s,(a,o,l)=>{__classPrivateFieldGet(this,_YargsInstance_options,"f")[a][o]=l})}[kPopulateParserHintArrayDictionary](e,t,n,s){this[kPopulateParserHintDictionary](e,t,n,s,(a,o,l)=>{__classPrivateFieldGet(this,_YargsInstance_options,"f")[a][o]=(__classPrivateFieldGet(this,_YargsInstance_options,"f")[a][o]||[]).concat(l)})}[kPopulateParserHintDictionary](e,t,n,s,a){if(Array.isArray(n))n.forEach(o=>{e(o,s)});else if((o=>typeof o=="object")(n))for(const o of objectKeys(n))e(o,n[o]);else a(t,this[kSanitizeKey](n),s)}[kSanitizeKey](e){return e==="__proto__"?"___proto___":e}[kSetKey](e,t){return this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this),"key",e,t),this}[kUnfreeze](){var e,t,n,s,a,o,l,f,E,w,y,d;const H=__classPrivateFieldGet(this,_YargsInstance_frozens,"f").pop();assertNotStrictEqual(H,void 0,__classPrivateFieldGet(this,_YargsInstance_shim,"f"));let Q;e=this,t=this,n=this,s=this,a=this,o=this,l=this,f=this,E=this,w=this,y=this,d=this,{options:{set value(W){__classPrivateFieldSet(e,_YargsInstance_options,W,"f")}}.value,configObjects:Q,exitProcess:{set value(W){__classPrivateFieldSet(t,_YargsInstance_exitProcess,W,"f")}}.value,groups:{set value(W){__classPrivateFieldSet(n,_YargsInstance_groups,W,"f")}}.value,output:{set value(W){__classPrivateFieldSet(s,_YargsInstance_output,W,"f")}}.value,exitError:{set value(W){__classPrivateFieldSet(a,_YargsInstance_exitError,W,"f")}}.value,hasOutput:{set value(W){__classPrivateFieldSet(o,_YargsInstance_hasOutput,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){__classPrivateFieldSet(l,_YargsInstance_strict,W,"f")}}.value,strictCommands:{set value(W){__classPrivateFieldSet(f,_YargsInstance_strictCommands,W,"f")}}.value,strictOptions:{set value(W){__classPrivateFieldSet(E,_YargsInstance_strictOptions,W,"f")}}.value,completionCommand:{set value(W){__classPrivateFieldSet(w,_YargsInstance_completionCommand,W,"f")}}.value,parseFn:{set value(W){__classPrivateFieldSet(y,_YargsInstance_parseFn,W,"f")}}.value,parseContext:{set value(W){__classPrivateFieldSet(d,_YargsInstance_parseContext,W,"f")}}.value}=H,__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects=Q,__classPrivateFieldGet(this,_YargsInstance_usage,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_validation,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_command,"f").unfreeze(),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").unfreeze()}[kValidateAsync](e,t){return maybeAsyncResult(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[kGetCommandInstance].bind(this),getContext:this[kGetContext].bind(this),getHasOutput:this[kGetHasOutput].bind(this),getLoggerInstance:this[kGetLoggerInstance].bind(this),getParseContext:this[kGetParseContext].bind(this),getParserConfiguration:this[kGetParserConfiguration].bind(this),getUsageConfiguration:this[kGetUsageConfiguration].bind(this),getUsageInstance:this[kGetUsageInstance].bind(this),getValidationInstance:this[kGetValidationInstance].bind(this),hasParseCallback:this[kHasParseCallback].bind(this),isGlobalContext:this[kIsGlobalContext].bind(this),postProcess:this[kPostProcess].bind(this),reset:this[kReset].bind(this),runValidation:this[kRunValidation].bind(this),runYargsParserAndExecuteCommands:this[kRunYargsParserAndExecuteCommands].bind(this),setHasOutput:this[kSetHasOutput].bind(this)}}[kGetCommandInstance](){return __classPrivateFieldGet(this,_YargsInstance_command,"f")}[kGetContext](){return __classPrivateFieldGet(this,_YargsInstance_context,"f")}[kGetHasOutput](){return __classPrivateFieldGet(this,_YargsInstance_hasOutput,"f")}[kGetLoggerInstance](){return __classPrivateFieldGet(this,_YargsInstance_logger,"f")}[kGetParseContext](){return __classPrivateFieldGet(this,_YargsInstance_parseContext,"f")||{}}[kGetUsageInstance](){return __classPrivateFieldGet(this,_YargsInstance_usage,"f")}[kGetValidationInstance](){return __classPrivateFieldGet(this,_YargsInstance_validation,"f")}[kHasParseCallback](){return!!__classPrivateFieldGet(this,_YargsInstance_parseFn,"f")}[kIsGlobalContext](){return __classPrivateFieldGet(this,_YargsInstance_isGlobalContext,"f")}[kPostProcess](e,t,n,s){return n||isPromise(e)||(t||(e=this[kCopyDoubleDash](e)),(this[kGetParserConfiguration]()["parse-positional-numbers"]||this[kGetParserConfiguration]()["parse-positional-numbers"]===void 0)&&(e=this[kParsePositionalNumbers](e)),s&&(e=applyMiddleware(e,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!1))),e}[kReset](e={}){__classPrivateFieldSet(this,_YargsInstance_options,__classPrivateFieldGet(this,_YargsInstance_options,"f")||{},"f");const t={};t.local=__classPrivateFieldGet(this,_YargsInstance_options,"f").local||[],t.configObjects=__classPrivateFieldGet(this,_YargsInstance_options,"f").configObjects||[];const n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(l=>{n[l]=!0})}),Object.assign(__classPrivateFieldGet(this,_YargsInstance_preservedGroups,"f"),Object.keys(__classPrivateFieldGet(this,_YargsInstance_groups,"f")).reduce((o,l)=>{const f=__classPrivateFieldGet(this,_YargsInstance_groups,"f")[l].filter(E=>!(E in n));return f.length>0&&(o[l]=f),o},{})),__classPrivateFieldSet(this,_YargsInstance_groups,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],a=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(o=>{t[o]=(__classPrivateFieldGet(this,_YargsInstance_options,"f")[o]||[]).filter(l=>!n[l])}),a.forEach(o=>{t[o]=objFilter(__classPrivateFieldGet(this,_YargsInstance_options,"f")[o],l=>!n[l])}),t.envPrefix=__classPrivateFieldGet(this,_YargsInstance_options,"f").envPrefix,__classPrivateFieldSet(this,_YargsInstance_options,t,"f"),__classPrivateFieldSet(this,_YargsInstance_usage,__classPrivateFieldGet(this,_YargsInstance_usage,"f")?__classPrivateFieldGet(this,_YargsInstance_usage,"f").reset(n):usage(this,__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldSet(this,_YargsInstance_validation,__classPrivateFieldGet(this,_YargsInstance_validation,"f")?__classPrivateFieldGet(this,_YargsInstance_validation,"f").reset(n):validation(this,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldSet(this,_YargsInstance_command,__classPrivateFieldGet(this,_YargsInstance_command,"f")?__classPrivateFieldGet(this,_YargsInstance_command,"f").reset():command(__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_validation,"f"),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldGet(this,_YargsInstance_completion,"f")||__classPrivateFieldSet(this,_YargsInstance_completion,completion(this,__classPrivateFieldGet(this,_YargsInstance_usage,"f"),__classPrivateFieldGet(this,_YargsInstance_command,"f"),__classPrivateFieldGet(this,_YargsInstance_shim,"f")),"f"),__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").reset(),__classPrivateFieldSet(this,_YargsInstance_completionCommand,null,"f"),__classPrivateFieldSet(this,_YargsInstance_output,"","f"),__classPrivateFieldSet(this,_YargsInstance_exitError,null,"f"),__classPrivateFieldSet(this,_YargsInstance_hasOutput,!1,"f"),this.parsed=!1,this}[kRebase](e,t){return __classPrivateFieldGet(this,_YargsInstance_shim,"f").path.relative(e,t)}[kRunYargsParserAndExecuteCommands](e,t,n,s=0,a=!1){let o=!!n||a;e=e||__classPrivateFieldGet(this,_YargsInstance_processArgs,"f"),__classPrivateFieldGet(this,_YargsInstance_options,"f").__=__classPrivateFieldGet(this,_YargsInstance_shim,"f").y18n.__,__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration=this[kGetParserConfiguration]();const l=!!__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration["populate--"],f=Object.assign({},__classPrivateFieldGet(this,_YargsInstance_options,"f").configuration,{"populate--":!0}),E=__classPrivateFieldGet(this,_YargsInstance_shim,"f").Parser.detailed(e,Object.assign({},__classPrivateFieldGet(this,_YargsInstance_options,"f"),{configuration:{"parse-positional-numbers":!1,...f}})),w=Object.assign(E.argv,__classPrivateFieldGet(this,_YargsInstance_parseContext,"f"));let y;const d=E.aliases;let H=!1,Q=!1;Object.keys(w).forEach(W=>{W===__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&w[W]?H=!0:W===__classPrivateFieldGet(this,_YargsInstance_versionOpt,"f")&&w[W]&&(Q=!0)}),w.$0=this.$0,this.parsed=E,s===0&&__classPrivateFieldGet(this,_YargsInstance_usage,"f").clearCachedHelpMessage();try{if(this[kGuessLocale](),t)return this[kPostProcess](w,l,!!n,!1);__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")&&[__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")].concat(d[__classPrivateFieldGet(this,_YargsInstance_helpOpt,"f")]||[]).filter(T=>T.length>1).includes(""+w._[w._.length-1])&&(w._.pop(),H=!0),__classPrivateFieldSet(this,_YargsInstance_isGlobalContext,!1,"f");const W=__classPrivateFieldGet(this,_YargsInstance_command,"f").getCommands(),_=__classPrivateFieldGet(this,_YargsInstance_completion,"f").completionKey in w,U=H||_||a;if(w._.length){if(W.length){let te;for(let T=s||0,X;w._[T]!==void 0;T++)if(X=String(w._[T]),W.includes(X)&&X!==__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")){const K=__classPrivateFieldGet(this,_YargsInstance_command,"f").runCommand(X,this,E,T+1,a,H||Q||a);return this[kPostProcess](K,l,!!n,!1)}else if(!te&&X!==__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")){te=X;break}!__classPrivateFieldGet(this,_YargsInstance_command,"f").hasDefaultCommand()&&__classPrivateFieldGet(this,_YargsInstance_recommendCommands,"f")&&te&&!U&&__classPrivateFieldGet(this,_YargsInstance_validation,"f").recommendCommands(te,W)}__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f")&&w._.includes(__classPrivateFieldGet(this,_YargsInstance_completionCommand,"f"))&&!_&&(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),this.showCompletionScript(),this.exit(0))}if(__classPrivateFieldGet(this,_YargsInstance_command,"f").hasDefaultCommand()&&!U){const te=__classPrivateFieldGet(this,_YargsInstance_command,"f").runCommand(null,this,E,0,a,H||Q||a);return this[kPostProcess](te,l,!!n,!1)}if(_){__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),e=[].concat(e);const te=e.slice(e.indexOf(`--${__classPrivateFieldGet(this,_YargsInstance_completion,"f").completionKey}`)+1);return __classPrivateFieldGet(this,_YargsInstance_completion,"f").getCompletion(te,(T,X)=>{if(T)throw new YError(T.message);(X||[]).forEach(K=>{__classPrivateFieldGet(this,_YargsInstance_logger,"f").log(K)}),this.exit(0)}),this[kPostProcess](w,!l,!!n,!1)}if(__classPrivateFieldGet(this,_YargsInstance_hasOutput,"f")||(H?(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),o=!0,this.showHelp("log"),this.exit(0)):Q&&(__classPrivateFieldGet(this,_YargsInstance_exitProcess,"f")&&setBlocking(!0),o=!0,__classPrivateFieldGet(this,_YargsInstance_usage,"f").showVersion("log"),this.exit(0))),!o&&__classPrivateFieldGet(this,_YargsInstance_options,"f").skipValidation.length>0&&(o=Object.keys(w).some(te=>__classPrivateFieldGet(this,_YargsInstance_options,"f").skipValidation.indexOf(te)>=0&&w[te]===!0)),!o){if(E.error)throw new YError(E.error.message);if(!_){const te=this[kRunValidation](d,{},E.error);n||(y=applyMiddleware(w,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!0)),y=this[kValidateAsync](te,y??w),isPromise(y)&&!n&&(y=y.then(()=>applyMiddleware(w,this,__classPrivateFieldGet(this,_YargsInstance_globalMiddleware,"f").getMiddleware(),!1)))}}}catch(W){if(W instanceof YError)__classPrivateFieldGet(this,_YargsInstance_usage,"f").fail(W.message,W);else throw W}return this[kPostProcess](y??w,l,!!n,!0)}[kRunValidation](e,t,n,s){const a={...this.getDemandedOptions()};return o=>{if(n)throw new YError(n.message);__classPrivateFieldGet(this,_YargsInstance_validation,"f").nonOptionCount(o),__classPrivateFieldGet(this,_YargsInstance_validation,"f").requiredArguments(o,a);let l=!1;__classPrivateFieldGet(this,_YargsInstance_strictCommands,"f")&&(l=__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownCommands(o)),__classPrivateFieldGet(this,_YargsInstance_strict,"f")&&!l?__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownArguments(o,e,t,!!s):__classPrivateFieldGet(this,_YargsInstance_strictOptions,"f")&&__classPrivateFieldGet(this,_YargsInstance_validation,"f").unknownArguments(o,e,{},!1,!1),__classPrivateFieldGet(this,_YargsInstance_validation,"f").limitedChoices(o),__classPrivateFieldGet(this,_YargsInstance_validation,"f").implications(o),__classPrivateFieldGet(this,_YargsInstance_validation,"f").conflicting(o)}}[kSetHasOutput](){__classPrivateFieldSet(this,_YargsInstance_hasOutput,!0,"f")}[kTrackManuallySetKeys](e){if(typeof e=="string")__classPrivateFieldGet(this,_YargsInstance_options,"f").key[e]=!0;else for(const t of e)__classPrivateFieldGet(this,_YargsInstance_options,"f").key[t]=!0}}function isYargsInstance(i){return!!i&&typeof i.getInternalMethods=="function"}const Yargs=YargsFactory(shim$1),path={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:path$1.resolve},useDotBin={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},useHashHistory={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},outdir={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:path$1.resolve},webcomponentPrefix={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},base={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},useOverview={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1},outputSingleFile={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},toPath=i=>i instanceof URL?node_url.fileURLToPath(i):i;function findUpSync(i,{cwd:e=process__default.cwd(),type:t="file",stopAt:n}={}){let s=path__default.resolve(toPath(e)??"");const{root:a}=path__default.parse(s);for(n=path__default.resolve(s,toPath(n)??a);s&&s!==n&&s!==a;){const o=path__default.isAbsolute(i)?i:path__default.join(s,i);try{const l=fs__default.statSync(o,{throwIfNoEntry:!1});if(t==="file"&&l?.isFile()||t==="directory"&&l?.isDirectory())return o}catch{}s=path__default.dirname(s)}}function packageUpSync({cwd:i=process__default.cwd()}={}){return findUpSync("package.json",{cwd:i})}const r=path$1.dirname(node_url.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:_documentCurrentScript&&_documentCurrentScript.tagName.toUpperCase()==="SCRIPT"&&_documentCurrentScript.src||new URL("cli/index.cjs",document.baseURI).href)),k=`
66
66
  /* prettier-ignore-start */
67
67
  /* eslint-disable */
68
68
 
@@ -77,25 +77,25 @@ ${H.join(`
77
77
  `,JsBanners={banner:k,footer:u};function findPkgRoot(){const i=packageUpSync({cwd:r});if(!i)throw new Error("likec4 package folder not found");return path$1.dirname(i)}function viteAppRoot(){const i=findPkgRoot(),e=[path$1.resolve(i,"__app__"),path$1.resolve(r,"../__app__"),path$1.resolve(r,"../../__app__"),path$1.resolve(r,"../../dist/__app__")],t=LikeC4.f(e,fs.existsSync);if(!t)throw LikeC4.H.error(`likec4 app root does not exist, tried:
78
78
  ${e.join(`
79
79
  `)}`),new Error("likec4 app root does not exist");return t}async function mkTempPublicDir(){const i=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-public-"));return await fsPromises.writeFile(path$1.join(i,"likec4-views.js"),`// generated by likec4
80
- `),i}const chunkSizeWarningLimit=1e4;function viteAliases(){const i=findPkgRoot();return{"likec4/icons":path$1.resolve(i,"icons"),"likec4/react":path$1.resolve(i,"react"),"likec4/model":path$1.resolve(i,"dist/model")}}function getSourceRegion(i){var e,t;if(i){if("astNode"in i)return getSourceRegionOfAstNode(i);if(Array.isArray(i))return i.reduce(mergeDocumentSegment,void 0);{const n=i,s=isCstNode(n)?getDocumentURIOrUndefined((t=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&t!==void 0?t:n?.astNode):void 0;return copyDocumentSegment(n,s)}}else return}function isCstNode(i){return typeof i<"u"&&"element"in i&&"text"in i}function getDocumentURIOrUndefined(i){try{return LikeC4.g(i).uri.toString()}catch{return}}function getSourceRegionOfAstNode(i){var e,t;const{astNode:n,property:s,index:o}=i??{},a=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||a===void 0)){if(s===void 0)return copyDocumentSegment(a,getDocumentURI(n));{const l=d=>o!==void 0&&o>-1&&Array.isArray(n[s])?o<d.length?d[o]:void 0:d.reduce(mergeDocumentSegment,void 0);if(!((t=a.assignments)===null||t===void 0)&&t[s]){const d=l(a.assignments[s]);return d&&copyDocumentSegment(d,getDocumentURI(n))}else if(n.$cstNode){const d=l(LikeC4.a(n.$cstNode,s));return d&&copyDocumentSegment(d,getDocumentURI(n))}else return}}}function getDocumentURI(i){var e,t,n,s;return i.$cstNode?(t=(e=LikeC4.g(i))===null||e===void 0?void 0:e.uri)===null||t===void 0?void 0:t.toString():i.$textRegion?i.$textRegion.documentURI||((s=(n=new LikeC4.T(i,o=>o.$container?[o.$container]:[]).find(o=>{var a;return(a=o.$textRegion)===null||a===void 0?void 0:a.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||s===void 0?void 0:s.documentURI):void 0}function copyDocumentSegment(i,e){var t,n;const s={offset:i.offset,end:(t=i.end)!==null&&t!==void 0?t:i.offset+i.length,length:(n=i.length)!==null&&n!==void 0?n:i.end-i.offset};return i.range&&(s.range=i.range),e??(e=i.fileURI),e&&(s.fileURI=e),s}function mergeDocumentSegment(i,e){var t,n;if(i){if(!e)return i&&copyDocumentSegment(i)}else return e&&copyDocumentSegment(e);const s=(t=i.end)!==null&&t!==void 0?t:i.offset+i.length,o=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,a=Math.min(i.offset,e.offset),l=Math.max(s,o),d=l-a,B={offset:a,end:l,length:d};if(i.range&&e.range&&(B.range={start:e.range.start.line<i.range.start.line||e.range.start.line===i.range.start.line&&e.range.start.character<i.range.start.character?e.range.start:i.range.start,end:e.range.end.line>i.range.end.line||e.range.end.line===i.range.end.line&&e.range.end.character>i.range.end.character?e.range.end:i.range.end}),i.fileURI||e.fileURI){const w=i.fileURI,E=e.fileURI,_=w&&E&&w!==E?`<unmergable text regions of ${w}, ${E}>`:w??E;B.fileURI=_}return B}class Context{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,t){if(e.length>0){const n=t&&this.currentPosition;this.lines[this.currentLineNumber].push(e),this.length+=e.length,n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let t=this.traceData.length-1;t>=0;t--){const n=this.traceData[t];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join("").length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){const t=createTraceRegion(e,this.currentPosition,n=>{var s,o;return(o=(s=this.traceData[this.traceData.length-1])===null||s===void 0?void 0:s.children)===null||o===void 0?void 0:o.push(n)});return this.traceData.push(t),t}popTraceRegion(e){const t=this.traceData.pop();return this.assertTrue(t===e,"Trace region mismatch!"),t}getParentTraceSourceFileURI(){var e;for(let t=this.traceData.length-1;t>-1;t--){const n=(e=this.traceData[t].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,t){if(!e)throw new Error(t)}}function createTraceRegion(i,e,t){const n={sourceRegion:i,targetRegion:void 0,children:[],targetStart:e,complete:s=>{var o,a;return n.targetRegion={offset:n.targetStart.offset,end:s.offset,length:s.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:s.line,character:s.character}}},delete n.targetStart,((o=n.children)===null||o===void 0?void 0:o.length)===0&&delete n.children,!((a=n.targetRegion)===null||a===void 0)&&a.length&&t(n),delete n.complete,n}};return n}function processGeneratorNode(i,e){const t=new Context(e),n=t.pushTraceRegion(void 0);processNodeInternal(i,t),t.popTraceRegion(n),n.complete&&n.complete(t.currentPosition);const s=n.children&&n.children.length===1?n.children[0]:void 0,o=s?.targetRegion,a=n.targetRegion;return o&&s.sourceRegion&&o.offset===a.offset&&o.length===a.length?{text:t.content,trace:s}:{text:t.content,trace:n}}function processNodeInternal(i,e){typeof i=="string"?processStringNode(i,e):i instanceof IndentNode?processIndentNode(i,e):i instanceof CompositeGeneratorNode?processCompositeNode(i,e):i instanceof NewLineNode&&processNewLineNode(i,e)}function hasContent(i,e){return typeof i=="string"?i.length!==0:i instanceof CompositeGeneratorNode?i.contents.some(t=>hasContent(t,e)):i instanceof NewLineNode?!(i.ifNotEmpty&&e.currentLineContent.length===0):!1}function processStringNode(i,e){i&&(e.pendingIndent&&handlePendingIndent(e,!1),e.append(i))}function handlePendingIndent(i,e){var t;let n="";for(const s of i.relevantIndents.filter(o=>o.indentEmptyLines||!e))n+=(t=s.indentation)!==null&&t!==void 0?t:i.defaultIndentation;i.append(n,!0),i.pendingIndent=!1}function processCompositeNode(i,e){let t;const n=getSourceRegion(i.tracedSource);n&&(t=e.pushTraceRegion(n));for(const s of i.contents)processNodeInternal(s,e);if(t){e.popTraceRegion(t);const s=e.getParentTraceSourceFileURI();s&&n?.fileURI===s&&delete n.fileURI,t.complete&&t.complete(e.currentPosition)}}function processIndentNode(i,e){var t;if(hasContent(i,e)){i.indentImmediately&&!e.pendingIndent&&e.append((t=i.indentation)!==null&&t!==void 0?t:e.defaultIndentation,!0);try{e.increaseIndent(i),processCompositeNode(i,e)}finally{e.decreaseIndent()}}}function processNewLineNode(i,e){i.ifNotEmpty&&!hasNonWhitespace(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&handlePendingIndent(e,!0),e.append(i.lineDelimiter),e.addNewLine())}function hasNonWhitespace(i){return i.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const nonWhitespace=/\S|$/;function findIndentation(i){const e=i.filter(n=>n.length>0).map(n=>n.search(nonWhitespace)),t=e.length===0?0:Math.min(...e);return Math.max(0,t)}function expandToNode(i,...e){const t=findIndentationAndTemplateStructure(i),n=splitTemplateLinesAndMergeWithSubstitutions(i,e,t);return composeFinalGeneratorNode(n)}function expandTracedToNode(i,e,t){return(n,...s)=>traceToNode(i,e,t)(expandToNode(n,...s))}function findIndentationAndTemplateStructure(i){const e=i.join("_").split(LikeC4.N),t=e.length>1&&e[0].trim().length===0,n=t&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:t,omitLastLine:n,trimLastLine:e.length!==1&&e[e.length-1].trim().length===0};{let s=t?e.slice(1):e;s=n?s.slice(0,s.length-1):s,s=s.filter(a=>a.length!==0);const o=findIndentation(s);return{indentation:o,omitFirstLine:t,omitLastLine:n&&(e[e.length-1].length<o||!e[e.length-1].startsWith(s[0].substring(0,o)))}}}function splitTemplateLinesAndMergeWithSubstitutions(i,e,{indentation:t,omitFirstLine:n,omitLastLine:s,trimLastLine:o}){const a=[];i.forEach((B,w)=>{a.push(...B.split(LikeC4.N).map((E,_)=>_===0||E.length<t?E:E.substring(t)).reduce(w===0?(E,_,U)=>U===0?n?[]:[_]:U===1&&E.length===0?[_]:E.concat(NEWLINE,_):(E,_,U)=>U===0?[_]:E.concat(NEWLINE,_),[]).filter(E=>!(typeof E=="string"&&E.length===0)).concat(isGeneratorNode(e[w])?e[w]:e[w]!==void 0?{content:String(e[w])}:w<e.length?UNDEFINED_SEGMENT:[]))});const l=a.length,d=l!==0?a[l-1]:void 0;return(s||o)&&typeof d=="string"&&d.trim().length===0?n&&l!==1&&a[l-2]===NEWLINE?a.slice(0,l-2):a.slice(0,l-1):a}const NEWLINE={isNewLine:!0},UNDEFINED_SEGMENT={isUndefinedSegment:!0},isNewLineMarker=i=>i===NEWLINE,isUndefinedSegmentMarker=i=>i===UNDEFINED_SEGMENT,isSubstitutionWrapper=i=>i.content!==void 0;function composeFinalGeneratorNode(i){return i.reduce((t,n,s)=>isUndefinedSegmentMarker(n)?t:isNewLineMarker(n)?{node:s!==0&&(isUndefinedSegmentMarker(i[s-1])||isGeneratorNode(i[s-1]))||s>1&&typeof i[s-1]=="string"&&(isUndefinedSegmentMarker(i[s-2])||isGeneratorNode(i[s-2]))?t.node.appendNewLineIfNotEmpty():t.node.appendNewLine()}:(()=>{var o;const a=(s===0||isNewLineMarker(i[s-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",l=isSubstitutionWrapper(n)?n.content:n;let d;return{node:t.indented?t.node:a.length!==0?t.node.indent({indentation:a,indentImmediately:!1,indentedChildren:B=>d=B.append(l)}):t.node.append(l),indented:d??((o=t.indented)===null||o===void 0?void 0:o.append(l))}})(),{node:new CompositeGeneratorNode}).node}const EOL=typeof process>"u"?`
80
+ `),i}const chunkSizeWarningLimit=1e4;function viteAliases(){const i=findPkgRoot();return{"likec4/icons":path$1.resolve(i,"icons"),"likec4/react":path$1.resolve(i,"react"),"likec4/model":path$1.resolve(i,"dist/model")}}function getSourceRegion(i){var e,t;if(i){if("astNode"in i)return getSourceRegionOfAstNode(i);if(Array.isArray(i))return i.reduce(mergeDocumentSegment,void 0);{const n=i,s=isCstNode(n)?getDocumentURIOrUndefined((t=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&t!==void 0?t:n?.astNode):void 0;return copyDocumentSegment(n,s)}}else return}function isCstNode(i){return typeof i<"u"&&"element"in i&&"text"in i}function getDocumentURIOrUndefined(i){try{return LikeC4.g(i).uri.toString()}catch{return}}function getSourceRegionOfAstNode(i){var e,t;const{astNode:n,property:s,index:a}=i??{},o=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||o===void 0)){if(s===void 0)return copyDocumentSegment(o,getDocumentURI(n));{const l=f=>a!==void 0&&a>-1&&Array.isArray(n[s])?a<f.length?f[a]:void 0:f.reduce(mergeDocumentSegment,void 0);if(!((t=o.assignments)===null||t===void 0)&&t[s]){const f=l(o.assignments[s]);return f&&copyDocumentSegment(f,getDocumentURI(n))}else if(n.$cstNode){const f=l(LikeC4.a(n.$cstNode,s));return f&&copyDocumentSegment(f,getDocumentURI(n))}else return}}}function getDocumentURI(i){var e,t,n,s;return i.$cstNode?(t=(e=LikeC4.g(i))===null||e===void 0?void 0:e.uri)===null||t===void 0?void 0:t.toString():i.$textRegion?i.$textRegion.documentURI||((s=(n=new LikeC4.T(i,a=>a.$container?[a.$container]:[]).find(a=>{var o;return(o=a.$textRegion)===null||o===void 0?void 0:o.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||s===void 0?void 0:s.documentURI):void 0}function copyDocumentSegment(i,e){var t,n;const s={offset:i.offset,end:(t=i.end)!==null&&t!==void 0?t:i.offset+i.length,length:(n=i.length)!==null&&n!==void 0?n:i.end-i.offset};return i.range&&(s.range=i.range),e??(e=i.fileURI),e&&(s.fileURI=e),s}function mergeDocumentSegment(i,e){var t,n;if(i){if(!e)return i&&copyDocumentSegment(i)}else return e&&copyDocumentSegment(e);const s=(t=i.end)!==null&&t!==void 0?t:i.offset+i.length,a=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,o=Math.min(i.offset,e.offset),l=Math.max(s,a),f=l-o,E={offset:o,end:l,length:f};if(i.range&&e.range&&(E.range={start:e.range.start.line<i.range.start.line||e.range.start.line===i.range.start.line&&e.range.start.character<i.range.start.character?e.range.start:i.range.start,end:e.range.end.line>i.range.end.line||e.range.end.line===i.range.end.line&&e.range.end.character>i.range.end.character?e.range.end:i.range.end}),i.fileURI||e.fileURI){const w=i.fileURI,y=e.fileURI,d=w&&y&&w!==y?`<unmergable text regions of ${w}, ${y}>`:w??y;E.fileURI=d}return E}class Context{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,t){if(e.length>0){const n=t&&this.currentPosition;this.lines[this.currentLineNumber].push(e),this.length+=e.length,n&&this.indentPendingTraceRegions(n)}}indentPendingTraceRegions(e){for(let t=this.traceData.length-1;t>=0;t--){const n=this.traceData[t];n.targetStart&&n.targetStart.offset===e.offset&&(n.targetStart=this.currentPosition)}}increaseIndent(e){this.currentIndents.push(e),e.indentImmediately||this.recentNonImmediateIndents.push(e)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(e=>!this.recentNonImmediateIndents.includes(e))}resetCurrentLine(){this.length-=this.lines[this.currentLineNumber].join("").length,this.lines[this.currentLineNumber]=[],this.pendingIndent=!0}addNewLine(){this.pendingIndent=!0,this.lines.push([]),this.recentNonImmediateIndents.length=0}pushTraceRegion(e){const t=createTraceRegion(e,this.currentPosition,n=>{var s,a;return(a=(s=this.traceData[this.traceData.length-1])===null||s===void 0?void 0:s.children)===null||a===void 0?void 0:a.push(n)});return this.traceData.push(t),t}popTraceRegion(e){const t=this.traceData.pop();return this.assertTrue(t===e,"Trace region mismatch!"),t}getParentTraceSourceFileURI(){var e;for(let t=this.traceData.length-1;t>-1;t--){const n=(e=this.traceData[t].sourceRegion)===null||e===void 0?void 0:e.fileURI;if(n)return n}}assertTrue(e,t){if(!e)throw new Error(t)}}function createTraceRegion(i,e,t){const n={sourceRegion:i,targetRegion:void 0,children:[],targetStart:e,complete:s=>{var a,o;return n.targetRegion={offset:n.targetStart.offset,end:s.offset,length:s.offset-n.targetStart.offset,range:{start:{line:n.targetStart.line,character:n.targetStart.character},end:{line:s.line,character:s.character}}},delete n.targetStart,((a=n.children)===null||a===void 0?void 0:a.length)===0&&delete n.children,!((o=n.targetRegion)===null||o===void 0)&&o.length&&t(n),delete n.complete,n}};return n}function processGeneratorNode(i,e){const t=new Context(e),n=t.pushTraceRegion(void 0);processNodeInternal(i,t),t.popTraceRegion(n),n.complete&&n.complete(t.currentPosition);const s=n.children&&n.children.length===1?n.children[0]:void 0,a=s?.targetRegion,o=n.targetRegion;return a&&s.sourceRegion&&a.offset===o.offset&&a.length===o.length?{text:t.content,trace:s}:{text:t.content,trace:n}}function processNodeInternal(i,e){typeof i=="string"?processStringNode(i,e):i instanceof IndentNode?processIndentNode(i,e):i instanceof CompositeGeneratorNode?processCompositeNode(i,e):i instanceof NewLineNode&&processNewLineNode(i,e)}function hasContent(i,e){return typeof i=="string"?i.length!==0:i instanceof CompositeGeneratorNode?i.contents.some(t=>hasContent(t,e)):i instanceof NewLineNode?!(i.ifNotEmpty&&e.currentLineContent.length===0):!1}function processStringNode(i,e){i&&(e.pendingIndent&&handlePendingIndent(e,!1),e.append(i))}function handlePendingIndent(i,e){var t;let n="";for(const s of i.relevantIndents.filter(a=>a.indentEmptyLines||!e))n+=(t=s.indentation)!==null&&t!==void 0?t:i.defaultIndentation;i.append(n,!0),i.pendingIndent=!1}function processCompositeNode(i,e){let t;const n=getSourceRegion(i.tracedSource);n&&(t=e.pushTraceRegion(n));for(const s of i.contents)processNodeInternal(s,e);if(t){e.popTraceRegion(t);const s=e.getParentTraceSourceFileURI();s&&n?.fileURI===s&&delete n.fileURI,t.complete&&t.complete(e.currentPosition)}}function processIndentNode(i,e){var t;if(hasContent(i,e)){i.indentImmediately&&!e.pendingIndent&&e.append((t=i.indentation)!==null&&t!==void 0?t:e.defaultIndentation,!0);try{e.increaseIndent(i),processCompositeNode(i,e)}finally{e.decreaseIndent()}}}function processNewLineNode(i,e){i.ifNotEmpty&&!hasNonWhitespace(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&handlePendingIndent(e,!0),e.append(i.lineDelimiter),e.addNewLine())}function hasNonWhitespace(i){return i.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const nonWhitespace=/\S|$/;function findIndentation(i){const e=i.filter(n=>n.length>0).map(n=>n.search(nonWhitespace)),t=e.length===0?0:Math.min(...e);return Math.max(0,t)}function expandToNode(i,...e){const t=findIndentationAndTemplateStructure(i),n=splitTemplateLinesAndMergeWithSubstitutions(i,e,t);return composeFinalGeneratorNode(n)}function expandTracedToNode(i,e,t){return(n,...s)=>traceToNode(i,e,t)(expandToNode(n,...s))}function findIndentationAndTemplateStructure(i){const e=i.join("_").split(LikeC4.N),t=e.length>1&&e[0].trim().length===0,n=t&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:t,omitLastLine:n,trimLastLine:e.length!==1&&e[e.length-1].trim().length===0};{let s=t?e.slice(1):e;s=n?s.slice(0,s.length-1):s,s=s.filter(o=>o.length!==0);const a=findIndentation(s);return{indentation:a,omitFirstLine:t,omitLastLine:n&&(e[e.length-1].length<a||!e[e.length-1].startsWith(s[0].substring(0,a)))}}}function splitTemplateLinesAndMergeWithSubstitutions(i,e,{indentation:t,omitFirstLine:n,omitLastLine:s,trimLastLine:a}){const o=[];i.forEach((E,w)=>{o.push(...E.split(LikeC4.N).map((y,d)=>d===0||y.length<t?y:y.substring(t)).reduce(w===0?(y,d,H)=>H===0?n?[]:[d]:H===1&&y.length===0?[d]:y.concat(NEWLINE,d):(y,d,H)=>H===0?[d]:y.concat(NEWLINE,d),[]).filter(y=>!(typeof y=="string"&&y.length===0)).concat(isGeneratorNode(e[w])?e[w]:e[w]!==void 0?{content:String(e[w])}:w<e.length?UNDEFINED_SEGMENT:[]))});const l=o.length,f=l!==0?o[l-1]:void 0;return(s||a)&&typeof f=="string"&&f.trim().length===0?n&&l!==1&&o[l-2]===NEWLINE?o.slice(0,l-2):o.slice(0,l-1):o}const NEWLINE={isNewLine:!0},UNDEFINED_SEGMENT={isUndefinedSegment:!0},isNewLineMarker=i=>i===NEWLINE,isUndefinedSegmentMarker=i=>i===UNDEFINED_SEGMENT,isSubstitutionWrapper=i=>i.content!==void 0;function composeFinalGeneratorNode(i){return i.reduce((t,n,s)=>isUndefinedSegmentMarker(n)?t:isNewLineMarker(n)?{node:s!==0&&(isUndefinedSegmentMarker(i[s-1])||isGeneratorNode(i[s-1]))||s>1&&typeof i[s-1]=="string"&&(isUndefinedSegmentMarker(i[s-2])||isGeneratorNode(i[s-2]))?t.node.appendNewLineIfNotEmpty():t.node.appendNewLine()}:(()=>{var a;const o=(s===0||isNewLineMarker(i[s-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",l=isSubstitutionWrapper(n)?n.content:n;let f;return{node:t.indented?t.node:o.length!==0?t.node.indent({indentation:o,indentImmediately:!1,indentedChildren:E=>f=E.append(l)}):t.node.append(l),indented:f??((a=t.indented)===null||a===void 0?void 0:a.append(l))}})(),{node:new CompositeGeneratorNode}).node}const EOL=typeof process>"u"?`
81
81
  `:process.platform==="win32"?`\r
82
82
  `:`
83
- `;function isGeneratorNode(i){return i instanceof CompositeGeneratorNode||i instanceof IndentNode||i instanceof NewLineNode}function toString(i,e){return isGeneratorNode(i)?processGeneratorNode(i,e).text:String(i)}class CompositeGeneratorNode{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,t,n){if(LikeC4.i(e)){if(this.tracedSource={astNode:e,property:t,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negative value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(const t of e)typeof t=="function"?t(this):t&&this.contents.push(t);return this}appendIf(e,...t){return e?this.append(...t):this}appendNewLine(){return this.append(NL)}appendNewLineIf(e){return e?this.append(NL):this}appendNewLineIfNotEmpty(){return this.append(NLEmpty)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...t){return this.append(expandToNode(e,...t))}appendTemplateIf(e){return e?(t,...n)=>this.appendTemplate(t,...n):()=>this}indent(e){const{indentedChildren:t,indentation:n,indentEmptyLines:s,indentImmediately:o}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},a=new IndentNode(n,o,s);return this.contents.push(a),Array.isArray(t)?a.append(...t):t&&a.append(t),this}appendTraced(e,t,n){return s=>this.append(new CompositeGeneratorNode().trace(e,t,n).append(s))}appendTracedIf(e,t,n,s){return e?this.appendTraced(typeof t=="function"?t():t,n,s):()=>this}appendTracedTemplate(e,t,n){return(s,...o)=>this.append(expandTracedToNode(e,t,n)(s,...o))}appendTracedTemplateIf(e,t,n,s){return e?this.appendTracedTemplate(typeof t=="function"?t():t,n,s):()=>this}}function traceToNode(i,e,t){return n=>n instanceof CompositeGeneratorNode&&n.tracedSource===void 0?n.trace(i,e,t):new CompositeGeneratorNode().trace(i,e,t).append(n)}class IndentNode extends CompositeGeneratorNode{constructor(e,t=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=t,this.indentEmptyLines=n}}class NewLineNode{constructor(e,t=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??EOL,this.ifNotEmpty=t}}const NL=new NewLineNode,NLEmpty=new NewLineNode(void 0,!0),defaultToGenerated=i=>i===void 0||typeof i=="string"||isGeneratorNode(i)?i:String(i);function joinToNode(i,e=defaultToGenerated,t={}){const n=typeof e=="function"?e:defaultToGenerated,{filter:s,prefix:o,suffix:a,separator:l,appendNewLineIfNotEmpty:d,skipNewLineAfterLastItem:B}=typeof e=="object"?e:t,w=typeof o=="function"?o:()=>o,E=typeof a=="function"?a:()=>a;return reduceWithIsLast(i,(_,U,H,W)=>{if(s&&!s(U,H,W))return _;const L=n(U,H,W);return L===void 0?_:(_??(_=new CompositeGeneratorNode)).append(w(U,H,W)).append(L).append(E(U,H,W)).appendIf(!W,l).appendNewLineIfNotEmptyIf(!_.isEmpty()&&!!d&&(!W||!B))})}function reduceWithIsLast(i,e,t){const n=i[Symbol.iterator]();let s=n.next(),o=0,a=t;for(;!s.done;){const l=n.next();a=e(a,s.value,o,!!l.done),s=l,o++}return a}var Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,unicode={Space_Separator,ID_Start,ID_Continue},util={isSpaceSeparator(i){return typeof i=="string"&&unicode.Space_Separator.test(i)},isIdStartChar(i){return typeof i=="string"&&(i>="a"&&i<="z"||i>="A"&&i<="Z"||i==="$"||i==="_"||unicode.ID_Start.test(i))},isIdContinueChar(i){return typeof i=="string"&&(i>="a"&&i<="z"||i>="A"&&i<="Z"||i>="0"&&i<="9"||i==="$"||i==="_"||i==="\u200C"||i==="\u200D"||unicode.ID_Continue.test(i))},isDigit(i){return typeof i=="string"&&/[0-9]/.test(i)},isHexDigit(i){return typeof i=="string"&&/[0-9A-Fa-f]/.test(i)}};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(e,t){source=String(e),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do token=lex(),parseStates[parseState]();while(token.type!=="eof");return typeof t=="function"?internalize({"":root},"",t):root};function internalize(i,e,t){const n=i[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++){const o=String(s),a=internalize(n,o,t);a===void 0?delete n[o]:Object.defineProperty(n,o,{value:a,writable:!0,enumerable:!0,configurable:!0})}else for(const s in n){const o=internalize(n,s,t);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}return t.call(i,e,n)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const i=lexStates[lexState]();if(i)return i}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const i=peek();return i===`
83
+ `;function isGeneratorNode(i){return i instanceof CompositeGeneratorNode||i instanceof IndentNode||i instanceof NewLineNode}function toString(i,e){return isGeneratorNode(i)?processGeneratorNode(i,e).text:String(i)}class CompositeGeneratorNode{constructor(...e){this.contents=[],this.append(...e)}isEmpty(){return this.contents.length===0}trace(e,t,n){if(LikeC4.i(e)){if(this.tracedSource={astNode:e,property:t,index:n},this.tracedSource.property===void 0&&this.tracedSource.index!==void 0&&this.tracedSource.index>-1)throw new Error("Generation support: 'property' argument must not be 'undefined' if a non-negative value is assigned to 'index' in 'CompositeGeneratorNode.trace(...)'.")}else this.tracedSource=e;return this}append(...e){for(const t of e)typeof t=="function"?t(this):t&&this.contents.push(t);return this}appendIf(e,...t){return e?this.append(...t):this}appendNewLine(){return this.append(NL)}appendNewLineIf(e){return e?this.append(NL):this}appendNewLineIfNotEmpty(){return this.append(NLEmpty)}appendNewLineIfNotEmptyIf(e){return e?this.appendNewLineIfNotEmpty():this}appendTemplate(e,...t){return this.append(expandToNode(e,...t))}appendTemplateIf(e){return e?(t,...n)=>this.appendTemplate(t,...n):()=>this}indent(e){const{indentedChildren:t,indentation:n,indentEmptyLines:s,indentImmediately:a}=Array.isArray(e)||typeof e=="function"?{indentedChildren:e}:typeof e=="object"?e:{},o=new IndentNode(n,a,s);return this.contents.push(o),Array.isArray(t)?o.append(...t):t&&o.append(t),this}appendTraced(e,t,n){return s=>this.append(new CompositeGeneratorNode().trace(e,t,n).append(s))}appendTracedIf(e,t,n,s){return e?this.appendTraced(typeof t=="function"?t():t,n,s):()=>this}appendTracedTemplate(e,t,n){return(s,...a)=>this.append(expandTracedToNode(e,t,n)(s,...a))}appendTracedTemplateIf(e,t,n,s){return e?this.appendTracedTemplate(typeof t=="function"?t():t,n,s):()=>this}}function traceToNode(i,e,t){return n=>n instanceof CompositeGeneratorNode&&n.tracedSource===void 0?n.trace(i,e,t):new CompositeGeneratorNode().trace(i,e,t).append(n)}class IndentNode extends CompositeGeneratorNode{constructor(e,t=!0,n=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof e=="string"?this.indentation=e:typeof e=="number"&&(this.indentation="".padStart(e)),this.indentImmediately=t,this.indentEmptyLines=n}}class NewLineNode{constructor(e,t=!1){this.ifNotEmpty=!1,this.lineDelimiter=e??EOL,this.ifNotEmpty=t}}const NL=new NewLineNode,NLEmpty=new NewLineNode(void 0,!0),defaultToGenerated=i=>i===void 0||typeof i=="string"||isGeneratorNode(i)?i:String(i);function joinToNode(i,e=defaultToGenerated,t={}){const n=typeof e=="function"?e:defaultToGenerated,{filter:s,prefix:a,suffix:o,separator:l,appendNewLineIfNotEmpty:f,skipNewLineAfterLastItem:E}=typeof e=="object"?e:t,w=typeof a=="function"?a:()=>a,y=typeof o=="function"?o:()=>o;return reduceWithIsLast(i,(d,H,Q,W)=>{if(s&&!s(H,Q,W))return d;const _=n(H,Q,W);return _===void 0?d:(d??(d=new CompositeGeneratorNode)).append(w(H,Q,W)).append(_).append(y(H,Q,W)).appendIf(!W,l).appendNewLineIfNotEmptyIf(!d.isEmpty()&&!!f&&(!W||!E))})}function reduceWithIsLast(i,e,t){const n=i[Symbol.iterator]();let s=n.next(),a=0,o=t;for(;!s.done;){const l=n.next();o=e(o,s.value,a,!!l.done),s=l,a++}return o}var Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,unicode={Space_Separator,ID_Start,ID_Continue},util={isSpaceSeparator(i){return typeof i=="string"&&unicode.Space_Separator.test(i)},isIdStartChar(i){return typeof i=="string"&&(i>="a"&&i<="z"||i>="A"&&i<="Z"||i==="$"||i==="_"||unicode.ID_Start.test(i))},isIdContinueChar(i){return typeof i=="string"&&(i>="a"&&i<="z"||i>="A"&&i<="Z"||i>="0"&&i<="9"||i==="$"||i==="_"||i==="\u200C"||i==="\u200D"||unicode.ID_Continue.test(i))},isDigit(i){return typeof i=="string"&&/[0-9]/.test(i)},isHexDigit(i){return typeof i=="string"&&/[0-9A-Fa-f]/.test(i)}};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(e,t){source=String(e),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do token=lex(),parseStates[parseState]();while(token.type!=="eof");return typeof t=="function"?internalize({"":root},"",t):root};function internalize(i,e,t){const n=i[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++){const a=String(s),o=internalize(n,a,t);o===void 0?delete n[a]:Object.defineProperty(n,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const s in n){const a=internalize(n,s,t);a===void 0?delete n[s]:Object.defineProperty(n,s,{value:a,writable:!0,enumerable:!0,configurable:!0})}return t.call(i,e,n)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const i=lexStates[lexState]();if(i)return i}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const i=peek();return i===`
84
84
  `?(line++,column=0):i?column+=i.length:column++,i&&(pos+=i.length),i}const lexStates={default(){switch(c){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
85
85
  `:case"\r":case"\u2028":case"\u2029":read();return;case"/":read(),lexState="comment";return;case void 0:return read(),newToken("eof")}if(util.isSpaceSeparator(c)){read();return}return lexStates[parseState]()},comment(){switch(c){case"*":read(),lexState="multiLineComment";return;case"/":read(),lexState="singleLineComment";return}throw invalidChar(read())},multiLineComment(){switch(c){case"*":read(),lexState="multiLineCommentAsterisk";return;case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(c){case"*":read();return;case"/":read(),lexState="default";return;case void 0:throw invalidChar(read())}read(),lexState="multiLineComment"},singleLineComment(){switch(c){case`
86
86
  `:case"\r":case"\u2028":case"\u2029":read(),lexState="default";return;case void 0:return read(),newToken("eof")}read()},value(){switch(c){case"{":case"[":return newToken("punctuator",read());case"n":return read(),literal("ull"),newToken("null",null);case"t":return read(),literal("rue"),newToken("boolean",!0);case"f":return read(),literal("alse"),newToken("boolean",!1);case"-":case"+":read()==="-"&&(sign=-1),lexState="sign";return;case".":buffer=read(),lexState="decimalPointLeading";return;case"0":buffer=read(),lexState="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":buffer=read(),lexState="decimalInteger";return;case"I":return read(),literal("nfinity"),newToken("numeric",1/0);case"N":return read(),literal("aN"),newToken("numeric",NaN);case'"':case"'":doubleQuote=read()==='"',buffer="",lexState="string";return}throw invalidChar(read())},identifierNameStartEscape(){if(c!=="u")throw invalidChar(read());read();const i=unicodeEscape();switch(i){case"$":case"_":break;default:if(!util.isIdStartChar(i))throw invalidIdentifier();break}buffer+=i,lexState="identifierName"},identifierName(){switch(c){case"$":case"_":case"\u200C":case"\u200D":buffer+=read();return;case"\\":read(),lexState="identifierNameEscape";return}if(util.isIdContinueChar(c)){buffer+=read();return}return newToken("identifier",buffer)},identifierNameEscape(){if(c!=="u")throw invalidChar(read());read();const i=unicodeEscape();switch(i){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!util.isIdContinueChar(i))throw invalidIdentifier();break}buffer+=i,lexState="identifierName"},sign(){switch(c){case".":buffer=read(),lexState="decimalPointLeading";return;case"0":buffer=read(),lexState="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":buffer=read(),lexState="decimalInteger";return;case"I":return read(),literal("nfinity"),newToken("numeric",sign*(1/0));case"N":return read(),literal("aN"),newToken("numeric",NaN)}throw invalidChar(read())},zero(){switch(c){case".":buffer+=read(),lexState="decimalPoint";return;case"e":case"E":buffer+=read(),lexState="decimalExponent";return;case"x":case"X":buffer+=read(),lexState="hexadecimal";return}return newToken("numeric",sign*0)},decimalInteger(){switch(c){case".":buffer+=read(),lexState="decimalPoint";return;case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},decimalPointLeading(){if(util.isDigit(c)){buffer+=read(),lexState="decimalFraction";return}throw invalidChar(read())},decimalPoint(){switch(c){case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util.isDigit(c)){buffer+=read(),lexState="decimalFraction";return}return newToken("numeric",sign*Number(buffer))},decimalFraction(){switch(c){case"e":case"E":buffer+=read(),lexState="decimalExponent";return}if(util.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},decimalExponent(){switch(c){case"+":case"-":buffer+=read(),lexState="decimalExponentSign";return}if(util.isDigit(c)){buffer+=read(),lexState="decimalExponentInteger";return}throw invalidChar(read())},decimalExponentSign(){if(util.isDigit(c)){buffer+=read(),lexState="decimalExponentInteger";return}throw invalidChar(read())},decimalExponentInteger(){if(util.isDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},hexadecimal(){if(util.isHexDigit(c)){buffer+=read(),lexState="hexadecimalInteger";return}throw invalidChar(read())},hexadecimalInteger(){if(util.isHexDigit(c)){buffer+=read();return}return newToken("numeric",sign*Number(buffer))},string(){switch(c){case"\\":read(),buffer+=escape();return;case'"':if(doubleQuote)return read(),newToken("string",buffer);buffer+=read();return;case"'":if(!doubleQuote)return read(),newToken("string",buffer);buffer+=read();return;case`
87
87
  `:case"\r":throw invalidChar(read());case"\u2028":case"\u2029":separatorChar(c);break;case void 0:throw invalidChar(read())}buffer+=read()},start(){switch(c){case"{":case"[":return newToken("punctuator",read())}lexState="value"},beforePropertyName(){switch(c){case"$":case"_":buffer=read(),lexState="identifierName";return;case"\\":read(),lexState="identifierNameStartEscape";return;case"}":return newToken("punctuator",read());case'"':case"'":doubleQuote=read()==='"',lexState="string";return}if(util.isIdStartChar(c)){buffer+=read(),lexState="identifierName";return}throw invalidChar(read())},afterPropertyName(){if(c===":")return newToken("punctuator",read());throw invalidChar(read())},beforePropertyValue(){lexState="value"},afterPropertyValue(){switch(c){case",":case"}":return newToken("punctuator",read())}throw invalidChar(read())},beforeArrayValue(){if(c==="]")return newToken("punctuator",read());lexState="value"},afterArrayValue(){switch(c){case",":case"]":return newToken("punctuator",read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(i,e){return{type:i,value:e,line,column}}function literal(i){for(const e of i){if(peek()!==e)throw invalidChar(read());read()}}function escape(){switch(peek()){case"b":return read(),"\b";case"f":return read(),"\f";case"n":return read(),`
88
88
  `;case"r":return read(),"\r";case"t":return read()," ";case"v":return read(),"\v";case"0":if(read(),util.isDigit(peek()))throw invalidChar(read());return"\0";case"x":return read(),hexEscape();case"u":return read(),unicodeEscape();case`
89
89
  `:case"\u2028":case"\u2029":return read(),"";case"\r":return read(),peek()===`
90
- `&&read(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw invalidChar(read());case void 0:throw invalidChar(read())}return read()}function hexEscape(){let i="",e=peek();if(!util.isHexDigit(e)||(i+=read(),e=peek(),!util.isHexDigit(e)))throw invalidChar(read());return i+=read(),String.fromCodePoint(parseInt(i,16))}function unicodeEscape(){let i="",e=4;for(;e-- >0;){const t=peek();if(!util.isHexDigit(t))throw invalidChar(read());i+=read()}return String.fromCodePoint(parseInt(i,16))}const parseStates={start(){if(token.type==="eof")throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":key=token.value,parseState="afterPropertyName";return;case"punctuator":pop();return;case"eof":throw invalidEOF()}},afterPropertyName(){if(token.type==="eof")throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if(token.type==="eof")throw invalidEOF();push()},beforeArrayValue(){if(token.type==="eof")throw invalidEOF();if(token.type==="punctuator"&&token.value==="]"){pop();return}push()},afterPropertyValue(){if(token.type==="eof")throw invalidEOF();switch(token.value){case",":parseState="beforePropertyName";return;case"}":pop()}},afterArrayValue(){if(token.type==="eof")throw invalidEOF();switch(token.value){case",":parseState="beforeArrayValue";return;case"]":pop()}},end(){}};function push(){let i;switch(token.type){case"punctuator":switch(token.value){case"{":i={};break;case"[":i=[];break}break;case"null":case"boolean":case"numeric":case"string":i=token.value;break}if(root===void 0)root=i;else{const e=stack[stack.length-1];Array.isArray(e)?e.push(i):Object.defineProperty(e,key,{value:i,writable:!0,enumerable:!0,configurable:!0})}if(i!==null&&typeof i=="object")stack.push(i),Array.isArray(i)?parseState="beforeArrayValue":parseState="beforePropertyName";else{const e=stack[stack.length-1];e==null?parseState="end":Array.isArray(e)?parseState="afterArrayValue":parseState="afterPropertyValue"}}function pop(){stack.pop();const i=stack[stack.length-1];i==null?parseState="end":Array.isArray(i)?parseState="afterArrayValue":parseState="afterPropertyValue"}function invalidChar(i){return syntaxError(i===void 0?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(i)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return column-=5,syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)}function separatorChar(i){console.warn(`JSON5: '${formatChar(i)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(i){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[i])return e[i];if(i<" "){const t=i.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return i}function syntaxError(i){const e=new SyntaxError(i);return e.lineNumber=line,e.columnNumber=column,e}var stringify=function(e,t,n){const s=[];let o="",a,l,d="",B;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t.space,B=t.quote,t=t.replacer),typeof t=="function")l=t;else if(Array.isArray(t)){a=[];for(const W of t){let L;typeof W=="string"?L=W:(typeof W=="number"||W instanceof String||W instanceof Number)&&(L=String(W)),L!==void 0&&a.indexOf(L)<0&&a.push(L)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),d=" ".substr(0,n)):typeof n=="string"&&(d=n.substr(0,10)),w("",{"":e});function w(W,L){let K=L[W];switch(K!=null&&(typeof K.toJSON5=="function"?K=K.toJSON5(W):typeof K.toJSON=="function"&&(K=K.toJSON(W))),l&&(K=l.call(L,W,K)),K instanceof Number?K=Number(K):K instanceof String?K=String(K):K instanceof Boolean&&(K=K.valueOf()),K){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof K=="string")return E(K);if(typeof K=="number")return String(K);if(typeof K=="object")return Array.isArray(K)?H(K):_(K)}function E(W){const L={"'":.1,'"':.2},K={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let ee="";for(let se=0;se<W.length;se++){const ce=W[se];switch(ce){case"'":case'"':L[ce]++,ee+=ce;continue;case"\0":if(util.isDigit(W[se+1])){ee+="\\x00";continue}}if(K[ce]){ee+=K[ce];continue}if(ce<" "){let Fe=ce.charCodeAt(0).toString(16);ee+="\\x"+("00"+Fe).substring(Fe.length);continue}ee+=ce}const ae=B||Object.keys(L).reduce((se,ce)=>L[se]<L[ce]?se:ce);return ee=ee.replace(new RegExp(ae,"g"),K[ae]),ae+ee+ae}function _(W){if(s.indexOf(W)>=0)throw TypeError("Converting circular structure to JSON5");s.push(W);let L=o;o=o+d;let K=a||Object.keys(W),ee=[];for(const se of K){const ce=w(se,W);if(ce!==void 0){let Fe=U(se)+":";d!==""&&(Fe+=" "),Fe+=ce,ee.push(Fe)}}let ae;if(ee.length===0)ae="{}";else{let se;if(d==="")se=ee.join(","),ae="{"+se+"}";else{let ce=`,
91
- `+o;se=ee.join(ce),ae=`{
92
- `+o+se+`,
93
- `+L+"}"}}return s.pop(),o=L,ae}function U(W){if(W.length===0)return E(W);const L=String.fromCodePoint(W.codePointAt(0));if(!util.isIdStartChar(L))return E(W);for(let K=L.length;K<W.length;K++)if(!util.isIdContinueChar(String.fromCodePoint(W.codePointAt(K))))return E(W);return W}function H(W){if(s.indexOf(W)>=0)throw TypeError("Converting circular structure to JSON5");s.push(W);let L=o;o=o+d;let K=[];for(let ae=0;ae<W.length;ae++){const se=w(String(ae),W);K.push(se!==void 0?se:"null")}let ee;if(K.length===0)ee="[]";else if(d==="")ee="["+K.join(",")+"]";else{let ae=`,
94
- `+o,se=K.join(ae);ee=`[
95
- `+o+se+`,
96
- `+L+"]"}return s.pop(),o=L,ee}};const JSON5={parse,stringify};var lib=JSON5;const D$1=i=>i.charAt(0).toLocaleUpperCase()+i.slice(1),v=i=>i.split(".").map(D$1).join(""),x=i=>v(i.parent?i.id.slice(i.parent.length+1):i.id),M=({autoLayout:i})=>{switch(i.direction){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},b=({shape:i})=>{switch(i){case"queue":case"cylinder":case"rectangle":case"person":return i;case"storage":return"stored_data";case"mobile":case"browser":return"rectangle"}};function P$1(i){const{nodes:e,edges:t}=i,n=new Map,s=(a,l)=>{const d=x(a),B=(l?l+".":"")+d;n.set(a.id,B);const w=JSON.stringify(a.title),E=b(a);return new CompositeGeneratorNode().append(d,": {",NL).indent({indentedChildren:_=>_.append("label: ",w,NL).appendIf(E!=="rectangle","shape: ",E,NL).appendIf(a.children.length>0,NL,joinToNode(e.filter(U=>U.parent===a.id),U=>s(U,B))),indentation:2}).append("}",NL)},o=a=>new CompositeGeneratorNode().append(n.get(a.source)," -> ",n.get(a.target)).append(l=>a.label&&l.append(": ",JSON.stringify(a.label)));return toString(new CompositeGeneratorNode().append("direction: ",M(i),NL,NL).append(joinToNode(e.filter(a=>LikeC4.n(a.parent)),a=>s(a),{appendNewLineIfNotEmpty:!0})).appendIf(t.length>0,NL,joinToNode(t,a=>o(a),{appendNewLineIfNotEmpty:!0})))}const A$1=i=>i.charAt(0).toLocaleUpperCase()+i.slice(1),O$1=i=>i.split(".").map(A$1).join(""),$$1=i=>O$1(i.parent?i.id.slice(i.parent.length+1):i.id),R=({shape:i})=>{switch(i){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([","])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function S(i){const{nodes:e,edges:t}=i,n=new Map,s=(a,l)=>{const d=$$1(a),B=(l?l+".":"")+d;n.set(a.id,B);const w=a.title.replaceAll(`
97
- `,"\\n"),E=R(a),_=new CompositeGeneratorNode;return a.children.length>0?_.append("subgraph ",B,"[",JSON.stringify(a.title),"]",NL).indent({indentedChildren:[joinToNode(e.filter(U=>U.parent===a.id),U=>s(U,B),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",NL):_.append(B,E[0],w,E[1]),_},o=a=>new CompositeGeneratorNode().append(n.get(a.source)," -.",a.label?' "'+a.label.replaceAll(`
98
- `,"\\n")+'" .-':"-","> ",n.get(a.target));return toString(new CompositeGeneratorNode().appendIf(i.title!==null&&i.title.length>0,"---",NL,`title: ${JSON.stringify(i.title)}`,NL,"---",NL).append("graph ",i.autoLayout.direction,NL).indent({indentedChildren:a=>{a.append(joinToNode(e.filter(l=>LikeC4.n(l.parent)),l=>s(l),{appendNewLineIfNotEmpty:!0})).appendIf(t.length>0,joinToNode(t,l=>o(l),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}function q(i){const e=new CompositeGeneratorNode;return e.appendTemplate`
90
+ `&&read(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw invalidChar(read());case void 0:throw invalidChar(read())}return read()}function hexEscape(){let i="",e=peek();if(!util.isHexDigit(e)||(i+=read(),e=peek(),!util.isHexDigit(e)))throw invalidChar(read());return i+=read(),String.fromCodePoint(parseInt(i,16))}function unicodeEscape(){let i="",e=4;for(;e-- >0;){const t=peek();if(!util.isHexDigit(t))throw invalidChar(read());i+=read()}return String.fromCodePoint(parseInt(i,16))}const parseStates={start(){if(token.type==="eof")throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":key=token.value,parseState="afterPropertyName";return;case"punctuator":pop();return;case"eof":throw invalidEOF()}},afterPropertyName(){if(token.type==="eof")throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if(token.type==="eof")throw invalidEOF();push()},beforeArrayValue(){if(token.type==="eof")throw invalidEOF();if(token.type==="punctuator"&&token.value==="]"){pop();return}push()},afterPropertyValue(){if(token.type==="eof")throw invalidEOF();switch(token.value){case",":parseState="beforePropertyName";return;case"}":pop()}},afterArrayValue(){if(token.type==="eof")throw invalidEOF();switch(token.value){case",":parseState="beforeArrayValue";return;case"]":pop()}},end(){}};function push(){let i;switch(token.type){case"punctuator":switch(token.value){case"{":i={};break;case"[":i=[];break}break;case"null":case"boolean":case"numeric":case"string":i=token.value;break}if(root===void 0)root=i;else{const e=stack[stack.length-1];Array.isArray(e)?e.push(i):Object.defineProperty(e,key,{value:i,writable:!0,enumerable:!0,configurable:!0})}if(i!==null&&typeof i=="object")stack.push(i),Array.isArray(i)?parseState="beforeArrayValue":parseState="beforePropertyName";else{const e=stack[stack.length-1];e==null?parseState="end":Array.isArray(e)?parseState="afterArrayValue":parseState="afterPropertyValue"}}function pop(){stack.pop();const i=stack[stack.length-1];i==null?parseState="end":Array.isArray(i)?parseState="afterArrayValue":parseState="afterPropertyValue"}function invalidChar(i){return syntaxError(i===void 0?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(i)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return column-=5,syntaxError(`JSON5: invalid identifier character at ${line}:${column}`)}function separatorChar(i){console.warn(`JSON5: '${formatChar(i)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(i){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[i])return e[i];if(i<" "){const t=i.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return i}function syntaxError(i){const e=new SyntaxError(i);return e.lineNumber=line,e.columnNumber=column,e}var stringify$1=function(e,t,n){const s=[];let a="",o,l,f="",E;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(n=t.space,E=t.quote,t=t.replacer),typeof t=="function")l=t;else if(Array.isArray(t)){o=[];for(const W of t){let _;typeof W=="string"?_=W:(typeof W=="number"||W instanceof String||W instanceof Number)&&(_=String(W)),_!==void 0&&o.indexOf(_)<0&&o.push(_)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),f=" ".substr(0,n)):typeof n=="string"&&(f=n.substr(0,10)),w("",{"":e});function w(W,_){let U=_[W];switch(U!=null&&(typeof U.toJSON5=="function"?U=U.toJSON5(W):typeof U.toJSON=="function"&&(U=U.toJSON(W))),l&&(U=l.call(_,W,U)),U instanceof Number?U=Number(U):U instanceof String?U=String(U):U instanceof Boolean&&(U=U.valueOf()),U){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof U=="string")return y(U);if(typeof U=="number")return String(U);if(typeof U=="object")return Array.isArray(U)?Q(U):d(U)}function y(W){const _={"'":.1,'"':.2},U={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let te="";for(let X=0;X<W.length;X++){const K=W[X];switch(K){case"'":case'"':_[K]++,te+=K;continue;case"\0":if(util.isDigit(W[X+1])){te+="\\x00";continue}}if(U[K]){te+=U[K];continue}if(K<" "){let le=K.charCodeAt(0).toString(16);te+="\\x"+("00"+le).substring(le.length);continue}te+=K}const T=E||Object.keys(_).reduce((X,K)=>_[X]<_[K]?X:K);return te=te.replace(new RegExp(T,"g"),U[T]),T+te+T}function d(W){if(s.indexOf(W)>=0)throw TypeError("Converting circular structure to JSON5");s.push(W);let _=a;a=a+f;let U=o||Object.keys(W),te=[];for(const X of U){const K=w(X,W);if(K!==void 0){let le=H(X)+":";f!==""&&(le+=" "),le+=K,te.push(le)}}let T;if(te.length===0)T="{}";else{let X;if(f==="")X=te.join(","),T="{"+X+"}";else{let K=`,
91
+ `+a;X=te.join(K),T=`{
92
+ `+a+X+`,
93
+ `+_+"}"}}return s.pop(),a=_,T}function H(W){if(W.length===0)return y(W);const _=String.fromCodePoint(W.codePointAt(0));if(!util.isIdStartChar(_))return y(W);for(let U=_.length;U<W.length;U++)if(!util.isIdContinueChar(String.fromCodePoint(W.codePointAt(U))))return y(W);return W}function Q(W){if(s.indexOf(W)>=0)throw TypeError("Converting circular structure to JSON5");s.push(W);let _=a;a=a+f;let U=[];for(let T=0;T<W.length;T++){const X=w(String(T),W);U.push(X!==void 0?X:"null")}let te;if(U.length===0)te="[]";else if(f==="")te="["+U.join(",")+"]";else{let T=`,
94
+ `+a,X=U.join(T);te=`[
95
+ `+a+X+`,
96
+ `+_+"]"}return s.pop(),a=_,te}};const JSON5={parse,stringify:stringify$1};var lib=JSON5;const D$1=i=>i.charAt(0).toLocaleUpperCase()+i.slice(1),v=i=>i.split(".").map(D$1).join(""),x=i=>v(i.parent?i.id.slice(i.parent.length+1):i.id),M=({autoLayout:i})=>{switch(i.direction){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},b=({shape:i})=>{switch(i){case"queue":case"cylinder":case"rectangle":case"person":return i;case"storage":return"stored_data";case"mobile":case"browser":return"rectangle"}};function P$1(i){const{nodes:e,edges:t}=i,n=new Map,s=(o,l)=>{const f=x(o),E=(l?l+".":"")+f;n.set(o.id,E);const w=JSON.stringify(o.title),y=b(o);return new CompositeGeneratorNode().append(f,": {",NL).indent({indentedChildren:d=>d.append("label: ",w,NL).appendIf(y!=="rectangle","shape: ",y,NL).appendIf(o.children.length>0,NL,joinToNode(e.filter(H=>H.parent===o.id),H=>s(H,E))),indentation:2}).append("}",NL)},a=o=>new CompositeGeneratorNode().append(n.get(o.source)," -> ",n.get(o.target)).append(l=>o.label&&l.append(": ",JSON.stringify(o.label)));return toString(new CompositeGeneratorNode().append("direction: ",M(i),NL,NL).append(joinToNode(e.filter(o=>LikeC4.n(o.parent)),o=>s(o),{appendNewLineIfNotEmpty:!0})).appendIf(t.length>0,NL,joinToNode(t,o=>a(o),{appendNewLineIfNotEmpty:!0})))}const A$1=i=>i.charAt(0).toLocaleUpperCase()+i.slice(1),O$1=i=>i.split(".").map(A$1).join(""),$$1=i=>O$1(i.parent?i.id.slice(i.parent.length+1):i.id),R=({shape:i})=>{switch(i){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([","])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function S(i){const{nodes:e,edges:t}=i,n=new Map,s=(o,l)=>{const f=$$1(o),E=(l?l+".":"")+f;n.set(o.id,E);const w=o.title.replaceAll(`
97
+ `,"\\n"),y=R(o),d=new CompositeGeneratorNode;return o.children.length>0?d.append("subgraph ",E,"[",JSON.stringify(o.title),"]",NL).indent({indentedChildren:[joinToNode(e.filter(H=>H.parent===o.id),H=>s(H,E),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",NL):d.append(E,y[0],w,y[1]),d},a=o=>new CompositeGeneratorNode().append(n.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
98
+ `,"\\n")+'" .-':"-","> ",n.get(o.target));return toString(new CompositeGeneratorNode().appendIf(i.title!==null&&i.title.length>0,"---",NL,`title: ${JSON.stringify(i.title)}`,NL,"---",NL).append("graph ",i.autoLayout.direction,NL).indent({indentedChildren:o=>{o.append(joinToNode(e.filter(l=>LikeC4.n(l.parent)),l=>s(l),{appendNewLineIfNotEmpty:!0})).appendIf(t.length>0,joinToNode(t,l=>a(l),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}function q(i){const e=new CompositeGeneratorNode;return e.appendTemplate`
99
99
  /* prettier-ignore-start */
100
100
  /* eslint-disable */
101
101
 
@@ -141,7 +141,7 @@ ${e.join(`
141
141
 
142
142
  /* prettier-ignore-end */
143
143
  `.append(NL),toString(t))}function C$1(i){i instanceof Set&&(i=[...i].sort(core.compareNatural));const e=i.map(t=>` | ${JSON.stringify(t)}`);return e.length===0&&e.push(" never"),e.join(`
144
- `)+";"}function Y(i){const{fqns:e,tags:t,kinds:n}=core.sortNaturalByFqn([...i.elements()]).reduce((a,l)=>(a.fqns.push(l.id),a.kinds.add(l.kind),a.tags.push(...l.tags),a),{fqns:[],kinds:new Set,tags:[]}),s=core.sortNaturalByFqn([...i.deployment.elements()]).map(a=>a.id),{viewIds:o}=[...i.views()].reduce((a,l)=>(a.viewIds.add(l.id),a.tags.push(...l.tags),a.tags.push(...l.includedTags),a),{viewIds:new Set,tags:t});return`
144
+ `)+";"}function Y(i){const{fqns:e,tags:t,kinds:n}=core.sortNaturalByFqn([...i.elements()]).reduce((o,l)=>(o.fqns.push(l.id),o.kinds.add(l.kind),o.tags.push(...l.tags),o),{fqns:[],kinds:new Set,tags:[]}),s=core.sortNaturalByFqn([...i.deployment.elements()]).map(o=>o.id),{viewIds:a}=[...i.views()].reduce((o,l)=>(o.viewIds.add(l.id),o.tags.push(...l.tags),o.tags.push(...l.includedTags),o),{viewIds:new Set,tags:t});return`
145
145
  /* prettier-ignore-start */
146
146
  /* eslint-disable */
147
147
 
@@ -168,7 +168,7 @@ type LikeC4DeploymentId =
168
168
  ${C$1(s)}
169
169
 
170
170
  type LikeC4ViewId =
171
- ${C$1(o)}
171
+ ${C$1(a)}
172
172
 
173
173
  type LikeC4ElementKind =
174
174
  ${C$1(n)}
@@ -273,7 +273,7 @@ export {
273
273
  default: {
274
274
  throw new Error('Unknown viewId: ' + viewId)
275
275
  }
276
- `}}).append(NL," }",NL,"}",NL,NL),toString(e)}function generateIconRendererSource(i){const e=LikeC4.x(i.flatMap(s=>s.nodes.map(o=>o.icon)),LikeC4.c(LikeC4.t),LikeC4.c(s=>LikeC4.d(s)&&!s.toLowerCase().startsWith("http")),LikeC4.b()).sort(),{imports:t,cases:n}=e.reduce((s,o,a)=>{const[l,d]=o.split(":"),B="Icon"+a.toString().padStart(2,"0");return s.imports.push(`import ${B} from 'likec4/icons/${l}/${d}'`),s.cases.push(` '${l}:${d}': ${B}`),s},{imports:[],cases:[]});return`
276
+ `}}).append(NL," }",NL,"}",NL,NL),toString(e)}function generateIconRendererSource(i){const e=LikeC4.x(i.flatMap(s=>s.nodes.map(a=>a.icon)),LikeC4.c(LikeC4.t),LikeC4.c(s=>LikeC4.d(s)&&!s.toLowerCase().startsWith("http")),LikeC4.b()).sort(),{imports:t,cases:n}=e.reduce((s,a,o)=>{const[l,f]=a.split(":"),E="Icon"+o.toString().padStart(2,"0");return s.imports.push(`import ${E} from 'likec4/icons/${l}/${f}'`),s.cases.push(` '${l}:${f}': ${E}`),s},{imports:[],cases:[]});return`
277
277
  ${t.join(`
278
278
  `)}
279
279
 
@@ -368,7 +368,7 @@ if (import.meta.hot) {
368
368
  }
369
369
  })
370
370
  }
371
- `}function diagramPreviewsSources(i,e){const{imports:t,cases:n}=i.reduce((s,{id:o},a)=>{const l=path$1.resolve(e,`${o}.png`);if(!fs.existsSync(l))return s;const d="Png"+a.toString().padStart(2,"0");return s.imports.push(`import ${d} from 'likec4/previews/${o}.png'`),s.cases.push(` ${JSON.stringify(o)}: ${d}`),s},{imports:[],cases:[]});return`
371
+ `}function diagramPreviewsSources(i,e){const{imports:t,cases:n}=i.reduce((s,{id:a},o)=>{const l=path$1.resolve(e,`${a}.png`);if(!fs.existsSync(l))return s;const f="Png"+o.toString().padStart(2,"0");return s.imports.push(`import ${f} from 'likec4/previews/${a}.png'`),s.cases.push(` ${JSON.stringify(a)}: ${f}`),s},{imports:[],cases:[]});return`
372
372
  import { nano } from 'likec4/react'
373
373
  // assets dir: ${e}
374
374
 
@@ -410,31 +410,33 @@ if (import.meta.hot) {
410
410
  }
411
411
  })
412
412
  }
413
- `}const P={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/dot-sources"));const t=await i.viewsService.viewsAsGraphvizOut(),n=LikeC4.l(t,({id:s,svg:o,dot:a})=>[s,{dot:a,svg:o}]);return generateDotSources(n)}},V={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/d2-sources"));const t=await i.viewsService.computedViews();return generateD2Sources(t)}},j={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/mmd-sources"));const t=await i.viewsService.computedViews();return generateMmdSources(t)}},C={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/icons"));const t=await i.viewsService.computedViews();return generateIconRendererSource(t)}},O={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plugin/overview-graph.js",async load({likec4:i,logger:e,useOverviewGraph:t}){if(t===!0)try{e.info(LikeC4.p.dim("generating virtual:likec4/overview-graph"));const n=await i.viewsService.overviewGraph();return generateOverviewGraphSource(n)}catch(n){e.error(n)}return e.info(LikeC4.p.dim("generating empty virtual:likec4/overview-graph")),generateOverviewGraphSource({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},m={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:i,logger:e,assetsDir:t}){e.info(LikeC4.p.dim("generating virtual:likec4/previews"));const n=await i.viewsService.computedViews();return diagramPreviewsSources(n,t)}},G={id:"virtual:likec4/model",virtualId:"\0likec4-plugin/model.js",async load({likec4:i,logger:e,assetsDir:t}){e.info(LikeC4.p.dim("generating virtual:likec4/model"));const n=await i.layoutedModel();return likec4ModelSources(n)}},modules=[C,P,V,j,O,m,G],$=i=>{const e=i.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")};function likec4Plugin({useOverviewGraph:i=!1,languageServices:e}){let t,n=e.workspace;return{name:"vite-plugin-likec4",configResolved(s){if(t=s.logger,i){const o=s.resolve.alias.find(a=>a.find==="likec4/previews")?.replacement;o?(n=o,t.info(LikeC4.p.dim("likec4/previews alias")+" "+LikeC4.p.dim(n))):t.warn("likec4/previews alias not found")}},resolveId(s){const o=modules.find(a=>a.id===s);return o?o.virtualId:null},async load(s){const o=modules.find(a=>a.virtualId===s);return o?await o.load({logger:t,likec4:e,assetsDir:n,useOverviewGraph:i}):null},configureServer(s){const o=LikeC4.e(1),a=()=>{o.clearQueue(),o(async()=>{const[B]=e.getErrors();if(B){s.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+B.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:B.sourceFsPath,line:B.range.start.line+1,column:B.range.start.character+1}}});return}for(const w of modules){const E=s.moduleGraph.getModuleById(w.virtualId);if(E&&E.importers.size>0){t.info(`${LikeC4.p.green("trigger hmr")} ${LikeC4.p.dim(E.url)}`);try{await s.reloadModule(E)}catch(_){t.error(_)}}}})},l=e.workspace;t.info(`${LikeC4.p.dim("watch")} ${l}`);const d=B=>w=>{$(w)&&e.notifyUpdate({[B]:w})};if(s.watcher.add(l).on("add",d("changed")).on("change",d("changed")).on("unlink",d("removed")),i&&!n.startsWith(e.workspace)){t.info(`${LikeC4.p.dim("watch")} ${n}`);const B=()=>{const w=s.moduleGraph.getModuleById(m.virtualId);w&&w.importers.size>0&&s.reloadModule(w)};s.watcher.add(n).on("add",B).on("change",B).on("unlink",B)}e.onModelUpdate(()=>{LikeC4.H.debug("likec4 model update"),a()})}}}const viteConfig=async({languageServices:i,likec4AssetsDir:e,...t})=>{const n=t.customLogger??LikeC4.h("c4:vite"),s=viteAppRoot(),o=t?.useOverviewGraph===!0;n.info(`${LikeC4.p.cyan("likec4 app root")} ${LikeC4.p.dim(s)}`);const a=t.outputDir??path$1.resolve(i.workspace,"dist");n.info(LikeC4.p.cyan("output")+" "+LikeC4.p.dim(a));let l="/";t.base&&(l=LikeC4.w(t.base),!LikeC4.j(l)&&l!=="./"&&(l=LikeC4.k(l))),l!=="/"&&n.info(`${LikeC4.p.green("app base url")} ${LikeC4.p.dim(l)}`);const d=t.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:e,webcomponentPrefix:d,root:s,languageServices:i,clearScreen:!1,base:l,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...viteAliases(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{force:!0,include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(d),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:o?"true":"false",__USE_HASH_HISTORY__:t?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:a,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[c__default(),likec4Plugin({languageServices:i,useOverviewGraph:o})]}};async function viteWebcomponentConfig({languageServices:i,outDir:e,base:t,webcomponentPrefix:n="likec4",filename:s="likec4-views.js"}){const o=LikeC4.h("c4:lib"),a=viteAppRoot();return o.info(LikeC4.p.cyan("outDir")+" "+LikeC4.p.dim(e)),{root:a,clearScreen:!1,base:t,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...JsBanners},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit,lib:{entry:"webcomponent/webcomponent.js",fileName(l,d){return s},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{defaultIsModuleExports:l=>l.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:o,plugins:[likec4Plugin({languageServices:i,useOverviewGraph:!1})]}}const Assets=["favicon.ico","robots.txt"],viteBuild=async({buildWebcomponent:i=!0,webcomponentPrefix:e="likec4",languageServices:t,likec4AssetsDir:n,...s})=>{n??=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-"));const{isDev:o,...a}=await viteConfig({...s,languageServices:t,likec4AssetsDir:n,webcomponentPrefix:e}),l=await mkTempPublicDir();for(const w of Assets){const E=path$1.resolve(a.root,w);fs.existsSync(E)&&fs.copyFileSync(E,path$1.resolve(l,w))}const d=await t.diagrams();if(d.length===0)throw process.exitCode=1,new Error("no views found");if(d.forEach(w=>{w.hasLayoutDrift&&a.customLogger.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(w.id))}),i){const w=await viteWebcomponentConfig({webcomponentPrefix:e,languageServices:t,outDir:l,base:a.base});await vite.build(w)}await vite.build({...a,publicDir:l,mode:"production"});const B=path$1.resolve(a.build.outDir,"index.html");fs.existsSync(B)&&fs.copyFileSync(B,path$1.resolve(a.build.outDir,"404.html"))};function resolveServerUrl(i){if(i.resolvedUrls)return LikeC4.m(i.resolvedUrls.network)??LikeC4.m(i.resolvedUrls.local)}function printServerUrls(i){if(!i.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");LikeC4.H.box([LikeC4.p.green("LikeC4 served at:"),"",LikeC4.p.dim("Local: ")+i.resolvedUrls.local.join(`
413
+ `}const P={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/dot-sources"));const t=await i.viewsService.viewsAsGraphvizOut(),n=LikeC4.l(t,({id:s,svg:a,dot:o})=>[s,{dot:o,svg:a}]);return generateDotSources(n)}},V={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/d2-sources"));const t=await i.viewsService.computedViews();return generateD2Sources(t)}},j={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/mmd-sources"));const t=await i.viewsService.computedViews();return generateMmdSources(t)}},C={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:i,logger:e}){e.info(LikeC4.p.dim("generating virtual:likec4/icons"));const t=await i.viewsService.computedViews();return generateIconRendererSource(t)}},O={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plugin/overview-graph.js",async load({likec4:i,logger:e,useOverviewGraph:t}){if(t===!0)try{e.info(LikeC4.p.dim("generating virtual:likec4/overview-graph"));const n=await i.viewsService.overviewGraph();return generateOverviewGraphSource(n)}catch(n){e.error(n)}return e.info(LikeC4.p.dim("generating empty virtual:likec4/overview-graph")),generateOverviewGraphSource({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},m$1={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:i,logger:e,assetsDir:t}){e.info(LikeC4.p.dim("generating virtual:likec4/previews"));const n=await i.viewsService.computedViews();return diagramPreviewsSources(n,t)}},G={id:"virtual:likec4/model",virtualId:"\0likec4-plugin/model.js",async load({likec4:i,logger:e,assetsDir:t}){e.info(LikeC4.p.dim("generating virtual:likec4/model"));const n=await i.layoutedModel();return likec4ModelSources(n)}},modules=[C,P,V,j,O,m$1,G],$=i=>{const e=i.toLowerCase();return e.endsWith(".c4")||e.endsWith(".likec4")||e.endsWith(".like-c4")};function likec4Plugin({useOverviewGraph:i=!1,languageServices:e}){let t,n=e.workspace;return{name:"vite-plugin-likec4",configResolved(s){if(t=s.logger,i){const a=s.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;a?(n=a,t.info(LikeC4.p.dim("likec4/previews alias")+" "+LikeC4.p.dim(n))):t.warn("likec4/previews alias not found")}},resolveId(s){const a=modules.find(o=>o.id===s);return a?a.virtualId:null},async load(s){const a=modules.find(o=>o.virtualId===s);return a?await a.load({logger:t,likec4:e,assetsDir:n,useOverviewGraph:i}):null},configureServer(s){const a=LikeC4.e(1),o=()=>{a.clearQueue(),a(async()=>{const[E]=e.getErrors();if(E){s.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+E.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:E.sourceFsPath,line:E.range.start.line+1,column:E.range.start.character+1}}});return}for(const w of modules){const y=s.moduleGraph.getModuleById(w.virtualId);if(y&&y.importers.size>0){t.info(`${LikeC4.p.green("trigger hmr")} ${LikeC4.p.dim(y.url)}`);try{await s.reloadModule(y)}catch(d){t.error(d)}}}})},l=e.workspace;t.info(`${LikeC4.p.dim("watch")} ${l}`);const f=E=>w=>{$(w)&&e.notifyUpdate({[E]:w})};if(s.watcher.add(l).on("add",f("changed")).on("change",f("changed")).on("unlink",f("removed")),i&&!n.startsWith(e.workspace)){t.info(`${LikeC4.p.dim("watch")} ${n}`);const E=()=>{const w=s.moduleGraph.getModuleById(m$1.virtualId);w&&w.importers.size>0&&s.reloadModule(w)};s.watcher.add(n).on("add",E).on("change",E).on("unlink",E)}e.onModelUpdate(()=>{LikeC4.H.debug("likec4 model update"),o()})}}}var utils$1={},hasRequiredUtils$1;function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,function(i){i.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,i.find=(e,t)=>e.nodes.find(n=>n.type===t),i.exceedsLimit=(e,t,n=1,s)=>s===!1||!i.isInteger(e)||!i.isInteger(t)?!1:(Number(t)-Number(e))/Number(n)>=s,i.escapeNode=(e,t=0,n)=>{const s=e.nodes[t];s&&(n&&s.type===n||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},i.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),i.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,i.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,i.reduce=e=>e.reduce((t,n)=>(n.type==="text"&&t.push(n.value),n.type==="range"&&(n.type="text"),t),[]),i.flatten=(...e)=>{const t=[],n=s=>{for(let a=0;a<s.length;a++){const o=s[a];if(Array.isArray(o)){n(o);continue}o!==void 0&&t.push(o)}return t};return n(e),t}}(utils$1)),utils$1}var stringify,hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify;hasRequiredStringify=1;const i=requireUtils$1();return stringify=(e,t={})=>{const n=(s,a={})=>{const o=t.escapeInvalid&&i.isInvalidBrace(a),l=s.invalid===!0&&t.escapeInvalid===!0;let f="";if(s.value)return(o||l)&&i.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(const E of s.nodes)f+=n(E);return f};return n(e)},stringify}var isNumber,hasRequiredIsNumber;function requireIsNumber(){return hasRequiredIsNumber||(hasRequiredIsNumber=1,isNumber=function(i){return typeof i=="number"?i-i===0:typeof i=="string"&&i.trim()!==""?Number.isFinite?Number.isFinite(+i):isFinite(+i):!1}),isNumber}var toRegexRange_1,hasRequiredToRegexRange;function requireToRegexRange(){if(hasRequiredToRegexRange)return toRegexRange_1;hasRequiredToRegexRange=1;const i=requireIsNumber(),e=(_,U,te)=>{if(i(_)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(U===void 0||_===U)return String(_);if(i(U)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let T={relaxZeros:!0,...te};typeof T.strictZeros=="boolean"&&(T.relaxZeros=T.strictZeros===!1);let X=String(T.relaxZeros),K=String(T.shorthand),le=String(T.capture),re=String(T.wrap),he=_+":"+U+"="+X+K+le+re;if(e.cache.hasOwnProperty(he))return e.cache[he].result;let De=Math.min(_,U),ge=Math.max(_,U);if(Math.abs(De-ge)===1){let me=_+"|"+U;return T.capture?`(${me})`:T.wrap===!1?me:`(?:${me})`}let ae=Q(_)||Q(U),ue={min:_,max:U,a:De,b:ge},ee=[],de=[];if(ae&&(ue.isPadded=ae,ue.maxLen=String(ue.max).length),De<0){let me=ge<0?Math.abs(ge):1;de=a(me,Math.abs(De),ue,T),De=ue.a=0}return ge>=0&&(ee=a(De,ge,ue,T)),ue.negatives=de,ue.positives=ee,ue.result=t(de,ee),T.capture===!0?ue.result=`(${ue.result})`:T.wrap!==!1&&ee.length+de.length>1&&(ue.result=`(?:${ue.result})`),e.cache[he]=ue,ue.result};function t(_,U,te){let T=o(_,U,"-",!1),X=o(U,_,"",!1),K=o(_,U,"-?",!0);return T.concat(K).concat(X).join("|")}function n(_,U){let te=1,T=1,X=w(_,te),K=new Set([U]);for(;_<=X&&X<=U;)K.add(X),te+=1,X=w(_,te);for(X=y(U+1,T)-1;_<X&&X<=U;)K.add(X),T+=1,X=y(U+1,T)-1;return K=[...K],K.sort(f),K}function s(_,U,te){if(_===U)return{pattern:_,count:[],digits:0};let T=l(_,U),X=T.length,K="",le=0;for(let re=0;re<X;re++){let[he,De]=T[re];he===De?K+=he:he!=="0"||De!=="9"?K+=H(he,De):le++}return le&&(K+=te.shorthand===!0?"\\d":"[0-9]"),{pattern:K,count:[le],digits:X}}function a(_,U,te,T){let X=n(_,U),K=[],le=_,re;for(let he=0;he<X.length;he++){let De=X[he],ge=s(String(le),String(De),T),ae="";if(!te.isPadded&&re&&re.pattern===ge.pattern){re.count.length>1&&re.count.pop(),re.count.push(ge.count[0]),re.string=re.pattern+d(re.count),le=De+1;continue}te.isPadded&&(ae=W(De,te,T)),ge.string=ae+ge.pattern+d(ge.count),K.push(ge),le=De+1,re=ge}return K}function o(_,U,te,T,X){let K=[];for(let le of _){let{string:re}=le;!T&&!E(U,"string",re)&&K.push(te+re),T&&E(U,"string",re)&&K.push(te+re)}return K}function l(_,U){let te=[];for(let T=0;T<_.length;T++)te.push([_[T],U[T]]);return te}function f(_,U){return _>U?1:U>_?-1:0}function E(_,U,te){return _.some(T=>T[U]===te)}function w(_,U){return Number(String(_).slice(0,-U)+"9".repeat(U))}function y(_,U){return _-_%Math.pow(10,U)}function d(_){let[U=0,te=""]=_;return te||U>1?`{${U+(te?","+te:"")}}`:""}function H(_,U,te){return`[${_}${U-_===1?"":"-"}${U}]`}function Q(_){return/^-?(0+)\d/.test(_)}function W(_,U,te){if(!U.isPadded)return _;let T=Math.abs(U.maxLen-String(_).length),X=te.relaxZeros!==!1;switch(T){case 0:return"";case 1:return X?"0?":"0";case 2:return X?"0{0,2}":"00";default:return X?`0{0,${T}}`:`0{${T}}`}}return e.cache={},e.clearCache=()=>e.cache={},toRegexRange_1=e,toRegexRange_1}var fillRange,hasRequiredFillRange;function requireFillRange(){if(hasRequiredFillRange)return fillRange;hasRequiredFillRange=1;const i=require$$0__default,e=requireToRegexRange(),t=T=>T!==null&&typeof T=="object"&&!Array.isArray(T),n=T=>X=>T===!0?Number(X):String(X),s=T=>typeof T=="number"||typeof T=="string"&&T!=="",a=T=>Number.isInteger(+T),o=T=>{let X=`${T}`,K=-1;if(X[0]==="-"&&(X=X.slice(1)),X==="0")return!1;for(;X[++K]==="0";);return K>0},l=(T,X,K)=>typeof T=="string"||typeof X=="string"?!0:K.stringify===!0,f=(T,X,K)=>{if(X>0){let le=T[0]==="-"?"-":"";le&&(T=T.slice(1)),T=le+T.padStart(le?X-1:X,"0")}return K===!1?String(T):T},E=(T,X)=>{let K=T[0]==="-"?"-":"";for(K&&(T=T.slice(1),X--);T.length<X;)T="0"+T;return K?"-"+T:T},w=(T,X,K)=>{T.negatives.sort((ge,ae)=>ge<ae?-1:ge>ae?1:0),T.positives.sort((ge,ae)=>ge<ae?-1:ge>ae?1:0);let le=X.capture?"":"?:",re="",he="",De;return T.positives.length&&(re=T.positives.map(ge=>E(String(ge),K)).join("|")),T.negatives.length&&(he=`-(${le}${T.negatives.map(ge=>E(String(ge),K)).join("|")})`),re&&he?De=`${re}|${he}`:De=re||he,X.wrap?`(${le}${De})`:De},y=(T,X,K,le)=>{if(K)return e(T,X,{wrap:!1,...le});let re=String.fromCharCode(T);if(T===X)return re;let he=String.fromCharCode(X);return`[${re}-${he}]`},d=(T,X,K)=>{if(Array.isArray(T)){let le=K.wrap===!0,re=K.capture?"":"?:";return le?`(${re}${T.join("|")})`:T.join("|")}return e(T,X,K)},H=(...T)=>new RangeError("Invalid range arguments: "+i.inspect(...T)),Q=(T,X,K)=>{if(K.strictRanges===!0)throw H([T,X]);return[]},W=(T,X)=>{if(X.strictRanges===!0)throw new TypeError(`Expected step "${T}" to be a number`);return[]},_=(T,X,K=1,le={})=>{let re=Number(T),he=Number(X);if(!Number.isInteger(re)||!Number.isInteger(he)){if(le.strictRanges===!0)throw H([T,X]);return[]}re===0&&(re=0),he===0&&(he=0);let De=re>he,ge=String(T),ae=String(X),ue=String(K);K=Math.max(Math.abs(K),1);let ee=o(ge)||o(ae)||o(ue),de=ee?Math.max(ge.length,ae.length,ue.length):0,me=ee===!1&&l(T,X,le)===!1,we=le.transform||n(me);if(le.toRegex&&K===1)return y(E(T,de),E(X,de),!0,le);let pe={negatives:[],positives:[]},Fe=ne=>pe[ne<0?"negatives":"positives"].push(Math.abs(ne)),Oe=[],ye=0;for(;De?re>=he:re<=he;)le.toRegex===!0&&K>1?Fe(re):Oe.push(f(we(re,ye),de,me)),re=De?re-K:re+K,ye++;return le.toRegex===!0?K>1?w(pe,le,de):d(Oe,null,{wrap:!1,...le}):Oe},U=(T,X,K=1,le={})=>{if(!a(T)&&T.length>1||!a(X)&&X.length>1)return Q(T,X,le);let re=le.transform||(me=>String.fromCharCode(me)),he=`${T}`.charCodeAt(0),De=`${X}`.charCodeAt(0),ge=he>De,ae=Math.min(he,De),ue=Math.max(he,De);if(le.toRegex&&K===1)return y(ae,ue,!1,le);let ee=[],de=0;for(;ge?he>=De:he<=De;)ee.push(re(he,de)),he=ge?he-K:he+K,de++;return le.toRegex===!0?d(ee,null,{wrap:!1,options:le}):ee},te=(T,X,K,le={})=>{if(X==null&&s(T))return[T];if(!s(T)||!s(X))return Q(T,X,le);if(typeof K=="function")return te(T,X,1,{transform:K});if(t(K))return te(T,X,0,K);let re={...le};return re.capture===!0&&(re.wrap=!0),K=K||re.step||1,a(K)?a(T)&&a(X)?_(T,X,K,re):U(T,X,Math.max(Math.abs(K),1),re):K!=null&&!t(K)?W(K,re):te(T,X,1,K)};return fillRange=te,fillRange}var compile_1,hasRequiredCompile;function requireCompile(){if(hasRequiredCompile)return compile_1;hasRequiredCompile=1;const i=requireFillRange(),e=requireUtils$1();return compile_1=(n,s={})=>{const a=(o,l={})=>{const f=e.isInvalidBrace(l),E=o.invalid===!0&&s.escapeInvalid===!0,w=f===!0||E===!0,y=s.escapeInvalid===!0?"\\":"";let d="";if(o.isOpen===!0)return y+o.value;if(o.isClose===!0)return console.log("node.isClose",y,o.value),y+o.value;if(o.type==="open")return w?y+o.value:"(";if(o.type==="close")return w?y+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":w?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const H=e.reduce(o.nodes),Q=i(...H,{...s,wrap:!1,toRegex:!0,strictZeros:!0});if(Q.length!==0)return H.length>1&&Q.length>1?`(${Q})`:Q}if(o.nodes)for(const H of o.nodes)d+=a(H,o);return d};return a(n)},compile_1}var expand_1,hasRequiredExpand;function requireExpand(){if(hasRequiredExpand)return expand_1;hasRequiredExpand=1;const i=requireFillRange(),e=requireStringify(),t=requireUtils$1(),n=(a="",o="",l=!1)=>{const f=[];if(a=[].concat(a),o=[].concat(o),!o.length)return a;if(!a.length)return l?t.flatten(o).map(E=>`{${E}}`):o;for(const E of a)if(Array.isArray(E))for(const w of E)f.push(n(w,o,l));else for(let w of o)l===!0&&typeof w=="string"&&(w=`{${w}}`),f.push(Array.isArray(w)?n(E,w,l):E+w);return t.flatten(f)};return expand_1=(a,o={})=>{const l=o.rangeLimit===void 0?1e3:o.rangeLimit,f=(E,w={})=>{E.queue=[];let y=w,d=w.queue;for(;y.type!=="brace"&&y.type!=="root"&&y.parent;)y=y.parent,d=y.queue;if(E.invalid||E.dollar){d.push(n(d.pop(),e(E,o)));return}if(E.type==="brace"&&E.invalid!==!0&&E.nodes.length===2){d.push(n(d.pop(),["{}"]));return}if(E.nodes&&E.ranges>0){const _=t.reduce(E.nodes);if(t.exceedsLimit(..._,o.step,l))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let U=i(..._,o);U.length===0&&(U=e(E,o)),d.push(n(d.pop(),U)),E.nodes=[];return}const H=t.encloseBrace(E);let Q=E.queue,W=E;for(;W.type!=="brace"&&W.type!=="root"&&W.parent;)W=W.parent,Q=W.queue;for(let _=0;_<E.nodes.length;_++){const U=E.nodes[_];if(U.type==="comma"&&E.type==="brace"){_===1&&Q.push(""),Q.push("");continue}if(U.type==="close"){d.push(n(d.pop(),Q,H));continue}if(U.value&&U.type!=="open"){Q.push(n(Q.pop(),U.value));continue}U.nodes&&f(U,E)}return Q};return t.flatten(f(a))},expand_1}var constants$1,hasRequiredConstants$1;function requireConstants$1(){return hasRequiredConstants$1||(hasRequiredConstants$1=1,constants$1={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:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
414
+ `,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"}),constants$1}var parse_1$1,hasRequiredParse$1;function requireParse$1(){if(hasRequiredParse$1)return parse_1$1;hasRequiredParse$1=1;const i=requireStringify(),{MAX_LENGTH:e,CHAR_BACKSLASH:t,CHAR_BACKTICK:n,CHAR_COMMA:s,CHAR_DOT:a,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_RIGHT_CURLY_BRACE:E,CHAR_LEFT_SQUARE_BRACKET:w,CHAR_RIGHT_SQUARE_BRACKET:y,CHAR_DOUBLE_QUOTE:d,CHAR_SINGLE_QUOTE:H,CHAR_NO_BREAK_SPACE:Q,CHAR_ZERO_WIDTH_NOBREAK_SPACE:W}=requireConstants$1();return parse_1$1=(U,te={})=>{if(typeof U!="string")throw new TypeError("Expected a string");const T=te||{},X=typeof T.maxLength=="number"?Math.min(e,T.maxLength):e;if(U.length>X)throw new SyntaxError(`Input length (${U.length}), exceeds max characters (${X})`);const K={type:"root",input:U,nodes:[]},le=[K];let re=K,he=K,De=0;const ge=U.length;let ae=0,ue=0,ee;const de=()=>U[ae++],me=we=>{if(we.type==="text"&&he.type==="dot"&&(he.type="text"),he&&he.type==="text"&&we.type==="text"){he.value+=we.value;return}return re.nodes.push(we),we.parent=re,we.prev=he,he=we,we};for(me({type:"bos"});ae<ge;)if(re=le[le.length-1],ee=de(),!(ee===W||ee===Q)){if(ee===t){me({type:"text",value:(te.keepEscaping?ee:"")+de()});continue}if(ee===y){me({type:"text",value:"\\"+ee});continue}if(ee===w){De++;let we;for(;ae<ge&&(we=de());){if(ee+=we,we===w){De++;continue}if(we===t){ee+=de();continue}if(we===y&&(De--,De===0))break}me({type:"text",value:ee});continue}if(ee===o){re=me({type:"paren",nodes:[]}),le.push(re),me({type:"text",value:ee});continue}if(ee===l){if(re.type!=="paren"){me({type:"text",value:ee});continue}re=le.pop(),me({type:"text",value:ee}),re=le[le.length-1];continue}if(ee===d||ee===H||ee===n){const we=ee;let pe;for(te.keepQuotes!==!0&&(ee="");ae<ge&&(pe=de());){if(pe===t){ee+=pe+de();continue}if(pe===we){te.keepQuotes===!0&&(ee+=pe);break}ee+=pe}me({type:"text",value:ee});continue}if(ee===f){ue++;const pe={type:"brace",open:!0,close:!1,dollar:he.value&&he.value.slice(-1)==="$"||re.dollar===!0,depth:ue,commas:0,ranges:0,nodes:[]};re=me(pe),le.push(re),me({type:"open",value:ee});continue}if(ee===E){if(re.type!=="brace"){me({type:"text",value:ee});continue}const we="close";re=le.pop(),re.close=!0,me({type:we,value:ee}),ue--,re=le[le.length-1];continue}if(ee===s&&ue>0){if(re.ranges>0){re.ranges=0;const we=re.nodes.shift();re.nodes=[we,{type:"text",value:i(re)}]}me({type:"comma",value:ee}),re.commas++;continue}if(ee===a&&ue>0&&re.commas===0){const we=re.nodes;if(ue===0||we.length===0){me({type:"text",value:ee});continue}if(he.type==="dot"){if(re.range=[],he.value+=ee,he.type="range",re.nodes.length!==3&&re.nodes.length!==5){re.invalid=!0,re.ranges=0,he.type="text";continue}re.ranges++,re.args=[];continue}if(he.type==="range"){we.pop();const pe=we[we.length-1];pe.value+=he.value+ee,he=pe,re.ranges--;continue}me({type:"dot",value:ee});continue}me({type:"text",value:ee})}do if(re=le.pop(),re.type!=="root"){re.nodes.forEach(Fe=>{Fe.nodes||(Fe.type==="open"&&(Fe.isOpen=!0),Fe.type==="close"&&(Fe.isClose=!0),Fe.nodes||(Fe.type="text"),Fe.invalid=!0)});const we=le[le.length-1],pe=we.nodes.indexOf(re);we.nodes.splice(pe,1,...re.nodes)}while(le.length>0);return me({type:"eos"}),K},parse_1$1}var braces_1,hasRequiredBraces;function requireBraces(){if(hasRequiredBraces)return braces_1;hasRequiredBraces=1;const i=requireStringify(),e=requireCompile(),t=requireExpand(),n=requireParse$1(),s=(a,o={})=>{let l=[];if(Array.isArray(a))for(const f of a){const E=s.create(f,o);Array.isArray(E)?l.push(...E):l.push(E)}else l=[].concat(s.create(a,o));return o&&o.expand===!0&&o.nodupes===!0&&(l=[...new Set(l)]),l};return s.parse=(a,o={})=>n(a,o),s.stringify=(a,o={})=>i(typeof a=="string"?s.parse(a,o):a,o),s.compile=(a,o={})=>(typeof a=="string"&&(a=s.parse(a,o)),e(a,o)),s.expand=(a,o={})=>{typeof a=="string"&&(a=s.parse(a,o));let l=t(a,o);return o.noempty===!0&&(l=l.filter(Boolean)),o.nodupes===!0&&(l=[...new Set(l)]),l},s.create=(a,o={})=>a===""||a.length<3?[a]:o.expand!==!0?s.compile(a,o):s.expand(a,o),braces_1=s,braces_1}var utils={},constants,hasRequiredConstants;function requireConstants(){if(hasRequiredConstants)return constants;hasRequiredConstants=1;const i=require$$0__default$1,e="\\\\/",t=`[^${e}]`,n="\\.",s="\\+",a="\\?",o="\\/",l="(?=.)",f="[^/]",E=`(?:${o}|$)`,w=`(?:^|${o})`,y=`${n}{1,2}${E}`,d=`(?!${n})`,H=`(?!${w}${y})`,Q=`(?!${n}{0,1}${E})`,W=`(?!${y})`,_=`[^.${o}]`,U=`${f}*?`,te={DOT_LITERAL:n,PLUS_LITERAL:s,QMARK_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,QMARK:f,END_ANCHOR:E,DOTS_SLASH:y,NO_DOT:d,NO_DOTS:H,NO_DOT_SLASH:Q,NO_DOTS_SLASH:W,QMARK_NO_DOT:_,STAR:U,START_ANCHOR:w},T={...te,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},X={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 constants={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:X,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,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,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,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:i.sep,extglobChars(K){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${K.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(K){return K===!0?T:te}},constants}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,function(i){const e=require$$0__default$1,t=process.platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=requireConstants();i.isObject=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),i.hasRegexChars=l=>a.test(l),i.isRegexChar=l=>l.length===1&&i.hasRegexChars(l),i.escapeRegex=l=>l.replace(o,"\\$1"),i.toPosixSlashes=l=>l.replace(n,"/"),i.removeBackslashes=l=>l.replace(s,f=>f==="\\"?"":f),i.supportsLookbehinds=()=>{const l=process.version.slice(1).split(".").map(Number);return l.length===3&&l[0]>=9||l[0]===8&&l[1]>=10},i.isWindows=l=>l&&typeof l.windows=="boolean"?l.windows:t===!0||e.sep==="\\",i.escapeLast=(l,f,E)=>{const w=l.lastIndexOf(f,E);return w===-1?l:l[w-1]==="\\"?i.escapeLast(l,f,w-1):`${l.slice(0,w)}\\${l.slice(w)}`},i.removePrefix=(l,f={})=>{let E=l;return E.startsWith("./")&&(E=E.slice(2),f.prefix="./"),E},i.wrapOutput=(l,f={},E={})=>{const w=E.contains?"":"^",y=E.contains?"":"$";let d=`${w}(?:${l})${y}`;return f.negated===!0&&(d=`(?:^(?!${d}).*$)`),d}}(utils)),utils}var scan_1,hasRequiredScan;function requireScan(){if(hasRequiredScan)return scan_1;hasRequiredScan=1;const i=requireUtils(),{CHAR_ASTERISK:e,CHAR_AT:t,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:s,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:E,CHAR_LEFT_SQUARE_BRACKET:w,CHAR_PLUS:y,CHAR_QUESTION_MARK:d,CHAR_RIGHT_CURLY_BRACE:H,CHAR_RIGHT_PARENTHESES:Q,CHAR_RIGHT_SQUARE_BRACKET:W}=requireConstants(),_=T=>T===l||T===n,U=T=>{T.isPrefix!==!0&&(T.depth=T.isGlobstar?1/0:1)};return scan_1=(T,X)=>{const K=X||{},le=T.length-1,re=K.parts===!0||K.scanToEnd===!0,he=[],De=[],ge=[];let ae=T,ue=-1,ee=0,de=0,me=!1,we=!1,pe=!1,Fe=!1,Oe=!1,ye=!1,ne=!1,Be=!1,Re=!1,Ce=!1,se=0,z,Ae,Ee={value:"",depth:0,isGlob:!1};const be=()=>ue>=le,xe=()=>ae.charCodeAt(ue+1),_e=()=>(z=Ae,ae.charCodeAt(++ue));for(;ue<le;){Ae=_e();let N;if(Ae===n){ne=Ee.backslashes=!0,Ae=_e(),Ae===f&&(ye=!0);continue}if(ye===!0||Ae===f){for(se++;be()!==!0&&(Ae=_e());){if(Ae===n){ne=Ee.backslashes=!0,_e();continue}if(Ae===f){se++;continue}if(ye!==!0&&Ae===a&&(Ae=_e())===a){if(me=Ee.isBrace=!0,pe=Ee.isGlob=!0,Ce=!0,re===!0)continue;break}if(ye!==!0&&Ae===s){if(me=Ee.isBrace=!0,pe=Ee.isGlob=!0,Ce=!0,re===!0)continue;break}if(Ae===H&&(se--,se===0)){ye=!1,me=Ee.isBrace=!0,Ce=!0;break}}if(re===!0)continue;break}if(Ae===l){if(he.push(ue),De.push(Ee),Ee={value:"",depth:0,isGlob:!1},Ce===!0)continue;if(z===a&&ue===ee+1){ee+=2;continue}de=ue+1;continue}if(K.noext!==!0&&(Ae===y||Ae===t||Ae===e||Ae===d||Ae===o)===!0&&xe()===E){if(pe=Ee.isGlob=!0,Fe=Ee.isExtglob=!0,Ce=!0,Ae===o&&ue===ee&&(Re=!0),re===!0){for(;be()!==!0&&(Ae=_e());){if(Ae===n){ne=Ee.backslashes=!0,Ae=_e();continue}if(Ae===Q){pe=Ee.isGlob=!0,Ce=!0;break}}continue}break}if(Ae===e){if(z===e&&(Oe=Ee.isGlobstar=!0),pe=Ee.isGlob=!0,Ce=!0,re===!0)continue;break}if(Ae===d){if(pe=Ee.isGlob=!0,Ce=!0,re===!0)continue;break}if(Ae===w){for(;be()!==!0&&(N=_e());){if(N===n){ne=Ee.backslashes=!0,_e();continue}if(N===W){we=Ee.isBracket=!0,pe=Ee.isGlob=!0,Ce=!0;break}}if(re===!0)continue;break}if(K.nonegate!==!0&&Ae===o&&ue===ee){Be=Ee.negated=!0,ee++;continue}if(K.noparen!==!0&&Ae===E){if(pe=Ee.isGlob=!0,re===!0){for(;be()!==!0&&(Ae=_e());){if(Ae===E){ne=Ee.backslashes=!0,Ae=_e();continue}if(Ae===Q){Ce=!0;break}}continue}break}if(pe===!0){if(Ce=!0,re===!0)continue;break}}K.noext===!0&&(Fe=!1,pe=!1);let Se=ae,Le="",Ne="";ee>0&&(Le=ae.slice(0,ee),ae=ae.slice(ee),de-=ee),Se&&pe===!0&&de>0?(Se=ae.slice(0,de),Ne=ae.slice(de)):pe===!0?(Se="",Ne=ae):Se=ae,Se&&Se!==""&&Se!=="/"&&Se!==ae&&_(Se.charCodeAt(Se.length-1))&&(Se=Se.slice(0,-1)),K.unescape===!0&&(Ne&&(Ne=i.removeBackslashes(Ne)),Se&&ne===!0&&(Se=i.removeBackslashes(Se)));const L={prefix:Le,input:T,start:ee,base:Se,glob:Ne,isBrace:me,isBracket:we,isGlob:pe,isExtglob:Fe,isGlobstar:Oe,negated:Be,negatedExtglob:Re};if(K.tokens===!0&&(L.maxDepth=0,_(Ae)||De.push(Ee),L.tokens=De),K.parts===!0||K.tokens===!0){let N;for(let oe=0;oe<he.length;oe++){const ie=N?N+1:ee,B=he[oe],fe=T.slice(ie,B);K.tokens&&(oe===0&&ee!==0?(De[oe].isPrefix=!0,De[oe].value=Le):De[oe].value=fe,U(De[oe]),L.maxDepth+=De[oe].depth),(oe!==0||fe!=="")&&ge.push(fe),N=B}if(N&&N+1<T.length){const oe=T.slice(N+1);ge.push(oe),K.tokens&&(De[De.length-1].value=oe,U(De[De.length-1]),L.maxDepth+=De[De.length-1].depth)}L.slashes=he,L.parts=ge}return L},scan_1}var parse_1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse_1;hasRequiredParse=1;const i=requireConstants(),e=requireUtils(),{MAX_LENGTH:t,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:o}=i,l=(w,y)=>{if(typeof y.expandRange=="function")return y.expandRange(...w,y);w.sort();const d=`[${w.join("-")}]`;try{new RegExp(d)}catch{return w.map(Q=>e.escapeRegex(Q)).join("..")}return d},f=(w,y)=>`Missing ${w}: "${y}" - use "\\\\${y}" to match literal characters`,E=(w,y)=>{if(typeof w!="string")throw new TypeError("Expected a string");w=o[w]||w;const d={...y},H=typeof d.maxLength=="number"?Math.min(t,d.maxLength):t;let Q=w.length;if(Q>H)throw new SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${H}`);const W={type:"bos",value:"",output:d.prepend||""},_=[W],U=d.capture?"":"?:",te=e.isWindows(y),T=i.globChars(te),X=i.extglobChars(T),{DOT_LITERAL:K,PLUS_LITERAL:le,SLASH_LITERAL:re,ONE_CHAR:he,DOTS_SLASH:De,NO_DOT:ge,NO_DOT_SLASH:ae,NO_DOTS_SLASH:ue,QMARK:ee,QMARK_NO_DOT:de,STAR:me,START_ANCHOR:we}=T,pe=B=>`(${U}(?:(?!${we}${B.dot?De:K}).)*?)`,Fe=d.dot?"":ge,Oe=d.dot?ee:de;let ye=d.bash===!0?pe(d):me;d.capture&&(ye=`(${ye})`),typeof d.noext=="boolean"&&(d.noextglob=d.noext);const ne={input:w,index:-1,start:0,dot:d.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:_};w=e.removePrefix(w,ne),Q=w.length;const Be=[],Re=[],Ce=[];let se=W,z;const Ae=()=>ne.index===Q-1,Ee=ne.peek=(B=1)=>w[ne.index+B],be=ne.advance=()=>w[++ne.index]||"",xe=()=>w.slice(ne.index+1),_e=(B="",fe=0)=>{ne.consumed+=B,ne.index+=fe},Se=B=>{ne.output+=B.output!=null?B.output:B.value,_e(B.value)},Le=()=>{let B=1;for(;Ee()==="!"&&(Ee(2)!=="("||Ee(3)==="?");)be(),ne.start++,B++;return B%2===0?!1:(ne.negated=!0,ne.start++,!0)},Ne=B=>{ne[B]++,Ce.push(B)},L=B=>{ne[B]--,Ce.pop()},N=B=>{if(se.type==="globstar"){const fe=ne.braces>0&&(B.type==="comma"||B.type==="brace"),Z=B.extglob===!0||Be.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!fe&&!Z&&(ne.output=ne.output.slice(0,-se.output.length),se.type="star",se.value="*",se.output=ye,ne.output+=se.output)}if(Be.length&&B.type!=="paren"&&(Be[Be.length-1].inner+=B.value),(B.value||B.output)&&Se(B),se&&se.type==="text"&&B.type==="text"){se.value+=B.value,se.output=(se.output||"")+B.value;return}B.prev=se,_.push(B),se=B},oe=(B,fe)=>{const Z={...X[fe],conditions:1,inner:""};Z.prev=se,Z.parens=ne.parens,Z.output=ne.output;const ce=(d.capture?"(":"")+Z.open;Ne("parens"),N({type:B,value:fe,output:ne.output?"":he}),N({type:"paren",extglob:!0,value:be(),output:ce}),Be.push(Z)},ie=B=>{let fe=B.close+(d.capture?")":""),Z;if(B.type==="negate"){let ce=ye;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(ce=pe(d)),(ce!==ye||Ae()||/^\)+$/.test(xe()))&&(fe=B.close=`)$))${ce}`),B.inner.includes("*")&&(Z=xe())&&/^\.[^\\/.]+$/.test(Z)){const ve=E(Z,{...y,fastpaths:!1}).output;fe=B.close=`)${ve})${ce})`}B.prev.type==="bos"&&(ne.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:z,output:fe}),L("parens")};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(w)){let B=!1,fe=w.replace(a,(Z,ce,ve,$e,Ie,je)=>$e==="\\"?(B=!0,Z):$e==="?"?ce?ce+$e+(Ie?ee.repeat(Ie.length):""):je===0?Oe+(Ie?ee.repeat(Ie.length):""):ee.repeat(ve.length):$e==="."?K.repeat(ve.length):$e==="*"?ce?ce+$e+(Ie?ye:""):ye:ce?Z:`\\${Z}`);return B===!0&&(d.unescape===!0?fe=fe.replace(/\\/g,""):fe=fe.replace(/\\+/g,Z=>Z.length%2===0?"\\\\":Z?"\\":"")),fe===w&&d.contains===!0?(ne.output=w,ne):(ne.output=e.wrapOutput(fe,ne,y),ne)}for(;!Ae();){if(z=be(),z==="\0")continue;if(z==="\\"){const Z=Ee();if(Z==="/"&&d.bash!==!0||Z==="."||Z===";")continue;if(!Z){z+="\\",N({type:"text",value:z});continue}const ce=/^\\+/.exec(xe());let ve=0;if(ce&&ce[0].length>2&&(ve=ce[0].length,ne.index+=ve,ve%2!==0&&(z+="\\")),d.unescape===!0?z=be():z+=be(),ne.brackets===0){N({type:"text",value:z});continue}}if(ne.brackets>0&&(z!=="]"||se.value==="["||se.value==="[^")){if(d.posix!==!1&&z===":"){const Z=se.value.slice(1);if(Z.includes("[")&&(se.posix=!0,Z.includes(":"))){const ce=se.value.lastIndexOf("["),ve=se.value.slice(0,ce),$e=se.value.slice(ce+2),Ie=n[$e];if(Ie){se.value=ve+Ie,ne.backtrack=!0,be(),!W.output&&_.indexOf(se)===1&&(W.output=he);continue}}}(z==="["&&Ee()!==":"||z==="-"&&Ee()==="]")&&(z=`\\${z}`),z==="]"&&(se.value==="["||se.value==="[^")&&(z=`\\${z}`),d.posix===!0&&z==="!"&&se.value==="["&&(z="^"),se.value+=z,Se({value:z});continue}if(ne.quotes===1&&z!=='"'){z=e.escapeRegex(z),se.value+=z,Se({value:z});continue}if(z==='"'){ne.quotes=ne.quotes===1?0:1,d.keepQuotes===!0&&N({type:"text",value:z});continue}if(z==="("){Ne("parens"),N({type:"paren",value:z});continue}if(z===")"){if(ne.parens===0&&d.strictBrackets===!0)throw new SyntaxError(f("opening","("));const Z=Be[Be.length-1];if(Z&&ne.parens===Z.parens+1){ie(Be.pop());continue}N({type:"paren",value:z,output:ne.parens?")":"\\)"}),L("parens");continue}if(z==="["){if(d.nobracket===!0||!xe().includes("]")){if(d.nobracket!==!0&&d.strictBrackets===!0)throw new SyntaxError(f("closing","]"));z=`\\${z}`}else Ne("brackets");N({type:"bracket",value:z});continue}if(z==="]"){if(d.nobracket===!0||se&&se.type==="bracket"&&se.value.length===1){N({type:"text",value:z,output:`\\${z}`});continue}if(ne.brackets===0){if(d.strictBrackets===!0)throw new SyntaxError(f("opening","["));N({type:"text",value:z,output:`\\${z}`});continue}L("brackets");const Z=se.value.slice(1);if(se.posix!==!0&&Z[0]==="^"&&!Z.includes("/")&&(z=`/${z}`),se.value+=z,Se({value:z}),d.literalBrackets===!1||e.hasRegexChars(Z))continue;const ce=e.escapeRegex(se.value);if(ne.output=ne.output.slice(0,-se.value.length),d.literalBrackets===!0){ne.output+=ce,se.value=ce;continue}se.value=`(${U}${ce}|${se.value})`,ne.output+=se.value;continue}if(z==="{"&&d.nobrace!==!0){Ne("braces");const Z={type:"brace",value:z,output:"(",outputIndex:ne.output.length,tokensIndex:ne.tokens.length};Re.push(Z),N(Z);continue}if(z==="}"){const Z=Re[Re.length-1];if(d.nobrace===!0||!Z){N({type:"text",value:z,output:z});continue}let ce=")";if(Z.dots===!0){const ve=_.slice(),$e=[];for(let Ie=ve.length-1;Ie>=0&&(_.pop(),ve[Ie].type!=="brace");Ie--)ve[Ie].type!=="dots"&&$e.unshift(ve[Ie].value);ce=l($e,d),ne.backtrack=!0}if(Z.comma!==!0&&Z.dots!==!0){const ve=ne.output.slice(0,Z.outputIndex),$e=ne.tokens.slice(Z.tokensIndex);Z.value=Z.output="\\{",z=ce="\\}",ne.output=ve;for(const Ie of $e)ne.output+=Ie.output||Ie.value}N({type:"brace",value:z,output:ce}),L("braces"),Re.pop();continue}if(z==="|"){Be.length>0&&Be[Be.length-1].conditions++,N({type:"text",value:z});continue}if(z===","){let Z=z;const ce=Re[Re.length-1];ce&&Ce[Ce.length-1]==="braces"&&(ce.comma=!0,Z="|"),N({type:"comma",value:z,output:Z});continue}if(z==="/"){if(se.type==="dot"&&ne.index===ne.start+1){ne.start=ne.index+1,ne.consumed="",ne.output="",_.pop(),se=W;continue}N({type:"slash",value:z,output:re});continue}if(z==="."){if(ne.braces>0&&se.type==="dot"){se.value==="."&&(se.output=K);const Z=Re[Re.length-1];se.type="dots",se.output+=z,se.value+=z,Z.dots=!0;continue}if(ne.braces+ne.parens===0&&se.type!=="bos"&&se.type!=="slash"){N({type:"text",value:z,output:K});continue}N({type:"dot",value:z,output:K});continue}if(z==="?"){if(!(se&&se.value==="(")&&d.noextglob!==!0&&Ee()==="("&&Ee(2)!=="?"){oe("qmark",z);continue}if(se&&se.type==="paren"){const ce=Ee();let ve=z;if(ce==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(se.value==="("&&!/[!=<:]/.test(ce)||ce==="<"&&!/<([!=]|\w+>)/.test(xe()))&&(ve=`\\${z}`),N({type:"text",value:z,output:ve});continue}if(d.dot!==!0&&(se.type==="slash"||se.type==="bos")){N({type:"qmark",value:z,output:de});continue}N({type:"qmark",value:z,output:ee});continue}if(z==="!"){if(d.noextglob!==!0&&Ee()==="("&&(Ee(2)!=="?"||!/[!=<:]/.test(Ee(3)))){oe("negate",z);continue}if(d.nonegate!==!0&&ne.index===0){Le();continue}}if(z==="+"){if(d.noextglob!==!0&&Ee()==="("&&Ee(2)!=="?"){oe("plus",z);continue}if(se&&se.value==="("||d.regex===!1){N({type:"plus",value:z,output:le});continue}if(se&&(se.type==="bracket"||se.type==="paren"||se.type==="brace")||ne.parens>0){N({type:"plus",value:z});continue}N({type:"plus",value:le});continue}if(z==="@"){if(d.noextglob!==!0&&Ee()==="("&&Ee(2)!=="?"){N({type:"at",extglob:!0,value:z,output:""});continue}N({type:"text",value:z});continue}if(z!=="*"){(z==="$"||z==="^")&&(z=`\\${z}`);const Z=s.exec(xe());Z&&(z+=Z[0],ne.index+=Z[0].length),N({type:"text",value:z});continue}if(se&&(se.type==="globstar"||se.star===!0)){se.type="star",se.star=!0,se.value+=z,se.output=ye,ne.backtrack=!0,ne.globstar=!0,_e(z);continue}let B=xe();if(d.noextglob!==!0&&/^\([^?]/.test(B)){oe("star",z);continue}if(se.type==="star"){if(d.noglobstar===!0){_e(z);continue}const Z=se.prev,ce=Z.prev,ve=Z.type==="slash"||Z.type==="bos",$e=ce&&(ce.type==="star"||ce.type==="globstar");if(d.bash===!0&&(!ve||B[0]&&B[0]!=="/")){N({type:"star",value:z,output:""});continue}const Ie=ne.braces>0&&(Z.type==="comma"||Z.type==="brace"),je=Be.length&&(Z.type==="pipe"||Z.type==="paren");if(!ve&&Z.type!=="paren"&&!Ie&&!je){N({type:"star",value:z,output:""});continue}for(;B.slice(0,3)==="/**";){const Pe=w[ne.index+4];if(Pe&&Pe!=="/")break;B=B.slice(3),_e("/**",3)}if(Z.type==="bos"&&Ae()){se.type="globstar",se.value+=z,se.output=pe(d),ne.output=se.output,ne.globstar=!0,_e(z);continue}if(Z.type==="slash"&&Z.prev.type!=="bos"&&!$e&&Ae()){ne.output=ne.output.slice(0,-(Z.output+se.output).length),Z.output=`(?:${Z.output}`,se.type="globstar",se.output=pe(d)+(d.strictSlashes?")":"|$)"),se.value+=z,ne.globstar=!0,ne.output+=Z.output+se.output,_e(z);continue}if(Z.type==="slash"&&Z.prev.type!=="bos"&&B[0]==="/"){const Pe=B[1]!==void 0?"|$":"";ne.output=ne.output.slice(0,-(Z.output+se.output).length),Z.output=`(?:${Z.output}`,se.type="globstar",se.output=`${pe(d)}${re}|${re}${Pe})`,se.value+=z,ne.output+=Z.output+se.output,ne.globstar=!0,_e(z+be()),N({type:"slash",value:"/",output:""});continue}if(Z.type==="bos"&&B[0]==="/"){se.type="globstar",se.value+=z,se.output=`(?:^|${re}|${pe(d)}${re})`,ne.output=se.output,ne.globstar=!0,_e(z+be()),N({type:"slash",value:"/",output:""});continue}ne.output=ne.output.slice(0,-se.output.length),se.type="globstar",se.output=pe(d),se.value+=z,ne.output+=se.output,ne.globstar=!0,_e(z);continue}const fe={type:"star",value:z,output:ye};if(d.bash===!0){fe.output=".*?",(se.type==="bos"||se.type==="slash")&&(fe.output=Fe+fe.output),N(fe);continue}if(se&&(se.type==="bracket"||se.type==="paren")&&d.regex===!0){fe.output=z,N(fe);continue}(ne.index===ne.start||se.type==="slash"||se.type==="dot")&&(se.type==="dot"?(ne.output+=ae,se.output+=ae):d.dot===!0?(ne.output+=ue,se.output+=ue):(ne.output+=Fe,se.output+=Fe),Ee()!=="*"&&(ne.output+=he,se.output+=he)),N(fe)}for(;ne.brackets>0;){if(d.strictBrackets===!0)throw new SyntaxError(f("closing","]"));ne.output=e.escapeLast(ne.output,"["),L("brackets")}for(;ne.parens>0;){if(d.strictBrackets===!0)throw new SyntaxError(f("closing",")"));ne.output=e.escapeLast(ne.output,"("),L("parens")}for(;ne.braces>0;){if(d.strictBrackets===!0)throw new SyntaxError(f("closing","}"));ne.output=e.escapeLast(ne.output,"{"),L("braces")}if(d.strictSlashes!==!0&&(se.type==="star"||se.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${re}?`}),ne.backtrack===!0){ne.output="";for(const B of ne.tokens)ne.output+=B.output!=null?B.output:B.value,B.suffix&&(ne.output+=B.suffix)}return ne};return E.fastpaths=(w,y)=>{const d={...y},H=typeof d.maxLength=="number"?Math.min(t,d.maxLength):t,Q=w.length;if(Q>H)throw new SyntaxError(`Input length: ${Q}, exceeds maximum allowed length: ${H}`);w=o[w]||w;const W=e.isWindows(y),{DOT_LITERAL:_,SLASH_LITERAL:U,ONE_CHAR:te,DOTS_SLASH:T,NO_DOT:X,NO_DOTS:K,NO_DOTS_SLASH:le,STAR:re,START_ANCHOR:he}=i.globChars(W),De=d.dot?K:X,ge=d.dot?le:X,ae=d.capture?"":"?:",ue={negated:!1,prefix:""};let ee=d.bash===!0?".*?":re;d.capture&&(ee=`(${ee})`);const de=Fe=>Fe.noglobstar===!0?ee:`(${ae}(?:(?!${he}${Fe.dot?T:_}).)*?)`,me=Fe=>{switch(Fe){case"*":return`${De}${te}${ee}`;case".*":return`${_}${te}${ee}`;case"*.*":return`${De}${ee}${_}${te}${ee}`;case"*/*":return`${De}${ee}${U}${te}${ge}${ee}`;case"**":return De+de(d);case"**/*":return`(?:${De}${de(d)}${U})?${ge}${te}${ee}`;case"**/*.*":return`(?:${De}${de(d)}${U})?${ge}${ee}${_}${te}${ee}`;case"**/.*":return`(?:${De}${de(d)}${U})?${_}${te}${ee}`;default:{const Oe=/^(.*?)\.(\w+)$/.exec(Fe);if(!Oe)return;const ye=me(Oe[1]);return ye?ye+_+Oe[2]:void 0}}},we=e.removePrefix(w,ue);let pe=me(we);return pe&&d.strictSlashes!==!0&&(pe+=`${U}?`),pe},parse_1=E,parse_1}var picomatch_1,hasRequiredPicomatch$1;function requirePicomatch$1(){if(hasRequiredPicomatch$1)return picomatch_1;hasRequiredPicomatch$1=1;const i=require$$0__default$1,e=requireScan(),t=requireParse(),n=requireUtils(),s=requireConstants(),a=l=>l&&typeof l=="object"&&!Array.isArray(l),o=(l,f,E=!1)=>{if(Array.isArray(l)){const U=l.map(T=>o(T,f,E));return T=>{for(const X of U){const K=X(T);if(K)return K}return!1}}const w=a(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!w)throw new TypeError("Expected pattern to be a non-empty string");const y=f||{},d=n.isWindows(f),H=w?o.compileRe(l,f):o.makeRe(l,f,!1,!0),Q=H.state;delete H.state;let W=()=>!1;if(y.ignore){const U={...f,ignore:null,onMatch:null,onResult:null};W=o(y.ignore,U,E)}const _=(U,te=!1)=>{const{isMatch:T,match:X,output:K}=o.test(U,H,f,{glob:l,posix:d}),le={glob:l,state:Q,regex:H,posix:d,input:U,output:K,match:X,isMatch:T};return typeof y.onResult=="function"&&y.onResult(le),T===!1?(le.isMatch=!1,te?le:!1):W(U)?(typeof y.onIgnore=="function"&&y.onIgnore(le),le.isMatch=!1,te?le:!1):(typeof y.onMatch=="function"&&y.onMatch(le),te?le:!0)};return E&&(_.state=Q),_};return o.test=(l,f,E,{glob:w,posix:y}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const d=E||{},H=d.format||(y?n.toPosixSlashes:null);let Q=l===w,W=Q&&H?H(l):l;return Q===!1&&(W=H?H(l):l,Q=W===w),(Q===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?Q=o.matchBase(l,f,E,y):Q=f.exec(W)),{isMatch:!!Q,match:Q,output:W}},o.matchBase=(l,f,E,w=n.isWindows(E))=>(f instanceof RegExp?f:o.makeRe(f,E)).test(i.basename(l)),o.isMatch=(l,f,E)=>o(f,E)(l),o.parse=(l,f)=>Array.isArray(l)?l.map(E=>o.parse(E,f)):t(l,{...f,fastpaths:!1}),o.scan=(l,f)=>e(l,f),o.compileRe=(l,f,E=!1,w=!1)=>{if(E===!0)return l.output;const y=f||{},d=y.contains?"":"^",H=y.contains?"":"$";let Q=`${d}(?:${l.output})${H}`;l&&l.negated===!0&&(Q=`^(?!${Q}).*$`);const W=o.toRegex(Q,f);return w===!0&&(W.state=l),W},o.makeRe=(l,f={},E=!1,w=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let y={negated:!1,fastpaths:!0};return f.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(y.output=t.fastpaths(l,f)),y.output||(y=t(l,f)),o.compileRe(y,f,E,w)},o.toRegex=(l,f)=>{try{const E=f||{};return new RegExp(l,E.flags||(E.nocase?"i":""))}catch(E){if(f&&f.debug===!0)throw E;return/$^/}},o.constants=s,picomatch_1=o,picomatch_1}var picomatch,hasRequiredPicomatch;function requirePicomatch(){return hasRequiredPicomatch||(hasRequiredPicomatch=1,picomatch=requirePicomatch$1()),picomatch}var micromatch_1,hasRequiredMicromatch;function requireMicromatch(){if(hasRequiredMicromatch)return micromatch_1;hasRequiredMicromatch=1;const i=require$$0__default,e=requireBraces(),t=requirePicomatch(),n=requireUtils(),s=l=>l===""||l==="./",a=l=>{const f=l.indexOf("{");return f>-1&&l.indexOf("}",f)>-1},o=(l,f,E)=>{f=[].concat(f),l=[].concat(l);let w=new Set,y=new Set,d=new Set,H=0,Q=U=>{d.add(U.output),E&&E.onResult&&E.onResult(U)};for(let U=0;U<f.length;U++){let te=t(String(f[U]),{...E,onResult:Q},!0),T=te.state.negated||te.state.negatedExtglob;T&&H++;for(let X of l){let K=te(X,!0);(T?!K.isMatch:K.isMatch)&&(T?w.add(K.output):(w.delete(K.output),y.add(K.output)))}}let _=(H===f.length?[...d]:[...y]).filter(U=>!w.has(U));if(E&&_.length===0){if(E.failglob===!0)throw new Error(`No matches found for "${f.join(", ")}"`);if(E.nonull===!0||E.nullglob===!0)return E.unescape?f.map(U=>U.replace(/\\/g,"")):f}return _};return o.match=o,o.matcher=(l,f)=>t(l,f),o.isMatch=(l,f,E)=>t(f,E)(l),o.any=o.isMatch,o.not=(l,f,E={})=>{f=[].concat(f).map(String);let w=new Set,y=[],d=Q=>{E.onResult&&E.onResult(Q),y.push(Q.output)},H=new Set(o(l,f,{...E,onResult:d}));for(let Q of y)H.has(Q)||w.add(Q);return[...w]},o.contains=(l,f,E)=>{if(typeof l!="string")throw new TypeError(`Expected a string: "${i.inspect(l)}"`);if(Array.isArray(f))return f.some(w=>o.contains(l,w,E));if(typeof f=="string"){if(s(l)||s(f))return!1;if(l.includes(f)||l.startsWith("./")&&l.slice(2).includes(f))return!0}return o.isMatch(l,f,{...E,contains:!0})},o.matchKeys=(l,f,E)=>{if(!n.isObject(l))throw new TypeError("Expected the first argument to be an object");let w=o(Object.keys(l),f,E),y={};for(let d of w)y[d]=l[d];return y},o.some=(l,f,E)=>{let w=[].concat(l);for(let y of[].concat(f)){let d=t(String(y),E);if(w.some(H=>d(H)))return!0}return!1},o.every=(l,f,E)=>{let w=[].concat(l);for(let y of[].concat(f)){let d=t(String(y),E);if(!w.every(H=>d(H)))return!1}return!0},o.all=(l,f,E)=>{if(typeof l!="string")throw new TypeError(`Expected a string: "${i.inspect(l)}"`);return[].concat(f).every(w=>t(w,E)(l))},o.capture=(l,f,E)=>{let w=n.isWindows(E),d=t.makeRe(String(l),{...E,capture:!0}).exec(w?n.toPosixSlashes(f):f);if(d)return d.slice(1).map(H=>H===void 0?"":H)},o.makeRe=(...l)=>t.makeRe(...l),o.scan=(...l)=>t.scan(...l),o.parse=(l,f)=>{let E=[];for(let w of[].concat(l||[]))for(let y of e(String(w),f))E.push(t.parse(y,f));return E},o.braces=(l,f)=>{if(typeof l!="string")throw new TypeError("Expected a string");return f&&f.nobrace===!0||!a(l)?[l]:e(l,f)},o.braceExpand=(l,f)=>{if(typeof l!="string")throw new TypeError("Expected a string");return o.braces(l,{...f,expand:!0})},o.hasBraces=a,micromatch_1=o,micromatch_1}var micromatchExports=requireMicromatch();const micromatch=LikeC4.h(micromatchExports),defaultConfig={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};function replaceScript(i,e,t,n=!1){const s=new RegExp(`<script([^>]*?) src="[./]*${e}"([^>]*)></script>`),a=/"?__VITE_PRELOAD__"?/g,o=t.replace(a,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),l=i.replace(s,(f,E,w)=>`<script${E}${w}>${o.trim()}</script>`);return n?_removeViteModuleLoader(l):l}function replaceCss(i,e,t){const n=new RegExp(`<link([^>]*?) href="[./]*${e}"([^>]*?)>`),s=t.replace('@charset "UTF-8";',"");return i.replace(n,(o,l,f)=>`<style${l}${f}>${s.trim()}</style>`)}const isJsFile=/\.[mc]?js$/,isCssFile=/\.css$/,isHtmlFile=/\.html?$/;function viteSingleFile({useRecommendedBuildConfig:i=!0,removeViteModuleLoader:e=!1,inlinePattern:t=[],deleteInlinedFiles:n=!0}=defaultConfig){function s(a){console.debug(`NOTE: asset not inlined: ${a}`)}return{name:"vite:singlefile",config:i?_useRecommendedBuildConfig:void 0,enforce:"post",generateBundle:(a,o)=>{console.debug(`
415
+ `);const l={html:[],css:[],js:[],other:[]};for(const E of Object.keys(o))isHtmlFile.test(E)?l.html.push(E):isCssFile.test(E)?l.css.push(E):isJsFile.test(E)?l.js.push(E):l.other.push(E);const f=[];for(const E of l.html){const w=o[E];let y=w.source;for(const d of l.js){if(t.length&&!micromatch.isMatch(d,t)){s(d);continue}const H=o[d];H.code!=null&&(console.debug(`Inlining: ${d}`),f.push(d),y=replaceScript(y,H.fileName,H.code,e))}for(const d of l.css){if(t.length&&!micromatch.isMatch(d,t)){s(d);continue}const H=o[d];console.debug(`Inlining: ${d}`),f.push(d),y=replaceCss(y,H.fileName,H.source)}w.source=y}if(n)for(const E of f)delete o[E];for(const E of l.other)s(E)}}}const _removeViteModuleLoader=i=>i.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),_useRecommendedBuildConfig=i=>{i.build||(i.build={}),i.build.assetsInlineLimit=()=>!0,i.build.chunkSizeWarningLimit=1e8,i.build.cssCodeSplit=!1,i.base="./",i.build.assetsDir="",i.build.rollupOptions||(i.build.rollupOptions={}),i.build.rollupOptions.output||(i.build.rollupOptions.output={});const e=t=>{t.inlineDynamicImports=!0};if(Array.isArray(i.build.rollupOptions.output))for(const t of i.build.rollupOptions.output)e(t);else e(i.build.rollupOptions.output)},viteConfig=async({languageServices:i,likec4AssetsDir:e,...t})=>{const n=t.customLogger??LikeC4.j("c4:vite"),s=viteAppRoot(),a=t?.useOverviewGraph===!0;n.info(`${LikeC4.p.cyan("likec4 app root")} ${LikeC4.p.dim(s)}`);const o=t.outputDir??path$1.resolve(i.workspace,"dist");n.info(LikeC4.p.cyan("output")+" "+LikeC4.p.dim(o));let l="/";t.base&&(l=LikeC4.w(t.base),!LikeC4.k(l)&&l!=="./"&&(l=LikeC4.m(l))),l!=="/"&&n.info(`${LikeC4.p.green("app base url")} ${LikeC4.p.dim(l)}`);const f=t.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:e,webcomponentPrefix:f,root:s,languageServices:i,clearScreen:!1,base:l,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...viteAliases(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{force:!0,include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(f),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:a?"true":"false",__USE_HASH_HISTORY__:t?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[c__default(),likec4Plugin({languageServices:i,useOverviewGraph:a})].concat(t.outputSingleFile?[viteSingleFile()]:[])}};async function viteWebcomponentConfig({languageServices:i,outDir:e,base:t,webcomponentPrefix:n="likec4",filename:s="likec4-views.js"}){const a=LikeC4.j("c4:lib"),o=viteAppRoot();return a.info(LikeC4.p.cyan("outDir")+" "+LikeC4.p.dim(e)),{root:o,clearScreen:!1,base:t,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...JsBanners},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit,lib:{entry:"webcomponent/webcomponent.js",fileName(l,f){return s},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{defaultIsModuleExports:l=>l.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:a,plugins:[likec4Plugin({languageServices:i,useOverviewGraph:!1})]}}const Assets=["favicon.ico","robots.txt"],viteBuild=async({buildWebcomponent:i=!0,webcomponentPrefix:e="likec4",languageServices:t,likec4AssetsDir:n,outputSingleFile:s,...a})=>{n??=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-"));const{isDev:o,...l}=await viteConfig({...a,languageServices:t,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:s}),f=await mkTempPublicDir();for(const w of Assets){const y=path$1.resolve(l.root,w);fs.existsSync(y)&&fs.copyFileSync(y,path$1.resolve(f,w))}const E=await t.diagrams();if(E.length===0)throw process.exitCode=1,new Error("no views found");if(E.forEach(w=>{w.hasLayoutDrift&&l.customLogger.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(w.id))}),i){const w=await viteWebcomponentConfig({webcomponentPrefix:e,languageServices:t,outDir:f,base:l.base});await vite.build(w)}if(await vite.build({...l,publicDir:f,mode:"production"}),s)for(let w of fs.readdirSync(path$1.resolve(l.build.outDir)).filter(y=>y!=="index.html"))fs.rmSync(path$1.resolve(l.build.outDir,w),{recursive:!0});else{const w=path$1.resolve(l.build.outDir,"index.html");fs.existsSync(w)&&fs.copyFileSync(w,path$1.resolve(l.build.outDir,"404.html"))}};function resolveServerUrl(i){if(i.resolvedUrls)return LikeC4.o(i.resolvedUrls.network)??LikeC4.o(i.resolvedUrls.local)}function printServerUrls(i){if(!i.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");LikeC4.H.box([LikeC4.p.green("LikeC4 served at:"),"",LikeC4.p.dim("Local: ")+i.resolvedUrls.local.join(`
414
416
  `+"".padEnd(9," ")),LikeC4.p.dim("Network: ")+i.resolvedUrls.network.join(`
415
417
  `+"".padEnd(9," "))].join(`
416
- `))}class Locked extends Error{constructor(e){super(`${e} is locked`)}}const lockedPorts={old:new Set,young:new Set},releaseOldLockedPortsIntervalMs=1e3*15,minPort=1024,maxPort=65535;let timeout;const getLocalHosts=()=>{const i=os__default.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const t of Object.values(i))for(const n of t)e.add(n.address);return e},checkAvailablePort=i=>new Promise((e,t)=>{const n=net__default.createServer();n.unref(),n.on("error",t),n.listen(i,()=>{const{port:s}=n.address();n.close(()=>{e(s)})})}),getAvailablePort=async(i,e)=>{if(i.host||i.port===0)return checkAvailablePort(i);for(const t of e)try{await checkAvailablePort({port:i.port,host:t})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return i.port},portCheckSequence=function*(i){i&&(yield*i),yield 0};async function getPorts(i){let e,t=new Set;if(i&&(i.port&&(e=typeof i.port=="number"?[i.port]:i.port),i.exclude)){const s=i.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const o of s){if(typeof o!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(o))throw new TypeError(`Number ${o} in the exclude option is not a safe integer and can't be used`)}t=new Set(s)}timeout===void 0&&(timeout=setTimeout(()=>{timeout=void 0,lockedPorts.old=lockedPorts.young,lockedPorts.young=new Set},releaseOldLockedPortsIntervalMs),timeout.unref&&timeout.unref());const n=getLocalHosts();for(const s of portCheckSequence(e))try{if(t.has(s))continue;let o=await getAvailablePort({...i,port:s},n);for(;lockedPorts.old.has(o)||lockedPorts.young.has(o);){if(s!==0)throw new Locked(s);o=await getAvailablePort({...i,port:s},n)}return lockedPorts.young.add(o),o}catch(o){if(!["EADDRINUSE","EACCES"].includes(o.code)&&!(o instanceof Locked))throw o}throw new Error("No available ports found")}function portNumbers(i,e){if(!Number.isInteger(i)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(i<minPort||i>maxPort)throw new RangeError(`'from' must be between ${minPort} and ${maxPort}`);if(e<minPort||e>maxPort)throw new RangeError(`'to' must be between ${minPort} and ${maxPort}`);if(i>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,s){for(let o=n;o<=s;o++)yield o}(i,e)}async function viteDev({buildWebcomponent:i=!0,hmr:e=!0,webcomponentPrefix:t="likec4",languageServices:n,likec4AssetsDir:s,openBrowser:o,...a}){s??=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-"));const{isDev:l,...d}=await viteConfig({...a,languageServices:n,likec4AssetsDir:s,webcomponentPrefix:t}),B=await getPorts({port:[5173,...portNumbers(61e3,61010),...portNumbers(62002,62010)]}),w=await getPorts({port:portNumbers(24678,24690)}),E=await mkTempPublicDir();let _;if(i){const H=await viteWebcomponentConfig({webcomponentPrefix:t,languageServices:n,outDir:E,base:d.base});_=vite.build({...H,logLevel:"warn"}).catch(W=>(LikeC4.H.warn("webcomponent build failed",W),LikeC4.H.warn("Ignoring error and continuing"),Promise.resolve()))}const U=await vite.createServer({...d,define:Object.assign({},d.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":d.mode,publicDir:E,server:{host:"0.0.0.0",port:B,hmr:e&&{overlay:!0,port:w},fs:{strict:!1},open:o??!l}});return await U.listen(),_&&await _,U}async function takeScreenshot({browserContext:i,views:e,output:t,logger:n,timeout:s,maxAttempts:o,outputType:a,theme:l}){let d;const B=e.map(_=>({view:_,attempt:1})),w=[];let E;for(;E=B.shift();){const{view:_,attempt:U}=E,H=`/export/${encodeURIComponent(_.id)}`;try{if(U>1){d&&(d.close({runBeforeUnload:!0}).catch(ae=>n.error(`failed to close page: ${ae}`)),d=void 0);const ee=LikeC4.u(U*200,{min:200,max:1e3});n.info(LikeC4.p.cyan(H)+LikeC4.p.dim(` attempt ${U} of ${o} after ${ee}ms`)),await promises.setTimeout(ee)}else _.hasLayoutDrift&&n.warn(LikeC4.p.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+LikeC4.p.red(_.id)),n.info(LikeC4.p.cyan(H));d??=await i.newPage(),await d.setViewportSize({width:_.bounds.width+20*2,height:_.bounds.height+20*2}),await d.goto(H+`?padding=20&theme=${l}`);const W=d.getByRole("presentation");await W.waitFor(),_.nodes.some(ee=>LikeC4.d(ee.icon)&&ee.icon.toLowerCase().startsWith("http"))&&await I(d,s);let L=".";a==="relative"&&(L=_.relativePath??".",L.includes("/")?L=L.slice(0,L.lastIndexOf("/")):L=".");const K=path$1.resolve(t,L,`${_.id}.png`);await W.screenshot({path:K,omitBackground:!0}),w.push({view:_,path:K})}catch(W){d?.close({runBeforeUnload:!0}).catch(L=>n.error(`failed to close page: ${L}`)),n.error(LikeC4.p.red("failed "+H+`
417
- `+W)),U<o&&(B.push({view:_,attempt:U+1}),n.info(LikeC4.p.dim(`retry ${H}`))),d=void 0}}return w}async function I(i,e){let t=await i.locator("//img").all();if(!t.length)return;const n=t.map(s=>s.evaluate(o=>o.complete||new Promise((a,l)=>{o.onload=a,o.onerror=l}),{timeout:Math.max(3e4,e)}));await Promise.allSettled(n)}async function exportViewsToPNG({logger:i,serverUrl:e,theme:t="light",timeoutMs:n=15e3,views:s,output:o,outputType:a="relative",maxAttempts:l=3}){i.info(`${LikeC4.p.cyan("export output")} ${LikeC4.p.dim(o)}`),i.info(`${LikeC4.p.cyan("from server")} ${LikeC4.p.dim(e)}`);const d=playwright.chromium.executablePath();i.info(LikeC4.p.cyan("Start chromium")),i.info(LikeC4.p.dim(d));const B=await playwright.chromium.launch();i.info(LikeC4.p.cyan("Color scheme: ")+t);const w=await B.newContext({deviceScaleFactor:2,colorScheme:t,baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",isMobile:!1});w.setDefaultNavigationTimeout(n),w.setDefaultTimeout(n);try{return await takeScreenshot({browserContext:w,views:s,output:o,outputType:a,logger:i,maxAttempts:l,timeout:n,theme:t})}finally{i.info(LikeC4.p.cyan("close chromium")),await w.close(),await B.close()}}async function pngHandler({path:i,useDotBin:e,theme:t="light",output:n,outputType:s,serverUrl:o,ignore:a=!1,timeoutMs:l=1e4,maxAttempts:d=3}){const B=LikeC4.h("c4:export"),w=process$1.hrtime(),E=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n??=E.workspace;const _=await E.diagrams();if(!core.hasAtLeast(_,1))throw B.warn("no views found"),new Error("no views found");let U;if(!o&&(B.info(LikeC4.p.cyan("start preview server")),U=await viteDev({languageServices:E,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),o=resolveServerUrl(U),!o))throw B.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const H=await exportViewsToPNG({logger:B,serverUrl:o,theme:t,timeoutMs:l,views:_,output:n,outputType:s,maxAttempts:d}),{pretty:W}=LikeC4.o(w);if(H.length>0&&B.info(LikeC4.p.green(`exported ${H.length} views in ${W}`)),H.length!==_.length&&(a&&H.length>0?B.info(LikeC4.p.dim("ignore")+" "+LikeC4.p.red(`failed ${_.length-H.length} out of ${_.length} views`)):B.error(LikeC4.p.red(`failed ${_.length-H.length} out of ${_.length} views`))),H.length!==_.length&&(H.length===0||!a))throw new Error(`Failed ${_.length-H.length} out of ${_.length} views`)}finally{U&&(B.info(LikeC4.p.cyan("stop server")),await U.close().catch(H=>{B.error(H)}))}}const{cyan:p,dim:f}=LikeC4.p;async function buildHandler({path:i,useDotBin:e,useHashHistory:t,webcomponentPrefix:n,useOverview:s=!1,output:o,base:a}){const l=LikeC4.h("c4:build"),d=await LikeC4.L.fromWorkspace(i,{graphviz:e?"binary":"wasm",logger:"vite"}),B=o??path$1.resolve(d.workspace,"dist");let w=path$1.resolve(B,"assets");if(s)try{w=path$1.resolve(B,"assets","previews"),await fsPromises.mkdir(w,{recursive:!0}),l.info(`${p("Generate previews")} ${f(w)}
418
- `),await pngHandler({path:i,useDotBin:e,output:w,outputType:"flat",ignore:!0})}catch(E){l.error(LikeC4.p.red("Failed to generate previews")),l.error(E),l.warn(LikeC4.p.yellow("Ignore previews and continue build")),fs.rmSync(w,{recursive:!0,force:!0}),s=!1}await viteBuild({base:a,useHashHistory:t,customLogger:l,useOverviewGraph:s,webcomponentPrefix:n,languageServices:d,likec4AssetsDir:w,outputDir:o}),s&&(l.info(`${p("clean previews")} ${f(w)}`),fs.rmSync(w,{recursive:!0,force:!0}))}const buildCmd={command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:i=>i.positional("path",path).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:path$1.resolve}).option("base",base).option("use-hash-history",useHashHistory).option("use-dot",useDotBin).option("webcomponent-prefix",webcomponentPrefix).option("use-overview",useOverview).example(`${LikeC4.p.green("$0 build -o ./build ./src")}`,LikeC4.p.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async i=>{await buildHandler({path:i.path,output:i.output,base:i.base,useHashHistory:i["use-hash-history"],useDotBin:i["use-dot"],useOverview:i["use-overview"]??!1,webcomponentPrefix:i["webcomponent-prefix"]})}};async function A(i,e,t){const n=".ts";e=e??path$1.resolve(i.workspace,"likec4.generated"+n),path$1.extname(e)!==n&&(e=e+n),await fsPromises.mkdir(path$1.dirname(e),{recursive:!0});const s=await i.diagrams(),o=J([...s]);await fsPromises.writeFile(e,o),t.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),e)}`)}async function D(i,e,t){await fsPromises.mkdir(e,{recursive:!0}),t.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("dot")}`),t.info(`${LikeC4.p.dim("outdir")} ${e}`);const n=new Set,s=await i.viewsService.layoutAllViews();let o=0;for(const{diagram:a,dot:l}of s)try{const d=a.relativePath??"";d!==""&&!n.has(d)&&(await fsPromises.mkdir(path$1.resolve(e,d),{recursive:!0}),n.add(d));const B=path$1.resolve(e,d,a.id+".dot");core.invariant(l,`dot for ${a.id} not found`),await fsPromises.writeFile(B,l),t.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),B)}`),o++}catch(d){t.error(`error while generating ${a.id}`,{error:d})}o>0&&t.info(`${LikeC4.p.dim("total")} ${o} files`)}async function F(i,e,t,n){await fsPromises.mkdir(t,{recursive:!0}),n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green(e)}`),n.info(`${LikeC4.p.dim("outdir")} ${t}`);let s,o;switch(e){case"d2":s=".d2",o=P$1;break;case"mermaid":s=".mmd",o=S;break;default:core.nonexhaustive(e)}const a=new Set,l=await i.diagrams();let d=0;for(const B of l)try{let w=B.relativePath??".";w.includes("/")?w=w.slice(0,w.lastIndexOf("/")):w=".",w!==""&&!a.has(w)&&(await fsPromises.mkdir(path$1.resolve(t,w),{recursive:!0}),a.add(w));const E=path$1.resolve(t,w,B.id+s),_=o(B);await fsPromises.writeFile(E,_),n.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),E)}`),d++}catch(w){n.error(`error while generating ${B.id}`,{error:w})}d>0&&n.info(`${LikeC4.p.dim("total")} ${d} files`)}async function legacyHandler({path:i,useDotBin:e,...t}){const n=LikeC4.h("c4:codegen"),s=LikeC4.s(n),o=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});if((await o.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(t.format){case"views":{await A(o,t.outfile,n);break}case"dot":{await D(o,t.outdir??i,n);break}case"d2":case"mermaid":{await F(o,t.format,t.outdir??i,n);break}default:core.nonexhaustive(t)}s.stopAndLog()}async function modelHandler({path:i,useDotBin:e,outfile:t}){const n=LikeC4.h("c4:codegen"),s=LikeC4.s(n),o=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("model")}`);const a=await o.layoutedModel();for(const E of a.views())E.$view.hasLayoutDrift&&n.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(E.id));let l=path$1.resolve(o.workspace,"likec4-model.ts");if(t&&(l=path$1.isAbsolute(t)?t:path$1.resolve(t),fs.existsSync(t)&&(await fsPromises.stat(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const d=path$1.basename(l);n.info(`${LikeC4.p.dim("filename")} ${d}`);const B=path$1.extname(d).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(B))throw n.error(`output file ${t} has extension "${B}"`),new Error(`output file ${t} must be a .ts, .mts or .cts file`);const w=path$1.dirname(l);n.info(`${LikeC4.p.dim("outdir")} ${w}`),await fsPromises.mkdir(w,{recursive:!0}),await fsPromises.writeFile(l,q(a),{encoding:"utf-8"}),LikeC4.H.box({message:LikeC4.q(`
418
+ `))}class Locked extends Error{constructor(e){super(`${e} is locked`)}}const lockedPorts={old:new Set,young:new Set},releaseOldLockedPortsIntervalMs=1e3*15,minPort=1024,maxPort=65535;let timeout;const getLocalHosts=()=>{const i=os__default.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const t of Object.values(i))for(const n of t)e.add(n.address);return e},checkAvailablePort=i=>new Promise((e,t)=>{const n=net__default.createServer();n.unref(),n.on("error",t),n.listen(i,()=>{const{port:s}=n.address();n.close(()=>{e(s)})})}),getAvailablePort=async(i,e)=>{if(i.host||i.port===0)return checkAvailablePort(i);for(const t of e)try{await checkAvailablePort({port:i.port,host:t})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return i.port},portCheckSequence=function*(i){i&&(yield*i),yield 0};async function getPorts(i){let e,t=new Set;if(i&&(i.port&&(e=typeof i.port=="number"?[i.port]:i.port),i.exclude)){const s=i.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const a of s){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding 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`)}t=new Set(s)}timeout===void 0&&(timeout=setTimeout(()=>{timeout=void 0,lockedPorts.old=lockedPorts.young,lockedPorts.young=new Set},releaseOldLockedPortsIntervalMs),timeout.unref&&timeout.unref());const n=getLocalHosts();for(const s of portCheckSequence(e))try{if(t.has(s))continue;let a=await getAvailablePort({...i,port:s},n);for(;lockedPorts.old.has(a)||lockedPorts.young.has(a);){if(s!==0)throw new Locked(s);a=await getAvailablePort({...i,port:s},n)}return lockedPorts.young.add(a),a}catch(a){if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof Locked))throw a}throw new Error("No available ports found")}function portNumbers(i,e){if(!Number.isInteger(i)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(i<minPort||i>maxPort)throw new RangeError(`'from' must be between ${minPort} and ${maxPort}`);if(e<minPort||e>maxPort)throw new RangeError(`'to' must be between ${minPort} and ${maxPort}`);if(i>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,s){for(let a=n;a<=s;a++)yield a}(i,e)}async function viteDev({buildWebcomponent:i=!0,hmr:e=!0,webcomponentPrefix:t="likec4",languageServices:n,likec4AssetsDir:s,openBrowser:a,...o}){s??=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-"));const{isDev:l,...f}=await viteConfig({...o,languageServices:n,likec4AssetsDir:s,webcomponentPrefix:t}),E=await getPorts({port:[5173,...portNumbers(61e3,61010),...portNumbers(62002,62010)]}),w=await getPorts({port:portNumbers(24678,24690)}),y=await mkTempPublicDir();let d;if(i){const Q=await viteWebcomponentConfig({webcomponentPrefix:t,languageServices:n,outDir:y,base:f.base});d=vite.build({...Q,logLevel:"warn"}).catch(W=>(LikeC4.H.warn("webcomponent build failed",W),LikeC4.H.warn("Ignoring error and continuing"),Promise.resolve()))}const H=await vite.createServer({...f,define:Object.assign({},f.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":f.mode,publicDir:y,server:{host:"0.0.0.0",port:E,hmr:e&&{overlay:!0,port:w},fs:{strict:!1},open:a??!l}});return await H.listen(),d&&await d,H}async function takeScreenshot({browserContext:i,views:e,output:t,logger:n,timeout:s,maxAttempts:a,outputType:o,theme:l}){let f;const E=e.map(d=>({view:d,attempt:1})),w=[];let y;for(;y=E.shift();){const{view:d,attempt:H}=y,Q=`/export/${encodeURIComponent(d.id)}`;try{if(H>1){f&&(f.close({runBeforeUnload:!0}).catch(T=>n.error(`failed to close page: ${T}`)),f=void 0);const te=LikeC4.u(H*200,{min:200,max:1e3});n.info(LikeC4.p.cyan(Q)+LikeC4.p.dim(` attempt ${H} of ${a} after ${te}ms`)),await promises.setTimeout(te)}else d.hasLayoutDrift&&n.warn(LikeC4.p.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+LikeC4.p.red(d.id)),n.info(LikeC4.p.cyan(Q));f??=await i.newPage(),await f.setViewportSize({width:d.bounds.width+20*2,height:d.bounds.height+20*2}),await f.goto(Q+`?padding=20&theme=${l}`);const W=f.getByRole("presentation");await W.waitFor(),d.nodes.some(te=>LikeC4.d(te.icon)&&te.icon.toLowerCase().startsWith("http"))&&await I(f,s);let _=".";o==="relative"&&(_=d.relativePath??".",_.includes("/")?_=_.slice(0,_.lastIndexOf("/")):_=".");const U=path$1.resolve(t,_,`${d.id}.png`);await W.screenshot({path:U,omitBackground:!0}),w.push({view:d,path:U})}catch(W){f?.close({runBeforeUnload:!0}).catch(_=>n.error(`failed to close page: ${_}`)),n.error(LikeC4.p.red("failed "+Q+`
419
+ `+W)),H<a&&(E.push({view:d,attempt:H+1}),n.info(LikeC4.p.dim(`retry ${Q}`))),f=void 0}}return w}async function I(i,e){let t=await i.locator("//img").all();if(!t.length)return;const n=t.map(s=>s.evaluate(a=>a.complete||new Promise((o,l)=>{a.onload=o,a.onerror=l}),{timeout:Math.max(3e4,e)}));await Promise.allSettled(n)}async function exportViewsToPNG({logger:i,serverUrl:e,theme:t="light",timeoutMs:n=15e3,views:s,output:a,outputType:o="relative",maxAttempts:l=3}){i.info(`${LikeC4.p.cyan("export output")} ${LikeC4.p.dim(a)}`),i.info(`${LikeC4.p.cyan("from server")} ${LikeC4.p.dim(e)}`);const f=playwright.chromium.executablePath();i.info(LikeC4.p.cyan("Start chromium")),i.info(LikeC4.p.dim(f));const E=await playwright.chromium.launch();i.info(LikeC4.p.cyan("Color scheme: ")+t);const w=await E.newContext({deviceScaleFactor:2,colorScheme:t,baseURL:e,ignoreHTTPSErrors:!0,reducedMotion:"reduce",isMobile:!1});w.setDefaultNavigationTimeout(n),w.setDefaultTimeout(n);try{return await takeScreenshot({browserContext:w,views:s,output:a,outputType:o,logger:i,maxAttempts:l,timeout:n,theme:t})}finally{i.info(LikeC4.p.cyan("close chromium")),await w.close(),await E.close()}}async function pngHandler({path:i,useDotBin:e,theme:t="light",output:n,outputType:s,serverUrl:a,ignore:o=!1,timeoutMs:l=1e4,maxAttempts:f=3}){const E=LikeC4.j("c4:export"),w=process$1.hrtime(),y=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n??=y.workspace;const d=await y.diagrams();if(!core.hasAtLeast(d,1))throw E.warn("no views found"),new Error("no views found");let H;if(!a&&(E.info(LikeC4.p.cyan("start preview server")),H=await viteDev({languageServices:y,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),a=resolveServerUrl(H),!a))throw E.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const Q=await exportViewsToPNG({logger:E,serverUrl:a,theme:t,timeoutMs:l,views:d,output:n,outputType:s,maxAttempts:f}),{pretty:W}=LikeC4.q(w);if(Q.length>0&&E.info(LikeC4.p.green(`exported ${Q.length} views in ${W}`)),Q.length!==d.length&&(o&&Q.length>0?E.info(LikeC4.p.dim("ignore")+" "+LikeC4.p.red(`failed ${d.length-Q.length} out of ${d.length} views`)):E.error(LikeC4.p.red(`failed ${d.length-Q.length} out of ${d.length} views`))),Q.length!==d.length&&(Q.length===0||!o))throw new Error(`Failed ${d.length-Q.length} out of ${d.length} views`)}finally{H&&(E.info(LikeC4.p.cyan("stop server")),await H.close().catch(Q=>{E.error(Q)}))}}const{cyan:m,dim:p}=LikeC4.p;async function buildHandler({path:i,useDotBin:e,useHashHistory:t,webcomponentPrefix:n,useOverview:s=!1,output:a,outputSingleFile:o,base:l}){const f=LikeC4.j("c4:build"),E=await LikeC4.L.fromWorkspace(i,{graphviz:e?"binary":"wasm",logger:"vite"}),w=a??path$1.resolve(E.workspace,"dist");let y=path$1.resolve(w,"assets");if(s)try{y=path$1.resolve(w,"assets","previews"),await fsPromises.mkdir(y,{recursive:!0}),f.info(`${m("Generate previews")} ${p(y)}
420
+ `),await pngHandler({path:i,useDotBin:e,output:y,outputType:"flat",ignore:!0})}catch(d){f.error(LikeC4.p.red("Failed to generate previews")),f.error(d),f.warn(LikeC4.p.yellow("Ignore previews and continue build")),fs.rmSync(y,{recursive:!0,force:!0}),s=!1}await viteBuild({base:l,useHashHistory:o||t,customLogger:f,useOverviewGraph:s,webcomponentPrefix:n,languageServices:E,likec4AssetsDir:y,outputDir:a,outputSingleFile:o}),s&&(f.info(`${m("clean previews")} ${p(y)}`),fs.rmSync(y,{recursive:!0,force:!0}))}const buildCmd={command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:i=>i.positional("path",path).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:path$1.resolve}).option("base",base).option("use-hash-history",useHashHistory).option("use-dot",useDotBin).option("webcomponent-prefix",webcomponentPrefix).option("use-overview",useOverview).option("output-single-file",outputSingleFile).example(`${LikeC4.p.green("$0 build -o ./build ./src")}`,LikeC4.p.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async i=>{await buildHandler({path:i.path,output:i.output,base:i.base,useHashHistory:i["use-hash-history"],useDotBin:i["use-dot"],useOverview:i["use-overview"]??!1,webcomponentPrefix:i["webcomponent-prefix"],outputSingleFile:i["output-single-file"]??!1})}};async function A(i,e,t){const n=".ts";e=e??path$1.resolve(i.workspace,"likec4.generated"+n),path$1.extname(e)!==n&&(e=e+n),await fsPromises.mkdir(path$1.dirname(e),{recursive:!0});const s=await i.diagrams(),a=J([...s]);await fsPromises.writeFile(e,a),t.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),e)}`)}async function D(i,e,t){await fsPromises.mkdir(e,{recursive:!0}),t.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("dot")}`),t.info(`${LikeC4.p.dim("outdir")} ${e}`);const n=new Set,s=await i.viewsService.layoutAllViews();let a=0;for(const{diagram:o,dot:l}of s)try{const f=o.relativePath??"";f!==""&&!n.has(f)&&(await fsPromises.mkdir(path$1.resolve(e,f),{recursive:!0}),n.add(f));const E=path$1.resolve(e,f,o.id+".dot");core.invariant(l,`dot for ${o.id} not found`),await fsPromises.writeFile(E,l),t.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),E)}`),a++}catch(f){t.error(`error while generating ${o.id}`,{error:f})}a>0&&t.info(`${LikeC4.p.dim("total")} ${a} files`)}async function F(i,e,t,n){await fsPromises.mkdir(t,{recursive:!0}),n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green(e)}`),n.info(`${LikeC4.p.dim("outdir")} ${t}`);let s,a;switch(e){case"d2":s=".d2",a=P$1;break;case"mermaid":s=".mmd",a=S;break;default:core.nonexhaustive(e)}const o=new Set,l=await i.diagrams();let f=0;for(const E of l)try{let w=E.relativePath??".";w.includes("/")?w=w.slice(0,w.lastIndexOf("/")):w=".",w!==""&&!o.has(w)&&(await fsPromises.mkdir(path$1.resolve(t,w),{recursive:!0}),o.add(w));const y=path$1.resolve(t,w,E.id+s),d=a(E);await fsPromises.writeFile(y,d),n.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),y)}`),f++}catch(w){n.error(`error while generating ${E.id}`,{error:w})}f>0&&n.info(`${LikeC4.p.dim("total")} ${f} files`)}async function legacyHandler({path:i,useDotBin:e,...t}){const n=LikeC4.j("c4:codegen"),s=LikeC4.s(n),a=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});if((await a.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(t.format){case"views":{await A(a,t.outfile,n);break}case"dot":{await D(a,t.outdir??i,n);break}case"d2":case"mermaid":{await F(a,t.format,t.outdir??i,n);break}default:core.nonexhaustive(t)}s.stopAndLog()}async function modelHandler({path:i,useDotBin:e,outfile:t}){const n=LikeC4.j("c4:codegen"),s=LikeC4.s(n),a=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("model")}`);const o=await a.layoutedModel();for(const y of o.views())y.$view.hasLayoutDrift&&n.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(y.id));let l=path$1.resolve(a.workspace,"likec4-model.ts");if(t&&(l=path$1.isAbsolute(t)?t:path$1.resolve(t),fs.existsSync(t)&&(await fsPromises.stat(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const f=path$1.basename(l);n.info(`${LikeC4.p.dim("filename")} ${f}`);const E=path$1.extname(f).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(E))throw n.error(`output file ${t} has extension "${E}"`),new Error(`output file ${t} must be a .ts, .mts or .cts file`);const w=path$1.dirname(l);n.info(`${LikeC4.p.dim("outdir")} ${w}`),await fsPromises.mkdir(w,{recursive:!0}),await fsPromises.writeFile(l,q(o),{encoding:"utf-8"}),LikeC4.H.box({message:LikeC4.r(`
419
421
  ${LikeC4.p.dim("Source with LikeC4Model generated:")}
420
422
  ${path$1.relative(process$1.cwd(),l)}
421
423
 
422
424
  ${LikeC4.p.dim("How to use:")}
423
425
  ${LikeC4.p.underline("https://likec4.dev/tooling/code-generation/model/")}
424
- `).trim(),style:{padding:2,borderColor:"green",borderStyle:"rounded"}}),s.stopAndLog()}async function viteReactConfig({languageServices:i,outDir:e,filename:t="likec4-react.mjs"}){const n=LikeC4.h("c4:react"),s=viteAppRoot();return n.info(`${LikeC4.p.cyan("likec4 app root")} ${LikeC4.p.dim(s)}`),n.info(LikeC4.p.cyan("outDir")+" "+LikeC4.p.dim(e)),{customLogger:n,root:s,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:viteAliases()},esbuild:{banner:`'use client'
425
- `+JsBanners.banner,footer:JsBanners.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,target:"es2022",copyPublicDir:!1,chunkSizeWarningLimit,lib:{entry:"react/likec4.tsx",fileName(o,a){return t},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(o,a){o.code!=="SOURCEMAP_ERROR"&&a(o)}}},plugins:[c__default({}),likec4Plugin({languageServices:i,useOverviewGraph:!1})]}}async function reactHandler({path:i,useDotBin:e,outfile:t}){const n=LikeC4.h("c4:codegen"),s=LikeC4.s(n),o=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("react")}`);const a=await o.diagrams();if(a.length===0)throw process.exitCode=1,new Error("no views found");a.forEach(U=>{U.hasLayoutDrift&&n.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(U.id))});let l=path$1.resolve(o.workspace,"likec4-views.js");if(t&&(l=path$1.isAbsolute(t)?t:path$1.resolve(t),fs.existsSync(t)&&(await fsPromises.stat(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const d=path$1.dirname(l);n.info(`${LikeC4.p.dim("outdir")} ${d}`);const B=path$1.basename(l);n.info(`${LikeC4.p.dim("filename")} ${B}`);const w=path$1.extname(B).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(w))throw n.error(`output file ${t} has extension "${w}"`),new Error(`output file ${t} must be a .js, .jsx or .mjs`);const E=await viteReactConfig({languageServices:o,outDir:d,filename:B});await vite.build({...E,logLevel:"warn"});const _=await o.layoutedModel();await fsPromises.writeFile(path$1.resolve(d,path$1.basename(l,w)+(w===".mjs"?".d.mts":".d.ts")),Y(_)),LikeC4.H.box({message:LikeC4.q(`
426
+ `).trim(),style:{padding:2,borderColor:"green",borderStyle:"rounded"}}),s.stopAndLog()}async function viteReactConfig({languageServices:i,outDir:e,filename:t="likec4-react.mjs"}){const n=LikeC4.j("c4:react"),s=viteAppRoot();return n.info(`${LikeC4.p.cyan("likec4 app root")} ${LikeC4.p.dim(s)}`),n.info(LikeC4.p.cyan("outDir")+" "+LikeC4.p.dim(e)),{customLogger:n,root:s,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:viteAliases()},esbuild:{banner:`'use client'
427
+ `+JsBanners.banner,footer:JsBanners.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,target:"es2022",copyPublicDir:!1,chunkSizeWarningLimit,lib:{entry:"react/likec4.tsx",fileName(a,o){return t},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(a,o){a.code!=="SOURCEMAP_ERROR"&&o(a)}}},plugins:[c__default({}),likec4Plugin({languageServices:i,useOverviewGraph:!1})]}}async function reactHandler({path:i,useDotBin:e,outfile:t}){const n=LikeC4.j("c4:codegen"),s=LikeC4.s(n),a=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("react")}`);const o=await a.diagrams();if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach(H=>{H.hasLayoutDrift&&n.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(H.id))});let l=path$1.resolve(a.workspace,"likec4-views.js");if(t&&(l=path$1.isAbsolute(t)?t:path$1.resolve(t),fs.existsSync(t)&&(await fsPromises.stat(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const f=path$1.dirname(l);n.info(`${LikeC4.p.dim("outdir")} ${f}`);const E=path$1.basename(l);n.info(`${LikeC4.p.dim("filename")} ${E}`);const w=path$1.extname(E).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(w))throw n.error(`output file ${t} has extension "${w}"`),new Error(`output file ${t} must be a .js, .jsx or .mjs`);const y=await viteReactConfig({languageServices:a,outDir:f,filename:E});await vite.build({...y,logLevel:"warn"});const d=await a.layoutedModel();await fsPromises.writeFile(path$1.resolve(f,path$1.basename(l,w)+(w===".mjs"?".d.mts":".d.ts")),Y(d)),LikeC4.H.box({message:LikeC4.r(`
426
428
  ${LikeC4.p.dim("Source generated:")}
427
429
  ${path$1.relative(process$1.cwd(),l)}
428
430
 
429
431
  ${LikeC4.p.dim("How to use:")}
430
432
  ${LikeC4.p.underline("https://likec4.dev/tooling/code-generation/react/")}
431
- `).trim(),style:{padding:2,borderColor:"green",borderStyle:"rounded"}}),s.stopAndLog()}async function webcomponentHandler({path:i,useDotBin:e,webcomponentPrefix:t="likec4",outfile:n}){const s=LikeC4.h("c4:codegen"),o=LikeC4.s(s),a=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});s.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("webcomponent")}`);const l=await a.diagrams();if(!LikeC4.r(l,1))throw s.warn("no views found"),process.exitCode=1,new Error("no views found");l.forEach(H=>{H.hasLayoutDrift&&s.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(H.id))});let d=path$1.resolve(a.workspace,"likec4-views.js");if(n&&(d=path$1.isAbsolute(n)?n:path$1.resolve(n),fs.existsSync(n)&&(await fsPromises.stat(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);LikeC4.H.debug(`${LikeC4.p.dim("outfilepath")} ${d}`);const B=path$1.basename(d);LikeC4.H.debug(`${LikeC4.p.dim("filename")} ${B}`);const w=path$1.extname(B).toLocaleLowerCase();if(w!==".js"&&w!==".mjs")throw LikeC4.H.warn(`output file ${n} has extension "${w}"`),new Error(`output file ${n} must be a .js or .mjs`);const E=await mkTempPublicDir();LikeC4.H.debug(`${LikeC4.p.dim("created temp public")} ${E}`);const _=await viteWebcomponentConfig({languageServices:a,outDir:E,filename:B,webcomponentPrefix:t,base:"/"});LikeC4.H.debug(`${LikeC4.p.dim("vite build webcomponent")}`),await vite.build({..._,logLevel:"warn"});const U=path$1.resolve(E,B);if(!fs.existsSync(U))throw new Error(`output file not found: ${U}`);await fsPromises.mkdir(path$1.dirname(d),{recursive:!0}),await fsPromises.copyFile(U,d),s.info(`${LikeC4.p.dim("generated")} ${d}`),LikeC4.H.debug(`${LikeC4.p.dim("remove temp public")}`),await fsPromises.rm(E,{recursive:!0,force:!0}),LikeC4.H.box(LikeC4.q(`
433
+ `).trim(),style:{padding:2,borderColor:"green",borderStyle:"rounded"}}),s.stopAndLog()}async function webcomponentHandler({path:i,useDotBin:e,webcomponentPrefix:t="likec4",outfile:n}){const s=LikeC4.j("c4:codegen"),a=LikeC4.s(s),o=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"});s.info(`${LikeC4.p.dim("format")} ${LikeC4.p.green("webcomponent")}`);const l=await o.diagrams();if(!LikeC4.v(l,1))throw s.warn("no views found"),process.exitCode=1,new Error("no views found");l.forEach(Q=>{Q.hasLayoutDrift&&s.warn(LikeC4.p.yellow("drift detected, manual layout can not be applied, view:")+" "+LikeC4.p.red(Q.id))});let f=path$1.resolve(o.workspace,"likec4-views.js");if(n&&(f=path$1.isAbsolute(n)?n:path$1.resolve(n),fs.existsSync(n)&&(await fsPromises.stat(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);LikeC4.H.debug(`${LikeC4.p.dim("outfilepath")} ${f}`);const E=path$1.basename(f);LikeC4.H.debug(`${LikeC4.p.dim("filename")} ${E}`);const w=path$1.extname(E).toLocaleLowerCase();if(w!==".js"&&w!==".mjs")throw LikeC4.H.warn(`output file ${n} has extension "${w}"`),new Error(`output file ${n} must be a .js or .mjs`);const y=await mkTempPublicDir();LikeC4.H.debug(`${LikeC4.p.dim("created temp public")} ${y}`);const d=await viteWebcomponentConfig({languageServices:o,outDir:y,filename:E,webcomponentPrefix:t,base:"/"});LikeC4.H.debug(`${LikeC4.p.dim("vite build webcomponent")}`),await vite.build({...d,logLevel:"warn"});const H=path$1.resolve(y,E);if(!fs.existsSync(H))throw new Error(`output file not found: ${H}`);await fsPromises.mkdir(path$1.dirname(f),{recursive:!0}),await fsPromises.copyFile(H,f),s.info(`${LikeC4.p.dim("generated")} ${f}`),LikeC4.H.debug(`${LikeC4.p.dim("remove temp public")}`),await fsPromises.rm(y,{recursive:!0,force:!0}),LikeC4.H.box(LikeC4.r(`
432
434
  ${LikeC4.p.dim("Webcomponents generated to:")}
433
- ${path$1.relative(process$1.cwd(),d)}
435
+ ${path$1.relative(process$1.cwd(),f)}
434
436
 
435
437
  ${LikeC4.p.dim("Setup and usage instructions:")}
436
438
  ${LikeC4.p.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
437
- `)),o.stopAndLog()}const codegenCmd={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:i=>i.positional("path",path).command("react [path]","generate react component to render likec4 view",e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),async e=>{await reactHandler({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:require$$0.resolve}).option("webcomponent-prefix",webcomponentPrefix).option("use-dot",useDotBin),handler:async e=>{await webcomponentHandler({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile,webcomponentPrefix:e.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),handler:async e=>{await modelHandler({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"views-data [path]",aliases:["views"],describe:"generate likec4 views data (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"views",path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"dot",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"d2",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"mermaid",useDotBin:e.useDotBin,path:e.path,outdir:e.outdir})}}).epilog(`${LikeC4.p.bold("Examples:")}
439
+ `)),a.stopAndLog()}const codegenCmd={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:i=>i.positional("path",path).command("react [path]","generate react component to render likec4 view",e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),async e=>{await reactHandler({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:require$$0.resolve}).option("webcomponent-prefix",webcomponentPrefix).option("use-dot",useDotBin),handler:async e=>{await webcomponentHandler({useDotBin:e.useDotBin,path:e.path,outfile:e.outfile,webcomponentPrefix:e.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),handler:async e=>{await modelHandler({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"views-data [path]",aliases:["views"],describe:"generate likec4 views data (.ts)",builder:e=>e.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:require$$0.resolve}).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"views",path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"dot",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"d2",path:e.path,useDotBin:e.useDotBin,outdir:e.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:e=>e.option("outdir",outdir).option("use-dot",useDotBin),handler:async e=>{await legacyHandler({format:"mermaid",useDotBin:e.useDotBin,path:e.path,outdir:e.outdir})}}).epilog(`${LikeC4.p.bold("Examples:")}
438
440
  likec4 gen react -o dist/likec4-views.mjs ./src/likec4
439
441
  likec4 gen model -o likec4-model.ts
440
442
  likec4 gen webcomponent -o likec4.js --webcomponent-prefix c4 --use-dot-bin ./src
@@ -442,7 +444,7 @@ if (import.meta.hot) {
442
444
  likec4 gen ts --outfile ../likec4.ts
443
445
  likec4 gen mmd --outdir assets/
444
446
  likec4 gen dot -o out .
445
- `),handler:()=>{}};async function handler$2({path:i,useDotBin:e,outfile:t}){const n=LikeC4.h("c4:export"),s=LikeC4.s(n),o=await(await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"})).layoutedModel();path$1.extname(t)!==".json"&&(t=t+".json"),await fsPromises.mkdir(path$1.dirname(t),{recursive:!0});const a=JSON.stringify(o.$model,null,2);await fsPromises.writeFile(t,a),n.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),t)}`),s.stopAndLog("\u2713 export in ")}const exportCmd={command:"export <format> [path]",describe:"Export to images or JSON",builder:i=>i.usage(`${LikeC4.p.bold("Usage:")} $0 export <format> [path]`).positional("path",path).command({command:"png [path]",describe:"export views to PNG",builder:e=>e.option("output",outdir).option("theme",{choices:["light","dark"],desc:"color-scheme to use, default is light"}).option("flat",{boolean:!0,type:"boolean",desc:"ignore sources structure and export all PNGs in output directory"}).option("use-dot",useDotBin).options({ignore:{boolean:!0,alias:"i",desc:"continue if some views failed to export"},timeout:{type:"number",alias:"t",desc:"(sec) timeout for playwright ",default:10},"max-attempts":{type:"number",describe:"",desc:"(number) max attempts to export failing view",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"}}).epilog(`${LikeC4.p.bold("Examples:")}
447
+ `),handler:()=>{}};async function handler$2({path:i,useDotBin:e,outfile:t}){const n=LikeC4.j("c4:export"),s=LikeC4.s(n),a=await(await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"})).layoutedModel();path$1.extname(t)!==".json"&&(t=t+".json"),await fsPromises.mkdir(path$1.dirname(t),{recursive:!0});const o=JSON.stringify(a.$model,null,2);await fsPromises.writeFile(t,o),n.info(`${LikeC4.p.dim("generated")} ${path$1.relative(process.cwd(),t)}`),s.stopAndLog("\u2713 export in ")}const exportCmd={command:"export <format> [path]",describe:"Export to images or JSON",builder:i=>i.usage(`${LikeC4.p.bold("Usage:")} $0 export <format> [path]`).positional("path",path).command({command:"png [path]",describe:"export views to PNG",builder:e=>e.option("output",outdir).option("theme",{choices:["light","dark"],desc:"color-scheme to use, default is light"}).option("flat",{boolean:!0,type:"boolean",desc:"ignore sources structure and export all PNGs in output directory"}).option("use-dot",useDotBin).options({ignore:{boolean:!0,alias:"i",desc:"continue if some views failed to export"},timeout:{type:"number",alias:"t",desc:"(sec) timeout for playwright ",default:10},"max-attempts":{type:"number",describe:"",desc:"(number) max attempts to export failing view",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"}}).epilog(`${LikeC4.p.bold("Examples:")}
446
448
  ${LikeC4.p.green("$0 export png")}
447
449
  ${LikeC4.p.gray("Search for likec4 files in current directory and output PNG next to sources")}
448
450
 
@@ -455,4 +457,4 @@ if (import.meta.hot) {
455
457
  ${LikeC4.p.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
456
458
  ${LikeC4.p.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
457
459
  `),handler:async e=>{await handler$2({path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).updateStrings({"Commands:":LikeC4.p.bold("Formats:")}),handler:()=>{}};async function vitePreview(i){const{isDev:e,...t}=await viteConfig({...i,likec4AssetsDir:"",webcomponentPrefix:void 0}),n=await getPorts({port:portNumbers(62001,62010)}),s=i?.open??!1;return await vite.preview({...t,mode:"production",preview:{host:"0.0.0.0",port:n,open:s}})}async function handler$1({path:i,output:e,base:t}){const n=await LikeC4.L.fromWorkspace(i,{logger:"vite"}),s=await vitePreview({base:t,languageServices:n,outputDir:e,open:!0});printServerUrls(s)}const previewCmd={command:"preview [path]",describe:"Start local server to preview production build",builder:i=>i.positional("path",{type:"string",desc:`Directory with LikeC4 source files
458
- 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"}}).coerce(["path","output"],require$$0.resolve).default("path",require$$0.resolve("."),"."),async handler(i){await handler$1(i)}};async function handler({path:i,useDotBin:e,webcomponentPrefix:t,useHashHistory:n,useOverview:s=!1,base:o}){const a=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"}),l=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-")),d=await viteDev({buildWebcomponent:!0,hmr:!0,base:o,webcomponentPrefix:t,languageServices:a,useHashHistory:n,useOverviewGraph:s,likec4AssetsDir:l});if(d.config.logger.clearScreen("info"),printServerUrls(d),!s)return;const B=await a.diagrams();if(LikeC4.r(B,1)){const w=LikeC4.h("c4:export"),E=resolveServerUrl(d);if(!E){w.error("no preview server url");return}w.info(LikeC4.p.cyan("wait 5sec before generating previews")),await core.delay(5e3);try{await exportViewsToPNG({serverUrl:E,logger:w,views:B,theme:"light",output:l,outputType:"flat"}),await core.delay(1e3),w.info(LikeC4.p.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(_){w.error(LikeC4.p.red("Failed to generate previews")),w.error(_)}}else d.config.logger.warn("no views found, no previews generated")}const serveCmd={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:i=>i.positional("path",path).option("base",base).option("webcomponent-prefix",webcomponentPrefix).option("use-hash-history",useHashHistory).option("use-overview",useOverview).option("use-dot",useDotBin),handler:async i=>{await handler({path:i.path,useDotBin:i["use-dot"],base:i.base,useOverview:i["use-overview"]??!1,webcomponentPrefix:i["webcomponent-prefix"],useHashHistory:i["use-hash-history"]})}};LikeC4.H.level=LikeC4.v.debug,LikeC4.H.wrapConsole();const g=Yargs(hideBin(process$1.argv)).scriptName("likec4").usage("Usage: $0 <command>").command(serveCmd).command(buildCmd).command(codegenCmd).command(exportCmd).command(previewCmd).help("help").version(LikeC4.y).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!0,"Something is wrong, run with --help").updateStrings({"Options:":LikeC4.p.bold("Options:"),"Positionals:":LikeC4.p.bold("Arguments:"),"Commands:":LikeC4.p.bold("Commands:"),"Examples:":LikeC4.p.bold("Examples:")}).wrap(LikeC4.u(process$1.stdout.columns-20,{min:80,max:120})).parseAsync();g.catch(()=>process$1.exit(1)),process.on("unhandledRejection",i=>{LikeC4.H.error(i)});
460
+ 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"}}).coerce(["path","output"],require$$0.resolve).default("path",require$$0.resolve("."),"."),async handler(i){await handler$1(i)}};async function handler({path:i,useDotBin:e,webcomponentPrefix:t,useHashHistory:n,useOverview:s=!1,base:a}){const o=await LikeC4.L.fromWorkspace(i,{logger:"vite",graphviz:e?"binary":"wasm"}),l=await fsPromises.mkdtemp(path$1.join(os.tmpdir(),".likec4-assets-"));process.env.NODE_ENV="development";const f=await viteDev({buildWebcomponent:!0,hmr:!0,base:a,webcomponentPrefix:t,languageServices:o,useHashHistory:n,useOverviewGraph:s,likec4AssetsDir:l});if(f.config.logger.clearScreen("info"),printServerUrls(f),!s)return;const E=await o.diagrams();if(LikeC4.v(E,1)){const w=LikeC4.j("c4:export"),y=resolveServerUrl(f);if(!y){w.error("no preview server url");return}w.info(LikeC4.p.cyan("wait 5sec before generating previews")),await core.delay(5e3);try{await exportViewsToPNG({serverUrl:y,logger:w,views:E,theme:"light",output:l,outputType:"flat"}),await core.delay(1e3),w.info(LikeC4.p.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(d){w.error(LikeC4.p.red("Failed to generate previews")),w.error(d)}}else f.config.logger.warn("no views found, no previews generated")}const serveCmd={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:i=>i.positional("path",path).option("base",base).option("webcomponent-prefix",webcomponentPrefix).option("use-hash-history",useHashHistory).option("use-overview",useOverview).option("use-dot",useDotBin),handler:async i=>{await handler({path:i.path,useDotBin:i["use-dot"],base:i.base,useOverview:i["use-overview"]??!1,webcomponentPrefix:i["webcomponent-prefix"],useHashHistory:i["use-hash-history"]})}};LikeC4.H.level=LikeC4.y.debug,LikeC4.H.wrapConsole();const g=Yargs(hideBin(process$1.argv)).scriptName("likec4").usage("Usage: $0 <command>").command(serveCmd).command(buildCmd).command(codegenCmd).command(exportCmd).command(previewCmd).help("help").version(LikeC4.z).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!0,"Something is wrong, run with --help").updateStrings({"Options:":LikeC4.p.bold("Options:"),"Positionals:":LikeC4.p.bold("Arguments:"),"Commands:":LikeC4.p.bold("Commands:"),"Examples:":LikeC4.p.bold("Examples:")}).wrap(LikeC4.u(process$1.stdout.columns-20,{min:80,max:120})).parseAsync();g.catch(()=>process$1.exit(1)),process.on("unhandledRejection",i=>{LikeC4.H.error(i)});