likec4 1.55.1 → 1.57.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 (244) hide show
  1. package/__app__/chunks/AIChat2.mjs +2 -0
  2. package/__app__/chunks/DiagramActorProvider.mjs +10 -0
  3. package/__app__/chunks/EmbedPage.mjs +1 -0
  4. package/__app__/chunks/ExportPage.mjs +2 -0
  5. package/__app__/chunks/LikeC4Diagram.mjs +19 -0
  6. package/__app__/chunks/LikeC4Styles.mjs +48 -0
  7. package/__app__/chunks/Markdown.mjs +1 -0
  8. package/__app__/chunks/NavigationPanel.mjs +1 -0
  9. package/__app__/chunks/ViewReact.mjs +1 -0
  10. package/__app__/chunks/adhoc-editor.mjs +1 -0
  11. package/__app__/chunks/aichat.mjs +1 -0
  12. package/__app__/chunks/box.mjs +1 -0
  13. package/__app__/chunks/create-style-context.mjs +1 -0
  14. package/__app__/chunks/css.mjs +1 -0
  15. package/__app__/chunks/factory.mjs +1 -0
  16. package/__app__/chunks/hooks.mjs +1 -0
  17. package/__app__/chunks/hstack.mjs +1 -0
  18. package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -0
  19. package/__app__/chunks/libs/@floating-ui/core.mjs +1 -0
  20. package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -0
  21. package/__app__/chunks/libs/@floating-ui/react.mjs +1 -0
  22. package/__app__/chunks/libs/@mantine/core.mjs +41 -0
  23. package/__app__/chunks/libs/@mantine/hooks.mjs +1 -0
  24. package/__app__/chunks/libs/@nanostores/react.mjs +1 -0
  25. package/__app__/chunks/libs/@react-hookz/web.mjs +1 -0
  26. package/__app__/chunks/libs/@tabler/icons-react.mjs +358 -0
  27. package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
  28. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
  29. package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
  30. package/__app__/chunks/libs/@tanstack/ai.mjs +2 -0
  31. package/__app__/chunks/libs/@tanstack/history.mjs +1 -0
  32. package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -0
  33. package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -0
  34. package/__app__/chunks/libs/@xstate/react.mjs +1 -0
  35. package/__app__/chunks/libs/@xstate/store.mjs +1 -0
  36. package/__app__/chunks/libs/@xyflow/react.mjs +7 -0
  37. package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -0
  38. package/__app__/chunks/libs/@zag-js/collection.mjs +1 -0
  39. package/__app__/chunks/libs/@zag-js/core.mjs +1 -0
  40. package/__app__/chunks/libs/@zag-js/react.mjs +1 -0
  41. package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -0
  42. package/__app__/chunks/libs/bezier-js.mjs +1 -0
  43. package/__app__/chunks/libs/copy-anything.mjs +1 -0
  44. package/__app__/chunks/libs/d3-path.mjs +1 -0
  45. package/__app__/chunks/libs/d3-shape.mjs +1 -0
  46. package/__app__/chunks/libs/fast-equals.mjs +1 -0
  47. package/__app__/chunks/libs/framer-motion.mjs +9 -0
  48. package/__app__/chunks/libs/html-to-image.mjs +2 -0
  49. package/__app__/chunks/libs/motion-dom.mjs +1 -0
  50. package/__app__/chunks/libs/nanostores.mjs +1 -0
  51. package/__app__/chunks/libs/react-error-boundary.mjs +1 -0
  52. package/__app__/chunks/libs/react-resizable-panels.mjs +1 -0
  53. package/__app__/chunks/libs/remeda.mjs +1 -0
  54. package/__app__/chunks/libs/superjson.mjs +1 -0
  55. package/__app__/chunks/libs/zod.mjs +64 -0
  56. package/__app__/chunks/rolldown-runtime.mjs +1 -0
  57. package/__app__/chunks/styles.css.mjs +1 -0
  58. package/__app__/chunks/txt.mjs +1 -0
  59. package/__app__/chunks/useLikeC4Project.mjs +1 -0
  60. package/__app__/codegen/react.mjs +11 -0
  61. package/__app__/codegen/webcomponent.mjs +942 -0
  62. package/__app__/src/aichat/index.mjs +1 -0
  63. package/__app__/src/fonts.css +1 -1
  64. package/__app__/src/main.mjs +45 -0
  65. package/__app__/src/pages/AdHocViewEditor.mjs +1 -0
  66. package/__app__/src/pages/EmbedPage.mjs +1 -0
  67. package/__app__/src/pages/ExportPage.mjs +1 -0
  68. package/__app__/src/pages/ProjectsOverview.mjs +1 -0
  69. package/__app__/src/pages/ViewAsD2.mjs +1 -0
  70. package/__app__/src/pages/ViewAsDot.mjs +1 -0
  71. package/__app__/src/pages/ViewAsMmd.mjs +1 -0
  72. package/__app__/src/pages/ViewAsPuml.mjs +1 -0
  73. package/__app__/src/pages/ViewEditor.mjs +1 -0
  74. package/__app__/src/pages/ViewReact.mjs +1 -0
  75. package/__app__/src/style.css +1 -1
  76. package/config/schema.json +14 -41
  77. package/dist/chunks/enableServer.mjs +1 -0
  78. package/dist/chunks/filenames.mjs +17 -0
  79. package/dist/{_chunks → chunks}/index.d.mts +2 -1
  80. package/dist/{_chunks → chunks}/index2.d.mts +639 -388
  81. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
  82. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
  83. package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
  84. package/dist/chunks/libs/@hono/mcp.mjs +70 -0
  85. package/dist/chunks/libs/@hono/node-server.mjs +1 -0
  86. package/dist/{_chunks → chunks}/libs/@logtape/logtape.d.mts +2 -0
  87. package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
  88. package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
  89. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
  90. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  91. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  92. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  93. package/dist/chunks/libs/ajv.mjs +1 -0
  94. package/dist/chunks/libs/ansi-align.mjs +2 -0
  95. package/dist/chunks/libs/ansi-regex.mjs +1 -0
  96. package/dist/chunks/libs/ansi-styles.mjs +1 -0
  97. package/dist/chunks/libs/atomically.mjs +1 -0
  98. package/dist/chunks/libs/birpc.mjs +1 -0
  99. package/dist/chunks/libs/boxen.mjs +22 -0
  100. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
  101. package/dist/chunks/libs/chevrotain.mjs +58 -0
  102. package/dist/chunks/libs/conf.mjs +1 -0
  103. package/dist/chunks/libs/defu.mjs +1 -0
  104. package/dist/chunks/libs/destr.mjs +1 -0
  105. package/dist/chunks/libs/eventemitter3.mjs +1 -0
  106. package/dist/chunks/libs/find-up-simple.mjs +1 -0
  107. package/dist/chunks/libs/get-port.mjs +1 -0
  108. package/dist/chunks/libs/hono.mjs +1 -0
  109. package/dist/chunks/libs/is-docker.mjs +1 -0
  110. package/dist/chunks/libs/is-error-instance.mjs +1 -0
  111. package/dist/chunks/libs/is-inside-container.mjs +1 -0
  112. package/dist/chunks/libs/is-plain-obj.mjs +1 -0
  113. package/dist/chunks/libs/isexe.mjs +1 -0
  114. package/dist/chunks/libs/json5.mjs +14 -0
  115. package/dist/chunks/libs/khroma.mjs +1 -0
  116. package/dist/chunks/libs/ky.mjs +3 -0
  117. package/dist/{_chunks → chunks}/libs/langium.d.mts +9 -9
  118. package/dist/chunks/libs/langium.mjs +32 -0
  119. package/dist/chunks/libs/merge-error-cause.mjs +2 -0
  120. package/dist/chunks/libs/p-debounce.mjs +1 -0
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -0
  123. package/dist/chunks/libs/p-timeout.mjs +1 -0
  124. package/dist/chunks/libs/package-manager-detector.mjs +1 -0
  125. package/dist/chunks/libs/package-up.mjs +1 -0
  126. package/dist/chunks/libs/pako.mjs +3 -0
  127. package/dist/chunks/libs/parse-ms.mjs +1 -0
  128. package/dist/chunks/libs/pathe.mjs +1 -0
  129. package/dist/chunks/libs/picomatch.mjs +1 -0
  130. package/dist/chunks/libs/pretty-ms.mjs +1 -0
  131. package/dist/chunks/libs/remeda.mjs +1 -0
  132. package/dist/chunks/libs/safe-stringify.mjs +1 -0
  133. package/dist/chunks/libs/strip-indent.mjs +1 -0
  134. package/dist/chunks/libs/tinyrainbow.mjs +1 -0
  135. package/dist/chunks/libs/ts-graphviz.mjs +1 -0
  136. package/dist/chunks/libs/ufo.mjs +1 -0
  137. package/dist/chunks/libs/unctx.mjs +1 -0
  138. package/dist/chunks/libs/unstorage.mjs +1 -0
  139. package/dist/chunks/libs/vscode-languageserver.mjs +1 -0
  140. package/dist/chunks/libs/which.mjs +1 -0
  141. package/dist/chunks/libs/word-wrap.mjs +12 -0
  142. package/dist/{_chunks → chunks}/libs/zod.d.mts +62 -25
  143. package/dist/chunks/node.mjs +93 -0
  144. package/dist/chunks/plugin.mjs +593 -0
  145. package/dist/chunks/rolldown-runtime.mjs +1 -0
  146. package/dist/chunks/sequence-view.mjs +1 -0
  147. package/dist/cli/index.mjs +188 -59
  148. package/dist/config/index.d.mts +1 -2
  149. package/dist/config/index.mjs +1 -1
  150. package/dist/index.d.mts +2 -135
  151. package/dist/index.mjs +1 -1
  152. package/dist/model/index.d.mts +3 -2
  153. package/dist/model/index.mjs +1 -1
  154. package/dist/vite-plugin/index.d.mts +90 -9
  155. package/dist/vite-plugin/index.mjs +1 -1
  156. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +1 -0
  157. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +1 -0
  158. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +1 -0
  159. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +1 -0
  160. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +1 -0
  161. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -0
  162. package/dist/{_chunks/libs/@nanostores/react.d.mts → vite-plugin/internal/index.d.mts} +103 -45
  163. package/dist/vite-plugin/internal/index.mjs +1 -0
  164. package/package.json +74 -80
  165. package/react/index.d.mts +84 -78
  166. package/react/index.mjs +51954 -53701
  167. package/vite-plugin/internal/package.json +2 -2
  168. package/vite-plugin-modules.d.ts +18 -0
  169. package/__app__/react/likec4.tsx +0 -25
  170. package/__app__/src/ProjectsOverview.js +0 -16
  171. package/__app__/src/const.js +0 -19
  172. package/__app__/src/likec4.js +0 -21254
  173. package/__app__/src/main.js +0 -7
  174. package/__app__/src/routes/index.js +0 -324
  175. package/__app__/src/routes/projects.js +0 -193
  176. package/__app__/src/routes/single.js +0 -1983
  177. package/__app__/src/vendors.js +0 -52683
  178. package/__app__/src/webcomponent.js +0 -68
  179. package/dist/THIRD-PARTY-LICENSES.md +0 -1609
  180. package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
  181. package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
  182. package/dist/_chunks/libs/@chevrotain/types.d.mts +0 -1
  183. package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
  184. package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
  185. package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
  186. package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
  187. package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
  188. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  189. package/dist/_chunks/libs/@nanostores/react.mjs +0 -1
  190. package/dist/_chunks/libs/ajv.mjs +0 -1
  191. package/dist/_chunks/libs/ansi-align.mjs +0 -2
  192. package/dist/_chunks/libs/ansi-regex.mjs +0 -1
  193. package/dist/_chunks/libs/ansi-styles.mjs +0 -1
  194. package/dist/_chunks/libs/atomically.mjs +0 -1
  195. package/dist/_chunks/libs/birpc.mjs +0 -1
  196. package/dist/_chunks/libs/boxen.mjs +0 -22
  197. package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
  198. package/dist/_chunks/libs/chevrotain.mjs +0 -58
  199. package/dist/_chunks/libs/conf.mjs +0 -1
  200. package/dist/_chunks/libs/defu.mjs +0 -1
  201. package/dist/_chunks/libs/destr.mjs +0 -1
  202. package/dist/_chunks/libs/esm-env.mjs +0 -1
  203. package/dist/_chunks/libs/eventemitter3.mjs +0 -1
  204. package/dist/_chunks/libs/fast-equals.mjs +0 -1
  205. package/dist/_chunks/libs/find-up-simple.mjs +0 -1
  206. package/dist/_chunks/libs/get-port.mjs +0 -1
  207. package/dist/_chunks/libs/is-docker.mjs +0 -1
  208. package/dist/_chunks/libs/is-error-instance.mjs +0 -1
  209. package/dist/_chunks/libs/is-inside-container.mjs +0 -1
  210. package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
  211. package/dist/_chunks/libs/isexe.mjs +0 -1
  212. package/dist/_chunks/libs/json5.mjs +0 -14
  213. package/dist/_chunks/libs/khroma.mjs +0 -1
  214. package/dist/_chunks/libs/ky.mjs +0 -3
  215. package/dist/_chunks/libs/langium.mjs +0 -33
  216. package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
  217. package/dist/_chunks/libs/p-limit.mjs +0 -1
  218. package/dist/_chunks/libs/p-queue.mjs +0 -1
  219. package/dist/_chunks/libs/p-timeout.mjs +0 -1
  220. package/dist/_chunks/libs/package-manager-detector.mjs +0 -1
  221. package/dist/_chunks/libs/package-up.mjs +0 -1
  222. package/dist/_chunks/libs/pako.mjs +0 -1
  223. package/dist/_chunks/libs/parse-ms.mjs +0 -1
  224. package/dist/_chunks/libs/pathe.mjs +0 -1
  225. package/dist/_chunks/libs/picomatch.mjs +0 -1
  226. package/dist/_chunks/libs/pretty-ms.mjs +0 -1
  227. package/dist/_chunks/libs/remeda.mjs +0 -2
  228. package/dist/_chunks/libs/safe-stringify.mjs +0 -1
  229. package/dist/_chunks/libs/strip-indent.mjs +0 -1
  230. package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
  231. package/dist/_chunks/libs/ts-graphviz.d.mts +0 -10
  232. package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
  233. package/dist/_chunks/libs/ufo.mjs +0 -1
  234. package/dist/_chunks/libs/unstorage.mjs +0 -1
  235. package/dist/_chunks/libs/vscode-languageserver.mjs +0 -1
  236. package/dist/_chunks/libs/which.mjs +0 -1
  237. package/dist/_chunks/libs/word-wrap.mjs +0 -12
  238. package/dist/_chunks/node.mjs +0 -76
  239. package/dist/_chunks/rolldown-runtime.mjs +0 -1
  240. package/dist/_chunks/sequence.mjs +0 -1
  241. package/dist/_chunks/src.mjs +0 -17
  242. package/dist/_chunks/src2.mjs +0 -499
  243. package/dist/vite-plugin/internal.d.mts +0 -44
  244. package/dist/vite-plugin/internal.mjs +0 -1
