likec4 1.50.0 → 1.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/__app__/src/ProjectsOverview.js +1 -1
  2. package/__app__/src/likec4.js +277 -164
  3. package/__app__/src/main.js +2 -56
  4. package/__app__/src/routes/index.js +85 -18
  5. package/__app__/src/routes/projects.js +1 -1
  6. package/__app__/src/routes/single.js +433 -53
  7. package/__app__/src/style.css +1 -1
  8. package/__app__/src/vendors.js +18646 -17381
  9. package/__app__/src/webcomponent.js +1 -1
  10. package/config/schema.json +1 -1
  11. package/dist/THIRD-PARTY-LICENSES.md +183 -285
  12. package/dist/_chunks/LikeC4.mjs +1 -1154
  13. package/dist/_chunks/filesystem.mjs +1229 -0
  14. package/dist/_chunks/index2.d.mts +49 -18
  15. package/dist/_chunks/libs/@hono/mcp.mjs +9 -9
  16. package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
  17. package/dist/_chunks/libs/@logtape/logtape.mjs +1 -1
  18. package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +13 -13
  19. package/dist/_chunks/libs/ansi-align.mjs +2 -0
  20. package/dist/_chunks/libs/ansi-regex.mjs +1 -0
  21. package/dist/_chunks/libs/ansi-styles.mjs +1 -0
  22. package/dist/_chunks/libs/atomically.mjs +1 -1
  23. package/dist/_chunks/libs/boxen.d.mts +1 -0
  24. package/dist/_chunks/libs/boxen.mjs +22 -0
  25. package/dist/_chunks/libs/conf.mjs +1 -1
  26. package/dist/_chunks/libs/langium.d.mts +1 -1
  27. package/dist/_chunks/libs/langium.mjs +17 -17
  28. package/dist/_chunks/libs/remeda.mjs +2 -2
  29. package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
  30. package/dist/_chunks/libs/vscode-languageserver.mjs +1 -0
  31. package/dist/_chunks/sequence.mjs +1 -1
  32. package/dist/_chunks/src.mjs +1 -1
  33. package/dist/_chunks/src2.mjs +64 -64
  34. package/dist/cli/index.mjs +84 -74
  35. package/dist/index.d.mts +836 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/vite-plugin/index.mjs +1 -1
  38. package/dist/vite-plugin/internal.mjs +1 -1
  39. package/package.json +23 -24
  40. package/react/index.d.mts +56 -2
  41. package/react/index.mjs +1575 -595
  42. package/dist/_chunks/binary.mjs +0 -72
  43. package/dist/_chunks/libs/@logtape/logtape.d.mts +0 -741
  44. package/dist/_chunks/libs/@msgpack/msgpack.mjs +0 -1
  45. package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -1
  46. package/dist/_chunks/libs/@smithy/util-base64.mjs +0 -1
