@pb33f/cowboy-components 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/{_baseUniq-CcG8uZM_.js → _baseUniq-DkvmJCFv.js} +1 -1
  2. package/dist/{_baseUniq-Co8RB71y.cjs → _baseUniq-FTe2FRsZ.cjs} +1 -1
  3. package/dist/{arc-CZ9OyfV-.js → arc-CYzOnlSi.js} +2 -2
  4. package/dist/{arc-D5LG9aVl.cjs → arc-tHE-eDC1.cjs} +1 -1
  5. package/dist/{architecture-YZFGNWBL-ne59NWt0.js → architecture-YZFGNWBL-CHrkvOqY.js} +1 -1
  6. package/dist/{architecture-YZFGNWBL-CuyaOcgJ.cjs → architecture-YZFGNWBL-CoFOgOkv.cjs} +1 -1
  7. package/dist/{architectureDiagram-Q4EWVU46-CxErVIKm.cjs → architectureDiagram-Q4EWVU46-BNgO6IDb.cjs} +1 -1
  8. package/dist/{architectureDiagram-Q4EWVU46-ibaXfmmT.js → architectureDiagram-Q4EWVU46-BlVPlre4.js} +4 -4
  9. package/dist/{blockDiagram-DXYQGD6D-D5vqojm8.js → blockDiagram-DXYQGD6D-CmuWyVpp.js} +6 -6
  10. package/dist/{blockDiagram-DXYQGD6D-iFIpSW7Y.cjs → blockDiagram-DXYQGD6D-DTH4brTo.cjs} +1 -1
  11. package/dist/{c4Diagram-AHTNJAMY-B7t5p6jA.js → c4Diagram-AHTNJAMY-Bd457Kk0.js} +2 -2
  12. package/dist/{c4Diagram-AHTNJAMY-Av_INk2v.cjs → c4Diagram-AHTNJAMY-D4IMO6iJ.cjs} +1 -1
  13. package/dist/{change-list-item-Bu_mPv-k.js → change-list-item-BRSBlaLu.js} +348 -350
  14. package/dist/{change-list-item-4xBSo3-U.cjs → change-list-item-Dy1GNFQ8.cjs} +91 -91
  15. package/dist/{channel-DO31wbvk.cjs → channel-Ct_j6JZf.cjs} +1 -1
  16. package/dist/{channel-BvR-WhLo.js → channel-rcMAVtNO.js} +1 -1
  17. package/dist/{chunk-4BX2VUAB-DHdTrTTD.cjs → chunk-4BX2VUAB-D4UkiLWV.cjs} +1 -1
  18. package/dist/{chunk-4BX2VUAB-DQ4rU_AZ.js → chunk-4BX2VUAB-XJuJGw_Z.js} +1 -1
  19. package/dist/{chunk-4TB4RGXK-BlskfrH8.cjs → chunk-4TB4RGXK-BxahB5gv.cjs} +1 -1
  20. package/dist/{chunk-4TB4RGXK-BK_uuzSP.js → chunk-4TB4RGXK-CnipwGVI.js} +5 -5
  21. package/dist/{chunk-55IACEB6-CRJ5yCrP.cjs → chunk-55IACEB6-CEDZ87Yr.cjs} +1 -1
  22. package/dist/{chunk-55IACEB6-BauZDeFH.js → chunk-55IACEB6-D2v5xo07.js} +1 -1
  23. package/dist/{chunk-EDXVE4YY-BrlRuHp3.cjs → chunk-EDXVE4YY-CP7pBxXD.cjs} +1 -1
  24. package/dist/{chunk-EDXVE4YY-DPpXfrr8.js → chunk-EDXVE4YY-DtZEtPNM.js} +1 -1
  25. package/dist/{chunk-FMBD7UC4-CtyzUnzx.js → chunk-FMBD7UC4-B2FUllsE.js} +1 -1
  26. package/dist/{chunk-FMBD7UC4-0x38b8wg.cjs → chunk-FMBD7UC4-slHNYrdA.cjs} +1 -1
  27. package/dist/{chunk-OYMX7WX6-U53KZXxw.js → chunk-OYMX7WX6-Cx27mmAN.js} +3 -3
  28. package/dist/{chunk-OYMX7WX6-DU4Zqa7r.cjs → chunk-OYMX7WX6-j5BWPw4q.cjs} +1 -1
  29. package/dist/{chunk-QZHKN3VN-Dyhr8mWm.cjs → chunk-QZHKN3VN-CfbDcaIZ.cjs} +1 -1
  30. package/dist/{chunk-QZHKN3VN-BhntY1rB.js → chunk-QZHKN3VN-CxT_HDdj.js} +1 -1
  31. package/dist/{chunk-YZCP3GAM-B_2rYHHe.cjs → chunk-YZCP3GAM-C2IM6BuV.cjs} +1 -1
  32. package/dist/{chunk-YZCP3GAM--UtgfYoK.js → chunk-YZCP3GAM-DpgFVAJS.js} +1 -1
  33. package/dist/{classDiagram-6PBFFD2Q-w916JDya.cjs → classDiagram-6PBFFD2Q-BJp1AGm6.cjs} +1 -1
  34. package/dist/{classDiagram-v2-HSJHXN6E-DX5nDbg5.js → classDiagram-6PBFFD2Q-CEDs-xzV.js} +2 -2
  35. package/dist/{classDiagram-v2-HSJHXN6E-w916JDya.cjs → classDiagram-v2-HSJHXN6E-BJp1AGm6.cjs} +1 -1
  36. package/dist/{classDiagram-6PBFFD2Q-DX5nDbg5.js → classDiagram-v2-HSJHXN6E-CEDs-xzV.js} +2 -2
  37. package/dist/{clone-DFz4YXr3.js → clone-BYMmv0vr.js} +1 -1
  38. package/dist/clone-CMeAJ3XK.cjs +1 -0
  39. package/dist/components/bundle-toolbar/bundle-toolbar.d.ts +0 -1
  40. package/dist/components/bundle-toolbar/bundle-toolbar.js +1 -3
  41. package/dist/components/editor/editor.js +114 -18
  42. package/dist/components/premium-gate/premium-gate.d.ts +1 -0
  43. package/dist/components/premium-gate/premium-gate.js +6 -0
  44. package/dist/components/rodeo/roundup.d.ts +7 -0
  45. package/dist/components/rodeo/roundup.js +40 -0
  46. package/dist/components/rodeo/user-detail.js +6 -3
  47. package/dist/components/the-doctor/doctor-editor-panel.css.js +67 -30
  48. package/dist/components/the-doctor/doctor-editor-panel.d.ts +1 -0
  49. package/dist/components/the-doctor/doctor-editor-panel.js +9 -1
  50. package/dist/components/the-doctor/doctor-navigator-panel.css.js +1 -0
  51. package/dist/components/the-doctor/doctor-sidebar-panel.d.ts +4 -1
  52. package/dist/components/the-doctor/doctor-sidebar-panel.js +18 -3
  53. package/dist/components/the-doctor/printing-press-docs-unavailable.css.d.ts +2 -0
  54. package/dist/components/the-doctor/printing-press-docs-unavailable.css.js +34 -0
  55. package/dist/components/the-doctor/printing-press-docs-unavailable.d.ts +12 -0
  56. package/dist/components/the-doctor/printing-press-docs-unavailable.js +35 -0
  57. package/dist/components/the-doctor/printing-press-export-controls.css.d.ts +2 -0
  58. package/dist/components/the-doctor/printing-press-export-controls.css.js +26 -0
  59. package/dist/components/the-doctor/printing-press-export-controls.d.ts +16 -0
  60. package/dist/components/the-doctor/printing-press-export-controls.js +75 -0
  61. package/dist/components/the-doctor/the-doctor.css.js +148 -8
  62. package/dist/components/the-doctor/the-doctor.d.ts +52 -2
  63. package/dist/components/the-doctor/the-doctor.js +581 -23
  64. package/dist/components/workspaces/workspace-view.d.ts +1 -5
  65. package/dist/components/workspaces/workspace-view.js +4 -11
  66. package/dist/controllers/diagnostic-controller.d.ts +2 -0
  67. package/dist/controllers/diagnostic-controller.js +40 -1
  68. package/dist/controllers/node-clicker-controller.d.ts +2 -3
  69. package/dist/controllers/spec-controller.js +1 -1
  70. package/dist/controllers/workspace-controller.d.ts +1 -2
  71. package/dist/controllers/workspace-controller.js +2 -2
  72. package/dist/{cose-bilkent-S5V4N54A-DcUKlxlF.js → cose-bilkent-S5V4N54A-8KG9LqBY.js} +2 -2
  73. package/dist/{cose-bilkent-S5V4N54A-CKHB3cR8.cjs → cose-bilkent-S5V4N54A-Tlz_fqGx.cjs} +1 -1
  74. package/dist/{cowboy-components-CxawaKWM.js → cowboy-components-CPx4P290.js} +12249 -12616
  75. package/dist/{cowboy-components-CjgqXqkM.cjs → cowboy-components-DDfCPnUY.cjs} +1349 -1473
  76. package/dist/{dagre-KV5264BT-B2JWO01l.cjs → dagre-KV5264BT-DPqcbQdq.cjs} +1 -1
  77. package/dist/{dagre-KV5264BT-Nl_VfI8a.js → dagre-KV5264BT-DSCWDkcl.js} +5 -5
  78. package/dist/{diagram-5BDNPKRD-TI1X3fNz.js → diagram-5BDNPKRD-D-Y0PkPP.js} +4 -4
  79. package/dist/{diagram-5BDNPKRD-BKI_3vWy.cjs → diagram-5BDNPKRD-Ioi_2Lul.cjs} +1 -1
  80. package/dist/{diagram-G4DWMVQ6-DFBdN4sf.cjs → diagram-G4DWMVQ6-BRmyn8WA.cjs} +1 -1
  81. package/dist/{diagram-G4DWMVQ6-CFqOAmuK.js → diagram-G4DWMVQ6-Cl1WmwJV.js} +4 -4
  82. package/dist/{diagram-MMDJMWI5-CFuTCrVQ.cjs → diagram-MMDJMWI5-CTASKErj.cjs} +1 -1
  83. package/dist/{diagram-MMDJMWI5-BSsV2xaN.js → diagram-MMDJMWI5-vq4gDD7H.js} +3 -3
  84. package/dist/{diagram-TYMM5635-CrgW2ZZO.cjs → diagram-TYMM5635-DEnqo3aX.cjs} +1 -1
  85. package/dist/{diagram-TYMM5635-BP1f-EB_.js → diagram-TYMM5635-DSUFes5l.js} +3 -3
  86. package/dist/{erDiagram-SMLLAGMA-rVfyZdO4.js → erDiagram-SMLLAGMA-BiPGCCxs.js} +4 -4
  87. package/dist/{erDiagram-SMLLAGMA-C3caLNRz.cjs → erDiagram-SMLLAGMA-CyaiSIV2.cjs} +1 -1
  88. package/dist/events/doctor.d.ts +2 -0
  89. package/dist/events/doctor.js +2 -0
  90. package/dist/{flowDiagram-DWJPFMVM-Ce_HVRt5.cjs → flowDiagram-DWJPFMVM-Bqf8cwLG.cjs} +1 -1
  91. package/dist/{flowDiagram-DWJPFMVM-DqFXC8zL.js → flowDiagram-DWJPFMVM-C9rhk5uL.js} +6 -6
  92. package/dist/{ganttDiagram-T4ZO3ILL-BmNOX7yf.js → ganttDiagram-T4ZO3ILL-BP9h2UTv.js} +3 -3
  93. package/dist/{ganttDiagram-T4ZO3ILL-HHFgf8w4.cjs → ganttDiagram-T4ZO3ILL-DaR_t9rW.cjs} +1 -1
  94. package/dist/{gitGraph-7Q5UKJZL-kCDkIMWc.js → gitGraph-7Q5UKJZL-CHmm38gX.js} +1 -1
  95. package/dist/{gitGraph-7Q5UKJZL-DgndfdDH.cjs → gitGraph-7Q5UKJZL-DytqCQiv.cjs} +1 -1
  96. package/dist/{gitGraphDiagram-UUTBAWPF-DaVjvjth.cjs → gitGraphDiagram-UUTBAWPF-BGuOUavm.cjs} +1 -1
  97. package/dist/{gitGraphDiagram-UUTBAWPF-C-Ahhj_h.js → gitGraphDiagram-UUTBAWPF-ecgG5qHi.js} +4 -4
  98. package/dist/{graph-Dfys1tzR.js → graph-Bv4HICS-.js} +2 -2
  99. package/dist/{graph-DyZUkQBU.cjs → graph-DpFK38bp.cjs} +1 -1
  100. package/dist/{info-OMHHGYJF-Cb_sFFZS.cjs → info-OMHHGYJF-CUIG00cp.cjs} +1 -1
  101. package/dist/info-OMHHGYJF-CoTbguMJ.js +5 -0
  102. package/dist/{infoDiagram-42DDH7IO-BP_YOQpC.js → infoDiagram-42DDH7IO--5_30AyR.js} +2 -2
  103. package/dist/{infoDiagram-42DDH7IO-C09CiT2v.cjs → infoDiagram-42DDH7IO-CuAPDz-b.cjs} +1 -1
  104. package/dist/interfaces/doctor-interfaces.d.ts +10 -2
  105. package/dist/{ishikawaDiagram-UXIWVN3A-CjAoGU0v.cjs → ishikawaDiagram-UXIWVN3A-B8zjZXR2.cjs} +1 -1
  106. package/dist/{ishikawaDiagram-UXIWVN3A-DwW6fn0e.js → ishikawaDiagram-UXIWVN3A-BVoGYP0J.js} +1 -1
  107. package/dist/{journeyDiagram-VCZTEJTY-Bk7z4VA2.js → journeyDiagram-VCZTEJTY-CmQ65Rzd.js} +4 -4
  108. package/dist/{journeyDiagram-VCZTEJTY-CZnSwt6p.cjs → journeyDiagram-VCZTEJTY-Cs5uPgLz.cjs} +1 -1
  109. package/dist/{kanban-definition-6JOO6SKY-BiN4nM1i.js → kanban-definition-6JOO6SKY-BUllH7Pr.js} +2 -2
  110. package/dist/{kanban-definition-6JOO6SKY-DZF8xgYV.cjs → kanban-definition-6JOO6SKY-Bpd9pm1_.cjs} +1 -1
  111. package/dist/{layout-BDanDonD.js → layout-B93j_9jn.js} +4 -4
  112. package/dist/{layout-rTQtAIwn.cjs → layout-zdFgePaJ.cjs} +1 -1
  113. package/dist/{linear-CuHSYSeN.cjs → linear-D1T5mBBn.cjs} +1 -1
  114. package/dist/{linear-DFB2dCGq.js → linear-EAwz3euQ.js} +1 -1
  115. package/dist/{mermaid-parser.core-CCHvxUQl.js → mermaid-parser.core-D4IlYn7u.js} +13 -13
  116. package/dist/{mermaid-parser.core-fjh_cn2l.cjs → mermaid-parser.core-S6P-fvNi.cjs} +2 -2
  117. package/dist/{min-rDRC9KDF.js → min-BcEbrjrR.js} +2 -2
  118. package/dist/{min-h6fs1hPk.cjs → min-Cp2y5NY5.cjs} +1 -1
  119. package/dist/{mindmap-definition-QFDTVHPH-CZMHHnKO.js → mindmap-definition-QFDTVHPH-CZXaWtPo.js} +3 -3
  120. package/dist/{mindmap-definition-QFDTVHPH-BbUJ3LHd.cjs → mindmap-definition-QFDTVHPH-CkLdkLZi.cjs} +1 -1
  121. package/dist/model/api-response.d.ts +1 -0
  122. package/dist/model/feature-flags.d.ts +1 -0
  123. package/dist/model/feature-flags.js +1 -0
  124. package/dist/model/roundup-stats.d.ts +7 -0
  125. package/dist/{packet-4T2RLAQJ-BRTuQgpj.cjs → packet-4T2RLAQJ-CWdQm1p_.cjs} +1 -1
  126. package/dist/{packet-4T2RLAQJ-Bl5gBk4Q.js → packet-4T2RLAQJ-CqUj6pUH.js} +1 -1
  127. package/dist/pie-ZZUOXDRM-Dt-GliGo.js +5 -0
  128. package/dist/{pie-ZZUOXDRM-BbZyrtOg.cjs → pie-ZZUOXDRM-DxRGMKj-.cjs} +1 -1
  129. package/dist/{pieDiagram-DEJITSTG-BpiMiYGL.cjs → pieDiagram-DEJITSTG-CeFtWjEL.cjs} +1 -1
  130. package/dist/{pieDiagram-DEJITSTG-BNTE6R98.js → pieDiagram-DEJITSTG-DF8iOEQ1.js} +5 -5
  131. package/dist/{quadrantDiagram-34T5L4WZ-JjtOrhxB.js → quadrantDiagram-34T5L4WZ-DIrQ_CoV.js} +2 -2
  132. package/dist/{quadrantDiagram-34T5L4WZ-DODOOGae.cjs → quadrantDiagram-34T5L4WZ-DbENKFQB.cjs} +1 -1
  133. package/dist/radar-PYXPWWZC-B0qn40ys.js +5 -0
  134. package/dist/{radar-PYXPWWZC-CSH1N71W.cjs → radar-PYXPWWZC-DbQi3NfV.cjs} +1 -1
  135. package/dist/{requirementDiagram-MS252O5E-CwV2UGNb.js → requirementDiagram-MS252O5E-BmJ9tgw2.js} +3 -3
  136. package/dist/{requirementDiagram-MS252O5E-CjMpy00l.cjs → requirementDiagram-MS252O5E-CmwBghn1.cjs} +1 -1
  137. package/dist/{sankeyDiagram-XADWPNL6-rri4GWAM.js → sankeyDiagram-XADWPNL6-D6nKYWbU.js} +1 -1
  138. package/dist/{sankeyDiagram-XADWPNL6-BzayPzy0.cjs → sankeyDiagram-XADWPNL6-_NTd9nNm.cjs} +1 -1
  139. package/dist/{sequenceDiagram-FGHM5R23-D-YegsL-.cjs → sequenceDiagram-FGHM5R23-DvARbSg3.cjs} +1 -1
  140. package/dist/{sequenceDiagram-FGHM5R23-BwBriXF1.js → sequenceDiagram-FGHM5R23-gj6-9UEl.js} +3 -3
  141. package/dist/services/linting-service.d.ts +1 -0
  142. package/dist/services/linting-service.js +3 -0
  143. package/dist/services/printing-press-service.d.ts +27 -0
  144. package/dist/services/printing-press-service.js +125 -0
  145. package/dist/{stateDiagram-FHFEXIEX-jfwjGp1O.js → stateDiagram-FHFEXIEX-CDfhkt5o.js} +5 -5
  146. package/dist/{stateDiagram-FHFEXIEX-Cq2H2XQO.cjs → stateDiagram-FHFEXIEX-CUoMK5qv.cjs} +1 -1
  147. package/dist/{stateDiagram-v2-QKLJ7IA2-Bw4Xgr7w.js → stateDiagram-v2-QKLJ7IA2-DiPwdbAK.js} +2 -2
  148. package/dist/{stateDiagram-v2-QKLJ7IA2-DKL73VEs.cjs → stateDiagram-v2-QKLJ7IA2-DkUny04G.cjs} +1 -1
  149. package/dist/{timeline-definition-GMOUNBTQ-CpABxKM5.js → timeline-definition-GMOUNBTQ-GxzCrHrx.js} +2 -2
  150. package/dist/{timeline-definition-GMOUNBTQ-DP1yCayj.cjs → timeline-definition-GMOUNBTQ-bpnHyBjo.cjs} +1 -1
  151. package/dist/{treeView-SZITEDCU-BtaLEQ3S.js → treeView-SZITEDCU-DIrUF69A.js} +1 -1
  152. package/dist/{treeView-SZITEDCU-BizNBkAv.cjs → treeView-SZITEDCU-zJeBKhxU.cjs} +1 -1
  153. package/dist/{treemap-W4RFUUIX-Cbbx2tbB.cjs → treemap-W4RFUUIX-DIVItjGt.cjs} +1 -1
  154. package/dist/{treemap-W4RFUUIX-CmVVUeZj.js → treemap-W4RFUUIX-De3UvqNM.js} +1 -1
  155. package/dist/{vennDiagram-DHZGUBPP-C0edoxsg.js → vennDiagram-DHZGUBPP-C8gJOl_U.js} +1 -1
  156. package/dist/{vennDiagram-DHZGUBPP-Dv3ZX8SJ.cjs → vennDiagram-DHZGUBPP-CPciBxaz.cjs} +1 -1
  157. package/dist/{wardley-RL74JXVD-DdQvN9q5.js → wardley-RL74JXVD-C7Xl9U8K.js} +1 -1
  158. package/dist/{wardley-RL74JXVD-BndLe7vL.cjs → wardley-RL74JXVD-pImcCh7M.cjs} +1 -1
  159. package/dist/{wardleyDiagram-NUSXRM2D-DCChf1Y2.js → wardleyDiagram-NUSXRM2D-C5cuHNUZ.js} +3 -3
  160. package/dist/{wardleyDiagram-NUSXRM2D-DpluOG7a.cjs → wardleyDiagram-NUSXRM2D-cJNJYk25.cjs} +1 -1
  161. package/dist/{xychartDiagram-5P7HB3ND-B7y6-7BP.cjs → xychartDiagram-5P7HB3ND-Bg7uOCAC.cjs} +1 -1
  162. package/dist/{xychartDiagram-5P7HB3ND-BWvz1AY8.js → xychartDiagram-5P7HB3ND-Ws1GisBM.js} +3 -3
  163. package/package.json +1 -1
  164. package/dist/clone-D_c-FYGd.cjs +0 -1
  165. package/dist/info-OMHHGYJF-KL9K6Ofp.js +0 -5
  166. package/dist/pie-ZZUOXDRM-CpENjo0C.js +0 -5
  167. package/dist/radar-PYXPWWZC-BiAwm-jb.js +0 -5