@@ -0,0 +1,45 @@
1
+ import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"../chunks/libs/@tanstack/react-router.mjs";import{n as h,t as g}from"../chunks/libs/@tanstack/history.mjs";import{t as _}from"../chunks/libs/@tanstack/router-core.mjs";import{E as v,N as y,O as b,W as x,s as S,v as C}from"../chunks/libs/remeda.mjs";import{A as w,At as T,B as E,C as D,Ct as O,D as k,Dt as A,E as ee,Et as j,F as te,Ft as ne,G as re,H as ie,J as ae,K as oe,N as se,O as M,Ot as ce,P as le,S as ue,T as de,U as fe,V as pe,Wt as me,Yt as he,a as ge,bt as _e,c as ve,f as ye,ft as N,h as be,i as xe,jt as Se,k as Ce,kt as we,l as P,m as Te,mt as Ee,n as De,o as Oe,ot as F,p as ke,q as I,qt as Ae,r as je,s as Me,st as Ne,t as Pe,w as Fe,wt as Ie,x as Le}from"../chunks/libs/@mantine/core.mjs";import{d as Re,o as ze,r as Be,u as Ve}from"../chunks/libs/@mantine/hooks.mjs";import{t as L}from"../chunks/css.mjs";import{r as He,s as Ue,t as We}from"../chunks/factory.mjs";import{K as Ge,U as Ke,Y as qe,v as Je}from"../chunks/LikeC4Styles.mjs";import{a as Ye,i as Xe}from"../chunks/ViewReact.mjs";import{a as Ze,t as Qe}from"../chunks/Markdown.mjs";import{C as $e,D as et,U as tt,W as nt,X as rt,Z as it,_ as at,h as ot,m as st,o as ct,q as lt,rt as ut,t as dt,tt as ft,y as pt,z as mt}from"../chunks/libs/@tabler/icons-react.mjs";import{t as ht}from"../chunks/libs/fast-equals.mjs";import{T as gt}from"../chunks/DiagramActorProvider.mjs";import{a as _t,i as vt,n as yt,o as bt,r as xt,s as St}from"../chunks/LikeC4Diagram.mjs";import{a as Ct,o as wt,r as Tt}from"../chunks/useLikeC4Project.mjs";import{S as Et}from"../chunks/libs/@xyflow/react.mjs";import{n as Dt,p as Ot,u as kt}from"../chunks/libs/framer-motion.mjs";import{n as At,t as R}from"../chunks/NavigationPanel.mjs";import{t as jt}from"../chunks/create-style-context.mjs";import{t as Mt}from"../chunks/box.mjs";import{n as Nt,r as Pt}from"../chunks/libs/nanostores.mjs";import{t as Ft}from"../chunks/libs/@nanostores/react.mjs";import{t as It}from"../chunks/libs/react-error-boundary.mjs";import{n as Lt,t as Rt}from"../chunks/EmbedPage.mjs";import{a as zt,c as Bt,o as Vt,r as z,s as Ht,t as Ut}from"../chunks/libs/zod.mjs";import{i as Wt,n as Gt,o as Kt,r as qt,t as Jt}from"../chunks/hooks.mjs";import{AdHocViewEditor as Yt}from"./pages/AdHocViewEditor.mjs";import{t as Xt}from"../chunks/ExportPage.mjs";import{ViewEditor as Zt}from"./pages/ViewEditor.mjs";import{ViewAsPuml as Qt}from"./pages/ViewAsPuml.mjs";import{ViewAsMmd as $t}from"./pages/ViewAsMmd.mjs";import{ViewAsDot as en}from"./pages/ViewAsDot.mjs";import{ViewAsD2 as tn}from"./pages/ViewAsD2.mjs";import{StrictMode as nn,lazy as rn,memo as B,useCallback as an,useEffect as V,useRef as on,useState as H}from"react";import{createRoot as sn}from"react-dom/client";import{c as U}from"react-compiler-runtime";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import{ComponentName as cn,basepath as ln,defaultTheme as un,pageTitle as dn,useHashHistory as fn}from"likec4:app-config";import{projects as q,useLikeC4Projects as pn}from"likec4:projects";import{compareNatural as mn,nonexhaustive as hn}from"@likec4/core/utils";import{RichText as gn}from"@likec4/core/types";import{loadModel as _n}from"likec4:model";import{getProjectIcons as vn}from"likec4:icons";import{isRpcAvailable as yn}from"likec4:rpc";import{loadPumlSources as bn}from"likec4:puml";import{loadMmdSources as xn}from"likec4:mmd";import{loadDotSources as Sn}from"likec4:dot";import{loadD2Sources as Cn}from"likec4:d2";function J({error:e,resetErrorBoundary:t}){let i=r(),a=n({strict:!1});if(s(e))return G(fe,{my:`md`,children:K(Ne,{variant:`light`,color:`orange`,children:[K(F,{c:`orange`,fz:`md`,children:[`The diagram`,` `,G(re,{color:`orange`,children:a.viewId??`unknown`}),` `,`does not exist or contains errors`]}),G(I,{onClick:()=>{t(),i.navigate({to:`/`})},variant:`light`,color:`orange`,mt:`lg`,size:`xs`,children:`Go to overview`})]})});let o=e,c=`Unknown error`;try{switch(!0){case b(o):c=`Unknown error`;break;case y(o):c=o.stack??o.message;break;case typeof o==`string`:c=o;break;case v(o):c=o.stack??o.message??`${o}`;break;default:c=`${o}`;break}}catch(e){c=`${e}`}return G(fe,{my:`md`,children:K(Ne,{variant:`filled`,color:`red`,title:`Something went wrong`,children:[G(re,{block:!0,color:`red`,children:c}),K(N,{mt:`lg`,children:[G(I,{onClick:()=>{i.invalidate().finally(()=>{t()})},color:`red`,variant:`white`,size:`xs`,children:`Try again`}),G(I,{onClick:()=>{t(),i.navigate({to:`/`})},color:`red`,size:`xs`,children:`Go to overview`})]})]})})}function wn({children:e,likec4model:t}){return G(Ke,{value:t,children:e})}function Tn(e){let t=U(12),{children:n,projects:r,onProjectChange:i}=e,a=wt(),o;t[0]===a?o=t[1]:(o=()=>{a&&console.warn(`LikeC4ProjectsProvider should not be nested inside another one`)},t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[2]=s):s=t[2],V(o,s);let c=Ge(i),l;t[3]!==c||t[4]!==r?(l=()=>({projects:r,onProjectChange:c}),t[3]=c,t[4]=r,t[5]=l):l=t[5];let[u,d]=H(l),f,p;t[6]===r?(f=t[7],p=t[8]):(f=()=>{d(e=>ht(e.projects,r)?e:{...e,projects:r})},p=[r],t[6]=r,t[7]=f,t[8]=p),V(f,p);let m;return t[9]!==n||t[10]!==u?(m=G(Ct,{value:u,children:n}),t[9]=n,t[10]=u,t[11]=m):m=t[11],m}var En=L({height:`30px`,paddingLeft:`sm`,paddingRight:`1`,borderRadius:`sm`,border:`1px solid`,borderColor:{base:`default.border`,_light:`mantine.colors.gray[4]`,_dark:`mantine.colors.dark[4]`,_hover:`default.border`},cursor:`pointer`,background:{base:`default`,_light:`white`,_dark:`mantine.colors.dark[6]`,_hover:`default.hover`},width:`100%`,"& .tabler-icon":{color:`text`},transition:{base:`fast`,_whenPanning:`none !important`},boxShadow:{base:`xs`,_hover:`sm`,_whenPanning:`none !important`}}),Dn=L({fontSize:`sm`,fontWeight:`medium`,paddingRight:`2.5`,color:`text.placeholder`,flex:`1`,sm:{paddingRight:`[30px]`},md:{paddingRight:`[50px]`}}),On=L({fontSize:`11px`,fontWeight:`bold`,lineHeight:1,padding:`[4px 7px]`,borderRadius:`sm`,border:`1px solid`,transition:`fast`,_light:{color:`mantine.colors.gray[7]`,borderColor:`mantine.colors.gray[2]`},_dark:{color:`mantine.colors.dark[0]`,borderColor:`mantine.colors.dark[7]`},backgroundColor:{_light:`mantine.colors.gray[2]/70`,_dark:`mantine.colors.dark[8]/70`,_groupHover:{_light:`mantine.colors.gray[2]`,_dark:`mantine.colors.dark[8]`}}});function kn({className:e,...t}){let n=Et();return G(O,{...t,className:Ue(`group`,En,e),children:K(N,{gap:`xs`,children:[G(pt,{style:{width:`15px`,height:`15px`},stroke:2}),G(F,{component:`div`,className:Dn,children:`Search`}),G(F,{component:`div`,className:On,children:n?`⌘ + K`:`Ctrl + K`})]})})}function An(e){let t=U(6),{children:n}=e,r=pn(),i=o(),a;t[0]===i?a=t[1]:(a=e=>{i({to:`/project/$projectId/`,params:{projectId:e}}).catch(console.error)},t[0]=i,t[1]=a);let s=Ae(a),c;return t[2]!==n||t[3]!==s||t[4]!==r?(c=G(Tn,{projects:r,onProjectChange:s,children:n}),t[2]=n,t[3]=s,t[4]=r,t[5]=c):c=t[5],c}const jn=Ht({theme:zt([`light`,`dark`,`auto`]).optional().catch(void 0),dynamic:Ut([`diagram`,`sequence`]).default(`diagram`).catch(`diagram`),padding:Vt().min(0).default(20).catch(20),relationships:Bt().nonempty().optional().catch(void 0).transform(e=>e),focusOnElement:Bt().nonempty().optional().catch(void 0).transform(e=>e)});function Mn(e){switch(e){case`light`:case`dark`:return e;default:return}}const Nn=A({autoContrast:!0,primaryColor:`indigo`,cursorType:`pointer`,fontFamily:`var(--likec4-app-font)`,headings:{fontWeight:`500`,sizes:{h1:{fontWeight:`600`},h2:{}}},fontSizes:{xxs:`var(--font-sizes-xxs)`,xs:`var(--font-sizes-xs)`,sm:`var(--font-sizes-sm)`,md:`var(--font-sizes-md)`,lg:`var(--font-sizes-lg)`,xl:`var(--font-sizes-xl)`},spacing:{xs:`var(--spacing-xs)`,sm:`var(--spacing-sm)`,md:`var(--spacing-md)`,lg:`var(--spacing-lg)`,xl:`var(--spacing-xl)`},components:{SegmentedControl:Te.extend({vars:(e,t,n)=>({root:{"--sc-font-size":e.fontSizes[t.fz??t.size]}})}),Portal:_e.extend({defaultProps:{reuseTargetNode:!0}}),Tooltip:be.extend({defaultProps:{color:`dark`}})}}),Y=f()({validateSearch:jn,search:{middlewares:[_({padding:20,theme:void 0,dynamic:`diagram`,relationships:void 0,focusOnElement:void 0})]},beforeLoad:()=>{let e=q.length>0?C(q,e=>e.id):[`default`];return{projects:e,projectId:e[0]}},component:Pn});function Pn(){let t=U(8),{theme:n}=Y.useSearch(),r;t[0]===n?r=t[1]:(r=Mn(n),t[0]=n,t[1]=r);let i=r,a=n===`auto`?`auto`:un,o;t[2]===i?o=t[3]:(o=i&&{forceColorScheme:i},t[2]=i,t[3]=o);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=G(e,{}),t[4]=s):s=t[4];let c;return t[5]!==a||t[6]!==o?(c=G(ce,{theme:Nn,defaultColorScheme:a,...o,children:s}),t[5]=a,t[6]=o,t[7]=c):c=t[7],c}const Fn=rn(async()=>{let{ProjectsOverviewPage:e}=await import(`./pages/ProjectsOverview.mjs`);return{default:e}}),In=l(`/projects`)({beforeLoad:async({context:e})=>{if(e.projects.length<2)throw u({to:`/single-index/`})},component:Ln,wrapInSuspense:!0});function Ln(){let e=U(1);Re(`Projects - ${dn}`);let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=G(Mt,{w:`100%`,h:`100%`,overflow:`hidden`,children:G(Fn,{})}),e[0]=t):t=e[0],t}const Rn=We(`div`,{base:{padding:`0`,margin:`0`,width:`full`,height:`full`}});function zn(e){let t=U(5),{children:n,projectId:r}=e,i;t[0]===r?i=t[1]:(i=vn(r),t[0]=r,t[1]=i);let a=i,o;return t[2]!==a||t[3]!==n?(o=G(qe,{value:a,children:n}),t[2]=a,t[3]=n,t[4]=o):o=t[4],o}function Bn(e){let t=U(6),{likec4model:n,children:r}=e,i=Ft(n),a;t[0]!==r||t[1]!==i?(a=G(wn,{likec4model:i,children:r}),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=G(Kt,{value:n,children:a}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o}const Vn=l(`/_single`)({staleTime:1/0,loaderDeps(){return[]},loader:async({context:e})=>{let t=e.projectId;return{$likec4model:(await _n(t)).$likec4model,projectId:t}},component:Hn});function Hn(){let t=U(6),{$likec4model:n,projectId:r}=Vn.useLoaderData(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=G(e,{}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=G(Bn,{likec4model:n,children:i}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=G(Rn,{children:G(It,{FallbackComponent:J,children:G(zn,{projectId:r,children:a})})}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}const Un=l(`/`)({beforeLoad:({context:e})=>{throw e.projects.length>1?u({to:`/projects/`,mask:{to:`/`,unmaskOnReload:!0}}):q[0]?.landingPage&&`redirect`in q[0].landingPage?u({to:`/view/$viewId/`,params:{viewId:`index`},mask:{to:`/`,unmaskOnReload:!0}}):u({to:`/single-index/`,mask:{to:`/`,unmaskOnReload:!0}})}});function Wn(){let e=U(21),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={keepTransitions:!0},e[0]=t):t=e[0];let{setColorScheme:n}=Se(t),r=T(`light`),i=o(),a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a={from:`__root__`},e[1]=a):a=e[1];let{theme:s}=m(a),c;e[2]===s?c=e[3]:(c=Mn(s),e[2]=s,e[3]=c);let l=c!=null,u=on(null),d,f;e[4]!==l||e[5]!==n?(d=()=>{u.current!=null&&!l&&(n(u.current),u.current=null)},f=[l,n],e[4]=l,e[5]=n,e[6]=d,e[7]=f):(d=e[6],f=e[7]),V(d,f);let p;e[8]!==r||e[9]!==l||e[10]!==i||e[11]!==n?(p=()=>{if(u.current!=null)return;let e=r===`light`?`dark`:`light`;l?(u.current=e,i({to:`../`,search:Gn,replace:!0}).catch(()=>{u.current=null})):n(e)},e[8]=r,e[9]=l,e[10]=i,e[11]=n,e[12]=p):p=e[12];let h=p,g=r===`light`?`block`:`none`,_;e[13]===g?_=e[14]:(_=G($e,{stroke:1.5,display:g}),e[13]=g,e[14]=_);let v=r===`dark`?`block`:`none`,y;e[15]===v?y=e[16]:(y=G(st,{stroke:1.5,display:v}),e[15]=v,e[16]=y);let b;return e[17]!==_||e[18]!==y||e[19]!==h?(b=K(Ee,{size:`md`,variant:`subtle`,color:`gray`,onClick:h,"aria-label":`Toggle color scheme`,children:[_,y]}),e[17]=_,e[18]=y,e[19]=h,e[20]=b):b=e[20],b}function Gn(e){return{...e,theme:void 0}}function Kn(e){let t=U(16),{onClose:n,children:r}=e,[i,a]=H(``),[s,c]=H(null),l=o(),u;t[0]!==l||t[1]!==n?(u=(e,t)=>{n(),l({to:`/view/$viewId/`,params:{viewId:e},search:e=>({...e,...t&&{focusOnElement:t}})})},t[0]=l,t[1]=n,t[2]=u):u=t[2];let d=u,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{c(e)},t[3]=f):f=t[3];let p=f,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{c(null)},t[4]=m):m=t[4];let h=m,g;t[5]===i?g=t[6]:(g=St(i),t[5]=i,t[6]=g);let _;t[7]!==d||t[8]!==n||t[9]!==s||t[10]!==i||t[11]!==g?(_={searchValue:i,setSearchValue:a,normalizedSearch:g,navigateTo:d,openPickView:p,closePickView:h,pickViewFor:s,close:n,currentViewId:null,openedWithSearch:null},t[7]=d,t[8]=n,t[9]=s,t[10]=i,t[11]=g,t[12]=_):_=t[12];let v=_,y;return t[13]!==r||t[14]!==v?(y=G(bt.Provider,{value:v,children:r}),t[13]=r,t[14]=v,t[15]=y):y=t[15],y}const qn=B(()=>{let e=U(10),[t,n]=H(!1),r=on(null),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>n(!0),e[0]=i):i=e[0];let a=i,o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>n(!1),e[1]=o):o=e[1];let s=o,c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{e&&(r.current=e)},e[2]=c):c=e[2];let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{r.current?.open&&r.current.close(),r.current=null},e[3]=u):u=e[3];let d=u,f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=[[`mod+k`,a,{preventDefault:!0}]],e[4]=f):f=e[4],ze(f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=G(kn,{onClick:a}),e[5]=p):p=e[5];let m;e[6]===t?m=e[7]:(m=t&&G(_t,{ref:l,fullscreen:!0,withBackdrop:!1,backdrop:{opacity:.9},classes:{dialog:vt,body:xt},openDelay:0,onClose:s,"data-likec4-search":`true`,children:G(Kn,{onClose:s,children:G(yt,{})})}),e[6]=t,e[7]=m);let h;return e[8]===m?h=e[9]:(h=K(W,{children:[p,G(Je,{children:G(Ot,{onExitComplete:d,children:m})})]}),e[8]=m,e[9]=h),h});qn.displayName=`OverviewSearch`;const Jn=e=>`type`in e&&[`file`,`folder`,`view`,`deployment-view`].includes(e.type);function Yn(e){return e===``?``:e.split(`/`).slice(0,-1).join(`/`)}function Xn(e,t){return e.children.length===0&&t.children.length>0?1:e.children.length>0&&t.children.length===0?-1:mn(e.label,t.label)}function Zn(e,t){let n={value:``,label:`Diagrams`,type:`folder`,children:[]},r=e=>{let t=n;if(e===``)return t;let r=e.split(`/`),i=[`@fs`];for(;r.length;){let e=r.shift();i.push(e);let n=i.join(`/`),a=x(t.children,e=>e.value===n);a||(a={label:e,value:n,type:`folder`,children:[]},t.children.push(a)),t=a}return t};for(let i of e){let e;switch(t){case`by-files`:e=i.$view.sourcePath??``;break;case`by-folders`:e=Yn(i.$view.sourcePath??``);break;case`none`:e=``;break;default:hn(t)}let a=r(e);a.children.push({value:i.id,label:i.title??i.id,type:i.isDeploymentView()?`deployment-view`:`view`,children:[]}),a!==n&&(a.children.sort(Xn),t===`by-files`&&a.type!==`file`&&(a.type=`file`))}return n.children.sort(Xn)}function Qn(e){let t=U(3),n=e===void 0?`by-files`:e,r=gt(),i;return t[0]!==n||t[1]!==r?(i=Zn([...r.views()],n),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}const $n=Pt(!1);Nt($n,()=>{$n.set(!1)});const er=()=>Ft($n),tr={open:()=>$n.set(!0),close:()=>$n.set(!1)},nr=e=>Jn(e)&&e.type===`file`,rr=e=>{let t=U(3),{node:n,expanded:r}=e;if(nr(n)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=G(xe,{size:`sm`,variant:`transparent`,color:`indigo`,children:G(tt,{size:16})}),t[0]=e):e=t[0],e}let i;return t[1]===r?i=t[2]:(i=G(xe,{size:`sm`,variant:`transparent`,color:`violet`,children:G(r?mt:ct,{size:16})}),t[1]=r,t[2]=i),i},ir=B(e=>{let t=U(27),{groupBy:n}=e,r=Wt(),i=Qn(n),a=o(),s;t[0]===a?s=t[1]:(s=e=>{tr.close(),a({to:`/view/$viewId/`,viewTransition:!1,params:{viewId:e}})},t[0]=a,t[1]=s);let c=s,[l]=Gt(),u=l?.id??null,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d={multiple:!1},t[2]=d):d=t[2];let f=De(d),p=l?.sourcePath??null,m;t[3]===f?m=t[4]:(m=()=>{f.collapseAllNodes()},t[3]=f,t[4]=m);let h;t[5]===n?h=t[6]:(h=[n],t[5]=n,t[6]=h),Ze(m,h);let g;t[7]!==p||t[8]!==f?(g=()=>{if(p){let e=p.split(`/`),t=`@fs`;for(let n of e)t+=`/${n}`,f.expand(t)}},t[7]=p,t[8]=f,t[9]=g):g=t[9];let _;t[10]!==n||t[11]!==p?(_=[p,n],t[10]=n,t[11]=p,t[12]=_):_=t[12],V(g,_);let v;t[13]!==f||t[14]!==u?(v=()=>{u&&f.select(u)},t[13]=f,t[14]=u,t[15]=v):v=t[15];let y;t[16]===u?y=t[17]:(y=[u],t[16]=u,t[17]=y),V(v,y);let b=T(),x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x={node:{marginTop:2,marginBottom:2}},t[18]=x):x=t[18];let S;t[19]!==c||t[20]!==b||t[21]!==r?(S=e=>{let{node:t,selected:n,expanded:i,elementProps:a,hasChildren:o}=e;return G(ar,{diagram:o?void 0:r.find(e=>e.id===t.value),children:G(I,{fullWidth:!0,color:b===`light`?`dark`:`gray`,variant:n?`transparent`:`subtle`,size:`sm`,fz:`sm`,fw:o?`600`:`500`,justify:`flex-start`,styles:{section:{opacity:.5}},leftSection:K(W,{children:[!o&&t.value===`index`&&G(dt,{size:14,opacity:.7}),!o&&t.value!==`index`&&Jn(t)&&K(W,{children:[t.type===`deployment-view`&&G(ot,{size:14}),t.type===`view`&&G(et,{size:14})]}),o&&G(rr,{node:t,expanded:i})]}),...a,...!o&&{onClick:e=>{e.stopPropagation(),c(t.value)}},children:t.label})})},t[19]=c,t[20]=b,t[21]=r,t[22]=S):S=t[22];let C;return t[23]!==i||t[24]!==S||t[25]!==f?(C=G(Mt,{children:G(Pe,{allowRangeSelection:!1,tree:f,data:i,styles:x,levelOffset:`md`,renderNode:S})}),t[23]=i,t[24]=S,t[25]=f,t[26]=C):C=t[26],C},(e,t)=>e.groupBy===t.groupBy);function ar(e){let t=U(14),{diagram:n,children:r}=e,i=n?Math.max(n.bounds.width/400,n.bounds.height/300):1,a;t[0]!==n||t[1]!==i?(a=n?Math.round(n.bounds.width/i):0,t[0]=n,t[1]=i,t[2]=a):a=t[2];let o=a,s;t[3]!==n||t[4]!==i?(s=n?Math.round(n.bounds.height/i):0,t[3]=n,t[4]=i,t[5]=s):s=t[5];let c=s,l;t[6]!==r||t[7]!==n||t[8]!==c||t[9]!==o?(l=n&&K(se,{position:`right-start`,openDelay:400,closeDelay:100,keepMounted:!1,shadow:`lg`,children:[G(le,{children:r}),G(te,{style:{width:o,height:c},p:`xs`,children:G(or,{diagram:n})})]}),t[6]=r,t[7]=n,t[8]=c,t[9]=o,t[10]=l):l=t[10];let u=!n&&r,d;return t[11]!==l||t[12]!==u?(d=K(W,{children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}const or=B(e=>{let t=U(10),{diagram:n}=e,r=Math.max(n.bounds.width/400,n.bounds.height/300),i;t[0]!==n.bounds.width||t[1]!==r?(i=Math.round(n.bounds.width/r),t[0]=n.bounds.width,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]!==n.bounds.height||t[4]!==r?(o=Math.round(n.bounds.height/r),t[3]=n.bounds.height,t[4]=r,t[5]=o):o=t[5];let s=o,c;return t[6]!==n||t[7]!==s||t[8]!==a?(c=G(Lt,{view:n,fitView:!0,fitViewPadding:`4px`,enableElementDetails:!1,reduceGraphics:!0,initialWidth:a,initialHeight:s}),t[6]=n,t[7]=s,t[8]=a,t[9]=c):c=t[9],c},(e,t)=>e.diagram.id===t.diagram.id),sr=B(()=>{let e=U(25),t=er(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={key:`sidebar-drawer-grouping`,defaultValue:`by-files`},e[0]=n):n=e[0];let[r,i]=Ve(n),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={select:lr},e[1]=o):o=e[1];let s=a(o),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=G(E.Overlay,{blur:2}),e[2]=c):c=e[2];let l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=G(ft,{size:14}),e[3]=l):l=e[3];let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=G(I,{component:d,to:`/`,leftSection:l,color:`dimmed`,variant:`subtle`,px:he(5),styles:{section:{marginInlineEnd:4}},size:`xs`,children:`Overview`}),e[4]=u):u=e[4];let f=i,p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=[{label:`By files`,value:`by-files`},{label:`By folders`,value:`by-folders`},{label:`List`,value:`none`}],e[5]=p):p=e[5];let m;e[6]!==r||e[7]!==f?(m=G(Te,{size:`xs`,withItemsBorders:!1,value:r,onChange:f,data:p}),e[6]=r,e[7]=f,e[8]=m):m=e[8];let h;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=G(dt,{size:12,stroke:2}),e[9]=h):h=e[9];let g;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=G(I,{leftSection:h,color:`dimmed`,variant:`subtle`,px:he(5),styles:{section:{marginInlineEnd:4}},size:`xs`,renderRoot:ur,children:`Open index`}),e[10]=g):g=e[10];let _;e[11]===m?_=e[12]:(_=K(N,{gap:`xs`,children:[u,m,g]}),e[11]=m,e[12]=_);let v;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=G(E.CloseButton,{}),e[13]=v):v=e[13];let y;e[14]===_?y=e[15]:(y=K(E.Header,{children:[_,v]}),e[14]=_,e[15]=y);let b;e[16]===r?b=e[17]:(b=G(E.Body,{children:G(ir,{groupBy:r})}),e[16]=r,e[17]=b);let x;e[18]!==y||e[19]!==b?(x=K(E.Content,{children:[y,b]}),e[18]=y,e[19]=b,e[20]=x):x=e[20];let S;return e[21]!==s||e[22]!==t||e[23]!==x?(S=K(E.Root,{keepMounted:s,opened:t,scrollAreaComponent:Ie.Autosize,onClose:tr.close,children:[c,x]}),e[21]=s,e[22]=t,e[23]=x,e[24]=S):S=e[24],S});function cr(e){return e.routeId===`/_single`}function lr(e){return e.some(cr)}function ur(e){return G(d,{to:`/view/$viewId`,params:{viewId:`index`},...e})}function dr(e,t){return t?`include`in t?e.filter(e=>fr(e,t.include)):`exclude`in t?e.filter(e=>!fr(e,t.exclude)):e:e}function fr(e,t){return t.some(t=>{if(t.startsWith(`#`)){let n=t.slice(1);return e.tags?.some(e=>e===n)??!1}return e.id===t})}L({color:`text.dimmed`}),L({});const pr=L({position:`relative`,overflow:`hidden`,padding:`0`,margin:`0`,backgroundOrigin:`padding-box`,backgroundImage:`radial-gradient({colors.default.border} 15%, {colors.body} 15%)`,backgroundPosition:`0 0`,backgroundSize:`12px 12px`,_after:{content:`" "`,position:`absolute`,top:`0`,left:`0`,right:`0`,bottom:`0`,zIndex:`1`}}),mr=L({position:`absolute`,inset:`0`,zIndex:5}),hr=l(`/_single/single-index`)({component:gr});function gr(){let e=U(40),t=Wt(),{landingPage:n,title:r}=Jt();Re(r??dn);let i,a,o,s,c,l,u,d,f,p,m;if(e[0]!==t||e[1]!==n){let r=dr(t,n);a=fe,f=`xl`;let h;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=G(sr,{}),h=L({containerName:`likec4-root`,containerType:`inline-size`,display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,padding:`xs`,gap:`xs`,position:`sticky`,top:`0`,zIndex:`10`,backgroundColor:`likec4.panel.bg/85`,backdropFilter:`blur(8px)`}),e[13]=p,e[14]=h):(p=e[13],h=e[14]);let g;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(g={position:`relative`,width:`max-content`,margin:`0`},e[15]=g):g=e[15];let _,v;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=G(`div`,{style:{width:0,height:36},"aria-hidden":!0}),v=G(ae,{size:`sm`,onClick:tr.open,"aria-label":`Toggle navigation`}),e[16]=_,e[17]=v):(_=e[16],v=e[17]);let y;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=G(R.Root,{css:g,children:K(R.Body,{children:[_,v,G(R.Logo,{css:{flexShrink:0},onClick:vr}),G(qn,{})]})}),e[18]=y):y=e[18];let b;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(b={position:`relative`,margin:`0`},e[19]=b):b=e[19],e[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=K(`div`,{className:h,children:[y,G(R.Root,{panelPosition:`right`,css:b,children:G(R.Body,{children:G(`div`,{style:{display:`flex`,alignItems:`center`,minHeight:36},children:G(Wn,{})})})})]}),e[20]=m):m=e[20],i=ye,e[21]===Symbol.for(`react.memo_cache_sentinel`)?(o={base:`md`,sm:`md`},s={base:`sm`,sm:`sm`},c={base:1,sm:2,md:3,xl:4},l={base:10,sm:`xl`},u={base:`md`,sm:`xl`},e[21]=o,e[22]=s,e[23]=c,e[24]=l,e[25]=u):(o=e[21],s=e[22],c=e[23],l=e[24],u=e[25]),d=r.map(_r),e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=o,e[5]=s,e[6]=c,e[7]=l,e[8]=u,e[9]=d,e[10]=f,e[11]=p,e[12]=m}else i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],m=e[12];let h;e[26]!==i||e[27]!==o||e[28]!==s||e[29]!==c||e[30]!==l||e[31]!==u||e[32]!==d?(h=G(i,{p:o,pt:s,cols:c,spacing:l,verticalSpacing:u,children:d}),e[26]=i,e[27]=o,e[28]=s,e[29]=c,e[30]=l,e[31]=u,e[32]=d,e[33]=h):h=e[33];let g;return e[34]!==a||e[35]!==f||e[36]!==p||e[37]!==m||e[38]!==h?(g=K(a,{size:f,children:[p,m,h]}),e[34]=a,e[35]=f,e[36]=p,e[37]=m,e[38]=h,e[39]=g):g=e[39],g}function _r(e){return G(yr,{view:e},e.id)}function vr(){return window.scrollTo({top:0,behavior:`smooth`})}function yr(e){let t=U(25),{view:n}=e,[r,i]=H(!1),{ref:a,inViewport:o}=Be(),s,c;t[0]!==o||t[1]!==r?(s=()=>{if(!o||r)return;let e=setTimeout(()=>i(!0),S(30,80));return()=>clearTimeout(e)},c=[o,r],t[0]=o,t[1]=r,t[2]=s,t[3]=c):(s=t[2],c=t[3]),V(s,c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={height:200},t[4]=l):l=t[4];let u;t[5]!==n||t[6]!==r?(u=r&&G(Lt,{background:`transparent`,view:n,fitView:!0,fitViewPadding:`4px`,reduceGraphics:!0}),t[5]=n,t[6]=r,t[7]=u):u=t[7];let f;t[8]===u?f=t[9]:(f=G(oe.Section,{children:G(j,{className:pr,style:l,children:u})}),t[8]=u,t[9]=f);let p=n.title??n.id,m;t[10]===p?m=t[11]:(m=G(N,{justify:`space-between`,mt:`md`,children:G(F,{fw:500,children:p})}),t[10]=p,t[11]=m);let h;t[12]===n.description?h=t[13]:(h=gn.from(n.description),t[12]=n.description,t[13]=h);let g;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=L({lineClamp:3,mt:`1`,transition:`fast`,opacity:{base:.8,_groupHover:1}}),t[14]=g):g=t[14];let _;t[15]===h?_=t[16]:(_=G(Qe,{value:h,textScale:.75,emptyText:`No description`,className:g}),t[15]=h,t[16]=_);let v;t[17]===n.id?v=t[18]:(v=G(d,{to:`/view/$viewId/`,params:{viewId:n.id},search:!0,className:mr}),t[17]=n.id,t[18]=v);let y;return t[19]!==a||t[20]!==_||t[21]!==v||t[22]!==f||t[23]!==m?(y=K(oe,{ref:a,shadow:`xs`,padding:`lg`,radius:`sm`,className:`group`,withBorder:!0,children:[f,m,_,v]}),t[19]=a,t[20]=_,t[21]=v,t[22]=f,t[23]=m,t[24]=y):y=t[24],y}const br=l(`/_single/adhoc`)({beforeLoad:()=>{if(!yn)throw u({to:`/single-index/`})},component:xr});function xr(){let e=U(2),{projectId:t}=br.useRouteContext(),n;return e[0]===t?n=e[1]:(n=G(Yt,{projectId:t}),e[0]=t,e[1]=n),n}const Sr=l(`/project/$projectId`)({staleTime:1/0,beforeLoad:({params:e})=>({projectId:e.projectId}),loaderDeps(){return[]},loader:async({context:e})=>{let t=e.projectId,n=await _n(t),r=n.$likec4data.value;if(!r)throw i();if(r.projectId!==t)throw u({to:`/project/$projectId/`,search:!0,params:{projectId:r.projectId}});return{$likec4model:n.$likec4model,projectId:t}},remountDeps({params:e}){return[e.projectId]},component:Cr,notFoundComponent:()=>G(Rn,{children:G(fe,{py:`xl`,children:K(P,{align:`flex-start`,children:[G(je,{children:`Project not found`}),G(I,{component:d,to:`/`,search:!0,size:`md`,children:`Open overview`})]})})})});function Cr(){let t=U(6),{$likec4model:n,projectId:r}=Sr.useLoaderData(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=G(It,{FallbackComponent:J,children:G(e,{})}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=G(Bn,{likec4model:n,children:i}),t[1]=n,t[2]=a);let o;return t[3]!==r||t[4]!==a?(o=G(Rn,{children:G(It,{FallbackComponent:J,children:G(zn,{projectId:r,children:a})})}),t[3]=r,t[4]=a,t[5]=o):o=t[5],o}const wr=l(`/project/$projectId/`)({component:()=>{let{projectId:e}=wr.useParams();return G(t,{to:`/project/$projectId/view/$viewId/`,replace:!0,params:{projectId:e,viewId:`index`}})}}),Tr=l(`/project/$projectId/adhoc`)({beforeLoad:({params:e})=>{if(!yn)throw u({to:`/project/$projectId/`,params:{projectId:e.projectId}})},component:Er});function Er(){let e=U(2),{projectId:t}=Tr.useRouteContext(),n;return e[0]===t?n=e[1]:(n=G(Yt,{projectId:t}),e[0]=t,e[1]=n),n}const Dr=l(`/_single/webcomponent/$`)({component:Or});function Or(){let e=U(7),t=r(),n=Dr.useParams()._splat||`index`,{colorScheme:i}=Se(),a;e[0]===t.basepath?a=e[1]:(a=t.basepath.endsWith(`/`)?t.basepath:`${t.basepath}/`,e[0]=t.basepath,e[1]=a);let o=`${a}likec4-views.js`,s;e[2]===o?s=e[3]:(s=new URL(o,window.location.href),e[2]=o,e[3]=s);let c=s,l=`
2
+ <!DOCTYPE html>
3
+ <html lang="en-US" style="color-scheme: ${i};">
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no" />
7
+ <style>
8
+ * {
9
+ border-width: 0px;
10
+ border-style: solid;
11
+ box-sizing: border-box;
12
+ overflow-wrap: break-word;
13
+ }
14
+ html, body {
15
+ margin: 0;
16
+ background-color: transparent !important;
17
+ width: 100%;
18
+ height: 100%;
19
+ font-size: 16px;
20
+ }
21
+ body {
22
+ min-height: 100%;
23
+ }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <div style="width: 100%; height: 100%; padding: clamp(0.5rem, 5vh, 4rem) clamp(0.5rem, 5vw, 5rem)">
28
+ <${cn.View} view-id="${encodeURIComponent(n)}"></${cn.View}>
29
+ </div>
30
+ <script type="module" src="${c.href}"><\/script>
31
+ </body>
32
+ </html>
33
+ `,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u={position:`fixed`,inset:`0`,width:`100%`,height:`100%`,overflow:`hidden`,"& iframe":{width:`100%`,height:`100%`,borderStyle:`none`,backgroundColor:`transparent`,overflow:`hidden`}},e[4]=u):u=e[4];let d;return e[5]===l?d=e[6]:(d=G(Mt,{css:u,children:G(`iframe`,{srcDoc:l,allowtransparency:`true`})}),e[5]=l,e[6]=d),d}const{withProvider:kr,withContext:Ar}=jt(At),jr=(e,t)=>!t.includes(e)&&(kt(e)||!He(e)),Mr={Root:kr(Dt,`root`,{shouldForwardProp:jr}),Body:Ar(Dt,`body`,{shouldForwardProp:jr}),Label:Ar(Dt,`label`,{shouldForwardProp:jr}),Dropdown:Ar(Dt,`dropdown`,{shouldForwardProp:jr})};function Nr(){let e=U(12),t=Tt(),n=Jt();if(t.length<2)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=G(rt,{opacity:.5,size:14}),e[0]=r):r=e[0];let i=n.title??n.id,a;e[1]===i?a=e[2]:(a=G(ee,{children:G(I,{variant:`subtle`,size:`sm`,color:`gray`,px:`sm`,rightSection:r,visibleFrom:`md`,children:i})}),e[1]=i,e[2]=a);let o,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=G(M,{renderRoot:Fr,children:`Projects overview`}),s=G(w,{}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let c;e[5]===t?c=e[6]:(c=t.map(Pr),e[5]=t,e[6]=c);let l;e[7]===c?l=e[8]:(l=K(Ce,{children:[o,s,c]}),e[7]=c,e[8]=l);let u;return e[9]!==a||e[10]!==l?(u=K(de,{shadow:`md`,width:200,trigger:`click-hover`,openDelay:200,children:[a,l]}),e[9]=a,e[10]=l,e[11]=u):u=e[11],u}function Pr(e){let{id:t,title:n}=e;return G(M,{renderRoot:e=>G(d,{...e,to:`/project/$projectId/view/$viewId/`,params:{projectId:t,viewId:`index`}}),children:n??t},t)}function Fr(e){return G(d,{...e,to:`/projects`})}const Ir=()=>{let e=U(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=G(ut,{}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=G(Ne,{color:`yellow`,icon:t,title:`Localhost URL`,styles:{body:{gap:he(4)}},children:G(F,{c:`yellow`,size:`sm`,children:`You need to deploy your project to make it available on the internet`})}),e[1]=n):n=e[1],n},Lr=e=>{let t=U(7),{copied:n,copy:r}=e,i=n?`teal`:`gray`,a;t[0]===n?a=t[1]:(a=G(n?it:lt,{style:{width:he(16)}}),t[0]=n,t[1]=a);let o=n?`Copied`:`Copy to clipboard`,s;return t[2]!==r||t[3]!==i||t[4]!==a||t[5]!==o?(s=G(I,{size:`xs`,color:i,variant:`light`,leftSection:a,onClick:r,children:o}),t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s):s=t[6],s},Rr=({diagram:e})=>{let t=r(),{colorScheme:n}=Se(),[i,a]=H(n),o=t.buildLocation({to:`/embed/$viewId/`,params:{viewId:e.id},search:{padding:20,...i===`auto`?{}:{theme:i}}}).href;o=fn?`#${o}`:o;let s=new URL(o,window.location.href),c=e.bounds.width+40,l=e.bounds.height+40,u=s.href,d=`
34
+ <div style="aspect-ratio:${c}/${l};width:100%;height:auto;max-width:${c}px;margin:0 auto">
35
+ <iframe src="${u}" width="100%" height="100%" style="border:0;background:transparent;"></iframe>
36
+ </div>
37
+ `.trim();return K(P,{children:[d.includes(`http://localhost`)&&G(Ir,{}),G(j,{children:G(F,{size:`sm`,children:`Embedded view is an iframe with a static diagram`})}),K(P,{gap:`xs`,children:[K(N,{justify:`space-between`,children:[G(j,{children:G(F,{fw:`500`,size:`sm`,children:`HTML`})}),K(N,{gap:`xs`,children:[G(Ee,{component:`a`,href:u,target:`_blank`,variant:`light`,color:`gray`,children:G(nt,{})}),G(ie,{value:d,timeout:1500,children:Lr})]})]}),G(re,{block:!0,children:d}),G(j,{style:{alignSelf:`flex-start`},children:G(ke,{label:`Color scheme`,value:i,allowDeselect:!1,onChange:e=>a(e??`auto`),data:[{value:`auto`,label:`Auto`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}]})})]})]})};function zr(e){let t=U(48),{diagram:n}=e,i=r(),a;t[0]===i.basepath?a=t[1]:(a=i.basepath.endsWith(`/`)?i.basepath:`${i.basepath}/`,t[0]=i.basepath,t[1]=a);let o=`${a}likec4-views.js`,s;t[2]===o?s=t[3]:(s=new URL(o,window.location.href),t[2]=o,t[3]=s);let c=s.href,l,u,d,f,p;if(t[4]!==n.id||t[5]!==c||t[6]!==i){d=`
38
+ <script module src="${c}"><\/script>
39
+ `.trim();let e=`
40
+ <${cn.View}
41
+ view-id="${encodeURIComponent(n.id)}"
42
+ browser="true"
43
+ dynamic-variant="sequence">
44
+ </${cn.View}>
45
+ `,r;t[12]===e?r=t[13]:(r=e.trim(),t[12]=e,t[13]=r),u=r;let a;t[14]!==n.id||t[15]!==i?(a=i.buildLocation(import.meta.env.DEV?{to:`/webcomponent/$/`,params:{_splat:`/`},hash:n.id,search:!0}:{to:`/webcomponent/$/`,params:{_splat:n.id},search:!0}),t[14]=n.id,t[15]=i,t[16]=a):a=t[16],p=a,l=P,f=d.includes(`http://localhost`)&&G(Ir,{}),t[4]=n.id,t[5]=c,t[6]=i,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else l=t[7],u=t[8],d=t[9],f=t[10],p=t[11];let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=G(j,{children:G(F,{size:`sm`,children:`Add this script to your page:`})}),t[17]=m):m=t[17];let h;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(h=G(j,{children:G(F,{fw:`500`,size:`sm`,children:`JavaScript`})}),t[18]=h):h=t[18];let g;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(g=G(nt,{}),t[19]=g):g=t[19];let _;t[20]===p.href?_=t[21]:(_=G(Ee,{component:`a`,href:p.href,target:`_blank`,variant:`light`,color:`gray`,children:g}),t[20]=p.href,t[21]=_);let v;t[22]===d?v=t[23]:(v=G(ie,{value:d,timeout:1500,children:Lr}),t[22]=d,t[23]=v);let y;t[24]!==_||t[25]!==v?(y=K(N,{justify:`space-between`,children:[h,K(N,{gap:`xs`,children:[_,v]})]}),t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]===d?b=t[28]:(b=G(re,{block:!0,children:d}),t[27]=d,t[28]=b);let x;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(x=G(`br`,{}),t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=G(`code`,{children:`<head>`}),t[30]=S):S=t[30];let C;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(C=G(j,{children:K(F,{size:`sm`,c:`dimmed`,children:[`This script defines a custom element (webcomponent) that renders your diagrams.`,x,`Script must be inserted once in the `,S,` or at the end of the `,G(`code`,{children:`<body>`}),` `,`tag.`]})}),t[31]=C):C=t[31];let w;t[32]!==y||t[33]!==b?(w=K(P,{gap:`xs`,children:[y,b,C]}),t[32]=y,t[33]=b,t[34]=w):w=t[34];let T;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(T=G(j,{children:G(F,{fw:`500`,size:`sm`,children:`HTML`})}),t[35]=T):T=t[35];let E,D;t[36]===u?(E=t[37],D=t[38]):(E=K(N,{justify:`space-between`,children:[T,G(j,{children:G(ie,{value:u,timeout:1500,children:Lr})})]}),D=G(re,{block:!0,children:u}),t[36]=u,t[37]=E,t[38]=D);let O;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(O=G(j,{children:K(F,{size:`sm`,c:`dimmed`,children:[`Insert this code to your page. Page may have multiple `,G(`code`,{children:`<likec4-view>`}),`.`]})}),t[39]=O):O=t[39];let k;t[40]!==E||t[41]!==D?(k=K(P,{gap:`xs`,children:[E,D,O]}),t[40]=E,t[41]=D,t[42]=k):k=t[42];let A;return t[43]!==l||t[44]!==w||t[45]!==k||t[46]!==f?(A=K(l,{children:[f,m,w,k]}),t[43]=l,t[44]=w,t[45]=k,t[46]=f,t[47]=A):A=t[47],A}function Br(e){let t=U(19),{onClose:n}=e,[r]=Gt(),[i,a]=H(`webcomponent`);if(!r)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=G(ue,{backgroundOpacity:.5,blur:3}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>a(e??`webcomponent`),t[1]=s):s=t[1];let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=K(ve,{children:[G(Oe,{value:`webcomponent`,children:`Webcomponent`}),G(Oe,{value:`embed`,children:`Embedded`})]}),t[2]=c):c=t[2];let l;t[3]===r?l=t[4]:(l=G(Me,{value:`embed`,pt:`md`,children:G(Rr,{diagram:r})}),t[3]=r,t[4]=l);let u;t[5]===r?u=t[6]:(u=G(Me,{value:`webcomponent`,pt:`md`,children:G(zr,{diagram:r})}),t[5]=r,t[6]=u);let d;t[7]!==i||t[8]!==l||t[9]!==u?(d=K(ge,{value:i,onChange:s,children:[c,l,u]}),t[7]=i,t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===n?f=t[12]:(f=G(N,{justify:`flex-end`,mt:`lg`,children:G(I,{size:`sm`,onClick:n,children:`Close`})}),t[11]=n,t[12]=f);let p;t[13]!==d||t[14]!==f?(p=G(D,{children:K(Fe,{children:[d,f]})}),t[13]=d,t[14]=f,t[15]=p):p=t[15];let m;return t[16]!==n||t[17]!==p?(m=K(Le,{size:`xl`,opened:!0,onClose:n,children:[o,p]}),t[16]=n,t[17]=p,t[18]=m):m=t[18],m}const Vr=B(()=>{let e=U(16),t=Tt(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select(e){return e.some(Gr)}},e[0]=n):n=e[0];let r=a(n),{breakpoints:i}=we(),o=me(`(min-width: ${i.md})`)??!1,[s,c]=ne(!1),{open:l,close:u}=c,f;e[1]!==r||e[2]!==o||e[3]!==l||e[4]!==t?(f=r?K(W,{children:[G(Nr,{}),t.length<=1&&G(I,{size:o?`sm`:`xs`,leftSection:G(at,{size:14}),onClick:l,children:`Share`}),G(Wr,{})]}):G(I,{component:d,to:`../`,size:o?`sm`:`xs`,variant:`subtle`,color:`gray`,children:`Back to diagram`}),e[1]=r,e[2]=o,e[3]=l,e[4]=t,e[5]=f):f=e[5];let p,m;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=G(pe,{orientation:`vertical`,visibleFrom:`md`}),m=G(Wn,{}),e[6]=p,e[7]=m):(p=e[6],m=e[7]);let h;e[8]===f?h=e[9]:(h=G(Mr.Root,{panelPosition:`right`,hideBelow:`md`,children:K(Mr.Body,{gap:`2`,children:[f,p,m]})}),e[8]=f,e[9]=h);let g;e[10]!==u||e[11]!==s?(g=s&&G(Br,{onClose:u}),e[10]=u,e[11]=s,e[12]=g):g=e[12];let _;return e[13]!==h||e[14]!==g?(_=K(W,{children:[h,g]}),e[13]=h,e[14]=g,e[15]=_):_=e[15],_}),Hr=e=>({...e,download:!0}),Ur=e=>({...e,download:!0,format:`jpeg`});function Wr(){let e=a({select:e=>e.some(({routeId:e})=>e===`/project/$projectId`)}),[t,n]=H(!1),r=Jt(),i=qt(),o=an(async()=>{try{n(!0);let{loadDrawioSources:e}=await import(`likec4:drawio`),{drawioEditUrl:t}=await e(r.id),a=t(i);window.open(a,`_blank`,`noopener,noreferrer`)}catch(e){console.error(`Failed to export to Draw.io:`,e)}finally{n(!1)}},[r.id,i]);return K(de,{shadow:`md`,width:200,trigger:`click-hover`,openDelay:200,children:[G(ee,{children:G(I,{variant:`subtle`,size:`sm`,color:`gray`,px:`sm`,rightSection:G(rt,{opacity:.5,size:14}),visibleFrom:`md`,children:`Export`})}),K(Ce,{children:[G(k,{children:`Current view`}),G(M,{renderRoot:t=>G(d,{target:`_blank`,to:e?`/project/$projectId/export/$viewId/`:`/export/$viewId/`,search:Hr,...t}),children:`Export as .png`}),G(M,{renderRoot:t=>G(d,{target:`_blank`,to:e?`/project/$projectId/export/$viewId/`:`/export/$viewId/`,search:Ur,...t}),children:`Export as .jpg`}),G(M,{renderRoot:t=>G(d,{to:e?`/project/$projectId/view/$viewId/dot/`:`/view/$viewId/dot/`,search:!0,...t}),children:`Export as .dot`}),G(M,{renderRoot:t=>G(d,{to:e?`/project/$projectId/view/$viewId/d2`:`/view/$viewId/d2`,search:!0,...t}),children:`Export as .d2`}),G(M,{renderRoot:t=>G(d,{to:e?`/project/$projectId/view/$viewId/mmd`:`/view/$viewId/mmd`,search:!0,...t}),children:`Export as .mmd`}),G(M,{renderRoot:t=>G(d,{to:e?`/project/$projectId/view/$viewId/puml`:`/view/$viewId/puml`,search:!0,...t}),children:`Export as .puml`}),G(M,{disabled:t,onClick:o,children:`Export to Draw.io`}),G(M,{disabled:!0,children:`Export to Miro`}),G(M,{disabled:!0,children:`Export to Notion`})]})]})}function Gr(e){let{routeId:t}=e;return t===`/_single/view/$viewId/`||t===`/project/$projectId/view/$viewId/`}const Kr=l(`/_single/view/$viewId`)({component:qr,errorComponent:({error:e,reset:t})=>G(J,{error:e,resetErrorBoundary:t})});function qr(){let t=U(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=K(W,{children:[G(e,{}),G(Vr,{})]}),t[0]=n):n=t[0],n}const Jr=l(`/_single/export/$viewId`)({validateSearch:Ht({description:z().optional().catch(!1),download:z().optional().catch(!1),format:Ut([`png`,`jpeg`]).optional().catch(`png`),notation:z().optional().catch(!1),quality:Vt().min(0).max(1).optional().catch(void 0)}),search:{middlewares:[_({description:!1,download:!1,format:`png`,notation:!1,quality:void 0})]},component:Xt}),Yr=l(`/_single/embed/$viewId`)({component:Rt}),Xr=l(`/_single/view/$viewId/`)({component:yn?Zt:Xe}),Zr=l(`/project/$projectId/view/$viewId`)({component:Qr,errorComponent:({error:e,reset:t})=>G(J,{error:e,resetErrorBoundary:t})});function Qr(){let t=U(1),n;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=K(W,{children:[G(e,{}),G(Vr,{})]}),t[0]=n):n=t[0],n}const $r=l(`/project/$projectId/export/$viewId`)({validateSearch:Ht({description:z().optional().catch(!1),download:z().optional().catch(!1),format:Ut([`png`,`jpeg`]).optional().catch(`png`),notation:z().optional().catch(!1),quality:Vt().min(0).max(1).optional().catch(void 0)}),search:{middlewares:[_({description:!1,download:!1,format:`png`,notation:!1,quality:void 0})]},component:Xt}),ei=l(`/project/$projectId/embed/$viewId`)({component:Rt}),ti=l(`/_single/view/$viewId/puml`)({component:ni,staleTime:1/0,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{pumlSource:e}=await bn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}}});function ni(){let e=U(2),{source:t}=ti.useLoaderData(),n;return e[0]===t?n=e[1]:(n=G(Qt,{pumlSource:t}),e[0]=t,e[1]=n),n}const ri=l(`/_single/view/$viewId/mmd`)({component:ii,staleTime:1/0,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{mmdSource:e}=await xn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}}});function ii(){let e=U(3),{viewId:t}=ri.useParams(),{source:n}=ri.useLoaderData(),r;return e[0]!==n||e[1]!==t?(r=G($t,{viewId:t,mmdSource:n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}const ai=l(`/_single/view/$viewId/dot`)({component:oi,staleTime:1/0,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{dotSource:e,svgSource:t}=await Sn(n);return{dot:e(r),dotSvg:t(r)}}catch(e){throw console.error(e),i()}}});function oi(){let e=U(3),{dot:t,dotSvg:n}=ai.useLoaderData(),r;return e[0]!==t||e[1]!==n?(r=G(en,{dot:t,dotSvg:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}const si=l(`/_single/view/$viewId/d2`)({component:ci,staleTime:1/0,loader:async({context:e,params:t})=>{let n=e.projectId,{viewId:r}=t;try{let{d2Source:e}=await Cn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}}});function ci(){let e=U(2),{source:t}=si.useLoaderData(),n;return e[0]===t?n=e[1]:(n=G(tn,{d2Source:t}),e[0]=t,e[1]=n),n}const li=l(`/project/$projectId/view/$viewId/`)({component:yn?Zt:Xe}),ui=l(`/project/$projectId/view/$viewId/puml`)({component:di,staleTime:1/0,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{pumlSource:e}=await bn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}}});function di(){let e=U(2),{source:t}=ui.useLoaderData(),n;return e[0]===t?n=e[1]:(n=G(Qt,{pumlSource:t}),e[0]=t,e[1]=n),n}const fi=l(`/project/$projectId/view/$viewId/mmd`)({component:pi,staleTime:1/0,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{mmdSource:e}=await xn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}}});function pi(){let e=U(3),{viewId:t}=fi.useParams(),{source:n}=fi.useLoaderData(),r;return e[0]!==n||e[1]!==t?(r=G($t,{viewId:t,mmdSource:n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}const mi=l(`/project/$projectId/view/$viewId/dot`)({component:hi,loader:async({params:e,context:t})=>{let n=t.projectId,{viewId:r}=e;try{let{dotSource:e,svgSource:t}=await Sn(n);return{dot:e(r),dotSvg:t(r)}}catch(e){throw console.error(e),i()}}});function hi(){let e=U(3),{dot:t,dotSvg:n}=mi.useLoaderData(),r;return e[0]!==t||e[1]!==n?(r=G(en,{dot:t,dotSvg:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}const gi=l(`/project/$projectId/view/$viewId/d2`)({loader:async({context:e,params:t})=>{let n=e.projectId,{viewId:r}=t;try{let{d2Source:e}=await Cn(n);return{source:e(r)}}catch(e){throw console.error(e),i()}},component:_i});function _i(){let e=U(2),{source:t}=gi.useLoaderData(),n;return e[0]===t?n=e[1]:(n=G(tn,{d2Source:t}),e[0]=t,e[1]=n),n}const vi=In.update({id:`/projects`,path:`/projects`,getParentRoute:()=>Y}),X=Vn.update({id:`/_single`,getParentRoute:()=>Y}),yi=Un.update({id:`/`,path:`/`,getParentRoute:()=>Y}),bi=hr.update({id:`/single-index`,path:`/single-index`,getParentRoute:()=>X}),xi=br.update({id:`/adhoc`,path:`/adhoc`,getParentRoute:()=>X}),Z=Sr.update({id:`/project/$projectId`,path:`/project/$projectId`,getParentRoute:()=>Y}),Si=wr.update({id:`/`,path:`/`,getParentRoute:()=>Z}),Ci=Tr.update({id:`/adhoc`,path:`/adhoc`,getParentRoute:()=>Z}),wi=Dr.update({id:`/webcomponent/$`,path:`/webcomponent/$`,getParentRoute:()=>X}),Q=Kr.update({id:`/view/$viewId`,path:`/view/$viewId`,getParentRoute:()=>X}),Ti=Jr.update({id:`/export/$viewId`,path:`/export/$viewId`,getParentRoute:()=>X}),Ei=Yr.update({id:`/embed/$viewId`,path:`/embed/$viewId`,getParentRoute:()=>X}),Di=Xr.update({id:`/`,path:`/`,getParentRoute:()=>Q}),$=Zr.update({id:`/view/$viewId`,path:`/view/$viewId`,getParentRoute:()=>Z}),Oi=$r.update({id:`/export/$viewId`,path:`/export/$viewId`,getParentRoute:()=>Z}),ki=ei.update({id:`/embed/$viewId`,path:`/embed/$viewId`,getParentRoute:()=>Z}),Ai=ti.update({id:`/puml`,path:`/puml`,getParentRoute:()=>Q}),ji=ri.update({id:`/mmd`,path:`/mmd`,getParentRoute:()=>Q}),Mi=ai.update({id:`/dot`,path:`/dot`,getParentRoute:()=>Q}),Ni=si.update({id:`/d2`,path:`/d2`,getParentRoute:()=>Q}),Pi=li.update({id:`/`,path:`/`,getParentRoute:()=>$}),Fi=ui.update({id:`/puml`,path:`/puml`,getParentRoute:()=>$}),Ii=fi.update({id:`/mmd`,path:`/mmd`,getParentRoute:()=>$}),Li=mi.update({id:`/dot`,path:`/dot`,getParentRoute:()=>$}),Ri=gi.update({id:`/d2`,path:`/d2`,getParentRoute:()=>$}),zi={SingleViewViewIdD2Route:Ni,SingleViewViewIdDotRoute:Mi,SingleViewViewIdMmdRoute:ji,SingleViewViewIdPumlRoute:Ai,SingleViewViewIdIndexRoute:Di},Bi={SingleAdhocRoute:xi,SingleSingleIndexRoute:bi,SingleEmbedViewIdRoute:Ei,SingleExportViewIdRoute:Ti,SingleViewViewIdRoute:Q._addFileChildren(zi),SingleWebcomponentSplatRoute:wi},Vi=X._addFileChildren(Bi),Hi={ProjectProjectIdViewViewIdD2Route:Ri,ProjectProjectIdViewViewIdDotRoute:Li,ProjectProjectIdViewViewIdMmdRoute:Ii,ProjectProjectIdViewViewIdPumlRoute:Fi,ProjectProjectIdViewViewIdIndexRoute:Pi},Ui={ProjectProjectIdAdhocRoute:Ci,ProjectProjectIdIndexRoute:Si,ProjectProjectIdEmbedViewIdRoute:ki,ProjectProjectIdExportViewIdRoute:Oi,ProjectProjectIdViewViewIdRoute:$._addFileChildren(Hi)},Wi={IndexRoute:yi,SingleRouteRoute:Vi,ProjectsRoute:vi,ProjectProjectIdRouteRoute:Z._addFileChildren(Ui)},Gi=c({routeTree:Y._addFileChildren(Wi)._addFileTypes(),context:{projectId:q[0].id,projects:C(q,e=>e.id)},InnerWrap:An,basepath:ln,trailingSlash:`always`,defaultViewTransition:!1,history:fn?h():g(),defaultStaleTime:1/0,defaultNotFoundComponent:()=>G(Ye,{}),defaultErrorComponent:({error:e,reset:t})=>G(J,{error:e,resetErrorBoundary:t})});function Ki(){let e=U(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=G(p,{router:Gi}),e[0]=t):t=e[0],t}sn(document.getElementById(`likec4-root`)).render(G(nn,{children:G(Ki,{})}));
@@ -0,0 +1 @@
1
+ import{Suspense as e,lazy as t}from"react";import{c as n}from"react-compiler-runtime";import{jsx as r}from"react/jsx-runtime";import{likec4rpc as i}from"likec4:rpc";const a=t(async()=>{let{LikeC4AdHocViewEditor:e}=await import(`../../chunks/adhoc-editor.mjs`);return{default:e}});function o(t){let o=n(2),{projectId:s}=t,c;return o[0]===s?c=o[1]:(c=r(e,{children:r(a,{service:{process:async e=>{let{predicates:t}=e;return{view:await i.calcAdhocView({projectId:s,predicates:t})}}}})}),o[0]=s,o[1]=c),c}export{o as AdHocViewEditor};
@@ -0,0 +1 @@
1
+ import{t as e}from"../../chunks/EmbedPage.mjs";export{e as EmbedPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"../../chunks/ExportPage.mjs";export{e as ExportPage};
@@ -0,0 +1 @@
1
+ import{Z as e,v as t}from"../../chunks/libs/remeda.mjs";import{qt as n}from"../../chunks/libs/@mantine/core.mjs";import{s as r}from"../../chunks/factory.mjs";import{D as i,E as a,K as o,P as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,i as h,l as g,n as _,o as v,r as y,s as b,t as x,u as S,v as C,y as w}from"../../chunks/LikeC4Styles.mjs";import{c as ee}from"../../chunks/libs/@tabler/icons-react.mjs";import{p as T}from"../../chunks/libs/@react-hookz/web.mjs";import{n as E}from"../../chunks/libs/fast-equals.mjs";import{a as te,i as ne,l as D,n as O,r as k,t as A}from"../../chunks/libs/@xstate/react.mjs";import{t as j}from"../../chunks/useLikeC4Project.mjs";import{l as re,m as ie,s as ae,u as oe,x as se}from"../../chunks/libs/@xyflow/react.mjs";import{f as ce,i as M,x as le}from"../../chunks/libs/framer-motion.mjs";import{n as ue,r as N,t as de}from"../../chunks/libs/motion-dom.mjs";import{t as P}from"../../chunks/NavigationPanel.mjs";import{createContext as F,memo as I,useContext as L,useEffect as R,useRef as z}from"react";import{c as B}from"react-compiler-runtime";import{jsx as V,jsxs as H}from"react/jsx-runtime";import{invariant as fe,nonNullable as U,nonexhaustive as pe}from"@likec4/core";import{useLikeC4ProjectsOverview as me}from"likec4:projects-overview";function he(e){return{xynodes:t(e.nodes,ge),xyedges:t(e.edges,_e)}}function ge({id:e,x:t,y:n,width:r,height:a,...o}){return{id:e,position:{x:t,y:n},type:`project`,initialWidth:r,initialHeight:a,draggable:!1,deletable:!1,zIndex:i.Element,style:{width:r,height:a},data:{id:e,width:r,height:a,...o}}}function _e({id:e,source:t,target:n,...r}){return{id:e,source:t,target:n,type:`relationship`,zIndex:i.Edge,deletable:!1,data:{id:e,technology:null,labelBBox:null,...r}}}var W=`likec4:projects-overview:lastViewport`,G={read(){try{let e=sessionStorage.getItem(W);return e?JSON.parse(e):null}catch(e){return console.error(`Error reading fromStorage ${W}:`,e),null}},write(e){if(!e){sessionStorage.removeItem(W);return}sessionStorage.setItem(W,JSON.stringify(e))}},K=ne({types:{context:{},tags:``,input:{},events:{},emitted:{}},guards:{isReady:({context:e})=>e.initialized.xydata&&e.initialized.xyflow&&!!e.xystore&&!!e.xyflow,"click: selected node":({event:e})=>e.type===`xyflow.click.node`&&e.node.selected===!0}}),q=()=>K.assign(({event:e})=>{k(e,`update.view`);let{xynodes:t,xyedges:n}=he(e.view);return{view:e.view,xynodes:t,xyedges:n}}),ve=()=>K.assign(({context:e,event:t})=>(k(t,`xyflow.applyNodeChanges`),{xynodes:oe(t.changes,e.xynodes)})),ye=()=>K.assign(({context:e,event:t})=>(k(t,`xyflow.applyEdgeChanges`),{xyedges:re(t.changes,e.xyedges)})),be=()=>K.assign(({context:e,event:t})=>{k(t,[`xyflow.mouse.enter.edge`,`xyflow.mouse.leave.edge`,`xyflow.mouse.enter.node`,`xyflow.mouse.leave.node`]);let n=t.type.startsWith(`xyflow.mouse.enter`);switch(t.type){case`xyflow.mouse.enter.edge`:case`xyflow.mouse.leave.edge`:{let r=t.edge.id;return{xyedges:e.xyedges.map(e=>e.id===r?m.setHovered(e,n):e)}}case`xyflow.mouse.enter.node`:case`xyflow.mouse.leave.node`:{let r=t.node.id;return{xynodes:e.xynodes.map(e=>e.id===r?m.setHovered(e,n):e)}}default:pe(t)}}),xe=()=>K.createAction(({context:e})=>{let t=e.xyflow;t&&G.write(t.getViewport())}),Se=()=>K.enqueueActions(({event:e,enqueue:t})=>{if(e.type===`xyflow.click.double`){t(J());return}}),J=e=>K.enqueueActions(({context:t,event:n})=>{let r=t.view.bounds,i;e?(r=e.bounds??t.view.bounds,i=e.duration):n.type===`xyflow.fitDiagram`&&(r=n.bounds??t.view.bounds,i=n.duration),i??=450;let{width:o,height:s,panZoom:c,transform:l}=U(t.xystore).getState(),u=Math.max(1,l[2]),d=se(r,o,s,a,u,t.fitViewPadding);d.x=Math.round(d.x),d.y=Math.round(d.y);let f=i>0?{duration:i,interpolate:`smooth`}:void 0;c?.setViewport(d,f).catch(e=>{console.error(`Error during fitDiagram panZoom setViewport`,{err:e})}),G.write(null)}),Ce=()=>K.enqueueActions(({context:e,enqueue:t})=>{let n=G.read();if(n){U(e.xyflow).setViewport(n,{duration:0});return}t(J({duration:0}))}),we=()=>K.assign({xyflow:null,xystore:null,initialized:{xyflow:!1,xydata:!1},xyedges:[],xynodes:[]}),Y=()=>K.assign(({event:e,context:t})=>{let n;switch(e.type){case`xyflow.click.node`:n=e.node;break;case`navigate.to`:n=U(t.xynodes.find(t=>t.id===e.fromNode),`Node ${e.fromNode} not found`);break;default:return console.warn(`Unexpected event ${e.type} in assignNavigateTo`),{}}return{navigateTo:n}}),Te=K.createMachine({id:`projects-overview`,context:({input:e})=>({...e,initialized:{xydata:!1,xyflow:!1},xyflow:null,xystore:null,xynodes:[],xyedges:[]}),initial:`init`,on:{close:{target:`.closed`}},states:{init:{on:{"update.view":{actions:[q(),D(({context:e})=>({initialized:{...e.initialized,xydata:!0}}))],target:`isReady`},"xyflow.init":{actions:[D(({context:e,event:t})=>({initialized:{...e.initialized,xyflow:!0},xyflow:t.xyflow,xystore:t.xystore}))],target:`isReady`}}},isReady:{always:[{guard:`isReady`,target:`active`},{target:`init`}]},active:{tags:`active`,entry:[Ce()],on:{"navigate.to":{actions:Y(),target:`navigate`},"xyflow.applyNodeChanges":{actions:ve()},"xyflow.applyEdgeChanges":{actions:ye()},"xyflow.mouse.*":{actions:be()},"xyflow.click.*":[{guard:`click: selected node`,actions:Y(),target:`navigate`},{actions:Se()}],"xyflow.fitDiagram":{actions:J()},"update.view":{actions:q()}}},navigate:{tags:`active`,entry:[xe(),D({xyedges:[]}),({context:{navigateTo:t,xyflow:n,xystore:r},self:i})=>{fe(n&&t,`Invalid state, xyflow is undefined`);let{width:o,domNode:s}=U(r).getState(),c=e(Math.min(o*7/9/t.data.width),{min:a,max:2.5}),l={x:Math.round(-c*t.position.x+(o-c*t.data.width)/2),y:Math.round(-c*t.position.y)+50},u=n.getViewport(),d=s.querySelectorAll(`.react-flow__node-project:not([data-id="${t.id}"]) > *`),f=M(d,{opacity:0,scale:.9},{visualDuration:.25,delay:ue(.08,{from:`center`})}),p=le(1),m=de(p,[1,0],[`translate(${u.x}px, ${u.y}px) scale(${u.zoom})`,`translate(${l.x}px, ${l.y}px) scale(${c})`]),h=N(s.querySelector(`.xyflow__viewport`),{transform:m}),g=N(s.querySelector(`.react-flow__node-project:is([data-id="${t.id}"]) > *`),{opacity:p}),_=M(p,0,{delay:d.length>3?.25:0,type:`spring`,stiffness:350,damping:40,mass:1.5,visualDuration:.55});Promise.race([_.finished,Ee(750)]).then(()=>{h(),g(),_.stop(),f.stop(),i.send({type:`emit.navigate.to`,projectId:t.data.projectId})})}],on:{"emit.navigate.to":{actions:te(({event:e})=>({...e,type:`navigate.to`}))}}},closed:{id:`closed`,type:`final`,entry:we()}}});function Ee(e){return new Promise(t=>setTimeout(t,e))}var X=F(null),De=X.Provider;function Z(){let e=B(2),t=L(X),n;return e[0]===t?n=e[1]:(n=U(t,`No ProjectsOverviewActorContext`),e[0]=t,e[1]=n),n}var Oe=()=>V(P.Root,{children:H(P.Body,{children:[V(P.Logo,{}),V(P.Label,{children:`Projects Overview`})]})}),ke=b(e=>{let t=s(e.data.points);return H(f,{...e,children:[V(d,{edgeProps:e,svgPath:t}),V(g,{edgeProps:e,children:V(S,{edgeProps:e})})]})});function Ae(e){let t=B(7),r=Z(),i;t[0]!==r||t[1]!==e.data.id||t[2]!==e.data.projectId?(i=t=>{t.stopPropagation(),r.send({type:`navigate.to`,fromNode:e.data.id,projectId:e.data.projectId})},t[0]=r,t[1]=e.data.id,t[2]=e.data.projectId,t[3]=i):i=t[3];let a=n(i),o;return t[4]!==a||t[5]!==e?(o=H(l,{layout:!0,nodeProps:e,children:[V(h,{...e}),V(v,{...e}),V(y,{...e,buttons:[{key:`navigate`,icon:V(ee,{}),onClick:a}]}),V(_,{})]},e.id),t[4]=a,t[5]=e,t[6]=o):o=t[6],o}function je(e,t){let n=t===void 0?E:t;return O(Z(),e,n)}function Q(){return ie()}var Me={project:Ae},Ne={relationship:ke},Pe=e=>({isActive:e.hasTag(`active`),nodes:e.context.xynodes,edges:e.context.xyedges}),Fe=(e,t)=>e.isActive===t.isActive&&E(e.nodes,t.nodes)&&E(e.edges,t.edges),$=I(e=>{let t=B(23),{background:n,...i}=e,a=n===void 0?`dots`:n,s=Z(),{isActive:c,nodes:l,edges:u}=je(Pe,Fe),d=Q(),f;t[0]===s?f=t[1]:(f=(e,t)=>{e.stopPropagation(),s.send({type:`xyflow.click.node`,node:t})},t[0]=s,t[1]=f);let m;t[2]===s?m=t[3]:(m=(e,t)=>{e.stopPropagation(),s.send({type:`xyflow.click.edge`,edge:t})},t[2]=s,t[3]=m);let h;t[4]===s?h=t[5]:(h=e=>{e.stopPropagation(),s.send({type:`xyflow.click.pane`})},t[4]=s,t[5]=h);let g;t[6]===s?g=t[7]:(g=e=>{e.stopPropagation(),s.send({type:`xyflow.click.double`})},t[6]=s,t[7]=g);let _;t[8]===s?_=t[9]:(_=e=>{s.send({type:`xyflow.applyNodeChanges`,changes:e})},t[8]=s,t[9]=_);let v;t[10]===s?v=t[11]:(v=e=>{s.send({type:`xyflow.applyEdgeChanges`,changes:e})},t[10]=s,t[11]=v);let y;t[12]===s?y=t[13]:(y=(e,t)=>{s.send({type:`xyflow.mouse.enter.edge`,edge:t,event:e})},t[12]=s,t[13]=y);let b;t[14]===s?b=t[15]:(b=(e,t)=>{s.send({type:`xyflow.mouse.leave.edge`,edge:t,event:e})},t[14]=s,t[15]=b);let x;t[16]===s?x=t[17]:(x=(e,t)=>{s.send({type:`xyflow.mouse.enter.node`,node:t})},t[16]=s,t[17]=x);let S;t[18]===s?S=t[19]:(S=(e,t)=>{s.send({type:`xyflow.mouse.leave.node`,node:t})},t[18]=s,t[19]=S);let C;return t[20]!==s||t[21]!==d?(C=e=>{s.send({type:`xyflow.init`,xyflow:e,xystore:d})},t[20]=s,t[21]=d,t[22]=C):C=t[22],V(p,{nodes:l,edges:u,className:r(c?`initialized`:`not-initialized`,`projects-overview`),nodeTypes:Me,edgeTypes:Ne,fitView:!1,onNodeClick:o(f),onEdgeClick:o(m),onPaneClick:o(h),onDoubleClick:o(g),onNodesChange:o(_),onEdgesChange:o(v),onEdgeMouseEnter:o(y),onEdgeMouseLeave:o(b),onNodeMouseEnter:o(x),onNodeMouseLeave:o(S),onInit:o(C),nodesDraggable:!1,nodesSelectable:!0,pannable:!0,zoomable:!0,background:a,...i})});$.displayName=`ProjectsOverviewXY`;function Ie({view:e,onNavigateToProject:t,fitViewPadding:n={top:`50px`,bottom:`32px`,left:`32px`,right:`32px`},...r}){let i=A(Te,{input:{view:e,fitViewPadding:n}});R(()=>{i.send({type:`update.view`,view:e})},[i,e]);let a=T(t);R(()=>{let e=[i.on(`navigate.to`,({projectId:e})=>{a.current?.(e)})];return()=>{e.forEach(e=>e.unsubscribe())}},[i]);let o=e.bounds;return V(De,{value:i,children:H(ae,{...z({initialNodes:[],initialEdges:[],initialWidth:o.width,initialHeight:o.height,fitView:!1}).current,children:[V(ce,{id:i.sessionId,inherit:!1,children:V($,{...r})}),V(Oe,{})]})})}function Le({view:e,className:t,onNavigateToProject:n,...r}){let i=j(),a=c();return n??=i,V(w,{children:H(C,{children:[V(x,{id:a}),V(u,{id:a,className:t,children:V(Ie,{view:e,onNavigateToProject:n,...r})})]})})}function Re(){let e=B(3),t=j(),n=me(),r;return e[0]!==t||e[1]!==n?(r=V(Le,{view:n,onNavigateToProject:t}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{Re as ProjectsOverviewPage};
@@ -0,0 +1 @@
1
+ import{G as e,q as t,wt as n}from"../../chunks/libs/@mantine/core.mjs";import{t as r}from"../../chunks/libs/@react-hookz/web.mjs";import{t as i}from"../../chunks/box.mjs";import{n as a,r as o,t as s}from"../../chunks/libs/react-resizable-panels.mjs";import{a as c,i as l,n as u,r as d,t as f}from"../../chunks/styles.css.mjs";import{c as p}from"react-compiler-runtime";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{krokiD2SvgUrl as _}from"likec4:app-config";const v=async e=>await(await fetch(_,{method:`POST`,cache:`force-cache`,body:JSON.stringify({diagram_source:e,output_format:`svg`}),headers:{"Content-Type":`application/json`}})).text();function y(_){let y=p(18),{d2Source:b}=_,[x,S]=r(v,null),{execute:C}=S,w;y[0]===Symbol.for(`react.memo_cache_sentinel`)?(w={viewport:{borderRadius:6}},y[0]=w):w=y[0];let T;y[1]===b?T=y[2]:(T=h(o,{children:g(n,{className:u,p:5,styles:w,children:[h(e,{block:!0,className:f,children:b}),h(c,{text:b})]})}),y[1]=b,y[2]=T);let E;y[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=h(s,{style:{width:10}}),y[3]=E):E=y[3];let D;y[4]!==b||y[5]!==C||y[6]!==x.error?.message||y[7]!==x.status?(D=x.status!==`success`&&g(m,{children:[h(t,{mt:`xs`,variant:`light`,disabled:x.status===`loading`,onClick:()=>void C(b),children:x.status===`loading`?`Loading...`:`Render with Kroki`}),x.status===`error`&&h(i,{children:x.error?.message})]}),y[4]=b,y[5]=C,y[6]=x.error?.message,y[7]=x.status,y[8]=D):D=y[8];let O;y[9]!==x.result||y[10]!==x.status?(O=x.status===`success`&&h(i,{className:d,children:x.result?h(`div`,{dangerouslySetInnerHTML:{__html:x.result}}):h(i,{children:`Empty result`})}),y[9]=x.result,y[10]=x.status,y[11]=O):O=y[11];let k;y[12]!==D||y[13]!==O?(k=h(o,{children:g(n,{h:`100%`,children:[D,O]})}),y[12]=D,y[13]=O,y[14]=k):k=y[14];let A;return y[15]!==T||y[16]!==k?(A=h(m,{children:g(a,{className:l,orientation:`horizontal`,children:[T,E,k]})}),y[15]=T,y[16]=k,y[17]=A):A=y[17],A}export{y as ViewAsD2};
@@ -0,0 +1 @@
1
+ import{G as e,wt as t}from"../../chunks/libs/@mantine/core.mjs";import{n,r,t as i}from"../../chunks/libs/react-resizable-panels.mjs";import{a,i as o,n as s,r as c,t as l}from"../../chunks/styles.css.mjs";import{c as u}from"react-compiler-runtime";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";function m(m){let h=u(9),{dot:g,dotSvg:_}=m,v;h[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={viewport:{borderRadius:6}},h[0]=v):v=h[0];let y;h[1]===g?y=h[2]:(y=f(r,{children:p(t,{className:s,p:5,styles:v,children:[f(e,{block:!0,className:l,children:g}),f(a,{text:g})]})}),h[1]=g,h[2]=y);let b;h[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=f(i,{style:{width:10}}),h[3]=b):b=h[3];let x;h[4]===_?x=h[5]:(x=f(r,{children:f(t,{h:`100%`,children:f(`div`,{className:c,dangerouslySetInnerHTML:{__html:_}})})}),h[4]=_,h[5]=x);let S;return h[6]!==y||h[7]!==x?(S=f(d,{children:p(n,{className:o,children:[y,b,x]})}),h[6]=y,h[7]=x,h[8]=S):S=h[8],S}export{m as ViewAsDot};
@@ -0,0 +1 @@
1
+ import{G as e,jt as t,wt as n}from"../../chunks/libs/@mantine/core.mjs";import{t as r}from"../../chunks/libs/@react-hookz/web.mjs";import{t as i}from"../../chunks/box.mjs";import{n as a,r as o,t as s}from"../../chunks/libs/react-resizable-panels.mjs";import{a as c,i as l,n as u,r as d,t as f}from"../../chunks/styles.css.mjs";import{useEffect as p}from"react";import{c as m}from"react-compiler-runtime";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v=async(e,t,n)=>{let{default:r}=await import(`https://cdn.jsdelivr.net/npm/mermaid@11.12/dist/mermaid.esm.min.mjs`);r.initialize({theme:n});let{svg:i}=await r.render(e,t);return i};function y(y){let b=m(20),{viewId:x,mmdSource:S}=y,{colorScheme:C}=t(),w=C===`auto`?`dark`:C,[T,E]=r(v,null),{execute:D}=E,O;b[0]!==D||b[1]!==S||b[2]!==w||b[3]!==x?(O=()=>{D(x,S,w)},b[0]=D,b[1]=S,b[2]=w,b[3]=x,b[4]=O):O=b[4];let k;b[5]!==S||b[6]!==w||b[7]!==x?(k=[S,w,x],b[5]=S,b[6]=w,b[7]=x,b[8]=k):k=b[8],p(O,k);let A;b[9]===Symbol.for(`react.memo_cache_sentinel`)?(A={viewport:{borderRadius:6}},b[9]=A):A=b[9];let j;b[10]===S?j=b[11]:(j=g(o,{children:_(n,{className:u,p:5,styles:A,children:[g(e,{block:!0,className:f,children:S}),g(c,{text:S})]})}),b[10]=S,b[11]=j);let M;b[12]===Symbol.for(`react.memo_cache_sentinel`)?(M=g(s,{style:{width:10}}),b[12]=M):M=b[12];let N;b[13]===T.result?N=b[14]:(N=T.result&&g(i,{className:d,dangerouslySetInnerHTML:{__html:T.result}}),b[13]=T.result,b[14]=N);let P;b[15]===N?P=b[16]:(P=g(o,{children:g(n,{h:`100%`,children:N})}),b[15]=N,b[16]=P);let F;return b[17]!==j||b[18]!==P?(F=g(h,{children:_(a,{className:l,orientation:`horizontal`,children:[j,M,P]})}),b[17]=j,b[18]=P,b[19]=F):F=b[19],F}export{y as ViewAsMmd};
@@ -0,0 +1 @@
1
+ import{G as e,q as t,wt as n}from"../../chunks/libs/@mantine/core.mjs";import{t as r}from"../../chunks/libs/@react-hookz/web.mjs";import{t as i}from"../../chunks/box.mjs";import{n as a,r as o,t as s}from"../../chunks/libs/react-resizable-panels.mjs";import{a as c,i as l,n as u,r as d,t as f}from"../../chunks/styles.css.mjs";import{c as p}from"react-compiler-runtime";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{krokiPumlSvgUrl as _}from"likec4:app-config";const v=async e=>await(await fetch(_,{method:`POST`,cache:`force-cache`,body:JSON.stringify({diagram_source:e,output_format:`svg`}),headers:{"Content-Type":`application/json`}})).text();function y(_){let y=p(18),{pumlSource:b}=_,[x,S]=r(v,null),{execute:C}=S,w;y[0]===Symbol.for(`react.memo_cache_sentinel`)?(w={viewport:{borderRadius:6}},y[0]=w):w=y[0];let T;y[1]===b?T=y[2]:(T=h(o,{children:g(n,{className:u,p:5,styles:w,children:[h(e,{block:!0,className:f,children:b}),h(c,{text:b})]})}),y[1]=b,y[2]=T);let E;y[3]===Symbol.for(`react.memo_cache_sentinel`)?(E=h(s,{style:{width:10}}),y[3]=E):E=y[3];let D;y[4]!==C||y[5]!==x.error?.message||y[6]!==x.status||y[7]!==b?(D=x.status!==`success`&&g(m,{children:[h(t,{mt:`xs`,variant:`light`,disabled:x.status===`loading`,onClick:()=>void C(b),children:x.status===`loading`?`Loading...`:`Render with Kroki`}),x.status===`error`&&h(i,{children:x.error?.message})]}),y[4]=C,y[5]=x.error?.message,y[6]=x.status,y[7]=b,y[8]=D):D=y[8];let O;y[9]!==x.result||y[10]!==x.status?(O=x.status===`success`&&h(i,{className:d,children:x.result?h(`div`,{dangerouslySetInnerHTML:{__html:x.result}}):h(i,{children:`Empty result`})}),y[9]=x.result,y[10]=x.status,y[11]=O):O=y[11];let k;y[12]!==D||y[13]!==O?(k=h(o,{children:g(n,{h:`100%`,children:[D,O]})}),y[12]=D,y[13]=O,y[14]=k):k=y[14];let A;return y[15]!==T||y[16]!==k?(A=h(m,{children:g(a,{className:l,orientation:`horizontal`,children:[T,E,k]})}),y[15]=T,y[16]=k,y[17]=A):A=y[17],A}export{y as ViewAsPuml};
@@ -0,0 +1 @@
1
+ import{l as e,u as t}from"../../chunks/libs/@tanstack/react-router.mjs";import{qt as n}from"../../chunks/libs/@mantine/core.mjs";import{a as r,n as i,r as a,t as o}from"../../chunks/ViewReact.mjs";import{C as s}from"../../chunks/DiagramActorProvider.mjs";import{t as c}from"../../chunks/LikeC4Diagram.mjs";import{n as l,s as u,t as d}from"../../chunks/hooks.mjs";import{n as f,t as p}from"../../chunks/aichat.mjs";import{c as m}from"react-compiler-runtime";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{isDevelopment as v}from"likec4:app-config";import{isAIAvailable as y,likec4rpc as b}from"likec4:rpc";function x(){let x=m(32),S=e(),C=d(),[w,T]=l(),E=u(),D;x[0]===Symbol.for(`react.memo_cache_sentinel`)?(D={strict:!1},x[0]=D):D=x[0];let{dynamic:O}=t(D),k;x[1]===S?k=x[2]:(k=e=>{S({to:`./`,viewTransition:!1,params:t=>({...t,viewId:e}),search:!0})},x[1]=S,x[2]=k);let A=n(k);if(!w){let e;return x[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=g(r,{}),x[3]=e):e=x[3],e}let j;x[4]===w.notation?.nodes?j=x[5]:(j=w.notation?.nodes??[],x[4]=w.notation?.nodes,x[5]=j);let M=j.length>0,N;x[6]===E?N=x[7]:(N=(e,t)=>{let n=E.get().view(e);return t===`auto`?n.$view:n.$layouted},x[6]=E,x[7]=N);let P,F;x[8]===C?(P=x[9],F=x[10]):(P=(e,t)=>{let n={projectId:C.id,viewId:e,change:t};return b.updateView(n)},F=y&&{applySemanticLayout:e=>b.applySemanticLayout({projectId:C.id,viewId:e})},x[8]=C,x[9]=P,x[10]=F);let I;x[11]!==N||x[12]!==P||x[13]!==F?(I={fetchView:N,handleChange:P,...F},x[11]=N,x[12]=P,x[13]=F,x[14]=I):I=x[14];let L;x[15]===Symbol.for(`react.memo_cache_sentinel`)?(L={top:`70px`,bottom:`32px`,left:`50px`,right:`32px`},x[15]=L):L=x[15];let R=v||M,z;x[16]===S?z=x[17]:(z=()=>{S({to:`/`})},x[16]=S,x[17]=z);let B,V,H,U;x[18]===Symbol.for(`react.memo_cache_sentinel`)?(B=g(i,{}),V=g(a,{}),H=g(o,{}),U=y&&_(h,{children:[g(p,{}),g(f,{})]}),x[18]=B,x[19]=V,x[20]=H,x[21]=U):(B=x[18],V=x[19],H=x[20],U=x[21]);let W;x[22]!==O||x[23]!==A||x[24]!==T||x[25]!==R||x[26]!==z||x[27]!==w?(W=_(c,{view:w,zoomable:!0,pannable:!0,controls:!0,fitViewPadding:L,showNavigationButtons:!0,enableNotations:R,enableSearch:!0,enableDynamicViewWalkthrough:!0,enableFocusMode:!0,enableElementDetails:!0,enableRelationshipDetails:!0,enableRelationshipBrowser:!0,enableElementTags:!0,enableCompareWithLatest:!0,dynamicViewVariant:O,onNavigateTo:A,onLayoutTypeChange:T,onLogoClick:z,children:[B,V,H,U]}),x[22]=O,x[23]=A,x[24]=T,x[25]=R,x[26]=z,x[27]=w,x[28]=W):W=x[28];let G;return x[29]!==W||x[30]!==I?(G=g(s,{editor:I,children:W}),x[29]=W,x[30]=I,x[31]=G):G=x[31],G}export{x as ViewEditor};
@@ -0,0 +1 @@
1
+ import{i as e,n as t,r as n,t as r}from"../../chunks/ViewReact.mjs";export{r as FocusElementFromUrl,t as ListenForDynamicVariantChange,n as OpenRelationshipBrowserFromUrl,e as ViewReact};