@@ -1,2 +1,2 @@
1
- function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}function n(...e){return t(r,e)}const r=(e,t)=>t.some(t=>t(e));function i(...e){return t(a,e)}function a(e,t){if(t<1)throw RangeError(`chunk: A chunk size of '${t.toString()}' would result in an infinite array`);if(e.length===0)return[];if(t>=e.length)return[[...e]];let n=Math.ceil(e.length/t),r=Array(n);if(t===1)for(let[t,n]of e.entries())r[t]=[n];else for(let i=0;i<n;i+=1){let n=i*t;r[i]=e.slice(n,n+t)}return r}function o(...e){return t(s,e)}const s=(e,{min:t,max:n})=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e;function c(...e){return t(l,e)}const l=(e,t)=>[...e,...t],u={done:!0,hasNext:!1},d={done:!1,hasNext:!1},f=()=>u,p=e=>({hasNext:!0,next:e,done:!1});function m(e,...t){let n=e,r=t.map(e=>`lazy`in e?g(e):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!ee(n)){let e=t[i];n=e(n),i+=1;continue}let e=[];for(let n=i;n<t.length;n++){let t=r[n];if(t===void 0||(e.push(t),t.isSingle))break}let a=[];for(let t of n)if(h(t,a,e))break;let{isSingle:o}=e.at(-1);n=o?a[0]:a,i+=e.length}return n}function h(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=d,a=!1;for(let[e,o]of n.entries()){let{index:s,items:c}=o;if(c.push(r),i=o(r,s,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let r of i.next)if(h(r,t,n.slice(e+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function g(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function ee(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}function _(e,t){let n=t.length-e.length;if(n===1){let[n,...r]=t;return m(n,{lazy:e,lazyArgs:r})}if(n===0){let n={lazy:e,lazyArgs:t};return Object.assign(e=>m(e,n),n)}throw Error(`Wrong number of arguments`)}function v(...e){return _(y,e)}function y(e){if(e.length===0)return p;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return e=>{let n=t.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(t.set(e,n-1),d)}}function b(...e){return t(te,e)}const te=(e,t)=>e.length>=t;function ne(...e){return t(Object.entries,e)}function re(...e){return t(x,e,S)}const x=(e,t)=>e.filter(t),S=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:d,C=e=>Object.assign(e,{single:!0});function w(...e){return t(T,e,C(E))}const T=(e,t)=>e.find(t),E=e=>(t,n,r)=>e(t,n,r)?{done:!0,hasNext:!0,next:t}:d;function D(...e){return t(O,e)}const O=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}};function k(...e){return t(A,e,C(j))}const A=([e])=>e,j=()=>M,M=e=>({hasNext:!0,next:e,done:!0});function N(t,n){return typeof t==`object`?P(t,n):e(P,t===void 0?[]:[t],F)}const P=(e,t)=>t===void 0?e.flat():e.flat(t),F=e=>e===void 0||e===1?I:e<=0?p:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},I=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function L(...e){return t(R,e,z)}const R=(e,t)=>e.flatMap(t),z=e=>(t,n,r)=>{let i=e(t,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function B(...e){return t(V,e,H)}function V(e,t){return e.forEach(t),e}const H=e=>(t,n,r)=>(e(t,n,r),{done:!1,hasNext:!0,next:t});function U(...e){return t(W,e)}function W(e,t){for(let[n,r]of Object.entries(e))t(r,n,e);return e}const G=Symbol(`funnel/voidReducer`),K=()=>G;function q(e,{triggerAt:t=`end`,minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:a=K}){let o,s,c,l,u=()=>{let t=c;t!==void 0&&(c=void 0,t===G?e():e(t),i!==void 0&&(s=setTimeout(d,i)))},d=()=>{clearTimeout(s),s=void 0,o===void 0&&u()},f=()=>{clearTimeout(o),o=void 0,l=void 0,s===void 0&&u()};return{call:(...e)=>{let d=o===void 0&&s===void 0;if((t!==`start`||d)&&(c=a(c,...e)),!(o===void 0&&!d)){if(n!==void 0||r!==void 0||i===void 0){clearTimeout(o);let e=Date.now();l??=e;let t=r===void 0?n??0:Math.min(n??r,Math.max(0,r-(e-l)));o=setTimeout(f,t)}t!==`end`&&d&&u()}},cancel:()=>{clearTimeout(o),o=void 0,l=void 0,clearTimeout(s),s=void 0,c=void 0},flush:()=>{f(),d()},get isIdle(){return o===void 0&&s===void 0}}}function J(...e){return t(Y,e)}const Y=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let e=n[a];e===void 0?n[a]=[i]:e.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function X(...e){return t(ie,e)}function ie(e,t){let n=Object.create(null);for(let r of e){let e=r?.[t];if(e!==void 0){let t=n[e];t===void 0?n[e]=[r]:t.push(r)}}return Object.setPrototypeOf(n,Object.prototype),n}function ae(...e){return t(Z,e)}function Z(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return oe(e,t);if(e instanceof Map)return se(e,t);if(e instanceof Set)return ce(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[n,r]of Object.entries(e))if(!(n in t)||!Z(r,t[n]))return!1;return!0}function oe(e,t){if(e.length!==t.length)return!1;for(let[n,r]of e.entries())if(!Z(r,t[n]))return!1;return!0}function se(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e.entries())if(!t.has(n)||!Z(r,t.get(n)))return!1;return!0}function ce(e,t){if(e.size!==t.size)return!1;let n=[...t];for(let t of e){let e=!1;for(let[r,i]of n.entries())if(Z(t,i)){e=!0,n.splice(r,1);break}if(!e)return!1}return!0}function le(){return ue}const ue=e=>e;function de(...e){return t(fe,e)}function fe(e,t){let n={};for(let[r,i]of e.entries()){let a=t(i,r,e);n[a]=i}return n}function pe(e){return Array.isArray(e)}function me(e){return typeof e==`boolean`}function he(e){return e!==void 0}function ge(e){return e===``||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function _e(e){if(e==null||e===``)return!0;if(typeof e!=`object`)return!1;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return!1;return Object.getOwnPropertySymbols(e).length===0}function ve(e){return e!=null}function ye(e){return e==null}function be(e){return typeof e==`number`&&!Number.isNaN(e)}function xe(e){return e instanceof Promise}function Se(e){return typeof e==`string`}function Ce(e){return!!e}function we(...e){return t(Object.keys,e)}function Te(...e){return t(Ee,e)}const Ee=e=>e.at(-1);function De(...e){return t(Oe,e,ke)}const Oe=(e,t)=>e.map(t),ke=e=>(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)});function Ae(...e){return t(je,e)}function je(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}function Me(...e){return t(Ne,e)}function Ne(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}function Pe(...e){return t(Fe,e)}function Fe(e,t){if(!b(t,1))return{...e};if(!b(t,2)){let{[t[0]]:n,...r}=e;return r}let n={...e};for(let e of t)delete n[e];return n}function Ie(...e){return t(Le,e)}function Le(e,t){let n={...e};for(let[r,i]of Object.entries(n))t(i,r,e)&&delete n[r];return n}function Re(e){let t=!1,n;return()=>(t||=(n=e(),!0),n)}function ze(...e){return t(Be,e)}const Be=e=>e.length===1?e[0]:void 0;function Ve(...e){return t(He,e)}const He=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};function Ue(...e){return t(We,e)}function We(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ge(...e){return t=>m(t,...e)}function Ke(e,...t){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?n=>Q(n,e,...t):Q(e,...t)}function Q(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}function qe(...e){return t(Je,e)}const Je=(e,t,n)=>e.reduce(t,n);function $(...e){return t(Ye,e)}function Ye(e){return[...e].reverse()}function Xe(...e){return t(Ze,e)}function Ze(e,t){let n=[...e];return n.sort(t),n}function Qe(...e){return t($e,e,et)}const $e=(e,t)=>t<0?[]:e.slice(0,t);function et(e){if(e<=0)return f;let t=e;return e=>(--t,{done:t<=0,hasNext:!0,next:e})}function tt(...e){return t(nt,e)}function nt(e,t){return t(e),e}new Set([`-`,`_`,...` .
2
- .\v.\f.\r. .….\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)]);function rt(...e){return _(it,e)}function it(){let e=new Set;return t=>e.has(t)?d:(e.add(t),{done:!1,hasNext:!0,next:t})}function at(...e){return _(ot,e)}function ot(e){let t=e,n=new Set;return(e,r,i)=>{let a=t(e,r,i);return n.has(a)?d:(n.add(a),{done:!1,hasNext:!0,next:e})}}function st(...e){return t(Object.values,e)}export{i as $,he as A,B,Se as C,ve as D,ye as E,ae as F,w as G,N as H,X as I,b as J,re as K,J as L,pe as M,de as N,_e as O,le as P,o as Q,q as R,Ce as S,be as T,k as U,L as V,D as W,m as X,v as Y,c as Z,Me as _,Qe as a,Te as b,qe as c,Ue as d,n as et,Ve as f,Pe as g,Ie as h,tt as i,me as j,ge as k,Ke as l,Re as m,at as n,Xe as o,ze as p,ne as q,rt as r,$ as s,st as t,t as tt,Ge as u,Ae as v,xe as w,we as x,De as y,U as z};
1
+ function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}function n(...e){return t(r,e)}const r=(e,t)=>t.some(t=>t(e));function i(...e){return t(a,e)}function a(e,t){if(t<1)throw RangeError(`chunk: A chunk size of '${t.toString()}' would result in an infinite array`);if(e.length===0)return[];if(t>=e.length)return[[...e]];let n=Math.ceil(e.length/t),r=Array(n);if(t===1)for(let[t,n]of e.entries())r[t]=[n];else for(let i=0;i<n;i+=1){let n=i*t;r[i]=e.slice(n,n+t)}return r}function o(...e){return t(s,e)}const s=(e,{min:t,max:n})=>t!==void 0&&e<t?t:n!==void 0&&e>n?n:e;function c(...e){return t(l,e)}const l=(e,t)=>[...e,...t],u={done:!0,hasNext:!1},d={done:!1,hasNext:!1},f=()=>u,p=e=>({hasNext:!0,next:e,done:!1});function m(e,...t){let n=e,r=t.map(e=>`lazy`in e?g(e):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!ee(n)){let e=t[i];n=e(n),i+=1;continue}let e=[];for(let n=i;n<t.length;n++){let t=r[n];if(t===void 0||(e.push(t),t.isSingle))break}let a=[];for(let t of n)if(h(t,a,e))break;let{isSingle:o}=e.at(-1);n=o?a[0]:a,i+=e.length}return n}function h(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=d,a=!1;for(let[e,o]of n.entries()){let{index:s,items:c}=o;if(c.push(r),i=o(r,s,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let r of i.next)if(h(r,t,n.slice(e+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function g(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function ee(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}function _(e,t){let n=t.length-e.length;if(n===1){let[n,...r]=t;return m(n,{lazy:e,lazyArgs:r})}if(n===0){let n={lazy:e,lazyArgs:t};return Object.assign(e=>m(e,n),n)}throw Error(`Wrong number of arguments`)}function v(...e){return _(y,e)}function y(e){if(e.length===0)return p;let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return e=>{let n=t.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(t.set(e,n-1),d)}}function b(...e){return t(te,e)}const te=(e,t)=>e.length>=t;function ne(...e){return t(Object.entries,e)}function re(...e){return t(x,e,S)}const x=(e,t)=>e.filter(t),S=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:d,C=e=>Object.assign(e,{single:!0});function w(...e){return t(T,e,C(E))}const T=(e,t)=>e.find(t),E=e=>(t,n,r)=>e(t,n,r)?{done:!0,hasNext:!0,next:t}:d;function D(...e){return t(O,e)}const O=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}};function k(...e){return t(A,e,C(j))}const A=([e])=>e,j=()=>M,M=e=>({hasNext:!0,next:e,done:!0});function N(t,n){return typeof t==`object`?P(t,n):e(P,t===void 0?[]:[t],F)}const P=(e,t)=>t===void 0?e.flat():e.flat(t),F=e=>e===void 0||e===1?I:e<=0?p:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},I=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function L(...e){return t(R,e,z)}const R=(e,t)=>e.flatMap(t),z=e=>(t,n,r)=>{let i=e(t,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function B(...e){return t(V,e,H)}function V(e,t){return e.forEach(t),e}const H=e=>(t,n,r)=>(e(t,n,r),{done:!1,hasNext:!0,next:t});function U(...e){return t(W,e)}function W(e,t){for(let[n,r]of Object.entries(e))t(r,n,e);return e}const G=Symbol(`funnel/voidReducer`),K=()=>G;function q(e,{triggerAt:t=`end`,minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:a=K}){let o,s,c,l,u=()=>{let t=c;t!==void 0&&(c=void 0,t===G?e():e(t),i!==void 0&&(s=setTimeout(d,i)))},d=()=>{clearTimeout(s),s=void 0,o===void 0&&u()},f=()=>{clearTimeout(o),o=void 0,l=void 0,s===void 0&&u()};return{call:(...e)=>{let d=o===void 0&&s===void 0;if((t!==`start`||d)&&(c=a(c,...e)),!(o===void 0&&!d)){if(n!==void 0||r!==void 0||i===void 0){clearTimeout(o);let e=Date.now();l??=e;let t=r===void 0?n??0:Math.min(n??r,Math.max(0,r-(e-l)));o=setTimeout(f,t)}t!==`end`&&d&&u()}},cancel:()=>{clearTimeout(o),o=void 0,l=void 0,clearTimeout(s),s=void 0,c=void 0},flush:()=>{f(),d()},get isIdle(){return o===void 0&&s===void 0}}}function J(...e){return t(Y,e)}const Y=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let e=n[a];e===void 0?n[a]=[i]:e.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function X(...e){return t(ie,e)}function ie(e,t){let n=Object.create(null);for(let r of e){let e=r?.[t];if(e!==void 0){let t=n[e];t===void 0?n[e]=[r]:t.push(r)}}return Object.setPrototypeOf(n,Object.prototype),n}function ae(...e){return t(Z,e)}function Z(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return oe(e,t);if(e instanceof Map)return se(e,t);if(e instanceof Set)return ce(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[n,r]of Object.entries(e))if(!(n in t)||!Z(r,t[n]))return!1;return!0}function oe(e,t){if(e.length!==t.length)return!1;for(let[n,r]of e.entries())if(!Z(r,t[n]))return!1;return!0}function se(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e.entries())if(!t.has(n)||!Z(r,t.get(n)))return!1;return!0}function ce(e,t){if(e.size!==t.size)return!1;let n=[...t];for(let t of e){let e=!1;for(let[r,i]of n.entries())if(Z(t,i)){e=!0,n.splice(r,1);break}if(!e)return!1}return!0}function le(){return ue}const ue=e=>e;function de(...e){return t(fe,e)}function fe(e,t){let n={};for(let[r,i]of e.entries()){let a=t(i,r,e);n[a]=i}return n}function pe(e){return Array.isArray(e)}function me(e){return typeof e==`boolean`}function he(e){return e!==void 0}function ge(e){return e===``||e===void 0?!0:Array.isArray(e)?e.length===0:Object.keys(e).length===0}function _e(e){if(e==null||e===``)return!0;if(typeof e!=`object`)return!1;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return!1;return Object.getOwnPropertySymbols(e).length===0}function ve(e){return e!=null}function ye(e){return e==null}function be(e){return typeof e==`number`&&!Number.isNaN(e)}function xe(e){return e instanceof Promise}function Se(e){return typeof e==`string`}function Ce(e){return!!e}function we(...e){return t(Object.keys,e)}function Te(...e){return t(Ee,e)}const Ee=e=>e.at(-1);function De(...e){return t(Oe,e,ke)}const Oe=(e,t)=>e.map(t),ke=e=>(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)});function Ae(...e){return t(je,e)}function je(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}function Me(...e){return t(Ne,e)}function Ne(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}function Pe(...e){return t(Fe,e)}function Fe(e,t){if(!b(t,1))return{...e};if(!b(t,2)){let{[t[0]]:n,...r}=e;return r}let n={...e};for(let e of t)delete n[e];return n}function Ie(...e){return t(Le,e)}function Le(e,t){let n={...e};for(let[r,i]of Object.entries(n))t(i,r,e)&&delete n[r];return n}function Re(e){let t=!1,n;return()=>(t||=(n=e(),!0),n)}function ze(...e){return t(Be,e)}const Be=e=>e.length===1?e[0]:void 0;function Ve(...e){return t(He,e)}const He=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};function Ue(...e){return t(We,e)}function We(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ge(...e){return t=>m(t,...e)}function Ke(e,...t){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?n=>Q(n,e,...t):Q(e,...t)}function Q(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e]}return n}function qe(...e){return t(Je,e)}function Je(e){let t=[];for(let n=0;n<e;n++){let e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[Math.floor(Math.random()*62)];t.push(e)}return t.join(``)}function $(...e){return t(Ye,e)}const Ye=(e,t,n)=>e.reduce(t,n);function Xe(...e){return t(Ze,e)}function Ze(e){return[...e].reverse()}function Qe(...e){return t($e,e)}function $e(e,t){let n=[...e];return n.sort(t),n}function et(...e){return t(tt,e,nt)}const tt=(e,t)=>t<0?[]:e.slice(0,t);function nt(e){if(e<=0)return f;let t=e;return e=>(--t,{done:t<=0,hasNext:!0,next:e})}function rt(...e){return t(it,e)}function it(e,t){return t(e),e}new Set([`-`,`_`,...` .
2
+ .\v.\f.\r. .….\xA0. . . . . . . . . . . . .\u2028.\u2029. . . .`.split(`.`)]);function at(...e){return _(ot,e)}function ot(){let e=new Set;return t=>e.has(t)?d:(e.add(t),{done:!1,hasNext:!0,next:t})}function st(...e){return _(ct,e)}function ct(e){let t=e,n=new Set;return(e,r,i)=>{let a=t(e,r,i);return n.has(a)?d:(n.add(a),{done:!1,hasNext:!0,next:e})}}function lt(...e){return t(Object.values,e)}export{o as $,ge as A,U as B,Ce as C,ye as D,be as E,le as F,D as G,L as H,ae as I,ne as J,w as K,X as L,me as M,pe as N,ve as O,de as P,c as Q,J as R,we as S,xe as T,N as U,B as V,k as W,v as X,b as Y,m as Z,Pe as _,et as a,De as b,$ as c,Ge as d,i as et,Ue as f,Ie as g,Re as h,rt as i,he as j,_e as k,qe as l,ze as m,st as n,t as nt,Qe as o,Ve as p,re as q,at as r,Xe as s,lt as t,n as tt,Ke as u,Me as v,Se as w,Te as x,Ae as y,q as z};
@@ -1 +1 @@
1
- import{isatty as e}from"tty";var t=Object.entries({reset:[0,0],bold:[1,22,`\x1B[22m\x1B[1m`],dim:[2,22,`\x1B[22m\x1B[2m`],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]});function n(e){return String(e)}n.open=``,n.close=``;function r(e=!1){let t=typeof process<`u`?process:void 0,n=t?.env||{},r=t?.argv||[];return!(`NO_COLOR`in n||r.includes(`--no-color`))&&(`FORCE_COLOR`in n||r.includes(`--color`)||t?.platform===`win32`||e&&n.TERM!==`dumb`||`CI`in n)||typeof window<`u`&&!!window.chrome}function i(e=!1){let i=r(e),a=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},o=(e,t,n=e)=>{let r=r=>{let i=String(r),o=i.indexOf(t,e.length);return~o?e+a(i,t,n,o)+t:e+i+t};return r.open=e,r.close=t,r},s={isColorSupported:i},c=e=>`\x1B[${e}m`;for(let[e,r]of t)s[e]=i?o(c(r[0]),c(r[1]),r[2]):n;return s}var a=i(process.env.FORCE_TTY!==void 0||e(1));export{a as t};
1
+ import{isatty as e}from"tty";var t={reset:[0,0],bold:[1,22,`\x1B[22m\x1B[1m`],dim:[2,22,`\x1B[22m\x1B[2m`],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function n(e){return String(e)}n.open=``,n.close=``;function r(){let e=typeof process<`u`?process:void 0,t=e?.env||{},n=t.FORCE_TTY!==`false`,r=e?.argv||[];return!(`NO_COLOR`in t||r.includes(`--no-color`))&&(`FORCE_COLOR`in t||r.includes(`--color`)||e?.platform===`win32`||n&&t.TERM!==`dumb`||`CI`in t)||typeof window<`u`&&!!window.chrome}function i(){let e=r(),i=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},a=(e,t,n=e)=>{let r=r=>{let a=String(r),o=a.indexOf(t,e.length);return~o?e+i(a,t,n,o)+t:e+a+t};return r.open=e,r.close=t,r},o={isColorSupported:e},s=e=>`\x1B[${e}m`;for(let r in t){let i=t[r];o[r]=e?a(s(i[0]),s(i[1]),i[2]):n}return o}var a=i(),o=Object.entries({reset:[0,0],bold:[1,22,`\x1B[22m\x1B[1m`],dim:[2,22,`\x1B[22m\x1B[2m`],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]});function s(e){return String(e)}s.open=``,s.close=``;function c(e=!1){let t=typeof process<`u`?process:void 0,n=t?.env||{},r=t?.argv||[];return!(`NO_COLOR`in n||r.includes(`--no-color`))&&(`FORCE_COLOR`in n||r.includes(`--color`)||t?.platform===`win32`||e&&n.TERM!==`dumb`||`CI`in n)||typeof window<`u`&&!!window.chrome}function l(e=!1){let t=c(e),n=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},r=(e,t,r=e)=>{let i=i=>{let a=String(i),o=a.indexOf(t,e.length);return~o?e+n(a,t,r,o)+t:e+a+t};return i.open=e,i.close=t,i},i={isColorSupported:t},a=e=>`\x1B[${e}m`;for(let[e,n]of o)i[e]=t?r(a(n[0]),a(n[1]),n[2]):s;return i}var u=l(process.env.FORCE_TTY!==void 0||e(1));export{a as n,u as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"../rolldown-runtime.mjs";import{_ as t}from"./langium.mjs";var n=e(((e,n)=>{n.exports=t()}));export{n as t};
@@ -1 +1 @@
1
- import{H as e,I as t,J as n,L as r,X as i,_ as a,b as o,p as s,t as c,y as l}from"./libs/remeda.mjs";import{a as u,i as d,n as f,r as p,t as m}from"./libs/@lume/kiwi.mjs";import{getParallelStepsPrefix as h,isStepEdgeId as g}from"@likec4/core/types";import{DefaultMap as _,Stack as v,invariant as y,isAncestor as b,nonNullable as x,nonexhaustive as S}from"@likec4/core/utils";function C(e){return i(e,r(e=>e.parallelPrefix??void 0),a((e,t)=>e.reduce((e,t)=>(e.min.column=Math.min(e.min.column,t.from.column,t.to.column),e.min.row=Math.min(e.min.row,t.from.row,t.to.row),e.max.column=Math.max(e.max.column,t.from.column,t.to.column),e.max.row=Math.max(e.max.row,t.from.row,t.to.row),e),{parallelPrefix:t,min:{column:1/0,row:1/0},max:{column:-1/0,row:-1/0}})),c())}function w(e,t){if(e.length===0||e.length===t.length)return[];let n=e=>x(t.find(t=>t.id===e));function r(e){let t=e.parent?n(e.parent):null;return t?[t,...r(t)]:[]}let i=new v,a=[];return e.forEach(e=>{let t=r(e);if(t.length===0){i.clear();return}let n=v.from(t),o,s;for(;o=i.peek()?.node,s=n.peek(),!(!s||!o);){if(b(s.id,o.id)||s.id===o.id){n.pop();continue}if(!b(o.id,s.id)){i.pop();continue}break}for(;s=n.pop();){let t={node:s,from:e,to:e,nested:[]},n=i.peek();n?n.nested.push(t):a.push(t),i.push(t)}i.forEach(t=>t.to=e)}),a}var T=class{#e=new m;#t;#n=[];#r;#i;#a;#o=[];#s=[];constructor({actors:e,steps:t,compounds:n}){this.#a=this.newVar(30),this.#r=this.newVar(0),this.#i=this.newVar(0),this.#t=this.addActors(e);for(let e of n){let t=this.addCompound(e),n=t[0];this.constraint(n.y1,`==`,0,d.strong),this.put(this.#i).after(n.bottom),this.put(this.#a).after(n.y2),this.#n.push(...t)}for(let e of t)this.addStep(e);for(let e of C(t))this.addParallelRect(e);let r=this.#t[0];this.constraint(r.offset.left,`==`,0,d.strong);let i=this.#t.reduce((e,t)=>(this.put(t.x).after(e.right,60),this.put(t.offset.left,d.strong).after(e.offset.right,32),this.constraint(t.centerY,`==`,e.centerY,d.strong),this.put(this.#a).after(t.offset.bottom),t));if(this.put(this.#r).after(i.offset.right),this.put(this.#i).after(o(this.#o)?.bottom??this.#a),n.length>0)for(let e of this.#n){let t=e.from.column,n=e.to.column,r=Math.max(e.from.maxRow,e.to.maxRow);for(let e=t+1;e<n;e++){let t=this.actorBox(e);r=Math.max(r,t.maxRow)}let i=x(this.#o[r],`row ${r} not found`);this.put(e.bottom).after(i.bottom,16),this.put(this.#i).after(e.bottom)}this.#e.updateVariables()}getParallelBoxes(){return this.#s.map(({parallelPrefix:e,x1:t,y1:n,x2:r,y2:i})=>({parallelPrefix:e,x:t.value(),y:n.value(),width:r.value()-t.value(),height:i.value()-n.value()}))}getActorBox(e){let t=this.actorBox(e);return{x:t.x.value(),y:t.y.value(),width:t.width,height:t.height}}getCompoundBoxes(){return this.#n.map(({node:e,depth:t,x1:n,y1:r,x2:i,bottom:a})=>({node:e,depth:t,x:n.value(),y:r.value(),width:i.value()-n.value(),height:a.value()-r.value()}))}getPortCenter(e,t){let{column:n,row:r}=t===`source`?e.from:e.to,i=this.actorBox(n).centerX,{y:a}=x(this.#o[r]);return{cx:i.value(),cy:a.value()+32/2+e.offset,height:t===`source`?40:24}}getViewBounds(){return{x:0,y:0,width:this.#r.value(),height:this.#i.value()}}actorBox(e){if(typeof e!=`number`){let t=typeof e==`string`?e:e.id;e=this.#t.findIndex(e=>e.actor.id===t),y(e>=0,`actor ${t} not found`)}return x(this.#t[e],`actor at index ${e} not found`)}addActors(e){let t=0;return l(e,(e,n)=>{let r=this.newVar(t);t+=e.width+60;let i=this.newVar(0),a={column:n,actor:e,x:r,y:i,centerX:r.plus(Math.round(e.width/2)),centerY:i.plus(Math.round(e.height/2)),width:e.width,height:e.height,right:r.plus(e.width),bottom:i.plus(e.height),minRow:1/0,maxRow:-1/0},o=this.newVar(0),s=this.newVar(0),c=this.newVar(0),l=this.newVar(0);return this.put(o,d.strong).before(i),this.put(s,d.strong).before(r),this.put(c,d.strong).after(a.right),this.put(l,d.strong).after(a.bottom),{...a,offset:{top:o,left:s,right:c,bottom:l}}})}addStep(e){let t=this.actorBox(e.source),n=this.actorBox(e.target);t.minRow=Math.min(t.minRow,e.from.row),t.maxRow=Math.max(t.maxRow,e.from.row),n.minRow=Math.min(n.minRow,e.to.row),n.maxRow=Math.max(n.maxRow,e.to.row);let[r,i]=t.column<=n.column?[t,n]:[n,t],a=(e.label?.width??100)+50;r===i?this.constraint(r.centerX.plus(a),`<=`,r.offset.right):this.constraint(r.centerX.plus(a),`<=`,i.centerX);let o=e.label?.height?e.label.height+50+32/2:80;return o=Math.max(o,80)+e.offset,this.ensureRow(e.from.row,o),e.isSelfLoop&&this.ensureRow(e.to.row,80),this}addParallelRect({parallelPrefix:e,min:t,max:n}){let r=this.actorBox(t.column).centerX.minus(30),i=this.actorBox(n.column).centerX.plus(30),a=this.#o[t.row],o=this.#o[n.row];y(a&&o,`parallel box invalid minRow=${t.row} maxRow=${n.row}`);let s=this.newVar(0);this.put(s).before(a.y,40);let c=o.bottom,l=t.row>0&&this.#o[t.row-1];l&&this.put(s).after(l.bottom,16);let u=n.row<this.#o.length-1&&this.#o[n.row+1];u&&this.put(c).before(u.y,16),this.#s.push({parallelPrefix:e,x1:r,y1:s,x2:i,y2:c})}addCompound(e){let t=[],n=e.nested.flatMap(e=>{let n=this.addCompound(e);return t.push(n[0]),n}),r=Math.max(...n.map(e=>e.depth+1),0),i=this.actorBox(e.from),a=this.actorBox(e.to),o=i.offset.left.minus(32);i.offset.left=o;let c=a.offset.right.plus(32);a.offset.right=c;let l=this.newVar(0),u=s(t),d,f;switch(!0){case!!u:d=u.y1.minus(40),f=u.y2.plus(32),this.put(l).after(u.bottom,32);break;case a===i:d=this.newVar(0),f=this.newVar(0),this.put(d).before(i.offset.top,52),this.put(f).after(i.offset.bottom,32),this.put(l).after(f);break;case t.length>0:d=this.newVar(0),f=this.newVar(0);for(let e of t)this.put(d).before(e.y1,32),this.put(f).after(e.y2,32),this.put(l).after(e.bottom,32);break;default:d=this.newVar(0),f=this.newVar(0);for(var p=i.column;p<=a.column;p++){let e=this.actorBox(p).offset;this.put(d).before(e.top,52),this.put(f).after(e.bottom,32)}this.put(l).after(f);break}for(var p=i.column;p<=a.column;p++){let e=this.actorBox(p).offset;e.top=d,e.bottom=f}return[{node:e.node,depth:r,from:i,to:a,x1:o,y1:d,x2:c,y2:f,bottom:l},...n]}ensureRow(e,t){for(;e>=this.#o.length;){let e=this.#o.length>0&&this.#o[this.#o.length-1]?.bottom||this.#a.plus(30),t=this.newVar(this.#o.length*80);this.put(t).after(e);let n=this.newVar(80);this.require(n,`>=`,80),this.#o.push({y:t,height:n,bottom:t.plus(n),lastHeight:80})}let n=x(this.#o[e]);t>n.lastHeight&&(n.lastHeight=t,this.require(n.height,`>=`,t),this.#e.suggestValue(n.height,t))}newVar(e){let t=new u;return this.#e.addEditVariable(t,d.weak),typeof e==`number`&&(this.#e.suggestValue(t,e),this.constraint(t,`>=`,0,d.strong)),t}require(e,t,n=void 0){switch(this.constraint(e,t,n,d.required),t){case`<=`:case`>=`:this.constraint(e,`==`,n,d.weak);break;case`<= 0`:case`>= 0`:this.constraint(e,`== 0`,void 0,d.weak);break}}constraint(e,t,n=void 0,r=d.medium){let i;switch(t){case`==`:i=p.Eq;break;case`>=`:i=p.Ge;break;case`<=`:i=p.Le;break;case`== 0`:i=p.Eq,n=0;break;case`>= 0`:i=p.Ge,n=0;break;case`<= 0`:i=p.Le,n=0;break;default:S(t)}this.#e.addConstraint(new f(e,i,n??0,r))}put(e,t=d.required){let n=t===d.required?d.medium:d.weak;return{before:(r,i)=>{i&&(r=r.minus(i)),this.constraint(e,`<=`,r,t),this.constraint(e,`==`,r,n)},after:(r,i)=>{i&&(r=r.plus(i)),this.constraint(e,`>=`,r,t),this.constraint(e,`==`,r,n)}}}};function E(r){let o=new Set,s=e=>x(r.nodes.find(t=>t.id===e)),u=[];for(let e of r.edges.filter(e=>g(e.id))){let t=s(e.source),n=s(e.target);if(t.children.length||n.children.length){console.error(`Sequence view does not support nested actors`);continue}o.add(t),o.add(n),u.push({edge:e,source:t,target:n})}let d=r.nodes.filter(e=>o.has(e));y(n(d,1),`actors array must not be empty`);let f=new _(()=>[]),p=[],m=0;for(let{edge:e,source:t,target:n}of u){let r=p.at(-1),i=d.indexOf(t),a=d.indexOf(n),o=t===n,s=i>a,c=h(e.id),l=!1;r&&r.target==t&&r.parallelPrefix===c&&(l=r.isSelfLoop!==o||r.isBack===s),l||m++;let u={id:e.id,from:{column:i,row:m},to:{column:a,row:o?++m:m},edge:e,isSelfLoop:o,isBack:s,parallelPrefix:c,offset:l?(r?.offset??0)+22:0,source:t,target:n,label:e.labelBBox?{height:e.labelBBox.height+8+(e.navigateTo?20:0),width:e.labelBBox.width+16,text:e.label}:null};p.push(u),f.get(t).push({step:u,row:m,type:`source`,position:s&&!o?`left`:`right`}),f.get(n).push({step:u,row:m,type:`target`,position:s||o?`right`:`left`})}let v=new T({actors:d,steps:p,compounds:w(d,r.nodes)}),b=v.getViewBounds(),S=i(v.getCompoundBoxes(),l(({node:e,...t})=>({...t,id:e.id,origin:e.id})),t(`id`),a((e,t)=>n(e,2)?l(e,(e,n)=>({...e,id:`${t}-${n+1}`})):e),c(),e());return{actors:d.map(e=>D({actor:e,ports:f.get(e),layout:v})),compounds:S,steps:l(p,e=>({id:e.id,sourceHandle:e.id+`_source`,targetHandle:e.id+`_target`,...e.label&&{labelBBox:{width:e.label.width,height:e.label.height}}})),parallelAreas:v.getParallelBoxes(),bounds:b}}function D({actor:e,ports:t,layout:n}){let{x:r,y:i,width:a,height:o}=n.getActorBox(e);return{id:e.id,x:r,y:i,width:a,height:o,ports:t.map(e=>{let t=n.getPortCenter(e.step,e.type);return{id:`${e.step.id}_${e.type}`,cx:t.cx-r,cy:t.cy-i,height:t.height,type:e.type,position:e.position}})}}export{E as t};
1
+ import{L as e,R as t,U as n,Y as r,Z as i,b as a,m as o,t as s,v as c,x as l}from"./libs/remeda.mjs";import{a as u,i as d,n as f,r as p,t as m}from"./libs/@lume/kiwi.mjs";import{getParallelStepsPrefix as h,isStepEdgeId as g}from"@likec4/core/types";import{DefaultMap as _,Stack as v,invariant as y,isAncestor as b,nonNullable as x,nonexhaustive as S}from"@likec4/core/utils";function C(e){return i(e,t(e=>e.parallelPrefix??void 0),c((e,t)=>e.reduce((e,t)=>(e.min.column=Math.min(e.min.column,t.from.column,t.to.column),e.min.row=Math.min(e.min.row,t.from.row,t.to.row),e.max.column=Math.max(e.max.column,t.from.column,t.to.column),e.max.row=Math.max(e.max.row,t.from.row,t.to.row),e),{parallelPrefix:t,min:{column:1/0,row:1/0},max:{column:-1/0,row:-1/0}})),s())}function w(e,t){if(e.length===0||e.length===t.length)return[];let n=e=>x(t.find(t=>t.id===e));function r(e){let t=e.parent?n(e.parent):null;return t?[t,...r(t)]:[]}let i=new v,a=[];return e.forEach(e=>{let t=r(e);if(t.length===0){i.clear();return}let n=v.from(t),o,s;for(;o=i.peek()?.node,s=n.peek(),!(!s||!o);){if(b(s.id,o.id)||s.id===o.id){n.pop();continue}if(!b(o.id,s.id)){i.pop();continue}break}for(;s=n.pop();){let t={node:s,from:e,to:e,nested:[]},n=i.peek();n?n.nested.push(t):a.push(t),i.push(t)}i.forEach(t=>t.to=e)}),a}var T=class{#e=new m;#t;#n=[];#r;#i;#a;#o=[];#s=[];constructor({actors:e,steps:t,compounds:n}){this.#a=this.newVar(30),this.#r=this.newVar(0),this.#i=this.newVar(0),this.#t=this.addActors(e);for(let e of n){let t=this.addCompound(e),n=t[0];this.constraint(n.y1,`==`,0,d.strong),this.put(this.#i).after(n.bottom),this.put(this.#a).after(n.y2),this.#n.push(...t)}for(let e of t)this.addStep(e);for(let e of C(t))this.addParallelRect(e);let r=this.#t[0];this.constraint(r.offset.left,`==`,0,d.strong);let i=this.#t.reduce((e,t)=>(this.put(t.x).after(e.right,60),this.put(t.offset.left,d.strong).after(e.offset.right,32),this.constraint(t.centerY,`==`,e.centerY,d.strong),this.put(this.#a).after(t.offset.bottom),t));if(this.put(this.#r).after(i.offset.right),this.put(this.#i).after(l(this.#o)?.bottom??this.#a),n.length>0)for(let e of this.#n){let t=e.from.column,n=e.to.column,r=Math.max(e.from.maxRow,e.to.maxRow);for(let e=t+1;e<n;e++){let t=this.actorBox(e);r=Math.max(r,t.maxRow)}let i=x(this.#o[r],`row ${r} not found`);this.put(e.bottom).after(i.bottom,16),this.put(this.#i).after(e.bottom)}this.#e.updateVariables()}getParallelBoxes(){return this.#s.map(({parallelPrefix:e,x1:t,y1:n,x2:r,y2:i})=>({parallelPrefix:e,x:t.value(),y:n.value(),width:r.value()-t.value(),height:i.value()-n.value()}))}getActorBox(e){let t=this.actorBox(e);return{x:t.x.value(),y:t.y.value(),width:t.width,height:t.height}}getCompoundBoxes(){return this.#n.map(({node:e,depth:t,x1:n,y1:r,x2:i,bottom:a})=>({node:e,depth:t,x:n.value(),y:r.value(),width:i.value()-n.value(),height:a.value()-r.value()}))}getPortCenter(e,t){let{column:n,row:r}=t===`source`?e.from:e.to,i=this.actorBox(n).centerX,{y:a}=x(this.#o[r]);return{cx:i.value(),cy:a.value()+32/2+e.offset,height:t===`source`?40:24}}getViewBounds(){return{x:0,y:0,width:this.#r.value(),height:this.#i.value()}}actorBox(e){if(typeof e!=`number`){let t=typeof e==`string`?e:e.id;e=this.#t.findIndex(e=>e.actor.id===t),y(e>=0,`actor ${t} not found`)}return x(this.#t[e],`actor at index ${e} not found`)}addActors(e){let t=0;return a(e,(e,n)=>{let r=this.newVar(t);t+=e.width+60;let i=this.newVar(0),a={column:n,actor:e,x:r,y:i,centerX:r.plus(Math.round(e.width/2)),centerY:i.plus(Math.round(e.height/2)),width:e.width,height:e.height,right:r.plus(e.width),bottom:i.plus(e.height),minRow:1/0,maxRow:-1/0},o=this.newVar(0),s=this.newVar(0),c=this.newVar(0),l=this.newVar(0);return this.put(o,d.strong).before(i),this.put(s,d.strong).before(r),this.put(c,d.strong).after(a.right),this.put(l,d.strong).after(a.bottom),{...a,offset:{top:o,left:s,right:c,bottom:l}}})}addStep(e){let t=this.actorBox(e.source),n=this.actorBox(e.target);t.minRow=Math.min(t.minRow,e.from.row),t.maxRow=Math.max(t.maxRow,e.from.row),n.minRow=Math.min(n.minRow,e.to.row),n.maxRow=Math.max(n.maxRow,e.to.row);let[r,i]=t.column<=n.column?[t,n]:[n,t],a=(e.label?.width??100)+50;r===i?this.constraint(r.centerX.plus(a),`<=`,r.offset.right):this.constraint(r.centerX.plus(a),`<=`,i.centerX);let o=e.label?.height?e.label.height+50+32/2:80;return o=Math.max(o,80)+e.offset,this.ensureRow(e.from.row,o),e.isSelfLoop&&this.ensureRow(e.to.row,80),this}addParallelRect({parallelPrefix:e,min:t,max:n}){let r=this.actorBox(t.column).centerX.minus(30),i=this.actorBox(n.column).centerX.plus(30),a=this.#o[t.row],o=this.#o[n.row];y(a&&o,`parallel box invalid minRow=${t.row} maxRow=${n.row}`);let s=this.newVar(0);this.put(s).before(a.y,40);let c=o.bottom,l=t.row>0&&this.#o[t.row-1];l&&this.put(s).after(l.bottom,16);let u=n.row<this.#o.length-1&&this.#o[n.row+1];u&&this.put(c).before(u.y,16),this.#s.push({parallelPrefix:e,x1:r,y1:s,x2:i,y2:c})}addCompound(e){let t=[],n=e.nested.flatMap(e=>{let n=this.addCompound(e);return t.push(n[0]),n}),r=Math.max(...n.map(e=>e.depth+1),0),i=this.actorBox(e.from),a=this.actorBox(e.to),s=i.offset.left.minus(32);i.offset.left=s;let c=a.offset.right.plus(32);a.offset.right=c;let l=this.newVar(0),u=o(t),d,f;switch(!0){case!!u:d=u.y1.minus(40),f=u.y2.plus(32),this.put(l).after(u.bottom,32);break;case a===i:d=this.newVar(0),f=this.newVar(0),this.put(d).before(i.offset.top,52),this.put(f).after(i.offset.bottom,32),this.put(l).after(f);break;case t.length>0:d=this.newVar(0),f=this.newVar(0);for(let e of t)this.put(d).before(e.y1,32),this.put(f).after(e.y2,32),this.put(l).after(e.bottom,32);break;default:d=this.newVar(0),f=this.newVar(0);for(var p=i.column;p<=a.column;p++){let e=this.actorBox(p).offset;this.put(d).before(e.top,52),this.put(f).after(e.bottom,32)}this.put(l).after(f);break}for(var p=i.column;p<=a.column;p++){let e=this.actorBox(p).offset;e.top=d,e.bottom=f}return[{node:e.node,depth:r,from:i,to:a,x1:s,y1:d,x2:c,y2:f,bottom:l},...n]}ensureRow(e,t){for(;e>=this.#o.length;){let e=this.#o.length>0&&this.#o[this.#o.length-1]?.bottom||this.#a.plus(30),t=this.newVar(this.#o.length*80);this.put(t).after(e);let n=this.newVar(80);this.require(n,`>=`,80),this.#o.push({y:t,height:n,bottom:t.plus(n),lastHeight:80})}let n=x(this.#o[e]);t>n.lastHeight&&(n.lastHeight=t,this.require(n.height,`>=`,t),this.#e.suggestValue(n.height,t))}newVar(e){let t=new u;return this.#e.addEditVariable(t,d.weak),typeof e==`number`&&(this.#e.suggestValue(t,e),this.constraint(t,`>=`,0,d.strong)),t}require(e,t,n=void 0){switch(this.constraint(e,t,n,d.required),t){case`<=`:case`>=`:this.constraint(e,`==`,n,d.weak);break;case`<= 0`:case`>= 0`:this.constraint(e,`== 0`,void 0,d.weak);break}}constraint(e,t,n=void 0,r=d.medium){let i;switch(t){case`==`:i=p.Eq;break;case`>=`:i=p.Ge;break;case`<=`:i=p.Le;break;case`== 0`:i=p.Eq,n=0;break;case`>= 0`:i=p.Ge,n=0;break;case`<= 0`:i=p.Le,n=0;break;default:S(t)}this.#e.addConstraint(new f(e,i,n??0,r))}put(e,t=d.required){let n=t===d.required?d.medium:d.weak;return{before:(r,i)=>{i&&(r=r.minus(i)),this.constraint(e,`<=`,r,t),this.constraint(e,`==`,r,n)},after:(r,i)=>{i&&(r=r.plus(i)),this.constraint(e,`>=`,r,t),this.constraint(e,`==`,r,n)}}}};function E(t){let o=new Set,l=e=>x(t.nodes.find(t=>t.id===e)),u=[];for(let e of t.edges.filter(e=>g(e.id))){let t=l(e.source),n=l(e.target);if(t.children.length||n.children.length){console.error(`Sequence view does not support nested actors`);continue}o.add(t),o.add(n),u.push({edge:e,source:t,target:n})}let d=t.nodes.filter(e=>o.has(e));y(r(d,1),`actors array must not be empty`);let f=new _(()=>[]),p=[],m=0;for(let{edge:e,source:t,target:n}of u){let r=p.at(-1),i=d.indexOf(t),a=d.indexOf(n),o=t===n,s=i>a,c=h(e.id),l=!1;r&&r.target==t&&r.parallelPrefix===c&&(l=r.isSelfLoop!==o||r.isBack===s),l||m++;let u={id:e.id,from:{column:i,row:m},to:{column:a,row:o?++m:m},edge:e,isSelfLoop:o,isBack:s,parallelPrefix:c,offset:l?(r?.offset??0)+22:0,source:t,target:n,label:e.labelBBox?{height:e.labelBBox.height+8+(e.navigateTo?20:0),width:e.labelBBox.width+16,text:e.label}:null};p.push(u),f.get(t).push({step:u,row:m,type:`source`,position:s&&!o?`left`:`right`}),f.get(n).push({step:u,row:m,type:`target`,position:s||o?`right`:`left`})}let v=new T({actors:d,steps:p,compounds:w(d,t.nodes)}),b=v.getViewBounds(),S=i(v.getCompoundBoxes(),a(({node:e,...t})=>({...t,id:e.id,origin:e.id})),e(`id`),c((e,t)=>r(e,2)?a(e,(e,n)=>({...e,id:`${t}-${n+1}`})):e),s(),n());return{actors:d.map(e=>D({actor:e,ports:f.get(e),layout:v})),compounds:S,steps:a(p,e=>({id:e.id,sourceHandle:e.id+`_source`,targetHandle:e.id+`_target`,...e.label&&{labelBBox:{width:e.label.width,height:e.label.height}}})),parallelAreas:v.getParallelBoxes(),bounds:b}}function D({actor:e,ports:t,layout:n}){let{x:r,y:i,width:a,height:o}=n.getActorBox(e);return{id:e.id,x:r,y:i,width:a,height:o,ports:t.map(e=>{let t=n.getPortCenter(e.step,e.type);return{id:`${e.step.id}_${e.type}`,cx:t.cx-r,cy:t.cy-i,height:t.height,type:e.type,position:e.position}})}}export{E as t};
@@ -11,5 +11,5 @@ These values will be used if such property is not defined`}),relationship:P.opti
11
11
  These values will be used if such property is not defined`})}).meta({id:`DefaultStyleValues`}),I=t.union([t.string().min(1,`Custom CSS file path cannot be empty`),t.array(t.string().min(1,`Custom CSS file path cannot be empty`))]).meta({id:`CustomStylesheets`}),L=t.strictObject({theme:M.optional().meta({description:`Project theme customization`}),defaults:F.optional().meta({description:`Override default values for style properties
12
12
  These values will be used if such property is not defined`}),customCss:I.optional().meta({description:`Custom CSS (or list of CSS files) to be included in the generated diagrams`})}).transform(({theme:e,defaults:t,customCss:n})=>l({defaults:R(t),customCss:ne(n),theme:e}));function R(e){if(!e)return;let{relationship:t,group:n,...r}=e;return l({...r,relationship:t&&l(t),group:n&&l(n)})}function ne(e){if(!e)return;let t=(Array.isArray(e)?e:[e]).filter(Boolean);if(t.length!==0)return{paths:t,content:``}}const z=t.strictObject({outDir:t.string().default(`.likec4`).meta({description:[`Path to the directory where manual layouts will be stored,`,`relative to the folder containing the project config. `,``,`Defaults to '.likec4'.`].join(`
13
13
  `)})}).meta({id:`ManualLayoutsConfig`,description:`Configuration for manual layouts`}),B=t.object({name:t.string().nonempty(`Project name cannot be empty`).refine(e=>e!==`default`,{abort:!0,error:`Project name cannot be "default"`}).refine(e=>!e.includes(`.`)&&!e.includes(`@`)&&!e.includes(`#`),{abort:!0,error:`Project name cannot contain ".", "@" or "#", try to use A-z, 0-9, _ and -`}).meta({description:`Project name, must be unique in the workspace`}),extends:t.union([t.string().min(1,`Extend path cannot be empty`),t.array(t.string().min(1,`Extend path cannot be empty`)).min(1,`Extend list cannot be empty`)]).optional().meta({description:`Extend styles from other config files`}),title:t.string().nonempty(`Project title cannot be empty if specified`).optional().meta({description:`A human readable title for the project`}),contactPerson:t.string().nonempty(`Contact person cannot be empty if specified`).optional().meta({description:`A person who has been involved in creating or maintaining this project`}),metadata:t.record(t.string(),t.any()).optional().meta({description:`Arbitrary metadata as key-value pairs for custom project information`}),styles:L.optional().meta({description:`Project styles customization`}),imageAliases:m.optional(),include:g.optional(),exclude:t.array(t.string()).optional().meta({description:`List of file patterns to exclude from the project, default is ["**/node_modules/**"]`}),manualLayouts:z.optional(),inferTechnologyFromIcon:t.boolean().optional().meta({description:[`Automatically derive element technology from icon name when technology is not set explicitly.`,`Applies to aws:, azure:, gcp:, and tech: icons. Bootstrap icons are excluded.`,`Defaults to true.`].join(`
14
- `)}),implicitViews:t.boolean().optional().meta({description:`Auto-generate scoped views for elements without explicit views. Defaults to true.`})}).meta({id:`LikeC4ProjectConfig`,description:`LikeC4 Project Configuration`}),V=t.instanceof(Function),H=t.record(t.string(),V),U=B.extend({generators:H.optional()});function W(e){let n=U.safeParse(e);if(n.success)return n.data;throw Error(`Config validation failed:
14
+ `)}),implicitViews:t.boolean().optional().meta({description:`Auto-generate scoped views for elements without explicit views. Defaults to false.`})}).meta({id:`LikeC4ProjectConfig`,description:`LikeC4 Project Configuration`}),V=t.instanceof(Function),H=t.record(t.string(),V),U=B.extend({generators:H.optional()});function W(e){let n=U.safeParse(e);if(n.success)return n.data;throw Error(`Config validation failed:
15
15
  `+t.prettifyError(n.error))}function G(t){return W(e.parse(t.trim()||`{}`))}const K={parse:G,validate:W,normalizeInclude:e=>{let t=g.safeParse(e);return t.success?t.data:{paths:[],maxDepth:3,fileThreshold:30}}};function q(e){let t=e.length;for(;t>0&&(e[t-1]===`/`||e[t-1]===`\\`);)t--;return e.slice(0,t)}function J(e){return e.split(`/`).flatMap(e=>e.split(`\\`))}function Y(e){let t=q(e),n=J(t);return n[n.length-1]||t}const X=[`.likec4rc`,`.likec4.config.json`,`likec4.config.json`],Z=[`likec4.config.js`,`likec4.config.cjs`,`likec4.config.mjs`,`likec4.config.ts`,`likec4.config.cts`,`likec4.config.mts`];[...X,...Z];function Q(e){return X.includes(Y(e))}function $(e){return Z.includes(Y(e))}function re(e){return Q(e)||$(e)}function ie(e){return U.parse(e)}function ae(e){return H.parse(e)}function oe(e){return O.parse(e)}function se(e){return M.parse(e)}function ce(e){return L.parse(e)}export{oe as a,$ as c,W as d,se as i,K as l,ae as n,re as o,ce as r,Q as s,ie as t,B as u};