@@ -0,0 +1,27 @@
1
+ export type PrintingPressArchiveFormat = 'zip' | 'tar.gz';
2
+ export interface PrintingPressDocumentExportOptions {
3
+ format?: PrintingPressArchiveFormat;
4
+ diagnostics?: boolean;
5
+ llm?: boolean;
6
+ brokerId?: string;
7
+ }
8
+ export interface PrintingPressGenerationResult {
9
+ taskId: string;
10
+ documentId: string;
11
+ status: string;
12
+ url?: string;
13
+ docsUrl?: string;
14
+ diagnosticsUrl?: string;
15
+ expiresAt?: string;
16
+ }
17
+ export declare class PrintingPressService {
18
+ static ensureWorkspaceDocs(brokerId?: string): Promise<PrintingPressGenerationResult>;
19
+ static fetchTaskResult(taskId: string, brokerId?: string): Promise<PrintingPressGenerationResult>;
20
+ static absoluteDocsUrl(docsUrl: string): string;
21
+ static preflightDocs(docsUrl: string, brokerId?: string): Promise<Response>;
22
+ static exportDocs(format: PrintingPressArchiveFormat, brokerId?: string): Promise<void>;
23
+ static exportDocumentDocs(docsUrl: string, optionsOrFormat?: PrintingPressDocumentExportOptions | PrintingPressArchiveFormat, diagnostics?: boolean, brokerId?: string): Promise<void>;
24
+ private static documentExportUrl;
25
+ private static errorFromResponse;
26
+ private static filenameFromResponse;
27
+ }
@@ -0,0 +1,125 @@
1
+ import { HeaderService } from "./header-service.js";
2
+ import { ModelService } from "./model-service.js";
3
+ export class PrintingPressService {
4
+ static async ensureWorkspaceDocs(brokerId) {
5
+ const response = await fetch(`${ModelService.doctorEndpoint}/ppress/generate-workspace?force=false`, {
6
+ method: 'POST',
7
+ credentials: 'include',
8
+ cache: 'no-store',
9
+ headers: HeaderService.buildDefaultHeaders(brokerId),
10
+ });
11
+ if (!response.ok) {
12
+ const error = await response.json();
13
+ throw error;
14
+ }
15
+ const payload = await response.json();
16
+ return (payload.response ?? payload);
17
+ }
18
+ static async fetchTaskResult(taskId, brokerId) {
19
+ const response = await fetch(`${ModelService.doctorEndpoint}/ppress/tasks/${encodeURIComponent(taskId)}`, {
20
+ method: 'GET',
21
+ credentials: 'include',
22
+ cache: 'no-store',
23
+ headers: HeaderService.buildDefaultHeaders(brokerId),
24
+ });
25
+ if (!response.ok) {
26
+ const error = await response.json();
27
+ throw error;
28
+ }
29
+ const payload = await response.json();
30
+ return (payload.response ?? payload);
31
+ }
32
+ static absoluteDocsUrl(docsUrl) {
33
+ return new URL(docsUrl, ModelService.doctorEndpoint).toString();
34
+ }
35
+ static preflightDocs(docsUrl, brokerId) {
36
+ return fetch(docsUrl, {
37
+ method: 'HEAD',
38
+ credentials: 'include',
39
+ cache: 'no-store',
40
+ headers: HeaderService.buildDefaultHeaders(brokerId),
41
+ });
42
+ }
43
+ static async exportDocs(format, brokerId) {
44
+ const headers = HeaderService.buildDefaultHeaders(brokerId);
45
+ const response = await fetch(`${ModelService.doctorEndpoint}/ppress/export?format=${encodeURIComponent(format)}`, {
46
+ method: 'GET',
47
+ credentials: 'include',
48
+ headers: headers,
49
+ });
50
+ if (!response.ok) {
51
+ const error = await response.json();
52
+ throw error;
53
+ }
54
+ const blob = await response.blob();
55
+ const filename = PrintingPressService.filenameFromResponse(response, format);
56
+ const url = URL.createObjectURL(blob);
57
+ const link = document.createElement('a');
58
+ link.href = url;
59
+ link.download = filename;
60
+ link.click();
61
+ setTimeout(() => URL.revokeObjectURL(url), 500);
62
+ }
63
+ static async exportDocumentDocs(docsUrl, optionsOrFormat = 'zip', diagnostics = false, brokerId) {
64
+ const options = typeof optionsOrFormat === 'string'
65
+ ? { format: optionsOrFormat, diagnostics, brokerId }
66
+ : optionsOrFormat;
67
+ const format = options.format ?? 'zip';
68
+ const exportUrl = PrintingPressService.documentExportUrl(docsUrl);
69
+ if (format) {
70
+ exportUrl.searchParams.set('format', format);
71
+ }
72
+ if (options.diagnostics) {
73
+ exportUrl.searchParams.set('diagnostics', '1');
74
+ }
75
+ if (options.llm) {
76
+ exportUrl.searchParams.set('llm', '1');
77
+ }
78
+ const response = await fetch(exportUrl.toString(), {
79
+ method: 'GET',
80
+ credentials: 'include',
81
+ headers: HeaderService.buildDefaultHeaders(options.brokerId),
82
+ });
83
+ if (!response.ok) {
84
+ const error = await PrintingPressService.errorFromResponse(response);
85
+ throw error;
86
+ }
87
+ const blob = await response.blob();
88
+ const filename = PrintingPressService.filenameFromResponse(response, format);
89
+ const url = URL.createObjectURL(blob);
90
+ const link = document.createElement('a');
91
+ link.href = url;
92
+ link.download = filename;
93
+ link.click();
94
+ setTimeout(() => URL.revokeObjectURL(url), 500);
95
+ }
96
+ static documentExportUrl(docsUrl) {
97
+ const resolved = new URL(docsUrl, ModelService.doctorEndpoint);
98
+ const match = resolved.pathname.match(/^(.*\/ppress\/docs\/)([^/]+)(?:\/.*)?$/);
99
+ if (!match?.[1] || !match?.[2]) {
100
+ throw new Error('Unable to locate the generated docs document ID.');
101
+ }
102
+ return new URL(`${match[1]}${match[2]}/export`, resolved.origin);
103
+ }
104
+ static async errorFromResponse(response) {
105
+ const body = await response.text();
106
+ try {
107
+ return JSON.parse(body);
108
+ }
109
+ catch {
110
+ return {
111
+ status: response.status,
112
+ title: response.statusText || 'request failed',
113
+ detail: body || 'Unable to export generated docs.',
114
+ };
115
+ }
116
+ }
117
+ static filenameFromResponse(response, format) {
118
+ const disposition = response.headers.get('content-disposition');
119
+ const match = disposition?.match(/filename="([^"]+)"/);
120
+ if (match?.[1]) {
121
+ return match[1];
122
+ }
123
+ return `printing-press-docs.${format}`;
124
+ }
125
+ }
@@ -1,8 +1,8 @@
1
- import { s as R, a as W, S as N } from "./chunk-OYMX7WX6-U53KZXxw.js";
2
- import { _ as f, c as t, d as H, l as S, e as P, k as z, O as _, u as U } from "./cowboy-components-CxawaKWM.js";
3
- import { G as C } from "./graph-Dfys1tzR.js";
4
- import { l as F } from "./layout-BDanDonD.js";
5
- import { l as O, c as J } from "./change-list-item-Bu_mPv-k.js";
1
+ import { s as R, a as W, S as N } from "./chunk-OYMX7WX6-Cx27mmAN.js";
2
+ import { _ as f, c as t, d as H, l as S, e as P, k as z, O as _, u as U } from "./cowboy-components-CPx4P290.js";
3
+ import { G as C } from "./graph-Bv4HICS-.js";
4
+ import { l as F } from "./layout-B93j_9jn.js";
5
+ import { l as O, c as J } from "./change-list-item-BRSBlaLu.js";
6
6
  var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => {
7
7
  const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
8
8
  return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./chunk-OYMX7WX6-DU4Zqa7r.cjs"),t=require("./cowboy-components-CjgqXqkM.cjs"),H=require("./graph-DyZUkQBU.cjs"),z=require("./layout-rTQtAIwn.cjs"),k=require("./change-list-item-4xBSo3-U.cjs");var L=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),W=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),G=t.__name((e,n)=>{const d=t.__name(function(s,m,u){const B=s.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);u||B.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,h=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(s){i||(d(h,s,r),r=!1),i=!1});const y=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),p=h.node().getBBox(),c=Math.max(p.width,o.width);return y.attr("x2",c+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",c+2*t.getConfig2().state.padding).attr("height",p.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),P=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),h=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),p=r.node().getBBox().width+o;let c=Math.max(p,h);c===h&&(c=c+o);let s;const m=e.node().getBBox();n.doc,s=i-g,p>h&&(s=(h-c)/2+g),Math.abs(i-m.x)<g&&p>h&&(s=i-(p-h)/2);const u=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",s).attr("y",u).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",s+g),p<=h&&r.attr("x",i+(c-o)/2-p/2+g),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),R=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),U=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let h=e.replace(/\r\n/g,"<br/>");h=h.replace(/\n/g,"<br/>");const i=h.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const y of i){const p=y.trim();if(p.length>0){const c=l.append("tspan");if(c.text(p),r===0){const s=c.node().getBBox();r+=s.height}o+=r,c.attr("x",n+t.getConfig2().state.noteMargin),c.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),F=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),N=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&L(o),n.type==="end"&&R(o),(n.type==="fork"||n.type==="join")&&U(o,n),n.type==="note"&&F(n.note.text,o),n.type==="divider"&&W(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&G(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),M=0,O=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case _.StateDB.relationType.AGGREGATION:return"aggregation";case _.StateDB.relationType.EXTENSION:return"extension";case _.StateDB.relationType.COMPOSITION:return"composition";case _.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=k.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(k.curveBasis),h=e.append("path").attr("d",l(o)).attr("id","edge"+M).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),h.attr("marker-end","url("+i+"#"+g(_.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:y,y:p}=t.utils_default.calcLabelPosition(n.points),c=t.common_default.getRows(d.title);let s=0;const m=[];let u=0,B=0;for(let x=0;x<=c.length;x++){const f=r.append("text").attr("text-anchor","middle").text(c[x]).attr("x",y).attr("y",p+s),C=f.node().getBBox();u=Math.max(u,C.width),B=Math.min(B,C.x),t.log.info(C.x,y,p+s),s===0&&(s=f.node().getBBox().height,t.log.info("Title height",s,p)),m.push(f)}let S=s*c.length;if(c.length>1){const x=(c.length-1)*s*.5;m.forEach((f,C)=>f.attr("y",p+C*s-x)),S=s*c.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",y-u/2-t.getConfig2().state.padding/2).attr("y",p-S/2-t.getConfig2().state.padding/2-3.5).attr("width",u+t.getConfig2().state.padding).attr("height",S+t.getConfig2().state.padding),t.log.info(a)}M++},"drawEdge"),w,E={},X=t.__name(function(){},"setConf"),q=t.__name(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const h=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=h.select(`[id='${n}']`);q(r);const y=g.db.getRootDoc(),p=r.append("g").attr("id",n+"-root");T(y,p,void 0,!1,h,i,g);const c=w.padding,s=r.node().getBBox(),m=s.width+c*2,u=s.height+c*2,B=m*1.75;t.configureSvgSize(r,u,B,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+m+" "+u)},"draw"),Y=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),T=t.__name((e,n,d,g,o,l,h)=>{const i=new H.Graph({compound:!0,multigraph:!0});let r,y=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){y=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const p=h.db.getStates(),c=h.db.getRelations(),s=Object.keys(p);for(const a of s){const x=p[a];d&&(x.parentId=d);let f;if(x.doc){let C=n.append("g").attr("id",x.id).attr("class","stateGroup");f=T(x.doc,C,x.id,!g,o,l,h);{C=P(C,x,g);let b=C.node().getBBox();f.width=b.width,f.height=b.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=N(n,x,i);if(x.note){const C={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},b=N(n,C,i);x.note.position==="left of"?(i.setNode(f.id+"-note",b),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",b)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;c.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:Y(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),z.layout(i),t.log.debug("Graph after layout",i.nodes());const u=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+u.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+u.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+u.id+" #"+a+" .divider").forEach(f=>{const C=f.parentElement;let b=0,v=0;C&&(C.parentElement&&(b=C.parentElement.getBBox().width),v=parseInt(C.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",b-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let B=u.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),O(n,i.edge(a),i.edge(a).relation))}),B=u.getBBox();const S={id:d||"root",label:d||"root",width:0,height:0};return S.width=B.width+2*w.padding,S.height=B.height+2*w.padding,t.log.debug("Doc rendered",S,i),S},"renderDoc"),I={setConf:X,draw:J},$={parser:_.stateDiagram_default,get db(){return new _.StateDB(1)},renderer:I,styles:_.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./chunk-OYMX7WX6-j5BWPw4q.cjs"),t=require("./cowboy-components-DDfCPnUY.cjs"),H=require("./graph-DpFK38bp.cjs"),z=require("./layout-zdFgePaJ.cjs"),k=require("./change-list-item-Dy1GNFQ8.cjs");var L=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),W=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),G=t.__name((e,n)=>{const d=t.__name(function(s,m,u){const B=s.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);u||B.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,h=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(s){i||(d(h,s,r),r=!1),i=!1});const y=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),p=h.node().getBBox(),c=Math.max(p.width,o.width);return y.attr("x2",c+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",c+2*t.getConfig2().state.padding).attr("height",p.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),P=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),h=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),p=r.node().getBBox().width+o;let c=Math.max(p,h);c===h&&(c=c+o);let s;const m=e.node().getBBox();n.doc,s=i-g,p>h&&(s=(h-c)/2+g),Math.abs(i-m.x)<g&&p>h&&(s=i-(p-h)/2);const u=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",s).attr("y",u).attr("class",d?"alt-composit":"composit").attr("width",c).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",s+g),p<=h&&r.attr("x",i+(c-o)/2-p/2+g),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",s).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",c).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),R=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),U=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let h=e.replace(/\r\n/g,"<br/>");h=h.replace(/\n/g,"<br/>");const i=h.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const y of i){const p=y.trim();if(p.length>0){const c=l.append("tspan");if(c.text(p),r===0){const s=c.node().getBBox();r+=s.height}o+=r,c.attr("x",n+t.getConfig2().state.noteMargin),c.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),F=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),N=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&L(o),n.type==="end"&&R(o),(n.type==="fork"||n.type==="join")&&U(o,n),n.type==="note"&&F(n.note.text,o),n.type==="divider"&&W(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&G(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),M=0,O=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case _.StateDB.relationType.AGGREGATION:return"aggregation";case _.StateDB.relationType.EXTENSION:return"extension";case _.StateDB.relationType.COMPOSITION:return"composition";case _.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=k.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(k.curveBasis),h=e.append("path").attr("d",l(o)).attr("id","edge"+M).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),h.attr("marker-end","url("+i+"#"+g(_.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:y,y:p}=t.utils_default.calcLabelPosition(n.points),c=t.common_default.getRows(d.title);let s=0;const m=[];let u=0,B=0;for(let x=0;x<=c.length;x++){const f=r.append("text").attr("text-anchor","middle").text(c[x]).attr("x",y).attr("y",p+s),C=f.node().getBBox();u=Math.max(u,C.width),B=Math.min(B,C.x),t.log.info(C.x,y,p+s),s===0&&(s=f.node().getBBox().height,t.log.info("Title height",s,p)),m.push(f)}let S=s*c.length;if(c.length>1){const x=(c.length-1)*s*.5;m.forEach((f,C)=>f.attr("y",p+C*s-x)),S=s*c.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",y-u/2-t.getConfig2().state.padding/2).attr("y",p-S/2-t.getConfig2().state.padding/2-3.5).attr("width",u+t.getConfig2().state.padding).attr("height",S+t.getConfig2().state.padding),t.log.info(a)}M++},"drawEdge"),w,E={},X=t.__name(function(){},"setConf"),q=t.__name(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const h=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=h.select(`[id='${n}']`);q(r);const y=g.db.getRootDoc(),p=r.append("g").attr("id",n+"-root");T(y,p,void 0,!1,h,i,g);const c=w.padding,s=r.node().getBBox(),m=s.width+c*2,u=s.height+c*2,B=m*1.75;t.configureSvgSize(r,u,B,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+m+" "+u)},"draw"),Y=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),T=t.__name((e,n,d,g,o,l,h)=>{const i=new H.Graph({compound:!0,multigraph:!0});let r,y=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){y=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:y?1:w.edgeLengthFactor,nodeSep:y?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const p=h.db.getStates(),c=h.db.getRelations(),s=Object.keys(p);for(const a of s){const x=p[a];d&&(x.parentId=d);let f;if(x.doc){let C=n.append("g").attr("id",x.id).attr("class","stateGroup");f=T(x.doc,C,x.id,!g,o,l,h);{C=P(C,x,g);let b=C.node().getBBox();f.width=b.width,f.height=b.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=N(n,x,i);if(x.note){const C={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},b=N(n,C,i);x.note.position==="left of"?(i.setNode(f.id+"-note",b),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",b)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;c.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:Y(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),z.layout(i),t.log.debug("Graph after layout",i.nodes());const u=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+u.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+u.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+u.id+" #"+a+" .divider").forEach(f=>{const C=f.parentElement;let b=0,v=0;C&&(C.parentElement&&(b=C.parentElement.getBBox().width),v=parseInt(C.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",b-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let B=u.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),O(n,i.edge(a),i.edge(a).relation))}),B=u.getBBox();const S={id:d||"root",label:d||"root",width:0,height:0};return S.width=B.width+2*w.padding,S.height=B.height+2*w.padding,t.log.debug("Doc rendered",S,i),S},"renderDoc"),I={setConf:X,draw:J},$={parser:_.stateDiagram_default,get db(){return new _.StateDB(1)},renderer:I,styles:_.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=$;
@@ -1,5 +1,5 @@
1
- import { s as a, b as t, a as r, S as s } from "./chunk-OYMX7WX6-U53KZXxw.js";
2
- import { _ as i } from "./cowboy-components-CxawaKWM.js";
1
+ import { s as a, b as t, a as r, S as s } from "./chunk-OYMX7WX6-Cx27mmAN.js";
2
+ import { _ as i } from "./cowboy-components-CPx4P290.js";
3
3
  var _ = {
4
4
  parser: r,
5
5
  get db() {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunk-OYMX7WX6-DU4Zqa7r.cjs"),r=require("./cowboy-components-CjgqXqkM.cjs");var a={parser:t.stateDiagram_default,get db(){return new t.StateDB(2)},renderer:t.stateRenderer_v3_unified_default,styles:t.styles_default,init:r.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunk-OYMX7WX6-j5BWPw4q.cjs"),r=require("./cowboy-components-DDfCPnUY.cjs");var a={parser:t.stateDiagram_default,get db(){return new t.StateDB(2)},renderer:t.stateRenderer_v3_unified_default,styles:t.styles_default,init:r.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=a;
@@ -1,5 +1,5 @@
1
- import { _ as o, D as pt, T as Ct, U as Rt, V as Wt, c as gt, l as E, I as Pt, N as Bt, W as ft, d as K, C as Vt, X as Ft, z as zt } from "./cowboy-components-CxawaKWM.js";
2
- import { d as ot } from "./arc-CZ9OyfV-.js";
1
+ import { _ as o, D as pt, T as Ct, U as Rt, V as Wt, c as gt, l as E, I as Pt, N as Bt, W as ft, d as K, C as Vt, X as Ft, z as zt } from "./cowboy-components-CPx4P290.js";
2
+ import { d as ot } from "./arc-CYzOnlSi.js";
3
3
  var tt = (function() {
4
4
  var e = /* @__PURE__ */ o(function(k, s, d, l) {
5
5
  for (d = d || {}, l = k.length; l--; d[k[l]] = s) ;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./cowboy-components-CjgqXqkM.cjs"),st=require("./arc-D5LG9aVl.cjs");var Q=(function(){var e=r.__name(function(x,s,d,c){for(d=d||{},c=x.length;c--;d[x[c]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],a=[1,14],h=[1,15],l=[1,16],o=[1,19],f=[1,20],p={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:r.__name(function(s,d,c,g,y,u,S){var k=u.length-1;switch(y){case 1:return u[k-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[k-1].push(u[k]),this.$=u[k-1];break;case 7:case 8:this.$=u[k];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[k].substr(6)),this.$=u[k].substr(6);break;case 12:this.$=u[k].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[k].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[k].substr(8)),this.$=u[k].substr(8);break;case 18:g.addTask(u[k],0,""),this.$=u[k];break;case 19:g.addEvent(u[k].substr(2)),this.$=u[k];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:a,19:h,20:l,21:17,22:18,23:o,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:a,19:h,20:l,21:17,22:18,23:o,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:r.__name(function(s,d){if(d.recoverable)this.trace(s);else{var c=new Error(s);throw c.hash=d,c}},"parseError"),parse:r.__name(function(s){var d=this,c=[0],g=[],y=[null],u=[],S=this.table,k="",N=0,A=0,R=2,O=1,H=u.slice.call(arguments,1),w=Object.create(this.lexer),I={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(I.yy[B]=this.yy[B]);w.setInput(s,I.yy),I.yy.lexer=w,I.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var V=w.yylloc;u.push(V);var q=w.options&&w.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(M){c.length=c.length-2*M,y.length=y.length-M,u.length=u.length-M}r.__name($,"popStack");function v(){var M;return M=g.pop()||w.lex()||O,typeof M!="number"&&(M instanceof Array&&(g=M,M=g.pop()),M=d.symbols_[M]||M),M}r.__name(v,"lex");for(var b,T,E,W,C={},z,P,j,K;;){if(T=c[c.length-1],this.defaultActions[T]?E=this.defaultActions[T]:((b===null||typeof b>"u")&&(b=v()),E=S[T]&&S[T][b]),typeof E>"u"||!E.length||!E[0]){var J="";K=[];for(z in S[T])this.terminals_[z]&&z>R&&K.push("'"+this.terminals_[z]+"'");w.showPosition?J="Parse error on line "+(N+1)+`:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./cowboy-components-DDfCPnUY.cjs"),st=require("./arc-tHE-eDC1.cjs");var Q=(function(){var e=r.__name(function(x,s,d,c){for(d=d||{},c=x.length;c--;d[x[c]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],a=[1,14],h=[1,15],l=[1,16],o=[1,19],f=[1,20],p={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:r.__name(function(s,d,c,g,y,u,S){var k=u.length-1;switch(y){case 1:return u[k-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[k-1].push(u[k]),this.$=u[k-1];break;case 7:case 8:this.$=u[k];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[k].substr(6)),this.$=u[k].substr(6);break;case 12:this.$=u[k].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[k].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[k].substr(8)),this.$=u[k].substr(8);break;case 18:g.addTask(u[k],0,""),this.$=u[k];break;case 19:g.addEvent(u[k].substr(2)),this.$=u[k];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:a,19:h,20:l,21:17,22:18,23:o,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:a,19:h,20:l,21:17,22:18,23:o,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:r.__name(function(s,d){if(d.recoverable)this.trace(s);else{var c=new Error(s);throw c.hash=d,c}},"parseError"),parse:r.__name(function(s){var d=this,c=[0],g=[],y=[null],u=[],S=this.table,k="",N=0,A=0,R=2,O=1,H=u.slice.call(arguments,1),w=Object.create(this.lexer),I={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(I.yy[B]=this.yy[B]);w.setInput(s,I.yy),I.yy.lexer=w,I.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var V=w.yylloc;u.push(V);var q=w.options&&w.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $(M){c.length=c.length-2*M,y.length=y.length-M,u.length=u.length-M}r.__name($,"popStack");function v(){var M;return M=g.pop()||w.lex()||O,typeof M!="number"&&(M instanceof Array&&(g=M,M=g.pop()),M=d.symbols_[M]||M),M}r.__name(v,"lex");for(var b,T,E,W,C={},z,P,j,K;;){if(T=c[c.length-1],this.defaultActions[T]?E=this.defaultActions[T]:((b===null||typeof b>"u")&&(b=v()),E=S[T]&&S[T][b]),typeof E>"u"||!E.length||!E[0]){var J="";K=[];for(z in S[T])this.terminals_[z]&&z>R&&K.push("'"+this.terminals_[z]+"'");w.showPosition?J="Parse error on line "+(N+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+K.join(", ")+", got '"+(this.terminals_[b]||b)+"'":J="Parse error on line "+(N+1)+": Unexpected "+(b==O?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(J,{text:w.match,token:this.terminals_[b]||b,line:w.yylineno,loc:V,expected:K})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+b);switch(E[0]){case 1:c.push(b),y.push(w.yytext),u.push(w.yylloc),c.push(E[1]),b=null,A=w.yyleng,k=w.yytext,N=w.yylineno,V=w.yylloc;break;case 2:if(P=this.productions_[E[1]][1],C.$=y[y.length-P],C._$={first_line:u[u.length-(P||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(P||1)].first_column,last_column:u[u.length-1].last_column},q&&(C._$.range=[u[u.length-(P||1)].range[0],u[u.length-1].range[1]]),W=this.performAction.apply(C,[k,A,N,I.yy,E[1],y,u].concat(H)),typeof W<"u")return W;P&&(c=c.slice(0,-1*P*2),y=y.slice(0,-1*P),u=u.slice(0,-1*P)),c.push(this.productions_[E[1]][0]),y.push(C.$),u.push(C._$),j=S[c[c.length-2]][c[c.length-1]],c.push(j);break;case 3:return!0}}return!0},"parse")},_=(function(){var x={EOF:1,parseError:r.__name(function(d,c){if(this.yy.parser)this.yy.parser.parseError(d,c);else throw new Error(d)},"parseError"),setInput:r.__name(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:r.__name(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:r.__name(function(s){var d=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===g.length?this.yylloc.first_column:0)+g[g.length-c.length].length-c[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:r.__name(function(){return this._more=!0,this},"more"),reject:r.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:r.__name(function(s){this.unput(this.match.slice(s))},"less"),pastInput:r.__name(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r.__name(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r.__name(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import { T as a, e as i } from "./mermaid-parser.core-CCHvxUQl.js";
1
+ import { T as a, e as i } from "./mermaid-parser.core-D4IlYn7u.js";
2
2
  export {
3
3
  a as TreeViewModule,
4
4
  i as createTreeViewServices
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-fjh_cn2l.cjs");exports.TreeViewModule=e.TreeViewModule;exports.createTreeViewServices=e.createTreeViewServices;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-S6P-fvNi.cjs");exports.TreeViewModule=e.TreeViewModule;exports.createTreeViewServices=e.createTreeViewServices;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-fjh_cn2l.cjs");exports.TreemapModule=e.TreemapModule;exports.createTreemapServices=e.createTreemapServices;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-S6P-fvNi.cjs");exports.TreemapModule=e.TreemapModule;exports.createTreemapServices=e.createTreemapServices;
@@ -1,4 +1,4 @@
1
- import { i as a, j as m } from "./mermaid-parser.core-CCHvxUQl.js";
1
+ import { i as a, j as m } from "./mermaid-parser.core-D4IlYn7u.js";
2
2
  export {
3
3
  a as TreemapModule,
4
4
  m as createTreemapServices
@@ -1,4 +1,4 @@
1
- import { az as Gt, _ as w, s as Wt, g as Kt, q as Ht, p as Yt, a as Xt, b as Zt, D as wt, I as Jt, d as ot, ao as Qt, T as $t, U as te, V as ee, e as ne, z as se, F as ie, G as oe } from "./cowboy-components-CxawaKWM.js";
1
+ import { az as Gt, _ as w, s as Wt, g as Kt, q as Ht, p as Yt, a as Xt, b as Zt, D as wt, I as Jt, d as ot, ao as Qt, T as $t, U as te, V as ee, e as ne, z as se, F as ie, G as oe } from "./cowboy-components-CPx4P290.js";
2
2
  const kt = (t, n) => Gt(t, "a", -n), _t = 1e-10;
3
3
  function st(t, n) {
4
4
  const s = ae(t), e = s.filter((c) => re(c, t));
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./cowboy-components-CjgqXqkM.cjs"),vt=(t,n)=>k.adjustChannel(t,"a",-n),Mt=1e-10;function st(t,n){const s=Ut(t),e=s.filter(c=>qt(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=wt(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const x={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const y=t[r.parentIndex[b]],M=Math.atan2(r.x-y.x,r.y-y.y),A=Math.atan2(h.x-y.x,h.y-y.y);let T=A-M;T<0&&(T+=2*Math.PI);const S=A-T/2;let g=q(x,{x:y.x+y.radius*Math.sin(S),y:y.y+y.radius*Math.cos(S)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:r,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(a.push(d),i+=at(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-Mt,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function qt(t,n){return n.every(s=>q(t,s)<s.radius+Mt)}function Ut(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=St(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function gt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}function St(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function wt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function Gt(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,x=t(r);if(x*a>=0&&(n=r),Math.abs(h)<o||x===0)return r}return n+h}function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function It(t,n){return lt(t).map(()=>lt(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ct(t){return Math.sqrt($(t,t))}function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function Tt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,x=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,y=new Array(b+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let _=0;_<b;++_){const l=n.slice();l[_]=l[_]?l[_]*i:o,y[_+1]=l,y[_+1].fx=t(l),y[_+1].id=_+1}function M(_){for(let l=0;l<_.length;l++)y[b][l]=_[l];y[b].fx=_.fx}const A=(_,l)=>_.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let _=0;_<e;++_){if(y.sort(A),s.history){const p=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});p.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(y[0][p]-y[1][p]));if(Math.abs(y[0].fx-y[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){T[p]=0;for(let f=0;f<b;++f)T[p]+=y[f][p];T[p]/=b}const l=y[b];if(J(S,1+h,T,-h,l),S.fx=t(S),S.fx<y[0].fx)J(m,1+u,T,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=y[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,T,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(x>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-x,y[0],x,y[f]),y[f].fx=t(y[f])}}else M(S)}return y.sort(A),{fx:y[0].fx,x:y[0]}}function Wt(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,x=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(y,M,A){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(x)<=-a*h)return i;x*(M-y)>=0&&(M=y),y=i,A=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=$(e.fxprime,n),u>c+o*i*h||y&&u>=r)return b(d,i,r);if(Math.abs(x)<=-a*h)return i;if(x>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function Kt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ut(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=Wt(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ut(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const x=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/x);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function Et(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||Zt,e=n.lossFunction||tt,i=Ht(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=Tt(r=>{const x={};for(let d=0;d<a.length;++d){const b=a[d];x[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(x,i)},c,n).x;for(let r=0;r<a.length;++r){const x=a[r];o[x].x=u[2*r],o[x].y=u[2*r+1]}return o}const zt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+zt?Math.abs(t-n):Gt(e=>gt(t,n,e)-s,0,t+n)}function Ht(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let x=u+1;x<h.sets.length;x++){const d=String(h.sets[x]),b=`${r};${d}`,y=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(y,h.size+(c.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function Yt(t,n,s){const e=It(n.length,n.length),i=It(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ft(h,u,o.size);e[a][c]=e[c][a]=r;let x=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?x=1:o.size<=1e-10&&(x=-1),i[a][c]=i[c][a]=x}),{distances:e,constraints:i}}function Xt(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],x=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),y=Math.sqrt(b),M=b-x*x;d>0&&y<=x||d<0&&y>=x||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function Zt(t,n={}){let s=Qt(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=Jt(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function Jt(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:o,constraints:a}=Yt(t,e,i);const c=ct(o.map(ct))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>Xt(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=lt(o.length*2).map(Math.random),y=Kt(h,b,n);(!u||y.fx<u.fx)&&(u=y)}const r=u.x,x={};for(let d=0;d<e.length;++d){const b=e[d];x[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ut(d.x,c);return x}function Qt(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const x of t)if(x.sets.length===1){const d=x.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:x.size,radius:Math.sqrt(x.size/Math.PI)},i[d]=[]}t=t.filter(x=>x.sets.length===2);for(const x of t){let d=x.weight!=null?x.weight:1;const b=x.sets[0],y=x.sets[1];x.size+zt>=Math.min(e[b].size,e[y].size)&&(d=0),i[b].push({set:y,size:x.size,weight:d}),i[y].push({set:b,size:x.size,weight:d})}const o=[];Object.keys(i).forEach(x=>{let d=0;for(let b=0;b<i[x].length;++b)d+=i[x][b].size*i[x][b].weight;o.push({set:x,size:d})});function a(x,d){return d.size-x.size}o.sort(a);const c={};function h(x){return x.set in c}function u(x,d){e[d].x=x.x,e[d].y=x.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let x=1;x<o.length;++x){const d=o[x].set,b=i[d].filter(h),y=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ft(y.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const _=e[b[m].set],l=ft(y.radius,_.radius,b[m].size),p=St({x:S.x,y:S.y,radius:g},{x:_.x,y:_.y,radius:l});M.push(...p)}}let A=1e50,T=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,T=S)}u(T,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=gt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function At(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=gt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function $t(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function te(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function ht(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ot(t).map(u=>Object.assign({},u));const i=te(e);for(const u of i){$t(u,n,s);const r=ht(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,x){if(!u)return;const d=u.bounds;let b,y;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(x)y=o.yRange.max-d.yRange.min+a;else{y=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=b,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=ht(e);return Rt(e)}function Ct(t,n,s,e,i){const o=Ot(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=ht(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),x=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Rt(o.map(b=>({radius:r*b.radius,x:e+x+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Rt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ot(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ee(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,x=null,d=null,b=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=Et,_=tt;function l(p){let f=p.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(F=>O.has(F)));let v={},C={};if(f.length>0){let I=m(f,{lossFunction:_,distinct:b});c&&(I=Dt(I,a,d)),v=Ct(I,s,e,i,h),C=Ft(v,f,M)}const U={};f.forEach(I=>{I.label&&(U[I.sets]=I.label)});function j(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}p.selectAll("svg").data([v]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const D={};let w=!1;E.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(w=!0,D[I.sets[0]]=ie(F))});function P(I){return F=>{const H=I.sets.map(et=>{let Y=D[et],Z=v[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return kt(H,y)}}const V=E.selectAll(".venn-area").data(f,I=>I.sets),N=V.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=N.append("path"),W=N.append("text").attr("class","label").text(I=>j(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),W.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=p;w&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",I=>kt(I.sets.map(F=>v[F])),y);const L=z.selectAll("text").filter(I=>I.sets in C).text(I=>j(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(w?"on"in L?L.on("end",ot(v,j)):L.each("end",ot(v,j)):L.each(ot(v,j)));const R=K(V.exit()).remove();typeof V.transition=="function"&&R.selectAll("path").attrTween("d",P);const X=R.selectAll("text").attr("x",s/2).attr("y",e/2);return x!==null&&(W.style("font-size","0px"),L.style("font-size",x),X.style("font-size","0px")),{circles:v,textCentres:C,nodes:V,enter:N,update:z,exit:R}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(x=p,l):x},l.round=function(p){return arguments.length?(y=p,l):y},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(_=p==="default"?tt:p==="logRatio"?At:p,l):_},l}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],x=0;const d=1.1;e.textContent=null;const b=[];function y(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=y(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=y(u),x++)}const A=.35-x*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function rt(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Nt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=rt(e[0],t,n);for(let r=1;r<e.length;++r){const x=rt(e[r],t,n);x>=o&&(i=e[r],o=x)}const a=Tt(r=>-1*rt({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Nt(t,[]):wt(u.arcs.map(r=>r.p1))}function ne(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function Ft(t,n,s){const e={},i=ne(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let y=0;y<b.length;++y)h[b[y]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const x=Nt(u,r,s);e[a]=x,x.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function se(t,n,s){const e=[];return e.push(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./cowboy-components-DDfCPnUY.cjs"),vt=(t,n)=>k.adjustChannel(t,"a",-n),Mt=1e-10;function st(t,n){const s=Ut(t),e=s.filter(c=>qt(c,t));let i=0,o=0;const a=[];if(e.length>1){const c=wt(e);for(let u=0;u<e.length;++u){const r=e[u];r.angle=Math.atan2(r.x-c.x,r.y-c.y)}e.sort((u,r)=>r.angle-u.angle);let h=e[e.length-1];for(let u=0;u<e.length;++u){const r=e[u];o+=(h.x+r.x)*(r.y-h.y);const x={x:(r.x+h.x)/2,y:(r.y+h.y)/2};let d=null;for(let b=0;b<r.parentIndex.length;++b)if(h.parentIndex.includes(r.parentIndex[b])){const y=t[r.parentIndex[b]],M=Math.atan2(r.x-y.x,r.y-y.y),A=Math.atan2(h.x-y.x,h.y-y.y);let T=A-M;T<0&&(T+=2*Math.PI);const S=A-T/2;let g=q(x,{x:y.x+y.radius*Math.sin(S),y:y.y+y.radius*Math.cos(S)});g>y.radius*2&&(g=y.radius*2),(d==null||d.width>g)&&(d={circle:y,width:g,p1:r,p2:h,large:g>y.radius,sweep:!0})}d!=null&&(a.push(d),i+=at(d.circle.radius,d.width),h=r)}}else{let c=t[0];for(let u=1;u<t.length;++u)t[u].radius<c.radius&&(c=t[u]);let h=!1;for(let u=0;u<t.length;++u)if(q(t[u],c)>Math.abs(c.radius-t[u].radius)){h=!0;break}h?i=o=0:(i=c.radius*c.radius*Math.PI,a.push({circle:c,p1:{x:c.x,y:c.y+c.radius},p2:{x:c.x-Mt,y:c.y+c.radius},width:c.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=a,n.innerPoints=e,n.intersectionPoints=s),i+o}function qt(t,n){return n.every(s=>q(t,s)<s.radius+Mt)}function Ut(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=St(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function at(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function gt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return at(t,e)+at(n,i)}function St(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),a=Math.sqrt(e*e-o*o),c=t.x+o*(n.x-t.x)/s,h=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(a/s),r=-(n.x-t.x)*(a/s);return[{x:c+u,y:h-r},{x:c-u,y:h+r}]}function wt(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function Gt(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,a=t(n),c=t(s);let h=s-n;if(a*c>0)throw"Initial bisect points must have opposite signs";if(a===0)return n;if(c===0)return s;for(let u=0;u<i;++u){h/=2;const r=n+h,x=t(r);if(x*a>=0&&(n=r),Math.abs(h)<o||x===0)return r}return n+h}function lt(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function It(t,n){return lt(t).map(()=>lt(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ct(t){return Math.sqrt($(t,t))}function ut(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function Tt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,a=s.minErrorDelta||1e-6,c=s.minErrorDelta||1e-5,h=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,r=s.psi!==void 0?s.psi:-.5,x=s.sigma!==void 0?s.sigma:.5;let d;const b=n.length,y=new Array(b+1);y[0]=n,y[0].fx=t(n),y[0].id=0;for(let _=0;_<b;++_){const l=n.slice();l[_]=l[_]?l[_]*i:o,y[_+1]=l,y[_+1].fx=t(l),y[_+1].id=_+1}function M(_){for(let l=0;l<_.length;l++)y[b][l]=_[l];y[b].fx=_.fx}const A=(_,l)=>_.fx-l.fx,T=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let _=0;_<e;++_){if(y.sort(A),s.history){const p=y.map(f=>{const O=f.slice();return O.fx=f.fx,O.id=f.id,O});p.sort((f,O)=>f.id-O.id),s.history.push({x:y[0].slice(),fx:y[0].fx,simplex:p})}d=0;for(let p=0;p<b;++p)d=Math.max(d,Math.abs(y[0][p]-y[1][p]));if(Math.abs(y[0].fx-y[b].fx)<a&&d<c)break;for(let p=0;p<b;++p){T[p]=0;for(let f=0;f<b;++f)T[p]+=y[f][p];T[p]/=b}const l=y[b];if(J(S,1+h,T,-h,l),S.fx=t(S),S.fx<y[0].fx)J(m,1+u,T,-u,l),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=y[b-1].fx){let p=!1;if(S.fx>l.fx?(J(g,1+r,T,-r,l),g.fx=t(g),g.fx<l.fx?M(g):p=!0):(J(g,1-r*h,T,r*h,l),g.fx=t(g),g.fx<S.fx?M(g):p=!0),p){if(x>=1)break;for(let f=1;f<y.length;++f)J(y[f],1-x,y[0],x,y[f]),y[f].fx=t(y[f])}}else M(S)}return y.sort(A),{fx:y[0].fx,x:y[0]}}function Wt(t,n,s,e,i,o,a){const c=s.fx,h=$(s.fxprime,n);let u=c,r=c,x=h,d=0;i=i||1,o=o||1e-6,a=a||.1;function b(y,M,A){for(let T=0;T<16;++T)if(i=(y+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=$(e.fxprime,n),u>c+o*i*h||u>=A)M=i;else{if(Math.abs(x)<=-a*h)return i;x*(M-y)>=0&&(M=y),y=i,A=u}return 0}for(let y=0;y<10;++y){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),x=$(e.fxprime,n),u>c+o*i*h||y&&u>=r)return b(d,i,r);if(Math.abs(x)<=-a*h)return i;if(x>=0)return b(i,d,u);r=u,d=i,i*=2}return i}function Kt(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let a,c,h=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),a=e.fxprime.slice(),ut(a,e.fxprime,-1);for(let r=0;r<u;++r){if(h=Wt(t,a,e,i,h),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),!h)ut(a,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const x=$(e.fxprime,e.fxprime),d=Math.max(0,$(o,i.fxprime)/x);J(a,d,a,-1,i.fxprime),c=e,e=i,i=c}if(ct(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:h}),e}function Et(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||Zt,e=n.lossFunction||tt,i=Ht(t,n),o=s(i,n),a=Object.keys(o),c=[];for(const r of a)c.push(o[r].x),c.push(o[r].y);const u=Tt(r=>{const x={};for(let d=0;d<a.length;++d){const b=a[d];x[b]={x:r[2*d],y:r[2*d+1],radius:o[b].radius}}return e(x,i)},c,n).x;for(let r=0;r<a.length;++r){const x=a[r];o[x].x=u[2*r],o[x].y=u[2*r+1]}return o}const zt=1e-10;function ft(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+zt?Math.abs(t-n):Gt(e=>gt(t,n,e)-s,0,t+n)}function Ht(t,n={}){const s=n.distinct,e=t.map(c=>Object.assign({},c));function i(c){return c.join(";")}if(s){const c=new Map;for(const h of e)for(let u=0;u<h.sets.length;u++){const r=String(h.sets[u]);c.set(r,h.size+(c.get(r)||0));for(let x=u+1;x<h.sets.length;x++){const d=String(h.sets[x]),b=`${r};${d}`,y=`${d};${r}`;c.set(b,h.size+(c.get(b)||0)),c.set(y,h.size+(c.get(y)||0))}}for(const h of e)h.sets.length<3&&(h.size=c.get(i(h.sets)))}const o=[],a=new Set;for(const c of e)if(c.sets.length===1)o.push(c.sets[0]);else if(c.sets.length===2){const h=c.sets[0],u=c.sets[1];a.add(i(c.sets)),a.add(i([u,h]))}o.sort((c,h)=>c===h?0:c<h?-1:1);for(let c=0;c<o.length;++c){const h=o[c];for(let u=c+1;u<o.length;++u){const r=o[u];a.has(i([h,r]))||e.push({sets:[h,r],size:0})}}return e}function Yt(t,n,s){const e=It(n.length,n.length),i=It(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const a=s[o.sets[0]],c=s[o.sets[1]],h=Math.sqrt(n[a].size/Math.PI),u=Math.sqrt(n[c].size/Math.PI),r=ft(h,u,o.size);e[a][c]=e[c][a]=r;let x=0;o.size+1e-10>=Math.min(n[a].size,n[c].size)?x=1:o.size<=1e-10&&(x=-1),i[a][c]=i[c][a]=x}),{distances:e,constraints:i}}function Xt(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const a=t[2*o],c=t[2*o+1];for(let h=o+1;h<s.length;++h){const u=t[2*h],r=t[2*h+1],x=s[o][h],d=e[o][h],b=(u-a)*(u-a)+(r-c)*(r-c),y=Math.sqrt(b),M=b-x*x;d>0&&y<=x||d<0&&y>=x||(i+=2*M*M,n[2*o]+=4*M*(a-u),n[2*o+1]+=4*M*(c-r),n[2*h]+=4*M*(u-a),n[2*h+1]+=4*M*(r-c))}}return i}function Zt(t,n={}){let s=Qt(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=Jt(t,n),o=e(i,t),a=e(s,t);o+1e-8<a&&(s=i)}return s}function Jt(t,n={}){const s=n.restarts||10,e=[],i={};for(const d of t)d.sets.length===1&&(i[d.sets[0]]=e.length,e.push(d));let{distances:o,constraints:a}=Yt(t,e,i);const c=ct(o.map(ct))/o.length;o=o.map(d=>d.map(b=>b/c));const h=(d,b)=>Xt(d,b,o,a);let u=null;for(let d=0;d<s;++d){const b=lt(o.length*2).map(Math.random),y=Kt(h,b,n);(!u||y.fx<u.fx)&&(u=y)}const r=u.x,x={};for(let d=0;d<e.length;++d){const b=e[d];x[b.sets[0]]={x:r[2*d]*c,y:r[2*d+1]*c,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const d of n.history)ut(d.x,c);return x}function Qt(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const x of t)if(x.sets.length===1){const d=x.sets[0];e[d]={x:1e10,y:1e10,rowid:e.length,size:x.size,radius:Math.sqrt(x.size/Math.PI)},i[d]=[]}t=t.filter(x=>x.sets.length===2);for(const x of t){let d=x.weight!=null?x.weight:1;const b=x.sets[0],y=x.sets[1];x.size+zt>=Math.min(e[b].size,e[y].size)&&(d=0),i[b].push({set:y,size:x.size,weight:d}),i[y].push({set:b,size:x.size,weight:d})}const o=[];Object.keys(i).forEach(x=>{let d=0;for(let b=0;b<i[x].length;++b)d+=i[x][b].size*i[x][b].weight;o.push({set:x,size:d})});function a(x,d){return d.size-x.size}o.sort(a);const c={};function h(x){return x.set in c}function u(x,d){e[d].x=x.x,e[d].y=x.y,c[d]=!0}u({x:0,y:0},o[0].set);for(let x=1;x<o.length;++x){const d=o[x].set,b=i[d].filter(h),y=e[d];if(b.sort(a),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var r=0;r<b.length;++r){const S=e[b[r].set],g=ft(y.radius,S.radius,b[r].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=r+1;m<b.length;++m){const _=e[b[m].set],l=ft(y.radius,_.radius,b[m].size),p=St({x:S.x,y:S.y,radius:g},{x:_.x,y:_.y,radius:l});M.push(...p)}}let A=1e50,T=M[0];for(const S of M){e[d].x=S.x,e[d].y=S.y;const g=s(e,t);g<A&&(A=g,T=S)}u(T,d)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const a=t[e.sets[0]],c=t[e.sets[1]];i=gt(a.radius,c.radius,q(a,c))}else i=st(e.sets.map(a=>t[a]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function At(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const c=t[e.sets[0]],h=t[e.sets[1]];i=gt(c.radius,h.radius,q(c,h))}else i=st(e.sets.map(c=>t[c]));const o=e.weight!=null?e.weight:1,a=Math.log((i+1)/(e.size+1));s+=o*a*a}return s}function $t(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const a of t)a.x-=i,a.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),a=Math.sin(i);for(const c of t){const h=c.x,u=c.y;c.x=o*h-a*u,c.y=a*h+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const a of t){var e=(a.x+o*a.y)/(1+o*o);a.x=2*e-a.x,a.y=2*e*o-a.y}}}}function te(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const a=n(i),c=n(o);a.parent=c}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const a=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<a&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function ht(t){const n=s=>{const e=t.reduce((o,a)=>Math.max(o,a[s]+a.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,a)=>Math.min(o,a[s]-a.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ot(t).map(u=>Object.assign({},u));const i=te(e);for(const u of i){$t(u,n,s);const r=ht(u);u.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),u.bounds=r}i.sort((u,r)=>r.size-u.size),e=i[0];let o=e.bounds;const a=(o.xRange.max-o.xRange.min)/50;function c(u,r,x){if(!u)return;const d=u.bounds;let b,y;if(r)b=o.xRange.max-d.xRange.min+a;else{b=o.xRange.max-d.xRange.max;const M=(d.xRange.max-d.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(x)y=o.yRange.max-d.yRange.min+a;else{y=o.yRange.max-d.yRange.max;const M=(d.yRange.max-d.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(y+=M)}for(const M of u)M.x+=b,M.y+=y,e.push(M)}let h=1;for(;h<i.length;)c(i[h],!0,!1),c(i[h+1],!1,!0),c(i[h+2],!0,!0),h+=3,o=ht(e);return Rt(e)}function Ct(t,n,s,e,i){const o=Ot(t);n-=2*e,s-=2*e;const{xRange:a,yRange:c}=ht(o);if(a.max===a.min||c.max===c.min)return console.log("not scaling solution: zero size detected"),t;let h,u;if(i){const b=Math.sqrt(i/Math.PI)*2;h=n/b,u=s/b}else h=n/(a.max-a.min),u=s/(c.max-c.min);const r=Math.min(u,h),x=(n-(a.max-a.min)*r)/2,d=(s-(c.max-c.min)*r)/2;return Rt(o.map(b=>({radius:r*b.radius,x:e+x+(b.x-a.min)*r,y:e+d+(b.y-c.min)*r,setid:b.setid})))}function Rt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ot(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ee(t={}){let n=!1,s=600,e=350,i=15,o=1e3,a=Math.PI/2,c=!0,h=null,u=!0,r=!0,x=null,d=null,b=!1,y=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,A={},T=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(p){if(p in A)return A[p];var f=A[p]=T[S];return S+=1,S>=T.length&&(S=0),f},m=Et,_=tt;function l(p){let f=p.datum();const O=new Set;f.forEach(I=>{I.size==0&&I.sets.length==1&&O.add(I.sets[0])}),f=f.filter(I=>!I.sets.some(F=>O.has(F)));let v={},C={};if(f.length>0){let I=m(f,{lossFunction:_,distinct:b});c&&(I=Dt(I,a,d)),v=Ct(I,s,e,i,h),C=Ft(v,f,M)}const U={};f.forEach(I=>{I.label&&(U[I.sets]=I.label)});function j(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}p.selectAll("svg").data([v]).enter().append("svg");const E=p.select("svg");n?E.attr("viewBox",`0 0 ${s} ${e}`):E.attr("width",s).attr("height",e);const D={};let w=!1;E.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(w=!0,D[I.sets[0]]=ie(F))});function P(I){return F=>{const H=I.sets.map(et=>{let Y=D[et],Z=v[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return kt(H,y)}}const V=E.selectAll(".venn-area").data(f,I=>I.sets),N=V.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=N.append("path"),W=N.append("text").attr("class","label").text(I=>j(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);r&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),W.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=p;w&&typeof z.transition=="function"?(z=K(p),z.selectAll("path").attrTween("d",P)):z.selectAll("path").attr("d",I=>kt(I.sets.map(F=>v[F])),y);const L=z.selectAll("text").filter(I=>I.sets in C).text(I=>j(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(w?"on"in L?L.on("end",ot(v,j)):L.each("end",ot(v,j)):L.each(ot(v,j)));const R=K(V.exit()).remove();typeof V.transition=="function"&&R.selectAll("path").attrTween("d",P);const X=R.selectAll("text").attr("x",s/2).attr("y",e/2);return x!==null&&(W.style("font-size","0px"),L.style("font-size",x),X.style("font-size","0px")),{circles:v,textCentres:C,nodes:V,enter:N,update:z,exit:R}}return l.wrap=function(p){return arguments.length?(u=p,l):u},l.useViewBox=function(){return n=!0,l},l.width=function(p){return arguments.length?(s=p,l):s},l.height=function(p){return arguments.length?(e=p,l):e},l.padding=function(p){return arguments.length?(i=p,l):i},l.distinct=function(p){return arguments.length?(b=p,l):b},l.colours=function(p){return arguments.length?(g=p,l):g},l.colors=function(p){return arguments.length?(g=p,l):g},l.fontSize=function(p){return arguments.length?(x=p,l):x},l.round=function(p){return arguments.length?(y=p,l):y},l.duration=function(p){return arguments.length?(o=p,l):o},l.layoutFunction=function(p){return arguments.length?(m=p,l):m},l.normalize=function(p){return arguments.length?(c=p,l):c},l.scaleToFit=function(p){return arguments.length?(h=p,l):h},l.styled=function(p){return arguments.length?(r=p,l):r},l.orientation=function(p){return arguments.length?(a=p,l):a},l.orientationOrder=function(p){return arguments.length?(d=p,l):d},l.lossFunction=function(p){return arguments.length?(_=p==="default"?tt:p==="logRatio"?At:p,l):_},l}function ot(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",a=o.split(/\s+/).reverse(),h=(o.length+a.length)/3;let u=a.pop(),r=[u],x=0;const d=1.1;e.textContent=null;const b=[];function y(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=y(u);for(;u=a.pop(),!!u;){r.push(u);const g=r.join(" ");M.textContent=g,g.length>h&&M.getComputedTextLength()>i&&(r.pop(),M.textContent=r.join(" "),r=[u],M=y(u),x++)}const A=.35-x*d/2,T=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",T),g.setAttribute("y",S),g.setAttribute("dy",`${A+m*d}em`)})}}function rt(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Nt(t,n,s){const e=[];for(const r of t)e.push({x:r.x,y:r.y}),e.push({x:r.x+r.radius/2,y:r.y}),e.push({x:r.x-r.radius/2,y:r.y}),e.push({x:r.x,y:r.y+r.radius/2}),e.push({x:r.x,y:r.y-r.radius/2});let i=e[0],o=rt(e[0],t,n);for(let r=1;r<e.length;++r){const x=rt(e[r],t,n);x>=o&&(i=e[r],o=x)}const a=Tt(r=>-1*rt({x:r[0],y:r[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,c={x:s?0:a[0],y:a[1]};let h=!0;for(const r of t)if(q(c,r)>r.radius){h=!1;break}for(const r of n)if(q(c,r)<r.radius){h=!1;break}if(h)return c;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Nt(t,[]):wt(u.arcs.map(r=>r.p1))}function ne(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let a=e+1;a<s.length;++a){const c=s[a],h=t[c],u=q(o,h);u+h.radius<=o.radius+1e-10?n[c].push(i):u+o.radius<=h.radius+1e-10&&n[i].push(c)}}return n}function Ft(t,n,s){const e={},i=ne(t);for(let o=0;o<n.length;++o){const a=n[o].sets,c={},h={};for(let d=0;d<a.length;++d){c[a[d]]=!0;const b=i[a[d]];for(let y=0;y<b.length;++y)h[b[y]]=!0}const u=[],r=[];for(let d in t)d in c?u.push(t[d]):d in h||r.push(t[d]);const x=Nt(u,r,s);e[a]=x,x.disjoint&&n[o].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return e}function se(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -1,4 +1,4 @@
1
- import { W as a, k as d } from "./mermaid-parser.core-CCHvxUQl.js";
1
+ import { W as a, k as d } from "./mermaid-parser.core-D4IlYn7u.js";
2
2
  export {
3
3
  a as WardleyModule,
4
4
  d as createWardleyServices
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-fjh_cn2l.cjs");exports.WardleyModule=e.WardleyModule;exports.createWardleyServices=e.createWardleyServices;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-S6P-fvNi.cjs");exports.WardleyModule=e.WardleyModule;exports.createWardleyServices=e.createWardleyServices;
@@ -1,6 +1,6 @@
1
- import { _ as y, s as Mt, g as Ct, q as Nt, p as zt, a as Lt, b as Xt, l as Q, I as At, e as Et, z as Tt, c as H, i as Yt } from "./cowboy-components-CxawaKWM.js";
2
- import { p as Bt } from "./chunk-4BX2VUAB-DQ4rU_AZ.js";
3
- import { p as Rt } from "./mermaid-parser.core-CCHvxUQl.js";
1
+ import { _ as y, s as Mt, g as Ct, q as Nt, p as zt, a as Lt, b as Xt, l as Q, I as At, e as Et, z as Tt, c as H, i as Yt } from "./cowboy-components-CPx4P290.js";
2
+ import { p as Bt } from "./chunk-4BX2VUAB-XJuJGw_Z.js";
3
+ import { p as Rt } from "./mermaid-parser.core-D4IlYn7u.js";
4
4
  var q = /* @__PURE__ */ y((a, r) => {
5
5
  const e = a <= 1 ? a * 100 : a;
6
6
  if (e < 0 || e > 100)
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./cowboy-components-CjgqXqkM.cjs"),_t=require("./chunk-4BX2VUAB-DHdTrTTD.cjs"),St=require("./mermaid-parser.core-fjh_cn2l.cjs");var G=h.__name((a,r)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),T=h.__name((a,r,e)=>({x:G(r,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),J=h.__name(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Mt=h.__name(a=>{if(!a?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(a)?.[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Ct=h.__name((a,r)=>{if(_t.populateCommonDb(a,r),a.size&&r.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(n=>n.secondName?`${n.name.trim()} / ${n.secondName.trim()}`:n.name.trim()),x=a.evolution.stages.filter(n=>n.boundary!==void 0).map(n=>n.boundary);r.updateAxes({stages:e,stageBoundaries:x})}if(a.anchors.forEach(e=>{const x=T(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,x.x,x.y,"anchor")}),a.components.forEach(e=>{const x=T(e.visibility,e.evolution,`Component "${e.name}"`),n=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,x.x,x.y,"component",n,d,e.inertia,m)}),a.notes.forEach(e=>{const x=T(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,x.x,x.y)}),a.pipelines.forEach(e=>{const x=r.getNode(e.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const n=x.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,M=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,u=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,F,n,"pipeline-component",M,u),r.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const x=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let n=J(e.fromPort)??J(e.toPort);const{flow:d,label:m}=Mt(e.arrow);!n&&d&&(n=d);const M=e.linkLabel,u=m??M;r.addLink(e.from,e.to,x,u,n)}),a.evolves.forEach(e=>{const x=r.getNode(e.component);if(x?.y!==void 0){const n=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,n,x.y)}}),a.annotations.length>0){const e=a.annotations[0],x=T(e.x,e.y,"Annotations box");r.setAnnotationsBox(x.x,x.y)}a.annotation.forEach(e=>{const x=T(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:x.x,y:x.y}],e.text)}),a.accelerators.forEach(e=>{const x=T(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,x.x,x.y)}),a.deaccelerators.forEach(e=>{const x=T(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,x.x,x.y)})},"populateDb"),K={parser:{yy:void 0},parse:h.__name(async a=>{const r=await St.parse("wardley",a);h.log.debug(r);const e=K.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ct(r,e)},"parse")},E,$t=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},x={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,x)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const x=this.pipelines.get(r);x&&x.componentIds.push(e);const n=this.nodes.get(e);n&&(n.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},h.__name(E,"WardleyBuilder"),E),P=new $t;function S(a){const r=h.getConfig2();return h.sanitizeText(a.trim(),r)}h.__name(S,"textSanitizer");function Q(){return h.getConfig2()["wardley-beta"]}h.__name(Q,"getConfig");function tt(a,r,e,x,n,d,m,M,u){P.addNode({id:a,label:S(r),x:e,y:x,className:n,labelOffsetX:d,labelOffsetY:m,inertia:M,sourceStrategy:u})}h.__name(tt,"addNode");function et(a,r,e=!1,x,n){P.addLink({source:a,target:r,dashed:e,label:x,flow:n})}h.__name(et,"addLink");function at(a,r,e){P.addTrend({nodeId:a,targetX:r,targetY:e})}h.__name(at,"addTrend");function rt(a,r,e){P.addAnnotation({number:a,coordinates:r,text:e?S(e):void 0})}h.__name(rt,"addAnnotation");function ot(a,r,e){P.addNote({text:S(a),x:r,y:e})}h.__name(ot,"addNote");function nt(a,r,e){P.addAccelerator({name:S(a),x:r,y:e})}h.__name(nt,"addAccelerator");function st(a,r,e){P.addDeaccelerator({name:S(a),x:r,y:e})}h.__name(st,"addDeaccelerator");function it(a,r){P.setAnnotationsBox(a,r)}h.__name(it,"setAnnotationsBox");function dt(a,r){P.setSize(a,r)}h.__name(dt,"setSize");function lt(a){P.startPipeline(a)}h.__name(lt,"startPipeline");function ct(a,r){P.addPipelineComponent(a,r)}h.__name(ct,"addPipelineComponent");function pt(a){const r={};a.xLabel&&(r.xLabel=S(a.xLabel)),a.yLabel&&(r.yLabel=S(a.yLabel)),a.stages&&(r.stages=a.stages.map(e=>S(e))),a.stageBoundaries&&(r.stageBoundaries=a.stageBoundaries),P.setAxes(r)}h.__name(pt,"updateAxes");function gt(a){return P.getNode(a)}h.__name(gt,"getNode");function ht(){return P.build()}h.__name(ht,"getWardleyData");function ft(){P.clear(),h.clear()}h.__name(ft,"clear");var Nt={getConfig:Q,addNode:tt,addLink:et,addTrend:at,addAnnotation:rt,addNote:ot,addAccelerator:nt,addDeaccelerator:st,setAnnotationsBox:it,setSize:dt,startPipeline:lt,addPipelineComponent:ct,updateAxes:pt,getNode:gt,getWardleyData:ht,clear:ft,setAccTitle:h.setAccTitle,getAccTitle:h.getAccTitle,setDiagramTitle:h.setDiagramTitle,getDiagramTitle:h.getDiagramTitle,getAccDescription:h.getAccDescription,setAccDescription:h.setAccDescription},Lt=["Genesis","Custom Built","Product","Commodity"],zt=h.__name(()=>{const{themeVariables:a}=h.getConfig2();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),At=h.__name(()=>{const a=h.getConfig2()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Tt=h.__name((a,r,e,x)=>{h.log.debug(`Rendering Wardley map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./cowboy-components-DDfCPnUY.cjs"),_t=require("./chunk-4BX2VUAB-D4UkiLWV.cjs"),St=require("./mermaid-parser.core-S6P-fvNi.cjs");var G=h.__name((a,r)=>{const e=a<=1?a*100:a;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${a}`);return e},"toPercent"),T=h.__name((a,r,e)=>({x:G(r,`${e} evolution`),y:G(a,`${e} visibility`)}),"toCoordinates"),J=h.__name(a=>{if(a){if(a==="+<>")return"bidirectional";if(a==="+<")return"backward";if(a==="+>")return"forward"}},"getFlowFromPort"),Mt=h.__name(a=>{if(!a?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(a)?.[1];return a.includes("<>")?{flow:"bidirectional",label:e}:a.includes("<")?{flow:"backward",label:e}:a.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Ct=h.__name((a,r)=>{if(_t.populateCommonDb(a,r),a.size&&r.setSize(a.size.width,a.size.height),a.evolution){const e=a.evolution.stages.map(n=>n.secondName?`${n.name.trim()} / ${n.secondName.trim()}`:n.name.trim()),x=a.evolution.stages.filter(n=>n.boundary!==void 0).map(n=>n.boundary);r.updateAxes({stages:e,stageBoundaries:x})}if(a.anchors.forEach(e=>{const x=T(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,x.x,x.y,"anchor")}),a.components.forEach(e=>{const x=T(e.visibility,e.evolution,`Component "${e.name}"`),n=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,m=e.decorator?.strategy;r.addNode(e.name,e.name,x.x,x.y,"component",n,d,e.inertia,m)}),a.notes.forEach(e=>{const x=T(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,x.x,x.y)}),a.pipelines.forEach(e=>{const x=r.getNode(e.parent);if(!x||typeof x.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const n=x.y;r.startPipeline(e.parent),e.components.forEach(d=>{const m=`${e.parent}_${d.name}`,M=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,u=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,F=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(m,d.name,F,n,"pipeline-component",M,u),r.addPipelineComponent(e.parent,m)})}),a.links.forEach(e=>{const x=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let n=J(e.fromPort)??J(e.toPort);const{flow:d,label:m}=Mt(e.arrow);!n&&d&&(n=d);const M=e.linkLabel,u=m??M;r.addLink(e.from,e.to,x,u,n)}),a.evolves.forEach(e=>{const x=r.getNode(e.component);if(x?.y!==void 0){const n=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,n,x.y)}}),a.annotations.length>0){const e=a.annotations[0],x=T(e.x,e.y,"Annotations box");r.setAnnotationsBox(x.x,x.y)}a.annotation.forEach(e=>{const x=T(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:x.x,y:x.y}],e.text)}),a.accelerators.forEach(e=>{const x=T(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,x.x,x.y)}),a.deaccelerators.forEach(e=>{const x=T(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,x.x,x.y)})},"populateDb"),K={parser:{yy:void 0},parse:h.__name(async a=>{const r=await St.parse("wardley",a);h.log.debug(r);const e=K.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ct(r,e)},"parse")},E,$t=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},x={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,x)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const x=this.pipelines.get(r);x&&x.componentIds.push(e);const n=this.nodes.get(e);n&&(n.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},h.__name(E,"WardleyBuilder"),E),P=new $t;function S(a){const r=h.getConfig2();return h.sanitizeText(a.trim(),r)}h.__name(S,"textSanitizer");function Q(){return h.getConfig2()["wardley-beta"]}h.__name(Q,"getConfig");function tt(a,r,e,x,n,d,m,M,u){P.addNode({id:a,label:S(r),x:e,y:x,className:n,labelOffsetX:d,labelOffsetY:m,inertia:M,sourceStrategy:u})}h.__name(tt,"addNode");function et(a,r,e=!1,x,n){P.addLink({source:a,target:r,dashed:e,label:x,flow:n})}h.__name(et,"addLink");function at(a,r,e){P.addTrend({nodeId:a,targetX:r,targetY:e})}h.__name(at,"addTrend");function rt(a,r,e){P.addAnnotation({number:a,coordinates:r,text:e?S(e):void 0})}h.__name(rt,"addAnnotation");function ot(a,r,e){P.addNote({text:S(a),x:r,y:e})}h.__name(ot,"addNote");function nt(a,r,e){P.addAccelerator({name:S(a),x:r,y:e})}h.__name(nt,"addAccelerator");function st(a,r,e){P.addDeaccelerator({name:S(a),x:r,y:e})}h.__name(st,"addDeaccelerator");function it(a,r){P.setAnnotationsBox(a,r)}h.__name(it,"setAnnotationsBox");function dt(a,r){P.setSize(a,r)}h.__name(dt,"setSize");function lt(a){P.startPipeline(a)}h.__name(lt,"startPipeline");function ct(a,r){P.addPipelineComponent(a,r)}h.__name(ct,"addPipelineComponent");function pt(a){const r={};a.xLabel&&(r.xLabel=S(a.xLabel)),a.yLabel&&(r.yLabel=S(a.yLabel)),a.stages&&(r.stages=a.stages.map(e=>S(e))),a.stageBoundaries&&(r.stageBoundaries=a.stageBoundaries),P.setAxes(r)}h.__name(pt,"updateAxes");function gt(a){return P.getNode(a)}h.__name(gt,"getNode");function ht(){return P.build()}h.__name(ht,"getWardleyData");function ft(){P.clear(),h.clear()}h.__name(ft,"clear");var Nt={getConfig:Q,addNode:tt,addLink:et,addTrend:at,addAnnotation:rt,addNote:ot,addAccelerator:nt,addDeaccelerator:st,setAnnotationsBox:it,setSize:dt,startPipeline:lt,addPipelineComponent:ct,updateAxes:pt,getNode:gt,getWardleyData:ht,clear:ft,setAccTitle:h.setAccTitle,getAccTitle:h.getAccTitle,setDiagramTitle:h.setDiagramTitle,getDiagramTitle:h.getDiagramTitle,getAccDescription:h.getAccDescription,setAccDescription:h.setAccDescription},Lt=["Genesis","Custom Built","Product","Commodity"],zt=h.__name(()=>{const{themeVariables:a}=h.getConfig2();return{backgroundColor:a.wardley?.backgroundColor??a.background??"#fff",axisColor:a.wardley?.axisColor??"#000",axisTextColor:a.wardley?.axisTextColor??a.primaryTextColor??"#222",gridColor:a.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:a.wardley?.componentFill??"#fff",componentStroke:a.wardley?.componentStroke??"#000",componentLabelColor:a.wardley?.componentLabelColor??a.primaryTextColor??"#222",linkStroke:a.wardley?.linkStroke??"#000",evolutionStroke:a.wardley?.evolutionStroke??"#dc3545",annotationStroke:a.wardley?.annotationStroke??"#000",annotationTextColor:a.wardley?.annotationTextColor??a.primaryTextColor??"#222",annotationFill:a.wardley?.annotationFill??a.background??"#fff"}},"getTheme"),At=h.__name(()=>{const a=h.getConfig2()["wardley-beta"];return{width:a?.width??900,height:a?.height??600,padding:a?.padding??48,nodeRadius:a?.nodeRadius??6,nodeLabelOffset:a?.nodeLabelOffset??8,axisFontSize:a?.axisFontSize??12,labelFontSize:a?.labelFontSize??10,showGrid:a?.showGrid??!1,useMaxWidth:a?.useMaxWidth??!0}},"getConfigValues"),Tt=h.__name((a,r,e,x)=>{h.log.debug(`Rendering Wardley map
2
2
  `+a);const n=At(),d=zt(),m=n.nodeRadius*1.6,M=x.db,u=M.getWardleyData(),F=M.getDiagramTitle(),C=u.size?.width??n.width,b=u.size?.height??n.height,B=h.selectSvgElement(r);B.selectAll("*").remove(),h.configureSvgSize(B,b,C,n.useMaxWidth),B.attr("viewBox",`0 0 ${C} ${b}`);const v=B.append("g").attr("class","wardley-map"),q=B.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",C).attr("height",b).attr("fill",d.backgroundColor);const Y=C-n.padding*2,O=b-n.padding*2;F&&v.append("text").attr("class","wardley-title").attr("x",C/2).attr("y",n.padding/2).attr("fill",d.axisTextColor).attr("font-size",n.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(F);const L=h.__name(t=>n.padding+t/100*Y,"projectX"),z=h.__name(t=>b-n.padding-t/100*O,"projectY"),D=v.append("g").attr("class","wardley-axes");D.append("line").attr("x1",n.padding).attr("x2",C-n.padding).attr("y1",b-n.padding).attr("y2",b-n.padding).attr("stroke",d.axisColor).attr("stroke-width",1),D.append("line").attr("x1",n.padding).attr("x2",n.padding).attr("y1",n.padding).attr("y2",b-n.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const xt=u.axes.xLabel??"Evolution",ut=u.axes.yLabel??"Visibility";D.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",n.padding+Y/2).attr("y",b-n.padding/4).attr("fill",d.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(xt),D.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",n.padding/3).attr("y",n.padding+O/2).attr("fill",d.axisTextColor).attr("font-size",n.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${n.padding/3} ${n.padding+O/2})`).text(ut);const R=u.axes.stages&&u.axes.stages.length>0?u.axes.stages:Lt;if(R.length>0){const t=v.append("g").attr("class","wardley-stages"),s=u.axes.stageBoundaries,o=[];if(s&&s.length===R.length){let i=0;s.forEach(p=>{o.push({start:i,end:p}),i=p})}else{const i=1/R.length;R.forEach((p,l)=>{o.push({start:l*i,end:(l+1)*i})})}R.forEach((i,p)=>{const l=o[p],g=n.padding+l.start*Y,f=n.padding+l.end*Y,y=(g+f)/2;p>0&&t.append("line").attr("x1",g).attr("x2",g).attr("y1",n.padding).attr("y2",b-n.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-n.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",n.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(n.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const o=s/4,i=n.padding+Y*o;t.append("line").attr("x1",i).attr("x2",i).attr("y1",n.padding).attr("y2",b-n.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",n.padding).attr("x2",C-n.padding).attr("y1",b-n.padding-O*o).attr("y2",b-n.padding-O*o).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(u.nodes.forEach(t=>{c.set(t.id,{x:L(t.x),y:z(t.y),node:t})}),u.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");u.pipelines.forEach(o=>{if(o.componentIds.length===0)return;const i=o.componentIds.map(f=>({id:f,pos:c.get(f),node:u.nodes.find(y=>y.id===f)})).filter(f=>f.pos&&f.node).sort((f,y)=>f.node.x-y.node.x);for(let f=0;f<i.length-1;f++){const y=i[f],w=i[f+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",w.pos.x).attr("y2",w.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,g=0;if(o.componentIds.forEach(f=>{const y=c.get(f);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),g=y.y)}),p!==1/0&&l!==-1/0){const y=n.nodeRadius*4,w=g-y/2,_=c.get(o.nodeId);if(_){const N=(p+l)/2;_.x=N,_.y=w-m/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",w).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const V=v.append("g").attr("class","wardley-links"),U=new Map;u.pipelines.forEach(t=>{U.set(t.nodeId,new Set(t.componentIds))});const Z=u.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||U.get(t.target)?.has(t.source)));V.selectAll("line").data(Z).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),o=c.get(t.target),p=u.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):n.nodeRadius,l=o.x-s.x,g=o.y-s.y,f=Math.sqrt(l*l+g*g);return s.x+l/f*p}).attr("y1",t=>{const s=c.get(t.source),o=c.get(t.target),p=u.nodes.find(y=>y.id===t.source).isPipelineParent?m/Math.sqrt(2):n.nodeRadius,l=o.x-s.x,g=o.y-s.y,f=Math.sqrt(l*l+g*g);return s.y+g/f*p}).attr("x2",t=>{const s=c.get(t.source),o=c.get(t.target),p=u.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):n.nodeRadius,l=s.x-o.x,g=s.y-o.y,f=Math.sqrt(l*l+g*g);return o.x+l/f*p}).attr("y2",t=>{const s=c.get(t.source),o=c.get(t.target),p=u.nodes.find(y=>y.id===t.target).isPipelineParent?m/Math.sqrt(2):n.nodeRadius,l=s.x-o.x,g=s.y-o.y,f=Math.sqrt(l*l+g*g);return o.y+g/f*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),V.selectAll("text").data(Z.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=o.y-s.y,l=o.x-s.x,g=Math.sqrt(l*l+p*p),f=8,y=p/g;return i+y*f}).attr("y",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.y+o.y)/2,p=o.x-s.x,l=o.y-s.y,g=Math.sqrt(p*p+l*l),f=8,y=-p/g;return i+y*f}).attr("fill",d.axisTextColor).attr("font-size",n.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),o=c.get(t.target),i=(s.x+o.x)/2,p=(s.y+o.y)/2,l=o.x-s.x,g=o.y-s.y,f=Math.sqrt(l*l+g*g),y=8,w=g/f,_=-l/f,N=i+w*y,I=p+_*y;let X=Math.atan2(g,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${I})`}).text(t=>t.label);const yt=v.append("g").attr("class","wardley-trends"),mt=u.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const o=L(t.targetX),i=z(t.targetY),p=o-s.x,l=i-s.y,g=Math.sqrt(p*p+l*l),f=n.nodeRadius+2,y=g>f?o-p/g*f:o,w=g>f?i-l/g*f:i;return{origin:s,targetX:o,targetY:i,adjustedX2:y,adjustedY2:w}}).filter(t=>t!==null);yt.selectAll("line").data(mt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const $=v.append("g").attr("class","wardley-nodes").selectAll("g").data(u.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));$.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",n.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),$.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",n.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),$.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",n.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const A=$.filter(t=>t.sourceStrategy==="market");A.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",n.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),$.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",n.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=n.nodeRadius*.7,k=n.nodeRadius*1.2;if(A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-k).attr("x2",t=>c.get(t.id).x-k*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-k*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+k*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+k*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-k).attr("stroke",d.componentStroke).attr("stroke-width",1),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-k).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-k*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),A.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+k*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+k*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),$.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-m/2).attr("y",t=>c.get(t.id).y-m/2).attr("width",m).attr("height",m).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),$.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let o=t.isPipelineParent?m/2+15:n.nodeRadius+15;return t.sourceStrategy&&(o+=n.nodeRadius+10),s.x+o}).attr("y1",t=>{const s=c.get(t.id),o=t.isPipelineParent?m:n.nodeRadius*2;return s.y-o/2}).attr("x2",t=>{const s=c.get(t.id);let o=t.isPipelineParent?m/2+15:n.nodeRadius+15;return t.sourceStrategy&&(o+=n.nodeRadius+10),s.x+o}).attr("y2",t=>{const s=c.get(t.id),o=t.isPipelineParent?m:n.nodeRadius*2;return s.y+o/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),$.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let o=n.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(o+=10);const i=t.labelOffsetX??o;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let o=-n.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(o-=10);const i=t.labelOffsetY??o;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",n.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),u.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(u.annotations.forEach(s=>{const o=s.coordinates.map(i=>({x:L(i.x),y:z(i.y)}));if(o.length>1)for(let i=0;i<o.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",o[i].x).attr("y1",o[i].y).attr("x2",o[i+1].x).attr("y2",o[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");o.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),u.annotationsBox){let s=L(u.annotationsBox.x),o=z(u.annotationsBox.y);const i=10,p=16,l=11,g=t.append("g").attr("class","wardley-annotations-box"),f=[...u.annotations].filter(w=>w.text).sort((w,_)=>w.number-_.number),y=[];if(f.forEach((w,_)=>{const N=g.append("text").attr("x",s+i).attr("y",o+i+(_+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${w.number}. ${w.text}`);y.push(N)}),y.length>0){let w=0,_=0;y.forEach(j=>{const W=j.node(),Pt=W.getComputedTextLength();w=Math.max(w,Pt);const vt=W.getBBox();_=Math.max(_,vt.height)});const N=w+i*2+105,I=f.length*p+i*2+_/2,X=n.padding,wt=C-n.padding-N,bt=n.padding,kt=b-n.padding-I;s=Math.max(X,Math.min(s,wt)),o=Math.max(bt,Math.min(o,kt)),y.forEach((j,W)=>{j.attr("x",s+i).attr("y",o+i+(W+1)*p)}),g.insert("rect","text").attr("x",s).attr("y",o).attr("width",N).attr("height",I).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(u.notes.length>0){const t=v.append("g").attr("class","wardley-notes");u.notes.forEach(s=>{const o=L(s.x),i=z(s.y);t.append("text").attr("x",o).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(u.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");u.accelerators.forEach(s=>{const o=L(s.x),i=z(s.y),p=60,l=30,g=20,f=`
3
3
  M ${o} ${i-l/2}
4
4
  L ${o+p-g} ${i-l/2}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./cowboy-components-CjgqXqkM.cjs"),he=require("./init-CHZsXQcr.cjs"),le=require("./ordinal-CagbB1m8.cjs"),Bt=require("./linear-CuHSYSeN.cjs"),Wt=require("./change-list-item-4xBSo3-U.cjs");function ce(i,t,e){i=+i,t=+t,e=(a=arguments.length)<2?(t=i,i=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((t-i)/e))|0,o=new Array(a);++s<a;)o[s]=i+s*e;return o}function _t(){var i=le.ordinal().unknown(void 0),t=i.domain,e=i.range,s=0,a=1,o,u,p=!1,f=0,R=0,P=.5;delete i.unknown;function S(){var y=t().length,E=a<s,v=E?a:s,L=E?s:a;o=(L-v)/Math.max(1,y-f+R*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var M=ce(y).map(function(m){return v+o*m});return e(E?M.reverse():M)}return i.domain=function(y){return arguments.length?(t(y),S()):t()},i.range=function(y){return arguments.length?([s,a]=y,s=+s,a=+a,S()):[s,a]},i.rangeRound=function(y){return[s,a]=y,s=+s,a=+a,p=!0,S()},i.bandwidth=function(){return u},i.step=function(){return o},i.round=function(y){return arguments.length?(p=!!y,S()):p},i.padding=function(y){return arguments.length?(f=Math.min(1,R=+y),S()):f},i.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),S()):f},i.paddingOuter=function(y){return arguments.length?(R=+y,S()):R},i.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),S()):P},i.copy=function(){return _t(t(),[s,a]).round(p).paddingInner(f).paddingOuter(R).align(P)},he.initRange.apply(S(),arguments)}var bt=(function(){var i=n.__name(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],R=[1,26],P=[1,28],S=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],m=[1,35],T=[1,36],l=[1,37],W=[1,43],z=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],V={trace:n.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n.__name(function(h,c,g,x,w,r,rt){var d=r.length-1;switch(w){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,34:a,35:o,36:u}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,34:a,35:o,36:u}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},i(p,[2,34]),i(p,[2,35]),i(p,[2,36]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,34:a,35:o,36:u}),{1:[2,3]},i(p,[2,5]),i(t,[2,7],{4:22,34:a,35:o,36:u}),{11:23,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:49,17:48,24:Y,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:52,17:51,24:Y,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{20:[1,53]},{22:[1,54]},i(C,[2,18]),{1:[2,2]},i(C,[2,8]),i(C,[2,9]),i(U,[2,37],{40:55,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l}),i(U,[2,38]),i(U,[2,39]),i(_,[2,40]),i(_,[2,42]),i(_,[2,43]),i(_,[2,44]),i(_,[2,45]),i(_,[2,46]),i(_,[2,47]),i(_,[2,48]),i(_,[2,49]),i(_,[2,50]),i(_,[2,51]),i(C,[2,10]),i(C,[2,22],{30:41,29:56,24:W,27:z}),i(C,[2,24]),i(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},i(C,[2,11]),i(C,[2,30],{33:60,27:X}),i(C,[2,32]),{31:[1,61]},i(C,[2,12]),{17:62,24:Y},{25:63,27:A},i(C,[2,14]),{17:65,24:Y},i(C,[2,16]),i(C,[2,17]),i(_,[2,41]),i(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},i(C,[2,31]),{27:[1,69]},i(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},i(C,[2,15]),i(C,[2,26]),i(C,[2,27]),{11:59,32:72,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},i(C,[2,33]),i(C,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n.__name(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:n.__name(function(h){var c=this,g=[0],x=[],w=[null],r=[],rt=this.table,d="",ct=0,Et=0,ne=2,Mt=1,ae=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var re=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(B){g.length=g.length-2*B,w.length=w.length-B,r.length=r.length-B}n.__name(oe,"popStack");function It(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}n.__name(It,"lex");for(var I,q,O,mt,j={},ut,N,Vt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?O=this.defaultActions[q]:((I===null||typeof I>"u")&&(I=It()),O=rt[q]&&rt[q][I]),typeof O>"u"||!O.length||!O[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>ne&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./cowboy-components-DDfCPnUY.cjs"),he=require("./init-CHZsXQcr.cjs"),le=require("./ordinal-CagbB1m8.cjs"),Bt=require("./linear-D1T5mBBn.cjs"),Wt=require("./change-list-item-Dy1GNFQ8.cjs");function ce(i,t,e){i=+i,t=+t,e=(a=arguments.length)<2?(t=i,i=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((t-i)/e))|0,o=new Array(a);++s<a;)o[s]=i+s*e;return o}function _t(){var i=le.ordinal().unknown(void 0),t=i.domain,e=i.range,s=0,a=1,o,u,p=!1,f=0,R=0,P=.5;delete i.unknown;function S(){var y=t().length,E=a<s,v=E?a:s,L=E?s:a;o=(L-v)/Math.max(1,y-f+R*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-f))*P,u=o*(1-f),p&&(v=Math.round(v),u=Math.round(u));var M=ce(y).map(function(m){return v+o*m});return e(E?M.reverse():M)}return i.domain=function(y){return arguments.length?(t(y),S()):t()},i.range=function(y){return arguments.length?([s,a]=y,s=+s,a=+a,S()):[s,a]},i.rangeRound=function(y){return[s,a]=y,s=+s,a=+a,p=!0,S()},i.bandwidth=function(){return u},i.step=function(){return o},i.round=function(y){return arguments.length?(p=!!y,S()):p},i.padding=function(y){return arguments.length?(f=Math.min(1,R=+y),S()):f},i.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),S()):f},i.paddingOuter=function(y){return arguments.length?(R=+y,S()):R},i.align=function(y){return arguments.length?(P=Math.max(0,Math.min(1,y)),S()):P},i.copy=function(){return _t(t(),[s,a]).round(p).paddingInner(f).paddingOuter(R).align(P)},he.initRange.apply(S(),arguments)}var bt=(function(){var i=n.__name(function(F,h,c,g){for(c=c||{},g=F.length;g--;c[F[g]]=h);return c},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],o=[1,6],u=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],f=[1,25],R=[1,26],P=[1,28],S=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],m=[1,35],T=[1,36],l=[1,37],W=[1,43],z=[1,42],X=[1,47],Y=[1,50],C=[1,10,12,14,16,18,19,21,23,34,35,36],U=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],_=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],A=[1,64],V={trace:n.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n.__name(function(h,c,g,x,w,r,rt){var d=r.length-1;switch(w){case 5:x.setOrientation(r[d]);break;case 9:x.setDiagramTitle(r[d].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[d]);break;case 13:x.setLineData(r[d-1],r[d]);break;case 14:x.setBarData({text:"",type:"text"},r[d]);break;case 15:x.setBarData(r[d-1],r[d]);break;case 16:this.$=r[d].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[d].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[d-1];break;case 20:this.$=[Number(r[d-2]),...r[d]];break;case 21:this.$=[Number(r[d])];break;case 22:x.setXAxisTitle(r[d]);break;case 23:x.setXAxisTitle(r[d-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(r[d]);break;case 26:x.setXAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 27:this.$=r[d-1];break;case 28:this.$=[r[d-2],...r[d]];break;case 29:this.$=[r[d]];break;case 30:x.setYAxisTitle(r[d]);break;case 31:x.setYAxisTitle(r[d-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(r[d-2]),Number(r[d]));break;case 37:this.$={text:r[d],type:"text"};break;case 38:this.$={text:r[d],type:"text"};break;case 39:this.$={text:r[d],type:"markdown"};break;case 40:this.$=r[d];break;case 41:this.$=r[d-1]+""+r[d];break}},"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,34:a,35:o,36:u}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,34:a,35:o,36:u}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:o,36:u}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},i(p,[2,34]),i(p,[2,35]),i(p,[2,36]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,34:a,35:o,36:u}),{1:[2,3]},i(p,[2,5]),i(t,[2,7],{4:22,34:a,35:o,36:u}),{11:23,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:45,15:44,27:X,33:46,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:49,17:48,24:Y,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{11:52,17:51,24:Y,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},{20:[1,53]},{22:[1,54]},i(C,[2,18]),{1:[2,2]},i(C,[2,8]),i(C,[2,9]),i(U,[2,37],{40:55,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l}),i(U,[2,38]),i(U,[2,39]),i(_,[2,40]),i(_,[2,42]),i(_,[2,43]),i(_,[2,44]),i(_,[2,45]),i(_,[2,46]),i(_,[2,47]),i(_,[2,48]),i(_,[2,49]),i(_,[2,50]),i(_,[2,51]),i(C,[2,10]),i(C,[2,22],{30:41,29:56,24:W,27:z}),i(C,[2,24]),i(C,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},i(C,[2,11]),i(C,[2,30],{33:60,27:X}),i(C,[2,32]),{31:[1,61]},i(C,[2,12]),{17:62,24:Y},{25:63,27:A},i(C,[2,14]),{17:65,24:Y},i(C,[2,16]),i(C,[2,17]),i(_,[2,41]),i(C,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},i(C,[2,31]),{27:[1,69]},i(C,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},i(C,[2,15]),i(C,[2,26]),i(C,[2,27]),{11:59,32:72,37:24,38:f,39:R,40:27,41:P,42:S,43:y,44:E,45:v,46:L,47:M,48:m,49:T,50:l},i(C,[2,33]),i(C,[2,19]),{25:73,27:A},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n.__name(function(h,c){if(c.recoverable)this.trace(h);else{var g=new Error(h);throw g.hash=c,g}},"parseError"),parse:n.__name(function(h){var c=this,g=[0],x=[],w=[null],r=[],rt=this.table,d="",ct=0,Et=0,ne=2,Mt=1,ae=r.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ft)&&($.yy[ft]=this.yy[ft]);D.setInput(h,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var pt=D.yylloc;r.push(pt);var re=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(B){g.length=g.length-2*B,w.length=w.length-B,r.length=r.length-B}n.__name(oe,"popStack");function It(){var B;return B=x.pop()||D.lex()||Mt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=c.symbols_[B]||B),B}n.__name(It,"lex");for(var I,q,O,mt,j={},ut,N,Vt,gt;;){if(q=g[g.length-1],this.defaultActions[q]?O=this.defaultActions[q]:((I===null||typeof I>"u")&&(I=It()),O=rt[q]&&rt[q][I]),typeof O>"u"||!O.length||!O[0]){var yt="";gt=[];for(ut in rt[q])this.terminals_[ut]&&ut>ne&&gt.push("'"+this.terminals_[ut]+"'");D.showPosition?yt="Parse error on line "+(ct+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+gt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":yt="Parse error on line "+(ct+1)+": Unexpected "+(I==Mt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(yt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:pt,expected:gt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+I);switch(O[0]){case 1:g.push(I),w.push(D.yytext),r.push(D.yylloc),g.push(O[1]),I=null,Et=D.yyleng,d=D.yytext,ct=D.yylineno,pt=D.yylloc;break;case 2:if(N=this.productions_[O[1]][1],j.$=w[w.length-N],j._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(j._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),mt=this.performAction.apply(j,[d,Et,ct,$.yy,O[1],w,r].concat(ae)),typeof mt<"u")return mt;N&&(g=g.slice(0,-1*N*2),w=w.slice(0,-1*N),r=r.slice(0,-1*N)),g.push(this.productions_[O[1]][0]),w.push(j.$),r.push(j._$),Vt=rt[g[g.length-2]][g[g.length-1]],g.push(Vt);break;case 3:return!0}}return!0},"parse")},k=(function(){var F={EOF:1,parseError:n.__name(function(c,g){if(this.yy.parser)this.yy.parser.parseError(c,g);else throw new Error(c)},"parseError"),setInput:n.__name(function(h,c){return this.yy=c||this.yy||{},this._input=h,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n.__name(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var c=h.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n.__name(function(h){var c=h.length,g=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var w=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n.__name(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n.__name(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n.__name(function(){var h=this.pastInput(),c=new Array(h.length+1).join("-");return h+this.upcomingInput()+`