likec4 1.9.0 → 1.10.1

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,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
- import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w as Xe,y as Hu,A as a,B as Gu,C as L,D as Ku,G as qu,K as _,M as Yu,O as Xu,P as Qu,Q as Qe,R as Ze,L as z,o as Zu,S as et,X as le,i as eu,c as be,Y as uu,Z as tu,$ as nu,a0 as ru,a1 as ut}from"../shared/likec4.D4BZc04H.mjs";import{DEV as tt}from"esm-env";import{hrtime as nt,cwd as iu,argv as rt,stdout as it,exit as ot}from"node:process";import at from"yargs";import{hideBin as st}from"yargs/helpers";import{resolve as y,dirname as ne,join as re,extname as pe,relative as Q,isAbsolute as ou,basename as ke}from"node:path";import{existsSync as K,copyFileSync as au,rmSync as su}from"node:fs";import{mkdtemp as fe,writeFile as Z,mkdir as H,stat as Du,copyFile as Dt,rm as ct}from"node:fs/promises";import dt,{tmpdir as me}from"node:os";import{fileURLToPath as lt}from"node:url";import{build as ie,createServer as pt,preview as ft}from"vite";import{chromium as cu}from"playwright";import mt from"node:net";import{setTimeout as Ct}from"node:timers/promises";import{resolve as oe}from"path";import gt from"@vitejs/plugin-react";import"tty";import"node:util";import"node:child_process";import"node:string_decoder";import"node:tty";import"child_process";import"fs";import"node:events";import"node:v8";import"node:stream";import"node:buffer";import"node:stream/promises";import"node:worker_threads";import"util";import"os";import"crypto";import"net";import"url";import"buffer";import"@hpcc-js/wasm-graphviz";const Ce={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:y},R={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},du={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},ge={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:y},Se={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},lu={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},pu={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1};function Ft(e){var u,n;if(e){if("astNode"in e)return Et(e);if(Array.isArray(e))return e.reduce(fu,void 0);{const t=e,r=At(t)?ht((n=(u=t?.root)===null||u===void 0?void 0:u.astNode)!==null&&n!==void 0?n:t?.astNode):void 0;return ee(t,r)}}else return}function At(e){return typeof e<"u"&&"element"in e&&"text"in e}function ht(e){try{return Ge(e).uri.toString()}catch{return}}function Et(e){var u,n;const{astNode:t,property:r,index:i}=e??{},o=(u=t?.$cstNode)!==null&&u!==void 0?u:t?.$textRegion;if(!(t===void 0||o===void 0)){if(r===void 0)return ee(o,$e(t));{const c=D=>i!==void 0&&i>-1&&Array.isArray(t[r])?i<D.length?D[i]:void 0:D.reduce(fu,void 0);if(!((n=o.assignments)===null||n===void 0)&&n[r]){const D=c(o.assignments[r]);return D&&ee(D,$e(t))}else if(t.$cstNode){const D=c(Uu(t.$cstNode,r));return D&&ee(D,$e(t))}else return}}}function $e(e){var u,n,t,r;return e.$cstNode?(n=(u=Ge(e))===null||u===void 0?void 0:u.uri)===null||n===void 0?void 0:n.toString():e.$textRegion?e.$textRegion.documentURI||((r=(t=new Mu(e,i=>i.$container?[i.$container]:[]).find(i=>{var o;return(o=i.$textRegion)===null||o===void 0?void 0:o.documentURI}))===null||t===void 0?void 0:t.$textRegion)===null||r===void 0?void 0:r.documentURI):void 0}function ee(e,u){var n,t;const r={offset:e.offset,end:(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,length:(t=e.length)!==null&&t!==void 0?t:e.end-e.offset};return e.range&&(r.range=e.range),u??(u=e.fileURI),u&&(r.fileURI=u),r}function fu(e,u){var n,t;if(e){if(!u)return e&&ee(e)}else return u&&ee(u);const r=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,i=(t=u.end)!==null&&t!==void 0?t:u.offset+u.length,o=Math.min(e.offset,u.offset),c=Math.max(r,i),D=c-o,l={offset:o,end:c,length:D};if(e.range&&u.range&&(l.range={start:u.range.start.line<e.range.start.line||u.range.start.line===e.range.start.line&&u.range.start.character<e.range.start.character?u.range.start:e.range.start,end:u.range.end.line>e.range.end.line||u.range.end.line===e.range.end.line&&u.range.end.character>e.range.end.character?u.range.end:e.range.end}),e.fileURI||u.fileURI){const d=e.fileURI,f=u.fileURI,p=d&&f&&d!==f?`<unmergable text regions of ${d}, ${f}>`:d??f;l.fileURI=p}return l}class wt{constructor(u){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof u=="string"?this.defaultIndentation=u:typeof u=="number"&&(this.defaultIndentation="".padStart(u))}get content(){return this.lines.map(u=>u.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(u,n){if(u.length>0){const t=n&&this.currentPosition;this.lines[this.currentLineNumber].push(u),this.length+=u.length,t&&this.indentPendingTraceRegions(t)}}indentPendingTraceRegions(u){for(let n=this.traceData.length-1;n>=0;n--){const t=this.traceData[n];t.targetStart&&t.targetStart.offset===u.offset&&(t.targetStart=this.currentPosition)}}increaseIndent(u){this.currentIndents.push(u),u.indentImmediately||this.recentNonImmediateIndents.push(u)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(u=>!this.recentNonImmediateIndents.includes(u))}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(u){const n=vt(u,this.currentPosition,t=>{var r,i;return(i=(r=this.traceData[this.traceData.length-1])===null||r===void 0?void 0:r.children)===null||i===void 0?void 0:i.push(t)});return this.traceData.push(n),n}popTraceRegion(u){const n=this.traceData.pop();return this.assertTrue(n===u,"Trace region mismatch!"),n}getParentTraceSourceFileURI(){var u;for(let n=this.traceData.length-1;n>-1;n--){const t=(u=this.traceData[n].sourceRegion)===null||u===void 0?void 0:u.fileURI;if(t)return t}}assertTrue(u,n){if(!u)throw new Error(n)}}function vt(e,u,n){const t={sourceRegion:e,targetRegion:void 0,children:[],targetStart:u,complete:r=>{var i,o;return t.targetRegion={offset:t.targetStart.offset,end:r.offset,length:r.offset-t.targetStart.offset,range:{start:{line:t.targetStart.line,character:t.targetStart.character},end:{line:r.line,character:r.character}}},delete t.targetStart,((i=t.children)===null||i===void 0?void 0:i.length)===0&&delete t.children,!((o=t.targetRegion)===null||o===void 0)&&o.length&&n(t),delete t.complete,t}};return t}function Bt(e,u){const n=new wt(u),t=n.pushTraceRegion(void 0);mu(e,n),n.popTraceRegion(t),t.complete&&t.complete(n.currentPosition);const r=t.children&&t.children.length===1?t.children[0]:void 0,i=r?.targetRegion,o=t.targetRegion;return i&&r.sourceRegion&&i.offset===o.offset&&i.length===o.length?{text:n.content,trace:r}:{text:n.content,trace:t}}function mu(e,u){typeof e=="string"?yt(e,u):e instanceof xe?bt(e,u):e instanceof N?Fu(e,u):e instanceof se&&kt(e,u)}function Cu(e,u){return typeof e=="string"?e.length!==0:e instanceof N?e.contents.some(n=>Cu(n,u)):e instanceof se?!(e.ifNotEmpty&&u.currentLineContent.length===0):!1}function yt(e,u){e&&(u.pendingIndent&&gu(u,!1),u.append(e))}function gu(e,u){var n;let t="";for(const r of e.relevantIndents.filter(i=>i.indentEmptyLines||!u))t+=(n=r.indentation)!==null&&n!==void 0?n:e.defaultIndentation;e.append(t,!0),e.pendingIndent=!1}function Fu(e,u){let n;const t=Ft(e.tracedSource);t&&(n=u.pushTraceRegion(t));for(const r of e.contents)mu(r,u);if(n){u.popTraceRegion(n);const r=u.getParentTraceSourceFileURI();r&&t?.fileURI===r&&delete t.fileURI,n.complete&&n.complete(u.currentPosition)}}function bt(e,u){var n;if(Cu(e,u)){e.indentImmediately&&!u.pendingIndent&&u.append((n=e.indentation)!==null&&n!==void 0?n:u.defaultIndentation,!0);try{u.increaseIndent(e),Fu(e,u)}finally{u.decreaseIndent()}}}function kt(e,u){e.ifNotEmpty&&!St(u.currentLineContent)?u.resetCurrentLine():(u.pendingIndent&&gu(u,!0),u.append(e.lineDelimiter),u.addNewLine())}function St(e){return e.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const $t=/\S|$/;function Nt(e){const u=e.filter(t=>t.length>0).map(t=>t.search($t)),n=u.length===0?0:Math.min(...u);return Math.max(0,n)}function V(e,...u){const n=It(e),t=Lt(e,u,n);return Tt(t)}function xt(e,u,n){return(t,...r)=>jt(e,u,n)(V(t,...r))}function It(e){const u=e.join("_").split(Ke),n=u.length>1&&u[0].trim().length===0,t=n&&u.length>1&&u[u.length-1].trim().length===0;if(u.length===1||u.length!==0&&u[0].trim().length!==0||u.length===2&&u[1].trim().length===0)return{indentation:0,omitFirstLine:n,omitLastLine:t,trimLastLine:u.length!==1&&u[u.length-1].trim().length===0};{let r=n?u.slice(1):u;r=t?r.slice(0,r.length-1):r,r=r.filter(o=>o.length!==0);const i=Nt(r);return{indentation:i,omitFirstLine:n,omitLastLine:t&&(u[u.length-1].length<i||!u[u.length-1].startsWith(r[0].substring(0,i)))}}}function Lt(e,u,{indentation:n,omitFirstLine:t,omitLastLine:r,trimLastLine:i}){const o=[];e.forEach((l,d)=>{o.push(...l.split(Ke).map((f,p)=>p===0||f.length<n?f:f.substring(n)).reduce(d===0?(f,p,E)=>E===0?t?[]:[p]:E===1&&f.length===0?[p]:f.concat(Fe,p):(f,p,E)=>E===0?[p]:f.concat(Fe,p),[]).filter(f=>!(typeof f=="string"&&f.length===0)).concat(ae(u[d])?u[d]:u[d]!==void 0?{content:String(u[d])}:d<u.length?Au:[]))});const c=o.length,D=c!==0?o[c-1]:void 0;return(r||i)&&typeof D=="string"&&D.trim().length===0?t&&c!==1&&o[c-2]===Fe?o.slice(0,c-2):o.slice(0,c-1):o}const Fe={isNewLine:!0},Au={isUndefinedSegment:!0},hu=e=>e===Fe,Ne=e=>e===Au,Pt=e=>e.content!==void 0;function Tt(e){return e.reduce((n,t,r)=>Ne(t)?n:hu(t)?{node:r!==0&&(Ne(e[r-1])||ae(e[r-1]))||r>1&&typeof e[r-1]=="string"&&(Ne(e[r-2])||ae(e[r-2]))?n.node.appendNewLineIfNotEmpty():n.node.appendNewLine()}:(()=>{var i;const o=(r===0||hu(e[r-1]))&&typeof t=="string"&&t.length!==0?"".padStart(t.length-t.trimStart().length):"",c=Pt(t)?t.content:t;let D;return{node:n.indented?n.node:o.length!==0?n.node.indent({indentation:o,indentImmediately:!1,indentedChildren:l=>D=l.append(c)}):n.node.append(c),indented:D??((i=n.indented)===null||i===void 0?void 0:i.append(c))}})(),{node:new N}).node}const Ot=typeof process>"u"?`
2
+ import{l as Ke,m as Mu,n as Ju,o as qe,p as Wu,r as Ye,w as zu,y as Hu,z as Xe,A as Ze,D as Gu,E as a,G as Ku,_ as x,H as qu,I as Yu,J as R,K as Xu,M as Zu,O as Qu,P as Qe,S as eu,k as z,C as et,U as ut,V as le,q as uu,T as be,W as tu,X as tt,Z as nu,$ as iu,a0 as ru,a1 as nt}from"../shared/likec4.DKLo7EEm.mjs";import{DEV as it}from"esm-env";import{hrtime as rt,cwd as ou,argv as ot,stdout as at,exit as st}from"node:process";import Dt from"yargs";import{hideBin as ct}from"yargs/helpers";import{resolve as y,dirname as ne,join as ie,extname as pe,relative as Z,isAbsolute as au,basename as ke}from"node:path";import{existsSync as K,copyFileSync as su,rmSync as Du}from"node:fs";import{mkdtemp as fe,writeFile as Q,mkdir as H,stat as cu,copyFile as dt,rm as lt}from"node:fs/promises";import pt,{tmpdir as me}from"node:os";import{fileURLToPath as ft}from"node:url";import{build as re,createServer as mt,preview as Ct}from"vite";import{chromium as du}from"playwright";import gt from"node:net";import{setTimeout as Ft}from"node:timers/promises";import{resolve as oe}from"path";import Et from"@vitejs/plugin-react";import"tty";import"node:util";import"node:child_process";import"node:string_decoder";import"node:tty";import"child_process";import"fs";import"node:events";import"node:v8";import"node:stream";import"node:buffer";import"node:stream/promises";import"buffer";import"util";import"os";import"crypto";import"net";import"url";import"@hpcc-js/wasm-graphviz";const Ce={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:y},V={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:'use graphviz binaries ("dot" should be on PATH)',default:!1},lu={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},ge={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:y},Se={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},pu={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"'},fu={boolean:!0,type:"boolean",desc:"overview all diagrams as graph [experimental]",default:!1};function At(e){var u,n;if(e){if("astNode"in e)return vt(e);if(Array.isArray(e))return e.reduce(mu,void 0);{const t=e,i=ht(t)?wt((n=(u=t?.root)===null||u===void 0?void 0:u.astNode)!==null&&n!==void 0?n:t?.astNode):void 0;return ee(t,i)}}else return}function ht(e){return typeof e<"u"&&"element"in e&&"text"in e}function wt(e){try{return Ke(e).uri.toString()}catch{return}}function vt(e){var u,n;const{astNode:t,property:i,index:r}=e??{},o=(u=t?.$cstNode)!==null&&u!==void 0?u:t?.$textRegion;if(!(t===void 0||o===void 0)){if(i===void 0)return ee(o,$e(t));{const c=D=>r!==void 0&&r>-1&&Array.isArray(t[i])?r<D.length?D[r]:void 0:D.reduce(mu,void 0);if(!((n=o.assignments)===null||n===void 0)&&n[i]){const D=c(o.assignments[i]);return D&&ee(D,$e(t))}else if(t.$cstNode){const D=c(Mu(t.$cstNode,i));return D&&ee(D,$e(t))}else return}}}function $e(e){var u,n,t,i;return e.$cstNode?(n=(u=Ke(e))===null||u===void 0?void 0:u.uri)===null||n===void 0?void 0:n.toString():e.$textRegion?e.$textRegion.documentURI||((i=(t=new Ju(e,r=>r.$container?[r.$container]:[]).find(r=>{var o;return(o=r.$textRegion)===null||o===void 0?void 0:o.documentURI}))===null||t===void 0?void 0:t.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function ee(e,u){var n,t;const i={offset:e.offset,end:(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,length:(t=e.length)!==null&&t!==void 0?t:e.end-e.offset};return e.range&&(i.range=e.range),u??(u=e.fileURI),u&&(i.fileURI=u),i}function mu(e,u){var n,t;if(e){if(!u)return e&&ee(e)}else return u&&ee(u);const i=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,r=(t=u.end)!==null&&t!==void 0?t:u.offset+u.length,o=Math.min(e.offset,u.offset),c=Math.max(i,r),D=c-o,l={offset:o,end:c,length:D};if(e.range&&u.range&&(l.range={start:u.range.start.line<e.range.start.line||u.range.start.line===e.range.start.line&&u.range.start.character<e.range.start.character?u.range.start:e.range.start,end:u.range.end.line>e.range.end.line||u.range.end.line===e.range.end.line&&u.range.end.character>e.range.end.character?u.range.end:e.range.end}),e.fileURI||u.fileURI){const d=e.fileURI,f=u.fileURI,p=d&&f&&d!==f?`<unmergable text regions of ${d}, ${f}>`:d??f;l.fileURI=p}return l}class Bt{constructor(u){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],this.lines=[[]],this.length=0,typeof u=="string"?this.defaultIndentation=u:typeof u=="number"&&(this.defaultIndentation="".padStart(u))}get content(){return this.lines.map(u=>u.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(u,n){if(u.length>0){const t=n&&this.currentPosition;this.lines[this.currentLineNumber].push(u),this.length+=u.length,t&&this.indentPendingTraceRegions(t)}}indentPendingTraceRegions(u){for(let n=this.traceData.length-1;n>=0;n--){const t=this.traceData[n];t.targetStart&&t.targetStart.offset===u.offset&&(t.targetStart=this.currentPosition)}}increaseIndent(u){this.currentIndents.push(u),u.indentImmediately||this.recentNonImmediateIndents.push(u)}decreaseIndent(){this.currentIndents.pop()}get relevantIndents(){return this.currentIndents.filter(u=>!this.recentNonImmediateIndents.includes(u))}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(u){const n=yt(u,this.currentPosition,t=>{var i,r;return(r=(i=this.traceData[this.traceData.length-1])===null||i===void 0?void 0:i.children)===null||r===void 0?void 0:r.push(t)});return this.traceData.push(n),n}popTraceRegion(u){const n=this.traceData.pop();return this.assertTrue(n===u,"Trace region mismatch!"),n}getParentTraceSourceFileURI(){var u;for(let n=this.traceData.length-1;n>-1;n--){const t=(u=this.traceData[n].sourceRegion)===null||u===void 0?void 0:u.fileURI;if(t)return t}}assertTrue(u,n){if(!u)throw new Error(n)}}function yt(e,u,n){const t={sourceRegion:e,targetRegion:void 0,children:[],targetStart:u,complete:i=>{var r,o;return t.targetRegion={offset:t.targetStart.offset,end:i.offset,length:i.offset-t.targetStart.offset,range:{start:{line:t.targetStart.line,character:t.targetStart.character},end:{line:i.line,character:i.character}}},delete t.targetStart,((r=t.children)===null||r===void 0?void 0:r.length)===0&&delete t.children,!((o=t.targetRegion)===null||o===void 0)&&o.length&&n(t),delete t.complete,t}};return t}function bt(e,u){const n=new Bt(u),t=n.pushTraceRegion(void 0);Cu(e,n),n.popTraceRegion(t),t.complete&&t.complete(n.currentPosition);const i=t.children&&t.children.length===1?t.children[0]:void 0,r=i?.targetRegion,o=t.targetRegion;return r&&i.sourceRegion&&r.offset===o.offset&&r.length===o.length?{text:n.content,trace:i}:{text:n.content,trace:t}}function Cu(e,u){typeof e=="string"?kt(e,u):e instanceof Ne?St(e,u):e instanceof I?Eu(e,u):e instanceof se&&$t(e,u)}function gu(e,u){return typeof e=="string"?e.length!==0:e instanceof I?e.contents.some(n=>gu(n,u)):e instanceof se?!(e.ifNotEmpty&&u.currentLineContent.length===0):!1}function kt(e,u){e&&(u.pendingIndent&&Fu(u,!1),u.append(e))}function Fu(e,u){var n;let t="";for(const i of e.relevantIndents.filter(r=>r.indentEmptyLines||!u))t+=(n=i.indentation)!==null&&n!==void 0?n:e.defaultIndentation;e.append(t,!0),e.pendingIndent=!1}function Eu(e,u){let n;const t=At(e.tracedSource);t&&(n=u.pushTraceRegion(t));for(const i of e.contents)Cu(i,u);if(n){u.popTraceRegion(n);const i=u.getParentTraceSourceFileURI();i&&t?.fileURI===i&&delete t.fileURI,n.complete&&n.complete(u.currentPosition)}}function St(e,u){var n;if(gu(e,u)){e.indentImmediately&&!u.pendingIndent&&u.append((n=e.indentation)!==null&&n!==void 0?n:u.defaultIndentation,!0);try{u.increaseIndent(e),Eu(e,u)}finally{u.decreaseIndent()}}}function $t(e,u){e.ifNotEmpty&&!It(u.currentLineContent)?u.resetCurrentLine():(u.pendingIndent&&Fu(u,!0),u.append(e.lineDelimiter),u.addNewLine())}function It(e){return e.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const Nt=/\S|$/;function Lt(e){const u=e.filter(t=>t.length>0).map(t=>t.search(Nt)),n=u.length===0?0:Math.min(...u);return Math.max(0,n)}function _(e,...u){const n=Pt(e),t=Tt(e,u,n);return jt(t)}function xt(e,u,n){return(t,...i)=>Vt(e,u,n)(_(t,...i))}function Pt(e){const u=e.join("_").split(qe),n=u.length>1&&u[0].trim().length===0,t=n&&u.length>1&&u[u.length-1].trim().length===0;if(u.length===1||u.length!==0&&u[0].trim().length!==0||u.length===2&&u[1].trim().length===0)return{indentation:0,omitFirstLine:n,omitLastLine:t,trimLastLine:u.length!==1&&u[u.length-1].trim().length===0};{let i=n?u.slice(1):u;i=t?i.slice(0,i.length-1):i,i=i.filter(o=>o.length!==0);const r=Lt(i);return{indentation:r,omitFirstLine:n,omitLastLine:t&&(u[u.length-1].length<r||!u[u.length-1].startsWith(i[0].substring(0,r)))}}}function Tt(e,u,{indentation:n,omitFirstLine:t,omitLastLine:i,trimLastLine:r}){const o=[];e.forEach((l,d)=>{o.push(...l.split(qe).map((f,p)=>p===0||f.length<n?f:f.substring(n)).reduce(d===0?(f,p,h)=>h===0?t?[]:[p]:h===1&&f.length===0?[p]:f.concat(Fe,p):(f,p,h)=>h===0?[p]:f.concat(Fe,p),[]).filter(f=>!(typeof f=="string"&&f.length===0)).concat(ae(u[d])?u[d]:u[d]!==void 0?{content:String(u[d])}:d<u.length?Au:[]))});const c=o.length,D=c!==0?o[c-1]:void 0;return(i||r)&&typeof D=="string"&&D.trim().length===0?t&&c!==1&&o[c-2]===Fe?o.slice(0,c-2):o.slice(0,c-1):o}const Fe={isNewLine:!0},Au={isUndefinedSegment:!0},hu=e=>e===Fe,Ie=e=>e===Au,Ot=e=>e.content!==void 0;function jt(e){return e.reduce((n,t,i)=>Ie(t)?n:hu(t)?{node:i!==0&&(Ie(e[i-1])||ae(e[i-1]))||i>1&&typeof e[i-1]=="string"&&(Ie(e[i-2])||ae(e[i-2]))?n.node.appendNewLineIfNotEmpty():n.node.appendNewLine()}:(()=>{var r;const o=(i===0||hu(e[i-1]))&&typeof t=="string"&&t.length!==0?"".padStart(t.length-t.trimStart().length):"",c=Ot(t)?t.content:t;let D;return{node:n.indented?n.node:o.length!==0?n.node.indent({indentation:o,indentImmediately:!1,indentedChildren:l=>D=l.append(c)}):n.node.append(c),indented:D??((r=n.indented)===null||r===void 0?void 0:r.append(c))}})(),{node:new I}).node}const Rt=typeof process>"u"?`
3
3
  `:process.platform==="win32"?`\r
4
4
  `:`
5
- `;function ae(e){return e instanceof N||e instanceof xe||e instanceof se}function U(e,u){return ae(e)?Bt(e,u).text:String(e)}class N{constructor(...u){this.contents=[],this.append(...u)}isEmpty(){return this.contents.length===0}trace(u,n,t){if(Wu(u)){if(this.tracedSource={astNode:u,property:n,index:t},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=u;return this}append(...u){for(const n of u)typeof n=="function"?n(this):n&&this.contents.push(n);return this}appendIf(u,...n){return u?this.append(...n):this}appendNewLine(){return this.append(A)}appendNewLineIf(u){return u?this.append(A):this}appendNewLineIfNotEmpty(){return this.append(_t)}appendNewLineIfNotEmptyIf(u){return u?this.appendNewLineIfNotEmpty():this}appendTemplate(u,...n){return this.append(V(u,...n))}appendTemplateIf(u){return u?(n,...t)=>this.appendTemplate(n,...t):()=>this}indent(u){const{indentedChildren:n,indentation:t,indentEmptyLines:r,indentImmediately:i}=Array.isArray(u)||typeof u=="function"?{indentedChildren:u}:typeof u=="object"?u:{},o=new xe(t,i,r);return this.contents.push(o),Array.isArray(n)?o.append(...n):n&&o.append(n),this}appendTraced(u,n,t){return r=>this.append(new N().trace(u,n,t).append(r))}appendTracedIf(u,n,t,r){return u?this.appendTraced(typeof n=="function"?n():n,t,r):()=>this}appendTracedTemplate(u,n,t){return(r,...i)=>this.append(xt(u,n,t)(r,...i))}appendTracedTemplateIf(u,n,t,r){return u?this.appendTracedTemplate(typeof n=="function"?n():n,t,r):()=>this}}function jt(e,u,n){return t=>t instanceof N&&t.tracedSource===void 0?t.trace(e,u,n):new N().trace(e,u,n).append(t)}class xe extends N{constructor(u,n=!0,t=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof u=="string"?this.indentation=u:typeof u=="number"&&(this.indentation="".padStart(u)),this.indentImmediately=n,this.indentEmptyLines=t}}class se{constructor(u,n=!1){this.ifNotEmpty=!1,this.lineDelimiter=u??Ot,this.ifNotEmpty=n}}const A=new se,_t=new se(void 0,!0),Eu=e=>e===void 0||typeof e=="string"||ae(e)?e:String(e);function O(e,u=Eu,n={}){const t=typeof u=="function"?u:Eu,{filter:r,prefix:i,suffix:o,separator:c,appendNewLineIfNotEmpty:D,skipNewLineAfterLastItem:l}=typeof u=="object"?u:n,d=typeof i=="function"?i:()=>i,f=typeof o=="function"?o:()=>o;return Rt(e,(p,E,v,m)=>{if(r&&!r(E,v,m))return p;const C=t(E,v,m);return C===void 0?p:(p??(p=new N)).append(d(E,v,m)).append(C).append(f(E,v,m)).appendIf(!m,c).appendNewLineIfNotEmptyIf(!p.isEmpty()&&!!D&&(!m||!l))})}function Rt(e,u,n){const t=e[Symbol.iterator]();let r=t.next(),i=0,o=n;for(;!r.done;){const c=t.next();o=u(o,r.value,i,!!c.done),r=c,i++}return o}const Vt=e=>e.charAt(0).toLocaleUpperCase()+e.slice(1),Ut=e=>e.split(".").map(Vt).join(""),Mt=e=>Ut(e.parent?e.id.slice(e.parent.length+1):e.id),Wt=({autoLayout:e})=>{switch(e){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},Jt=({shape:e})=>{switch(e){case"queue":case"cylinder":case"rectangle":case"person":return e;case"storage":return"stored_data";case"mobile":case"browser":return"rectangle"}};function wu(e){const{nodes:u,edges:n}=e,t=new Map,r=(o,c)=>{const D=Mt(o),l=(c?c+".":"")+D;t.set(o.id,l);const d=JSON.stringify(o.title),f=Jt(o);return new N().append(D,": {",A).indent({indentedChildren:p=>p.append("label: ",d,A).appendIf(f!=="rectangle","shape: ",f,A).appendIf(o.children.length>0,A,O(u.filter(E=>E.parent===o.id),E=>r(E,l))),indentation:2}).append("}",A)},i=o=>new N().append(t.get(o.source)," -> ",t.get(o.target)).append(c=>o.label&&c.append(": ",JSON.stringify(o.label)));return U(new N().append("direction: ",Wt(e),A,A).append(O(u.filter(o=>qe(o.parent)),o=>r(o),{appendNewLineIfNotEmpty:!0})).appendIf(n.length>0,A,O(n,o=>i(o),{appendNewLineIfNotEmpty:!0})))}const zt=e=>e.charAt(0).toLocaleUpperCase()+e.slice(1),Ht=e=>e.split(".").map(zt).join(""),Gt=e=>Ht(e.parent?e.id.slice(e.parent.length+1):e.id),Kt=({shape:e})=>{switch(e){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([","])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function vu(e){const{nodes:u,edges:n}=e,t=new Map,r=(o,c)=>{const D=Gt(o),l=(c?c+".":"")+D;t.set(o.id,l);const d=o.title.replaceAll(`
6
- `,"\\n"),f=Kt(o),p=new N;return o.children.length>0?p.append("subgraph ",l,"[",JSON.stringify(o.title),"]",A).indent({indentedChildren:[O(u.filter(E=>E.parent===o.id),E=>r(E,l),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",A):p.append(l,f[0],d,f[1]),p},i=o=>new N().append(t.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
7
- `,"\\n")+'" .-':"-","> ",t.get(o.target));return U(new N().appendIf(e.title!==null&&e.title.length>0,"---",A,`title: ${JSON.stringify(e.title)}`,A,"---",A).append("graph ",e.autoLayout,A).indent({indentedChildren:o=>{o.append(O(u.filter(c=>qe(c.parent)),c=>r(c),{appendNewLineIfNotEmpty:!0})).appendIf(n.length>0,O(n,c=>i(c),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}var qt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Yt=/[\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]/,Xt=/[\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]/,Ie={Space_Separator:qt,ID_Start:Yt,ID_Continue:Xt},$={isSpaceSeparator(e){return typeof e=="string"&&Ie.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Ie.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Ie.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let Le,T,M,Ae,G,j,I,Pe,De;var Qt=function(u,n){Le=String(u),T="start",M=[],Ae=0,G=1,j=0,I=void 0,Pe=void 0,De=void 0;do I=Zt(),tn[T]();while(I.type!=="eof");return typeof n=="function"?Te({"":De},"",n):De};function Te(e,u,n){const t=e[u];if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let r=0;r<t.length;r++){const i=String(r),o=Te(t,i,n);o===void 0?delete t[i]:Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const r in t){const i=Te(t,r,n);i===void 0?delete t[r]:Object.defineProperty(t,r,{value:i,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,u,t)}let h,F,ce,W,w;function Zt(){for(h="default",F="",ce=!1,W=1;;){w=J();const e=Bu[h]();if(e)return e}}function J(){if(Le[Ae])return String.fromCodePoint(Le.codePointAt(Ae))}function s(){const e=J();return e===`
8
- `?(G++,j=0):e?j+=e.length:j++,e&&(Ae+=e.length),e}const Bu={default(){switch(w){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
9
- `:case"\r":case"\u2028":case"\u2029":s();return;case"/":s(),h="comment";return;case void 0:return s(),b("eof")}if($.isSpaceSeparator(w)){s();return}return Bu[T]()},comment(){switch(w){case"*":s(),h="multiLineComment";return;case"/":s(),h="singleLineComment";return}throw k(s())},multiLineComment(){switch(w){case"*":s(),h="multiLineCommentAsterisk";return;case void 0:throw k(s())}s()},multiLineCommentAsterisk(){switch(w){case"*":s();return;case"/":s(),h="default";return;case void 0:throw k(s())}s(),h="multiLineComment"},singleLineComment(){switch(w){case`
10
- `:case"\r":case"\u2028":case"\u2029":s(),h="default";return;case void 0:return s(),b("eof")}s()},value(){switch(w){case"{":case"[":return b("punctuator",s());case"n":return s(),q("ull"),b("null",null);case"t":return s(),q("rue"),b("boolean",!0);case"f":return s(),q("alse"),b("boolean",!1);case"-":case"+":s()==="-"&&(W=-1),h="sign";return;case".":F=s(),h="decimalPointLeading";return;case"0":F=s(),h="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=s(),h="decimalInteger";return;case"I":return s(),q("nfinity"),b("numeric",1/0);case"N":return s(),q("aN"),b("numeric",NaN);case'"':case"'":ce=s()==='"',F="",h="string";return}throw k(s())},identifierNameStartEscape(){if(w!=="u")throw k(s());s();const e=Oe();switch(e){case"$":case"_":break;default:if(!$.isIdStartChar(e))throw yu();break}F+=e,h="identifierName"},identifierName(){switch(w){case"$":case"_":case"\u200C":case"\u200D":F+=s();return;case"\\":s(),h="identifierNameEscape";return}if($.isIdContinueChar(w)){F+=s();return}return b("identifier",F)},identifierNameEscape(){if(w!=="u")throw k(s());s();const e=Oe();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!$.isIdContinueChar(e))throw yu();break}F+=e,h="identifierName"},sign(){switch(w){case".":F=s(),h="decimalPointLeading";return;case"0":F=s(),h="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=s(),h="decimalInteger";return;case"I":return s(),q("nfinity"),b("numeric",W*(1/0));case"N":return s(),q("aN"),b("numeric",NaN)}throw k(s())},zero(){switch(w){case".":F+=s(),h="decimalPoint";return;case"e":case"E":F+=s(),h="decimalExponent";return;case"x":case"X":F+=s(),h="hexadecimal";return}return b("numeric",W*0)},decimalInteger(){switch(w){case".":F+=s(),h="decimalPoint";return;case"e":case"E":F+=s(),h="decimalExponent";return}if($.isDigit(w)){F+=s();return}return b("numeric",W*Number(F))},decimalPointLeading(){if($.isDigit(w)){F+=s(),h="decimalFraction";return}throw k(s())},decimalPoint(){switch(w){case"e":case"E":F+=s(),h="decimalExponent";return}if($.isDigit(w)){F+=s(),h="decimalFraction";return}return b("numeric",W*Number(F))},decimalFraction(){switch(w){case"e":case"E":F+=s(),h="decimalExponent";return}if($.isDigit(w)){F+=s();return}return b("numeric",W*Number(F))},decimalExponent(){switch(w){case"+":case"-":F+=s(),h="decimalExponentSign";return}if($.isDigit(w)){F+=s(),h="decimalExponentInteger";return}throw k(s())},decimalExponentSign(){if($.isDigit(w)){F+=s(),h="decimalExponentInteger";return}throw k(s())},decimalExponentInteger(){if($.isDigit(w)){F+=s();return}return b("numeric",W*Number(F))},hexadecimal(){if($.isHexDigit(w)){F+=s(),h="hexadecimalInteger";return}throw k(s())},hexadecimalInteger(){if($.isHexDigit(w)){F+=s();return}return b("numeric",W*Number(F))},string(){switch(w){case"\\":s(),F+=en();return;case'"':if(ce)return s(),b("string",F);F+=s();return;case"'":if(!ce)return s(),b("string",F);F+=s();return;case`
11
- `:case"\r":throw k(s());case"\u2028":case"\u2029":nn(w);break;case void 0:throw k(s())}F+=s()},start(){switch(w){case"{":case"[":return b("punctuator",s())}h="value"},beforePropertyName(){switch(w){case"$":case"_":F=s(),h="identifierName";return;case"\\":s(),h="identifierNameStartEscape";return;case"}":return b("punctuator",s());case'"':case"'":ce=s()==='"',h="string";return}if($.isIdStartChar(w)){F+=s(),h="identifierName";return}throw k(s())},afterPropertyName(){if(w===":")return b("punctuator",s());throw k(s())},beforePropertyValue(){h="value"},afterPropertyValue(){switch(w){case",":case"}":return b("punctuator",s())}throw k(s())},beforeArrayValue(){if(w==="]")return b("punctuator",s());h="value"},afterArrayValue(){switch(w){case",":case"]":return b("punctuator",s())}throw k(s())},end(){throw k(s())}};function b(e,u){return{type:e,value:u,line:G,column:j}}function q(e){for(const u of e){if(J()!==u)throw k(s());s()}}function en(){switch(J()){case"b":return s(),"\b";case"f":return s(),"\f";case"n":return s(),`
12
- `;case"r":return s(),"\r";case"t":return s()," ";case"v":return s(),"\v";case"0":if(s(),$.isDigit(J()))throw k(s());return"\0";case"x":return s(),un();case"u":return s(),Oe();case`
13
- `:case"\u2028":case"\u2029":return s(),"";case"\r":return s(),J()===`
14
- `&&s(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw k(s());case void 0:throw k(s())}return s()}function un(){let e="",u=J();if(!$.isHexDigit(u)||(e+=s(),u=J(),!$.isHexDigit(u)))throw k(s());return e+=s(),String.fromCodePoint(parseInt(e,16))}function Oe(){let e="",u=4;for(;u-- >0;){const n=J();if(!$.isHexDigit(n))throw k(s());e+=s()}return String.fromCodePoint(parseInt(e,16))}const tn={start(){if(I.type==="eof")throw Y();je()},beforePropertyName(){switch(I.type){case"identifier":case"string":Pe=I.value,T="afterPropertyName";return;case"punctuator":he();return;case"eof":throw Y()}},afterPropertyName(){if(I.type==="eof")throw Y();T="beforePropertyValue"},beforePropertyValue(){if(I.type==="eof")throw Y();je()},beforeArrayValue(){if(I.type==="eof")throw Y();if(I.type==="punctuator"&&I.value==="]"){he();return}je()},afterPropertyValue(){if(I.type==="eof")throw Y();switch(I.value){case",":T="beforePropertyName";return;case"}":he()}},afterArrayValue(){if(I.type==="eof")throw Y();switch(I.value){case",":T="beforeArrayValue";return;case"]":he()}},end(){}};function je(){let e;switch(I.type){case"punctuator":switch(I.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=I.value;break}if(De===void 0)De=e;else{const u=M[M.length-1];Array.isArray(u)?u.push(e):Object.defineProperty(u,Pe,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")M.push(e),Array.isArray(e)?T="beforeArrayValue":T="beforePropertyName";else{const u=M[M.length-1];u==null?T="end":Array.isArray(u)?T="afterArrayValue":T="afterPropertyValue"}}function he(){M.pop();const e=M[M.length-1];e==null?T="end":Array.isArray(e)?T="afterArrayValue":T="afterPropertyValue"}function k(e){return Ee(e===void 0?`JSON5: invalid end of input at ${G}:${j}`:`JSON5: invalid character '${bu(e)}' at ${G}:${j}`)}function Y(){return Ee(`JSON5: invalid end of input at ${G}:${j}`)}function yu(){return j-=5,Ee(`JSON5: invalid identifier character at ${G}:${j}`)}function nn(e){console.warn(`JSON5: '${bu(e)}' in strings is not valid ECMAScript; consider escaping`)}function bu(e){const u={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(u[e])return u[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function Ee(e){const u=new SyntaxError(e);return u.lineNumber=G,u.columnNumber=j,u}var rn=function(u,n,t){const r=[];let i="",o,c,D="",l;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(t=n.space,l=n.quote,n=n.replacer),typeof n=="function")c=n;else if(Array.isArray(n)){o=[];for(const m of n){let C;typeof m=="string"?C=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(C=String(m)),C!==void 0&&o.indexOf(C)<0&&o.push(C)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),typeof t=="number"?t>0&&(t=Math.min(10,Math.floor(t)),D=" ".substr(0,t)):typeof t=="string"&&(D=t.substr(0,10)),d("",{"":u});function d(m,C){let g=C[m];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(m):typeof g.toJSON=="function"&&(g=g.toJSON(m))),c&&(g=c.call(C,m,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return f(g);if(typeof g=="number")return String(g);if(typeof g=="object")return Array.isArray(g)?v(g):p(g)}function f(m){const C={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let B="";for(let x=0;x<m.length;x++){const P=m[x];switch(P){case"'":case'"':C[P]++,B+=P;continue;case"\0":if($.isDigit(m[x+1])){B+="\\x00";continue}}if(g[P]){B+=g[P];continue}if(P<" "){let X=P.charCodeAt(0).toString(16);B+="\\x"+("00"+X).substring(X.length);continue}B+=P}const S=l||Object.keys(C).reduce((x,P)=>C[x]<C[P]?x:P);return B=B.replace(new RegExp(S,"g"),g[S]),S+B+S}function p(m){if(r.indexOf(m)>=0)throw TypeError("Converting circular structure to JSON5");r.push(m);let C=i;i=i+D;let g=o||Object.keys(m),B=[];for(const x of g){const P=d(x,m);if(P!==void 0){let X=E(x)+":";D!==""&&(X+=" "),X+=P,B.push(X)}}let S;if(B.length===0)S="{}";else{let x;if(D==="")x=B.join(","),S="{"+x+"}";else{let P=`,
15
- `+i;x=B.join(P),S=`{
16
- `+i+x+`,
17
- `+C+"}"}}return r.pop(),i=C,S}function E(m){if(m.length===0)return f(m);const C=String.fromCodePoint(m.codePointAt(0));if(!$.isIdStartChar(C))return f(m);for(let g=C.length;g<m.length;g++)if(!$.isIdContinueChar(String.fromCodePoint(m.codePointAt(g))))return f(m);return m}function v(m){if(r.indexOf(m)>=0)throw TypeError("Converting circular structure to JSON5");r.push(m);let C=i;i=i+D;let g=[];for(let S=0;S<m.length;S++){const x=d(String(S),m);g.push(x!==void 0?x:"null")}let B;if(g.length===0)B="[]";else if(D==="")B="["+g.join(",")+"]";else{let S=`,
18
- `+i,x=g.join(S);B=`[
19
- `+i+x+`,
20
- `+C+"]"}return r.pop(),i=C,B}};const on={parse:Qt,stringify:rn};var ue=on;function an(e){return O(e,u=>V`${ue.stringify(u.id)}`,{separator:" | "})}function sn(e){const u=Array.from(e),n=new N;return n.appendTemplate`
5
+ `;function ae(e){return e instanceof I||e instanceof Ne||e instanceof se}function U(e,u){return ae(e)?bt(e,u).text:String(e)}class I{constructor(...u){this.contents=[],this.append(...u)}isEmpty(){return this.contents.length===0}trace(u,n,t){if(Wu(u)){if(this.tracedSource={astNode:u,property:n,index:t},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=u;return this}append(...u){for(const n of u)typeof n=="function"?n(this):n&&this.contents.push(n);return this}appendIf(u,...n){return u?this.append(...n):this}appendNewLine(){return this.append(E)}appendNewLineIf(u){return u?this.append(E):this}appendNewLineIfNotEmpty(){return this.append(_t)}appendNewLineIfNotEmptyIf(u){return u?this.appendNewLineIfNotEmpty():this}appendTemplate(u,...n){return this.append(_(u,...n))}appendTemplateIf(u){return u?(n,...t)=>this.appendTemplate(n,...t):()=>this}indent(u){const{indentedChildren:n,indentation:t,indentEmptyLines:i,indentImmediately:r}=Array.isArray(u)||typeof u=="function"?{indentedChildren:u}:typeof u=="object"?u:{},o=new Ne(t,r,i);return this.contents.push(o),Array.isArray(n)?o.append(...n):n&&o.append(n),this}appendTraced(u,n,t){return i=>this.append(new I().trace(u,n,t).append(i))}appendTracedIf(u,n,t,i){return u?this.appendTraced(typeof n=="function"?n():n,t,i):()=>this}appendTracedTemplate(u,n,t){return(i,...r)=>this.append(xt(u,n,t)(i,...r))}appendTracedTemplateIf(u,n,t,i){return u?this.appendTracedTemplate(typeof n=="function"?n():n,t,i):()=>this}}function Vt(e,u,n){return t=>t instanceof I&&t.tracedSource===void 0?t.trace(e,u,n):new I().trace(e,u,n).append(t)}class Ne extends I{constructor(u,n=!0,t=!1){super(),this.indentImmediately=!0,this.indentEmptyLines=!1,typeof u=="string"?this.indentation=u:typeof u=="number"&&(this.indentation="".padStart(u)),this.indentImmediately=n,this.indentEmptyLines=t}}class se{constructor(u,n=!1){this.ifNotEmpty=!1,this.lineDelimiter=u??Rt,this.ifNotEmpty=n}}const E=new se,_t=new se(void 0,!0),wu=e=>e===void 0||typeof e=="string"||ae(e)?e:String(e);function O(e,u=wu,n={}){const t=typeof u=="function"?u:wu,{filter:i,prefix:r,suffix:o,separator:c,appendNewLineIfNotEmpty:D,skipNewLineAfterLastItem:l}=typeof u=="object"?u:n,d=typeof r=="function"?r:()=>r,f=typeof o=="function"?o:()=>o;return Ut(e,(p,h,v,m)=>{if(i&&!i(h,v,m))return p;const g=t(h,v,m);return g===void 0?p:(p??(p=new I)).append(d(h,v,m)).append(g).append(f(h,v,m)).appendIf(!m,c).appendNewLineIfNotEmptyIf(!p.isEmpty()&&!!D&&(!m||!l))})}function Ut(e,u,n){const t=e[Symbol.iterator]();let i=t.next(),r=0,o=n;for(;!i.done;){const c=t.next();o=u(o,i.value,r,!!c.done),i=c,r++}return o}const Mt=e=>e.charAt(0).toLocaleUpperCase()+e.slice(1),Jt=e=>e.split(".").map(Mt).join(""),Wt=e=>Jt(e.parent?e.id.slice(e.parent.length+1):e.id),zt=({autoLayout:e})=>{switch(e){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},Ht=({shape:e})=>{switch(e){case"queue":case"cylinder":case"rectangle":case"person":return e;case"storage":return"stored_data";case"mobile":case"browser":return"rectangle"}};function vu(e){const{nodes:u,edges:n}=e,t=new Map,i=(o,c)=>{const D=Wt(o),l=(c?c+".":"")+D;t.set(o.id,l);const d=JSON.stringify(o.title),f=Ht(o);return new I().append(D,": {",E).indent({indentedChildren:p=>p.append("label: ",d,E).appendIf(f!=="rectangle","shape: ",f,E).appendIf(o.children.length>0,E,O(u.filter(h=>h.parent===o.id),h=>i(h,l))),indentation:2}).append("}",E)},r=o=>new I().append(t.get(o.source)," -> ",t.get(o.target)).append(c=>o.label&&c.append(": ",JSON.stringify(o.label)));return U(new I().append("direction: ",zt(e),E,E).append(O(u.filter(o=>Ye(o.parent)),o=>i(o),{appendNewLineIfNotEmpty:!0})).appendIf(n.length>0,E,O(n,o=>r(o),{appendNewLineIfNotEmpty:!0})))}const Gt=e=>e.charAt(0).toLocaleUpperCase()+e.slice(1),Kt=e=>e.split(".").map(Gt).join(""),qt=e=>Kt(e.parent?e.id.slice(e.parent.length+1):e.id),Yt=({shape:e})=>{switch(e){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([","])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function Bu(e){const{nodes:u,edges:n}=e,t=new Map,i=(o,c)=>{const D=qt(o),l=(c?c+".":"")+D;t.set(o.id,l);const d=o.title.replaceAll(`
6
+ `,"\\n"),f=Yt(o),p=new I;return o.children.length>0?p.append("subgraph ",l,"[",JSON.stringify(o.title),"]",E).indent({indentedChildren:[O(u.filter(h=>h.parent===o.id),h=>i(h,l),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",E):p.append(l,f[0],d,f[1]),p},r=o=>new I().append(t.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
7
+ `,"\\n")+'" .-':"-","> ",t.get(o.target));return U(new I().appendIf(e.title!==null&&e.title.length>0,"---",E,`title: ${JSON.stringify(e.title)}`,E,"---",E).append("graph ",e.autoLayout,E).indent({indentedChildren:o=>{o.append(O(u.filter(c=>Ye(c.parent)),c=>i(c),{appendNewLineIfNotEmpty:!0})).appendIf(n.length>0,O(n,c=>r(c),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}var Xt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Zt=/[\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]/,Qt=/[\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]/,Le={Space_Separator:Xt,ID_Start:Zt,ID_Continue:Qt},$={isSpaceSeparator(e){return typeof e=="string"&&Le.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Le.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Le.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let xe,T,M,Ee,G,j,L,Pe,De;var en=function(u,n){xe=String(u),T="start",M=[],Ee=0,G=1,j=0,L=void 0,Pe=void 0,De=void 0;do L=un(),rn[T]();while(L.type!=="eof");return typeof n=="function"?Te({"":De},"",n):De};function Te(e,u,n){const t=e[u];if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let i=0;i<t.length;i++){const r=String(i),o=Te(t,r,n);o===void 0?delete t[r]:Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const i in t){const r=Te(t,i,n);r===void 0?delete t[i]:Object.defineProperty(t,i,{value:r,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,u,t)}let A,F,ce,J,w;function un(){for(A="default",F="",ce=!1,J=1;;){w=W();const e=yu[A]();if(e)return e}}function W(){if(xe[Ee])return String.fromCodePoint(xe.codePointAt(Ee))}function s(){const e=W();return e===`
8
+ `?(G++,j=0):e?j+=e.length:j++,e&&(Ee+=e.length),e}const yu={default(){switch(w){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
9
+ `:case"\r":case"\u2028":case"\u2029":s();return;case"/":s(),A="comment";return;case void 0:return s(),b("eof")}if($.isSpaceSeparator(w)){s();return}return yu[T]()},comment(){switch(w){case"*":s(),A="multiLineComment";return;case"/":s(),A="singleLineComment";return}throw k(s())},multiLineComment(){switch(w){case"*":s(),A="multiLineCommentAsterisk";return;case void 0:throw k(s())}s()},multiLineCommentAsterisk(){switch(w){case"*":s();return;case"/":s(),A="default";return;case void 0:throw k(s())}s(),A="multiLineComment"},singleLineComment(){switch(w){case`
10
+ `:case"\r":case"\u2028":case"\u2029":s(),A="default";return;case void 0:return s(),b("eof")}s()},value(){switch(w){case"{":case"[":return b("punctuator",s());case"n":return s(),q("ull"),b("null",null);case"t":return s(),q("rue"),b("boolean",!0);case"f":return s(),q("alse"),b("boolean",!1);case"-":case"+":s()==="-"&&(J=-1),A="sign";return;case".":F=s(),A="decimalPointLeading";return;case"0":F=s(),A="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=s(),A="decimalInteger";return;case"I":return s(),q("nfinity"),b("numeric",1/0);case"N":return s(),q("aN"),b("numeric",NaN);case'"':case"'":ce=s()==='"',F="",A="string";return}throw k(s())},identifierNameStartEscape(){if(w!=="u")throw k(s());s();const e=Oe();switch(e){case"$":case"_":break;default:if(!$.isIdStartChar(e))throw bu();break}F+=e,A="identifierName"},identifierName(){switch(w){case"$":case"_":case"\u200C":case"\u200D":F+=s();return;case"\\":s(),A="identifierNameEscape";return}if($.isIdContinueChar(w)){F+=s();return}return b("identifier",F)},identifierNameEscape(){if(w!=="u")throw k(s());s();const e=Oe();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!$.isIdContinueChar(e))throw bu();break}F+=e,A="identifierName"},sign(){switch(w){case".":F=s(),A="decimalPointLeading";return;case"0":F=s(),A="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":F=s(),A="decimalInteger";return;case"I":return s(),q("nfinity"),b("numeric",J*(1/0));case"N":return s(),q("aN"),b("numeric",NaN)}throw k(s())},zero(){switch(w){case".":F+=s(),A="decimalPoint";return;case"e":case"E":F+=s(),A="decimalExponent";return;case"x":case"X":F+=s(),A="hexadecimal";return}return b("numeric",J*0)},decimalInteger(){switch(w){case".":F+=s(),A="decimalPoint";return;case"e":case"E":F+=s(),A="decimalExponent";return}if($.isDigit(w)){F+=s();return}return b("numeric",J*Number(F))},decimalPointLeading(){if($.isDigit(w)){F+=s(),A="decimalFraction";return}throw k(s())},decimalPoint(){switch(w){case"e":case"E":F+=s(),A="decimalExponent";return}if($.isDigit(w)){F+=s(),A="decimalFraction";return}return b("numeric",J*Number(F))},decimalFraction(){switch(w){case"e":case"E":F+=s(),A="decimalExponent";return}if($.isDigit(w)){F+=s();return}return b("numeric",J*Number(F))},decimalExponent(){switch(w){case"+":case"-":F+=s(),A="decimalExponentSign";return}if($.isDigit(w)){F+=s(),A="decimalExponentInteger";return}throw k(s())},decimalExponentSign(){if($.isDigit(w)){F+=s(),A="decimalExponentInteger";return}throw k(s())},decimalExponentInteger(){if($.isDigit(w)){F+=s();return}return b("numeric",J*Number(F))},hexadecimal(){if($.isHexDigit(w)){F+=s(),A="hexadecimalInteger";return}throw k(s())},hexadecimalInteger(){if($.isHexDigit(w)){F+=s();return}return b("numeric",J*Number(F))},string(){switch(w){case"\\":s(),F+=tn();return;case'"':if(ce)return s(),b("string",F);F+=s();return;case"'":if(!ce)return s(),b("string",F);F+=s();return;case`
11
+ `:case"\r":throw k(s());case"\u2028":case"\u2029":on(w);break;case void 0:throw k(s())}F+=s()},start(){switch(w){case"{":case"[":return b("punctuator",s())}A="value"},beforePropertyName(){switch(w){case"$":case"_":F=s(),A="identifierName";return;case"\\":s(),A="identifierNameStartEscape";return;case"}":return b("punctuator",s());case'"':case"'":ce=s()==='"',A="string";return}if($.isIdStartChar(w)){F+=s(),A="identifierName";return}throw k(s())},afterPropertyName(){if(w===":")return b("punctuator",s());throw k(s())},beforePropertyValue(){A="value"},afterPropertyValue(){switch(w){case",":case"}":return b("punctuator",s())}throw k(s())},beforeArrayValue(){if(w==="]")return b("punctuator",s());A="value"},afterArrayValue(){switch(w){case",":case"]":return b("punctuator",s())}throw k(s())},end(){throw k(s())}};function b(e,u){return{type:e,value:u,line:G,column:j}}function q(e){for(const u of e){if(W()!==u)throw k(s());s()}}function tn(){switch(W()){case"b":return s(),"\b";case"f":return s(),"\f";case"n":return s(),`
12
+ `;case"r":return s(),"\r";case"t":return s()," ";case"v":return s(),"\v";case"0":if(s(),$.isDigit(W()))throw k(s());return"\0";case"x":return s(),nn();case"u":return s(),Oe();case`
13
+ `:case"\u2028":case"\u2029":return s(),"";case"\r":return s(),W()===`
14
+ `&&s(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw k(s());case void 0:throw k(s())}return s()}function nn(){let e="",u=W();if(!$.isHexDigit(u)||(e+=s(),u=W(),!$.isHexDigit(u)))throw k(s());return e+=s(),String.fromCodePoint(parseInt(e,16))}function Oe(){let e="",u=4;for(;u-- >0;){const n=W();if(!$.isHexDigit(n))throw k(s());e+=s()}return String.fromCodePoint(parseInt(e,16))}const rn={start(){if(L.type==="eof")throw Y();je()},beforePropertyName(){switch(L.type){case"identifier":case"string":Pe=L.value,T="afterPropertyName";return;case"punctuator":Ae();return;case"eof":throw Y()}},afterPropertyName(){if(L.type==="eof")throw Y();T="beforePropertyValue"},beforePropertyValue(){if(L.type==="eof")throw Y();je()},beforeArrayValue(){if(L.type==="eof")throw Y();if(L.type==="punctuator"&&L.value==="]"){Ae();return}je()},afterPropertyValue(){if(L.type==="eof")throw Y();switch(L.value){case",":T="beforePropertyName";return;case"}":Ae()}},afterArrayValue(){if(L.type==="eof")throw Y();switch(L.value){case",":T="beforeArrayValue";return;case"]":Ae()}},end(){}};function je(){let e;switch(L.type){case"punctuator":switch(L.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=L.value;break}if(De===void 0)De=e;else{const u=M[M.length-1];Array.isArray(u)?u.push(e):Object.defineProperty(u,Pe,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")M.push(e),Array.isArray(e)?T="beforeArrayValue":T="beforePropertyName";else{const u=M[M.length-1];u==null?T="end":Array.isArray(u)?T="afterArrayValue":T="afterPropertyValue"}}function Ae(){M.pop();const e=M[M.length-1];e==null?T="end":Array.isArray(e)?T="afterArrayValue":T="afterPropertyValue"}function k(e){return he(e===void 0?`JSON5: invalid end of input at ${G}:${j}`:`JSON5: invalid character '${ku(e)}' at ${G}:${j}`)}function Y(){return he(`JSON5: invalid end of input at ${G}:${j}`)}function bu(){return j-=5,he(`JSON5: invalid identifier character at ${G}:${j}`)}function on(e){console.warn(`JSON5: '${ku(e)}' in strings is not valid ECMAScript; consider escaping`)}function ku(e){const u={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(u[e])return u[e];if(e<" "){const n=e.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return e}function he(e){const u=new SyntaxError(e);return u.lineNumber=G,u.columnNumber=j,u}var an=function(u,n,t){const i=[];let r="",o,c,D="",l;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(t=n.space,l=n.quote,n=n.replacer),typeof n=="function")c=n;else if(Array.isArray(n)){o=[];for(const m of n){let g;typeof m=="string"?g=m:(typeof m=="number"||m instanceof String||m instanceof Number)&&(g=String(m)),g!==void 0&&o.indexOf(g)<0&&o.push(g)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),typeof t=="number"?t>0&&(t=Math.min(10,Math.floor(t)),D=" ".substr(0,t)):typeof t=="string"&&(D=t.substr(0,10)),d("",{"":u});function d(m,g){let C=g[m];switch(C!=null&&(typeof C.toJSON5=="function"?C=C.toJSON5(m):typeof C.toJSON=="function"&&(C=C.toJSON(m))),c&&(C=c.call(g,m,C)),C instanceof Number?C=Number(C):C instanceof String?C=String(C):C instanceof Boolean&&(C=C.valueOf()),C){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof C=="string")return f(C);if(typeof C=="number")return String(C);if(typeof C=="object")return Array.isArray(C)?v(C):p(C)}function f(m){const g={"'":.1,'"':.2},C={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let B="";for(let N=0;N<m.length;N++){const P=m[N];switch(P){case"'":case'"':g[P]++,B+=P;continue;case"\0":if($.isDigit(m[N+1])){B+="\\x00";continue}}if(C[P]){B+=C[P];continue}if(P<" "){let X=P.charCodeAt(0).toString(16);B+="\\x"+("00"+X).substring(X.length);continue}B+=P}const S=l||Object.keys(g).reduce((N,P)=>g[N]<g[P]?N:P);return B=B.replace(new RegExp(S,"g"),C[S]),S+B+S}function p(m){if(i.indexOf(m)>=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let g=r;r=r+D;let C=o||Object.keys(m),B=[];for(const N of C){const P=d(N,m);if(P!==void 0){let X=h(N)+":";D!==""&&(X+=" "),X+=P,B.push(X)}}let S;if(B.length===0)S="{}";else{let N;if(D==="")N=B.join(","),S="{"+N+"}";else{let P=`,
15
+ `+r;N=B.join(P),S=`{
16
+ `+r+N+`,
17
+ `+g+"}"}}return i.pop(),r=g,S}function h(m){if(m.length===0)return f(m);const g=String.fromCodePoint(m.codePointAt(0));if(!$.isIdStartChar(g))return f(m);for(let C=g.length;C<m.length;C++)if(!$.isIdContinueChar(String.fromCodePoint(m.codePointAt(C))))return f(m);return m}function v(m){if(i.indexOf(m)>=0)throw TypeError("Converting circular structure to JSON5");i.push(m);let g=r;r=r+D;let C=[];for(let S=0;S<m.length;S++){const N=d(String(S),m);C.push(N!==void 0?N:"null")}let B;if(C.length===0)B="[]";else if(D==="")B="["+C.join(",")+"]";else{let S=`,
18
+ `+r,N=C.join(S);B=`[
19
+ `+r+N+`,
20
+ `+g+"]"}return i.pop(),r=g,B}};const sn={parse:en,stringify:an};var ue=sn;function Dn(e){return O(e,u=>_`${ue.stringify(u.id)}`,{separator:" | "})}function cn(e){const u=Array.from(e),n=new I;return n.appendTemplate`
21
21
  /******************************************************************************
22
22
  * This file was generated
23
23
  * DO NOT EDIT MANUALLY!
@@ -25,9 +25,9 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
25
25
  /* prettier-ignore-start */
26
26
  /* eslint-disable */
27
27
 
28
- `.append(A,A),u.length==0?(n.append("export const LikeC4Views = {}",A),U(n)):(n.appendTemplate`
28
+ `.append(E,E),u.length==0?(n.append("export const LikeC4Views = {}",E),U(n)):(n.appendTemplate`
29
29
  export const LikeC4Views = {
30
- `.indent({indentation:2,indentedChildren(t){t.appendNewLineIf(u.length>1).append(O(u,r=>V`${ue.stringify(r.id)}: ${ue.stringify(r)}`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("}",A,A).appendTemplate`
30
+ `.indent({indentation:2,indentedChildren(t){t.appendNewLineIf(u.length>1).append(O(u,i=>_`${ue.stringify(i.id)}: ${ue.stringify(i)}`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("}",E,E).appendTemplate`
31
31
 
32
32
  export function isLikeC4ViewId(value) {
33
33
  return (
@@ -38,7 +38,7 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
38
38
  }
39
39
 
40
40
  /* prettier-ignore-end */
41
- `.append(A),U(n))}function Dn(e){const u=Array.from(e),n=new N;return n.appendTemplate`
41
+ `.append(E),U(n))}function dn(e){const u=Array.from(e),n=new I;return n.appendTemplate`
42
42
  /******************************************************************************
43
43
  * This file was generated
44
44
  * DO NOT EDIT MANUALLY!
@@ -49,10 +49,10 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
49
49
  // @ts-nocheck
50
50
 
51
51
  import type { DiagramView } from 'likec4'
52
- `.append(A,A),u.length===0?(n.append("export {}",A),U(n)):(n.appendTemplate`
53
- export type LikeC4ViewId = ${an(u)};
52
+ `.append(E,E),u.length===0?(n.append("export {}",E),U(n)):(n.appendTemplate`
53
+ export type LikeC4ViewId = ${Dn(u)};
54
54
  export const LikeC4Views = {
55
- `.indent({indentation:2,indentedChildren(t){t.appendNewLineIf(u.length>1).append(O(u,r=>V`${ue.stringify(r.id)}: (${ue.stringify(r)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",A,A).appendTemplate`
55
+ `.indent({indentation:2,indentedChildren(t){t.appendNewLineIf(u.length>1).append(O(u,i=>_`${ue.stringify(i.id)}: (${ue.stringify(i)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",E,E).appendTemplate`
56
56
  export type LikeC4Views = typeof LikeC4Views
57
57
 
58
58
  export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
@@ -64,7 +64,7 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
64
64
  }
65
65
 
66
66
  /* prettier-ignore-end */
67
- `.append(A),U(n))}function cn(e){const u=new N;return u.appendTemplate`
67
+ `.append(E),U(n))}function ln(e){const u=new I;return u.appendTemplate`
68
68
  /******************************************************************************
69
69
  * This file was generated
70
70
  * DO NOT EDIT MANUALLY!
@@ -73,17 +73,17 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
73
73
 
74
74
  export function d2Source(viewId) {
75
75
  switch (viewId) {
76
- `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(e,t=>V`
76
+ `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(e,t=>_`
77
77
  case ${JSON.stringify(t.id)}: {
78
- return ${JSON.stringify(wu(t))}
78
+ return ${JSON.stringify(vu(t))}
79
79
  }
80
80
  `,{appendNewLineIfNotEmpty:!0})).appendTemplate`
81
81
  default: {
82
82
  throw new Error('Unknown viewId: ' + viewId)
83
83
  }
84
- `}}).append(A," }",A).appendTemplate`
84
+ `}}).append(E," }",E).appendTemplate`
85
85
  }
86
- `.append(A,A),U(u)}function dn(e){const u=new N;return u.appendTemplate`
86
+ `.append(E,E),U(u)}function pn(e){const u=new I;return u.appendTemplate`
87
87
  /******************************************************************************
88
88
  * This file was generated
89
89
  * DO NOT EDIT MANUALLY!
@@ -92,7 +92,7 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
92
92
 
93
93
  export function dotSource(viewId) {
94
94
  switch (viewId) {
95
- `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(Object.keys(e),t=>V`
95
+ `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(Object.keys(e),t=>_`
96
96
  case ${JSON.stringify(t)}: {
97
97
  return ${JSON.stringify(e[t].dot)}
98
98
  }
@@ -100,12 +100,12 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
100
100
  default: {
101
101
  throw new Error('Unknown viewId: ' + viewId)
102
102
  }
103
- `}}).append(A," }",A).appendTemplate`
103
+ `}}).append(E," }",E).appendTemplate`
104
104
  }
105
105
 
106
106
  export function svgSource(viewId) {
107
107
  switch (viewId) {
108
- `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(Object.keys(e),t=>V`
108
+ `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(Object.keys(e),t=>_`
109
109
  case ${JSON.stringify(t)}: {
110
110
  return ${JSON.stringify(e[t].svg)}
111
111
  }
@@ -113,7 +113,7 @@ import{n as Ge,p as Uu,q as Mu,N as Ke,r as Wu,s as qe,x as Ju,u as zu,v as Ye,w
113
113
  default: {
114
114
  throw new Error('Unknown viewId: ' + viewId)
115
115
  }
116
- `}}).append(A," }",A,"}",A,A),U(u)}function ln(e){const u=Ju(e.flatMap(r=>r.nodes.map(i=>i.icon)),Ye(Hu),Ye(r=>Xe(r)&&!r.toLowerCase().startsWith("http")),zu()).sort(),{imports:n,cases:t}=u.reduce((r,i,o)=>{const[c,D]=i.split(":"),l="Icon"+o.toString().padStart(2,"0");return r.imports.push(`import ${l} from 'likec4/icons/${c}/${D}'`),r.cases.push(` '${c}:${D}': ${l}`),r},{imports:[],cases:[]});return`
116
+ `}}).append(E," }",E,"}",E,E),U(u)}function fn(e){const u=zu(e.flatMap(i=>i.nodes.map(r=>r.icon)),Xe(Gu),Xe(i=>Ze(i)&&!i.toLowerCase().startsWith("http")),Hu()).sort(),{imports:n,cases:t}=u.reduce((i,r,o)=>{const[c,D]=r.split(":"),l="Icon"+o.toString().padStart(2,"0");return i.imports.push(`import ${l} from 'likec4/icons/${c}/${D}'`),i.cases.push(` '${c}:${D}': ${l}`),i},{imports:[],cases:[]});return`
117
117
  ${n.join(`
118
118
  `)}
119
119
 
@@ -135,7 +135,7 @@ if (import.meta.hot) {
135
135
  }
136
136
  })
137
137
  }
138
- `}function pn(e){const u=new N;return u.appendTemplate`
138
+ `}function mn(e){const u=new I;return u.appendTemplate`
139
139
  /******************************************************************************
140
140
  * This file was generated
141
141
  * DO NOT EDIT MANUALLY!
@@ -144,18 +144,18 @@ if (import.meta.hot) {
144
144
 
145
145
  export function mmdSource(viewId) {
146
146
  switch (viewId) {
147
- `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(e,t=>V`
147
+ `.appendNewLine().indent({indentation:4,indentedChildren(n){n.append(O(e,t=>_`
148
148
  case ${JSON.stringify(t.id)}: {
149
- return ${JSON.stringify(vu(t))}
149
+ return ${JSON.stringify(Bu(t))}
150
150
  }
151
151
  `,{appendNewLineIfNotEmpty:!0})).appendTemplate`
152
152
  default: {
153
153
  throw new Error('Unknown viewId: ' + viewId)
154
154
  }
155
- `}}).append(A," }",A).appendTemplate`
155
+ `}}).append(E," }",E).appendTemplate`
156
156
  }
157
157
 
158
- `.append(A,A),U(u)}function ku(e){return`
158
+ `.append(E,E),U(u)}function Su(e){return`
159
159
  import { useStore } from '@nanostores/react'
160
160
  import { atom } from 'nanostores'
161
161
 
@@ -178,7 +178,7 @@ if (import.meta.hot) {
178
178
  }
179
179
  })
180
180
  }
181
- `}function fn(e,u){const{imports:n,cases:t}=e.reduce((r,{id:i},o)=>{const c=y(u,`${i}.png`);if(!K(c))return r;const D="Png"+o.toString().padStart(2,"0");return r.imports.push(`import ${D} from 'likec4/previews/${i}.png'`),r.cases.push(` ${JSON.stringify(i)}: ${D}`),r},{imports:[],cases:[]});return`
181
+ `}function Cn(e,u){const{imports:n,cases:t}=e.reduce((i,{id:r},o)=>{const c=y(u,`${r}.png`);if(!K(c))return i;const D="Png"+o.toString().padStart(2,"0");return i.imports.push(`import ${D} from 'likec4/previews/${r}.png'`),i.cases.push(` ${JSON.stringify(r)}: ${D}`),i},{imports:[],cases:[]});return`
182
182
  import { useStore } from '@nanostores/react'
183
183
  import { map } from 'nanostores'
184
184
 
@@ -222,7 +222,7 @@ if (import.meta.hot) {
222
222
  }
223
223
  })
224
224
  }
225
- `}const mn=`
225
+ `}const gn=`
226
226
  import { useStore } from '@nanostores/react'
227
227
  import { map } from 'nanostores'
228
228
  import { LikeC4Views } from 'virtual:likec4/views'
@@ -261,8 +261,7 @@ if (import.meta.hot) {
261
261
  }
262
262
  })
263
263
  }
264
- `,Cn={id:"virtual:likec4/store",virtualId:"\0likec4-plugin/store.js",async load({likec4:e,logger:u}){return u.info(a.dim("generating virtual:likec4/store")),mn}},gn={id:"virtual:likec4/views",virtualId:"\0likec4-plugin/views.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/views"));const n=await e.views.diagrams();return sn([...n])}},Fn={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/dot-sources"));const n=await e.views.viewsAsGraphvizOut(),t=Ku(n,({id:r,svg:i,dot:o})=>[r,{dot:o,svg:i}]);return dn(t)}},An={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/d2-sources"));const n=await e.views.computedViews();return cn(n)}},hn={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/mmd-sources"));const n=await e.views.computedViews();return pn(n)}},En={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/icons"));const n=await e.views.computedViews();return ln(n)}},wn={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plugin/overview-graph.js",async load({likec4:e,logger:u,useOverviewGraph:n}){if(n===!0)try{u.info(a.dim("generating virtual:likec4/overview-graph"));const t=await e.views.overviewGraph();return ku(t)}catch(t){u.error(t)}return u.info(a.dim("generating empty virtual:likec4/overview-graph")),ku({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},Su={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:e,logger:u,assetsDir:n}){u.info(a.dim("generating virtual:likec4/previews"));const t=await e.views.computedViews();return fn(t,n)}},$u=[En,Fn,An,hn,gn,wn,Su],Nu=[...$u,Cn],vn=e=>{const u=e.toLowerCase();return u.endsWith(".c4")||u.endsWith(".likec4")||u.endsWith(".like-c4")};function _e({useOverviewGraph:e=!1,languageServices:u}){let n,t=u.workspace;return{name:"vite-plugin-likec4",configResolved(r){if(n=r.logger,e){const i=r.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;i?(t=i,n.info(a.dim("likec4/previews alias")+" "+a.dim(t))):n.warn("likec4/previews alias not found")}},resolveId(r){const i=Nu.find(o=>o.id===r);return i?i.virtualId:null},async load(r){const i=Nu.find(o=>o.virtualId===r);return i?await i.load({logger:n,likec4:u,assetsDir:t,useOverviewGraph:e}):null},configureServer(r){const i=Gu(1),o=()=>{i.clearQueue(),i(async()=>{const[l]=u.getErrors();if(l){r.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+l.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:l.sourceFsPath,line:l.range.start.line+1,column:l.range.start.character+1}}});return}for(const d of $u){const f=r.moduleGraph.getModuleById(d.virtualId);if(f&&f.importers.size>0){n.info(`${a.green("trigger hmr")} ${a.dim(f.url)}`);try{await r.reloadModule(f)}catch(p){n.error(p)}}}})},c=u.workspace;n.info(`${a.dim("watch")} ${c}`);const D=l=>d=>{vn(d)&&u.notifyUpdate({[l]:d})};if(r.watcher.add(c).on("add",D("changed")).on("change",D("changed")).on("unlink",D("removed")),e&&!t.startsWith(u.workspace)){n.info(`${a.dim("watch")} ${t}`);const l=()=>{const d=r.moduleGraph.getModuleById(Su.virtualId);d&&d.importers.size>0&&r.reloadModule(d)};r.watcher.add(t).on("add",l).on("change",l).on("unlink",l)}u.onModelUpdate(()=>{L.debug("likec4 model update"),o()})}}}const Re=ne(lt(import.meta.url)),Bn=`
265
- // @ts-nocheck
264
+ `,Fn={id:"virtual:likec4/store",virtualId:"\0likec4-plugin/store.js",async load({likec4:e,logger:u}){return u.info(a.dim("generating virtual:likec4/store")),gn}},En={id:"virtual:likec4/views",virtualId:"\0likec4-plugin/views.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/views"));const n=await e.views.diagrams();return cn([...n])}},An={id:"virtual:likec4/dot-sources",virtualId:"\0likec4-plugin/dot-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/dot-sources"));const n=await e.views.viewsAsGraphvizOut(),t=qu(n,({id:i,svg:r,dot:o})=>[i,{dot:o,svg:r}]);return pn(t)}},hn={id:"virtual:likec4/d2-sources",virtualId:"\0likec4-plugin/d2-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/d2-sources"));const n=await e.views.computedViews();return ln(n)}},wn={id:"virtual:likec4/mmd-sources",virtualId:"\0likec4-plugin/mmd-sources.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/mmd-sources"));const n=await e.views.computedViews();return mn(n)}},vn={id:"virtual:likec4/icons",virtualId:"\0likec4-plugin/icons.js",async load({likec4:e,logger:u}){u.info(a.dim("generating virtual:likec4/icons"));const n=await e.views.computedViews();return fn(n)}},Bn={id:"virtual:likec4/overview-graph",virtualId:"\0likec4-plugin/overview-graph.js",async load({likec4:e,logger:u,useOverviewGraph:n}){if(n===!0)try{u.info(a.dim("generating virtual:likec4/overview-graph"));const t=await e.views.overviewGraph();return Su(t)}catch(t){u.error(t)}return u.info(a.dim("generating empty virtual:likec4/overview-graph")),Su({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}})}},$u={id:"virtual:likec4/previews",virtualId:"\0likec4-plugin/previews.js",async load({likec4:e,logger:u,assetsDir:n}){u.info(a.dim("generating virtual:likec4/previews"));const t=await e.views.computedViews();return Cn(t,n)}},Iu=[vn,An,hn,wn,En,Bn,$u],Nu=[...Iu,Fn],yn=e=>{const u=e.toLowerCase();return u.endsWith(".c4")||u.endsWith(".likec4")||u.endsWith(".like-c4")};function Re({useOverviewGraph:e=!1,languageServices:u}){let n,t=u.workspace;return{name:"vite-plugin-likec4",configResolved(i){if(n=i.logger,e){const r=i.resolve.alias.find(o=>o.find==="likec4/previews")?.replacement;r?(t=r,n.info(a.dim("likec4/previews alias")+" "+a.dim(t))):n.warn("likec4/previews alias not found")}},resolveId(i){const r=Nu.find(o=>o.id===i);return r?r.virtualId:null},async load(i){const r=Nu.find(o=>o.virtualId===i);return r?await r.load({logger:n,likec4:u,assetsDir:t,useOverviewGraph:e}):null},configureServer(i){const r=Ku(1),o=()=>{r.clearQueue(),r(async()=>{const[l]=u.getErrors();if(l){i.ws.send({type:"error",err:{name:"LikeC4ValidationError",message:"Validation error: "+l.message.slice(0,500),stack:"",plugin:"vite-plugin-likec4",loc:{file:l.sourceFsPath,line:l.range.start.line+1,column:l.range.start.character+1}}});return}for(const d of Iu){const f=i.moduleGraph.getModuleById(d.virtualId);if(f&&f.importers.size>0){n.info(`${a.green("trigger hmr")} ${a.dim(f.url)}`);try{await i.reloadModule(f)}catch(p){n.error(p)}}}})},c=u.workspace;n.info(`${a.dim("watch")} ${c}`);const D=l=>d=>{yn(d)&&u.notifyUpdate({[l]:d})};if(i.watcher.add(c).on("add",D("changed")).on("change",D("changed")).on("unlink",D("removed")),e&&!t.startsWith(u.workspace)){n.info(`${a.dim("watch")} ${t}`);const l=()=>{const d=i.moduleGraph.getModuleById($u.virtualId);d&&d.importers.size>0&&i.reloadModule(d)};i.watcher.add(t).on("add",l).on("change",l).on("unlink",l)}u.onModelUpdate(()=>{x.debug("likec4 model update"),o()})}}}const Ve=ne(ft(import.meta.url)),bn=`
266
265
  /* prettier-ignore-start */
267
266
  /* eslint-disable */
268
267
 
@@ -271,72 +270,114 @@ if (import.meta.hot) {
271
270
  * DO NOT EDIT MANUALLY!
272
271
  ******************************************************************************/
273
272
 
274
- `.trimStart(),yn=`
273
+ `.trimStart(),kn=`
275
274
 
276
275
  /* prettier-ignore-end */
277
- `,Ve={banner:Bn,footer:yn};function Ue(){const e=[y(Re,"../__app__"),y(Re,"../../__app__"),y(Re,"../../dist/__app__")],u=qu(e,K);if(!u)throw L.error(`likec4 app root does not exist, tried:
276
+ `,_e={banner:bn,footer:kn};function Ue(){const e=[y(Ve,"../__app__"),y(Ve,"../../__app__"),y(Ve,"../../dist/__app__")],u=Yu(e,K);if(!u)throw x.error(`likec4 app root does not exist, tried:
278
277
  ${e.join(`
279
- `)}`),new Error("likec4 app root does not exist");return u}async function Me(){const e=await fe(re(me(),".likec4-public-"));return await Z(re(e,"likec4-views.js"),`// generated by likec4
280
- `),e}const We=1e4,Je=async({languageServices:e,likec4AssetsDir:u,...n})=>{const t=n.customLogger??_("c4:vite"),r=Ue(),i=n?.useOverviewGraph===!0;t.info(`${a.cyan("likec4 app root")} ${a.dim(r)}`);const o=n.outputDir??y(e.workspace,"dist");t.info(a.cyan("output")+" "+a.dim(o));let c="/";n.base&&(c=Yu(n.base),Xu(c)||(c=Qu(c))),c!=="/"&&t.info(`${a.green("app base url")} ${a.dim(c)}`);const D=n.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:u,webcomponentPrefix:D,root:r,languageServices:e,clearScreen:!1,base:c,resolve:{alias:{"likec4/previews":u}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","nanostores","@nanostores/react"],force:!0},define:{WEBCOMPONENT_PREFIX:JSON.stringify(D),__USE_SHADOW_STYLE__:"false",__USE_OVERVIEW_GRAPH__:i?"true":"false",__USE_HASH_HISTORY__:n?.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:We,commonjsOptions:{defaultIsModuleExports:l=>l.includes("react")?!0:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:t,plugins:[_e({languageServices:e,useOverviewGraph:i})]}};async function ze({languageServices:e,outDir:u,base:n,webcomponentPrefix:t="likec4",filename:r="likec4-views.js"}){const i=_("c4:lib"),o=Ue();return i.info(a.cyan("outDir")+" "+a.dim(u)),{root:o,clearScreen:!1,base:n,configFile:!1,publicDir:!1,mode:"production",define:{WEBCOMPONENT_PREFIX:JSON.stringify(t),"process.env.NODE_ENV":'"production"'},resolve:{alias:{"likec4/icons":y(o,"../../icons")}},esbuild:{...Ve},build:{outDir:u,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:We,lib:{entry:"webcomponent/webcomponent.js",fileName(c,D){return r},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{defaultIsModuleExports:c=>c.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:i,plugins:[_e({languageServices:e,useOverviewGraph:!1})]}}const bn=["favicon.ico","robots.txt"],kn=async({buildWebcomponent:e=!0,webcomponentPrefix:u="likec4",languageServices:n,likec4AssetsDir:t,...r})=>{t??=await fe(re(me(),".likec4-assets-"));const{isDev:i,...o}=await Je({...r,languageServices:n,likec4AssetsDir:t,webcomponentPrefix:u}),c=await Me();for(const d of bn){const f=y(o.root,d);K(f)&&au(f,y(c,d))}const D=await n.diagrams();if(D.length===0)throw process.exitCode=1,new Error("no views found");if(D.forEach(d=>{d.hasLayoutDrift&&o.customLogger.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(d.id))}),e){const d=await ze({webcomponentPrefix:u,languageServices:n,outDir:c,base:o.base});await ie(d)}await ie({...o,publicDir:c,mode:"production"});const l=y(o.build.outDir,"index.html");K(l)&&au(l,y(o.build.outDir,"404.html"))};function xu(e){if(e.resolvedUrls)return Qe(e.resolvedUrls.network)??Qe(e.resolvedUrls.local)}function Iu(e){if(!e.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");L.box([a.green("LikeC4 served at:"),"",a.dim("Local: ")+e.resolvedUrls.local.join(`
278
+ `)}`),new Error("likec4 app root does not exist");return u}async function Me(){const e=await fe(ie(me(),".likec4-public-"));return await Q(ie(e,"likec4-views.js"),`// generated by likec4
279
+ `),e}const Je=1e4,We=async({languageServices:e,likec4AssetsDir:u,...n})=>{const t=n.customLogger??R("c4:vite"),i=Ue(),r=n?.useOverviewGraph===!0;t.info(`${a.cyan("likec4 app root")} ${a.dim(i)}`);const o=n.outputDir??y(e.workspace,"dist");t.info(a.cyan("output")+" "+a.dim(o));let c="/";n.base&&(c=Xu(n.base),Zu(c)||(c=Qu(c))),c!=="/"&&t.info(`${a.green("app base url")} ${a.dim(c)}`);const D=n.webcomponentPrefix??"likec4";return{isDev:!1,likec4AssetsDir:u,webcomponentPrefix:D,root:i,languageServices:e,clearScreen:!1,base:c,resolve:{alias:{"likec4/previews":u}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","nanostores","@nanostores/react"],force:!0},define:{WEBCOMPONENT_PREFIX:JSON.stringify(D),__USE_STYLE_BUNDLE__:"false",__USE_OVERVIEW_GRAPH__:r?"true":"false",__USE_HASH_HISTORY__:n?.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:Je,commonjsOptions:{defaultIsModuleExports:l=>l.includes("react")?!0:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:t,plugins:[Re({languageServices:e,useOverviewGraph:r})]}};async function ze({languageServices:e,outDir:u,base:n,webcomponentPrefix:t="likec4",filename:i="likec4-views.js"}){const r=R("c4:lib"),o=Ue();return r.info(a.cyan("outDir")+" "+a.dim(u)),{root:o,clearScreen:!1,base:n,configFile:!1,publicDir:!1,mode:"production",define:{WEBCOMPONENT_PREFIX:JSON.stringify(t),"process.env.NODE_ENV":'"production"'},resolve:{alias:{"likec4/icons":y(o,"../../icons")}},esbuild:{..._e},build:{outDir:u,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Je,lib:{entry:"webcomponent/webcomponent.js",fileName(c,D){return i},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{defaultIsModuleExports:c=>c.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:r,plugins:[Re({languageServices:e,useOverviewGraph:!1})]}}const Sn=["favicon.ico","robots.txt"],$n=async({buildWebcomponent:e=!0,webcomponentPrefix:u="likec4",languageServices:n,likec4AssetsDir:t,...i})=>{t??=await fe(ie(me(),".likec4-assets-"));const{isDev:r,...o}=await We({...i,languageServices:n,likec4AssetsDir:t,webcomponentPrefix:u}),c=await Me();for(const d of Sn){const f=y(o.root,d);K(f)&&su(f,y(c,d))}const D=await n.diagrams();if(D.length===0)throw process.exitCode=1,new Error("no views found");if(D.forEach(d=>{d.hasLayoutDrift&&o.customLogger.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(d.id))}),e){const d=await ze({webcomponentPrefix:u,languageServices:n,outDir:c,base:o.base});await re(d)}await re({...o,publicDir:c,mode:"production"});const l=y(o.build.outDir,"index.html");K(l)&&su(l,y(o.build.outDir,"404.html"))};function Lu(e){if(e.resolvedUrls)return Qe(e.resolvedUrls.network)??Qe(e.resolvedUrls.local)}function xu(e){if(!e.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");x.box([a.green("LikeC4 served at:"),"",a.dim("Local: ")+e.resolvedUrls.local.join(`
281
280
  `+"".padEnd(9," ")),a.dim("Network: ")+e.resolvedUrls.network.join(`
282
281
  `+"".padEnd(9," "))].join(`
283
- `))}class Lu extends Error{constructor(u){super(`${u} is locked`)}}const te={old:new Set,young:new Set},Sn=1e3*15,we=1024,ve=65535;let de;const $n=()=>{const e=dt.networkInterfaces(),u=new Set([void 0,"0.0.0.0"]);for(const n of Object.values(e))for(const t of n)u.add(t.address);return u},Pu=e=>new Promise((u,n)=>{const t=mt.createServer();t.unref(),t.on("error",n),t.listen(e,()=>{const{port:r}=t.address();t.close(()=>{u(r)})})}),Tu=async(e,u)=>{if(e.host||e.port===0)return Pu(e);for(const n of u)try{await Pu({port:e.port,host:n})}catch(t){if(!["EADDRNOTAVAIL","EINVAL"].includes(t.code))throw t}return e.port},Nn=function*(e){e&&(yield*e),yield 0};async function He(e){let u,n=new Set;if(e&&(e.port&&(u=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const r=e.exclude;if(typeof r[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const i of r){if(typeof i!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}n=new Set(r)}de===void 0&&(de=setTimeout(()=>{de=void 0,te.old=te.young,te.young=new Set},Sn),de.unref&&de.unref());const t=$n();for(const r of Nn(u))try{if(n.has(r))continue;let i=await Tu({...e,port:r},t);for(;te.old.has(i)||te.young.has(i);){if(r!==0)throw new Lu(r);i=await Tu({...e,port:r},t)}return te.young.add(i),i}catch(i){if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof Lu))throw i}throw new Error("No available ports found")}function Be(e,u){if(!Number.isInteger(e)||!Number.isInteger(u))throw new TypeError("`from` and `to` must be integer numbers");if(e<we||e>ve)throw new RangeError(`'from' must be between ${we} and ${ve}`);if(u<we||u>ve)throw new RangeError(`'to' must be between ${we} and ${ve}`);if(e>u)throw new RangeError("`to` must be greater than or equal to `from`");return function*(t,r){for(let i=t;i<=r;i++)yield i}(e,u)}async function Ou({buildWebcomponent:e=!0,hmr:u=!0,webcomponentPrefix:n="likec4",languageServices:t,likec4AssetsDir:r,openBrowser:i,...o}){r??=await fe(re(me(),".likec4-assets-"));const{isDev:c,...D}=await Je({...o,languageServices:t,likec4AssetsDir:r,webcomponentPrefix:n}),l=await He({port:[5173,...Be(61e3,61010),...Be(62002,62010)]}),d=await He({port:Be(24678,24690)}),f=await Me();let p;if(e){const v=await ze({webcomponentPrefix:n,languageServices:t,outDir:f,base:D.base});p=ie({...v,logLevel:"warn"}).catch(m=>(L.warn("webcomponent build failed",m),L.warn("Ignoring error and continuing"),Promise.resolve()))}const E=await pt({...D,define:Object.assign({},D.define,u&&{"process.env.NODE_ENV":'"development"'}),mode:u?"development":D.mode,publicDir:f,server:{host:"0.0.0.0",port:l,hmr:u&&{overlay:!0,port:d},fs:{strict:!1},open:i??!c}});return await E.listen(),p&&await p,E}async function xn({browserContext:e,views:u,output:n,logger:t,timeout:r,maxAttempts:i,outputType:o,theme:c}){let D;const l=u.map(p=>({view:p,attempt:1})),d=[];let f;for(;f=l.shift();){const{view:p,attempt:E}=f,v=`/export/${encodeURIComponent(p.id)}`;try{if(E>1){D&&(D.close({runBeforeUnload:!0}).catch(S=>t.error(`failed to close page: ${S}`)),D=void 0);const B=Ze(E*200,{min:200,max:1e3});t.info(a.cyan(v)+a.dim(` attempt ${E} of ${i} after ${B}ms`)),await Ct(B)}else p.hasLayoutDrift&&t.warn(a.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+a.red(p.id)),t.info(a.cyan(v));D??=await e.newPage(),await D.goto(v+`?padding=20&theme=${c}`);const m=D.getByRole("presentation");await m.waitFor(),p.nodes.some(B=>Xe(B.icon)&&B.icon.toLowerCase().startsWith("http"))&&await In(D,r);let C=".";o==="relative"&&(C=p.relativePath??".",C.includes("/")?C=C.slice(0,C.lastIndexOf("/")):C=".");const g=y(n,C,`${p.id}.png`);await m.screenshot({path:g,omitBackground:!0}),d.push({view:p,path:g})}catch(m){D?.close({runBeforeUnload:!0}).catch(C=>t.error(`failed to close page: ${C}`)),t.error(a.red("failed "+v+`
284
- `+m)),E<i&&(l.push({view:p,attempt:E+1}),t.info(a.dim(`retry ${v}`))),D=void 0}}return d}async function In(e,u){let n=await e.locator("//img").all();if(!n.length)return;const t=n.map(r=>r.evaluate(i=>i.complete||new Promise((o,c)=>{i.onload=o,i.onerror=c}),{timeout:Math.max(3e4,u)}));await Promise.allSettled(t)}async function ju({logger:e,serverUrl:u,theme:n="light",timeoutMs:t=15e3,views:r,output:i,outputType:o="relative",maxAttempts:c=3}){e.info(`${a.cyan("export output")} ${a.dim(i)}`),e.info(`${a.cyan("from server")} ${a.dim(u)}`);const D=cu.executablePath();e.info(a.cyan("Start chromium")),e.info(a.dim(D));const l=await cu.launch();e.info(a.cyan("Color scheme: ")+n);const d=await l.newContext({deviceScaleFactor:2,colorScheme:n,baseURL:u,isMobile:!1});d.setDefaultNavigationTimeout(t),d.setDefaultTimeout(t);try{return await xn({browserContext:d,views:r,output:i,outputType:o,logger:e,maxAttempts:c,timeout:t,theme:n})}finally{e.info(a.cyan("close chromium")),await d.close(),await l.close()}}async function _u({path:e,useDotBin:u,theme:n="light",output:t,outputType:r,serverUrl:i,ignore:o=!1,timeoutMs:c=1e4,maxAttempts:D=3}){const l=_("c4:export"),d=nt(),f=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});t??=f.workspace;const p=await f.diagrams();if(!Zu(p,1))throw l.warn("no views found"),new Error("no views found");let E;if(!i&&(l.info(a.cyan("start preview server")),E=await Ou({languageServices:f,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),i=xu(E),!i))throw l.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const v=await ju({logger:l,serverUrl:i,theme:n,timeoutMs:c,views:p,output:t,outputType:r,maxAttempts:D}),{pretty:m}=et(d);if(v.length>0&&l.info(a.green(`exported ${v.length} views in ${m}`)),v.length!==p.length&&(o&&v.length>0?l.info(a.dim("ignore")+" "+a.red(`failed ${p.length-v.length} out of ${p.length} views`)):l.error(a.red(`failed ${p.length-v.length} out of ${p.length} views`))),v.length!==p.length&&(v.length===0||!o))throw new Error(`Failed ${p.length-v.length} out of ${p.length} views`)}finally{E&&(l.info(a.cyan("stop server")),await E.close().catch(v=>{l.error(v)}))}}const{cyan:Ru,dim:Vu}=a;async function Ln({path:e,useDotBin:u,useHashHistory:n,webcomponentPrefix:t,useOverview:r=!1,output:i,base:o}){const c=_("c4:build"),D=await z.fromWorkspace(e,{graphviz:u?"binary":"wasm"}),l=i??y(D.workspace,"dist");let d=y(l,"assets");if(r)try{d=y(l,"assets","previews"),await H(d,{recursive:!0}),c.info(`${Ru("Generate previews")} ${Vu(d)}
285
- `),await _u({path:e,useDotBin:u,output:d,outputType:"flat",ignore:!0})}catch(f){c.error(a.red("Failed to generate previews")),c.error(f),c.warn(a.yellow("Ignore previews and continue build")),su(d,{recursive:!0,force:!0}),r=!1}await kn({base:o,useHashHistory:n,customLogger:c,useOverviewGraph:r,webcomponentPrefix:t,languageServices:D,likec4AssetsDir:d,outputDir:i}),r&&(c.info(`${Ru("clean previews")} ${Vu(d)}`),su(d,{recursive:!0,force:!0}))}const Pn={command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:e=>e.positional("path",Ce).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:y}).option("base",lu).option("use-hash-history",du).option("use-dot",R).option("webcomponent-prefix",Se).option("use-overview",pu).example(`${a.green("$0 build -o ./build ./src")}`,a.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async e=>{await Ln({path:e.path,output:e.output,base:e.base,useHashHistory:e["use-hash-history"],useDotBin:e["use-dot"],useOverview:e["use-overview"]??!1,webcomponentPrefix:e["webcomponent-prefix"]})}};async function Tn(e,u,n){const t=".ts";u=u??y(e.workspace,"likec4.generated"+t),pe(u)!==t&&(u=u+t),await H(ne(u),{recursive:!0});const r=await e.diagrams(),i=Dn([...r]);await Z(u,i),n.info(`${a.dim("generated")} ${Q(process.cwd(),u)}`)}async function On(e,u,n){await H(u,{recursive:!0}),n.info(`${a.dim("format")} ${a.green("dot")}`),n.info(`${a.dim("outdir")} ${u}`);const t=new Set,r=await e.views.layoutViews();let i=0;for(const{diagram:o,dot:c}of r)try{const D=o.relativePath??"";D!==""&&!t.has(D)&&(await H(y(u,D),{recursive:!0}),t.add(D));const l=y(u,D,o.id+".dot");be(c,`dot for ${o.id} not found`),await Z(l,c),n.info(`${a.dim("generated")} ${Q(process.cwd(),l)}`),i++}catch(D){n.error(`error while generating ${o.id}`,{error:D})}i>0&&n.info(`${a.dim("total")} ${i} files`)}async function jn(e,u,n,t){await H(n,{recursive:!0}),t.info(`${a.dim("format")} ${a.green(u)}`),t.info(`${a.dim("outdir")} ${n}`);let r,i;switch(u){case"d2":r=".d2",i=wu;break;case"mermaid":r=".mmd",i=vu;break;default:eu(u)}const o=new Set,c=await e.diagrams();let D=0;for(const l of c)try{let d=l.relativePath??".";d.includes("/")?d=d.slice(0,d.lastIndexOf("/")):d=".",d!==""&&!o.has(d)&&(await H(y(n,d),{recursive:!0}),o.add(d));const f=y(n,d,l.id+r),p=i(l);await Z(f,p),t.info(`${a.dim("generated")} ${Q(process.cwd(),f)}`),D++}catch(d){t.error(`error while generating ${l.id}`,{error:d})}D>0&&t.info(`${a.dim("total")} ${D} files`)}async function ye({path:e,useDotBin:u,...n}){const t=_("c4:codegen"),r=le(t),i=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});if((await i.views.computedViews()).length===0)throw t.warn("no views found"),process.exitCode=1,new Error("no views found");switch(n.format){case"views":{await Tn(i,n.outfile,t);break}case"dot":{await On(i,n.outdir??e,t);break}case"d2":case"mermaid":{await jn(i,n.format,n.outdir??e,t);break}default:eu(n)}r.stopAndLog()}async function _n({languageServices:e,outDir:u,filename:n="likec4-react.mjs"}){const t=_("c4:react"),r=Ue();return t.info(a.cyan("outDir")+" "+a.dim(u)),{customLogger:t,root:r,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",esbuild:{banner:Ve.banner,footer:Ve.footer,jsx:"transform",jsxDev:!1,minifyIdentifiers:!1,minifySyntax:!0,minifyWhitespace:!0,tsconfigRaw:{compilerOptions:{target:"ES2020",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:u,emptyOutDir:!1,sourcemap:!1,minify:"esbuild",target:"es2020",copyPublicDir:!1,chunkSizeWarningLimit:We,lib:{entry:"react/likec4.tsx",fileName(i,o){return n},formats:["es"]},rollupOptions:{external:["likec4/react","likec4","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(i,o){i.code!=="SOURCEMAP_ERROR"&&o(i)}}},plugins:[gt({}),_e({languageServices:e,useOverviewGraph:!1})]}}async function Rn({path:e,useDotBin:u,outfile:n}){const t=_("c4:codegen"),r=le(t),i=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});t.info(`${a.dim("format")} ${a.green("react")}`);const o=await i.diagrams();if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach(C=>{C.hasLayoutDrift&&t.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(C.id))});let c=y(i.workspace,"likec4-views.mjs");if(n&&(c=ou(n)?n:y(n),K(n)&&(await Du(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const D=ne(c);t.info(`${a.dim("outdir")} ${D}`);const l=ke(c);t.info(`${a.dim("filename")} ${l}`);const d=pe(l).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(d))throw t.error(`output file ${n} has extension "${d}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const f=await _n({languageServices:i,outDir:D,filename:l});await ie({...f,logLevel:"warn"});const p=o.reduce((C,g)=>(C.ids.add(g.id),g.tags?.forEach(B=>C.tags.add(B)),g.nodes.forEach(B=>{B.tags?.forEach(S=>C.tags.add(S)),C.kinds.add(B.kind)}),g.edges.forEach(B=>{B.tags?.forEach(S=>C.tags.add(S))}),C),{ids:new Set,tags:new Set,kinds:new Set}),E=[...p.ids].toSorted().map(C=>` | ${JSON.stringify(C)}`),v=[...p.tags].toSorted().map(C=>` | ${JSON.stringify(C)}`);v.length===0&&v.push(" | never");const m=[...p.kinds].toSorted().map(C=>` | ${JSON.stringify(C)}`);m.length===0&&m.push(" | never"),await Z(y(D,ke(c,d)+(d===".mjs"?".d.mts":".d.ts")),`
286
- import type { JSX } from 'react'
287
- import type { LikeC4ViewBaseProps, DiagramView } from 'likec4/react'
288
-
289
- export type LikeC4ViewId =
290
- ${E.join(`
291
- `)}
282
+ `))}class Pu extends Error{constructor(u){super(`${u} is locked`)}}const te={old:new Set,young:new Set},In=1e3*15,we=1024,ve=65535;let de;const Nn=()=>{const e=pt.networkInterfaces(),u=new Set([void 0,"0.0.0.0"]);for(const n of Object.values(e))for(const t of n)u.add(t.address);return u},Tu=e=>new Promise((u,n)=>{const t=gt.createServer();t.unref(),t.on("error",n),t.listen(e,()=>{const{port:i}=t.address();t.close(()=>{u(i)})})}),Ou=async(e,u)=>{if(e.host||e.port===0)return Tu(e);for(const n of u)try{await Tu({port:e.port,host:n})}catch(t){if(!["EADDRNOTAVAIL","EINVAL"].includes(t.code))throw t}return e.port},Ln=function*(e){e&&(yield*e),yield 0};async function He(e){let u,n=new Set;if(e&&(e.port&&(u=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const i=e.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const r of i){if(typeof r!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(r))throw new TypeError(`Number ${r} in the exclude option is not a safe integer and can't be used`)}n=new Set(i)}de===void 0&&(de=setTimeout(()=>{de=void 0,te.old=te.young,te.young=new Set},In),de.unref&&de.unref());const t=Nn();for(const i of Ln(u))try{if(n.has(i))continue;let r=await Ou({...e,port:i},t);for(;te.old.has(r)||te.young.has(r);){if(i!==0)throw new Pu(i);r=await Ou({...e,port:i},t)}return te.young.add(r),r}catch(r){if(!["EADDRINUSE","EACCES"].includes(r.code)&&!(r instanceof Pu))throw r}throw new Error("No available ports found")}function Be(e,u){if(!Number.isInteger(e)||!Number.isInteger(u))throw new TypeError("`from` and `to` must be integer numbers");if(e<we||e>ve)throw new RangeError(`'from' must be between ${we} and ${ve}`);if(u<we||u>ve)throw new RangeError(`'to' must be between ${we} and ${ve}`);if(e>u)throw new RangeError("`to` must be greater than or equal to `from`");return function*(t,i){for(let r=t;r<=i;r++)yield r}(e,u)}async function ju({buildWebcomponent:e=!0,hmr:u=!0,webcomponentPrefix:n="likec4",languageServices:t,likec4AssetsDir:i,openBrowser:r,...o}){i??=await fe(ie(me(),".likec4-assets-"));const{isDev:c,...D}=await We({...o,languageServices:t,likec4AssetsDir:i,webcomponentPrefix:n}),l=await He({port:[5173,...Be(61e3,61010),...Be(62002,62010)]}),d=await He({port:Be(24678,24690)}),f=await Me();let p;if(e){const v=await ze({webcomponentPrefix:n,languageServices:t,outDir:f,base:D.base});p=re({...v,logLevel:"warn"}).catch(m=>(x.warn("webcomponent build failed",m),x.warn("Ignoring error and continuing"),Promise.resolve()))}const h=await mt({...D,define:Object.assign({},D.define,u&&{"process.env.NODE_ENV":'"development"'}),mode:u?"development":D.mode,publicDir:f,server:{host:"0.0.0.0",port:l,hmr:u&&{overlay:!0,port:d},fs:{strict:!1},open:r??!c}});return await h.listen(),p&&await p,h}async function xn({browserContext:e,views:u,output:n,logger:t,timeout:i,maxAttempts:r,outputType:o,theme:c}){let D;const l=u.map(p=>({view:p,attempt:1})),d=[];let f;for(;f=l.shift();){const{view:p,attempt:h}=f,v=`/export/${encodeURIComponent(p.id)}`;try{if(h>1){D&&(D.close({runBeforeUnload:!0}).catch(S=>t.error(`failed to close page: ${S}`)),D=void 0);const B=eu(h*200,{min:200,max:1e3});t.info(a.cyan(v)+a.dim(` attempt ${h} of ${r} after ${B}ms`)),await Ft(B)}else p.hasLayoutDrift&&t.warn(a.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+a.red(p.id)),t.info(a.cyan(v));D??=await e.newPage(),await D.goto(v+`?padding=20&theme=${c}`);const m=D.getByRole("presentation");await m.waitFor(),p.nodes.some(B=>Ze(B.icon)&&B.icon.toLowerCase().startsWith("http"))&&await Pn(D,i);let g=".";o==="relative"&&(g=p.relativePath??".",g.includes("/")?g=g.slice(0,g.lastIndexOf("/")):g=".");const C=y(n,g,`${p.id}.png`);await m.screenshot({path:C,omitBackground:!0}),d.push({view:p,path:C})}catch(m){D?.close({runBeforeUnload:!0}).catch(g=>t.error(`failed to close page: ${g}`)),t.error(a.red("failed "+v+`
283
+ `+m)),h<r&&(l.push({view:p,attempt:h+1}),t.info(a.dim(`retry ${v}`))),D=void 0}}return d}async function Pn(e,u){let n=await e.locator("//img").all();if(!n.length)return;const t=n.map(i=>i.evaluate(r=>r.complete||new Promise((o,c)=>{r.onload=o,r.onerror=c}),{timeout:Math.max(3e4,u)}));await Promise.allSettled(t)}async function Ru({logger:e,serverUrl:u,theme:n="light",timeoutMs:t=15e3,views:i,output:r,outputType:o="relative",maxAttempts:c=3}){e.info(`${a.cyan("export output")} ${a.dim(r)}`),e.info(`${a.cyan("from server")} ${a.dim(u)}`);const D=du.executablePath();e.info(a.cyan("Start chromium")),e.info(a.dim(D));const l=await du.launch();e.info(a.cyan("Color scheme: ")+n);const d=await l.newContext({deviceScaleFactor:2,colorScheme:n,baseURL:u,isMobile:!1});d.setDefaultNavigationTimeout(t),d.setDefaultTimeout(t);try{return await xn({browserContext:d,views:i,output:r,outputType:o,logger:e,maxAttempts:c,timeout:t,theme:n})}finally{e.info(a.cyan("close chromium")),await d.close(),await l.close()}}async function Vu({path:e,useDotBin:u,theme:n="light",output:t,outputType:i,serverUrl:r,ignore:o=!1,timeoutMs:c=1e4,maxAttempts:D=3}){const l=R("c4:export"),d=rt(),f=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});t??=f.workspace;const p=await f.diagrams();if(!et(p,1))throw l.warn("no views found"),new Error("no views found");let h;if(!r&&(l.info(a.cyan("start preview server")),h=await ju({languageServices:f,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),r=Lu(h),!r))throw l.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");try{const v=await Ru({logger:l,serverUrl:r,theme:n,timeoutMs:c,views:p,output:t,outputType:i,maxAttempts:D}),{pretty:m}=ut(d);if(v.length>0&&l.info(a.green(`exported ${v.length} views in ${m}`)),v.length!==p.length&&(o&&v.length>0?l.info(a.dim("ignore")+" "+a.red(`failed ${p.length-v.length} out of ${p.length} views`)):l.error(a.red(`failed ${p.length-v.length} out of ${p.length} views`))),v.length!==p.length&&(v.length===0||!o))throw new Error(`Failed ${p.length-v.length} out of ${p.length} views`)}finally{h&&(l.info(a.cyan("stop server")),await h.close().catch(v=>{l.error(v)}))}}const{cyan:_u,dim:Uu}=a;async function Tn({path:e,useDotBin:u,useHashHistory:n,webcomponentPrefix:t,useOverview:i=!1,output:r,base:o}){const c=R("c4:build"),D=await z.fromWorkspace(e,{graphviz:u?"binary":"wasm",logger:"vite"}),l=r??y(D.workspace,"dist");let d=y(l,"assets");if(i)try{d=y(l,"assets","previews"),await H(d,{recursive:!0}),c.info(`${_u("Generate previews")} ${Uu(d)}
284
+ `),await Vu({path:e,useDotBin:u,output:d,outputType:"flat",ignore:!0})}catch(f){c.error(a.red("Failed to generate previews")),c.error(f),c.warn(a.yellow("Ignore previews and continue build")),Du(d,{recursive:!0,force:!0}),i=!1}await $n({base:o,useHashHistory:n,customLogger:c,useOverviewGraph:i,webcomponentPrefix:t,languageServices:D,likec4AssetsDir:d,outputDir:r}),i&&(c.info(`${_u("clean previews")} ${Uu(d)}`),Du(d,{recursive:!0,force:!0}))}const On={command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:e=>e.positional("path",Ce).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:y}).option("base",pu).option("use-hash-history",lu).option("use-dot",V).option("webcomponent-prefix",Se).option("use-overview",fu).example(`${a.green("$0 build -o ./build ./src")}`,a.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async e=>{await Tn({path:e.path,output:e.output,base:e.base,useHashHistory:e["use-hash-history"],useDotBin:e["use-dot"],useOverview:e["use-overview"]??!1,webcomponentPrefix:e["webcomponent-prefix"]})}};async function jn(e,u,n){const t=".ts";u=u??y(e.workspace,"likec4.generated"+t),pe(u)!==t&&(u=u+t),await H(ne(u),{recursive:!0});const i=await e.diagrams(),r=dn([...i]);await Q(u,r),n.info(`${a.dim("generated")} ${Z(process.cwd(),u)}`)}async function Rn(e,u,n){await H(u,{recursive:!0}),n.info(`${a.dim("format")} ${a.green("dot")}`),n.info(`${a.dim("outdir")} ${u}`);const t=new Set,i=await e.views.layoutViews();let r=0;for(const{diagram:o,dot:c}of i)try{const D=o.relativePath??"";D!==""&&!t.has(D)&&(await H(y(u,D),{recursive:!0}),t.add(D));const l=y(u,D,o.id+".dot");be(c,`dot for ${o.id} not found`),await Q(l,c),n.info(`${a.dim("generated")} ${Z(process.cwd(),l)}`),r++}catch(D){n.error(`error while generating ${o.id}`,{error:D})}r>0&&n.info(`${a.dim("total")} ${r} files`)}async function Vn(e,u,n,t){await H(n,{recursive:!0}),t.info(`${a.dim("format")} ${a.green(u)}`),t.info(`${a.dim("outdir")} ${n}`);let i,r;switch(u){case"d2":i=".d2",r=vu;break;case"mermaid":i=".mmd",r=Bu;break;default:uu(u)}const o=new Set,c=await e.diagrams();let D=0;for(const l of c)try{let d=l.relativePath??".";d.includes("/")?d=d.slice(0,d.lastIndexOf("/")):d=".",d!==""&&!o.has(d)&&(await H(y(n,d),{recursive:!0}),o.add(d));const f=y(n,d,l.id+i),p=r(l);await Q(f,p),t.info(`${a.dim("generated")} ${Z(process.cwd(),f)}`),D++}catch(d){t.error(`error while generating ${l.id}`,{error:d})}D>0&&t.info(`${a.dim("total")} ${D} files`)}async function ye({path:e,useDotBin:u,...n}){const t=R("c4:codegen"),i=le(t),r=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});if((await r.views.computedViews()).length===0)throw t.warn("no views found"),process.exitCode=1,new Error("no views found");switch(n.format){case"views":{await jn(r,n.outfile,t);break}case"dot":{await Rn(r,n.outdir??e,t);break}case"d2":case"mermaid":{await Vn(r,n.format,n.outdir??e,t);break}default:uu(n)}i.stopAndLog()}async function _n({languageServices:e,outDir:u,filename:n="likec4-react.mjs"}){const t=R("c4:react"),i=Ue();return t.info(a.cyan("outDir")+" "+a.dim(u)),{customLogger:t,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",esbuild:{banner:`'use client'
285
+ `+_e.banner,footer:_e.footer,jsx:"transform",jsxDev:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2020",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:u,emptyOutDir:!1,sourcemap:!1,minify:!1,target:"es2020",copyPublicDir:!1,chunkSizeWarningLimit:Je,lib:{entry:"react/likec4.tsx",fileName(r,o){return n},formats:["es"]},rollupOptions:{output:{compact:!1},external:["likec4/react","likec4","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(r,o){r.code!=="SOURCEMAP_ERROR"&&o(r)}}},plugins:[Et({}),Re({languageServices:e,useOverviewGraph:!1})]}}function Ge(e){const u=[...e].sort(tt).map(n=>` | ${JSON.stringify(n)}`);return u.length===0?u.push(" | never"):u.push(" | (string & Record<never, never>)"),u.join(`
286
+ `)+";"}async function Un({path:e,useDotBin:u,outfile:n}){const t=R("c4:codegen"),i=le(t),r=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});t.info(`${a.dim("format")} ${a.green("react")}`);const o=await r.diagrams();if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach(g=>{g.hasLayoutDrift&&t.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(g.id))});let c=y(r.workspace,"likec4-views.mjs");if(n&&(c=au(n)?n:y(n),K(n)&&(await cu(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const D=ne(c);t.info(`${a.dim("outdir")} ${D}`);const l=ke(c);t.info(`${a.dim("filename")} ${l}`);const d=pe(l).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(d))throw t.error(`output file ${n} has extension "${d}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const f=await _n({languageServices:r,outDir:D,filename:l});await re({...f,logLevel:"warn"});const p=o.reduce((g,C)=>(g.ids.add(C.id),C.tags?.forEach(B=>g.tags.add(B)),C.nodes.forEach(B=>{B.tags?.forEach(S=>g.tags.add(S)),g.kinds.add(B.kind)}),C.edges.forEach(B=>{B.tags?.forEach(S=>g.tags.add(S))}),g),{ids:new Set,tags:new Set,kinds:new Set}),h=Ge(p.ids),v=Ge(p.tags),m=Ge(p.kinds);await Q(y(D,ke(c,d)+(d===".mjs"?".d.mts":".d.ts")),`
287
+ /* prettier-ignore-start */
288
+ /* eslint-disable */
292
289
 
293
- export type LikeC4Tag =
294
- ${v.join(`
295
- `)}
290
+ /******************************************************************************
291
+ * This file was generated
292
+ * DO NOT EDIT MANUALLY!
293
+ ******************************************************************************/
296
294
 
297
- export type LikeC4ElementKind =
298
- ${m.join(`
299
- `)}
295
+ import type { JSX } from 'react/jsx-runtime'
296
+ import type { LikeC4ViewProps as BaseLikeC4ViewProps, ViewData, ReactLikeC4Props as GenericReactLikeC4Props } from 'likec4/react'
297
+
298
+ type LikeC4ViewId =
299
+ ${h}
300
300
 
301
- export type LikeC4DiagramView = DiagramView<LikeC4ViewId>
302
- export const LikeC4Views: Record<LikeC4ViewId, LikeC4DiagramView>
301
+ type LikeC4ElementKind =
302
+ ${m}
303
303
 
304
- export declare function isLikeC4ViewId(value: unknown): value is LikeC4ViewId
304
+ type LikeC4Tag =
305
+ ${v}
305
306
 
306
- export type LikeC4ViewProps = LikeC4ViewBaseProps<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>
307
+ type LikeC4ViewData = ViewData<LikeC4ViewId>
307
308
 
308
- export declare function LikeC4View({viewId, ...props}: LikeC4ViewProps): JSX.Element
309
+ /**
310
+ * @deprecated alias, use LikeC4ViewData instead
311
+ */
312
+ type LikeC4DiagramView = LikeC4ViewData
309
313
 
310
- `.trimStart()),L.box(uu(`
314
+ declare const LikeC4Views: Record<LikeC4ViewId, LikeC4ViewData>
315
+ declare function isLikeC4ViewId(value: unknown): value is LikeC4ViewId
316
+
317
+ type IconRendererProps = {
318
+ node: {
319
+ id: string
320
+ title: string
321
+ icon?: string | undefined
322
+ }
323
+ }
324
+ declare function RenderIcon(props: IconRendererProps): JSX.Element;
325
+
326
+ type LikeC4ViewProps = BaseLikeC4ViewProps<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>;
327
+ declare function LikeC4View({viewId, ...props}: LikeC4ViewProps): JSX.Element;
328
+
329
+ type ReactLikeC4Props =
330
+ & Omit<GenericReactLikeC4Props<LikeC4ViewId, LikeC4Tag, LikeC4ElementKind>, 'view' | 'renderIcon'>
331
+ & {
332
+ viewId: LikeC4ViewId
333
+ };
334
+ declare function ReactLikeC4({viewId, ...props}: ReactLikeC4Props): JSX.Element;
335
+
336
+ export {
337
+ type LikeC4ViewId,
338
+ type LikeC4Tag,
339
+ type LikeC4ElementKind,
340
+ type LikeC4ViewData,
341
+ type LikeC4DiagramView,
342
+ type LikeC4ViewProps,
343
+ type ReactLikeC4Props,
344
+ isLikeC4ViewId,
345
+ LikeC4Views,
346
+ LikeC4View,
347
+ RenderIcon,
348
+ ReactLikeC4
349
+ }
350
+ /* prettier-ignore-end */
351
+ `.trimStart()),x.box(tu(`
311
352
  ${a.dim("Component generated:")}
312
- ${Q(iu(),c)}
353
+ ${Z(ou(),c)}
313
354
 
314
355
  ${a.dim("How to use:")}
315
356
  ${a.blue("https://likec4.dev/tooling/codegen/#react")}
316
- `)),r.stopAndLog()}async function Vn({path:e,useDotBin:u,webcomponentPrefix:n="likec4",outfile:t}){const r=_("c4:codegen"),i=le(r),o=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});r.info(`${a.dim("format")} ${a.green("webcomponent")}`);const c=await o.diagrams();if(!tu(c,1))throw r.warn("no views found"),process.exitCode=1,new Error("no views found");c.forEach(v=>{v.hasLayoutDrift&&r.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(v.id))});let D=y(o.workspace,"likec4-views.js");if(t&&(D=ou(t)?t:y(t),K(t)&&(await Du(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);L.debug(`${a.dim("outfilepath")} ${D}`);const l=ke(D);L.debug(`${a.dim("filename")} ${l}`);const d=pe(l).toLocaleLowerCase();if(d!==".js"&&d!==".mjs")throw L.warn(`output file ${t} has extension "${d}"`),new Error(`output file ${t} must be a .js or .mjs`);const f=await Me();L.debug(`${a.dim("created temp public")} ${f}`);const p=await ze({languageServices:o,outDir:f,filename:l,webcomponentPrefix:n,base:"/"});L.debug(`${a.dim("vite build webcomponent")}`),await ie({...p,logLevel:"warn"});const E=y(f,l);if(!K(E))throw new Error(`output file not found: ${E}`);await H(ne(D),{recursive:!0}),await Dt(E,D),r.info(`${a.dim("generated")} ${D}`),L.debug(`${a.dim("remove temp public")}`),await ct(f,{recursive:!0,force:!0}),L.box(uu(`
357
+ `)),i.stopAndLog()}async function Mn({path:e,useDotBin:u,webcomponentPrefix:n="likec4",outfile:t}){const i=R("c4:codegen"),r=le(i),o=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"});i.info(`${a.dim("format")} ${a.green("webcomponent")}`);const c=await o.diagrams();if(!nu(c,1))throw i.warn("no views found"),process.exitCode=1,new Error("no views found");c.forEach(v=>{v.hasLayoutDrift&&i.warn(a.yellow("drift detected, manual layout can not be applied, view:")+" "+a.red(v.id))});let D=y(o.workspace,"likec4-views.js");if(t&&(D=au(t)?t:y(t),K(t)&&(await cu(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);x.debug(`${a.dim("outfilepath")} ${D}`);const l=ke(D);x.debug(`${a.dim("filename")} ${l}`);const d=pe(l).toLocaleLowerCase();if(d!==".js"&&d!==".mjs")throw x.warn(`output file ${t} has extension "${d}"`),new Error(`output file ${t} must be a .js or .mjs`);const f=await Me();x.debug(`${a.dim("created temp public")} ${f}`);const p=await ze({languageServices:o,outDir:f,filename:l,webcomponentPrefix:n,base:"/"});x.debug(`${a.dim("vite build webcomponent")}`),await re({...p,logLevel:"warn"});const h=y(f,l);if(!K(h))throw new Error(`output file not found: ${h}`);await H(ne(D),{recursive:!0}),await dt(h,D),i.info(`${a.dim("generated")} ${D}`),x.debug(`${a.dim("remove temp public")}`),await lt(f,{recursive:!0,force:!0}),x.box(tu(`
317
358
  ${a.dim("Webcomponents generated to:")}
318
- ${Q(iu(),D)}
359
+ ${Z(ou(),D)}
319
360
 
320
361
  ${a.dim("Setup and usage instructions:")}
321
362
  ${a.blue("https://likec4.dev/tooling/codegen/#webcomponent")}
322
- `)),i.stopAndLog()}const Un={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:e=>e.positional("path",Ce).command("react [path]","generate react component to render likec4 view",u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:oe}).option("use-dot",R),async u=>{await Rn({useDotBin:u.useDotBin,path:u.path,outfile:u.outfile})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:oe}).option("webcomponent-prefix",Se).option("use-dot",R),handler:async u=>{await Vn({useDotBin:u.useDotBin,path:u.path,outfile:u.outfile,webcomponentPrefix:u.webcomponentPrefix})}}).command({command:"views-data [path]",aliases:["ts","views"],describe:"generate likec4 views data (.ts)",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:oe}).option("use-dot",R),handler:async u=>{await ye({format:"views",path:u.path,useDotBin:u.useDotBin,outfile:u.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:u=>u.option("outdir",ge).option("use-dot",R),handler:async u=>{await ye({format:"dot",path:u.path,useDotBin:u.useDotBin,outdir:u.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:u=>u.option("outdir",ge).option("use-dot",R),handler:async u=>{await ye({format:"d2",path:u.path,useDotBin:u.useDotBin,outdir:u.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:u=>u.option("outdir",ge).option("use-dot",R),handler:async u=>{await ye({format:"mermaid",useDotBin:u.useDotBin,path:u.path,outdir:u.outdir})}}).epilog(`${a.bold("Examples:")}
363
+ `)),r.stopAndLog()}const Jn={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:e=>e.positional("path",Ce).command("react [path]","generate react component to render likec4 view",u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:oe}).option("use-dot",V),async u=>{await Un({useDotBin:u.useDotBin,path:u.path,outfile:u.outfile})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:oe}).option("webcomponent-prefix",Se).option("use-dot",V),handler:async u=>{await Mn({useDotBin:u.useDotBin,path:u.path,outfile:u.outfile,webcomponentPrefix:u.webcomponentPrefix})}}).command({command:"views-data [path]",aliases:["ts","views"],describe:"generate likec4 views data (.ts)",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:oe}).option("use-dot",V),handler:async u=>{await ye({format:"views",path:u.path,useDotBin:u.useDotBin,outfile:u.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:u=>u.option("outdir",ge).option("use-dot",V),handler:async u=>{await ye({format:"dot",path:u.path,useDotBin:u.useDotBin,outdir:u.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:u=>u.option("outdir",ge).option("use-dot",V),handler:async u=>{await ye({format:"d2",path:u.path,useDotBin:u.useDotBin,outdir:u.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:u=>u.option("outdir",ge).option("use-dot",V),handler:async u=>{await ye({format:"mermaid",useDotBin:u.useDotBin,path:u.path,outdir:u.outdir})}}).epilog(`${a.bold("Examples:")}
323
364
  likec4 gen react -o dist/likec4-views.mjs ./src/likec4
324
365
  likec4 gen webcomponent -o likec4.js --webcomponent-prefix c4 --use-dot-bin ./src
325
366
  likec4 gen views-data -o ./src/likec4-data.ts
326
367
  likec4 gen ts --outfile ../likec4.ts
327
368
  likec4 gen mmd --outdir assets/
328
369
  likec4 gen dot -o out .
329
- `),handler:()=>{}};async function Mn({path:e,useDotBin:u,outfile:n}){const t=_("c4:export"),r=le(t),i=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"}),o=await i.computed();if(!o)throw t.warn("no model parsed"),new Error("no model parsed");pe(n)!==".json"&&(n=n+".json"),await H(ne(n),{recursive:!0});const c=await i.diagrams(),D={...o,views:c},l=JSON.stringify(D,null,2);await Z(n,l),t.info(`${a.dim("generated")} ${Q(process.cwd(),n)}`),r.stopAndLog("\u2713 export in ")}const Wn={command:"export <format> [path]",describe:"Export to images or JSON",builder:e=>e.usage(`${a.bold("Usage:")} $0 export <format> [path]`).positional("path",Ce).command({command:"png [path]",describe:"export views to PNG",builder:u=>u.option("output",ge).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",R).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(`${a.bold("Examples:")}
370
+ `),handler:()=>{}};async function Wn({path:e,useDotBin:u,outfile:n}){const t=R("c4:export"),i=le(t),r=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"}),o=await r.computed();if(!o)throw t.warn("no model parsed"),new Error("no model parsed");pe(n)!==".json"&&(n=n+".json"),await H(ne(n),{recursive:!0});const c=await r.diagrams(),D={...o,views:c},l=JSON.stringify(D,null,2);await Q(n,l),t.info(`${a.dim("generated")} ${Z(process.cwd(),n)}`),i.stopAndLog("\u2713 export in ")}const zn={command:"export <format> [path]",describe:"Export to images or JSON",builder:e=>e.usage(`${a.bold("Usage:")} $0 export <format> [path]`).positional("path",Ce).command({command:"png [path]",describe:"export views to PNG",builder:u=>u.option("output",ge).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",V).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(`${a.bold("Examples:")}
330
371
  ${a.green("$0 export png")}
331
372
  ${a.gray("Search for likec4 files in current directory and output PNG next to sources")}
332
373
 
333
374
  ${a.green("$0 export png --theme dark -o ./png src/likec4 ")}
334
375
  ${a.gray("Search for likec4 files in src/likec4 and output PNG with dark theme to png folder")}
335
- `),handler:async u=>{be(u.timeout>=1,"timeout must be >= 1"),be(u["max-attempts"]>=1,"max-attempts must be >= 1"),await _u({path:u.path,useDotBin:u.useDotBin,output:u.output,timeoutMs:u.timeout*1e3,maxAttempts:u.maxAttempts,ignore:u.ignore===!0,outputType:u.flat?"flat":"relative",serverUrl:u.serverUrl,theme:u.theme??"light"})}}).command({command:"json [path]",describe:"export model to JSON",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:y}).option("use-dot",R).epilog(`${a.bold("Examples:")}
376
+ `),handler:async u=>{be(u.timeout>=1,"timeout must be >= 1"),be(u["max-attempts"]>=1,"max-attempts must be >= 1"),await Vu({path:u.path,useDotBin:u.useDotBin,output:u.output,timeoutMs:u.timeout*1e3,maxAttempts:u.maxAttempts,ignore:u.ignore===!0,outputType:u.flat?"flat":"relative",serverUrl:u.serverUrl,theme:u.theme??"light"})}}).command({command:"json [path]",describe:"export model to JSON",builder:u=>u.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:y}).option("use-dot",V).epilog(`${a.bold("Examples:")}
336
377
  ${a.green("$0 export json")}
337
378
  ${a.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
338
379
 
339
380
  ${a.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
340
381
  ${a.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
341
- `),handler:async u=>{await Mn({path:u.path,useDotBin:u.useDotBin,outfile:u.outfile})}}).updateStrings({"Commands:":a.bold("Formats:")}),handler:()=>{}};async function Jn(e){const{isDev:u,...n}=await Je({...e,likec4AssetsDir:"",webcomponentPrefix:void 0}),t=await He({port:Be(62001,62010)}),r=e?.open??!1;return await ft({...n,mode:"production",preview:{host:"0.0.0.0",port:t,open:r}})}async function zn({path:e,output:u,base:n}){const t=await z.fromWorkspace(e,{logger:"vite"}),r=await Jn({base:n,languageServices:t,outputDir:u,open:!0});Iu(r)}const Hn={command:"preview [path]",describe:"Start local server to preview production build",builder:e=>e.positional("path",{type:"string",desc:`Directory with LikeC4 source files
342
- 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"],oe).default("path",oe("."),"."),async handler(e){await zn(e)}};async function Gn({path:e,useDotBin:u,webcomponentPrefix:n,useHashHistory:t,useOverview:r=!1,base:i}){const o=await z.fromWorkspace(e,{graphviz:u?"binary":"wasm"}),c=await fe(re(me(),".likec4-assets-")),D=await Ou({buildWebcomponent:!1,hmr:!0,base:i,webcomponentPrefix:n,languageServices:o,useHashHistory:t,useOverviewGraph:r,likec4AssetsDir:c});if(D.config.logger.clearScreen("info"),Iu(D),!r)return;const l=await o.diagrams();if(tu(l,1)){const d=_("c4:export"),f=xu(D);if(!f){d.error("no preview server url");return}d.info(a.cyan("wait 5sec before generating previews")),await nu(5e3);try{await ju({serverUrl:f,logger:d,views:l,theme:"light",output:c,outputType:"flat"}),await nu(1e3),d.info(a.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(p){d.error(a.red("Failed to generate previews")),d.error(p)}}else D.config.logger.warn("no views found, no previews generated")}const Kn={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:e=>e.positional("path",Ce).option("base",lu).option("webcomponent-prefix",Se).option("use-hash-history",du).option("use-overview",pu).option("use-dot",R),handler:async e=>{await Gn({path:e.path,useDotBin:e["use-dot"],base:e.base,useOverview:e["use-overview"]??!1,webcomponentPrefix:e["webcomponent-prefix"],useHashHistory:e["use-hash-history"]})}};L.level=ru.debug,tt&&(L.level=ru.trace,L.warn("running cli in dev mode"));const qn=at(st(rt)).scriptName("likec4").usage("Usage: $0 <command>").command(Kn).command(Pn).command(Un).command(Wn).command(Hn).help("help").version(ut.version).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!1,"Something is wrong, run with --help for available options").updateStrings({"Options:":a.bold("Options:"),"Positionals:":a.bold("Arguments:"),"Commands:":a.bold("Commands:"),"Examples:":a.bold("Examples:")}).wrap(Ze(it.columns-20,{min:80,max:120})).parseAsync();qn.catch(()=>ot(1)),process.on("unhandledRejection",e=>{L.error(e)});
382
+ `),handler:async u=>{await Wn({path:u.path,useDotBin:u.useDotBin,outfile:u.outfile})}}).updateStrings({"Commands:":a.bold("Formats:")}),handler:()=>{}};async function Hn(e){const{isDev:u,...n}=await We({...e,likec4AssetsDir:"",webcomponentPrefix:void 0}),t=await He({port:Be(62001,62010)}),i=e?.open??!1;return await Ct({...n,mode:"production",preview:{host:"0.0.0.0",port:t,open:i}})}async function Gn({path:e,output:u,base:n}){const t=await z.fromWorkspace(e,{logger:"vite"}),i=await Hn({base:n,languageServices:t,outputDir:u,open:!0});xu(i)}const Kn={command:"preview [path]",describe:"Start local server to preview production build",builder:e=>e.positional("path",{type:"string",desc:`Directory with LikeC4 source files
383
+ 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"],oe).default("path",oe("."),"."),async handler(e){await Gn(e)}};async function qn({path:e,useDotBin:u,webcomponentPrefix:n,useHashHistory:t,useOverview:i=!1,base:r}){const o=await z.fromWorkspace(e,{logger:"vite",graphviz:u?"binary":"wasm"}),c=await fe(ie(me(),".likec4-assets-")),D=await ju({buildWebcomponent:!1,hmr:!0,base:r,webcomponentPrefix:n,languageServices:o,useHashHistory:t,useOverviewGraph:i,likec4AssetsDir:c});if(D.config.logger.clearScreen("info"),xu(D),!i)return;const l=await o.diagrams();if(nu(l,1)){const d=R("c4:export"),f=Lu(D);if(!f){d.error("no preview server url");return}d.info(a.cyan("wait 5sec before generating previews")),await iu(5e3);try{await Ru({serverUrl:f,logger:d,views:l,theme:"light",output:c,outputType:"flat"}),await iu(1e3),d.info(a.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(p){d.error(a.red("Failed to generate previews")),d.error(p)}}else D.config.logger.warn("no views found, no previews generated")}const Yn={command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:e=>e.positional("path",Ce).option("base",pu).option("webcomponent-prefix",Se).option("use-hash-history",lu).option("use-overview",fu).option("use-dot",V),handler:async e=>{await qn({path:e.path,useDotBin:e["use-dot"],base:e.base,useOverview:e["use-overview"]??!1,webcomponentPrefix:e["webcomponent-prefix"],useHashHistory:e["use-hash-history"]})}};x.level=ru.debug,it&&(x.level=ru.trace,x.warn("running cli in dev mode"));const Xn=Dt(ct(ot)).scriptName("likec4").usage("Usage: $0 <command>").command(Yn).command(On).command(Jn).command(zn).command(Kn).help("help").version(nt.version).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:":a.bold("Options:"),"Positionals:":a.bold("Arguments:"),"Commands:":a.bold("Commands:"),"Examples:":a.bold("Examples:")}).wrap(eu(at.columns-20,{min:80,max:120})).parseAsync();Xn.catch(()=>st(1)),process.on("unhandledRejection",e=>{x.error(e)});