@aiquants/markdown 5.0.0 → 6.0.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/README.md +93 -14
- package/dist/{abnfDiagram-VRR7QNED-DeHJ63Vu.js → abnfDiagram-VRR7QNED-D7Rp9EaV.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-CfVjEUzG.cjs → abnfDiagram-VRR7QNED-KTGT9TWM.cjs} +1 -1
- package/dist/{arc-XFFLkHkK.cjs → arc-D5T_urCC.cjs} +1 -1
- package/dist/arc-DzZml7Bc.js +83 -0
- package/dist/{architectureDiagram-ZJ3FMSHR-7xJ6YYGu.cjs → architectureDiagram-ZJ3FMSHR-BOo3y9aD.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-CQ1m3MUB.js → architectureDiagram-ZJ3FMSHR-DLrGYTYy.js} +123 -123
- package/dist/{blockDiagram-677ZJIJ3-BPC3se0e.js → blockDiagram-677ZJIJ3-B60l5Fpl.js} +166 -166
- package/dist/{blockDiagram-677ZJIJ3-CJOFqwiW.cjs → blockDiagram-677ZJIJ3-DnjCjo0a.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-BEIrp4t6.js → c4Diagram-LMCZKHZV-BmbplKCu.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-D8ytYGhR.cjs → c4Diagram-LMCZKHZV-bd8fWQ1F.cjs} +1 -1
- package/dist/channel-B3oXm84X.js +5 -0
- package/dist/{channel-CJQcZr8o.cjs → channel-DJ_PyD9w.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-l8ly7Yjr.js → chunk-2Q5K7J3B-C0hbxO3D.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-BbMQR3Sm.cjs → chunk-2Q5K7J3B-CWLCO342.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BwDfmprN.cjs → chunk-32BRIVSS-Cb9nTxqN.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BhQJBlVw.js → chunk-32BRIVSS-DUWtkDEY.js} +1 -1
- package/dist/{chunk-5VM5RSS4-Bfis-x7E.js → chunk-5VM5RSS4-C3mSh-gE.js} +1 -1
- package/dist/{chunk-5VM5RSS4-CqDQlS7v.cjs → chunk-5VM5RSS4-DHA5n_Ls.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-9aDULZwJ.cjs → chunk-EX3LRPZG-ByY6_kep.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-DUTbzwDM.js → chunk-EX3LRPZG-DCF1zjtT.js} +50 -50
- package/dist/{chunk-JWPE2WC7-DpcSSOP5.js → chunk-JWPE2WC7-CPLOunIL.js} +1 -1
- package/dist/{chunk-JWPE2WC7-5cM5nFf6.cjs → chunk-JWPE2WC7-CUBzYD4G.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-D_h6bolU.js → chunk-MOJQB5TN-CmOhW6SK.js} +9 -9
- package/dist/{chunk-MOJQB5TN-Cw864mUL.cjs → chunk-MOJQB5TN-P8-yb3-j.cjs} +1 -1
- package/dist/{chunk-PUDLZKDR-B0wZjmzv.js → chunk-PUDLZKDR-DH7B7ZTK.js} +22 -22
- package/dist/{chunk-PUDLZKDR-yLvT3c9x.cjs → chunk-PUDLZKDR-pKdIELvz.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-DTKYsCgk.js → chunk-RYQCIY6F-C7ytn_QX.js} +6 -6
- package/dist/{chunk-RYQCIY6F-hj9dRWMT.cjs → chunk-RYQCIY6F-DcvQCEoc.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-COa9uddv.js → chunk-V7JOEXUC-BgLcssUF.js} +5 -5
- package/dist/{chunk-V7JOEXUC-DIQ8n1AN.cjs → chunk-V7JOEXUC-CtXgqODy.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-B72PxPVm.js → chunk-VR4S4FIN-BK6xeIQk.js} +3 -3
- package/dist/{chunk-VR4S4FIN-Cy-2mZJB.cjs → chunk-VR4S4FIN-Cc4GDi2Z.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-D2Sgptl-.js → chunk-XXDRQBXY-COtZ25Ez.js} +1 -1
- package/dist/{chunk-XXDRQBXY-DmoUE7-y.cjs → chunk-XXDRQBXY-D1OixGzR.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-GjsCEuKI.cjs → classDiagram-OUVF2IWQ-DDLmqaG6.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-Dah4_VL7.js → classDiagram-OUVF2IWQ-Jc-IwOm0.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-GjsCEuKI.cjs → classDiagram-v2-EOCWNBFH-DDLmqaG6.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-Dah4_VL7.js → classDiagram-v2-EOCWNBFH-Jc-IwOm0.js} +2 -2
- package/dist/components/MarkdownRenderer.d.ts +5 -2
- package/dist/components/MarkdownViewer.d.ts +3 -2
- package/dist/components/NodesRenderer.d.ts +1 -5
- package/dist/components/embeds/ClientFrame.d.ts +13 -0
- package/dist/components/embeds/LinkCard.d.ts +9 -0
- package/dist/components/embeds/ProviderEmbed.d.ts +11 -0
- package/dist/components/embeds/embedLabels.d.ts +12 -0
- package/dist/components/embeds/frameMessages.d.ts +7 -0
- package/dist/components/embeds/markdownEmbeds.d.ts +2 -0
- package/dist/components/embeds/requestQueue.d.ts +16 -0
- package/dist/components/embeds.d.ts +0 -8
- package/dist/components/htmlSanitizer.d.ts +4 -0
- package/dist/components/mdastNodes/HTMLBlockContainerNode.d.ts +1 -2
- package/dist/components/rawHtml.d.ts +6 -3
- package/dist/components/viewerLabels.d.ts +3 -1
- package/dist/{cose-bilkent-JH36ORCC-Pi0l3C5o.js → cose-bilkent-JH36ORCC-DaucPocG.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-Vi9pHFwc.cjs → cose-bilkent-JH36ORCC-OwiXHdQY.cjs} +1 -1
- package/dist/css/zenn-content.css +0 -40
- package/dist/{cynefinDiagram-TSTJHNR4-BQ2k9Z6b.cjs → cynefinDiagram-TSTJHNR4-Ag-HcuUm.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-CIh03JTU.js → cynefinDiagram-TSTJHNR4-Dkmz7gDw.js} +47 -47
- package/dist/{dagre-VKFMJZFB-cINcPwV3.js → dagre-VKFMJZFB-BHGdcjt3.js} +27 -27
- package/dist/{dagre-VKFMJZFB-DI2wSrAy.cjs → dagre-VKFMJZFB-Q4CcAQ09.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-BonrBTG_.js → diagram-FQU43EPY-DBASKnKu.js} +42 -42
- package/dist/{diagram-FQU43EPY-B6iUH2l5.cjs → diagram-FQU43EPY-jWCrN_AW.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-CY6mWS2R.cjs → diagram-G47NLZAW-B4XMStX7.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-5N876QQA.js → diagram-G47NLZAW-BY1mmnYA.js} +83 -83
- package/dist/{diagram-NH7WQ7WH-x3SaRfd6.cjs → diagram-NH7WQ7WH-BS1eEa9R.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-LFuTbHxY.js → diagram-NH7WQ7WH-BXFvYRtm.js} +18 -18
- package/dist/{diagram-OA4YK3LP-B9mVw8cB.cjs → diagram-OA4YK3LP-CTaL_2Nc.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-Cinpbl0B.js → diagram-OA4YK3LP-DgGrzezu.js} +61 -61
- package/dist/{diagram-WEI45ONY-HPCHpafe.js → diagram-WEI45ONY-BHxWKH3v.js} +21 -21
- package/dist/{diagram-WEI45ONY-BRYVUhRr.cjs → diagram-WEI45ONY-DX7BGSMI.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-oLOdtH39.js → ebnfDiagram-CCIWWBDH-BUK_anpV.js} +5 -5
- package/dist/{ebnfDiagram-CCIWWBDH-DhFlIi0a.cjs → ebnfDiagram-CCIWWBDH-BpDmVVJY.cjs} +1 -1
- package/dist/embeds/frames.d.ts +4 -0
- package/dist/embeds/linkCards.d.ts +16 -0
- package/dist/embeds/placeholder.d.ts +15 -0
- package/dist/embeds/providers.d.ts +73 -0
- package/dist/embeds/testing.cjs +1 -0
- package/dist/embeds/testing.d.ts +7 -0
- package/dist/embeds/testing.js +67 -0
- package/dist/embeds.cjs +1 -0
- package/dist/embeds.d.ts +4 -0
- package/dist/embeds.js +94 -0
- package/dist/{erDiagram-Q63AITRT-DCCFR1Ai.cjs → erDiagram-Q63AITRT-Cd9H9BtP.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-CCtzpK78.js → erDiagram-Q63AITRT-Qb2bmkNp.js} +9 -9
- package/dist/{extractHeadings-CGJexznE.js → extractHeadings-B2pUyEPa.js} +5603 -5517
- package/dist/extractHeadings-DgefF9l1.cjs +311 -0
- package/dist/flowDiagram-23GEKE2U-BOmNlv7X.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-DMZnRz-6.js +7 -0
- package/dist/{ganttDiagram-NO4QXBWP-Dfi3nINO.js → ganttDiagram-NO4QXBWP-BVISsrzr.js} +69 -69
- package/dist/{ganttDiagram-NO4QXBWP-C9RPyo4r.cjs → ganttDiagram-NO4QXBWP-C6-ExcDz.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-CjAqPhww.js → gitGraphDiagram-IHSO6WYX-BDVA2TFP.js} +38 -38
- package/dist/{gitGraphDiagram-IHSO6WYX-mT3NNT7T.cjs → gitGraphDiagram-IHSO6WYX-DLzPc702.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +1 -10
- package/dist/index.client.js +41 -49
- package/dist/index.js +41 -49
- package/dist/index.server.cjs +1 -1
- package/dist/index.server.d.ts +0 -2
- package/dist/index.server.js +116 -161
- package/dist/{infoDiagram-FWYZ7A6U-BXWQ9Vy4.js → infoDiagram-FWYZ7A6U-D31UwqjR.js} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-0Co9BitR.cjs → infoDiagram-FWYZ7A6U-DMF_wb2h.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-BKqUBw1i.cjs → ishikawaDiagram-FXEZZL3T-DUlnwraq.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-CZp5P1WE.js → ishikawaDiagram-FXEZZL3T-XA6-gyHY.js} +35 -35
- package/dist/{journeyDiagram-5HDEW3XC-DYVTgOOE.js → journeyDiagram-5HDEW3XC-B8sfsWpu.js} +39 -39
- package/dist/{journeyDiagram-5HDEW3XC-CeumPQ1I.cjs → journeyDiagram-5HDEW3XC-CwQyFcYa.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-Cg5KnsE9.cjs → kanban-definition-HUTT4EX6-BjPlt2-E.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-CnleRy80.js → kanban-definition-HUTT4EX6-FTrTBare.js} +123 -123
- package/dist/{linear-qqwu6T0F.cjs → linear-D3AJM3sY.cjs} +1 -1
- package/dist/{linear-Cf8i6Rsk.js → linear-DI9P_z72.js} +32 -32
- package/dist/markdown.css +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-DfFWeFph.cjs → mindmap-definition-LN4V7U3C-CxgWZidl.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-lBin9VOm.js → mindmap-definition-LN4V7U3C-YW4YcL9x.js} +33 -33
- package/dist/{pegDiagram-2B236MQR-Cf1f-3yi.cjs → pegDiagram-2B236MQR-CUo7q5bl.cjs} +1 -1
- package/dist/{pegDiagram-2B236MQR-BiD21lOj.js → pegDiagram-2B236MQR-sJjLKeF3.js} +5 -5
- package/dist/{pieDiagram-ENE6RG2P-jwhVsZgX.cjs → pieDiagram-ENE6RG2P-Cy_sUuLQ.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-BqZb6gaV.js → pieDiagram-ENE6RG2P-D4VanIOv.js} +58 -58
- package/dist/providers-Bxr2Wb-j.cjs +1 -0
- package/dist/providers-Drq7MT_K.js +209 -0
- package/dist/{quadrantDiagram-ABIIQ3AL-sO_sIA7b.cjs → quadrantDiagram-ABIIQ3AL-D3c8xLpt.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-CNe9fRLO.js → quadrantDiagram-ABIIQ3AL-ubxphjb_.js} +48 -48
- package/dist/{railroadDiagram-RFXS5EU6-53YTkJrs.js → railroadDiagram-RFXS5EU6-DvpD4C_A.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-Dkc8k3e9.cjs → railroadDiagram-RFXS5EU6-_Q4W5hB-.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-C0GMlJO4.cjs → requirementDiagram-TGXJPOKE-DdYIO-wU.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-D8Gz7jzA.js → requirementDiagram-TGXJPOKE-Dk_6BuX9.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-CEC0GaCg.js → sankeyDiagram-HTMAVEWB-s3Kd7T8n.js} +67 -67
- package/dist/{sankeyDiagram-HTMAVEWB-Bw9J2Ay2.cjs → sankeyDiagram-HTMAVEWB-zuYg6LTg.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-BuqPCreB.cjs → sequenceDiagram-DBY2YBRQ-BvNPCevg.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CKb4m3I0.js → sequenceDiagram-DBY2YBRQ-YQic4wxL.js} +47 -47
- package/dist/{sizeCapture-X5ZJPWSS-Dm3rsxXw.cjs → sizeCapture-X5ZJPWSS-BqrdzzsI.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-CotnTNAA.js → sizeCapture-X5ZJPWSS-qMsWGfjy.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-GWEIP-C9.js → stateDiagram-2N3HPSRC-D1Ub8LYq.js} +22 -22
- package/dist/{stateDiagram-2N3HPSRC-5Y-OlePe.cjs → stateDiagram-2N3HPSRC-Ds8f-scd.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-BZFV8swJ.js → stateDiagram-v2-6OUMAXLB-DW8wjtk3.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-v77D3Qyf.cjs → stateDiagram-v2-6OUMAXLB-PmrsPXuZ.cjs} +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-DujAOwAt.js → swimlanes-5IMT3BWC-C8P8vU0w.js} +313 -313
- package/dist/{swimlanes-5IMT3BWC-B1hLl8Ph.cjs → swimlanes-5IMT3BWC-jZhcesRT.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-B-5z3jDg.js → swimlanesDiagram-G3AALYLV-B9FKeJRf.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-Cklgsxbg.cjs → swimlanesDiagram-G3AALYLV-M5Cg2MHU.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-Fmzt_lvR.js → timeline-definition-FHXFAJF6-Ch-He--D.js} +34 -34
- package/dist/{timeline-definition-FHXFAJF6-B2m-aQLI.cjs → timeline-definition-FHXFAJF6-DZm1-KlQ.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-zIXK42Cx.js → vennDiagram-L72KCM5P-CaoPscCM.js} +92 -92
- package/dist/{vennDiagram-L72KCM5P-rL7UDYbl.cjs → vennDiagram-L72KCM5P-mUSI238J.cjs} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-pTeeZ0uM.js → wardleyDiagram-EHGQE667-CSAqF366.js} +11 -11
- package/dist/{wardleyDiagram-EHGQE667-CNLieFen.cjs → wardleyDiagram-EHGQE667-CkKP97H-.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-CD5ik4HK.cjs → xychartDiagram-FW5EYKEG-BivGpkVk.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-B6UdSSVZ.js → xychartDiagram-FW5EYKEG-OEsTD_k4.js} +37 -37
- package/package.json +21 -8
- package/dist/arc-DH6k2JIR.js +0 -83
- package/dist/channel-DoH_tsOQ.js +0 -5
- package/dist/components/mdastNodes/BlockLinkNode.d.ts +0 -5
- package/dist/components/mdastNodes/RichLinkCard.d.ts +0 -8
- package/dist/components/mdastNodes/TwitterEmbedNode.d.ts +0 -25
- package/dist/components/mdastNodes/YouTubeEmbedNode.d.ts +0 -6
- package/dist/extractHeadings-lDHB2sBb.cjs +0 -310
- package/dist/flowDiagram-23GEKE2U-ORytlvmX.js +0 -7
- package/dist/flowDiagram-23GEKE2U-h2WZTCCn.cjs +0 -1
- package/dist/plugins/createIntentTweetLink.d.ts +0 -10
- package/dist/plugins/extractYouTubeVideoId.d.ts +0 -5
- package/dist/plugins/fetchSiteMetadata.d.ts +0 -9
- package/dist/plugins/remark-auto-heading-id.d.ts +0 -2
- package/dist/plugins/remark-block-link-metadata.d.ts +0 -23
- package/dist/plugins/remark-block-link.d.ts +0 -12
- package/dist/plugins/remark-twitter-embed.d.ts +0 -20
- package/dist/plugins/remark-youtube-embed.d.ts +0 -14
- package/dist/simple-logger-DZxBpX7v.cjs +0 -1
- package/dist/simple-logger-i94ikRyH.js +0 -101
- package/dist/utils/getFaviconUrl.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { p as re } from "./chunk-JWPE2WC7-
|
|
2
|
-
import {
|
|
1
|
+
import { p as re } from "./chunk-JWPE2WC7-CPLOunIL.js";
|
|
2
|
+
import { a6 as oe, a5 as se, y as de, z as le, A as ce, G as me, _ as o, O as g, J as T, K as ue, ag as xe, ab as fe, ah as ge, af as M, ai as he, V as y, X as P, aY as pe } from "./extractHeadings-B2pUyEPa.js";
|
|
3
3
|
import { p as be, i as ve } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
4
|
-
var
|
|
4
|
+
var $ = "position frame", D = "frame positioned", S = "position relation", N = "relation positioned", we = /* @__PURE__ */ o(function(e) {
|
|
5
5
|
g.debug("options str", e);
|
|
6
6
|
}, "setOptions"), ye = /* @__PURE__ */ o(function() {
|
|
7
7
|
return {};
|
|
@@ -22,9 +22,9 @@ function O() {
|
|
|
22
22
|
if (!n)
|
|
23
23
|
throw new Error("No data for EventModel");
|
|
24
24
|
return n.frames.forEach((i, a) => {
|
|
25
|
-
const r =
|
|
25
|
+
const r = L(i, n.dataEntities, t);
|
|
26
26
|
e = v(e, {
|
|
27
|
-
$kind:
|
|
27
|
+
$kind: $,
|
|
28
28
|
index: a,
|
|
29
29
|
frame: i,
|
|
30
30
|
textProps: r
|
|
@@ -48,10 +48,10 @@ function O() {
|
|
|
48
48
|
}, e;
|
|
49
49
|
}
|
|
50
50
|
o(O, "getState");
|
|
51
|
-
function
|
|
51
|
+
function I(e) {
|
|
52
52
|
B.ast = e;
|
|
53
53
|
}
|
|
54
|
-
o(
|
|
54
|
+
o(I, "setAst");
|
|
55
55
|
var s = {
|
|
56
56
|
swimlaneMinHeight: 70,
|
|
57
57
|
swimlanePadding: 15,
|
|
@@ -86,12 +86,12 @@ var Fe = {
|
|
|
86
86
|
maxR: 0,
|
|
87
87
|
sortedSwimlanesArray: []
|
|
88
88
|
};
|
|
89
|
-
function
|
|
89
|
+
function W(e) {
|
|
90
90
|
const n = e.split(".");
|
|
91
91
|
if (n.length === 2)
|
|
92
92
|
return n[0];
|
|
93
93
|
}
|
|
94
|
-
o(
|
|
94
|
+
o(W, "extractNamespace");
|
|
95
95
|
function H(e) {
|
|
96
96
|
const n = e.split(".");
|
|
97
97
|
return n.length === 2 ? n[1] : e;
|
|
@@ -113,7 +113,7 @@ function b(e, n, t) {
|
|
|
113
113
|
}
|
|
114
114
|
o(b, "findNextAvailableIndex");
|
|
115
115
|
function _(e, n) {
|
|
116
|
-
const t =
|
|
116
|
+
const t = W(e.entityIdentifier), i = U(n, t);
|
|
117
117
|
switch (e.modelEntityType) {
|
|
118
118
|
case "ui":
|
|
119
119
|
case "pcr":
|
|
@@ -147,7 +147,7 @@ function _(e, n) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
o(_, "calculateSwimlaneProps");
|
|
150
|
-
function
|
|
150
|
+
function G(e) {
|
|
151
151
|
const { themeVariables: n } = M();
|
|
152
152
|
switch (e.modelEntityType) {
|
|
153
153
|
case "ui":
|
|
@@ -186,8 +186,8 @@ function L(e) {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
o(
|
|
190
|
-
function
|
|
189
|
+
o(G, "calculateEntityVisualProps");
|
|
190
|
+
function L(e, n, t) {
|
|
191
191
|
const i = M(), a = y(H(e.entityIdentifier) ?? "", i);
|
|
192
192
|
let r;
|
|
193
193
|
const d = {
|
|
@@ -217,9 +217,9 @@ function V(e, n, t) {
|
|
|
217
217
|
};
|
|
218
218
|
return g.debug(`[${e.name}] ${e.entityIdentifier} text`, f), f;
|
|
219
219
|
}
|
|
220
|
-
o(
|
|
221
|
-
function
|
|
222
|
-
const t = n, i =
|
|
220
|
+
o(L, "calculateTextProps");
|
|
221
|
+
function V(e, n) {
|
|
222
|
+
const t = n, i = G(t.frame), a = {
|
|
223
223
|
width: t.textProps.width + 2 * s.boxTextPadding,
|
|
224
224
|
height: t.textProps.height + 2 * s.boxTextPadding
|
|
225
225
|
};
|
|
@@ -232,21 +232,21 @@ function G(e, n) {
|
|
|
232
232
|
textProps: t.textProps
|
|
233
233
|
}];
|
|
234
234
|
}
|
|
235
|
-
o(
|
|
235
|
+
o(V, "decidePositionFrame");
|
|
236
236
|
function X(e, n, t) {
|
|
237
237
|
return n === void 0 ? s.contentStartX : n.index === e.index && e.r ? e.r + s.boxPadding : t === void 0 ? s.contentStartX : t.r - s.boxOverlap + s.boxPadding;
|
|
238
238
|
}
|
|
239
239
|
o(X, "calculateX");
|
|
240
|
-
function
|
|
240
|
+
function Y(e, n) {
|
|
241
241
|
const t = [...e.map((i) => i.r), n];
|
|
242
242
|
return Math.max(...t);
|
|
243
243
|
}
|
|
244
|
-
o(
|
|
244
|
+
o(Y, "calculateMaxRight");
|
|
245
245
|
function A(e) {
|
|
246
246
|
return Object.values(e).sort((n, t) => n.index - t.index);
|
|
247
247
|
}
|
|
248
248
|
o(A, "sortedSwimlanesArray");
|
|
249
|
-
function
|
|
249
|
+
function j(e, n) {
|
|
250
250
|
const t = n, i = _(t.frame, e.swimlanes);
|
|
251
251
|
let a;
|
|
252
252
|
i.index in e.swimlanes ? a = e.swimlanes[i.index] : a = {
|
|
@@ -266,7 +266,7 @@ function Y(e, n) {
|
|
|
266
266
|
s.boxMinHeight,
|
|
267
267
|
Math.min(s.boxMaxHeight, t.dimension.height)
|
|
268
268
|
) + 2 * s.boxPadding
|
|
269
|
-
}, c = X(a, d, r), m = c + l.width + s.boxPadding, x =
|
|
269
|
+
}, c = X(a, d, r), m = c + l.width + s.boxPadding, x = Y(Object.values(e.swimlanes), m);
|
|
270
270
|
a.r = c + l.width, a.maxHeight = Math.max(a.maxHeight, l.height), a.height = Math.max(s.swimlaneMinHeight, a.maxHeight) + 2 * s.swimlanePadding;
|
|
271
271
|
const u = {
|
|
272
272
|
x: c,
|
|
@@ -298,7 +298,7 @@ function Y(e, n) {
|
|
|
298
298
|
}
|
|
299
299
|
return h;
|
|
300
300
|
}
|
|
301
|
-
o(
|
|
301
|
+
o(j, "evolveFramePositioned");
|
|
302
302
|
function z(e, n) {
|
|
303
303
|
return e === 0 && n.sourceFrames.length === 0;
|
|
304
304
|
}
|
|
@@ -312,7 +312,7 @@ function k(e, n) {
|
|
|
312
312
|
return e.find((t) => t.frame.name === n.name);
|
|
313
313
|
}
|
|
314
314
|
o(k, "findBoxByFrame");
|
|
315
|
-
function
|
|
315
|
+
function J(e, n, t) {
|
|
316
316
|
if (!(t < 0))
|
|
317
317
|
for (let i = t; i >= 0; i--) {
|
|
318
318
|
const a = e[i];
|
|
@@ -320,8 +320,8 @@ function q(e, n, t) {
|
|
|
320
320
|
return a;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
o(
|
|
324
|
-
function
|
|
323
|
+
o(J, "findBoxByLineIndex");
|
|
324
|
+
function q(e, n) {
|
|
325
325
|
const t = n;
|
|
326
326
|
if (ve(t.frame) || z(t.index, t.frame))
|
|
327
327
|
return [];
|
|
@@ -329,7 +329,7 @@ function Q(e, n) {
|
|
|
329
329
|
if (i === void 0)
|
|
330
330
|
throw new Error(`Target box not found for frame ${t.frame.name}`);
|
|
331
331
|
let a;
|
|
332
|
-
return t.sourceFrame ? a = k(e.boxes, t.sourceFrame) : a =
|
|
332
|
+
return t.sourceFrame ? a = k(e.boxes, t.sourceFrame) : a = J(e.boxes, i.swimlane.index, t.index - 1), a === void 0 ? [] : [{
|
|
333
333
|
$kind: N,
|
|
334
334
|
frame: t.frame,
|
|
335
335
|
index: t.index,
|
|
@@ -337,8 +337,8 @@ function Q(e, n) {
|
|
|
337
337
|
targetBox: i
|
|
338
338
|
}];
|
|
339
339
|
}
|
|
340
|
-
o(
|
|
341
|
-
function
|
|
340
|
+
o(q, "decidePositionRelation");
|
|
341
|
+
function Q(e, n) {
|
|
342
342
|
const t = n, i = {
|
|
343
343
|
visual: {
|
|
344
344
|
fill: "none",
|
|
@@ -360,13 +360,13 @@ function J(e, n) {
|
|
|
360
360
|
relations: [...e.relations, i]
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
o(
|
|
363
|
+
o(Q, "evolveRelationPositioned");
|
|
364
364
|
var Me = {
|
|
365
|
-
[
|
|
366
|
-
[S]:
|
|
365
|
+
[$]: V,
|
|
366
|
+
[S]: q
|
|
367
367
|
}, Be = {
|
|
368
|
-
[D]:
|
|
369
|
-
[N]:
|
|
368
|
+
[D]: j,
|
|
369
|
+
[N]: Q
|
|
370
370
|
};
|
|
371
371
|
function Z(e, n) {
|
|
372
372
|
const t = Me[n.$kind];
|
|
@@ -400,7 +400,7 @@ var F = {
|
|
|
400
400
|
setAccDescription: de,
|
|
401
401
|
setDiagramTitle: se,
|
|
402
402
|
getDiagramTitle: oe,
|
|
403
|
-
setAst:
|
|
403
|
+
setAst: I,
|
|
404
404
|
getDiagramProps: E,
|
|
405
405
|
getState: O
|
|
406
406
|
}, Ee = {
|
|
@@ -408,7 +408,7 @@ var F = {
|
|
|
408
408
|
const n = await be("eventmodeling", e);
|
|
409
409
|
g.debug(n), F.setAst(n), re(n, F);
|
|
410
410
|
}, "parse")
|
|
411
|
-
}, Ae =
|
|
411
|
+
}, Ae = T(), Re = Ae?.eventmodeling;
|
|
412
412
|
function te(e, n) {
|
|
413
413
|
return (t) => {
|
|
414
414
|
const i = t.swimlane.y + n.swimlanePadding, a = e.append("g").attr("class", "em-box");
|
|
@@ -440,22 +440,22 @@ function ae(e, n, t, i) {
|
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
442
|
o(ae, "renderD3Swimlane");
|
|
443
|
-
var
|
|
443
|
+
var Te = /* @__PURE__ */ o(function(e, n, t, i) {
|
|
444
444
|
if (g.debug("in eventmodeling renderer", e + `
|
|
445
445
|
`, "id:", n, t), !Re)
|
|
446
446
|
throw new Error("EventModeling config not found");
|
|
447
|
-
const a = i.db, { themeVariables: r, eventmodeling: d } =
|
|
447
|
+
const a = i.db, { themeVariables: r, eventmodeling: d } = T(), l = ue(`[id="${n}"]`), c = a.getDiagramProps(), m = a.getState(), x = `em-arrowhead-${n}`, u = r.emArrowhead ?? "#000000";
|
|
448
448
|
m.sortedSwimlanesArray.forEach(
|
|
449
449
|
ae(l, m.maxR, c, r)
|
|
450
450
|
), m.boxes.forEach(te(l, c)), m.relations.forEach(ie(l, c, x, r)), l.append("defs").append("marker").attr("id", x).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", u), xe(void 0, l, d?.padding ?? 30, d?.useMaxWidth);
|
|
451
|
-
}, "draw"),
|
|
452
|
-
draw:
|
|
453
|
-
}, De = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = De,
|
|
451
|
+
}, "draw"), $e = {
|
|
452
|
+
draw: Te
|
|
453
|
+
}, De = /* @__PURE__ */ o((e) => "", "getStyles"), Ne = De, We = {
|
|
454
454
|
parser: Ee,
|
|
455
455
|
db: F,
|
|
456
|
-
renderer:
|
|
456
|
+
renderer: $e,
|
|
457
457
|
styles: Ne
|
|
458
458
|
};
|
|
459
459
|
export {
|
|
460
|
-
|
|
460
|
+
We as diagram
|
|
461
461
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("./chunk-JWPE2WC7-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("./chunk-JWPE2WC7-CUBzYD4G.cjs"),i=require("./extractHeadings-DgefF9l1.cjs"),M=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var B="position frame",E="frame positioned",w="position relation",A="relation positioned",ne=i.__name(function(e){i.log.debug("options str",e)},"setOptions"),ie=i.__name(function(){return{}},"getOptions"),ae=i.__name(function(){T(),i.clear()},"clear");function T(){P={}}i.__name(T,"reset");var re=i.defaultConfig_default.eventmodeling,oe=i.__name(()=>i.cleanAndMerge({...re,...i.getConfig().eventmodeling}),"getConfig"),P={};function D(){let e=se;const{ast:n}=P,t=S();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((a,r)=>{const o=I(a,n.dataEntities,t);e=p(e,{$kind:B,index:r,frame:a,textProps:o});let l;X(a)?(i.log.debug("source frame",a.sourceFrames),l=n.frames.filter(d=>a.sourceFrames.some(c=>c.$refText===d.name)),l.forEach(d=>{e=p(e,{$kind:w,index:r,frame:a,sourceFrame:d})})):e=p(e,{$kind:w,index:r,frame:a})}),e={...e,sortedSwimlanesArray:k(e.swimlanes)},e}i.__name(D,"getState");function R(e){P.ast=e}i.__name(R,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function S(){return s}i.__name(S,"getDiagramProps");var se={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function C(e){const n=e.split(".");if(n.length===2)return n[0]}i.__name(C,"extractNamespace");function $(e){const n=e.split(".");return n.length===2?n[1]:e}i.__name($,"extractName");function N(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}i.__name(N,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(a=>{const r=Number.parseInt(a);return r>n&&r<t}).map(a=>Number.parseInt(a)))+1}i.__name(b,"findNextAvailableIndex");function O(e,n){const t=C(e.entityIdentifier),a=N(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return a?{index:a.index,label:a.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return a?{index:a.index,label:a.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return a?{index:a.index,label:a.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}i.__name(O,"calculateSwimlaneProps");function W(e){const{themeVariables:n}=i.getConfig();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}i.__name(W,"calculateEntityVisualProps");function I(e,n,t){const a=i.getConfig(),r=i.sanitizeText($(e.entityIdentifier)??"",a);let o;const l={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${i.wrapLabel(r,t.textMaxWidth,l)}</b>`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf("{")+1),o=o.substring(0,o.lastIndexOf("}")-1),o=i.sanitizeText(o,a),o=i.wrapLabel(o,t.textMaxWidth,l),o=o.replaceAll(" "," ")),e.dataReference){const h=n.find(v=>v.name===e.dataReference?.$refText);h&&(o=h.dataBlockValue,o=o.substring(o.indexOf(`{
|
|
2
2
|
`)+2),o=o.substring(0,o.lastIndexOf("}")-1),o=i.sanitizeText(o,a),o=i.wrapLabel(o,t.textMaxWidth,l),o=o.replaceAll(" "," "),o+="<br/>")}const m=o!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${o}</code>`);const x={fontSize:l.fontSize,fontWeight:l.fontWeight,fontFamily:l.fontFamily},u=i.calculateTextDimensions(c,x),f=m?u.width/3:u.width,g={content:c,width:f,height:u.height};return i.log.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}i.__name(I,"calculateTextProps");function H(e,n){const t=n,a=W(t.frame),r={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:E,frame:t.frame,index:t.index,visual:a,dimension:r,textProps:t.textProps}]}i.__name(H,"decidePositionFrame");function U(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}i.__name(U,"calculateX");function L(e,n){const t=[...e.map(a=>a.r),n];return Math.max(...t)}i.__name(L,"calculateMaxRight");function k(e){return Object.values(e).sort((n,t)=>n.index-t.index)}i.__name(k,"sortedSwimlanesArray");function V(e,n){const t=n,a=O(t.frame,e.swimlanes);let r;a.index in e.swimlanes?r=e.swimlanes[a.index]:r={index:a.index,label:a.label,r:0,y:a.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const o=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,l=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,d={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=U(r,l,o),m=c+d.width+s.boxPadding,x=L(Object.values(e.swimlanes),m);r.r=c+d.width,r.maxHeight=Math.max(r.maxHeight,d.height),r.height=Math.max(s.swimlaneMinHeight,r.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+r.y,r:m,dimension:d,leftSibling:!1,swimlane:r,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},f={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${r.index}`]:r},previousSwimlaneNumber:a.index,previousFrame:t.frame,maxR:x},g=k(f.swimlanes);g.length>0&&(g[0].y=0);for(let h=1;h<g.length;h++){const v=g[h],F=g[h-1];v.y=F.y+F.height+s.swimlaneGap}return f}i.__name(V,"evolveFramePositioned");function G(e,n){return e===0&&n.sourceFrames.length===0}i.__name(G,"isFirstFrame");function X(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}i.__name(X,"hasSourceFrame");function _(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}i.__name(_,"findBoxByFrame");function j(e,n,t){if(!(t<0))for(let a=t;a>=0;a--){const r=e[a];if(r.swimlane.index!==n)return r}}i.__name(j,"findBoxByLineIndex");function Y(e,n){const t=n;if(M.isEmResetFrame(t.frame)||G(t.index,t.frame))return[];const a=_(e.boxes,t.frame);if(a===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let r;return t.sourceFrame?r=_(e.boxes,t.sourceFrame):r=j(e.boxes,a.swimlane.index,t.index-1),r===void 0?[]:[{$kind:A,frame:t.frame,index:t.index,sourceBox:r,targetBox:a}]}i.__name(Y,"decidePositionRelation");function z(e,n){const t=n,a={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,a]}}i.__name(z,"evolveRelationPositioned");var le={[B]:H,[w]:Y},de={[E]:V,[A]:z};function K(e,n){const t=le[n.$kind];if(t==null)return[];const a=t(e,n);return i.log.debug("decided events",a),a}i.__name(K,"decide");function q(e,n){const t=n.reduce((a,r)=>{const o=de[r.$kind];return o==null?a:o(a,r)},e);return i.log.debug("evolve events",{state:e,newState:t,events:n}),t}i.__name(q,"evolve");function p(e,n){const t=K(e,n);return q(e,t)}i.__name(p,"dispatch");var y={getConfig:oe,setOptions:ne,getOptions:ie,clear:ae,setAccTitle:i.setAccTitle,getAccTitle:i.getAccTitle,getAccDescription:i.getAccDescription,setAccDescription:i.setAccDescription,setDiagramTitle:i.setDiagramTitle,getDiagramTitle:i.getDiagramTitle,setAst:R,getDiagramProps:S,getState:D},ce={parse:i.__name(async e=>{const n=await M.parse("eventmodeling",e);i.log.debug(n),y.setAst(n),te.populateCommonDb(n,y)},"parse")},me=i.getConfig2(),ue=me?.eventmodeling;function J(e,n){return t=>{const a=t.swimlane.y+n.swimlanePadding,r=e.append("g").attr("class","em-box");r.append("rect").attr("x",t.x).attr("y",a).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),r.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",a+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}i.__name(J,"renderD3Box");function Q(e,n){return e>n}i.__name(Q,"dirUpwards");function Z(e,n,t,a){return r=>{const o=r.sourceBox.swimlane.y+n.swimlanePadding,l=r.targetBox.swimlane.y+n.swimlanePadding,d=Q(o,l),c=r.sourceBox.x+r.sourceBox.dimension.width*2/3,m=r.targetBox.x+r.targetBox.dimension.width/3;let x,u;i.log.debug(`rendering relation up=${d} for `,{sourceBox:r.sourceBox,targetBox:r.targetBox}),d?(x=o,u=l+r.targetBox.dimension.height):(x=o+r.sourceBox.dimension.height,u=l);const f=a.emRelationStroke??r.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",r.visual.fill).attr("stroke",f).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}i.__name(Z,"renderD3Relation");function ee(e,n,t,a){return r=>{const o=e.append("g").attr("class","em-swimlane"),l=a.emSwimlaneBackgroundOdd??"rgb(250,250,250)",d=a.emSwimlaneBackgroundStroke??"rgb(240,240,240)";o.append("rect").attr("x",0).attr("y",r.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",r.height).attr("fill",l).attr("stroke",d),o.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",r.y+30).text(r.label)}}i.__name(ee,"renderD3Swimlane");var xe=i.__name(function(e,n,t,a){if(i.log.debug("in eventmodeling renderer",e+`
|
|
3
3
|
`,"id:",n,t),!ue)throw new Error("EventModeling config not found");const r=a.db,{themeVariables:o,eventmodeling:l}=i.getConfig2(),d=i.select(`[id="${n}"]`),c=r.getDiagramProps(),m=r.getState(),x=`em-arrowhead-${n}`,u=o.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ee(d,m.maxR,c,o)),m.boxes.forEach(J(d,c)),m.relations.forEach(Z(d,c,x,o)),d.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),i.setupGraphViewbox2(void 0,d,l?.padding??30,l?.useMaxWidth)},"draw"),ge={draw:xe},fe=i.__name(e=>"","getStyles"),he=fe,be={parser:ce,db:y,renderer:ge,styles:he};exports.diagram=be;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("./chunk-JWPE2WC7-5cM5nFf6.cjs"),h=require("./extractHeadings-lDHB2sBb.cjs"),ue=require("./chunk-VR4S4FIN-Cy-2mZJB.cjs"),pe=require("./cynefin-VYW2F7L2-MpAliYy9.cjs"),I=require("./defaultLocale-C4wbwF1n.cjs"),Z=require("./ordinal-CagbB1m8.cjs");function fe(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ge(){return this.eachAfter(fe)}function me(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ye(t,a){for(var l=this,n=[l],r,i,d=-1;l=n.pop();)if(t.call(a,l,++d,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Se(t,a){for(var l=this,n=[l],r=[],i,d,u,y=-1;l=n.pop();)if(r.push(l),i=l.children)for(d=0,u=i.length;d<u;++d)n.push(i[d]);for(;l=r.pop();)t.call(a,l,++y,this);return this}function ve(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function xe(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function be(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function we(t){for(var a=this,l=Ce(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ce(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function Te(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function _e(){return Array.from(this)}function Le(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function $e(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ae(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function K(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ne)):a===void 0&&(a=Me);for(var l=new j(t),n,r=[l],i,d,u,y;n=r.pop();)if((d=a(n.data))&&(y=(d=Array.from(d)).length))for(n.children=d,u=y-1;u>=0;--u)r.push(i=d[u]=new j(d[u])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ve)}function Fe(){return K(this).eachBefore(ke)}function Me(t){return t.children}function Ne(t){return Array.isArray(t)?t[1]:null}function ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=K.prototype={constructor:j,count:ge,each:me,eachAfter:Se,eachBefore:ye,find:ve,sum:xe,sort:be,path:we,ancestors:Te,descendants:_e,leaves:Le,links:$e,copy:Fe,[Symbol.iterator]:Ae};function ze(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Pe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function De(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(n-a)/t.value;++u<y;)d=i[u],d.y0=l,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function Be(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(r-l)/t.value;++u<y;)d=i[u],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var We=(1+Math.sqrt(5))/2;function Ee(t,a,l,n,r,i){for(var d=[],u=a.children,y,c,p=0,w=0,s=u.length,b,v,x=a.value,f,S,F,L,z,E,M;p<s;){b=r-l,v=i-n;do f=u[w++].value;while(!f&&w<s);for(S=F=f,E=Math.max(v/b,b/v)/(x*t),M=f*f*E,z=Math.max(F/M,M/S);w<s;++w){if(f+=c=u[w].value,c<S&&(S=c),c>F&&(F=c),M=f*f*E,L=Math.max(F/M,M/S),L>z){f-=c;break}z=L}d.push(y={value:f,dice:b<v,children:u.slice(p,w)}),y.dice?De(y,l,n,r,x?n+=v*f/x:i):Be(y,l,n,x?l+=b*f/x:r,i),x-=f,p=w}return d}const Re=(function t(a){function l(n,r,i,d,u){Ee(a,n,r,i,d,u)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(We);function He(){var t=Re,a=!1,l=1,n=1,r=[0],i=q,d=q,u=q,y=q,c=q;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(w),r=[0],a&&s.eachBefore(Pe),s}function w(s){var b=r[s.depth],v=s.x0+b,x=s.y0+b,f=s.x1-b,S=s.y1-b;f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),s.x0=v,s.y0=x,s.x1=f,s.y1=S,s.children&&(b=r[s.depth+1]=i(s)/2,v+=c(s)-b,x+=d(s)-b,f-=u(s)-b,S-=y(s)-b,f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),t(s,v,x,f,S))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=ze(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:O(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:O(+s),p):d},p.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:O(+s),p):u},p.paddingBottom=function(s){return arguments.length?(y=typeof s=="function"?s:O(+s),p):y},p.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:O(+s),p):c},p}var W,ne=(W=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=h.setAccTitle,this.getAccTitle=h.getAccTitle,this.setDiagramTitle=h.setDiagramTitle,this.getDiagramTitle=h.getDiagramTitle,this.getAccDescription=h.getAccDescription,this.setAccDescription=h.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=h.defaultConfig_default,l=h.getConfig();return h.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(i=>{h.isLabelStyle(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){h.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},h.__name(W,"TreeMapDB"),W);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}h.__name(le,"buildHierarchy");var Ie=h.__name((t,a)=>{he.populateCommonDb(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const d=i.item;if(!d)continue;const u=i.indent?parseInt(i.indent):0,y=qe(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c:void 0,w={level:u,name:y,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=le(l),r=h.__name((i,d)=>{for(const u of i)a.addNode(u,d),u.children&&u.children.length>0&&r(u.children,d+1)},"addNodesRecursively");r(n,0)},"populate"),qe=h.__name(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:h.__name(async t=>{try{const a=pe.parse,l=await a("treemap",t);h.log.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ie(l,n)}catch(a){throw h.log.error("Error parsing treemap:",a),a}},"parse")},Oe=10,B=10,G=25,Ge=h.__name((t,a,l,n)=>{const r=n.db,i=r.getConfig(),d=i.padding??Oe,u=r.getDiagramTitle(),y=r.getRoot(),{themeVariables:c}=h.getConfig();if(!y)return;const p=u?30:0,w=h.selectSvgElement(a),s=i.nodeWidth?i.nodeWidth*B:960,b=i.nodeHeight?i.nodeHeight*B:500,v=s,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),h.configureSvgSize(w,x,v,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=h.__name(o=>"$"+I.format(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),g=o?o[0]:"";f=h.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);f=h.__name(g=>"$"+I.format(o||"")(g),"valueFormat")}else f=I.format(e)}catch(e){h.log.error("Error creating format function:",e),f=I.format(",")}const S=Z.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),F=Z.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),L=Z.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);u&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),E=K(y).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),Q=He().size([s,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=Q.descendants().filter(e=>e.children&&e.children.length>0),R=z.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>S(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>F(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=h.select(this),g=e.data.name;o.text(g);const C=e.x1-e.x0,_=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-_:T=C-_-6;const m=Math.max(15,T),N=o.node();if(N.getComputedTextLength()>m){let V=g;for(;V.length>0;){if(V=g.substring(0,V.length-1),V.length===0){o.text("..."),N.getComputedTextLength()>m&&o.text("");break}if(o.text(V+"..."),N.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")});const ee=Q.leaves(),$=ee.length>20,ie=$?16:38,X=$?14:28,P=$?4:8,H=$?4:6,J=$?2:4,te=$?8:10,U=$?1:2,Y=z.selectAll(".treemapLeafGroup").data(ee).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("style",e=>h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ie}px;fill:`+L(e.data.name)+";",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=h.select(this),g=e.x1-e.x0,C=e.y1-e.y0,_=o.node(),T=g-2*J,D=C-2*J;if(T<te||D<te){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const N=.6;for(;_.getComputedTextLength()>T&&m>P;)m--,o.style("font-size",`${m}px`);let A=Math.max(H,Math.min(X,Math.round(m*N))),k=m+U+A;for(;k>D&&m>P&&(m--,A=Math.max(H,Math.min(X,Math.round(m*N))),!(A<H&&m===P));)o.style("font-size",`${m}px`),k=m+U+A;o.style("font-size",`${m}px`),$?(m<P||D<P)&&o.style("display","none"):(_.getComputedTextLength()>T||m<P||D<m)&&o.style("display","none")}),i.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const g=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+L(o.data.name)+";",C=h.styles2String({cssCompiledStyles:o.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,g)=>`url(#clip-${a}-${g})`).text(o=>o.value?f(o.value):"").each(function(o){const g=h.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const _=h.select(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){g.style("display","none");return}const T=parseFloat(_.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));g.style("font-size",`${m}px`);const A=(o.y1-o.y0)/2+T/2+U;g.attr("y",A);const k=o.x1-o.x0,ae=o.y1-o.y0-4,de=k-2*J;g.node().getComputedTextLength()>de||A+m>ae||m<H?g.style("display","none"):g.style("display",null)});const oe=i.diagramPadding??8;ue.setupViewPortForSVG(w,oe,"flowchart",i?.useMaxWidth||!1)},"draw"),Xe=h.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ye={draw:Ge,getClasses:Xe},je={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Je=h.__name(({treemap:t}={})=>{const a=h.getThemeVariables3(),l=h.getConfig(),n=h.cleanAndMerge(a,l.themeVariables),r=h.cleanAndMerge(je,t),i=r.titleColor??n.titleColor,d=r.labelColor??n.textColor,u=r.valueColor??n.textColor;return`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("./chunk-JWPE2WC7-CUBzYD4G.cjs"),h=require("./extractHeadings-DgefF9l1.cjs"),ue=require("./chunk-VR4S4FIN-Cc4GDi2Z.cjs"),pe=require("./cynefin-VYW2F7L2-MpAliYy9.cjs"),I=require("./defaultLocale-C4wbwF1n.cjs"),Z=require("./ordinal-CagbB1m8.cjs");function fe(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function ge(){return this.eachAfter(fe)}function me(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function ye(t,a){for(var l=this,n=[l],r,i,d=-1;l=n.pop();)if(t.call(a,l,++d,this),r=l.children)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Se(t,a){for(var l=this,n=[l],r=[],i,d,u,y=-1;l=n.pop();)if(r.push(l),i=l.children)for(d=0,u=i.length;d<u;++d)n.push(i[d]);for(;l=r.pop();)t.call(a,l,++y,this);return this}function ve(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function xe(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,r=n&&n.length;--r>=0;)l+=n[r].value;a.value=l})}function be(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function we(t){for(var a=this,l=Ce(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var r=n.length;t!==l;)n.splice(r,0,t),t=t.parent;return n}function Ce(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),r=null;for(t=l.pop(),a=n.pop();t===a;)r=t,t=l.pop(),a=n.pop();return r}function Te(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function _e(){return Array.from(this)}function Le(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function $e(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ae(){var t=this,a,l=[t],n,r,i;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)l.push(n[r]);while(l.length)}function K(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ne)):a===void 0&&(a=Me);for(var l=new j(t),n,r=[l],i,d,u,y;n=r.pop();)if((d=a(n.data))&&(y=(d=Array.from(d)).length))for(n.children=d,u=y-1;u>=0;--u)r.push(i=d[u]=new j(d[u])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Ve)}function Fe(){return K(this).eachBefore(ke)}function Me(t){return t.children}function Ne(t){return Array.isArray(t)?t[1]:null}function ke(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=K.prototype={constructor:j,count:ge,each:me,eachAfter:Se,eachBefore:ye,find:ve,sum:xe,sort:be,path:we,ancestors:Te,descendants:_e,leaves:Le,links:$e,copy:Fe,[Symbol.iterator]:Ae};function ze(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Pe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function De(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(n-a)/t.value;++u<y;)d=i[u],d.y0=l,d.y1=r,d.x0=a,d.x1=a+=d.value*c}function Be(t,a,l,n,r){for(var i=t.children,d,u=-1,y=i.length,c=t.value&&(r-l)/t.value;++u<y;)d=i[u],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var We=(1+Math.sqrt(5))/2;function Ee(t,a,l,n,r,i){for(var d=[],u=a.children,y,c,p=0,w=0,s=u.length,b,v,x=a.value,f,S,F,L,z,E,M;p<s;){b=r-l,v=i-n;do f=u[w++].value;while(!f&&w<s);for(S=F=f,E=Math.max(v/b,b/v)/(x*t),M=f*f*E,z=Math.max(F/M,M/S);w<s;++w){if(f+=c=u[w].value,c<S&&(S=c),c>F&&(F=c),M=f*f*E,L=Math.max(F/M,M/S),L>z){f-=c;break}z=L}d.push(y={value:f,dice:b<v,children:u.slice(p,w)}),y.dice?De(y,l,n,r,x?n+=v*f/x:i):Be(y,l,n,x?l+=b*f/x:r,i),x-=f,p=w}return d}const Re=(function t(a){function l(n,r,i,d,u){Ee(a,n,r,i,d,u)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(We);function He(){var t=Re,a=!1,l=1,n=1,r=[0],i=q,d=q,u=q,y=q,c=q;function p(s){return s.x0=s.y0=0,s.x1=l,s.y1=n,s.eachBefore(w),r=[0],a&&s.eachBefore(Pe),s}function w(s){var b=r[s.depth],v=s.x0+b,x=s.y0+b,f=s.x1-b,S=s.y1-b;f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),s.x0=v,s.y0=x,s.x1=f,s.y1=S,s.children&&(b=r[s.depth+1]=i(s)/2,v+=c(s)-b,x+=d(s)-b,f-=u(s)-b,S-=y(s)-b,f<v&&(v=f=(v+f)/2),S<x&&(x=S=(x+S)/2),t(s,v,x,f,S))}return p.round=function(s){return arguments.length?(a=!!s,p):a},p.size=function(s){return arguments.length?(l=+s[0],n=+s[1],p):[l,n]},p.tile=function(s){return arguments.length?(t=ze(s),p):t},p.padding=function(s){return arguments.length?p.paddingInner(s).paddingOuter(s):p.paddingInner()},p.paddingInner=function(s){return arguments.length?(i=typeof s=="function"?s:O(+s),p):i},p.paddingOuter=function(s){return arguments.length?p.paddingTop(s).paddingRight(s).paddingBottom(s).paddingLeft(s):p.paddingTop()},p.paddingTop=function(s){return arguments.length?(d=typeof s=="function"?s:O(+s),p):d},p.paddingRight=function(s){return arguments.length?(u=typeof s=="function"?s:O(+s),p):u},p.paddingBottom=function(s){return arguments.length?(y=typeof s=="function"?s:O(+s),p):y},p.paddingLeft=function(s){return arguments.length?(c=typeof s=="function"?s:O(+s),p):c},p}var W,ne=(W=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=h.setAccTitle,this.getAccTitle=h.getAccTitle,this.setDiagramTitle=h.setDiagramTitle,this.getDiagramTitle=h.getDiagramTitle,this.getAccDescription=h.getAccDescription,this.setAccDescription=h.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=h.defaultConfig_default,l=h.getConfig();return h.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},r=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(i=>{h.isLabelStyle(i)&&(n?.textStyles?n.textStyles.push(i):n.textStyles=[i]),n?.styles?n.styles.push(i):n.styles=[i]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){h.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},h.__name(W,"TreeMapDB"),W);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const r={name:n.name,children:n.type==="Leaf"?void 0:[]};for(r.classSelector=n?.classSelector,n?.cssCompiledStyles&&(r.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(r.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(r);else{const i=l[l.length-1].node;i.children?i.children.push(r):i.children=[r]}n.type!=="Leaf"&&l.push({node:r,level:n.level})}),a}h.__name(le,"buildHierarchy");var Ie=h.__name((t,a)=>{he.populateCommonDb(t,a);const l=[];for(const i of t.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of t.TreemapRows??[]){const d=i.item;if(!d)continue;const u=i.indent?parseInt(i.indent):0,y=qe(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c:void 0,w={level:u,name:y,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=le(l),r=h.__name((i,d)=>{for(const u of i)a.addNode(u,d),u.children&&u.children.length>0&&r(u.children,d+1)},"addNodesRecursively");r(n,0)},"populate"),qe=h.__name(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:h.__name(async t=>{try{const a=pe.parse,l=await a("treemap",t);h.log.debug("Treemap AST:",l);const n=re.parser?.yy;if(!(n instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ie(l,n)}catch(a){throw h.log.error("Error parsing treemap:",a),a}},"parse")},Oe=10,B=10,G=25,Ge=h.__name((t,a,l,n)=>{const r=n.db,i=r.getConfig(),d=i.padding??Oe,u=r.getDiagramTitle(),y=r.getRoot(),{themeVariables:c}=h.getConfig();if(!y)return;const p=u?30:0,w=h.selectSvgElement(a),s=i.nodeWidth?i.nodeWidth*B:960,b=i.nodeHeight?i.nodeHeight*B:500,v=s,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),h.configureSvgSize(w,x,v,i.useMaxWidth);let f;try{const e=i.valueFormat||",";if(e==="$0,0")f=h.__name(o=>"$"+I.format(",")(o),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const o=/\.\d+/.exec(e),g=o?o[0]:"";f=h.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const o=e.substring(1);f=h.__name(g=>"$"+I.format(o||"")(g),"valueFormat")}else f=I.format(e)}catch(e){h.log.error("Error creating format function:",e),f=I.format(",")}const S=Z.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),F=Z.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),L=Z.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);u&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(u);const z=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),E=K(y).sum(e=>e.value??0).sort((e,o)=>(o.value??0)-(e.value??0)),Q=He().size([s,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=Q.descendants().filter(e=>e.children&&e.children.length>0),R=z.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),R.append("clipPath").attr("id",(e,o)=>`clip-section-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),R.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,o)=>`treemapSection section${o}`).attr("fill",e=>S(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>F(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const o=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o.nodeStyles+";"+o.borderStyles.join(";")}),R.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,o)=>`url(#clip-section-${a}-${o})`).attr("style",e=>{if(e.depth===0)return"display: none;";const o="dominant-baseline: middle; font-size: 12px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const o=h.select(this),g=e.data.name;o.text(g);const C=e.x1-e.x0,_=6;let T;i.showValues!==!1&&e.value?T=C-10-30-10-_:T=C-_-6;const m=Math.max(15,T),N=o.node();if(N.getComputedTextLength()>m){let V=g;for(;V.length>0;){if(V=g.substring(0,V.length-1),V.length===0){o.text("..."),N.getComputedTextLength()>m&&o.text("");break}if(o.text(V+"..."),N.getComputedTextLength()<=m)break}}}),i.showValues!==!1&&R.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const o="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+L(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")});const ee=Q.leaves(),$=ee.length>20,ie=$?16:38,X=$?14:28,P=$?4:8,H=$?4:6,J=$?2:4,te=$?8:10,U=$?1:2,Y=z.selectAll(".treemapLeafGroup").data(ee).enter().append("g").attr("class",(e,o)=>`treemapNode treemapLeafGroup leaf${o}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("style",e=>h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?S(e.parent.data.name):S(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,o)=>`clip-${a}-${o}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const o=`text-anchor: middle; dominant-baseline: middle; font-size: ${ie}px;fill:`+L(e.data.name)+";",g=h.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return o+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,o)=>`url(#clip-${a}-${o})`).text(e=>e.data.name).each(function(e){const o=h.select(this),g=e.x1-e.x0,C=e.y1-e.y0,_=o.node(),T=g-2*J,D=C-2*J;if(T<te||D<te){o.style("display","none");return}let m=parseInt(o.style("font-size"),10);const N=.6;for(;_.getComputedTextLength()>T&&m>P;)m--,o.style("font-size",`${m}px`);let A=Math.max(H,Math.min(X,Math.round(m*N))),k=m+U+A;for(;k>D&&m>P&&(m--,A=Math.max(H,Math.min(X,Math.round(m*N))),!(A<H&&m===P));)o.style("font-size",`${m}px`),k=m+U+A;o.style("font-size",`${m}px`),$?(m<P||D<P)&&o.style("display","none"):(_.getComputedTextLength()>T||m<P||D<m)&&o.style("display","none")}),i.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",o=>(o.x1-o.x0)/2).attr("y",function(o){return(o.y1-o.y0)/2}).attr("style",o=>{const g=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+L(o.data.name)+";",C=h.styles2String({cssCompiledStyles:o.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(o,g)=>`url(#clip-${a}-${g})`).text(o=>o.value?f(o.value):"").each(function(o){const g=h.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const _=h.select(C).select(".treemapLabel");if(_.empty()||_.style("display")==="none"){g.style("display","none");return}const T=parseFloat(_.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));g.style("font-size",`${m}px`);const A=(o.y1-o.y0)/2+T/2+U;g.attr("y",A);const k=o.x1-o.x0,ae=o.y1-o.y0-4,de=k-2*J;g.node().getComputedTextLength()>de||A+m>ae||m<H?g.style("display","none"):g.style("display",null)});const oe=i.diagramPadding??8;ue.setupViewPortForSVG(w,oe,"flowchart",i?.useMaxWidth||!1)},"draw"),Xe=h.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ye={draw:Ge,getClasses:Xe},je={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Je=h.__name(({treemap:t}={})=>{const a=h.getThemeVariables3(),l=h.getConfig(),n=h.cleanAndMerge(a,l.themeVariables),r=h.cleanAndMerge(je,t),i=r.titleColor??n.titleColor,d=r.labelColor??n.textColor,u=r.valueColor??n.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${r.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${r.sectionStrokeWidth};
|