@harperfast/harper 5.2.13 → 5.2.14

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 (264) hide show
  1. package/components/Application.ts +7 -7
  2. package/components/componentLoader.ts +70 -33
  3. package/dist/components/Application.js +1 -7
  4. package/dist/components/Application.js.map +1 -1
  5. package/dist/components/componentLoader.d.ts +6 -0
  6. package/dist/components/componentLoader.js +60 -31
  7. package/dist/components/componentLoader.js.map +1 -1
  8. package/dist/resources/RocksTransactionLogStore.d.ts +4 -2
  9. package/dist/resources/RocksTransactionLogStore.js +12 -6
  10. package/dist/resources/RocksTransactionLogStore.js.map +1 -1
  11. package/dist/resources/Table.js +40 -4
  12. package/dist/resources/Table.js.map +1 -1
  13. package/dist/resources/replayLogs.js +25 -21
  14. package/dist/resources/replayLogs.js.map +1 -1
  15. package/dist/resources/transactionBroadcast.js +4 -6
  16. package/dist/resources/transactionBroadcast.js.map +1 -1
  17. package/dist/security/certificateVerification/index.js +40 -11
  18. package/dist/security/certificateVerification/index.js.map +1 -1
  19. package/dist/security/certificateVerification/trustedIssuers.d.ts +24 -0
  20. package/dist/security/certificateVerification/trustedIssuers.js +79 -0
  21. package/dist/security/certificateVerification/trustedIssuers.js.map +1 -0
  22. package/dist/security/certificateVerification/types.d.ts +1 -0
  23. package/dist/security/keys.js +4 -0
  24. package/dist/security/keys.js.map +1 -1
  25. package/dist/server/loadRootComponents.js +4 -2
  26. package/dist/server/loadRootComponents.js.map +1 -1
  27. package/dist/server/threads/manageThreads.d.ts +1 -0
  28. package/dist/server/threads/manageThreads.js +175 -24
  29. package/dist/server/threads/manageThreads.js.map +1 -1
  30. package/npm-shrinkwrap.json +2 -2
  31. package/package.json +1 -1
  32. package/resources/DESIGN.md +5 -0
  33. package/resources/RocksTransactionLogStore.ts +12 -6
  34. package/resources/Table.ts +39 -4
  35. package/resources/replayLogs.ts +25 -22
  36. package/resources/transactionBroadcast.ts +4 -4
  37. package/security/certificateVerification/index.ts +54 -13
  38. package/security/certificateVerification/trustedIssuers.ts +76 -0
  39. package/security/certificateVerification/types.ts +1 -0
  40. package/security/keys.ts +3 -0
  41. package/server/DESIGN.md +14 -13
  42. package/server/loadRootComponents.js +9 -2
  43. package/server/threads/manageThreads.js +176 -23
  44. package/studio/web/404.html +79 -0
  45. package/studio/web/assets/{Chat-4RrB5134.js → Chat-C97PMlIn.js} +274 -247
  46. package/studio/web/assets/FloatingChat-BUlsFGMV.js +23 -0
  47. package/studio/web/assets/_basePickBy-QJXUw_pr.js +1 -0
  48. package/studio/web/assets/_baseUniq-DR4vVjyC.js +1 -0
  49. package/studio/web/assets/{abnfDiagram-VCTEODGH-B0BebmD2.js → abnfDiagram-O67JEVCF-DpPZWMOf.js} +1 -1
  50. package/studio/web/assets/{alertDialog-CQyAJJhl.js → alertDialog-UrbiMgQt.js} +1 -1
  51. package/studio/web/assets/{apiToken-Bke3wvfZ.js → apiToken-CPhbc_zN.js} +1 -1
  52. package/studio/web/assets/applications-D3Z6BVDl.js +296 -0
  53. package/studio/web/assets/architecture-7GRP2DOG-11l4Ny1l.js +1 -0
  54. package/studio/web/assets/architectureDiagram-NJMV4G6O-OmgLraID.js +36 -0
  55. package/studio/web/assets/authStore-5jSS5pTW.js +3 -0
  56. package/studio/web/assets/{blockDiagram-I7D4REHJ-BqguiadH.js → blockDiagram-BEXU5L5S-Cv7CD3Ai.js} +15 -4
  57. package/studio/web/assets/{button-BIsUKRZq.js → button-MFP9n8Ck.js} +1 -1
  58. package/studio/web/assets/c4Diagram-YGBWAQC7-Ds1vKYnN.js +38 -0
  59. package/studio/web/assets/channel-BDtouPd6.js +1 -0
  60. package/studio/web/assets/chevron-up-CFe8x5Bp.js +1 -0
  61. package/studio/web/assets/chunk-3FUC2YCW-DpnBPH8B.js +2 -0
  62. package/studio/web/assets/{chunk-GVQU2GXP-sbwVIQ8i.js → chunk-5DYCD2WN-LLLCQSzg.js} +1 -1
  63. package/studio/web/assets/{chunk-PWAF6VOD-1z1THyS5.js → chunk-742MDFTN-BL8J_pIO.js} +1 -1
  64. package/studio/web/assets/chunk-7INBJB4K-C-hJHiiK.js +62 -0
  65. package/studio/web/assets/chunk-7M6MHVWA-C6ZqkFbA.js +213 -0
  66. package/studio/web/assets/chunk-7PRAP22T-CUXM8BG6.js +1 -0
  67. package/studio/web/assets/chunk-DUW6YSOI-Dgx8z5s3.js +1 -0
  68. package/studio/web/assets/{chunk-FOHPRMQF-DHwB1DNv.js → chunk-FOHPRMQF-DzxwRta7.js} +9 -9
  69. package/studio/web/assets/{chunk-SVP7TREG-jtdAHw0S.js → chunk-GTNCS2PH-DJ2BFvS1.js} +1 -1
  70. package/studio/web/assets/{chunk-F27PBJKO-BVA5EPhV.js → chunk-GWA4HPMP-C42bSqLL.js} +1 -1
  71. package/studio/web/assets/chunk-J5ZVWO5B-oDCd-gWO.js +1 -0
  72. package/studio/web/assets/chunk-MBY4JIJT-C-5jz6Lo.js +72 -0
  73. package/studio/web/assets/chunk-NETBCI7D-D-bzlN4r.js +1 -0
  74. package/studio/web/assets/chunk-O7XYJQB3-ep14zA23.js +128 -0
  75. package/studio/web/assets/chunk-UA2S7LBM-BMRWRHED.js +1 -0
  76. package/studio/web/assets/{chunk-POPQ4Y6H-ClWhhkwW.js → chunk-WEXAMYUT-DdLYVdX1.js} +1 -1
  77. package/studio/web/assets/{chunk-XXDRQBXY-BoGZu3HH.js → chunk-XXDRQBXY-CbPh2l8S.js} +1 -1
  78. package/studio/web/assets/{chunk-OSK3NFVY-ByciRftO.js → chunk-Z7XXMR3K-BmKEDjcP.js} +3 -3
  79. package/studio/web/assets/{chunk-75Z2AOVW-QGQD6th2.js → chunk-ZIGJFQKS-DLZgdNxA.js} +2 -2
  80. package/studio/web/assets/classDiagram-v2-NBCMYWYE-DOI5vgKT.js +217 -0
  81. package/studio/web/assets/cose-bilkent-JH36ORCC-BSOszL11.js +1 -0
  82. package/studio/web/assets/createLucideIcon-bziYxJli.js +1 -0
  83. package/studio/web/assets/{css.worker-BD9HbRGW.js → css.worker-l1psR_wG.js} +13 -10
  84. package/studio/web/assets/{cssMode-C1vRa7zh.js → cssMode-DyLZPMjo.js} +1 -1
  85. package/studio/web/assets/cynefin-OW5HDTMX-BSW-DB7S.js +1 -0
  86. package/studio/web/assets/cynefinDiagram-VND7K2PF-CbAHEwxt.js +62 -0
  87. package/studio/web/assets/cytoscape.esm-BZkf-uXn.js +321 -0
  88. package/studio/web/assets/dagre-6A5THRUB-Csxewgs4.js +4 -0
  89. package/studio/web/assets/diagram-22UHCM2B-a0rt8tY4.js +200 -0
  90. package/studio/web/assets/{diagram-VX7I27RA-DccVJet6.js → diagram-3UASUU5V-lEj2SVNh.js} +2 -2
  91. package/studio/web/assets/{diagram-VSXAHHWV-fhEdmkwM.js → diagram-ATOU4E4O-HcrAeB-q.js} +3 -3
  92. package/studio/web/assets/{diagram-S7CK7UJ4-aoCVTtcy.js → diagram-CDSNMT55-CYxiuyEx.js} +3 -3
  93. package/studio/web/assets/{diagram-Z3DM3KII-D-RyJJb7.js → diagram-MLGK6HIB-ChbCJTgJ.js} +1 -1
  94. package/studio/web/assets/diagram-MPIPVDR6-DaX9Y-N3.js +41 -0
  95. package/studio/web/assets/dialog-DTepachC.js +1 -0
  96. package/studio/web/assets/{dist-kYfyPZP9.js → dist-BRuBKNNy.js} +1 -1
  97. package/studio/web/assets/{dist-DP8UjMB_.js → dist-Cz2Y6-6G.js} +2 -2
  98. package/studio/web/assets/download-CtostjYn.js +1 -0
  99. package/studio/web/assets/{ebnfDiagram-PWID7BFC-DJGpIpz_.js → ebnfDiagram-ZINNZB2B-CwAsENB1.js} +1 -1
  100. package/studio/web/assets/{editor-3XRWEDWX.js → editor-CFQ5kbiT.js} +1 -1
  101. package/studio/web/assets/editor.worker-CkkvdXvO.js +33 -0
  102. package/studio/web/assets/elk-276RUBZZ-Hexg9E4D.js +27 -0
  103. package/studio/web/assets/{erDiagram-RLTQ6QDP-CIfNlgkC.js → erDiagram-OPXOYQCR-CeC-wwO1.js} +15 -15
  104. package/studio/web/assets/eventmodeling-NTZA5JFV-CFb03e0o.js +1 -0
  105. package/studio/web/assets/flowDiagram-KWPJA3E3-Cidi00_Y.js +1 -0
  106. package/studio/web/assets/{ganttDiagram-EL5Y4UJY-BxToTzzD.js → ganttDiagram-FUAMR5RP-C2_Hhl1-.js} +2 -2
  107. package/studio/web/assets/{getAnalytics-GHK8ORfM.js → getAnalytics-CjthMQqF.js} +1 -1
  108. package/studio/web/assets/gitGraph-4MIJSDKK-xIk5Vuew.js +1 -0
  109. package/studio/web/assets/{gitGraphDiagram-WWUBYQGX-Dwntd4-x.js → gitGraphDiagram-X574FWY7-CMxJ34up.js} +4 -4
  110. package/studio/web/assets/graphlib-C9Tl7QrK.js +1 -0
  111. package/studio/web/assets/{html-CTY5tdMr.js → html-DdMBJEGu.js} +1 -1
  112. package/studio/web/assets/{html.worker-DsMmVtuG.js → html.worker-DdwM4IrA.js} +12 -9
  113. package/studio/web/assets/{htmlMode-CG1vSD9t.js → htmlMode-DNtBx3OV.js} +1 -1
  114. package/studio/web/assets/index-CPoDzQTe.css +1 -0
  115. package/studio/web/assets/index-zZCxAIEb.js +824 -0
  116. package/studio/web/assets/index.lazy-CKbsHbSN.js +2 -0
  117. package/studio/web/assets/info-A6RAGUB7-o49TEbj-.js +1 -0
  118. package/studio/web/assets/infoDiagram-VRGFBTTK-Cjhh7yzZ.js +2 -0
  119. package/studio/web/assets/{ishikawaDiagram-5VMMS53U-D9Xh2r6X.js → ishikawaDiagram-OU5B5YK6-C63aXRmh.js} +2 -2
  120. package/studio/web/assets/{javascript-CJeJzGnI.js → javascript-Dy6KbeHT.js} +1 -1
  121. package/studio/web/assets/{journeyDiagram-3NMN7TZE-CokIi6ll.js → journeyDiagram-ZHPQQLJL-D_o0P5Mu.js} +3 -3
  122. package/studio/web/assets/json.worker-CSi2hF-a.js +65 -0
  123. package/studio/web/assets/{jsonMode-CYPBwM82.js → jsonMode-BiuDVrzl.js} +1 -1
  124. package/studio/web/assets/{kanban-definition-UXKFOSKX-CukSFJfX.js → kanban-definition-PNTS6WVX-CTI9SSxY.js} +7 -7
  125. package/studio/web/assets/{katex-CXMH3UgJ.js → katex-ZlcWpGUi.js} +2 -2
  126. package/studio/web/assets/languageServices-Dk8_6B25.js +1 -0
  127. package/studio/web/assets/linear-Ds1AeO4V.js +1 -0
  128. package/studio/web/assets/{lspLanguageFeatures-BC8_gxKG.js → lspLanguageFeatures-DwJKXzQa.js} +2 -2
  129. package/studio/web/assets/{mermaid-parser.core-BlEsOWNO.js → mermaid-parser.core-C2lcH_jP.js} +3 -3
  130. package/studio/web/assets/mermaid.core-BG5bjfIG.js +44 -0
  131. package/studio/web/assets/{mindmap-definition-YA3MSWOX-IprMc_0j.js → mindmap-definition-NLK3R4M7-BK7ho6JD.js} +24 -24
  132. package/studio/web/assets/{notifications-DFbArTfC.js → notifications-DJqAtWxD.js} +1 -1
  133. package/studio/web/assets/{notifications-BfKBpYcq.js → notifications-DsDtb41c.js} +1 -1
  134. package/studio/web/assets/packet-AYTQ26CC-BHPy6KBV.js +1 -0
  135. package/studio/web/assets/{pegDiagram-XKGWAZYB-BNuPDLZY.js → pegDiagram-GJSIUBJH-DzjwG3jO.js} +1 -1
  136. package/studio/web/assets/pie-WAS4IAKB-D0cP-DTU.js +1 -0
  137. package/studio/web/assets/{pieDiagram-E7YTZNPT-DqNb6Ht2.js → pieDiagram-5QR66LMP-C_hOP9Lv.js} +2 -2
  138. package/studio/web/assets/profile-zTGUN51x.js +1 -0
  139. package/studio/web/assets/{quadrantDiagram-AXDQQJYC-BGH9E2YR.js → quadrantDiagram-O4NWA36T-CZW8PbV1.js} +3 -3
  140. package/studio/web/assets/radar-RG4KPBEZ-C8fk0U81.js +1 -0
  141. package/studio/web/assets/railroad-74A4TZTK-B60FWm17.js +1 -0
  142. package/studio/web/assets/railroad-abnf-HS5TGJTU-CLMVZvH0.js +1 -0
  143. package/studio/web/assets/railroad-ebnf-LZEXJU2U--tlwFoVB.js +1 -0
  144. package/studio/web/assets/railroad-peg-WCYAUIDC-Dpuslblm.js +1 -0
  145. package/studio/web/assets/{railroadDiagram-O6MQD6OU-DGTPh2KZ.js → railroadDiagram-XR7U4H2S-DyyNmgbU.js} +1 -1
  146. package/studio/web/assets/regions-SOtABPB9.js +1 -0
  147. package/studio/web/assets/{register-1ZZuMsiA.js → register-7JezVakc.js} +39 -39
  148. package/studio/web/assets/{requirementDiagram-BXWQKSXE-BJnO6uLz.js → requirementDiagram-PLB6GJNP-C4H-mLKu.js} +11 -11
  149. package/studio/web/assets/{rolldown-runtime-hePW80VL.js → rolldown-runtime-Dd_uD5pT.js} +1 -1
  150. package/studio/web/assets/sankeyDiagram-IPEJSGJF-DHDyga4c.js +40 -0
  151. package/studio/web/assets/sequenceDiagram-PO4LG4MO-CdNcHXRI.js +169 -0
  152. package/studio/web/assets/setComponentFile-BavlhfY0.js +1 -0
  153. package/studio/web/assets/{setup-DWprJyJy.js → setup-04yVzr2I.js} +2 -2
  154. package/studio/web/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
  155. package/studio/web/assets/{src-CMc7m_Ut.js → src-D0vMJQRr.js} +1 -1
  156. package/studio/web/assets/stateDiagram-v2-GCMORJYK-CpKuXq15.js +291 -0
  157. package/studio/web/assets/status-g_mNYE7j.js +61 -0
  158. package/studio/web/assets/swimlanes-2SLR337P-NRHa2D8I.js +1 -0
  159. package/studio/web/assets/swimlanesDiagram-TC7HE7FX-BBk4t4hO.js +8 -0
  160. package/studio/web/assets/{tabs-BrHu7gJi.js → tabs-CnQ_zenf.js} +1 -1
  161. package/studio/web/assets/{time-Cclkb7kQ.js → time-Ci1v4fvT.js} +1 -1
  162. package/studio/web/assets/timeline-definition-EJHVYXUP-D39Y-xpq.js +120 -0
  163. package/studio/web/assets/toggleHighContrast-i2FjCrzO.js +49 -0
  164. package/studio/web/assets/treeView-Q6P3EWNA-CRWR9OqD.js +1 -0
  165. package/studio/web/assets/treemap-WGGIJYW6-ZfXyJgLO.js +1 -0
  166. package/studio/web/assets/{ts.worker-DpaaFKhy.js → ts.worker-DDMUrpqh.js} +118 -115
  167. package/studio/web/assets/{tsMode-pjgytARx.js → tsMode-DGeWfx0W.js} +5 -5
  168. package/studio/web/assets/{typescript-Cdg0mqUh.js → typescript-62_1FUbs.js} +1 -1
  169. package/studio/web/assets/{useEntityRestURL-RZhaY8Rn.js → useEntityRestURL-DSVwev9J.js} +1 -1
  170. package/studio/web/assets/useLocalStorage-BYoZF60G.js +1 -0
  171. package/studio/web/assets/usecaseDiagram-POWQR4AR-jf-zIDZ_.js +328 -0
  172. package/studio/web/assets/vendor-core-BdkdbUek.js +63 -0
  173. package/studio/web/assets/vendor-datadog-fCQhBHGk.js +6 -0
  174. package/studio/web/assets/vendor-react-izWchTRL.js +9 -0
  175. package/studio/web/assets/vendor-tanstack-CQ1aRjVa.js +2 -0
  176. package/studio/web/assets/vendor-ui-aE1tHcW7.js +41 -0
  177. package/studio/web/assets/vennDiagram-UO4OBE2U-BKYAZUh_.js +34 -0
  178. package/studio/web/assets/wardley-WFR3VGLG-BO7f36ci.js +1 -0
  179. package/studio/web/assets/{wardleyDiagram-VM6X3IG4-CjrkKWUR.js → wardleyDiagram-VNRHLVJA-Djb0JDQc.js} +3 -3
  180. package/studio/web/assets/{workers-BgoXIqQe.js → workers-Cs52GyHv.js} +1 -1
  181. package/studio/web/assets/x-vYntCxm4.js +1 -0
  182. package/studio/web/assets/{xml-BwSeDMiP.js → xml-Co5ow_Ix.js} +1 -1
  183. package/studio/web/assets/{xychartDiagram-S5SC5T6Z-Biok4GYV.js → xychartDiagram-PMCCYNJV-BQh9ubvb.js} +3 -3
  184. package/studio/web/assets/{yaml-DotCUG5l.js → yaml-BcngpXye.js} +1 -1
  185. package/studio/web/assets/yaml.worker-DAK2o_H1.js +479 -0
  186. package/studio/web/auth/fabric-globe-dark.png +0 -0
  187. package/studio/web/auth/fabric-globe-light.png +0 -0
  188. package/studio/web/auth/fabric-platform-dark.png +0 -0
  189. package/studio/web/auth/fabric-platform-light.png +0 -0
  190. package/studio/web/index.html +15 -15
  191. package/studio/web/assets/FloatingChat-omlNMDcJ.js +0 -23
  192. package/studio/web/assets/applications-DvFDYJgK.js +0 -296
  193. package/studio/web/assets/architecture-7GRP2DOG-LB-MLAAb.js +0 -1
  194. package/studio/web/assets/architectureDiagram-5GKGNRK7-7SW3GD-K.js +0 -36
  195. package/studio/web/assets/authStore-C3Nfubqr.js +0 -3
  196. package/studio/web/assets/c4Diagram-7LVT6UL2-LBNf8t_X.js +0 -38
  197. package/studio/web/assets/channel-yictG-U-.js +0 -1
  198. package/studio/web/assets/chevron-up-DtKGqDn3.js +0 -1
  199. package/studio/web/assets/chunk-4HAMMTFA-DWtTut21.js +0 -62
  200. package/studio/web/assets/chunk-DU6HZSFF-Chq20Ba5.js +0 -127
  201. package/studio/web/assets/chunk-GMAD6QVW-BeS7S07A.js +0 -72
  202. package/studio/web/assets/chunk-IMKFNOWR-Bnh3tAVd.js +0 -231
  203. package/studio/web/assets/chunk-L3NEJ4N5-COfUyKII.js +0 -1
  204. package/studio/web/assets/chunk-P2QGCYS3-CP1VhG_c.js +0 -1
  205. package/studio/web/assets/chunk-SHT3W25Y-LpQkMsah.js +0 -168
  206. package/studio/web/assets/chunk-TICWLB2K-VOwzetX-.js +0 -206
  207. package/studio/web/assets/classDiagram-ZZMXUADV-VaEwSy_g.js +0 -1
  208. package/studio/web/assets/classDiagram-v2-VYDZK3BY-VaEwSy_g.js +0 -1
  209. package/studio/web/assets/cose-bilkent-JH36ORCC-Cuuf67Bh.js +0 -1
  210. package/studio/web/assets/createLucideIcon-CzW9508A.js +0 -1
  211. package/studio/web/assets/cynefin-OW5HDTMX-BbdbCvub.js +0 -1
  212. package/studio/web/assets/cynefinDiagram-5FMLGOSQ-TP-aIqbt.js +0 -62
  213. package/studio/web/assets/cytoscape.esm-C2x7inlt.js +0 -321
  214. package/studio/web/assets/dagre-GXQ25YYZ-DShnGpGo.js +0 -4
  215. package/studio/web/assets/dagre-PrKaheQc.js +0 -1
  216. package/studio/web/assets/diagram-UQ7AKVKN-DglXtQ6x.js +0 -41
  217. package/studio/web/assets/dialog-Cn2uWgD4.js +0 -1
  218. package/studio/web/assets/download-B5T5r7ss.js +0 -1
  219. package/studio/web/assets/editor.worker-DwcOiOeP.js +0 -30
  220. package/studio/web/assets/eventmodeling-NTZA5JFV-CLxnp2CR.js +0 -1
  221. package/studio/web/assets/flowDiagram-HODETNUW-BIbhmz9f.js +0 -1
  222. package/studio/web/assets/gitGraph-4MIJSDKK-D2s2w8lE.js +0 -1
  223. package/studio/web/assets/graphlib-DS17s2tU.js +0 -1
  224. package/studio/web/assets/index-7RMEgVG1.css +0 -1
  225. package/studio/web/assets/index-Dfpeofdu.js +0 -824
  226. package/studio/web/assets/index.lazy-B1VOIv-t.js +0 -2
  227. package/studio/web/assets/info-A6RAGUB7-DYjkvb0C.js +0 -1
  228. package/studio/web/assets/infoDiagram-27XIBGKW-Bnp1FJE5.js +0 -2
  229. package/studio/web/assets/json.worker-fO_hOLCP.js +0 -62
  230. package/studio/web/assets/languageServices-IKH4GUHl.js +0 -1
  231. package/studio/web/assets/linear-Cnt8506Q.js +0 -1
  232. package/studio/web/assets/mermaid.core-BlkGaMIH.js +0 -44
  233. package/studio/web/assets/packet-AYTQ26CC-Bi3V04Zi.js +0 -1
  234. package/studio/web/assets/pie-WAS4IAKB-_6DoDbng.js +0 -1
  235. package/studio/web/assets/profile-Q4-T6c-S.js +0 -1
  236. package/studio/web/assets/radar-RG4KPBEZ-DDdVczcL.js +0 -1
  237. package/studio/web/assets/railroad-74A4TZTK-BJUP4Jds.js +0 -1
  238. package/studio/web/assets/railroad-abnf-HS5TGJTU-Bm3L1L0h.js +0 -1
  239. package/studio/web/assets/railroad-ebnf-LZEXJU2U-CKzLGlkw.js +0 -1
  240. package/studio/web/assets/railroad-peg-WCYAUIDC-S8xLjslx.js +0 -1
  241. package/studio/web/assets/regions-CtkV0xje.js +0 -1
  242. package/studio/web/assets/sankeyDiagram-P5KCCOFB-0vSOdymH.js +0 -40
  243. package/studio/web/assets/sequenceDiagram-WJ2MYXX4-hETizDWE.js +0 -162
  244. package/studio/web/assets/setComponentFile-ZWLcWv5X.js +0 -1
  245. package/studio/web/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -1
  246. package/studio/web/assets/stateDiagram-D77RDMKH-CdYQ_KtC.js +0 -1
  247. package/studio/web/assets/stateDiagram-v2-MP3YSRHH-CdKuzQMT.js +0 -1
  248. package/studio/web/assets/status--aNm8isn.js +0 -61
  249. package/studio/web/assets/swimlanes-42K2YHIH-B8cHIpU4.js +0 -1
  250. package/studio/web/assets/swimlanesDiagram-VR7AAH4N-DmOSJwaH.js +0 -8
  251. package/studio/web/assets/timeline-definition-24CTP7MA-BJWYSXqF.js +0 -120
  252. package/studio/web/assets/toggleHighContrast-Cq_lt3XD.js +0 -49
  253. package/studio/web/assets/treeView-Q6P3EWNA-qxe_v6CQ.js +0 -1
  254. package/studio/web/assets/treemap-WGGIJYW6-dDo97XXF.js +0 -1
  255. package/studio/web/assets/useLocalStorage-BqMR3D8_.js +0 -1
  256. package/studio/web/assets/vendor-core-c2JRRJpV.js +0 -58
  257. package/studio/web/assets/vendor-datadog-CLUcJXOo.js +0 -6
  258. package/studio/web/assets/vendor-react-CJV_K1u4.js +0 -9
  259. package/studio/web/assets/vendor-tanstack-DxzraizX.js +0 -1
  260. package/studio/web/assets/vendor-ui-BUjK0h8a.js +0 -41
  261. package/studio/web/assets/vennDiagram-4TSXK5OY-A3i-lCdl.js +0 -34
  262. package/studio/web/assets/wardley-WFR3VGLG-B0ik-_6g.js +0 -1
  263. package/studio/web/assets/x-DIzaLEdK.js +0 -1
  264. package/studio/web/assets/yaml.worker-BDL8_iuk.js +0 -454
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{c as t,f as n,l as r,n as i,s as a,u as o}from"./authStore-5jSS5pTW.js";import{n as s,t as c}from"./button-MFP9n8Ck.js";import{a as l}from"./vendor-datadog-fCQhBHGk.js";import{r as u}from"./vendor-react-izWchTRL.js";import{L as d,k as f,x as p,z as m}from"./vendor-tanstack-CQ1aRjVa.js";import{t as h}from"./createLucideIcon-bziYxJli.js";import{n as g}from"./chevron-up-CFe8x5Bp.js";import{n as _}from"./setLocalStorage-D_kflv4U.js";import{t as v}from"./useLocalStorage-BYoZF60G.js";import{$t as y,Cr as b,Er as x,Ht as S,Mn as C,Pr as w,Qt as T,Sn as E,Sr as D,Vt as O,Xn as k,Yn as A,_r as j,dt as M,en as ee,jr as N,lr as P,mt as te,nn as F,on as ne,sn as re,tn as ie,un as ae,xt as oe,yn as I}from"./index-zZCxAIEb.js";import{t as se}from"./useEntityRestURL-DSVwev9J.js";import{i as L,n as R,r as ce,t as z}from"./tabs-CnQ_zenf.js";var B={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};B.node;var V=h(B),H=u(),le={get:`text-blue border-blue/40 bg-blue/10`,post:`text-green border-green/40 bg-green/10`,put:`text-yellow border-yellow/40 bg-yellow/10`,patch:`text-pink border-pink/40 bg-pink/10`,delete:`text-red border-red/40 bg-red/10`,options:`text-muted-foreground border-border bg-muted`,head:`text-muted-foreground border-border bg-muted`,trace:`text-muted-foreground border-border bg-muted`};function U({method:e,className:t}){return(0,H.jsx)(`span`,{className:s(`inline-flex shrink-0 items-center justify-center rounded-md border font-mono text-[0.68rem] font-bold uppercase tracking-wide`,`min-w-14 px-1.5 py-0.5`,le[e],t),children:e})}var W=e(l(),1),ue={login:`Log in`,basic:`Basic`,bearer:`Bearer`,cookie:`Cookie`};function de({tree:e,totalCount:t,filteredCount:n,isFiltering:r,selectedId:i,onSelect:a,filter:o,onFilterChange:c,method:l,authorized:u,settingsActive:d,onOpenSettings:f}){let[p,m]=(0,W.useState)(new Set),h=e=>m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,H.jsxs)(`div`,{className:`flex max-h-[28rem] flex-col gap-3 lg:h-full lg:max-h-none lg:min-h-0`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:f,"aria-pressed":d,className:s(`flex w-full shrink-0 items-center gap-2 rounded-md border px-2.5 py-2 text-left text-sm transition-colors`,d?`border-primary bg-primary/10 text-foreground`:`border-border hover:bg-accent/60`),children:[u?(0,H.jsx)(x,{className:`text-green size-4 shrink-0`}):(0,H.jsx)(V,{className:`text-muted-foreground size-4 shrink-0`}),(0,H.jsx)(`span`,{className:`flex-1 font-medium`,children:`Authorize`}),(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:ue[l]})]}),(0,H.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,H.jsx)(j,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2`}),(0,H.jsx)(I,{value:o,onChange:e=>c(e.target.value),placeholder:`Filter endpoints…`,className:`pl-8`,"aria-label":`Filter endpoints`})]}),(0,H.jsx)(`div`,{className:`flex-1 overflow-y-auto overscroll-contain min-h-0 pr-1`,children:n===0?(0,H.jsx)(`p`,{className:`text-muted-foreground px-1 py-6 text-center text-sm`,children:t===0?`No endpoints found in this spec.`:`No endpoints match your filter.`}):(0,H.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,H.jsx)(fe,{resource:e,expanded:r||!p.has(e.resource),onToggle:()=>h(e.resource),selectedId:i,onSelect:a},e.resource))})})]})}function fe({resource:e,expanded:t,onToggle:n,selectedId:r,onSelect:i}){let a=(0,W.useMemo)(()=>e.paths.some(e=>e.operations.some(e=>e.id===r)),[e,r]);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`button`,{type:`button`,onClick:n,"aria-expanded":t,className:`text-foreground hover:bg-accent/60 flex w-full items-center gap-1.5 rounded-md px-1.5 py-1.5 text-left`,children:[t?(0,H.jsx)(g,{className:`size-4 shrink-0`}):(0,H.jsx)(w,{className:`size-4 shrink-0`}),(0,H.jsx)(`span`,{className:`flex-1 truncate text-sm font-semibold`,children:e.resource}),(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.operationCount})]}),t&&(0,H.jsx)(`div`,{className:`border-border/60 ml-3 flex flex-col gap-2 border-l pt-1 pl-2`,children:e.paths.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:s(`truncate px-1 font-mono text-xs`,a?`text-foreground`:`text-muted-foreground`),title:e.path,children:e.path}),(0,H.jsx)(`ul`,{className:`border-border/40 ml-2 flex flex-col gap-0.5 border-l pl-2`,children:e.operations.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:s(`flex w-full items-center gap-2 rounded-md px-2 py-1 text-left transition-colors`,e.id===r?`bg-primary/10 ring-primary/30 ring-1`:`hover:bg-accent/60`),children:[(0,H.jsx)(U,{method:e.method,className:`min-w-14`}),e.operation.summary&&(0,H.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate text-xs`,children:e.operation.summary})]})},e.id))})]},e.path))})]})}function G({code:e,className:t,label:n,maxHeightClassName:r=`max-h-96`}){let i=ne();return(0,H.jsxs)(`div`,{className:s(`group bg-muted/60 relative rounded-md border`,t),children:[(0,H.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":n?`Copy ${n}`:`Copy to clipboard`,className:`absolute top-1.5 right-1.5 z-10 size-7 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,onClick:()=>i(e),children:(0,H.jsx)(N,{className:`size-3.5`})}),(0,H.jsx)(`pre`,{className:s(`overflow-auto p-3 text-xs leading-relaxed`,r),children:(0,H.jsx)(`code`,{className:`font-mono`,children:e})})]})}var pe=[`get`,`post`,`put`,`patch`,`delete`,`options`,`head`,`trace`],K=`default`;function me(e){return e.split(`/`).find(Boolean)??`/`}function he(e,t){let n=e.security??t?.security;return!Array.isArray(n)||n.length===0?!1:n.every(ge)}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;for(let t in e)return!0;return!1}function _e(e){let t=e?.paths;if(!t)return[];let n=[];for(let[e,r]of Object.entries(t))if(r)for(let t of pe){let i=r[t];if(!i)continue;let a=ve(r.parameters,i.parameters);n.push({id:`${t} ${e}`,method:t,path:e,operation:i,tag:i.tags?.[0]??K,parameters:a,searchText:`${t} ${e} ${i.summary??``} ${i.description??``} ${i.operationId??``}`.toLowerCase()})}return n}function ve(e=[],t=[]){let n=new Map;for(let r of[...e,...t])r?.name&&r?.in&&n.set(`${r.in}:${r.name}`,r);return[...n.values()]}function ye(e){let t=new Map;for(let n of e){let e=me(n.path),r=t.get(e);r||(r=new Map,t.set(e,r));let i=r.get(n.path);i||(i=[],r.set(n.path,i)),i.push(n)}return[...t.entries()].map(([e,t])=>{let n=[...t.entries()].map(([e,t])=>({path:e,operations:t}));return{resource:e,operationCount:n.reduce((e,t)=>e+t.operations.length,0),paths:n}})}function be(e,t){let n=t.trim().toLowerCase();return!n||e.searchText.includes(n)}function xe(e,t){let n=[],r=new Set,i=(e,t)=>{if(!e)return;let i=e.replace(/\/+$/,``);r.has(i)||(r.add(i),n.push({url:e,label:t}))};i(t??void 0,`Studio`);for(let t of e?.servers??[])i(t?.url,t?.description||`Declared in spec`);return n}var Se=`#/components/schemas/`;function q(e,t){if(!e||!t||!t.startsWith(Se))return;let n=t.slice(21),r=e.components?.schemas;return r&&Object.hasOwn(r,n)?r[n]:void 0}function Ce(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function J(e){if(!e)return;let t=Object.keys(e).find(e=>e.includes(`json`))??Object.keys(e)[0];return t?e[t]?.schema:void 0}var we=1e3;function Y(e,t,n=new Set,r=0,i={remaining:we}){if(!t||r>8||i.remaining<=0)return null;let a=t.$ref?q(e,t.$ref):t;if(!a||n.has(a))return{};if(i.remaining--,a.example!==void 0)return a.example;if(a.default!==void 0)return a.default;if(a.const!==void 0)return a.const;if(Array.isArray(a.enum)&&a.enum.length>0)return a.enum[0];let o=new Set(n).add(a),s=a.allOf??a.oneOf??a.anyOf;if(s?.length)return a.allOf?a.allOf.reduce((t,n)=>{let a=Y(e,n,o,r+1,i);return a&&typeof a==`object`&&!Array.isArray(a)?{...t,...a}:t},{}):Y(e,s[0],o,r+1,i);switch(Array.isArray(a.type)?a.type.find(e=>e!==`null`):a.type){case`object`:return Te(e,a,o,r+1,i);case`array`:return[Y(e,a.items,o,r+1,i)];case`string`:return Ee(a);case`integer`:case`number`:return 0;case`boolean`:return!1;case`null`:return null;default:return a.properties?Te(e,a,o,r+1,i):null}}function Te(e,t,n,r,i){let a={};for(let[o,s]of Object.entries(t.properties??{})){if(i.remaining<=0)break;a[o]=Y(e,s,n,r,i)}return a}function Ee(e){switch(e.format){case`date-time`:case`Date`:return new Date().toISOString();case`date`:return new Date().toISOString().slice(0,10);case`uuid`:return`00000000-0000-0000-0000-000000000000`;default:return``}}function X(e){if(!e)return`any`;if(e.$ref)return Ce(e.$ref);if(e.allOf||e.oneOf||e.anyOf){let t=e.allOf??e.oneOf??e.anyOf??[],n=e.allOf?` & `:` | `;return t.map(e=>X(e)).join(n)||`object`}let t=Array.isArray(e.type)?e.type.join(` | `):e.type;return t===`array`?`${X(e.items)}[]`:e.format&&t?`${t} <${e.format}>`:t??(e.properties?`object`:`any`)}function De(e,t){let n=[];return{path:e.replace(/\{([^}]+)\}/g,(e,r)=>{let i=t[r];return typeof i!=`string`||i===``?(n.push(r),`{${r}}`):encodeURIComponent(i)}),missing:n}}function Oe(e){let t=new Map(e.parameters.filter(e=>e.in===`path`).map(e=>[e.name,e]));return[...e.path.matchAll(/\{([^}]+)\}/g)].map(e=>e[1]).map(e=>t.get(e)??{name:e,in:`path`,required:!0,schema:{type:`string`}})}var Z=6;function ke({spec:e,schema:t,className:n}){return t?(0,H.jsx)(`div`,{className:s(`text-sm`,n),children:(0,H.jsx)(Ae,{spec:e,schema:t,depth:0,seen:new Set})}):(0,H.jsx)(`p`,{className:s(`text-muted-foreground text-sm`,n),children:`No schema provided.`})}function Ae({spec:e,schema:t,depth:n,seen:r,required:i}){let a=t;if(t.$ref){let i=q(e,t.$ref);if(!i)return(0,H.jsx)(Ne,{label:Ce(t.$ref),note:`(unresolved reference)`});if(r.has(i)||n>=Z)return(0,H.jsx)(Ne,{label:X(t),note:`(nested)`});a=i}let o=Array.isArray(a.type)?a.type.find(e=>e!==`null`):a.type;if(o===`object`||a.properties){let i=Object.entries(a.properties??{}),o=new Set(a.required??[]);if(i.length===0)return(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[X(t),a.additionalProperties?` (open — any additional properties allowed)`:``]});let s=new Set(r).add(a);return(0,H.jsx)(`ul`,{className:`border-border/70 flex flex-col gap-2 border-l pl-3`,children:i.map(([t,r])=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(je,{name:t,schema:r,spec:e,required:o.has(t)}),(0,H.jsx)(Me,{spec:e,schema:r,depth:n+1,seen:s})]},t))})}if(o===`array`){let t=new Set(r).add(a);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`array of `,X(a.items)]}),a.items&&n<Z&&(0,H.jsx)(Ae,{spec:e,schema:a.items,depth:n+1,seen:t})]})}return(0,H.jsx)(Ne,{label:X(t),required:i,description:a.description,enumValues:a.enum})}function je({name:e,schema:t,spec:n,required:r}){let i=t.$ref?q(n,t.$ref)??t:t;return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,H.jsx)(`code`,{className:`text-foreground font-medium`,children:e}),(0,H.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:X(t)}),r&&(0,H.jsx)(`span`,{className:`text-red text-xs font-medium`,children:`required`}),i.description&&(0,H.jsx)(`span`,{className:`text-muted-foreground w-full text-xs`,children:i.description}),Array.isArray(i.enum)&&i.enum.length>0&&(0,H.jsxs)(`span`,{className:`text-muted-foreground w-full text-xs`,children:[`allowed: `,i.enum.map(e=>JSON.stringify(e)).join(`, `)]})]})}function Me({spec:e,schema:t,depth:n,seen:r}){if(n>=Z)return null;let i=t.$ref?q(e,t.$ref):t;if(!i||r.has(i))return null;let a=Array.isArray(i.type)?i.type.find(e=>e!==`null`):i.type,o=a===`object`||!!i.properties,s=i.items?.$ref?q(e,i.items.$ref):i.items,c=a===`array`&&!!s&&(s.type===`object`||!!s.properties);if(!o&&!c)return null;let l=c?i.items:i;return(0,H.jsx)(`div`,{className:`mt-1`,children:(0,H.jsx)(Ae,{spec:e,schema:l,depth:n,seen:r})})}function Ne({label:e,required:t,description:n,note:r,enumValues:i}){return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:e}),r&&(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:r}),t&&(0,H.jsx)(`span`,{className:`text-red text-xs font-medium`,children:`required`}),n&&(0,H.jsx)(`span`,{className:`text-muted-foreground w-full text-xs`,children:n}),Array.isArray(i)&&i.length>0&&(0,H.jsxs)(`span`,{className:`text-muted-foreground w-full text-xs`,children:[`allowed: `,i.map(e=>JSON.stringify(e)).join(`, `)]})]})}var Pe=`text-muted-foreground border-border bg-muted`;function Fe(e){return!Number.isFinite(e)||e<=0?`text-red border-red/40 bg-red/10`:e<300?`text-green border-green/40 bg-green/10`:e<400?`text-blue border-blue/40 bg-blue/10`:e<500?`text-yellow border-yellow/40 bg-yellow/10`:`text-red border-red/40 bg-red/10`}function Ie({colorClass:e,children:t}){return(0,H.jsx)(`span`,{className:s(`rounded-md border px-2 py-0.5 font-mono text-xs font-bold`,e),children:t})}function Le(e){return e.type===`basic`&&typeof e.username==`string`&&e.username!==``||e.type===`bearer`&&typeof e.token==`string`&&e.token!==``}function Re(e){return e===`post`||e===`put`||e===`patch`}function ze(e,t){return e?`${e.replace(/\/+$/,``)}/${t.replace(/^\/+/,``)}`:t}function Be(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}function Ve(e){switch(e.type){case`basic`:return{Authorization:`Basic ${Be(`${e.username}:${e.password}`)}`};case`bearer`:return{Authorization:`Bearer ${e.token}`};default:return{}}}function He(e,t,n,r){let{path:i,missing:a}=De(e.path,n.pathParams),o=new URLSearchParams;for(let[e,t]of Object.entries(n.queryParams))t!==``&&o.append(e,t);let s=o.toString(),c=ze(t,i)+(s?`?${s}`:``),l={Accept:`application/json`};for(let[e,t]of Object.entries(n.headerParams))t!==``&&(l[e]=t);Object.assign(l,Ve(r));let u=Re(e.method)&&n.body.trim()!==``;return u&&(l[`Content-Type`]=`application/json`),{method:e.method,url:c,headers:l,body:u?n.body:void 0,missingPathParams:a}}async function Ue(e,t=()=>Date.now()){let n=t();try{let r=await fetch(e.url,{method:e.method.toUpperCase(),headers:e.headers,body:e.body,credentials:`include`}),{text:i,truncated:a}=await Ge(r),o=r.headers.get(`content-type`),s={};return r.headers.forEach((e,t)=>{s[t]=e}),{ok:r.ok,status:r.status,statusText:r.statusText,headers:s,body:Ke(i,o,a),contentType:o,durationMs:Math.round(t()-n)}}catch(e){return{ok:!1,status:0,statusText:``,headers:{},body:``,contentType:null,durationMs:Math.round(t()-n),networkError:e instanceof Error?e.message:String(e)}}}var We=512e3;async function Ge(e,t=We){let n=e.body?.getReader?.();if(!n){let n=await e.text();return n.length>t?{text:n.slice(0,t),truncated:!0}:{text:n,truncated:!1}}let r=new TextDecoder,i=``;try{for(;i.length<t;){let{done:e,value:t}=await n.read();if(e){i+=r.decode();break}i+=r.decode(t,{stream:!0})}}finally{await n.cancel().catch(()=>{})}return i.length>t?{text:i.slice(0,t),truncated:!0}:{text:i,truncated:!1}}function Ke(e,t,n=!1){return n||e.length>512e3?`${e.length>512e3?e.slice(0,We):e}\n\n… response truncated for display (first ${We} characters shown) …`:qe(e,t)}function qe(e,t){if(!e)return``;if(t&&!t.includes(`json`))return e;try{return JSON.stringify(JSON.parse(e),null,` `)}catch{return e}}function Je(e){let t=[],n=Object.entries(e.headers);if(t.push(`const response = await fetch(${JSON.stringify(e.url)}, {`),t.push(`\tmethod: ${JSON.stringify(e.method.toUpperCase())},`),t.push(` credentials: "include",`),n.length){t.push(` headers: {`);for(let[e,r]of n)t.push(`\t\t${JSON.stringify(e)}: ${JSON.stringify(r)},`);t.push(` },`)}if(e.body!==void 0){let n=e.body.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${");t.push(`\tbody: \`${n}\`,`)}return t.push(`});`),t.push(`const data = await response.json();`),t.push(`console.log(data);`),t.join(`
2
+ `)}function Ye(e,t){if(!Re(t.method)||!t.operation.requestBody)return``;let n=J(t.operation.requestBody.content);return n?JSON.stringify(Y(e,n),null,` `):``}function Xe({op:e,spec:t,baseURL:n,auth:r,authRequired:i,authorized:a,onOpenAuthorize:o}){let s=S(),l=Oe(e),u=e.parameters.filter(e=>e.in===`query`),d=e.parameters.filter(e=>e.in===`header`),[f,p]=(0,W.useState)({}),[m,h]=(0,W.useState)({}),[g,_]=(0,W.useState)({}),[v,y]=(0,W.useState)(()=>Ye(t,e)),[x,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(!1),E={pathParams:f,queryParams:m,headerParams:g,body:v},D=(0,W.useMemo)(()=>He(e,n??``,E,r),[e,n,r,f,m,g,v]),k=Re(e.method)&&!!e.operation.requestBody,A=[...D.missingPathParams,...u.filter(e=>e.required&&!m[e.name]?.trim()).map(e=>e.name),...d.filter(e=>e.required&&!g[e.name]?.trim()).map(e=>e.name),...k&&e.operation.requestBody?.required&&v.trim()===``?[`request body`]:[]],j=!!n&&A.length===0&&!w;async function M(){T(!0),C(null);let e=await Ue(D);C(e),T(!1)}return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[i&&!a&&(0,H.jsxs)(`div`,{className:`border-border bg-muted/40 text-muted-foreground flex flex-wrap items-center gap-1.5 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(`span`,{children:`This endpoint requires authorization.`}),(0,H.jsx)(`button`,{type:`button`,onClick:o,className:`text-foreground font-medium underline underline-offset-2`,children:`Authorize →`})]}),l.length>0&&(0,H.jsx)(Ze,{title:`Path parameters`,params:l,values:f,onChange:p}),u.length>0&&(0,H.jsx)(Ze,{title:`Query parameters`,params:u,values:m,onChange:h}),d.length>0&&(0,H.jsx)(Ze,{title:`Header parameters`,params:d,values:g,onChange:_}),k&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Request body`}),(0,H.jsx)(`div`,{className:`h-56 overflow-hidden rounded-md border`,children:(0,H.jsx)(O,{className:`h-full w-full`,language:`json-worker-free`,theme:s,value:v,onChange:e=>y(e??``),options:{minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1,fontSize:12,lineNumbers:`off`,folding:!1}})})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsxs)(c,{variant:`submit`,onClick:M,disabled:!j,children:[(0,H.jsx)(b,{}),w?`Sending…`:`Send request`]}),!n&&(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`The REST API URL couldn't be determined for this instance.`}),n&&A.length>0&&(0,H.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Fill in: `,A.join(`, `)]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Request`}),(0,H.jsxs)(`div`,{className:`bg-muted/60 flex items-center gap-2 overflow-x-auto rounded-md border px-3 py-2 font-mono text-xs`,children:[(0,H.jsx)(`span`,{className:`uppercase`,children:D.method}),(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:D.url})]})]}),x&&(0,H.jsx)(Qe,{result:x}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Code sample — fetch`}),(0,H.jsx)(G,{code:Je(D),label:`code sample`})]})]})}function Ze({title:e,params:t,values:n,onChange:r}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:e}),(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,children:t.map(e=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsxs)(E,{htmlFor:`param-${e.in}-${e.name}`,className:`flex items-baseline gap-2`,children:[(0,H.jsx)(`code`,{children:e.name}),e.required&&(0,H.jsx)(`span`,{className:`text-red text-xs font-medium`,children:`required`}),e.schema&&(0,H.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs font-normal`,children:Array.isArray(e.schema.type)?e.schema.type.join(` | `):e.schema.type??`string`})]}),(0,H.jsx)(I,{id:`param-${e.in}-${e.name}`,value:n[e.name]??``,placeholder:e.description||e.name,onChange:t=>r({...n,[e.name]:t.target.value})})]},`${e.in}:${e.name}`))})]})}function Qe({result:e}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Response`}),(0,H.jsx)(Ie,{colorClass:Fe(e.status),children:e.networkError?`Failed`:`${e.status} ${e.statusText}`.trim()}),(0,H.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.durationMs,` ms`]})]}),e.networkError?(0,H.jsxs)(`div`,{className:`border-red/40 bg-red/10 text-foreground rounded-md border p-3 text-sm`,children:[(0,H.jsx)(`p`,{className:`text-red font-medium`,children:`The request could not be completed.`}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:e.networkError}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-2 text-xs`,children:`This is usually a CORS or connectivity issue — check that CORS is enabled for this origin (see the banner above) and that the instance is reachable.`})]}):(0,H.jsx)(G,{code:e.body||`(empty response body)`,label:`response body`})]})}function $e(e){let t=Number(e);return Number.isFinite(t)?Fe(t):Pe}function et({op:e,spec:t,baseURL:n,auth:r,authorized:i,onOpenAuthorize:a}){let[o]=re(e.path),s=he(e.operation,t),l=e.operation.summary,u=e.operation.description;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(U,{method:e.method}),(0,H.jsx)(`code`,{className:`text-foreground text-base font-medium break-all`,children:e.path}),(0,H.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Copy path`,className:`size-7`,onClick:o,children:(0,H.jsx)(N,{className:`size-3.5`})}),e.operation.deprecated&&(0,H.jsx)(A,{variant:`warning`,children:`Deprecated`}),s&&(0,H.jsxs)(`button`,{type:`button`,onClick:a,className:`border-border hover:bg-accent/60 inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs transition-colors`,children:[i?(0,H.jsx)(x,{className:`text-green size-3`}):(0,H.jsx)(x,{className:`text-muted-foreground size-3`}),i?`Credential set`:`Auth required — Authorize`]})]}),l&&(0,H.jsx)(`h2`,{className:`text-lg font-medium`,children:l}),u&&u!==l&&(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:u})]}),(0,H.jsxs)(z,{defaultValue:`docs`,className:`gap-4`,children:[(0,H.jsxs)(ce,{children:[(0,H.jsx)(L,{value:`docs`,children:`Documentation`}),(0,H.jsx)(L,{value:`try`,children:`Try it out`})]}),(0,H.jsxs)(R,{value:`docs`,className:`flex flex-col gap-6`,children:[(0,H.jsx)(nt,{parameters:e.parameters}),(0,H.jsx)(rt,{op:e,spec:t}),(0,H.jsx)(it,{responses:e.operation.responses,spec:t})]}),(0,H.jsx)(R,{value:`try`,children:(0,H.jsx)(Xe,{op:e,spec:t,baseURL:n,auth:r,authRequired:s,authorized:i,onOpenAuthorize:a})})]})]})}function tt({children:e}){return(0,H.jsx)(`h3`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:e})}function nt({parameters:e}){return e.length===0?null:(0,H.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(tt,{children:`Parameters`}),(0,H.jsx)(`ul`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,H.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,H.jsx)(`code`,{className:`text-foreground font-medium`,children:e.name}),(0,H.jsx)(A,{variant:`outline`,className:`text-[0.65rem]`,children:e.in}),(0,H.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:Array.isArray(e.schema?.type)?e.schema?.type.join(` | `):e.schema?.type??`string`}),e.required&&(0,H.jsx)(`span`,{className:`text-red text-xs font-medium`,children:`required`})]}),e.description&&(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description})]},`${e.in}:${e.name}`))})]})}function rt({op:e,spec:t}){let n=e.operation.requestBody,r=n?J(n.content):void 0,i=(0,W.useMemo)(()=>r?JSON.stringify(Y(t,r),null,` `):``,[t,r]);return n?(0,H.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(tt,{children:[`Request body`,n.required?` (required)`:``]}),n.description&&(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:n.description}),(0,H.jsx)(ke,{spec:t,schema:r}),i&&i!==`{}`&&i!==`null`&&(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Example`}),(0,H.jsx)(G,{code:i,label:`example request body`,maxHeightClassName:`max-h-72`})]})]}):null}function it({responses:e,spec:t}){let n=Object.entries(e??{});return n.length===0?null:(0,H.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(tt,{children:`Responses`}),(0,H.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(([e,n])=>{let r=J(n.content);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,H.jsx)(Ie,{colorClass:$e(e),children:e}),n.description&&(0,H.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:n.description})]}),r&&(0,H.jsx)(`div`,{className:`pl-1`,children:(0,H.jsx)(ke,{spec:t,schema:r})})]},e)})})]})}function at(e){let t=Object.values(e?.components?.securitySchemes??{}),n=!1,r=!1;for(let e of t){let t=typeof e?.scheme==`string`?e.scheme.toLowerCase():void 0;t===`basic`&&(n=!0),(t===`bearer`||e?.type===`oauth2`)&&(r=!0)}return!n&&!r?{basic:!0,bearer:!0}:{basic:n,bearer:r}}function ot({spec:e,method:t,auth:n,authorized:r,tab:i,onTabChange:a,onSelectMethod:o,onApplyBasic:s,onApplyBearer:l,onClearAuth:u,login:d,serverOptions:f,activeServer:p,onServerChange:m,onCopyServer:h}){let g=at(e);return(0,H.jsxs)(`div`,{className:`flex max-w-2xl flex-col gap-8`,children:[(0,H.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-lg font-medium`,children:`Server`}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`The base URL that "Try it out" requests target.`})]}),(0,H.jsx)(pt,{options:f,value:p,onChange:m,onCopy:h})]}),(0,H.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r?(0,H.jsx)(x,{className:`text-green size-4`}):(0,H.jsx)(V,{className:`text-muted-foreground size-4`}),(0,H.jsx)(`h2`,{className:`text-lg font-medium`,children:`Authorization`})]}),(0,H.jsxs)(z,{value:i,onValueChange:e=>a(e),className:`gap-4`,children:[(0,H.jsxs)(ce,{children:[(0,H.jsx)(L,{value:`docs`,children:`Documentation`}),(0,H.jsx)(L,{value:`try`,children:`Try it out`})]}),(0,H.jsx)(R,{value:`docs`,children:(0,H.jsx)(st,{available:g})}),(0,H.jsxs)(R,{value:`try`,className:`flex flex-col gap-4`,children:[(0,H.jsx)(ct,{method:t,available:g,onSelect:o}),r&&(0,H.jsxs)(`div`,{className:`border-green/40 bg-green/10 text-foreground flex flex-wrap items-center gap-2 rounded-md border p-3 text-sm`,children:[(0,H.jsx)(x,{className:`text-green size-4`}),(0,H.jsx)(`span`,{className:`flex-1`,children:`Credential set — "Try it out" requests will send it.`}),(0,H.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:u,children:`Clear`})]}),t===`login`&&(0,H.jsx)(lt,{login:d,authorized:r},d.revocation),t===`basic`&&(0,H.jsx)(ut,{auth:n,onApply:s}),t===`bearer`&&(0,H.jsx)(dt,{auth:n,onApply:l}),t===`cookie`&&(0,H.jsx)(ft,{})]})]})]})]})}function st({available:e}){return(0,H.jsxs)(`div`,{className:`text-muted-foreground flex max-w-prose flex-col gap-4 text-sm`,children:[(0,H.jsx)(`p`,{children:`How "Try it out" requests authenticate. Your selection is saved in this browser tab only (session storage) and cleared when the tab closes.`}),(0,H.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-foreground font-medium`,children:`Log in (recommended)`}),(0,H.jsxs)(`dd`,{children:[`Exchanges your current Studio session — or a username and password — for a short-lived Bearer token, sent as an `,(0,H.jsx)(`code`,{children:`Authorization`}),` `,`header. This works even when the instance is on a different site than Studio and cookies aren't sent. Only the minted token is stored, never your password.`]})]}),e.basic&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-foreground font-medium`,children:`Basic`}),(0,H.jsxs)(`dd`,{children:[`Sends your username and password as an `,(0,H.jsx)(`code`,{children:`Authorization: Basic`}),` `,`header on every request. The username and password are stored in this browser tab until it closes.`]})]}),e.bearer&&(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-foreground font-medium`,children:`Bearer token`}),(0,H.jsxs)(`dd`,{children:[`Paste an existing operation token; it's sent as an `,(0,H.jsx)(`code`,{children:`Authorization: Bearer`}),` header.`]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{className:`text-foreground font-medium`,children:`Cookie`}),(0,H.jsxs)(`dd`,{children:[`Relies on your browser's instance session cookie (`,(0,H.jsx)(`code`,{children:`credentials: "include"`}),`). Whether the cookie is sent depends on how the instance is deployed relative to Studio (same site, cookie attributes, HTTPS), so it often won't work in a deployed environment — prefer Log in there.`]})]})]})]})}function ct({method:e,available:t,onSelect:n}){return(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(Q,{active:e===`login`,onClick:()=>n(`login`),children:`Log in`}),t.basic&&(0,H.jsx)(Q,{active:e===`basic`,onClick:()=>n(`basic`),children:`Basic`}),t.bearer&&(0,H.jsx)(Q,{active:e===`bearer`,onClick:()=>n(`bearer`),children:`Bearer token`}),(0,H.jsx)(Q,{active:e===`cookie`,onClick:()=>n(`cookie`),children:`Cookie`})]})}function lt({login:e,authorized:t}){let[n,r]=(0,W.useState)(``),[i,a]=(0,W.useState)(``),o=e.status===`pending`,s=(0,W.useRef)(0),l=e=>{let t=s.current;e().then(e=>{e===`applied`&&s.current===t&&(r(``),a(``))})};return(0,H.jsxs)(`div`,{className:`flex max-w-sm flex-col gap-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(c,{type:`button`,variant:`submit`,disabled:o,onClick:()=>l(e.runSession),children:o?`Authorizing…`:`Authorize with your current session`}),(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Mints a token as the user you're signed in to Studio as — no credentials to retype.`})]}),e.runCredentials&&(0,H.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault();let r=e.runCredentials;r&&l(()=>r({username:n,password:i}))},children:[(0,H.jsx)(`span`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Or use different credentials`}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(E,{htmlFor:`api-login-username`,children:`Username`}),(0,H.jsx)(I,{id:`api-login-username`,value:n,autoComplete:`username`,onChange:e=>{s.current++,r(e.target.value)}})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(E,{htmlFor:`api-login-password`,children:`Password`}),(0,H.jsx)(I,{id:`api-login-password`,type:`password`,value:i,autoComplete:`current-password`,onChange:e=>{s.current++,a(e.target.value)}})]}),(0,H.jsx)(c,{type:`submit`,variant:`outline`,disabled:o||!n||!i,children:o?`Authorizing…`:`Authorize`})]}),e.status===`error`&&e.error&&(0,H.jsx)(`p`,{className:`text-red text-sm`,children:e.error}),!t&&e.status===`idle`&&(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Not signed in — authenticated requests will be rejected.`})]})}function ut({auth:e,onApply:t}){let[n,r]=(0,W.useState)(e.type===`basic`?e.username:``),[i,a]=(0,W.useState)(e.type===`basic`?e.password:``);return(0,W.useEffect)(()=>{r(e.type===`basic`?e.username:``),a(e.type===`basic`?e.password:``)},[e]),(0,H.jsxs)(`form`,{className:`flex max-w-sm flex-col gap-3`,onSubmit:e=>{e.preventDefault(),t(n,i)},children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(E,{htmlFor:`api-auth-username`,children:`Username`}),(0,H.jsx)(I,{id:`api-auth-username`,value:n,autoComplete:`username`,onChange:e=>r(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(E,{htmlFor:`api-auth-password`,children:`Password`}),(0,H.jsx)(I,{id:`api-auth-password`,type:`password`,value:i,autoComplete:`current-password`,onChange:e=>a(e.target.value)})]}),(0,H.jsx)(c,{type:`submit`,variant:`outline`,disabled:!n,children:`Authorize`})]})}function dt({auth:e,onApply:t}){let[n,r]=(0,W.useState)(e.type===`bearer`?e.token:``);return(0,W.useEffect)(()=>{r(e.type===`bearer`?e.token:``)},[e]),(0,H.jsxs)(`form`,{className:`flex max-w-sm flex-col gap-1.5`,onSubmit:e=>{e.preventDefault(),t(n)},children:[(0,H.jsx)(E,{htmlFor:`api-auth-token`,children:`Token`}),(0,H.jsx)(I,{id:`api-auth-token`,value:n,placeholder:`eyJhbGciOi…`,onChange:e=>r(e.target.value)}),(0,H.jsx)(c,{type:`submit`,variant:`outline`,className:`mt-2`,disabled:!n,children:`Authorize`})]})}function ft(){return(0,H.jsxs)(`p`,{className:`text-muted-foreground max-w-prose text-sm`,children:[`Requests are sent with your browser's instance session cookie (`,(0,H.jsx)(`code`,{children:`credentials: "include"`}),`). Whether it's sent depends on how the instance is deployed relative to Studio, so it often won't work in a deployed environment — use Log in if requests come back unauthorized.`]})}function pt({options:e,value:t,onChange:n,onCopy:r}){return e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No server URL could be determined for this instance.`}):e.length===1?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-mono break-all`,children:e[0].url}),(0,H.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Copy server URL`,className:`size-6`,onClick:r,children:(0,H.jsx)(N,{className:`size-3`})})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsxs)(T,{value:t,onValueChange:n,children:[(0,H.jsx)(ie,{className:`max-w-md min-w-0 flex-1`,"aria-label":`Server`,children:(0,H.jsx)(F,{})}),(0,H.jsx)(y,{children:e.map(e=>(0,H.jsxs)(ee,{value:e.url,children:[(0,H.jsx)(`span`,{className:`font-mono text-xs`,children:e.url}),(0,H.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`— `,e.label]})]},e.url))})]}),(0,H.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Copy server URL`,className:`size-6`,onClick:r,children:(0,H.jsx)(N,{className:`size-3`})})]})}function Q({active:e,onClick:t,children:n}){return(0,H.jsx)(`button`,{type:`button`,onClick:t,className:s(`rounded-md border px-3 py-1.5 text-sm transition-colors`,e?`border-primary bg-primary/10 text-foreground`:`border-border text-muted-foreground hover:bg-accent/60`),children:n})}var mt=10;function ht(e){return Math.max(240,Math.floor(e/2))}function $(e,t){return Math.round(Math.min(Math.max(Number.isFinite(e)?e:320,240),ht(t)))}function gt(){let[e,t]=v(_.ApiExplorerSidebarWidth,320),[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(()=>$(e,window.innerWidth)),o=(0,W.useRef)(i);o.current=i;let s=(0,W.useRef)(null);(0,W.useEffect)(()=>{n||a($(e,window.innerWidth))},[e,n]),(0,W.useEffect)(()=>{let t=()=>{n||a($(e,window.innerWidth))};return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e,n]);let c=(0,W.useCallback)(e=>{e.preventDefault(),s.current={startX:e.clientX,startWidth:o.current},r(!0)},[]);return(0,W.useEffect)(()=>{if(!n)return;let e=e=>{let t=s.current;t&&a($(t.startWidth+(e.clientX-t.startX),window.innerWidth))},i=()=>{r(!1),t(o.current)},c=document.body.style.userSelect;return document.body.style.userSelect=`none`,window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,i),()=>{document.body.style.userSelect=c,window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,i)}},[n,t]),{width:i,isResizing:n,startResizing:c,handleKeyDown:(0,W.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),t(e=>$(e-mt,window.innerWidth))):e.key===`ArrowRight`&&(e.preventDefault(),t(e=>$(e+mt,window.innerWidth)))},[t])}}var _t={type:`cookie`};function vt({spec:e,baseURL:t,entityId:r,onSessionMint:a,onCredentialMint:c}){let l=(0,W.useMemo)(()=>_e(e),[e]),u=(0,W.useMemo)(()=>xe(e,t),[e,t]),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(`operation`),[h,g]=(0,W.useState)(`docs`),[_,v]=(0,W.useState)(()=>l[0]?.id),y=e=>{g(e),m(`settings`)},[b,x]=(0,W.useState)(()=>o(r)),S=e=>{n(r,e),x(t=>({...t,...e}))},C=b.method??`login`,w=b.auth??{type:`cookie`},T=u.find(e=>e.url===b.server)?.url??u[0]?.url??t,E=(0,W.useRef)(0),D=(0,W.useRef)(!0);(0,W.useEffect)(()=>(D.current=!0,()=>{D.current=!1,E.current++}),[]);let[O,k]=(0,W.useState)(`idle`),[j,M]=(0,W.useState)(null),[ee,N]=(0,W.useState)(0),[P,te]=(0,W.useState)(()=>i.getExplorerAuthEpoch(r));(0,W.useEffect)(()=>{let e=i.onExplorerAuthInvalidated(r,()=>{E.current++,x(o(r)),k(`idle`),M(null),te(i.getExplorerAuthEpoch(r)),N(e=>e+1)});return te(i.getExplorerAuthEpoch(r)),e},[r]);let F=async e=>{let n=++E.current,a=i.getExplorerAuthEpoch(r);k(`pending`),M(null);try{let o=await e();return!D.current||n!==E.current?`discarded`:i.getExplorerAuthEpoch(r)===a?typeof o!=`string`||o===``?(M(`The instance did not return a usable token.`),k(`error`),`failed`):(S({method:`login`,auth:{type:`bearer`,token:o},authServer:t??void 0,authGeneration:i.getExplorerAuthEpoch(r)}),k(`idle`),`applied`):(k(`idle`),`discarded`)}catch(e){return!D.current||n!==E.current?`discarded`:(M(e instanceof Error?e.message:`Log in failed.`),k(`error`),`failed`)}},ne={status:O,error:j,revocation:ee,runSession:()=>F(a),runCredentials:c?e=>F(()=>c(e)):null},ie=e=>{E.current++,e===`cookie`?S({method:`cookie`,auth:{type:`cookie`},authServer:void 0}):e===`basic`?S({method:`basic`,auth:w.type===`basic`?w:{type:`basic`,username:``,password:``}}):e===`bearer`?S({method:`bearer`,auth:w.type===`bearer`?w:{type:`bearer`,token:``}}):C===`login`&&w.type===`bearer`?S({method:`login`}):S({method:`login`,auth:{type:`cookie`},authServer:void 0}),k(`idle`),M(null)},ae=(e,t)=>{E.current++,S({method:`basic`,auth:{type:`basic`,username:e,password:t},authServer:T??void 0,authGeneration:i.getExplorerAuthEpoch(r)})},oe=e=>{E.current++,S({method:`bearer`,auth:{type:`bearer`,token:e},authServer:T??void 0,authGeneration:i.getExplorerAuthEpoch(r)})},I=()=>{E.current++,k(`idle`),M(null),S({auth:C===`basic`?{type:`basic`,username:``,password:``}:C===`bearer`?{type:`bearer`,token:``}:{type:`cookie`},authServer:void 0})},se=e=>S({server:e}),[L]=re(T??``),R=b.authServer!=null&&b.authServer===T,ce=b.authGeneration===P,z=Le(w)&&R&&ce?w:_t,B=Le(z),{width:V,isResizing:le,startResizing:U,handleKeyDown:ue}=gt(),fe={"--api-sidebar-width":`${V}px`},G=(0,W.useMemo)(()=>l.filter(e=>be(e,d)),[l,d]),pe=(0,W.useMemo)(()=>ye(G),[G]),K=l.find(e=>e.id===_)??l[0];function me(e){v(e),m(`operation`)}return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5 lg:min-h-0 lg:flex-1`,children:[(0,H.jsxs)(`header`,{className:`flex min-w-0 flex-col lg:shrink-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`h1`,{className:`font-radioGrotesk truncate text-2xl`,children:e?.info?.title??`API Explorer`}),e?.info?.version&&(0,H.jsxs)(A,{variant:`secondary`,children:[`v`,e.info.version]})]}),e?.info?.description&&(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-sm`,children:e.info.description})]}),l.length===0?(0,H.jsx)(`div`,{className:`border-border text-muted-foreground rounded-md border border-dashed p-8 text-center text-sm`,children:`This spec doesn't define any endpoints yet.`}):(0,H.jsxs)(`div`,{className:`flex flex-col gap-6 lg:min-h-0 lg:flex-1 lg:flex-row lg:items-stretch`,children:[(0,H.jsxs)(`aside`,{style:fe,className:`relative w-full shrink-0 overflow-y-clip lg:h-full lg:min-h-0 lg:w-[var(--api-sidebar-width)]`,children:[(0,H.jsx)(de,{tree:pe,totalCount:l.length,filteredCount:G.length,isFiltering:d.trim()!==``,selectedId:p===`operation`?K?.id:void 0,onSelect:me,filter:d,onFilterChange:f,method:C,authorized:B,settingsActive:p===`settings`,onOpenSettings:()=>y(`docs`)}),(0,H.jsx)(`div`,{role:`separator`,tabIndex:0,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,"aria-valuenow":V,"aria-valuemin":240,"aria-valuemax":ht(window.innerWidth),onMouseDown:U,onKeyDown:ue,className:`group absolute top-0 right-0 bottom-0 z-40 hidden w-4 translate-x-1/2 cursor-col-resize outline-none lg:block`,children:(0,H.jsx)(`div`,{className:s(`absolute inset-y-0 left-1/2 w-1 -translate-x-1/2 transition-colors`,`group-hover:bg-violet-400/60 dark:group-hover:bg-violet-500/60 group-focus-visible:bg-violet-500/80`,le&&`bg-violet-400/60 dark:bg-violet-500/60`)})})]}),(0,H.jsx)(`main`,{className:`min-w-0 flex-1 lg:min-h-0 lg:overflow-y-auto lg:overscroll-contain lg:pb-6`,children:p===`settings`?(0,H.jsx)(ot,{spec:e,method:C,auth:w,authorized:B,tab:h,onTabChange:g,onSelectMethod:ie,onApplyBasic:ae,onApplyBearer:oe,onClearAuth:I,login:ne,serverOptions:u,activeServer:T??void 0,onServerChange:se,onCopyServer:L}):K?(0,H.jsx)(et,{op:K,spec:e,baseURL:T??null,auth:z,authorized:B,onOpenAuthorize:()=>y(`try`)},K.id):(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Select an endpoint to see its documentation.`})})]})]})}function yt({entityId:e,instanceClient:t}){return d({queryKey:[`OpenAPI`,e],queryFn:async()=>{let{data:e}=await t.get(`/api/openapi/rest`);return e}})}function bt(){let{instanceId:e,clusterId:n}=f({strict:!1}),i=C(),{data:o,isLoading:s}=m(M(i)),{data:l,isLoading:u}=m(oe(i)),d=se(),{data:p,isLoading:h,error:g}=m(yt(i)),_=i.instanceClient.defaults.baseURL,v=(0,W.useCallback)(async()=>(await a({instanceClient:i.instanceClient})).operationToken,[i.instanceClient]),y=(0,W.useMemo)(()=>r(_)?e=>t({operationsUrl:_,...e}):null,[_]),b=o?.http,x=``,S=b?.cors===!1,w=b?.corsAccessList?.length!==void 0&&!b.corsAccessList.includes(`*`)&&!b.corsAccessList.includes(`null`)&&!b.corsAccessList.includes(window.location.origin);S?x=`This ${n&&!e?`cluster`:`instance`} has CORS disabled currently, so you won't be able to execute API requests from the browser.`:w&&(x=`This ${n&&!e?`cluster`:`instance`} has CORS enabled, but ${window.location.origin} is not allowed, so you won't be able to execute API requests from the browser.`);let{onConfigUpdate:T,isPending:E}=te(),O=(0,W.useCallback)(()=>{T({...S?{http_cors:!0}:{},...w?{http_corsAccessList:[...b?.corsAccessList??[],window.location.origin]}:{}})},[S,b?.corsAccessList,w,T]);if(s||u||h)return(0,H.jsx)(k,{centered:!0,text:`Looking up your instance configuration, one moment.`});if(g){let e;return e=l?.version&&!ae(`4.7.0-beta.7`,l?.version)?`API Docs are only available starting in version '4.7.0-beta.7' of Harper, please update your version ${l.version}!`:`We weren't able to look up your docs. Please check the Network tab of your developer tools to see why the docs were not accessible to Studio.`,(0,H.jsx)(P,{title:`API Docs Unavailable`,error:{message:e},showReturnToHome:!1})}return(0,H.jsxs)(`div`,{className:`flex flex-col px-4 pt-6 pb-12 md:px-8 lg:h-[calc(100vh-(--spacing(32)))] lg:pb-0`,children:[x&&(0,H.jsx)(P,{title:`CORS Disabled: HTTP API Not Accessible`,className:`mt-0 mb-6 shrink-0 border-yellow text-yellow`,error:{message:x},showReturnToHome:!1,children:(0,H.jsxs)(c,{type:`button`,disabled:E,variant:`warning`,onClick:O,children:[(0,H.jsx)(D,{}),E?`Enabling CORS...`:`Enable CORS for ${window.location.origin}`]})}),(0,H.jsx)(vt,{spec:p,baseURL:d,entityId:i.entityId,onSessionMint:v,onCredentialMint:y},i.entityId)]})}var xt=p(`/apis`)({component:bt});export{xt as route};
@@ -0,0 +1 @@
1
+ import"./chunk-FOHPRMQF-DzxwRta7.js";import{w as e}from"./mermaid-parser.core-C2lcH_jP.js";export{e as createInfoServices};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./mermaid-parser.core-C2lcH_jP.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n}from"./src-D0vMJQRr.js";import{c as r}from"./chunk-O7XYJQB3-ep14zA23.js";import{a as i}from"./mermaid.core-BG5bjfIG.js";var a={parse:t(async t=>{let r=await e(`info`,t);n.debug(r)},`parse`)},o={version:`12.0.0`},s={parser:a,db:{getVersion:t(()=>o.version,`getVersion`)},renderer:{draw:t((e,t,a)=>{n.debug(`rendering info diagram
2
+ `+e);let o=i(t);r(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
@@ -1,9 +1,9 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-CMc7m_Ut.js";import{H as t,K as n,U as r,a as i,c as a,s as o,v as s,w as c,x as l,y as u}from"./chunk-DU6HZSFF-Chq20Ba5.js";import{p as d}from"./chunk-75Z2AOVW-QGQD6th2.js";import{t as f}from"./rough.esm-Dy-Kn_BL.js";import{f as p}from"./mermaid.core-BlkGaMIH.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim())}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-D0vMJQRr.js";import{H as t,U as n,a as r,c as i,q as a,s as o,v as s,w as c,x as l,y as u}from"./chunk-O7XYJQB3-ep14zA23.js";import{p as d}from"./chunk-ZIGJFQKS-DLZgdNxA.js";import{t as f}from"./rough.esm-Dy-Kn_BL.js";import{a as p}from"./mermaid.core-BG5bjfIG.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim())}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(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:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
5
  `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return e(g,`Parser`),g.prototype=h,h.Parser=g,new g})();m.parser=m;var h=m,g=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,i()}getRoot(){return this.root}addNode(e,t){let r=o.sanitizeText(t,l());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],n(r);return}this.baseLevel??=e;let i=e-this.baseLevel+1;for(i<=0&&(i=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=i;)this.stack.pop();let a=this.stack[this.stack.length-1].node,s={text:r,children:[]};a.children.push(s),this.stack.push({level:i,node:s})}getAccTitle(){return u()}setAccTitle(e){r(e)}getAccDescription(){return s()}setAccDescription(e){t(e)}getDiagramTitle(){return c()}setDiagramTitle(e){n(e)}},_=14,v=250,y=30,b=60,x=5,S=82*Math.PI/180,C=Math.cos(S),w=Math.sin(S),T=e((e,t,n)=>{let r=e.node().getBBox(),i=r.width+t*2,o=r.height+t*2;a(e,o,i,n),e.attr(`viewBox`,`${r.x-t} ${r.y-t} ${i} ${o}`)},`applyPaddedViewBox`),E=e((e,t,n,r)=>{let i=r.db.getRoot();if(!i)return;let a=l(),{look:o,handDrawnSeed:s,themeVariables:c}=a,u=d(a.fontSize)[0]??_,m=o===`handDrawn`,h=i.children??[],g=a.ishikawa?.diagramPadding??20,y=a.ishikawa?.useMaxWidth??!1,b=p(t),x=b.append(`g`).attr(`class`,`ishikawa`),S=m?f.svg(b.node()):void 0,C=S?{roughSvg:S,seed:s??0,lineColor:c?.lineColor??`#333`,fillColor:c?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${t}`;m||x.append(`defs`).append(`marker`).attr(`id`,w).attr(`viewBox`,`0 0 10 10`).attr(`refX`,0).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 Z`).attr(`class`,`ishikawa-arrow`);let E=0,k=v,A=m?void 0:L(x,E,k,E,k,`ishikawa-spine`);if(O(x,E,k,i.text,u,C),!h.length){m&&L(x,E,k,E,k,`ishikawa-spine`,C),T(b,g,y);return}E-=20;let j=h.filter((e,t)=>t%2==0),N=h.filter((e,t)=>t%2==1),P=D(j),F=D(N),I=P.total+F.total,R=v,z=v;if(I>0){let e=v*2,t=v*.3;R=Math.max(t,e*(P.total/I)),z=Math.max(t,e*(F.total/I))}let B=u*2;R=Math.max(R,P.max*B),z=Math.max(z,F.max*B),k=Math.max(R,v),A&&A.attr(`y1`,k).attr(`y2`,k),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${k})`);let V=Math.ceil(h.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[h[e*2],-1,R],[h[e*2+1],1,z]])n&&M(t,n,E,k,r,i,u,C);E=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(m)L(x,E,k,0,k,`ishikawa-spine`,C);else{A.attr(`x1`,E);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}T(b,g,y)},`draw`),D=e(t=>{let n=e(e=>e.children.reduce((e,t)=>e+1+n(t),0),`countDescendants`);return t.reduce((e,t)=>{let r=n(t);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),O=e((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=F(s,P(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),k=e((t,n)=>{let r=[],i=[],a=e((e,t,o)=>{let s=n===-1?[...e].reverse():e;for(let e of s){let n=r.length,s=e.children??[];r.push({depth:o,text:P(e.text,15),parentIndex:t,childCount:s.length}),o%2==0?(i.push(n),s.length&&a(s,n,o+1)):(s.length&&a(s,n,o+1),i.push(n))}},`walk`);return a(t,-1,2),{entries:r,yOrder:i}},`flattenTree`),A=e((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=F(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),j=e((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),M=e((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-C*l,d=w*l*i,f=n+u,p=r+d;if(L(e,n,r,f,p,`ishikawa-branch`,s),s&&j(e,n,r,n-f,r-p,s),A(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=k(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let S=-C,T=w*i,E=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=I(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?b+n.childCount*x:y),L(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,r,1,0,s),F(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=I(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+S*((r-l)/T),L(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,l,c-u,l-r,s),F(a,n.text,u,r,E,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),N=e(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),P=e((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}})();function g(){this.yy={}}return e(g,`Parser`),g.prototype=h,h.Parser=g,new g})();m.parser=m;var h=m,g=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,`IshikawaDB`)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,r()}getRoot(){return this.root}addNode(e,t){let n=o.sanitizeText(t,l());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],a(n);return}this.baseLevel??=e;let r=e-this.baseLevel+1;for(r<=0&&(r=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=r;)this.stack.pop();let i=this.stack[this.stack.length-1].node,s={text:n,children:[]};i.children.push(s),this.stack.push({level:r,node:s})}getAccTitle(){return u()}setAccTitle(e){n(e)}getAccDescription(){return s()}setAccDescription(e){t(e)}getDiagramTitle(){return c()}setDiagramTitle(e){a(e)}},_=14,v=250,y=30,b=60,x=5,S=82*Math.PI/180,C=Math.cos(S),w=Math.sin(S),T=e((e,t,n)=>{let r=e.node().getBBox(),a=r.width+t*2,o=r.height+t*2;i(e,o,a,n),e.attr(`viewBox`,`${r.x-t} ${r.y-t} ${a} ${o}`)},`applyPaddedViewBox`),E=e((e,t,n,r)=>{let i=r.db.getRoot();if(!i)return;let a=l(),{look:o,handDrawnSeed:s,themeVariables:c}=a,u=d(a.fontSize)[0]??_,m=o===`handDrawn`,h=i.children??[],g=a.ishikawa?.diagramPadding??20,y=a.ishikawa?.useMaxWidth??!1,b=p(t),x=b.append(`g`).attr(`class`,`ishikawa`),S=m?f.svg(b.node()):void 0,C=S?{roughSvg:S,seed:s??0,lineColor:c?.lineColor??`#333`,fillColor:c?.mainBkg??`#fff`}:void 0,w=`ishikawa-arrow-${t}`;m||x.append(`defs`).append(`marker`).attr(`id`,w).attr(`viewBox`,`0 0 10 10`).attr(`refX`,0).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 Z`).attr(`class`,`ishikawa-arrow`);let E=0,k=v,A=m?void 0:L(x,E,k,E,k,`ishikawa-spine`);if(O(x,E,k,i.text,u,C),!h.length){m&&L(x,E,k,E,k,`ishikawa-spine`,C),T(b,g,y);return}E-=20;let j=h.filter((e,t)=>t%2==0),N=h.filter((e,t)=>t%2==1),P=D(j),F=D(N),I=P.total+F.total,R=v,z=v;if(I>0){let e=v*2,t=v*.3;R=Math.max(t,e*(P.total/I)),z=Math.max(t,e*(F.total/I))}let B=u*2;R=Math.max(R,P.max*B),z=Math.max(z,F.max*B),k=Math.max(R,v),A&&A.attr(`y1`,k).attr(`y2`,k),x.select(`.ishikawa-head-group`).attr(`transform`,`translate(0,${k})`);let V=Math.ceil(h.length/2);for(let e=0;e<V;e++){let t=x.append(`g`).attr(`class`,`ishikawa-pair`);for(let[n,r,i]of[[h[e*2],-1,R],[h[e*2+1],1,z]])n&&M(t,n,E,k,r,i,u,C);E=t.selectAll(`text`).nodes().reduce((e,t)=>Math.min(e,t.getBBox().x),1/0)}if(m)L(x,E,k,0,k,`ishikawa-spine`,C);else{A.attr(`x1`,E);let e=`url(#${w})`;x.selectAll(`line.ishikawa-branch, line.ishikawa-sub-branch`).attr(`marker-start`,e)}T(b,g,y)},`draw`),D=e(t=>{let n=e(e=>e.children.reduce((e,t)=>e+1+n(t),0),`countDescendants`);return t.reduce((e,t)=>{let r=n(t);return e.total+=r,e.max=Math.max(e.max,r),e},{total:0,max:0})},`sideStats`),O=e((e,t,n,r,i,a)=>{let o=Math.max(6,Math.floor(110/(i*.6))),s=e.append(`g`).attr(`class`,`ishikawa-head-group`).attr(`transform`,`translate(${t},${n})`),c=F(s,P(r,o),0,0,`ishikawa-head-label`,`start`,i),l=c.node().getBBox(),u=Math.max(60,l.width+6),d=Math.max(40,l.height*2+40),f=`M 0 ${-d/2} L 0 ${d/2} Q ${u*2.4} 0 0 ${-d/2} Z`;if(a){let e=a.roughSvg.path(f,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-head`)}else s.insert(`path`,`:first-child`).attr(`class`,`ishikawa-head`).attr(`d`,f);c.attr(`transform`,`translate(${(u-l.width)/2-l.x+3},${-l.y-l.height/2})`)},`drawHead`),k=e((t,n)=>{let r=[],i=[],a=e((e,t,o)=>{let s=n===-1?[...e].reverse():e;for(let e of s){let n=r.length,s=e.children??[];r.push({depth:o,text:P(e.text,15),parentIndex:t,childCount:s.length}),o%2==0?(i.push(n),s.length&&a(s,n,o+1)):(s.length&&a(s,n,o+1),i.push(n))}},`walk`);return a(t,-1,2),{entries:r,yOrder:i}},`flattenTree`),A=e((e,t,n,r,i,a,o)=>{let s=e.append(`g`).attr(`class`,`ishikawa-label-group`),c=F(s,t,n,r+11*i,`ishikawa-label cause`,`middle`,a).node().getBBox();if(o){let e=o.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:`hachure`,fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>e,`:first-child`).attr(`class`,`ishikawa-label-box`)}else s.insert(`rect`,`:first-child`).attr(`class`,`ishikawa-label-box`).attr(`x`,c.x-20).attr(`y`,c.y-2).attr(`width`,c.width+40).attr(`height`,c.height+4)},`drawCauseLabel`),j=e((e,t,n,r,i,a)=>{let o=Math.sqrt(r*r+i*i);if(o===0)return;let s=r/o,c=i/o,l=-c*6,u=s*6,d=t,f=n,p=`M ${d} ${f} L ${d-s*6*2+l} ${f-c*6*2+u} L ${d-s*6*2-l} ${f-c*6*2-u} Z`,m=a.roughSvg.path(p,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:`solid`,stroke:a.lineColor,strokeWidth:1});e.append(()=>m)},`drawArrowMarker`),M=e((e,t,n,r,i,a,o,s)=>{let c=t.children??[],l=a*(c.length?1:.2),u=-C*l,d=w*l*i,f=n+u,p=r+d;if(L(e,n,r,f,p,`ishikawa-branch`,s),s&&j(e,n,r,n-f,r-p,s),A(e,t.text,f,p,i,o,s),!c.length)return;let{entries:m,yOrder:h}=k(c,i),g=m.length,_=Array(g);for(let[e,t]of h.entries())_[t]=r+d*((e+1)/(g+1));let v=new Map;v.set(-1,{x0:n,y0:r,x1:f,y1:p,childCount:c.length,childrenDrawn:0});let S=-C,T=w*i,E=i<0?`ishikawa-label up`:`ishikawa-label down`;for(let[t,n]of m.entries()){let r=_[t],i=v.get(n.parentIndex),a=e.append(`g`).attr(`class`,`ishikawa-sub-group`),c=0,l=0,u=0;if(n.depth%2==0){let e=i.y1-i.y0;c=I(i.x0,i.x1,e?(r-i.y0)/e:.5),l=r,u=c-(n.childCount>0?b+n.childCount*x:y),L(a,c,r,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,r,1,0,s),F(a,n.text,u,r,`ishikawa-label align`,`end`,o)}else{let e=i.childrenDrawn++;c=I(i.x0,i.x1,(i.childCount-e)/(i.childCount+1)),l=i.y0,u=c+S*((r-l)/T),L(a,c,l,u,r,`ishikawa-sub-branch`,s),s&&j(a,c,l,c-u,l-r,s),F(a,n.text,u,r,E,`end`,o)}n.childCount>0&&v.set(t,{x0:c,y0:l,x1:u,y1:r,childCount:n.childCount,childrenDrawn:0})}},`drawBranch`),N=e(e=>e.split(/<br\s*\/?>|\n/),`splitLines`),P=e((e,t)=>{if(e.length<=t)return e;let n=[];for(let r of e.split(/\s+/)){let e=n.length-1;e>=0&&n[e].length+1+r.length<=t?n[e]+=` `+r:n.push(r)}return n.join(`
7
7
  `)},`wrapText`),F=e((e,t,n,r,i,a,o)=>{let s=N(t),c=o*1.05,l=e.append(`text`).attr(`class`,i).attr(`text-anchor`,a).attr(`x`,n).attr(`y`,r-(s.length-1)*c/2);for(let[e,t]of s.entries())l.append(`tspan`).attr(`x`,n).attr(`dy`,e===0?0:c).text(t);return l},`drawMultilineText`),I=e((e,t,n)=>e+(t-e)*n,`lerp`),L=e((e,t,n,r,i,a,o)=>{if(o){let s=o.roughSvg.line(t,n,r,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});e.append(()=>s).attr(`class`,a);return}return e.append(`line`).attr(`class`,a).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i)},`drawLine`),R={parser:h,get db(){return new g},renderer:{draw:E},styles:e(e=>`
8
8
  .ishikawa .ishikawa-spine,
9
9
  .ishikawa .ishikawa-branch,
@@ -1 +1 @@
1
- import{conf as e,language as t}from"./typescript-Cdg0mqUh.js";var n=e,r={defaultToken:`invalid`,tokenPostfix:`.js`,keywords:`break.case.catch.class.continue.const.constructor.debugger.default.delete.do.else.export.extends.false.finally.for.from.function.get.if.import.in.instanceof.let.new.null.return.set.static.super.switch.symbol.this.throw.true.try.typeof.undefined.var.void.while.with.yield.async.await.of`.split(`.`),typeKeywords:[],operators:t.operators,symbols:t.symbols,escapes:t.escapes,digits:t.digits,octaldigits:t.octaldigits,binarydigits:t.binarydigits,hexdigits:t.hexdigits,regexpctl:t.regexpctl,regexpesc:t.regexpesc,tokenizer:t.tokenizer};export{n as conf,r as language};
1
+ import{conf as e,language as t}from"./typescript-62_1FUbs.js";var n=e,r={defaultToken:`invalid`,tokenPostfix:`.js`,keywords:`break.case.catch.class.continue.const.constructor.debugger.default.delete.do.else.export.extends.false.finally.for.from.function.get.if.import.in.instanceof.let.new.null.return.set.static.super.switch.symbol.this.throw.true.try.typeof.undefined.var.void.while.with.yield.async.await.of`.split(`.`),typeKeywords:[],operators:t.operators,symbols:t.symbols,escapes:t.escapes,digits:t.digits,octaldigits:t.octaldigits,binarydigits:t.binarydigits,hexdigits:t.hexdigits,regexpctl:t.regexpctl,regexpesc:t.regexpesc,tokenizer:t.tokenizer};export{n as conf,r as language};
@@ -1,9 +1,9 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-CMc7m_Ut.js";import{H as n,K as r,U as i,a,c as o,v as s,w as c,x as l,y as u}from"./chunk-DU6HZSFF-Chq20Ba5.js";import{t as d}from"./arc-CVRByUzA.js";import{t as f}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{a as p,n as m,o as h,s as g}from"./chunk-F27PBJKO-BVA5EPhV.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t}from"./src-D0vMJQRr.js";import{H as n,U as r,a as i,c as a,q as o,v as s,w as c,x as l,y as u}from"./chunk-O7XYJQB3-ep14zA23.js";import{t as d}from"./arc-CVRByUzA.js";import{t as f}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{a as p,n as m,o as h,s as g}from"./chunk-GWA4HPMP-C42bSqLL.js";var _=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,11,12,14,16,17,18],r=[1,9],i=[1,10],a=[1,11],o=[1,12],s=[1,13],c=[1,14],l={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:`error`,4:`journey`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,11:`title`,12:`acc_title`,13:`acc_title_value`,14:`acc_descr`,15:`acc_descr_value`,16:`acc_descr_multiline_value`,17:`section`,18:`taskName`,19:`taskData`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 9:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 10:case 11:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$=`task`}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:r,12:i,14:a,16:o,17:s,18:c},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};l.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,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:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=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),n.length-1&&(this.yylineno-=n.length-1);var i=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:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(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:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
5
  `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function u(){this.yy={}}return e(u,`Parser`),u.prototype=l,l.Parser=u,new u})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=e(function(){b.length=0,x.length=0,y=``,S.length=0,a()},`clear`),w=e(function(e){y=e,b.push(e)},`addSection`),T=e(function(){return b},`getSections`),E=e(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=e(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=e(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=e(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=e(function(){let t=e(function(e){return S[e].processed},`compileTask`),n=!0;for(let[e,r]of S.entries())t(e),n&&=r.processed;return n},`compileTasks`),j={getConfig:e(()=>l().journey,`getConfig`),clear:C,setDiagramTitle:r,getDiagramTitle:c,setAccTitle:i,getAccTitle:u,setAccDescription:n,getAccDescription:s,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:e(function(){return D()},`getActors`)},M=e(e=>`.label {
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin(`acc_title`),12;case 8:return this.popState(),`acc_title_value`;case 9:return this.begin(`acc_descr`),14;case 10:return this.popState(),`acc_descr_value`;case 11:this.begin(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 17;case 15:return 18;case 16:return 19;case 17:return`:`;case 18:return 6;case 19:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}}})();function u(){this.yy={}}return e(u,`Parser`),u.prototype=l,l.Parser=u,new u})();_.parser=_;var v=_,y=``,b=[],x=[],S=[],C=e(function(){b.length=0,x.length=0,y=``,S.length=0,i()},`clear`),w=e(function(e){y=e,b.push(e)},`addSection`),T=e(function(){return b},`getSections`),E=e(function(){let e=A(),t=0;for(;!e&&t<100;)e=A(),t++;return x.push(...S),x},`getTasks`),D=e(function(){let e=[];return x.forEach(t=>{t.people&&e.push(...t.people)}),[...new Set(e)].sort()},`updateActors`),O=e(function(e,t){let n=t.substr(1).split(`:`),r=0,i=[];n.length===1?(r=Number(n[0]),i=[]):(r=Number(n[0]),i=n[1].split(`,`));let a=i.map(e=>e.trim()),o={section:y,type:y,people:a,task:e,score:r};S.push(o)},`addTask`),k=e(function(e){let t={section:y,type:y,description:e,task:e,classes:[]};x.push(t)},`addTaskOrg`),A=e(function(){let t=e(function(e){return S[e].processed},`compileTask`),n=!0;for(let[e,r]of S.entries())t(e),n&&=r.processed;return n},`compileTasks`),j={getConfig:e(()=>l().journey,`getConfig`),clear:C,setDiagramTitle:o,getDiagramTitle:c,setAccTitle:r,getAccTitle:u,setAccDescription:n,getAccDescription:s,addSection:w,getSections:T,getTasks:E,addTask:O,addTaskOrg:k,getActors:e(function(){return D()},`getActors`)},M=e(e=>`.label {
7
7
  font-family: ${e.fontFamily};
8
8
  color: ${e.textColor};
9
9
  }
@@ -136,4 +136,4 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l
136
136
  ${e.actor5?`fill: ${e.actor5}`:``};
137
137
  }
138
138
  ${f()}
139
- `,`getStyles`),N=e(function(e,t){return p(e,t)},`drawRect`),P=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=d().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=d().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),F=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I=e(function(e,t){return h(e,t)},`drawText`),L=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,I(t,n)},`drawLabel`),R=e(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,N(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,B=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),P(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,N(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color,r={cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position};F(a,r),s+=10}),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),V=e(function(e,t){m(e,t)},`drawBackgroundRect`),H=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),U={drawRect:N,drawCircle:F,drawSection:R,drawText:I,drawLabel:L,drawTask:B,drawBackgroundRect:V,initGraphics:e(function(e,t){z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},W=e(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=l().journey,n=t.maxLabelWidth;K=0;let r=60;Object.keys(G).forEach(i=>{let a=G[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:G[i].position};U.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&l.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&l.push(r),s.remove()}l.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=U.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),r+=Math.max(20,l.length*20)})}e(q,`drawActorLegend`);var J=l().journey,Y=0,ee=e(function(e,n,r,i){let a=l(),s=a.journey.titleColor,c=a.journey.titleFontSize,u=a.journey.titleFontFamily,d=a.securityLevel,f;d===`sandbox`&&(f=t(`#i`+n));let p=t(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);U.initGraphics(m,n);let h=i.db.getTasks(),g=i.db.getDiagramTitle(),_=i.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),te(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,c).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,s).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;o(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:e(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=l().journey,o=this,s=0;function c(c){return e(function(e){s++;let l=o.sequenceItems.length-s+1;o.updateVal(e,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(e,`stopy`,i+l*a.boxMargin,Math.max),o.updateVal(X.data,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopx`,r+l*a.boxMargin,Math.max),c!==`activation`&&(o.updateVal(e,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(e,`stopx`,r+l*a.boxMargin,Math.max),o.updateVal(X.data,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopy`,i+l*a.boxMargin,Math.max))},`updateItemBounds`)}e(c,`updateFn`),this.sequenceItems.forEach(c())},`updateBounds`),insert:e(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,te=e(function(e,t,n,r){let i=l().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,c=`#CCC`,u=`black`,d=0;for(let[n,l]of t.entries()){if(a!==l.section){c=Z[s%Z.length],d=s%Z.length,u=Q[s%Q.length];let r=0,o=l.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let f={x:n*i.taskMargin+n*i.width+Y,y:50,text:l.section,fill:c,num:d,colour:u,taskCount:r};U.drawSection(e,f,i),a=l.section,s++}let f=l.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});l.x=n*i.taskMargin+n*i.width+Y,l.y=o,l.width=i.diagramMarginX,l.height=i.diagramMarginY,l.colour=u,l.fill=c,l.num=d,l.actors=f,U.drawTask(e,l,i,r),X.insert(l.x,l.y,l.x+l.width+i.taskMargin,450)}},`drawTasks`),$={setConf:W,draw:ee},ne={parser:v,db:j,renderer:$,styles:M,init:e(e=>{$.setConf(e.journey),j.clear()},`init`)};export{ne as diagram};
139
+ `,`getStyles`),N=e(function(e,t){return p(e,t)},`drawRect`),P=e(function(t,n){let r=t.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=t.append(`g`);i.append(`circle`).attr(`cx`,n.cx-5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=d().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}e(a,`smile`);function o(e){let t=d().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}e(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return e(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),F=e(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),I=e(function(e,t){return h(e,t)},`drawText`),L=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,I(t,n)},`drawLabel`),R=e(function(e,t,n){let r=e.append(`g`),i=g();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width*t.taskCount+n.diagramMarginX*(t.taskCount-1),i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,N(r,i),H(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),z=-1,B=e(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);z++,a.append(`line`).attr(`id`,r+`-task`+z).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),P(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=g();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,N(a,o);let s=t.x+14;t.people.forEach(e=>{let n=t.actors[e].color,r={cx:s,cy:t.y,r:7,fill:n,stroke:`#000`,title:e,pos:t.actors[e].position};F(a,r),s+=10}),H(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),V=e(function(e,t){m(e,t)},`drawBackgroundRect`),H=(function(){function t(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}e(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}e(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return e(i,`_setTextAttrs`),function(e){return e.textPlacement===`fo`?r:e.textPlacement===`old`?t:n}})(),U={drawRect:N,drawCircle:F,drawSection:R,drawText:I,drawLabel:L,drawTask:B,drawBackgroundRect:V,initGraphics:e(function(e,t){z=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`)},W=e(function(e){Object.keys(e).forEach(function(t){J[t]=e[t]})},`setConf`),G={},K=0;function q(e){let t=l().journey,n=t.maxLabelWidth;K=0;let r=60;Object.keys(G).forEach(i=>{let a=G[i].color,o={cx:20,cy:r,r:7,fill:a,stroke:`#000`,pos:G[i].position};U.drawCircle(e,o);let s=e.append(`text`).attr(`visibility`,`hidden`).text(i),c=s.node().getBoundingClientRect().width;s.remove();let l=[];if(c<=n)l=[i];else{let t=i.split(` `),r=``;s=e.append(`text`).attr(`visibility`,`hidden`),t.forEach(e=>{let t=r?`${r} ${e}`:e;if(s.text(t),s.node().getBoundingClientRect().width>n){if(r&&l.push(r),r=e,s.text(e),s.node().getBoundingClientRect().width>n){let t=``;for(let r of e)t+=r,s.text(t+`-`),s.node().getBoundingClientRect().width>n&&(l.push(t.slice(0,-1)+`-`),t=r);r=t}}else r=t}),r&&l.push(r),s.remove()}l.forEach((n,i)=>{let a={x:40,y:r+7+i*20,fill:`#666`,text:n,textMargin:t.boxTextMargin??5},o=U.drawText(e,a).node().getBoundingClientRect().width;o>K&&o>t.leftMargin-o&&(K=o)}),r+=Math.max(20,l.length*20)})}e(q,`drawActorLegend`);var J=l().journey,Y=0,ee=e(function(e,n,r,i){let o=l(),s=o.journey.titleColor,c=o.journey.titleFontSize,u=o.journey.titleFontFamily,d=o.securityLevel,f;d===`sandbox`&&(f=t(`#i`+n));let p=t(d===`sandbox`?f.nodes()[0].contentDocument.body:`body`);X.init();let m=p.select(`#`+n);U.initGraphics(m,n);let h=i.db.getTasks(),g=i.db.getDiagramTitle(),_=i.db.getActors();for(let e in G)delete G[e];let v=0;_.forEach(e=>{G[e]={color:J.actorColours[v%J.actorColours.length],position:v},v++}),q(m),Y=J.leftMargin+K,X.insert(0,0,Y,Object.keys(G).length*50),te(m,h,0,n);let y=X.getBounds();g&&m.append(`text`).text(g).attr(`x`,Y).attr(`font-size`,c).attr(`font-weight`,`bold`).attr(`y`,25).attr(`fill`,s).attr(`font-family`,u);let b=y.stopy-y.starty+2*J.diagramMarginY,x=Y+y.stopx+2*J.diagramMarginX;a(m,b,x,J.useMaxWidth),m.append(`line`).attr(`x1`,Y).attr(`y1`,J.height*4).attr(`x2`,x-Y-4).attr(`y2`,J.height*4).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#`+n+`-arrowhead)`);let S=g?70:0;m.attr(`viewBox`,`${y.startx} -25 ${x} ${b+S}`),m.attr(`preserveAspectRatio`,`xMinYMin meet`),m.attr(`height`,b+S+25)},`draw`),X={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:e(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=l().journey,o=this,s=0;function c(c){return e(function(e){s++;let l=o.sequenceItems.length-s+1;o.updateVal(e,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(e,`stopy`,i+l*a.boxMargin,Math.max),o.updateVal(X.data,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopx`,r+l*a.boxMargin,Math.max),c!==`activation`&&(o.updateVal(e,`startx`,t-l*a.boxMargin,Math.min),o.updateVal(e,`stopx`,r+l*a.boxMargin,Math.max),o.updateVal(X.data,`starty`,n-l*a.boxMargin,Math.min),o.updateVal(X.data,`stopy`,i+l*a.boxMargin,Math.max))},`updateItemBounds`)}e(c,`updateFn`),this.sequenceItems.forEach(c())},`updateBounds`),insert:e(function(e,t,n,r){let i=Math.min(e,n),a=Math.max(e,n),o=Math.min(t,r),s=Math.max(t,r);this.updateVal(X.data,`startx`,i,Math.min),this.updateVal(X.data,`starty`,o,Math.min),this.updateVal(X.data,`stopx`,a,Math.max),this.updateVal(X.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=this.verticalPos},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return this.data},`getBounds`)},Z=J.sectionFills,Q=J.sectionColours,te=e(function(e,t,n,r){let i=l().journey,a=``,o=n+(i.height*2+i.diagramMarginY),s=0,c=`#CCC`,u=`black`,d=0;for(let[n,l]of t.entries()){if(a!==l.section){c=Z[s%Z.length],d=s%Z.length,u=Q[s%Q.length];let r=0,o=l.section;for(let e=n;e<t.length&&t[e].section==o;e++)r+=1;let f={x:n*i.taskMargin+n*i.width+Y,y:50,text:l.section,fill:c,num:d,colour:u,taskCount:r};U.drawSection(e,f,i),a=l.section,s++}let f=l.people.reduce((e,t)=>(G[t]&&(e[t]=G[t]),e),{});l.x=n*i.taskMargin+n*i.width+Y,l.y=o,l.width=i.diagramMarginX,l.height=i.diagramMarginY,l.colour=u,l.fill=c,l.num=d,l.actors=f,U.drawTask(e,l,i,r),X.insert(l.x,l.y,l.x+l.width+i.taskMargin,450)}},`drawTasks`),$={setConf:W,draw:ee},ne={parser:v,db:j,renderer:$,styles:M,init:e(e=>{$.setConf(e.journey),j.clear()},`init`)};export{ne as diagram};