@aiderdesk/aiderdesk 0.88.0 → 0.90.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.
- package/bin/aiderdesk.js +23 -4
- package/out/renderer/assets/2DXBBFLN-CN7PCbP4.js +666 -0
- package/out/renderer/assets/46IJ22JX-C0JBV-DN.js +853 -0
- package/out/renderer/assets/4TTDE5I4-9dfnF-mJ.js +501 -0
- package/out/renderer/assets/4UF3HTLV-BOGNNOtG.js +29 -0
- package/out/renderer/assets/5THPTBWS-2mBFupjU.js +21 -0
- package/out/renderer/assets/7WLXJQOR-C8MM6Bra.js +23 -0
- package/out/renderer/assets/AAXQQPKT-CUxujcLx.js +1130 -0
- package/out/renderer/assets/AKE5O7KZ-BacZZCk1.js +184 -0
- package/out/renderer/assets/{AgentSettings-DffQ3g7i.js → AgentSettings-d970JEBg.js} +711 -265
- package/out/renderer/assets/BNMLP6AG-CPZZ4Yk4.js +804 -0
- package/out/renderer/assets/DKTLEL5E-Dj3316cp.js +42 -0
- package/out/renderer/assets/DR6PKOQU-B1RVO4q1.js +301 -0
- package/out/renderer/assets/E4RJ7UJB-DblNDQqr.js +441 -0
- package/out/renderer/assets/ELSXBIJH-Cv7twqii.js +39 -0
- package/out/renderer/assets/ERTIBQVS-BOWB3hEk.js +182 -0
- package/out/renderer/assets/F653G4FO-W-KqfQ-Y.js +1497 -0
- package/out/renderer/assets/FKCDD66M-B14TkcR1.js +205 -0
- package/out/renderer/assets/FP7KDXVC-CfbGNJSU.js +221 -0
- package/out/renderer/assets/FT5I3RHX-CN4zS9Hs.js +243 -0
- package/out/renderer/assets/FTXIJQGB-BX14b7pN.js +13 -0
- package/out/renderer/assets/G3MDBVQH-qZ3yfAIw.js +25 -0
- package/out/renderer/assets/GY35JXOZ-JZ4iNyhl.js +168 -0
- package/out/renderer/assets/H5EEJPP2-uIwpGj04.js +353 -0
- package/out/renderer/assets/HWDLEDTA-B-21e-nW.js +982 -0
- package/out/renderer/assets/{InfoIcon-CMLVIQF3.js → InfoIcon-BdHyLaWR.js} +1 -1
- package/out/renderer/assets/JZWSX6AR-CGOPcITT.js +67 -0
- package/out/renderer/assets/KQOEJWJY-CVXfAIs2.js +84 -0
- package/out/renderer/assets/KS3BB3KE-CtBv4FqR.js +138 -0
- package/out/renderer/assets/KXJRRZHI-BM99Fieb.js +502 -0
- package/out/renderer/assets/MFVI5XKI-CnIb_NK6.js +10 -0
- package/out/renderer/assets/MWY2J62P-_tQcE8Un.js +1102 -0
- package/out/renderer/assets/MXGNCBL2-BNrmRaJD.js +216 -0
- package/out/renderer/assets/N6DAJLIZ-BAz5hAGi.js +120 -0
- package/out/renderer/assets/NU5M23IW-CffAjbNM.js +116 -0
- package/out/renderer/assets/NV4XNBIS-CVgN6zoj.js +1221 -0
- package/out/renderer/assets/OGLU4SIR-BWc9bhhe.js +289 -0
- package/out/renderer/assets/OUNS5N76-Da3c60xf.js +1064 -0
- package/out/renderer/assets/{Onboarding-699qRMTN.js → Onboarding-C_40udgn.js} +4 -4
- package/out/renderer/assets/PU4ISKXV-caynfvUT.js +515 -0
- package/out/renderer/assets/PUZGS23X-BBtie16s.js +21 -0
- package/out/renderer/assets/{ProviderHeader-BnuGEmze.js → ProviderHeader-DTr3RouJ.js} +226 -68
- package/out/renderer/assets/Q3IYVLG5-BtsgTutD.js +500 -0
- package/out/renderer/assets/QYHQDLKZ-B_qsOSul.js +983 -0
- package/out/renderer/assets/RVARI57O-DMrXgtoB.js +10 -0
- package/out/renderer/assets/RZSVICHU-Bmzdqx47.js +263 -0
- package/out/renderer/assets/{SettingsPage-CLTNRnQI.js → SettingsPage-BfCnceVZ.js} +1952 -1744
- package/out/renderer/assets/UEXXS2NB-BzcZ5Jtl.js +25 -0
- package/out/renderer/assets/UHTQJXKL-C3dTKgrU.js +134 -0
- package/out/renderer/assets/URA2L2QI-B0LuLlBK.js +201 -0
- package/out/renderer/assets/UXCHDUKG-BCkRaN06.js +173 -0
- package/out/renderer/assets/{UsageDashboard-DRihVOqx.js → UsageDashboard-C8R2mFRK.js} +11329 -8646
- package/out/renderer/assets/VKNV3BUX-DIigERiR.js +277 -0
- package/out/renderer/assets/VMV7XPHP-ZutksyU0.js +127 -0
- package/out/renderer/assets/WEVWDWVA-RbwADIlH.js +57 -0
- package/out/renderer/assets/XRRJ35LF-C0MrgsVR.js +119 -0
- package/out/renderer/assets/YFKBLVVN-DWeGL1O-.js +990 -0
- package/out/renderer/assets/YHRE5QGZ-QRdA6Sjw.js +697 -0
- package/out/renderer/assets/ZF3OVT4B-Br3NszUk.js +420 -0
- package/out/renderer/assets/{index-DTwId9nn.js → index--wHnLMDb.js} +1 -1
- package/out/renderer/assets/{index-D1Him45L.js → index-8j5_0Xmy.js} +2 -2
- package/out/renderer/assets/{index-BeF6VrSe.js → index-B5RSRSoJ.js} +1 -1
- package/out/renderer/assets/{index-8-JzmzqC.js → index-B7B7XIvK.js} +2 -2
- package/out/renderer/assets/{index-4IKrE3Ch.js → index-B8KC4V_E.js} +2 -2
- package/out/renderer/assets/{index-CNGDTtBW.js → index-BE3TwVrI.js} +1 -1
- package/out/renderer/assets/{index-BSh2X31_.js → index-BI_bWG8f.js} +5 -5
- package/out/renderer/assets/{index-DBHj35Nq.js → index-BSVdNEPT.js} +2 -2
- package/out/renderer/assets/{index-CY4zeK5l.js → index-Bfv_tHDl.js} +3 -3
- package/out/renderer/assets/{index-tkTKXqGX.js → index-BgwAdiY-.js} +3 -3
- package/out/renderer/assets/{index-TTgmBk0H.js → index-CCXOgMyH.js} +1 -1
- package/out/renderer/assets/{index-DZ8Tuuit.js → index-CPsc5AXE.js} +33253 -56520
- package/out/renderer/assets/{index-Z7VaFhjR.js → index-CbIhyJsA.js} +1 -1
- package/out/renderer/assets/{index-ly0cB32v.css → index-CmC58I3A.css} +147 -0
- package/out/renderer/assets/{index-C-WEDvyw.js → index-CmZ1Jh7h.js} +5 -5
- package/out/renderer/assets/{index-Dq8m0XiD.js → index-Cpbtrl5u.js} +2 -2
- package/out/renderer/assets/{index-D2Y9BB9n.js → index-Ctxv0x2L.js} +5 -5
- package/out/renderer/assets/{index-BFLm6WFt.js → index-CuPAggjp.js} +5 -5
- package/out/renderer/assets/{index-BhXi7Le_.js → index-D3XbzIRk.js} +5 -5
- package/out/renderer/assets/{index-3hl2j-_p.js → index-D5x1sIX6.js} +2 -2
- package/out/renderer/assets/{index-vBiBurKH.js → index-D6Wnf7gd.js} +2 -2
- package/out/renderer/assets/{index-Otcl72On.js → index-DLjRa0WD.js} +1403 -1403
- package/out/renderer/assets/{index-D1jY29Az.js → index-DjulCRn0.js} +4 -4
- package/out/renderer/assets/{index-CnxPOcjf.js → index-Dmxn6jrh.js} +1 -1
- package/out/renderer/assets/{index-HjbPyDJm.js → index-Dq6Gglw0.js} +5 -5
- package/out/renderer/assets/{index-DUOs3uZb.js → index-DvBIPTnQ.js} +1 -1
- package/out/renderer/assets/{index--DpoC2Fa.js → index-XefJXdnR.js} +2 -2
- package/out/renderer/assets/{index-CC_7dh5L.js → index-ZECsEmSY.js} +2 -2
- package/out/renderer/assets/{index-B41U46QG.js → index-cOR6WxqF.js} +1 -1
- package/out/renderer/assets/{index-Bv8Yvnki.js → index-dFdSx4rr.js} +2 -2
- package/out/renderer/assets/{index-BJ-vdpjD.js → index-j2Lce0uE.js} +1 -1
- package/out/renderer/assets/{index-DHZvdQmh.js → index-rCofdqK1.js} +2 -2
- package/out/renderer/assets/{index-CBVmxCYX.js → index-sKm26BNt.js} +2 -2
- package/out/renderer/assets/{jsx-dev-runtime-DshTpFeb.js → jsx-dev-runtime-Cc6Jhn6s.js} +1 -1
- package/out/renderer/index.html +2 -2
- package/out/resources/prompts/system-prompt.hbs +11 -0
- package/out/resources/skills/extension-creator/SKILL.md +32 -1
- package/out/resources/skills/extension-creator/references/event-types.md +3 -3
- package/out/resources/skills/extension-creator/references/extension-interface.md +67 -0
- package/out/resources/skills/extension-creator/references/external-agent-providers.md +90 -0
- package/out/resources/skills/extension-creator/references/ui-components.md +29 -4
- package/out/runner.js +2235 -393
- package/package.json +22 -22
- package/out/renderer/assets/abnfDiagram-N423BO3Z-D0STbTTF.js +0 -118
- package/out/renderer/assets/arc-DeFSKBzy.js +0 -131
- package/out/renderer/assets/architectureDiagram-T3A2C74G-BDrfxwK6.js +0 -8829
- package/out/renderer/assets/band-zXq5o_Ib.js +0 -77
- package/out/renderer/assets/blockDiagram-VBNYF7ZC-x_YF9Yme.js +0 -3824
- package/out/renderer/assets/c4Diagram-5PPSVZJV-C7kuvNRf.js +0 -2482
- package/out/renderer/assets/channel-T97-CMvj.js +0 -7
- package/out/renderer/assets/chunk-2GRJ4B5K-C7nbnxgH.js +0 -116
- package/out/renderer/assets/chunk-2Q5K7J3B-D5IUyzX4.js +0 -19
- package/out/renderer/assets/chunk-5RXB4S5H-DkL2I1-Q.js +0 -1988
- package/out/renderer/assets/chunk-5VM5RSS4-qszW8EYL.js +0 -19
- package/out/renderer/assets/chunk-6Q2QTUOP-CbtMo4y_.js +0 -860
- package/out/renderer/assets/chunk-GF5L2VYU-C6qdgHXJ.js +0 -2026
- package/out/renderer/assets/chunk-JWPE2WC7-DxAg7bLn.js +0 -16
- package/out/renderer/assets/chunk-KBJHAD2P-Cqd2HDdS.js +0 -24
- package/out/renderer/assets/chunk-RYQCIY6F-DVzbqgRf.js +0 -474
- package/out/renderer/assets/chunk-XXDRQBXY-DF_8pbWI.js +0 -13
- package/out/renderer/assets/classDiagram-JCYQIIEL-MfTsDS5w.js +0 -23
- package/out/renderer/assets/classDiagram-v2-OCEON4UE-MfTsDS5w.js +0 -23
- package/out/renderer/assets/cose-bilkent-JH36ORCC-BvzyW9fn.js +0 -4942
- package/out/renderer/assets/cynefin-VYW2F7L2-BmRenSSB.js +0 -32093
- package/out/renderer/assets/cynefinDiagram-MW4NZA55-DmybMaTR.js +0 -453
- package/out/renderer/assets/cytoscape.esm-Bx_1tVW-.js +0 -30332
- package/out/renderer/assets/dagre-VZM6K2ZE-b6plu1_t.js +0 -522
- package/out/renderer/assets/defaultLocale-B2RvLBDe.js +0 -206
- package/out/renderer/assets/diagram-7IWD3JNH-B0LyLNK-.js +0 -488
- package/out/renderer/assets/diagram-B4RE2ZJO-BtJGLH72.js +0 -632
- package/out/renderer/assets/diagram-LBJQPF4R-BpSykW90.js +0 -212
- package/out/renderer/assets/diagram-Q27KOJAE-_vw0jdNl.js +0 -857
- package/out/renderer/assets/diagram-UB23O5K3-rE12zYQ8.js +0 -311
- package/out/renderer/assets/ebnfDiagram-BXEA7PRR-BXR1_d_o.js +0 -138
- package/out/renderer/assets/erDiagram-JOGREHBK-B1QCAGl4.js +0 -1238
- package/out/renderer/assets/flowDiagram-UKHOOZJN-wRfN63to.js +0 -2348
- package/out/renderer/assets/ganttDiagram-PKOTCBZU-DsXpzatp.js +0 -2782
- package/out/renderer/assets/gitGraphDiagram-DS77QQ5N-CsYsZ42q.js +0 -1373
- package/out/renderer/assets/graph-CfUL5tFv.js +0 -1308
- package/out/renderer/assets/infoDiagram-6WML65LV-BXT6TYnf.js +0 -31
- package/out/renderer/assets/init-CTO7spbL.js +0 -35
- package/out/renderer/assets/ishikawaDiagram-WSZJBQD7-6BJ687Ec.js +0 -967
- package/out/renderer/assets/journeyDiagram-NVQOT4AX-HgkRlCT0.js +0 -1255
- package/out/renderer/assets/kanban-definition-27J2QSJJ-COYri25f.js +0 -1052
- package/out/renderer/assets/layout-BBVpFPy1.js +0 -2326
- package/out/renderer/assets/linear-DuNIFrPi.js +0 -361
- package/out/renderer/assets/map-toxJVbdU.js +0 -299
- package/out/renderer/assets/mindmap-definition-FAOFIHXS-DhCEcxPL.js +0 -1153
- package/out/renderer/assets/ordinal-BD3Y6v77.js +0 -77
- package/out/renderer/assets/pegDiagram-VL7TDLO6-DZ8w3ViJ.js +0 -126
- package/out/renderer/assets/pieDiagram-7S7Q4E2Y-JcEYE_Dn.js +0 -316
- package/out/renderer/assets/quadrantDiagram-CIZ2JOQS-De59Sk4l.js +0 -1343
- package/out/renderer/assets/railroadDiagram-AXF67PYL-D7nWbE5S.js +0 -92
- package/out/renderer/assets/requirementDiagram-LRYGKXZP-DKWcKu7I.js +0 -1204
- package/out/renderer/assets/sankeyDiagram-W5VNT64P-Bj8jLitx.js +0 -1274
- package/out/renderer/assets/sequenceDiagram-SI44F4Z6-D9Jp65xC.js +0 -4514
- package/out/renderer/assets/sizeCapture-X5ZJPWSS-mY9H2lE6.js +0 -62
- package/out/renderer/assets/stateDiagram-OKZ733FA-BEn9ud4k.js +0 -452
- package/out/renderer/assets/stateDiagram-v2-UEYNNEHI-D_psrMs3.js +0 -22
- package/out/renderer/assets/swimlanes-SLNWSIFB-BMcpfWEi.js +0 -8557
- package/out/renderer/assets/swimlanesDiagram-ULZ7WXOC-OwdbT2xV.js +0 -20
- package/out/renderer/assets/time-DMe8nTku.js +0 -985
- package/out/renderer/assets/timeline-definition-Z64GVDOM-BTi-OvtJ.js +0 -1596
- package/out/renderer/assets/vennDiagram-T6HMQDX7-CoxSnB7W.js +0 -2515
- package/out/renderer/assets/wardleyDiagram-T6FBY63Y-Dj0FNpwr.js +0 -975
- package/out/renderer/assets/xychartDiagram-ELKLHX3M-jVSDR4Ov.js +0 -1943
- package/patches/ai+7.0.127.patch +0 -29
|
@@ -0,0 +1,1064 @@
|
|
|
1
|
+
import { x } from "./ELSXBIJH-Cv7twqii.js";
|
|
2
|
+
import { b as be$1, d as de, m as me$1, p as pe$1 } from "./FKCDD66M-B14TkcR1.js";
|
|
3
|
+
import { H, J as r, y as t, B as u, K as x$2, x as x$3 } from "./index-CPsc5AXE.js";
|
|
4
|
+
import { m, c } from "./DKTLEL5E-Dj3316cp.js";
|
|
5
|
+
import { F as Fn$1, S as Sn$1, D as Dn$1, w as wn$1 } from "./HWDLEDTA-B-21e-nW.js";
|
|
6
|
+
import { g as gt$1, a as _t, h as ht$1, y, x as x$1, f as ft$1, _, b, $ as $t } from "./RZSVICHU-Bmzdqx47.js";
|
|
7
|
+
var tt = "EOF USECASE ACTOR SYSTEM_BOUNDARY END DIRECTION TD TB BT LR RL NOTE FOR JSON CLASS_DEF CLASS STYLE INCLUDE EXTEND TRUE FALSE IDENTIFIER NUMBER AT COMMA COLON HASH_COLOR CSS_IDENTIFIER CSS_ESCAPED_COMMA DASH DOT PERCENT CSS_PUNCTUATION LABEL_PUNCTUATION LABEL_SYMBOL PLAIN_STRING MARKDOWN_STRING UNCLOSED_MARKDOWN_STRING COMMENT NEWLINE ACC_DESCR_BLOCK ACC_TITLE_LINE ACC_DESCR_LINE JSON_DECLARATION_START JSON_OBJECT_LITERAL UNCLOSED_JSON_OBJECT_LITERAL GENERALIZATION DEPENDENCY_ARROW STEREOTYPE_START STEREOTYPE_END STEREOTYPE_TEXT UNCLOSED_STEREOTYPE_TEXT CLASS_SEPARATOR FORWARD_SOLID BACKWARD_SOLID FORWARD_CIRCLE BACKWARD_CIRCLE FORWARD_CROSS BACKWARD_CROSS MARKERLESS_SOLID METADATA_START LBRACE RBRACE LBRACKET RBRACKET LPAREN RPAREN".split(" ");
|
|
8
|
+
var be = 1, Gt = 2, ae = new Uint8Array(128);
|
|
9
|
+
for (let e = 48; e <= 57; e++) ae[e] = be;
|
|
10
|
+
for (let e = 65; e <= 90; e++) ae[e] = ae[e + 32] = be;
|
|
11
|
+
ae[95] = be;
|
|
12
|
+
for (let e of "!#$&*+/=?^|~") ae[e.charCodeAt(0)] = Gt;
|
|
13
|
+
var Ft = [0, 12, 5, 14, 3, 9, 2, 2, 2, 2, 2, 4, 3, 4, 8, 5, 5, 7, 6, 4, 5];
|
|
14
|
+
function Be(e) {
|
|
15
|
+
return e < 128 && (ae[e] & be) !== 0;
|
|
16
|
+
}
|
|
17
|
+
function nt(e, n, s) {
|
|
18
|
+
for (let r2 = 0; r2 < s.length; r2++) if ((e.charCodeAt(n + r2) | 32) !== s.charCodeAt(r2)) return false;
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function vn(e, n, s) {
|
|
22
|
+
switch (s) {
|
|
23
|
+
case 97:
|
|
24
|
+
return e.startsWith("actor", n) ? 2 : 0;
|
|
25
|
+
case 115:
|
|
26
|
+
return e.startsWith("systemBoundary", n) ? 3 : e.startsWith("style", n) ? 16 : 0;
|
|
27
|
+
case 101:
|
|
28
|
+
return e.startsWith("end", n) ? 4 : nt(e, n, "extend") ? 18 : 0;
|
|
29
|
+
case 69:
|
|
30
|
+
return nt(e, n, "extend") ? 18 : 0;
|
|
31
|
+
case 100:
|
|
32
|
+
return e.startsWith("direction", n) ? 5 : 0;
|
|
33
|
+
case 84:
|
|
34
|
+
return e.startsWith("TD", n) ? 6 : e.startsWith("TB", n) ? 7 : 0;
|
|
35
|
+
case 66:
|
|
36
|
+
return e.startsWith("BT", n) ? 8 : 0;
|
|
37
|
+
case 76:
|
|
38
|
+
return e.startsWith("LR", n) ? 9 : 0;
|
|
39
|
+
case 82:
|
|
40
|
+
return e.startsWith("RL", n) ? 10 : 0;
|
|
41
|
+
case 110:
|
|
42
|
+
return e.startsWith("note", n) ? 11 : 0;
|
|
43
|
+
case 102:
|
|
44
|
+
return e.startsWith("for", n) ? 12 : e.startsWith("false", n) ? 20 : 0;
|
|
45
|
+
case 106:
|
|
46
|
+
return e.startsWith("json", n) ? 13 : 0;
|
|
47
|
+
case 99:
|
|
48
|
+
return e.startsWith("classDef", n) ? 14 : e.startsWith("class", n) ? 15 : 0;
|
|
49
|
+
case 105:
|
|
50
|
+
case 73:
|
|
51
|
+
return nt(e, n, "include") ? 17 : 0;
|
|
52
|
+
case 116:
|
|
53
|
+
return e.startsWith("true", n) ? 19 : 0;
|
|
54
|
+
case 117:
|
|
55
|
+
return e.startsWith("usecase-beta", n) ? 1 : 0;
|
|
56
|
+
default:
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function ie(e, n) {
|
|
61
|
+
let s = 1, r2 = 0;
|
|
62
|
+
for (let o = 0; o < n; o++) {
|
|
63
|
+
let a = e.charCodeAt(o);
|
|
64
|
+
a !== 10 && a !== 13 || (a === 13 && o + 1 < n && e.charCodeAt(o + 1) === 10 && o++, s++, r2 = o + 1);
|
|
65
|
+
}
|
|
66
|
+
return [s, n - r2 + 1];
|
|
67
|
+
}
|
|
68
|
+
function jt(e, n, s) {
|
|
69
|
+
let [r2, o] = ie(e, n);
|
|
70
|
+
return `line ${r2}, column ${o} [${n},${s})`;
|
|
71
|
+
}
|
|
72
|
+
function Yt(e, n, s) {
|
|
73
|
+
for (let r2 = n + 1; r2 < e.length; r2++) {
|
|
74
|
+
let o = e.charCodeAt(r2);
|
|
75
|
+
if (o === s) return r2 + 1;
|
|
76
|
+
if (o === 10 || o === 13) return -1;
|
|
77
|
+
}
|
|
78
|
+
return -1;
|
|
79
|
+
}
|
|
80
|
+
function Pn(e, n) {
|
|
81
|
+
let s = e.charCodeAt(n);
|
|
82
|
+
return s !== 34 && s !== 39 ? true : s === 34 && e.charCodeAt(n + 1) === 96 || Yt(e, n, s) !== -1;
|
|
83
|
+
}
|
|
84
|
+
function Kt(e, n, s) {
|
|
85
|
+
let [r2, o] = ie(e, n);
|
|
86
|
+
return new x$3(`Error lexing usecase diagram: unexpected character: ->${e.charAt(n)}<- at offset: ${n}, skipped ${s} characters. at line ${r2}, column ${o} [${n},${n + s})`, "syntax", { type: "usecase", line: r2, column: o });
|
|
87
|
+
}
|
|
88
|
+
function Jt(e) {
|
|
89
|
+
let n = [], s = [], r$1 = [], o = e.length, a = 0, d = true, E = false;
|
|
90
|
+
for (; a < o; ) {
|
|
91
|
+
let h = e.charCodeAt(a);
|
|
92
|
+
if (h === 32 || h === 9) {
|
|
93
|
+
a++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
let u$1, p = a + 1, O = false;
|
|
97
|
+
if (h < 128 && (ae[h] & be) !== 0) {
|
|
98
|
+
if (u$1 = 0, h === 97 && d && e.startsWith("acc", a)) {
|
|
99
|
+
let i = e.startsWith("Descr", a + 3);
|
|
100
|
+
if (i || e.startsWith("Title", a + 3)) {
|
|
101
|
+
let A = a + 8;
|
|
102
|
+
for (; r(e.charCodeAt(A)); ) A++;
|
|
103
|
+
let _2 = e.charCodeAt(A);
|
|
104
|
+
if (_2 === 58) for (u$1 = i ? 42 : 41, p = A + 1; p < o && e.charCodeAt(p) !== 10 && e.charCodeAt(p) !== 13; ) p++;
|
|
105
|
+
else if (_2 === 123 && i && !E) {
|
|
106
|
+
let N = e.indexOf("}", A + 1);
|
|
107
|
+
N === -1 ? E = true : (u$1 = 40, p = N + 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
} else if (h === 106 && e.startsWith("json", a) && r(e.charCodeAt(a + 4))) {
|
|
111
|
+
let i = a + 5;
|
|
112
|
+
for (; r(e.charCodeAt(i)); ) i++;
|
|
113
|
+
let A = i;
|
|
114
|
+
for (; Be(e.charCodeAt(i)); ) i++;
|
|
115
|
+
if (i > A) {
|
|
116
|
+
for (; r(e.charCodeAt(i)); ) i++;
|
|
117
|
+
if (e.charCodeAt(i) === 64) {
|
|
118
|
+
for (i++; r(e.charCodeAt(i)); ) i++;
|
|
119
|
+
if (e.charCodeAt(i) === 123) {
|
|
120
|
+
n.push(43), s.push(a), r$1.push(i), a = i;
|
|
121
|
+
let _2 = 0, N = false, w = false, I = i;
|
|
122
|
+
for (; I < o; I++) {
|
|
123
|
+
let B = e.charCodeAt(I);
|
|
124
|
+
if (N) w ? w = false : B === 92 ? w = true : B === 34 && (N = false);
|
|
125
|
+
else if (B === 34) N = true;
|
|
126
|
+
else if (B === 123) _2++;
|
|
127
|
+
else if (B === 125 && --_2 === 0) break;
|
|
128
|
+
}
|
|
129
|
+
n.push(I < o ? 44 : 45), s.push(i), a = I < o ? I + 1 : o, r$1.push(a), d = false;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (u$1 === 0) {
|
|
136
|
+
for (; p < o && Be(e.charCodeAt(p)); ) p++;
|
|
137
|
+
let i = vn(e, a, h);
|
|
138
|
+
if (i !== 0) i === 1 || p - a === Ft[i] ? (u$1 = i, p = a + Ft[i]) : u$1 = 21;
|
|
139
|
+
else if ((h === 111 || h === 120) && e.charCodeAt(a + 1) === 45 && e.charCodeAt(a + 2) === 45) u$1 = h === 111 ? 56 : 58, p = a + 3;
|
|
140
|
+
else if (t(h)) {
|
|
141
|
+
let A = a + 1;
|
|
142
|
+
for (; t(e.charCodeAt(A)); ) A++;
|
|
143
|
+
if (e.charCodeAt(A) === 46 && t(e.charCodeAt(A + 1))) {
|
|
144
|
+
for (u$1 = 22, p = A + 2; t(e.charCodeAt(p)); ) p++;
|
|
145
|
+
for (; u(e.charCodeAt(p)); ) p++;
|
|
146
|
+
} else u$1 = 21;
|
|
147
|
+
} else for (u$1 = 21; e.charCodeAt(p) === 45 && Be(e.charCodeAt(p + 1)); ) for (u$1 = 27, p += 2; Be(e.charCodeAt(p)); ) p++;
|
|
148
|
+
}
|
|
149
|
+
} else if (h === 10) u$1 = 39, O = true;
|
|
150
|
+
else if (h === 13) u$1 = 39, O = true, e.charCodeAt(p) === 10 && p++;
|
|
151
|
+
else if (h === 34 || h === 39) {
|
|
152
|
+
if (h === 34 && e.charCodeAt(a + 1) === 96) {
|
|
153
|
+
let i = e.indexOf('`"', a + 2);
|
|
154
|
+
u$1 = i === -1 ? 37 : 36, p = i === -1 ? o : i + 2;
|
|
155
|
+
} else if (u$1 = 35, p = Yt(e, a, h), p === -1) {
|
|
156
|
+
let i = a + 1;
|
|
157
|
+
for (; i < o && !Pn(e, i); ) i++;
|
|
158
|
+
throw Kt(e, a, i - a);
|
|
159
|
+
}
|
|
160
|
+
} else if (h === 37) if (d && e.charCodeAt(p) === 37) for (u$1 = 38; p < o && e.charCodeAt(p) !== 10 && e.charCodeAt(p) !== 13; ) p++;
|
|
161
|
+
else u$1 = 31;
|
|
162
|
+
else if (h === 45) if (e.charCodeAt(p) !== 45) u$1 = 29;
|
|
163
|
+
else {
|
|
164
|
+
for (; e.charCodeAt(p) === 45; ) p++;
|
|
165
|
+
let i = e.charCodeAt(p), A = p - a === 2;
|
|
166
|
+
A && i === 124 && e.charCodeAt(p + 1) === 62 ? (u$1 = 46, p += 2) : i === 62 ? (u$1 = 53, p++) : A && (i === 111 || i === 120) ? (u$1 = i === 111 ? 55 : 57, p++) : u$1 = 59;
|
|
167
|
+
}
|
|
168
|
+
else if (h === 46) {
|
|
169
|
+
let i = e.charCodeAt(p);
|
|
170
|
+
if (i === 46 && e.charCodeAt(p + 1) === 62) u$1 = 47, p += 2;
|
|
171
|
+
else if (t(i)) {
|
|
172
|
+
for (u$1 = 22; t(e.charCodeAt(p)); ) p++;
|
|
173
|
+
for (; u(e.charCodeAt(p)); ) p++;
|
|
174
|
+
} else u$1 = 30;
|
|
175
|
+
} else if (h === 60) if (e.charCodeAt(p) === 60) {
|
|
176
|
+
if (n.push(48), s.push(a), r$1.push(a + 2), d = false, a += 2, a >= o) break;
|
|
177
|
+
if (e.charCodeAt(a) === 62 && e.charCodeAt(a + 1) === 62) u$1 = 49, p = a + 2;
|
|
178
|
+
else {
|
|
179
|
+
let i = a, A = false;
|
|
180
|
+
for (; i < o; i++) {
|
|
181
|
+
let _2 = e.charCodeAt(i);
|
|
182
|
+
if (_2 === 10 || _2 === 13) break;
|
|
183
|
+
if (_2 === 62 && e.charCodeAt(i + 1) === 62) {
|
|
184
|
+
A = true;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (A && e.slice(a, i).trim() !== "") n.push(50), s.push(a), r$1.push(i), u$1 = 49, a = i, p = i + 2;
|
|
189
|
+
else {
|
|
190
|
+
for (; i < o && e.charCodeAt(i) !== 10 && e.charCodeAt(i) !== 13; ) i++;
|
|
191
|
+
if (i === a) {
|
|
192
|
+
for (; i < o && (e.charCodeAt(i) === 10 || e.charCodeAt(i) === 13); ) i++;
|
|
193
|
+
throw Kt(e, a, i - a);
|
|
194
|
+
}
|
|
195
|
+
u$1 = 51, p = i;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
} else if (e.charCodeAt(p) === 45 && e.charCodeAt(p + 1) === 45) for (u$1 = 54, p += 2; e.charCodeAt(p) === 45; ) p++;
|
|
199
|
+
else u$1 = 33;
|
|
200
|
+
else if (h === 58) e.charCodeAt(p) === 58 && e.charCodeAt(p + 1) === 58 ? (u$1 = 52, p += 2) : u$1 = 25;
|
|
201
|
+
else if (h === 64) e.charCodeAt(p) === 123 ? (u$1 = 60, p++) : u$1 = 23;
|
|
202
|
+
else if (h === 123) u$1 = 61;
|
|
203
|
+
else if (h === 125) u$1 = 62;
|
|
204
|
+
else if (h === 91) u$1 = 63;
|
|
205
|
+
else if (h === 93) u$1 = 64;
|
|
206
|
+
else if (h === 40) u$1 = 65;
|
|
207
|
+
else if (h === 41) u$1 = 66;
|
|
208
|
+
else if (h === 44) u$1 = 24;
|
|
209
|
+
else if (h === 35) {
|
|
210
|
+
for (; x$2(e.charCodeAt(p)); ) p++;
|
|
211
|
+
u$1 = p > a + 1 ? 26 : 32;
|
|
212
|
+
} else if (h === 92) e.charCodeAt(p) === 44 ? (u$1 = 28, p++) : u$1 = 33;
|
|
213
|
+
else if (h < 127 && h > 32) u$1 = (ae[h] & Gt) !== 0 ? 32 : 33;
|
|
214
|
+
else for (u$1 = 34; p < o; ) {
|
|
215
|
+
let i = e.charCodeAt(p);
|
|
216
|
+
if (i >= 32 && i < 127 || i === 9 || i === 10 || i === 13) break;
|
|
217
|
+
p++;
|
|
218
|
+
}
|
|
219
|
+
n.push(u$1), s.push(a), r$1.push(p), a = p, d = O;
|
|
220
|
+
}
|
|
221
|
+
for (let h = 0; h < 3; h++) n.push(0), s.push(o), r$1.push(o);
|
|
222
|
+
return { types: n, starts: s, ends: r$1 };
|
|
223
|
+
}
|
|
224
|
+
function Ht() {
|
|
225
|
+
return { type: "usecase", actors: /* @__PURE__ */ new Map(), useCases: /* @__PURE__ */ new Map(), systemBoundaries: /* @__PURE__ */ new Map(), relationships: [], notes: /* @__PURE__ */ new Map(), jsonNodes: /* @__PURE__ */ new Map(), classDefs: /* @__PURE__ */ new Map(), direction: "LR", title: void 0, accTitle: "", accDescr: "", accDescription: "", source: "", headerSpan: [0, 0], statements: [] };
|
|
226
|
+
}
|
|
227
|
+
function Vt() {
|
|
228
|
+
return { elements: [], boundaries: [], jsons: [], relationships: [], notes: [], metadata: [], classes: [], styles: [], classDefs: [], direction: void 0, accTitle: "", accDescription: "" };
|
|
229
|
+
}
|
|
230
|
+
function st(e, n) {
|
|
231
|
+
if (n.length === 0) return;
|
|
232
|
+
let s = new Set(e);
|
|
233
|
+
for (let r2 of n) s.has(r2) || (s.add(r2), e.push(r2));
|
|
234
|
+
}
|
|
235
|
+
function Fn(e) {
|
|
236
|
+
let n = /* @__PURE__ */ new Set(["actor", "usecase", "boundary", "edge"]);
|
|
237
|
+
for (let { key: s, value: r2 } of e) if (s === "icon") n.clear(), n.add("actor");
|
|
238
|
+
else if (s === "animate" || s === "animation") n.clear(), n.add("edge");
|
|
239
|
+
else if (s === "type") n.clear(), r2 === "rect" || r2 === "package" ? n.add("boundary") : (r2 === "normal" || r2 === "hollow" || r2 === "awesome") && n.add("actor");
|
|
240
|
+
else if (s === "business") n.delete("boundary"), n.delete("edge");
|
|
241
|
+
else return;
|
|
242
|
+
return n.size === 1 ? [...n][0] : void 0;
|
|
243
|
+
}
|
|
244
|
+
function Xt(e, n, s, r2, o) {
|
|
245
|
+
let a = Ht(), { actors: d, useCases: E, systemBoundaries: h } = a, u2 = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), _2 = (t2) => jt(e, t2[0], t2[1]), N = (t2, c2) => {
|
|
246
|
+
let [f, b2] = ie(e, c2[0]);
|
|
247
|
+
return new x$3(t2, "semantic", { type: "usecase", line: f, column: b2 });
|
|
248
|
+
}, w = (t2, c2) => {
|
|
249
|
+
throw N(`${t2} at ${_2(c2)}`, c2);
|
|
250
|
+
}, I = (t2, c2, f, b2, y2) => {
|
|
251
|
+
let C = (T) => T === void 0 ? "" : ` (label "${T}")`;
|
|
252
|
+
throw N(`${t2} at ${_2(c2)}${C(b2)}; previous declaration at ${_2(f)}${C(y2)}`, c2);
|
|
253
|
+
}, B = (t2, c2, f) => w(`Metadata property '${f.key}' is invalid for ${c2} '${t2}'`, f.keySpan), H2 = (t2, c2) => {
|
|
254
|
+
let f = A.get(t2);
|
|
255
|
+
(f === void 0 || c2 < f) && A.set(t2, c2);
|
|
256
|
+
}, te = (t2) => [...t2].sort((c2, f) => (A.get(c2.id) ?? 0) - (A.get(f.id) ?? 0)), de2 = (t2, c2) => {
|
|
257
|
+
u2.set(t2.id, { kind: c2, span: t2.span, generated: t2.generated, label: t2.label.text });
|
|
258
|
+
}, Se = (t2, c2) => {
|
|
259
|
+
let f = u2.get(t2.id);
|
|
260
|
+
if (!f) return;
|
|
261
|
+
let b2 = t2.generated ? t2.label.text : void 0, y2 = f.generated ? f.label : void 0;
|
|
262
|
+
f.kind !== c2 && I(`ID '${t2.id}' is declared as both ${f.kind} and ${c2}`, t2.span, f.span, b2, y2), (f.generated || t2.generated) && I(`Generated ID '${t2.id}' collides with another declaration`, t2.span, f.span, b2, y2);
|
|
263
|
+
}, De = (t2, c2, f) => {
|
|
264
|
+
let b2 = u2.get(t2);
|
|
265
|
+
b2 && I(`ID '${t2}' is declared more than once (${b2.kind} and ${c2})`, f, b2.span, void 0, b2.generated ? b2.label : void 0), u2.set(t2, { kind: c2, span: f, generated: false });
|
|
266
|
+
}, Xe = (t2, c2, f) => {
|
|
267
|
+
let { key: b2, value: y2 } = c2, C = (T) => {
|
|
268
|
+
!f && T !== void 0 && T !== y2 && I(`Actor '${t2.id}' has conflicting ${b2} metadata`, c2.keySpan, t2.span);
|
|
269
|
+
};
|
|
270
|
+
b2 === "type" && (y2 === "normal" || y2 === "hollow" || y2 === "awesome") ? (C(t2.actorType), t2.actorType = y2) : b2 === "icon" && typeof y2 == "string" ? (C(t2.icon), t2.icon = y2) : b2 === "business" && typeof y2 == "boolean" ? (C(t2.business), t2.business = y2) : B(t2.id, "actor", c2);
|
|
271
|
+
}, re = (t2, c2, f) => {
|
|
272
|
+
for (let b2 of c2 ?? []) t2.kind === "actor" ? Xe(t2, b2, f) : b2.key === "business" && typeof b2.value == "boolean" ? (!f && t2.business !== void 0 && t2.business !== b2.value && I(`Use case '${t2.id}' has conflicting business metadata`, b2.keySpan, t2.span), t2.business = b2.value) : B(t2.id, "usecase", b2);
|
|
273
|
+
}, ue = (t2) => {
|
|
274
|
+
let c2;
|
|
275
|
+
if (t2.kind === "actor") {
|
|
276
|
+
E.delete(t2.id);
|
|
277
|
+
let f = { id: t2.id, label: t2.label.text, labelType: t2.label.type, business: t2.business ?? false, classes: [...t2.classes], type: t2.icon ? "icon" : t2.actorType ?? "normal", styles: d.get(t2.id)?.styles ?? [] };
|
|
278
|
+
t2.icon && (f.icon = t2.icon), d.set(t2.id, f), c2 = f;
|
|
279
|
+
} else d.delete(t2.id), c2 = { id: t2.id, label: t2.label.text, labelType: t2.label.type, business: t2.business ?? false, classes: [...t2.classes], shape: t2.shape ?? "ellipse", styles: E.get(t2.id)?.styles ?? [] }, E.set(t2.id, c2);
|
|
280
|
+
t2.stereotype && (c2.stereotype = t2.stereotype), t2.parent?.id && (c2.parentId = t2.parent.id);
|
|
281
|
+
}, _e = (t2) => {
|
|
282
|
+
Se(t2, t2.kind);
|
|
283
|
+
let c2 = t2.parent?.id ? t2.parent : void 0, f = p.get(t2.id);
|
|
284
|
+
if (!f) {
|
|
285
|
+
let b2 = { kind: t2.kind, id: t2.id, label: t2.label, span: t2.span, generated: t2.generated, classes: [...t2.classes], parent: c2, shape: t2.shape, stereotype: t2.stereotype, stereotypeSpan: t2.stereotype ? t2.span : void 0 };
|
|
286
|
+
re(b2, t2.metadata, false), p.set(t2.id, b2), de2(t2, t2.kind);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
(f.label.text !== t2.label.text || f.label.type !== t2.label.type) && I(`ID '${t2.id}' has conflicting labels`, t2.span, f.span), t2.shape && f.shape && t2.shape !== f.shape && I(`Use case '${t2.id}' has conflicting shapes`, t2.span, f.span), c2 && f.parent?.id && c2.id !== f.parent.id && I(`Element '${t2.id}' belongs to more than one system boundary`, c2.span, f.parent.span), t2.stereotype && f.stereotype && t2.stereotype !== f.stereotype && I(`Element '${t2.id}' has conflicting stereotypes`, t2.span, f.stereotypeSpan ?? f.span), f.shape ??= t2.shape, f.parent ??= t2.parent, f.stereotype ??= t2.stereotype, f.stereotypeSpan ??= t2.stereotype ? t2.span : void 0, st(f.classes, t2.classes), re(f, t2.metadata, false);
|
|
290
|
+
}, ge = (t2) => {
|
|
291
|
+
Se(t2, "boundary");
|
|
292
|
+
let c2 = O.get(t2.id);
|
|
293
|
+
if (c2) {
|
|
294
|
+
(c2.label.text !== t2.label.text || c2.label.type !== t2.label.type) && I(`Boundary '${t2.id}' has conflicting titles`, t2.span, c2.span), st(c2.classes, t2.classes);
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
O.set(t2.id, { ...t2, classes: [...t2.classes], members: [] }), de2(t2, "boundary");
|
|
298
|
+
}, Ae = (t2) => {
|
|
299
|
+
t2.classed && !t2.declares && w(`Relationship endpoint '${t2.id}' uses ::: without declaring the node`, t2.span);
|
|
300
|
+
let c2 = u2.get(t2.id);
|
|
301
|
+
return c2 ? c2.kind : (p.set(t2.id, { ...t2, kind: "usecase", shape: "ellipse", classes: [] }), de2(t2, "usecase"), H2(t2.id, t2.span[0]), "usecase");
|
|
302
|
+
}, fe = (t2, c2) => {
|
|
303
|
+
let f = u2.get(t2)?.kind;
|
|
304
|
+
return (f === "actor" ? d.get(t2) : f === "usecase" ? E.get(t2) : f === "boundary" ? h.get(t2) : f === "json" ? a.jsonNodes.get(t2) : i.get(t2)) ?? w(`Class/style target '${t2}' is unresolved or anonymous`, c2);
|
|
305
|
+
}, ne = [];
|
|
306
|
+
for (let { source: t2, target: c2 } of n.relationships) H2(t2.id, t2.span[0]), H2(c2.id, c2.span[0]);
|
|
307
|
+
for (let t2 of n.elements) H2(t2.id, t2.span[0]), ne.push({ offset: t2.span[0], run: () => _e(t2) });
|
|
308
|
+
for (let t2 of n.boundaries) H2(t2.id, t2.span[0]), ne.push({ offset: t2.span[0], run: () => ge(t2) });
|
|
309
|
+
for (let t2 of n.jsons) H2(t2.id, t2.span[0]), ne.push({ offset: t2.span[0], run: () => De(t2.id, "json", t2.span) });
|
|
310
|
+
for (let { id: t2, idSpan: c2 } of n.relationships) t2 && c2 && ne.push({ offset: c2[0], run: () => De(t2, "edge", c2) });
|
|
311
|
+
ne.sort((t2, c2) => t2.offset - c2.offset);
|
|
312
|
+
for (let t2 of ne) t2.run();
|
|
313
|
+
for (let t2 of te(p.values())) ue(t2);
|
|
314
|
+
for (let t2 of te(O.values())) h.set(t2.id, { id: t2.id, label: t2.label.text, labelType: t2.label.type, type: "rect", members: [], classes: [], styles: [] });
|
|
315
|
+
for (let t2 of te(n.jsons)) a.jsonNodes.set(t2.id, { id: t2.id, value: t2.value, propertyOrder: t2.propertyOrder, classes: [...t2.classes], styles: [] });
|
|
316
|
+
let we = 0;
|
|
317
|
+
for (let t2 of n.relationships) {
|
|
318
|
+
let { source: c2, target: f, type: b2 } = t2, y2 = Ae(c2), C = Ae(f), T = (M) => M === "actor" || M === "usecase" || M === "json";
|
|
319
|
+
T(y2) || I(`Relationship source '${c2.id}' cannot be ${y2}`, c2.span, u2.get(c2.id).span), T(C) || I(`Relationship target '${f.id}' cannot be ${C}`, f.span, u2.get(f.id).span), (b2 === "include" || b2 === "extend") && (y2 !== "usecase" || C !== "usecase") && w(`${b2} relationship requires use-case endpoints`, t2.span), b2 === "generalization" && (y2 === "json" || y2 !== C) && w("Generalization requires actor-to-actor or use-case-to-use-case endpoints", t2.span), b2 === "association" && (y2 === "json" || C === "json") && t2.arrowType > 2 && w(`JSON relationship '${c2.id}' to '${f.id}' permits only point, reversed-point, or markerless solid association`, t2.span);
|
|
320
|
+
let L = t2.id ?? `edge-${we++}`, $ = { id: L, explicitId: !!t2.id, source: c2.id, target: f.id, type: b2, arrowType: t2.arrowType, minlen: t2.minlen, classes: [], styles: [], animate: false };
|
|
321
|
+
t2.label && ($.label = t2.label.text, $.labelType = t2.label.type), a.relationships.push($), i.set(L, $);
|
|
322
|
+
}
|
|
323
|
+
let bt = new Map(d), m2 = new Map(E);
|
|
324
|
+
d.clear(), E.clear();
|
|
325
|
+
for (let t2 of te(p.values())) {
|
|
326
|
+
let c2 = bt.get(t2.id), f = m2.get(t2.id);
|
|
327
|
+
c2 ? d.set(t2.id, c2) : f ? E.set(t2.id, f) : ue(t2);
|
|
328
|
+
}
|
|
329
|
+
for (let { target: t2, span: c2, properties: f, statement: b2 } of n.metadata) {
|
|
330
|
+
let y2 = u2.get(t2);
|
|
331
|
+
if (!y2) {
|
|
332
|
+
let $ = Fn(f);
|
|
333
|
+
return w(`Metadata target '${t2}' is unresolved${$ ? ` (metadata implies ${$})` : ""}`, c2);
|
|
334
|
+
}
|
|
335
|
+
let C = y2.kind;
|
|
336
|
+
C === "actor" || C === "usecase" ? re(p.get(t2), f, true) : C === "edge" && (b2.kind = "edgeMetadata", b2.edges = [{ id: t2, span: b2.span, idSpan: c2, metadata: b2.metadata }], delete b2.nodes);
|
|
337
|
+
let T = O.get(t2), L = i.get(t2);
|
|
338
|
+
for (let $ of C === "actor" || C === "usecase" ? [] : f) {
|
|
339
|
+
let { key: M, value: D } = $;
|
|
340
|
+
C === "boundary" && T && M === "type" && (D === "rect" || D === "package") ? T.type = D : C === "edge" && L && M === "animate" && typeof D == "boolean" ? L.animate = D : C === "edge" && L && M === "animation" && (D === "fast" || D === "slow") ? (L.animation = D, L.animate = true) : B(t2, C, $);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
for (let t2 of a.relationships) t2.animation && (t2.animate = true);
|
|
344
|
+
for (let t2 of p.values()) t2.kind === "actor" ? (t2.icon && t2.actorType && t2.actorType !== "normal" && w(`Actor '${t2.id}' cannot combine icon with type '${t2.actorType}'`, t2.span), t2.business && (t2.icon || t2.actorType === "awesome") && w(`Business actor '${t2.id}' must use normal or hollow geometry`, t2.span)) : t2.shape === "rect" && t2.business && w(`Rectangular use case '${t2.id}' cannot be a business use case`, t2.span), ue(t2);
|
|
345
|
+
for (let t2 of [...n.elements].sort((c2, f) => c2.span[0] - f.span[0])) {
|
|
346
|
+
if (!t2.parent?.id) continue;
|
|
347
|
+
let c2 = O.get(t2.parent.id).members;
|
|
348
|
+
c2.includes(t2.id) || c2.push(t2.id);
|
|
349
|
+
}
|
|
350
|
+
for (let t2 of O.values()) {
|
|
351
|
+
let c2 = h.get(t2.id);
|
|
352
|
+
c2.type = t2.type ?? "rect", c2.members = t2.members, c2.classes = [...t2.classes];
|
|
353
|
+
}
|
|
354
|
+
let S = 0;
|
|
355
|
+
for (let t2 of n.notes) {
|
|
356
|
+
let c2 = u2.get(t2.target);
|
|
357
|
+
if (!c2) return w(`Note target '${t2.target}' is unresolved`, t2.span);
|
|
358
|
+
c2.kind !== "actor" && c2.kind !== "usecase" && I(`Note target '${t2.target}' must be an actor or use case, not ${c2.kind}`, t2.span, c2.span);
|
|
359
|
+
let f = `note-${S++}`;
|
|
360
|
+
a.notes.set(f, { id: f, target: t2.target, label: t2.label.text, labelType: t2.label.type });
|
|
361
|
+
}
|
|
362
|
+
for (let t2 of n.classDefs) for (let c2 of t2.ids) a.classDefs.set(c2, { id: c2, styles: [...t2.styles] });
|
|
363
|
+
for (let t2 of n.classes) for (let c2 of t2.targets) st(fe(c2.id, c2.span).classes, t2.classes);
|
|
364
|
+
for (let t2 of n.styles) fe(t2.target, t2.span).styles.push(...t2.styles);
|
|
365
|
+
return a.direction = n.direction ?? a.direction, a.title = o, a.accTitle = n.accTitle, a.accDescription = n.accDescription, a.accDescr = n.accDescription.replace(/\n\s+/g, `
|
|
366
|
+
`), a.source = e, a.headerSpan = s, a.statements = r2, a;
|
|
367
|
+
}
|
|
368
|
+
var K = class extends Error {
|
|
369
|
+
constructor(s) {
|
|
370
|
+
super("Invalid JSON token");
|
|
371
|
+
this.offset = s;
|
|
372
|
+
}
|
|
373
|
+
offset;
|
|
374
|
+
};
|
|
375
|
+
function zt(e) {
|
|
376
|
+
let n = /* @__PURE__ */ new Map(), s = [], r2 = [], o = e.length, a = 0, d = "", E = 0, h = () => {
|
|
377
|
+
for (; a < o; ) {
|
|
378
|
+
let i = e.charCodeAt(a);
|
|
379
|
+
if (i !== 32 && i !== 9 && i !== 10 && i !== 13) return;
|
|
380
|
+
a++;
|
|
381
|
+
}
|
|
382
|
+
}, u2 = (i) => {
|
|
383
|
+
a++;
|
|
384
|
+
let A = "";
|
|
385
|
+
for (; a < o; ) {
|
|
386
|
+
let _2 = a, N = e[a++];
|
|
387
|
+
if (N === '"') return A;
|
|
388
|
+
if (N.charCodeAt(0) < 32) throw new K(_2);
|
|
389
|
+
if (N !== "\\") {
|
|
390
|
+
i && (A += N);
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
let w = a, I = e[a++], B;
|
|
394
|
+
if (I === '"' || I === "\\" || I === "/") B = I;
|
|
395
|
+
else if (I === "b") B = "\b";
|
|
396
|
+
else if (I === "f") B = "\f";
|
|
397
|
+
else if (I === "n") B = `
|
|
398
|
+
`;
|
|
399
|
+
else if (I === "r") B = "\r";
|
|
400
|
+
else if (I === "t") B = " ";
|
|
401
|
+
else if (I === "u") {
|
|
402
|
+
let H2 = e.slice(a, a + 4);
|
|
403
|
+
if (!/^[\dA-Fa-f]{4}$/.test(H2)) throw new K(a);
|
|
404
|
+
B = String.fromCharCode(parseInt(H2, 16)), a += 4;
|
|
405
|
+
} else throw new K(w);
|
|
406
|
+
i && (A += B);
|
|
407
|
+
}
|
|
408
|
+
throw new K(a);
|
|
409
|
+
}, p = (i) => {
|
|
410
|
+
for (let A = 0; A < i.length; A++) if (e[a + A] !== i[A]) throw new K(a + A);
|
|
411
|
+
a += i.length;
|
|
412
|
+
}, O = () => {
|
|
413
|
+
if (e.charCodeAt(a) === 45 && a++, e.charCodeAt(a) === 48) a++;
|
|
414
|
+
else if (t(e.charCodeAt(a))) for (; t(e.charCodeAt(a)); ) a++;
|
|
415
|
+
else throw new K(a);
|
|
416
|
+
if (e.charCodeAt(a) === 46) {
|
|
417
|
+
if (a++, !t(e.charCodeAt(a))) throw new K(a);
|
|
418
|
+
for (; t(e.charCodeAt(a)); ) a++;
|
|
419
|
+
}
|
|
420
|
+
if ((e.charCodeAt(a) | 32) === 101) {
|
|
421
|
+
if (a++, (e.charCodeAt(a) === 43 || e.charCodeAt(a) === 45) && a++, !t(e.charCodeAt(a))) throw new K(a);
|
|
422
|
+
for (; t(e.charCodeAt(a)); ) a++;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
for (h(); ; ) if (E === 0) {
|
|
426
|
+
h();
|
|
427
|
+
let i = e.charCodeAt(a);
|
|
428
|
+
if (E = 2, i === 123) {
|
|
429
|
+
a++;
|
|
430
|
+
let A = [];
|
|
431
|
+
n.set(d, A), s.push(d), h(), e.charCodeAt(a) === 125 ? a++ : (r2.push({ object: true, pointer: d, keys: A, ranges: /* @__PURE__ */ new Map(), key: "", from: 0, index: 0 }), E = 1);
|
|
432
|
+
} else if (i === 91) a++, h(), e.charCodeAt(a) === 93 ? a++ : (r2.push({ object: false, pointer: d, keys: [], ranges: /* @__PURE__ */ new Map(), key: "", from: 0, index: 0 }), d += "/0", E = 0);
|
|
433
|
+
else if (i === 34) u2(false);
|
|
434
|
+
else if (i === 116) p("true");
|
|
435
|
+
else if (i === 102) p("false");
|
|
436
|
+
else if (i === 110) p("null");
|
|
437
|
+
else if (i === 45 || t(i)) O();
|
|
438
|
+
else throw new K(a);
|
|
439
|
+
} else if (E === 1) {
|
|
440
|
+
let i = r2[r2.length - 1];
|
|
441
|
+
if (e.charCodeAt(a) !== 34) throw new K(a);
|
|
442
|
+
let A = u2(true), _2 = i.ranges.get(A);
|
|
443
|
+
if (_2 === void 0) i.keys.push(A);
|
|
444
|
+
else for (let N = _2[0]; N < _2[1]; N++) n.delete(s[N]);
|
|
445
|
+
if (i.key = A, i.from = s.length, h(), e.charCodeAt(a) !== 58) throw new K(a);
|
|
446
|
+
a++, d = `${i.pointer}/${A.replaceAll("~", "~0").replaceAll("/", "~1")}`, E = 0;
|
|
447
|
+
} else {
|
|
448
|
+
let i = r2[r2.length - 1];
|
|
449
|
+
if (i === void 0) break;
|
|
450
|
+
i.object ? i.ranges.set(i.key, [i.from, s.length]) : i.index++, h();
|
|
451
|
+
let A = e.charCodeAt(a);
|
|
452
|
+
if (A === (i.object ? 125 : 93)) a++, r2.pop();
|
|
453
|
+
else {
|
|
454
|
+
if (A !== 44) throw new K(a);
|
|
455
|
+
a++, h(), d = `${i.pointer}/${i.index}`, E = i.object ? 1 : 0;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
if (h(), a !== o) throw new K(a);
|
|
459
|
+
return n;
|
|
460
|
+
}
|
|
461
|
+
function at(e, n, s, r2) {
|
|
462
|
+
let o = Math.min(Math.max(n, 0), e.length);
|
|
463
|
+
for (let a = 0; a < o; a++) {
|
|
464
|
+
let d = e.charCodeAt(a);
|
|
465
|
+
d === 13 ? (s++, r2 = 1) : d === 10 ? (a === 0 || e.charCodeAt(a - 1) !== 13) && (s++, r2 = 1) : r2++;
|
|
466
|
+
}
|
|
467
|
+
return [s, r2];
|
|
468
|
+
}
|
|
469
|
+
function Kn(e, n, s, r2) {
|
|
470
|
+
let o = /\bposition (\d+)\b/.exec(e);
|
|
471
|
+
if (o) return at(n, parseInt(o[1], 10), s, r2);
|
|
472
|
+
let a = /\bline (\d+) column (\d+)\b/.exec(e);
|
|
473
|
+
if (a) {
|
|
474
|
+
let d = parseInt(a[1], 10), E = parseInt(a[2], 10);
|
|
475
|
+
return [s + d - 1, d === 1 ? r2 + E - 1 : E];
|
|
476
|
+
}
|
|
477
|
+
if (/unexpected end|end of json input/i.test(e)) return at(n, n.length, s, r2);
|
|
478
|
+
}
|
|
479
|
+
function qt(e, n, s) {
|
|
480
|
+
return new x$3(`${e} (line ${n}, column ${s})`, "syntax", { type: "usecase", line: n, column: s });
|
|
481
|
+
}
|
|
482
|
+
function Zt(e, n) {
|
|
483
|
+
let s;
|
|
484
|
+
try {
|
|
485
|
+
s = JSON.parse(e);
|
|
486
|
+
} catch (r2) {
|
|
487
|
+
let o = r2 instanceof Error ? r2.message : String(r2), [a, d] = n(), E = Kn(o, e, a, d);
|
|
488
|
+
if (!E) {
|
|
489
|
+
let h = 0;
|
|
490
|
+
try {
|
|
491
|
+
zt(e);
|
|
492
|
+
} catch (u2) {
|
|
493
|
+
u2 instanceof K && (h = u2.offset);
|
|
494
|
+
}
|
|
495
|
+
E = at(e, h, a, d);
|
|
496
|
+
}
|
|
497
|
+
throw qt(`Invalid JSON: ${o}`, E[0], E[1]);
|
|
498
|
+
}
|
|
499
|
+
if (typeof s != "object" || s === null || Array.isArray(s)) {
|
|
500
|
+
let [r2, o] = n();
|
|
501
|
+
throw qt("JSON value must have an object root", r2, o);
|
|
502
|
+
}
|
|
503
|
+
return { value: s, propertyOrder: zt(e) };
|
|
504
|
+
}
|
|
505
|
+
var rn = 1, ct = 2, it = 4, ln = 8, cn = 16, pn = 32, dn = 64, Ke = "DEPENDENCY_ARROW|GENERALIZATION|FORWARD_SOLID|BACKWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|BACKWARD_CIRCLE|FORWARD_CROSS|BACKWARD_CROSS", Ge = "IDENTIFIER|PLAIN_STRING|MARKDOWN_STRING", Gn = "PLAIN_STRING|MARKDOWN_STRING|LABEL_TEXT", un = "ACC_TITLE_LINE|ACC_DESCR_LINE|ACC_DESCR_BLOCK|DIRECTION|ACTOR|SYSTEM_BOUNDARY|NOTE|JSON_DECLARATION_START|CLASS_DEF|CLASS|STYLE", fn = "WORD|PLAIN_STRING|NUMBER|HASH_COLOR|CSS_IDENTIFIER|CSS_ESCAPED_COMMA|DASH|DOT|PERCENT|CSS_PUNCTUATION|COLON|LPAREN|RPAREN|LBRACKET|RBRACKET|LBRACE|RBRACE|AT|MARKERLESS_SOLID", ee = new Uint8Array(67);
|
|
506
|
+
function pe(e, n) {
|
|
507
|
+
for (let s of e.split("|")) if (s === "WORD") for (let r2 = 1; r2 <= 21; r2++) ee[r2] |= n;
|
|
508
|
+
else ee[tt.indexOf(s)] |= n;
|
|
509
|
+
}
|
|
510
|
+
pe(`NEWLINE|COMMENT|${un}|${Ge}`, rn);
|
|
511
|
+
pe(`IDENTIFIER|${Ke}`, ct);
|
|
512
|
+
pe(fn, it);
|
|
513
|
+
pe(`STEREOTYPE_START|CLASS_SEPARATOR|IDENTIFIER|${Ke}|NEWLINE|EOF`, ln);
|
|
514
|
+
pe(`NEWLINE|COMMENT|ACTOR|${Ge}`, cn);
|
|
515
|
+
pe("FORWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|FORWARD_CROSS", pn);
|
|
516
|
+
pe("NEWLINE|IDENTIFIER|PLAIN_STRING|RBRACE", dn);
|
|
517
|
+
var jn = /* @__PURE__ */ new Set(["allowmixing", "newpage", "package", "rectangle", "skinparam"]), J = "", R = [], F = [], Y = [], l = 0, hn = 0, P, Pe, ve = [], En = 0, yn = 0;
|
|
518
|
+
function U(e) {
|
|
519
|
+
return J.slice(F[e], Y[e]);
|
|
520
|
+
}
|
|
521
|
+
function z(e) {
|
|
522
|
+
return [F[e], Y[e]];
|
|
523
|
+
}
|
|
524
|
+
function je(e) {
|
|
525
|
+
let [n, s] = ie(J, F[l]);
|
|
526
|
+
throw new x$3(`Error parsing usecase diagram: ${e} at line ${n}, column ${s} [${F[l]},${Y[l]})`, "syntax", { type: "usecase", line: n, column: s });
|
|
527
|
+
}
|
|
528
|
+
function Sn(e) {
|
|
529
|
+
je(`Expecting token of type --> ${e} <-- but found --> '${U(l)}' <--`);
|
|
530
|
+
}
|
|
531
|
+
function v(e) {
|
|
532
|
+
return R[l] !== e && Sn(tt[e]), l++;
|
|
533
|
+
}
|
|
534
|
+
function Z(e) {
|
|
535
|
+
let n = e.split("|").map((s, r2) => ` ${r2 + 1}. [${s}]`);
|
|
536
|
+
je(`Expecting: one of these possible Token sequences:
|
|
537
|
+
${n.join(`
|
|
538
|
+
`)}
|
|
539
|
+
but found: '${U(l)}'`);
|
|
540
|
+
}
|
|
541
|
+
function Qt() {
|
|
542
|
+
let e = Ge.split("|"), n = e.flatMap((o) => ["NEWLINE", "IDENTIFIER", "PLAIN_STRING", "RBRACE"].map((a) => `${o}, METADATA_START, ${a}`)), s = `STEREOTYPE_START|CLASS_SEPARATOR|IDENTIFIER|${Ke}|NEWLINE|EOF`.split("|"), r2 = e.flatMap((o, a) => (a === 0 ? ["LPAREN", "LBRACKET", ...s] : s).map((d) => `${o}, ${d}`));
|
|
543
|
+
return [un, ...n, ...r2, ...n].join("|");
|
|
544
|
+
}
|
|
545
|
+
function en(e) {
|
|
546
|
+
return e >= 1 && e <= 21;
|
|
547
|
+
}
|
|
548
|
+
function tn(e) {
|
|
549
|
+
return e >= 1 && e <= 34;
|
|
550
|
+
}
|
|
551
|
+
function ce() {
|
|
552
|
+
hn = Y[l - 1], R[l] === 39 ? l++ : R[l] !== 0 && Z("NEWLINE|EOF");
|
|
553
|
+
}
|
|
554
|
+
function Oe(e) {
|
|
555
|
+
let n = R[e] === 36 ? 2 : R[e] === 35 ? 1 : 0;
|
|
556
|
+
return [F[e] + n, Y[e] - n];
|
|
557
|
+
}
|
|
558
|
+
function lt(e) {
|
|
559
|
+
let n = Oe(e);
|
|
560
|
+
return { text: J.slice(n[0], n[1]), type: R[e] === 36 ? "markdown" : "text", span: n };
|
|
561
|
+
}
|
|
562
|
+
function gn(e) {
|
|
563
|
+
return e.replace(/\W/g, "_");
|
|
564
|
+
}
|
|
565
|
+
function Ce() {
|
|
566
|
+
let e = R[l];
|
|
567
|
+
if (e === 35 || e === 36) return lt(l++);
|
|
568
|
+
tn(e) || Z(Gn);
|
|
569
|
+
let n = l;
|
|
570
|
+
for (; tn(R[l]); ) l++;
|
|
571
|
+
let s = [F[n], Y[l - 1]];
|
|
572
|
+
return { text: J.slice(s[0], s[1]), type: "text", span: s };
|
|
573
|
+
}
|
|
574
|
+
function le(e) {
|
|
575
|
+
return e === 21 || e === 35;
|
|
576
|
+
}
|
|
577
|
+
function nn() {
|
|
578
|
+
let e = l;
|
|
579
|
+
le(R[l]) || Z("IDENTIFIER|PLAIN_STRING"), l++, v(25);
|
|
580
|
+
let n = l, s = R[l];
|
|
581
|
+
!le(s) && s !== 19 && s !== 20 && Z("IDENTIFIER|PLAIN_STRING|TRUE|FALSE"), l++;
|
|
582
|
+
let r2 = Oe(e), o = Oe(n);
|
|
583
|
+
return { key: J.slice(r2[0], r2[1]), value: s === 19 ? true : s === 20 ? false : J.slice(o[0], o[1]), span: [F[e], Y[n]], keySpan: r2, valueSpan: o };
|
|
584
|
+
}
|
|
585
|
+
function Yn() {
|
|
586
|
+
let e = R[l], n = R[l + 1], s = R[l + 2];
|
|
587
|
+
return e === 24 ? le(n) || n === 39 && (s === 39 || le(s)) : e !== 39 ? false : n === 24 || le(n) || n === 39 && (s === 39 || s === 24 || le(s));
|
|
588
|
+
}
|
|
589
|
+
function pt() {
|
|
590
|
+
v(60);
|
|
591
|
+
let e = [];
|
|
592
|
+
for (; R[l] === 39; ) l++;
|
|
593
|
+
if (le(R[l])) {
|
|
594
|
+
for (e.push(nn()); Yn(); ) {
|
|
595
|
+
if (R[l] === 24) l++;
|
|
596
|
+
else {
|
|
597
|
+
for (; R[l] === 39; ) l++;
|
|
598
|
+
R[l] === 24 && l++;
|
|
599
|
+
}
|
|
600
|
+
for (; R[l] === 39; ) l++;
|
|
601
|
+
e.push(nn());
|
|
602
|
+
}
|
|
603
|
+
for (R[l] === 24 && l++; R[l] === 39; ) l++;
|
|
604
|
+
}
|
|
605
|
+
return v(62), e;
|
|
606
|
+
}
|
|
607
|
+
function dt(e) {
|
|
608
|
+
return e.map(({ key: n, span: s, keySpan: r2, valueSpan: o }) => ({ key: n, span: s, keySpan: r2, valueSpan: o }));
|
|
609
|
+
}
|
|
610
|
+
function ut(e, n) {
|
|
611
|
+
do {
|
|
612
|
+
l++;
|
|
613
|
+
let s = v(21);
|
|
614
|
+
e.push(U(s)), n.push(z(s));
|
|
615
|
+
} while (R[l] === 24);
|
|
616
|
+
}
|
|
617
|
+
function An(e) {
|
|
618
|
+
let n = l, s = R[l], r2 = { id: "", label: void 0, span: Oe(n), generated: s !== 21, classes: [], classSpans: [], explicit: false, nodeSpan: [0, 0] };
|
|
619
|
+
if (s === 21) {
|
|
620
|
+
l++, r2.id = U(n);
|
|
621
|
+
let o = R[l];
|
|
622
|
+
o === 65 || e && o === 63 ? (l++, r2.label = Ce(), v(o === 65 ? 66 : 64), r2.shape = o === 65 ? "ellipse" : "rect") : r2.label = lt(n);
|
|
623
|
+
} else s === 35 || s === 36 ? (l++, r2.label = lt(n), r2.id = gn(r2.label.text)) : Z(Ge);
|
|
624
|
+
return r2;
|
|
625
|
+
}
|
|
626
|
+
function Fe(e) {
|
|
627
|
+
let n = l, s = An(!e);
|
|
628
|
+
if (e && (s.shape = void 0), R[l] === 60 && (s.metadata = pt()), R[l] === 48) {
|
|
629
|
+
l++;
|
|
630
|
+
let r2 = v(50);
|
|
631
|
+
v(49), s.stereotype = U(r2).trim(), s.stereotypeSpan = z(r2);
|
|
632
|
+
}
|
|
633
|
+
return R[l] === 52 && ut(s.classes, s.classSpans), s.explicit = !!(s.shape || s.metadata || s.stereotype), s.nodeSpan = [F[n], Y[l - 1]], s;
|
|
634
|
+
}
|
|
635
|
+
function ft(e, n) {
|
|
636
|
+
return { id: e.id, kind: n, label: e.label, span: e.span, generated: e.generated, parent: Pe, shape: e.shape, metadata: e.metadata, stereotype: e.stereotype, classes: e.classes };
|
|
637
|
+
}
|
|
638
|
+
function sn(e, n) {
|
|
639
|
+
return { id: e.id, label: e.label, span: e.span, generated: e.generated, declares: n, classed: e.classes.length > 0 };
|
|
640
|
+
}
|
|
641
|
+
function ht(e, n) {
|
|
642
|
+
let s = { id: e.id, span: e.nodeSpan, idSpan: e.span, labelSpan: e.label.span };
|
|
643
|
+
return n && (s.defines = true), e.stereotypeSpan && (s.stereotypeSpan = e.stereotypeSpan), e.metadata && (s.metadata = dt(e.metadata)), e.classSpans.length > 0 && (s.classSpans = e.classSpans), s;
|
|
644
|
+
}
|
|
645
|
+
function ot(e) {
|
|
646
|
+
if (R[l] < 1 || R[l] > 36) return false;
|
|
647
|
+
for (let n = l + 1; ; n++) {
|
|
648
|
+
let s = R[n];
|
|
649
|
+
if (s === 59 || (ee[s] & e) !== 0) return true;
|
|
650
|
+
if (s < 1 || s > 36) return false;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
function me(e) {
|
|
654
|
+
let n = Y[e] - F[e] - (R[e] === 59 ? 0 : 1);
|
|
655
|
+
return Math.max(1, n - 1);
|
|
656
|
+
}
|
|
657
|
+
function Rn() {
|
|
658
|
+
let e = l, n = { type: "association", arrowType: 0, minlen: 1, target: void 0, span: [0, 0] };
|
|
659
|
+
R[l] === 21 && R[l + 1] === 23 && (n.explicitId = U(l), n.explicitIdSpan = z(l), l += 2);
|
|
660
|
+
let s = l, r2 = R[l++];
|
|
661
|
+
if (r2 === 47) v(25), R[l] !== 17 && R[l] !== 18 && Z("INCLUDE|EXTEND"), n.type = R[l] === 17 ? "include" : "extend", n.label = { text: n.type, type: "text", span: z(l) }, l++;
|
|
662
|
+
else if (r2 === 46) n.type = "generalization";
|
|
663
|
+
else if (r2 === 53) n.minlen = me(s);
|
|
664
|
+
else if (r2 === 54) n.arrowType = 1, Y[s] - F[s] === 3 && ot(0) ? (n.label = Ce(), n.minlen = me(v(59))) : n.minlen = me(s);
|
|
665
|
+
else if (r2 === 59) if (n.arrowType = 2, Y[s] - F[s] === 2 && ot(pn)) {
|
|
666
|
+
n.label = Ce();
|
|
667
|
+
let o = R[l];
|
|
668
|
+
o === 53 ? n.arrowType = 0 : o === 55 ? n.arrowType = 3 : o === 57 ? n.arrowType = 4 : o !== 59 && Z("FORWARD_SOLID|MARKERLESS_SOLID|FORWARD_CIRCLE|FORWARD_CROSS"), (n.arrowType === 0 || n.arrowType === 2) && (n.minlen = me(l)), l++;
|
|
669
|
+
} else n.minlen = me(s);
|
|
670
|
+
else r2 === 55 ? n.arrowType = 3 : r2 === 57 ? n.arrowType = 4 : r2 === 56 || r2 === 58 ? (n.arrowType = r2 === 56 ? 5 : 6, ot(0) && (n.label = Ce(), v(59))) : (l--, Z(Ke));
|
|
671
|
+
return n.target = Fe(false), n.span = [F[e], Y[l - 1]], n;
|
|
672
|
+
}
|
|
673
|
+
function Q(e) {
|
|
674
|
+
return { kind: e, span: [0, 0] };
|
|
675
|
+
}
|
|
676
|
+
function bn(e, n, s, r2) {
|
|
677
|
+
let o = s.target;
|
|
678
|
+
o.explicit && P.elements.push(ft(o, "usecase")), P.relationships.push({ source: sn(e, n), target: sn(o, o.explicit), span: s.span, id: s.explicitId, idSpan: s.explicitIdSpan, type: s.type, arrowType: s.arrowType, label: s.label, minlen: s.minlen }), r2.push(ht(o, o.explicit));
|
|
679
|
+
let a = Q("edge");
|
|
680
|
+
return a.nodes = r2, a.edges = [{ id: s.explicitId ?? `edge-${En++}`, span: a.span }], s.explicitIdSpan && (a.edges[0].idSpan = s.explicitIdSpan), s.label && (a.edges[0].labelSpan = s.label.span), a;
|
|
681
|
+
}
|
|
682
|
+
function mn(e) {
|
|
683
|
+
let n = Q("node");
|
|
684
|
+
return n.nodes = e, n;
|
|
685
|
+
}
|
|
686
|
+
function Cn(e) {
|
|
687
|
+
l++;
|
|
688
|
+
let n = [Fe(true)], s;
|
|
689
|
+
if (R[l] === 24) do
|
|
690
|
+
l++, n.push(Fe(true));
|
|
691
|
+
while (R[l] === 24);
|
|
692
|
+
else e && (ee[R[l]] & ct) !== 0 && (s = Rn());
|
|
693
|
+
ce();
|
|
694
|
+
for (let o of n) P.elements.push(ft(o, "actor"));
|
|
695
|
+
let r2 = n.map((o) => ht(o, true));
|
|
696
|
+
return s ? bn(n[0], true, s, r2) : mn(r2);
|
|
697
|
+
}
|
|
698
|
+
function On(e) {
|
|
699
|
+
let n = Fe(false), s = e && (ee[R[l]] & ct) !== 0 ? Rn() : void 0;
|
|
700
|
+
ce(), s || (n.explicit = true, n.shape ??= "ellipse"), n.explicit && P.elements.push(ft(n, "usecase"));
|
|
701
|
+
let r2 = [ht(n, n.explicit)];
|
|
702
|
+
return s ? bn(n, n.explicit, s, r2) : mn(r2);
|
|
703
|
+
}
|
|
704
|
+
function Jn() {
|
|
705
|
+
l++;
|
|
706
|
+
let e = An(true), n = { id: e.id, label: e.label, span: e.span, generated: e.generated, classes: e.classes }, s = R[l] === 60 ? pt() : void 0;
|
|
707
|
+
R[l] === 52 && ut(e.classes, e.classSpans), ce(), P.boundaries.push(n), Pe = n;
|
|
708
|
+
let r2 = [];
|
|
709
|
+
for (; (ee[R[l]] & cn) !== 0; ) r2.push(Tn(false));
|
|
710
|
+
Pe = void 0;
|
|
711
|
+
let o = v(4);
|
|
712
|
+
ce();
|
|
713
|
+
let a = Q("group");
|
|
714
|
+
return a.group = n.id, a.idSpan = n.span, a.titleSpan = n.label.span, a.endSpan = z(o), a.classSpans = e.classSpans, r2.length > 0 && (a.children = r2), s && (a.metadata = dt(s), P.metadata.push({ target: n.id, span: n.span, properties: s, statement: a })), a;
|
|
715
|
+
}
|
|
716
|
+
function an() {
|
|
717
|
+
let e = l, n = R[l];
|
|
718
|
+
for (en(n) || n === 27 ? l++ : n === 59 ? (l++, en(R[l]) || Sn("WORD"), l++) : Z("WORD|CSS_IDENTIFIER|MARKERLESS_SOLID"), v(25), (ee[R[l]] & it) === 0 && je(`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::
|
|
719
|
+
<[${fn.replaceAll("|", "] ,[")}]>
|
|
720
|
+
but found: '${U(l)}'`); (ee[R[l]] & it) !== 0; ) l++;
|
|
721
|
+
return J.slice(F[e], Y[l - 1]).replaceAll("\\,", ",");
|
|
722
|
+
}
|
|
723
|
+
function on() {
|
|
724
|
+
let e = [an()];
|
|
725
|
+
for (; R[l] === 24; ) l++, e.push(an());
|
|
726
|
+
return e;
|
|
727
|
+
}
|
|
728
|
+
function rt() {
|
|
729
|
+
let e = [v(21)];
|
|
730
|
+
for (; R[l] === 24; ) l++, e.push(v(21));
|
|
731
|
+
return e;
|
|
732
|
+
}
|
|
733
|
+
function Ue(e) {
|
|
734
|
+
let n = Oe(e);
|
|
735
|
+
return { id: U(e), span: n, idSpan: n };
|
|
736
|
+
}
|
|
737
|
+
function Hn() {
|
|
738
|
+
let e = l, n = R[l], s;
|
|
739
|
+
if (n === 41 || n === 42 || n === 40) {
|
|
740
|
+
l++;
|
|
741
|
+
let r2 = U(e);
|
|
742
|
+
n === 40 ? P.accDescription = r2.slice(r2.indexOf("{") + 1, r2.lastIndexOf("}")).trim() : n === 42 ? P.accDescription = r2.slice(r2.indexOf(":") + 1).trim() : P.accTitle = r2.slice(r2.indexOf(":") + 1).trim(), s = Q(n === 41 ? "accTitle" : "accDescr");
|
|
743
|
+
} else if (n === 5) {
|
|
744
|
+
l++;
|
|
745
|
+
let r2 = R[l];
|
|
746
|
+
(r2 < 6 || r2 > 10) && Z("TD|TB|BT|LR|RL"), P.direction = r2 === 6 ? "TB" : U(l), l++, s = Q("direction");
|
|
747
|
+
} else {
|
|
748
|
+
if (n === 2) return Cn(true);
|
|
749
|
+
if (n === 3) return Jn();
|
|
750
|
+
if (n === 11) {
|
|
751
|
+
l++, v(12);
|
|
752
|
+
let r2 = v(21), o = Ce();
|
|
753
|
+
P.notes.push({ target: U(r2), span: z(r2), label: o }), s = Q("note"), s.ref = `note-${yn++}`, s.refSpan = o.span, s.nodes = [Ue(r2)];
|
|
754
|
+
} else if (n === 43) {
|
|
755
|
+
l++;
|
|
756
|
+
let r2 = v(44), o = [], a = [];
|
|
757
|
+
R[l] === 52 && ut(o, a);
|
|
758
|
+
let d = F[e] + 4;
|
|
759
|
+
for (; J.charCodeAt(d) === 32 || J.charCodeAt(d) === 9; ) d++;
|
|
760
|
+
let E = d;
|
|
761
|
+
for (; /\w/.test(J.charAt(E)); ) E++;
|
|
762
|
+
let h = { id: J.slice(d, E), value: {}, propertyOrder: /* @__PURE__ */ new Map(), span: [d, E], classes: o };
|
|
763
|
+
P.jsons.push(h), ve.push([h, r2]), s = Q("json"), s.nodes = [{ id: h.id, span: h.span, idSpan: h.span, defines: true, classSpans: a }], s.classSpans = a;
|
|
764
|
+
} else if (n === 14) {
|
|
765
|
+
l++;
|
|
766
|
+
let r2 = rt();
|
|
767
|
+
P.classDefs.push({ ids: r2.map(U), styles: on() }), s = Q("classDef"), s.ref = U(r2[0]), s.refSpan = z(r2[0]);
|
|
768
|
+
} else if (n === 15) {
|
|
769
|
+
l++;
|
|
770
|
+
let r2 = rt(), o = rt();
|
|
771
|
+
P.classes.push({ targets: r2.map((a) => ({ id: U(a), span: z(a) })), classes: o.map(U) }), s = Q("classAssign"), s.ref = U(o[0]), s.refSpan = z(o[0]), s.nodes = r2.map(Ue);
|
|
772
|
+
} else if (n === 16) {
|
|
773
|
+
l++;
|
|
774
|
+
let r2 = v(21);
|
|
775
|
+
P.styles.push({ target: U(r2), span: z(r2), styles: on() }), s = Q("style"), s.nodes = [Ue(r2)];
|
|
776
|
+
} else {
|
|
777
|
+
let r2 = R[l + 1];
|
|
778
|
+
if (r2 === 60) {
|
|
779
|
+
(ee[R[l + 2]] & dn) === 0 && Z(Qt()), l++;
|
|
780
|
+
let o = Ue(e);
|
|
781
|
+
n !== 21 && (o.id = gn(J.slice(o.span[0], o.span[1])));
|
|
782
|
+
let a = pt();
|
|
783
|
+
s = Q("metadata"), s.nodes = [o], s.metadata = dt(a), P.metadata.push({ target: o.id, span: o.span, properties: a, statement: s });
|
|
784
|
+
} else return (!((ee[r2] & ln) !== 0 || n === 21 && (r2 === 65 || r2 === 63)) || n === 21 && jn.has(U(e).toLowerCase())) && Z(Qt()), On(true);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return ce(), s;
|
|
788
|
+
}
|
|
789
|
+
function Tn(e) {
|
|
790
|
+
let n = l, s = R[l];
|
|
791
|
+
if (s === 39) return l++, { kind: "blank", span: z(n) };
|
|
792
|
+
if (s === 38) return l++, ce(), { kind: "comment", span: z(n) };
|
|
793
|
+
let r2 = e ? Hn() : s === 2 ? Cn(false) : On(false);
|
|
794
|
+
if (r2.span = [F[n], hn], r2.edges) for (let o of r2.edges) o.span = r2.span;
|
|
795
|
+
return r2;
|
|
796
|
+
}
|
|
797
|
+
function In(e, n) {
|
|
798
|
+
J = e, { types: R, starts: F, ends: Y } = Jt(e), l = 0, P = Vt(), Pe = void 0, ve = [], En = 0, yn = 0;
|
|
799
|
+
try {
|
|
800
|
+
let s = v(1);
|
|
801
|
+
ce();
|
|
802
|
+
let r2 = [];
|
|
803
|
+
for (; (ee[R[l]] & rn) !== 0; ) r2.push(Tn(true));
|
|
804
|
+
R[l] !== 0 && je(`Redundant input, expecting EOF but found: ${U(l)}`);
|
|
805
|
+
for (let [o, a] of ve) {
|
|
806
|
+
let d = Zt(U(a), () => ie(e, F[a]));
|
|
807
|
+
o.value = d.value, o.propertyOrder = d.propertyOrder;
|
|
808
|
+
}
|
|
809
|
+
return Xt(e, P, z(s), r2, n);
|
|
810
|
+
} finally {
|
|
811
|
+
J = "", R = F = Y = ve = [];
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
var Vn = { normal: "usecaseActor", hollow: "usecaseActorHollow", awesome: "usecaseActorAwesome", icon: "usecaseActorIcon" }, Et = [["none", "arrow_point"], ["arrow_point", "none"], ["none", "none"], ["none", "arrow_circle"], ["none", "arrow_cross"], ["arrow_circle", "none"], ["arrow_cross", "none"]];
|
|
815
|
+
function Nn(e) {
|
|
816
|
+
return typeof e == "string" ? e : e === null ? "null" : String(e);
|
|
817
|
+
}
|
|
818
|
+
function Xn(e) {
|
|
819
|
+
let n = [], s = [[e.value, "", ""]], r2 = [];
|
|
820
|
+
for (; s.length > 0; ) {
|
|
821
|
+
let [o, a, d] = s.pop();
|
|
822
|
+
if (r2.length = 0, Array.isArray(o)) o.length === 0 ? n.push({ key: a, accessibleKey: a, value: "[]" }) : o.every((E) => E === null || typeof E != "object") ? o.forEach((E, h) => n.push({ key: h === 0 ? a : "", accessibleKey: a, value: Nn(E) })) : o.forEach((E, h) => r2.push([E, `${a}[${h}]`, `${d}/${h}`]));
|
|
823
|
+
else if (o !== null && typeof o == "object") {
|
|
824
|
+
let E = o, h = e.propertyOrder.get(d) ?? Object.keys(E);
|
|
825
|
+
h.length === 0 && n.push({ key: a, accessibleKey: a, value: "{}" });
|
|
826
|
+
for (let u2 of h) r2.push([Object.prototype.hasOwnProperty.call(E, u2) ? E[u2] : void 0, a ? `${a}.${u2}` : u2, `${d}/${u2.replaceAll("~", "~0").replaceAll("/", "~1")}`]);
|
|
827
|
+
} else n.push({ key: a, accessibleKey: a, value: Nn(o) });
|
|
828
|
+
for (let E = r2.length - 1; E >= 0; E--) s.push(r2[E]);
|
|
829
|
+
}
|
|
830
|
+
return n;
|
|
831
|
+
}
|
|
832
|
+
function Te(...e) {
|
|
833
|
+
return e.filter(Boolean).join(" ");
|
|
834
|
+
}
|
|
835
|
+
function zn(e) {
|
|
836
|
+
return e.type === "generalization" ? ["none", "extension"] : e.type !== "association" ? Et[0] : Et[e.arrowType] ?? Et[2];
|
|
837
|
+
}
|
|
838
|
+
function Ln(e) {
|
|
839
|
+
let n = [], s = [], r2 = (o) => {
|
|
840
|
+
let a = /* @__PURE__ */ new Map();
|
|
841
|
+
for (let d of ["default", ...o]) {
|
|
842
|
+
let E = e.classDefs.get(d);
|
|
843
|
+
if (E) for (let h of E.styles) {
|
|
844
|
+
let u2 = h.trim(), p = u2.indexOf(":"), O = (p === -1 ? u2 : u2.slice(0, p)).trim();
|
|
845
|
+
O && a.set(O, u2);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
return [...a.values()];
|
|
849
|
+
};
|
|
850
|
+
for (let o of e.actors.values()) n.push({ id: o.id, label: o.label, labelType: o.labelType, shape: Vn[o.type], isGroup: false, padding: 10, cssClasses: Te("default", "usecase-actor", `usecase-actor-${o.type}`, o.business && "usecase-business", ...o.classes), cssStyles: [...o.styles], cssCompiledStyles: r2(o.classes), actorType: o.type, business: o.business, icon: o.icon || void 0, stereotype: o.stereotype || void 0, parentId: o.parentId || void 0 });
|
|
851
|
+
for (let o of e.useCases.values()) {
|
|
852
|
+
let a = o.shape === "ellipse";
|
|
853
|
+
n.push({ id: o.id, label: o.label, labelType: o.labelType, shape: a ? o.business ? "usecaseBusiness" : "usecaseEllipse" : "rect", isGroup: false, padding: a ? 20 : 10, cssClasses: Te("default", "usecase-element", `usecase-${o.shape}`, o.business && "usecase-business", ...o.classes), cssStyles: [...o.styles], cssCompiledStyles: r2(o.classes), business: o.business, stereotype: o.stereotype || void 0, parentId: o.parentId || void 0 });
|
|
854
|
+
}
|
|
855
|
+
for (let o of e.notes.values()) n.push({ id: o.id, label: o.label, labelType: o.labelType, shape: "note", isGroup: false, padding: 10, cssClasses: "default usecase-note", cssStyles: [], cssCompiledStyles: r2([]), noteTarget: o.target });
|
|
856
|
+
for (let o of e.jsonNodes.values()) n.push({ id: o.id, label: o.id, labelType: "text", shape: "usecaseJsonTable", isGroup: false, padding: 10, cssClasses: Te("default", "usecase-json-table", ...o.classes), cssStyles: [...o.styles], cssCompiledStyles: r2(o.classes), jsonRows: Xn(o) });
|
|
857
|
+
for (let o of e.systemBoundaries.values()) n.push({ id: o.id, label: o.label, labelType: o.labelType, shape: "usecaseSystemBoundary", isGroup: true, padding: 20, cssClasses: Te("default", "system-boundary", `system-boundary-${o.type}`, ...o.classes), cssStyles: [...o.styles], cssCompiledStyles: r2(o.classes), boundaryType: o.type });
|
|
858
|
+
for (let o of e.relationships) {
|
|
859
|
+
let a = o.type === "include" || o.type === "extend", [d, E] = zn(o), h = o.animate || o.animation !== void 0, u2 = { id: o.id, start: o.source, end: o.target, relationshipType: o.type, pattern: a ? "dotted" : "solid", arrowTypeStart: d, arrowTypeEnd: E, classes: Te("default", "relationship", `relationship-${o.type}`, ...o.classes, h && `edge-animation-${o.animation ?? "fast"}`), style: [...o.styles], cssCompiledStyles: r2(o.classes), animate: o.animate, animation: o.animation, minlen: o.minlen, explicitId: o.explicitId, internal: false };
|
|
860
|
+
a ? (u2.label = o.type, u2.labelType = "text") : o.type === "association" && (o.label && (u2.label = o.label), o.labelType && (u2.labelType = o.labelType)), s.push(u2);
|
|
861
|
+
}
|
|
862
|
+
for (let o of e.notes.values()) s.push({ id: `${o.id}-edge`, start: o.id, end: o.target, relationshipType: "note", pattern: "dotted", arrowTypeStart: "none", arrowTypeEnd: "none", classes: "default relationship relationship-note", style: [], cssCompiledStyles: r2([]), animate: false, minlen: 1, explicitId: false, internal: true });
|
|
863
|
+
return { nodes: n, edges: s };
|
|
864
|
+
}
|
|
865
|
+
var qn = 32, Zn = 16, Qn = 72, Ye = 20, yt = 26, Rt = 40, Ne = 60, Dn = 6, St = 6, Ie = 10, gt = 8, Je = 9, Ve = 12, es = 14, Le = ' fill="var(--_s)" stroke="var(--_b)"';
|
|
866
|
+
function _n(e, n, s) {
|
|
867
|
+
let r2 = e.usecase?.[n];
|
|
868
|
+
return typeof r2 == "number" && r2 > 0 ? Math.min(r2, 2e3) : s;
|
|
869
|
+
}
|
|
870
|
+
function ts(e) {
|
|
871
|
+
return e.replace(/[&<>\\]/g, (n) => `&#${n.charCodeAt(0)};`);
|
|
872
|
+
}
|
|
873
|
+
function oe(e, n, s, r2, o, a = 0) {
|
|
874
|
+
return _t(e && !n ? ts(e) : e, n, s, r2, o, a);
|
|
875
|
+
}
|
|
876
|
+
function At(e, n, s, r2) {
|
|
877
|
+
let o = s === 1 || s === 2 ? 1 : -1, a = s === 1 || s === 3, d = (a ? e.w : e.h) / 2, E = 0;
|
|
878
|
+
if (e.kind === 0) a ? (d = Rt / 2 + 3, E = (Ne - e.h) / 2) : d += 2;
|
|
879
|
+
else if (e.kind === 1) {
|
|
880
|
+
let h = (a ? e.h : e.w) / 2;
|
|
881
|
+
d *= Math.sqrt(Math.max(1 - (r2 / h) ** 2, 0));
|
|
882
|
+
}
|
|
883
|
+
return a ? [n.x + o * d, n.y + E + r2] : [n.x + r2, n.y + o * d];
|
|
884
|
+
}
|
|
885
|
+
function Mn(e, n) {
|
|
886
|
+
let s = n === 1 || n === 3;
|
|
887
|
+
if (e.kind === 0) return s ? Ne * 0.5 : Rt * 0.6;
|
|
888
|
+
let r2 = s ? e.h : e.w;
|
|
889
|
+
return e.kind === 1 ? r2 * 0.6 : r2 - 16;
|
|
890
|
+
}
|
|
891
|
+
function ns(e, n, s) {
|
|
892
|
+
let r2 = /* @__PURE__ */ new Map(), o = (a, d, E, h) => {
|
|
893
|
+
let u2 = n[a];
|
|
894
|
+
if (u2.isGroup) return;
|
|
895
|
+
let p = d[E] - u2.x, O = d[E + 1] - u2.y, i;
|
|
896
|
+
if (Math.abs(Math.abs(O) - u2.h / 2) < 0.5) i = O < 0 ? 0 : 2;
|
|
897
|
+
else if (Math.abs(Math.abs(p) - u2.w / 2) < 0.5) i = p < 0 ? 3 : 1;
|
|
898
|
+
else return;
|
|
899
|
+
let A = a * 4 + i, _2 = { route: d, at: E, toward: d[h + (i & 1 ? 1 : 0)] }, N = r2.get(A);
|
|
900
|
+
N ? N.push(_2) : r2.set(A, [_2]);
|
|
901
|
+
};
|
|
902
|
+
for (let a of e) {
|
|
903
|
+
let d = a.route.length - 3;
|
|
904
|
+
a.src === a.dst || d < 3 || (o(a.src, a.route, 0, 3), o(a.dst, a.route, d, d - 3));
|
|
905
|
+
}
|
|
906
|
+
for (let [a, d] of r2) {
|
|
907
|
+
let E = a >> 2, h = a & 3, u2 = s[E], p = d.length > 1 ? Math.min(es, Mn(u2, h) / (d.length - 1)) : 0;
|
|
908
|
+
d.sort((O, i) => O.toward - i.toward);
|
|
909
|
+
for (let O = 0; O < d.length; O++) {
|
|
910
|
+
let [i, A] = At(u2, n[E], h, (O - (d.length - 1) / 2) * p);
|
|
911
|
+
d[O].route[d[O].at] = i, d[O].route[d[O].at + 1] = A;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
function ss(e, n, s, r2, o) {
|
|
916
|
+
let a = e - s * Ve, d = n - r2 * Ve, E = Ve * 0.5;
|
|
917
|
+
return `<path class="pele-marker" d="M${x$1(e)},${x$1(n)}L${x$1(a - r2 * E)},${x$1(d + s * E)}L${x$1(a + r2 * E)},${x$1(d - s * E)}Z" fill="var(--_bg)" stroke="${o}" stroke-linejoin="round"/>`;
|
|
918
|
+
}
|
|
919
|
+
function He(e) {
|
|
920
|
+
return e === "extension" ? Ve : wn$1(e);
|
|
921
|
+
}
|
|
922
|
+
function wn(e, n, s, r2, o, a) {
|
|
923
|
+
return e === "extension" ? ss(n, s, r2, o, a) : Dn$1(e, n, s, r2, o, a);
|
|
924
|
+
}
|
|
925
|
+
function as(e, n) {
|
|
926
|
+
let s = e.node, r2 = e.style.shape, o = ` fill="none" stroke="var(--_b)"${e.style.line}`, a = -21, d = 9, E;
|
|
927
|
+
return s.actorType === "hollow" ? (d = 8, E = `<circle cy="-21" r="8" fill="var(--_bg)" stroke="var(--_b)"${r2}/><path d="M-20,-9H20V0H5.5L20,15.5L12,25.5L0,12L-12,25.5L-20,15.5L-5.5,0H-20Z" fill="var(--_bg)" stroke="var(--_b)" stroke-linejoin="round"${r2}/>`) : s.actorType === "awesome" ? E = `<path d="M0,-30A11,11 0 1 1 0,-8A11,11 0 1 1 0,-30ZM-20,25C-20,9 -12,-3 0,-3C12,-3 20,9 20,25C20,28 18,30 15,30H-15C-18,30 -20,28 -20,25Z" fill="var(--_b)"${r2}/>` : s.actorType === "icon" ? (a = -14, d = 12, E = `<rect x="-22" y="-26" width="44" height="44" rx="${_}"${Le}${r2}/><svg class="pele-icon" data-icon="${y(s.icon ?? "")}" x="-14" y="-18" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${n?.(s.icon ?? "") ?? ""}</svg>`) : E = `<circle cy="-21" r="9"${Le}${r2}/><path d="M0,-12V10M-14,-3H14M0,10L-12,30M0,10L12,30"${o}/>`, s.business && (E += `<path class="pele-business" d="M${x$1(0.12 * d)},${x$1(a + 0.99 * d)}L${x$1(0.92 * d)},${x$1(a - 0.39 * d)}"${o}/>`), E;
|
|
928
|
+
}
|
|
929
|
+
function xn(e, n, s) {
|
|
930
|
+
return m(e.direction) ? c(s, (r2) => $n(e, n, s, r2)) : $n(e, n, s, false);
|
|
931
|
+
}
|
|
932
|
+
function $n(e, n, s, r2) {
|
|
933
|
+
let o = Ln(e), a = s.fontSize ?? 16, d = Math.round(a * 0.875), E = Math.round(a * 0.8125), h = s.measurer ?? H(s.fontFamily), u2 = s.padding ?? 8, p = s.icons, O = r2 ? "TB" : be$1(e.direction), i = O === "LR" || O === "RL", A = /* @__PURE__ */ new Map(), _$1 = [], N = [];
|
|
934
|
+
o.nodes.forEach((m2, S) => A.set(m2.id, S));
|
|
935
|
+
for (let m2 of o.nodes) {
|
|
936
|
+
let S = gt$1(m2.cssStyles.length > 0 ? m2.cssCompiledStyles.concat(m2.cssStyles) : m2.cssCompiledStyles), t2 = (S.bold ? 1 : 0) | (S.italic ? 2 : 0), c2 = S.fontSize ?? a, f = m2.labelType === "markdown", b2 = oe(m2.stereotype && `«${m2.stereotype}»`, false, h, E, 200, t2), y2 = { node: m2, kind: 2, style: S, label: b2, stereotype: b2, w: 0, h: 0, rows: [], keyW: 0, headH: 0, loops: 0 }, C;
|
|
937
|
+
if (m2.isGroup) {
|
|
938
|
+
y2.kind = 4, y2.label = oe(m2.label, f, h, c2, 4e3, t2);
|
|
939
|
+
let T = y2.label.height;
|
|
940
|
+
C = de(0, 0), C.isGroup = true, C.padX = Ye, C.padBottom = Ye, C.padTop = m2.boundaryType === "package" ? T + 2 * St + 16 : T > 0 ? T + 16 : Ye, C.minW = y2.label.width + 2 * Ye;
|
|
941
|
+
} else {
|
|
942
|
+
if (m2.jsonRows) {
|
|
943
|
+
y2.kind = 3, y2.label = oe(m2.label, false, h, c2, 4e3, t2 | 1);
|
|
944
|
+
let T = 0;
|
|
945
|
+
for (let L of m2.jsonRows) {
|
|
946
|
+
let $ = oe(L.key, false, h, d, 4e3, t2), M = oe(L.value, false, h, d, 260, t2);
|
|
947
|
+
y2.rows.push([$, M]), y2.keyW = Math.max(y2.keyW, $.width), T = Math.max(T, M.width), y2.h += Math.max(M.height, Math.round(d * 1.5)) + gt;
|
|
948
|
+
}
|
|
949
|
+
y2.keyW > 0 && (y2.keyW += 2 * Ie), y2.headH = Math.max(y2.label.height, Math.round(c2 * 1.5)) + gt, y2.w = Math.max(y2.label.width + 2 * Ie, y2.rows.length > 0 ? y2.keyW + T + 2 * Ie : 0, 72), y2.h += y2.headH;
|
|
950
|
+
} else if (m2.actorType) y2.kind = 0, y2.label = oe(m2.label, f, h, c2, 140, t2), y2.w = Math.max(Rt, y2.label.width, b2.width), y2.h = Ne + Dn + b2.height + y2.label.height;
|
|
951
|
+
else {
|
|
952
|
+
y2.label = oe(m2.label, f, h, m2.shape === "note" ? d : c2, 180, t2);
|
|
953
|
+
let T = Math.max(y2.label.width, b2.width), L = y2.label.height + b2.height;
|
|
954
|
+
m2.shape === "usecaseEllipse" || m2.shape === "usecaseBusiness" ? (y2.kind = 1, y2.w = Math.max(T + 2 * m2.padding + (m2.business ? 16 : 4), 88), y2.h = Math.max(L + 28, 48)) : m2.shape === "note" ? (y2.w = T + 2 * m2.padding + 6, y2.h = L + 18) : (y2.w = Math.max(T + 2 * m2.padding + 12, 80), y2.h = Math.max(L + 24, 44));
|
|
955
|
+
}
|
|
956
|
+
C = de(y2.w, y2.h);
|
|
957
|
+
}
|
|
958
|
+
C.seq = _$1.length, _$1.push(y2), N.push(C);
|
|
959
|
+
}
|
|
960
|
+
o.nodes.forEach((m2, S) => {
|
|
961
|
+
N[S].parent = m2.parentId !== void 0 ? A.get(m2.parentId) ?? -1 : -1;
|
|
962
|
+
});
|
|
963
|
+
let w = [], I = [], B = [];
|
|
964
|
+
for (let m2 of o.edges) {
|
|
965
|
+
let S = A.get(m2.start), t2 = A.get(m2.end);
|
|
966
|
+
if (S === void 0 || t2 === void 0) continue;
|
|
967
|
+
let c2 = m2.relationshipType === "include" || m2.relationshipType === "extend", f = oe(c2 ? `«${m2.label}»` : m2.label, m2.labelType === "markdown", h, d, 200);
|
|
968
|
+
S === t2 && (_$1[S].loops++, i ? N[S].h += 2 * (yt + (f.height > 0 ? f.height + 8 : 0)) : N[S].w += 2 * (yt + (f.width > 0 ? f.width + 12 : 0))), B.push(m2), I.push(f), w.push({ src: S, dst: t2, minlen: m2.minlen, labelW: f.width > 0 ? f.width + 12 : 0, labelH: f.height > 0 ? f.height + 4 : 0, route: [], labelX: 0, labelY: 0 });
|
|
969
|
+
}
|
|
970
|
+
let H$1 = me$1(N, w, O, { nodeSep: _n(n, "nodeSpacing", qn), edgeSep: Zn, rankSep: _n(n, "rankSpacing", Qn), portSep: 20 }), te = _t(e.title, false, h, a, 4e3, 1), de$1 = te.height > 0 ? te.height + 12 : 0, Se = Math.max(H$1.width, te.width), De = u2 + (Se - H$1.width) / 2, Xe = u2 + de$1;
|
|
971
|
+
pe$1(N, w, De, Xe);
|
|
972
|
+
let re = Math.ceil(Se + 2 * u2), ue = Math.ceil(H$1.height + de$1 + 2 * u2), _e = /* @__PURE__ */ new Map();
|
|
973
|
+
for (let m2 of w) x(_e, m2.route);
|
|
974
|
+
ns(w, N, _$1);
|
|
975
|
+
let ge = "", Ae = "";
|
|
976
|
+
for (let m2 = 0; m2 < _$1.length; m2++) {
|
|
977
|
+
let S = _$1[m2], t2 = N[m2], c2 = S.node, f = ht$1(c2.cssClasses.replace(/^default\s?/, "")), b2 = y(c2.id), y$1 = S.style.text, C = S.style.shape, T = S.w, L = S.h;
|
|
978
|
+
if (S.kind === 4) {
|
|
979
|
+
let D = t2.x - t2.w / 2, k = t2.y - t2.h / 2, x2 = ` fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${C}`, W = ` class="pele-cluster-label" fill="var(--_m)"${y$1}`, G;
|
|
980
|
+
if (c2.boundaryType === "package") {
|
|
981
|
+
let V = Math.min(S.label.width + 2 * St + 8, t2.w), X = S.label.height + 2 * St;
|
|
982
|
+
G = `<rect class="pele-boundary-tab" x="${x$1(D)}" y="${x$1(k)}" width="${x$1(V)}" height="${x$1(X)}"${x2}/><rect x="${x$1(D)}" y="${x$1(k + X)}" width="${x$1(t2.w)}" height="${x$1(t2.h - X)}"${x2}/>` + ft$1(S.label, D + V / 2, k + X / 2, W, p);
|
|
983
|
+
} else G = `<rect x="${x$1(D)}" y="${x$1(k)}" width="${x$1(t2.w)}" height="${x$1(t2.h)}" rx="${_}"${x2}/>` + ft$1(S.label, os(t2, S.label.width, _e), k + 8 + S.label.height / 2, W, p);
|
|
984
|
+
ge += `<g class="pele-cluster pele-boundary${f}" data-id="${b2}">${G}</g>`;
|
|
985
|
+
continue;
|
|
986
|
+
}
|
|
987
|
+
let $, M;
|
|
988
|
+
if (S.kind === 0) {
|
|
989
|
+
M = "pele-actor";
|
|
990
|
+
let D = -L / 2, k = D + Ne + Dn + S.stereotype.height / 2;
|
|
991
|
+
$ = `<g class="pele-actor-figure" transform="translate(0,${x$1(D + Ne / 2)})">${as(S, p)}</g>` + ft$1(S.stereotype, 0, k, ` class="pele-stereotype" font-size="${E}" fill="var(--_m)"`, p) + ft$1(S.label, 0, L / 2 - S.label.height / 2, ` class="pele-label"${y$1}`, p);
|
|
992
|
+
} else if (S.kind === 3) {
|
|
993
|
+
M = "pele-json";
|
|
994
|
+
let D = -T / 2, k = -L / 2 + S.headH, x2 = "", W = `M${x$1(D)},${x$1(k)}H${x$1(D + T)}`;
|
|
995
|
+
S.keyW > 0 && (W += `M${x$1(D + S.keyW)},${x$1(k)}V${x$1(L / 2)}`);
|
|
996
|
+
for (let [G, V] of S.rows) {
|
|
997
|
+
let X = Math.max(V.height, Math.round(d * 1.5)) + gt;
|
|
998
|
+
x2 += ft$1(G, D + Ie + G.width / 2, k + X / 2, ' class="pele-json-key" fill="var(--_m)"', p) + rs(V, D + S.keyW + Ie, k + X / 2, ` class="pele-json-value"${y$1}`, p), k += X;
|
|
999
|
+
}
|
|
1000
|
+
$ = `<rect x="${x$1(D)}" y="${x$1(-L / 2)}" width="${x$1(T)}" height="${x$1(L)}" rx="${_}"${Le}${C}/><path class="pele-json-lines" d="${W}" fill="none" stroke="var(--_b)"${S.style.line}/>` + ft$1(S.label, 0, -L / 2 + S.headH / 2, ` class="pele-label" font-weight="var(--_hw)"${y$1}`, p) + `<g font-size="${d}">${x2}</g>`;
|
|
1001
|
+
} else {
|
|
1002
|
+
let D = S.stereotype.height / 2, k;
|
|
1003
|
+
if (S.kind === 1) {
|
|
1004
|
+
if (M = "pele-usecase", k = `<ellipse rx="${x$1(T / 2)}" ry="${x$1(L / 2)}"${Le}${C}/>`, c2.business) {
|
|
1005
|
+
let x2 = T / 2 - 15, W = T / 2 - 5, G = (V) => L / 2 * Math.sqrt(1 - (V / (T / 2)) ** 2);
|
|
1006
|
+
k += `<path class="pele-business" d="M${x$1(x2)},${x$1(G(x2))}L${x$1(W)},${x$1(-G(W))}" fill="none" stroke="var(--_b)"${S.style.line}/>`;
|
|
1007
|
+
}
|
|
1008
|
+
} else if (c2.shape === "note") {
|
|
1009
|
+
M = "pele-note";
|
|
1010
|
+
let x2 = T / 2, W = L / 2;
|
|
1011
|
+
k = `<path d="M${x$1(-x2)},${x$1(-W)}H${x$1(x2 - Je)}L${x$1(x2)},${x$1(Je - W)}V${x$1(W)}H${x$1(-x2)}Z" fill="var(--_a)" stroke="var(--_b)" stroke-linejoin="round"${C}/><path d="M${x$1(x2 - Je)},${x$1(-W)}V${x$1(Je - W)}H${x$1(x2)}" fill="none" stroke="var(--_b)" stroke-linejoin="round"${S.style.line}/>`;
|
|
1012
|
+
} else M = "pele-usecase", k = `<rect x="${x$1(-T / 2)}" y="${x$1(-L / 2)}" width="${x$1(T)}" height="${x$1(L)}" rx="${_}"${Le}${C}/>`;
|
|
1013
|
+
$ = k + ft$1(S.stereotype, 0, -S.label.height / 2, ` class="pele-stereotype" font-size="${E}" fill="var(--_m)"`, p) + ft$1(S.label, 0, D, ` class="pele-label"${c2.shape === "note" ? ` font-size="${d}"` : ""}${y$1}`, p);
|
|
1014
|
+
}
|
|
1015
|
+
Ae += `<g class="pele-node ${M}${f}" data-id="${b2}" transform="translate(${x$1(t2.x)},${x$1(t2.y)})">${$}</g>`;
|
|
1016
|
+
}
|
|
1017
|
+
let fe = "", ne = "", we = /* @__PURE__ */ new Map();
|
|
1018
|
+
for (let m2 = 0; m2 < w.length; m2++) {
|
|
1019
|
+
let S = w[m2], t2 = B[m2], c2 = I[m2], f = t2.style.length > 0 || t2.cssCompiledStyles.length > 0 ? gt$1(t2.cssCompiledStyles.concat(t2.style)) : void 0, b$1 = t2.arrowTypeStart, y$1 = t2.arrowTypeEnd, C;
|
|
1020
|
+
if (S.src === S.dst) {
|
|
1021
|
+
let $ = N[S.src], M = _$1[S.src], D = we.get(S.src) ?? 0;
|
|
1022
|
+
we.set(S.src, D + 1);
|
|
1023
|
+
let k = i ? 2 : 1, x2 = Math.min(Mn(M, k) / 2, 8 + D * 6), W = yt + D * 8, [G, V] = At(M, $, k, -x2), [X, $e] = At(M, $, k, x2), Me = Math.hypot(W, x2) || 1, he = i ? x2 / Me : W / Me, Ee = i ? W / Me : x2 / Me, xe = He(b$1), mt = He(y$1), Ct = (Ot, Tt, It, ke) => i ? `${x$1(Ot + It * x2 * (ke ? 1 : 0))},${x$1(Tt + ke)}` : `${x$1(Ot + ke)},${x$1(Tt + It * x2 * (ke ? 1 : 0))}`, kn = i ? G - he * xe : G + he * xe, Wn = i ? V + Ee * xe : V - Ee * xe, Bn = X + he * mt, Un = $e + Ee * mt;
|
|
1024
|
+
C = { d: `M${x$1(kn)},${x$1(Wn)}C${Ct(G, V, -1, W)} ${Ct(X, $e, 1, W)} ${x$1(Bn)},${x$1(Un)}`, sx: G, sy: V, sdx: i ? he : -he, sdy: i ? -Ee : Ee, ex: X, ey: $e, edx: -he, edy: -Ee }, i ? (S.labelX = $.x, S.labelY = Math.max(V, $e) + W * 0.75 + 6 + c2.height / 2) : (S.labelX = Math.max(G, X) + W * 0.75 + 8 + c2.width / 2, S.labelY = $.y);
|
|
1025
|
+
} else {
|
|
1026
|
+
if (S.route.length < 6) continue;
|
|
1027
|
+
C = Fn$1(S.route, void 0, He(b$1), He(y$1));
|
|
1028
|
+
}
|
|
1029
|
+
let T = f?.stroke ? b(f.stroke) : "var(--_l)", L = t2.internal ? "2 3" : t2.pattern === "dotted" ? "5 4" : t2.animate ? "9 5" : "";
|
|
1030
|
+
if (fe += `<g class="pele-edge pele-${t2.relationshipType}${ht$1(t2.classes.replace(/^default relationship relationship-\S+\s?/, ""))}" data-id="${y(t2.id)}"${f?.line ?? ""}><path d="${C.d}"${L ? ` stroke-dasharray="${L}"` : ""}/>` + wn(b$1, C.sx, C.sy, C.sdx, C.sdy, T) + wn(y$1, C.ex, C.ey, C.edx, C.edy, T) + "</g>", c2.width > 0) {
|
|
1031
|
+
let $ = S.labelX, M = S.labelY, D = t2.relationshipType === "include" || t2.relationshipType === "extend";
|
|
1032
|
+
ne += Sn$1(t2.id, c2, $, M, (D ? ' fill="var(--_m)"' : "") + (f?.text ?? ""), p);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return { svg: $t("usecase", re, ue, a, s, e, ft$1(te, re / 2, u2 + te.height / 2, ' class="pele-title" font-weight="var(--_tw)"') + (ge ? `<g class="pele-clusters">${ge}</g>` : "") + (fe ? `<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${fe}</g>` : "") + (ne ? `<g class="pele-edge-labels" font-size="${d}">${ne}</g>` : "") + `<g class="pele-nodes">${Ae}</g>`), width: re, height: ue, links: [] };
|
|
1036
|
+
}
|
|
1037
|
+
function os(e, n, s) {
|
|
1038
|
+
let r2 = s.get(Math.round(e.y - e.h / 2));
|
|
1039
|
+
if (n === 0 || r2 === void 0) return e.x;
|
|
1040
|
+
let o = e.x - e.w / 2 + 6, a = e.x + e.w / 2 - 6, d = r2.filter((i) => i > o && i < a).sort((i, A) => i - A);
|
|
1041
|
+
d.push(a);
|
|
1042
|
+
let E = n / 2 + 6, h = e.x, u2 = 1 / 0, p = 0, O = o;
|
|
1043
|
+
for (let i of d) {
|
|
1044
|
+
if (i - O >= 2 * E) {
|
|
1045
|
+
let A = Math.min(Math.max(e.x, O + E), i - E);
|
|
1046
|
+
Math.abs(A - e.x) < u2 && (u2 = Math.abs(A - e.x), h = A);
|
|
1047
|
+
} else u2 === 1 / 0 && i - O > p && (p = i - O, h = (O + i) / 2);
|
|
1048
|
+
O = i;
|
|
1049
|
+
}
|
|
1050
|
+
return h;
|
|
1051
|
+
}
|
|
1052
|
+
function rs(e, n, s, r2, o) {
|
|
1053
|
+
if (e.lines.length < 2) return ft$1(e, n + e.width / 2, s, r2, o);
|
|
1054
|
+
let a = "";
|
|
1055
|
+
for (let d = 0; d < e.lines.length; d++) {
|
|
1056
|
+
let E = { ...e, lines: [e.lines[d]], widths: [e.widths[d]], height: e.lineHeight };
|
|
1057
|
+
a += ft$1(E, n + e.widths[d] / 2, s - e.height / 2 + (d + 0.5) * e.lineHeight, r2, o);
|
|
1058
|
+
}
|
|
1059
|
+
return a;
|
|
1060
|
+
}
|
|
1061
|
+
var Fs = { type: "usecase", parse: (e, n, s) => In(e, s), render: xn };
|
|
1062
|
+
export {
|
|
1063
|
+
Fs as usecase
|
|
1064
|
+
};
|