@chaibuilder/pages 0.16.9 → 0.16.10

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 (177) hide show
  1. package/dist/{2AITGKQY-BGZjtYdS.cjs → 2AITGKQY-C0A7leVc.cjs} +1 -1
  2. package/dist/{2AITGKQY-BmDJ4ubt.js → 2AITGKQY-LtoYzpXb.js} +2 -2
  3. package/dist/{NCMVHL6D-CRT9RlLF.cjs → NCMVHL6D-BbCiXTDR.cjs} +1 -1
  4. package/dist/{NCMVHL6D-Dk4_u4LD.js → NCMVHL6D-BqKNTZhH.js} +2 -2
  5. package/dist/{ZDWCUMSJ-Ktzz_Tsg.js → ZDWCUMSJ-CudD-G3A.js} +1 -1
  6. package/dist/{ZDWCUMSJ-DEHPTCDq.cjs → ZDWCUMSJ-DEjMuvHw.cjs} +1 -1
  7. package/dist/{_arrayEach-CvixaZ6g.cjs → _arrayEach-7nw56Qes.cjs} +1 -1
  8. package/dist/{_arrayEach-BoWUuJyH.js → _arrayEach-CBNlJl8q.js} +1 -1
  9. package/dist/{add-new-language-page-BLNVUYeo.js → add-new-language-page-C3R8vwOA.js} +2 -2
  10. package/dist/{add-new-language-page-jU1kF1AN.cjs → add-new-language-page-CTZglguY.cjs} +1 -1
  11. package/dist/{add-new-page-DKyY5ZY7.cjs → add-new-page-ByCsABU-.cjs} +1 -1
  12. package/dist/{add-new-page-X9ytZJiO.js → add-new-page-Dn-jphFf.js} +1 -1
  13. package/dist/{ai-panel-content-ChDHNrKg.js → ai-panel-content-CF7-wrq0.js} +17 -17
  14. package/dist/ai-panel-content-VYS5Bn3a.cjs +1 -0
  15. package/dist/{ai-panel-default-lang-CxmSDvNu.js → ai-panel-default-lang-C_zJzkZ4.js} +110 -104
  16. package/dist/ai-panel-default-lang-D5vpT3cL.cjs +3 -0
  17. package/dist/{ai-panel-other-lang-CicrT1I-.js → ai-panel-other-lang-5Hdkr4eJ.js} +19 -19
  18. package/dist/ai-panel-other-lang-BFnghH5Z.cjs +1 -0
  19. package/dist/{ai-prompt-input-L_bHFj7w.cjs → ai-prompt-input-BXp7SxcJ.cjs} +1 -1
  20. package/dist/{ai-prompt-input-BOAqFpAN.js → ai-prompt-input-CrBweB8X.js} +1 -1
  21. package/dist/{ai-translation-prompt-23g3VfWP.cjs → ai-translation-prompt-BYubvAxO.cjs} +1 -1
  22. package/dist/{ai-translation-prompt-DoeWqKDZ.js → ai-translation-prompt-E3TEDobP.js} +1 -1
  23. package/dist/{arc-CEYgkAY6.js → arc-CuYV2Z4i.js} +1 -1
  24. package/dist/{arc-DQcgp6fe.cjs → arc-Dzs-yn9V.cjs} +1 -1
  25. package/dist/{architecture-U656AL7Q-D9ThnYW7.js → architecture-U656AL7Q-BFW69Rn1.js} +1 -1
  26. package/dist/{architecture-U656AL7Q-DXHyXosc.cjs → architecture-U656AL7Q-C1RBosC-.cjs} +1 -1
  27. package/dist/{architectureDiagram-VXUJARFQ-xhCIZb18.js → architectureDiagram-VXUJARFQ-C7E-J7qp.js} +4 -4
  28. package/dist/{architectureDiagram-VXUJARFQ-DJkKSCT6.cjs → architectureDiagram-VXUJARFQ-i1olysFf.cjs} +1 -1
  29. package/dist/{blockDiagram-VD42YOAC-zvZU2M01.js → blockDiagram-VD42YOAC-8bGFphRU.js} +4 -4
  30. package/dist/{blockDiagram-VD42YOAC-DqXdnG8y.cjs → blockDiagram-VD42YOAC-DG8nN7FI.cjs} +1 -1
  31. package/dist/{c4Diagram-YG6GDRKO-BpDWqFJi.js → c4Diagram-YG6GDRKO-C5vTWKII.js} +2 -2
  32. package/dist/{c4Diagram-YG6GDRKO-COF9vwh9.cjs → c4Diagram-YG6GDRKO-ojLwrHAZ.cjs} +1 -1
  33. package/dist/{channel-DMpDH8Tt.js → channel-Cdlcq82Q.js} +1 -1
  34. package/dist/{channel-DshxF_w-.cjs → channel-D8SQrHOQ.cjs} +1 -1
  35. package/dist/{chunk-4BX2VUAB-DOrHz66s.cjs → chunk-4BX2VUAB-D0Nkkvke.cjs} +1 -1
  36. package/dist/{chunk-4BX2VUAB-DcXzX0k2.js → chunk-4BX2VUAB-kRXCJxGQ.js} +1 -1
  37. package/dist/{chunk-55IACEB6-MgFQOjd_.cjs → chunk-55IACEB6-Ya_-e5Gj.cjs} +1 -1
  38. package/dist/{chunk-55IACEB6-yEIZuruo.js → chunk-55IACEB6-xzVewFKl.js} +1 -1
  39. package/dist/{chunk-B4BG7PRW-Dw8okTHN.cjs → chunk-B4BG7PRW-C8Sj4Rta.cjs} +1 -1
  40. package/dist/{chunk-B4BG7PRW-Bm0X0FwP.js → chunk-B4BG7PRW-DG5qX3ch.js} +4 -4
  41. package/dist/{chunk-DI55MBZ5-CY8rQYfB.cjs → chunk-DI55MBZ5-C9He0Rku.cjs} +1 -1
  42. package/dist/{chunk-DI55MBZ5-Dzl4K5YZ.js → chunk-DI55MBZ5-CI_Ti_F2.js} +3 -3
  43. package/dist/{chunk-FMBD7UC4-DsnO3YB7.js → chunk-FMBD7UC4-9Wx_99-Q.js} +1 -1
  44. package/dist/{chunk-FMBD7UC4-DeDzgDPq.cjs → chunk-FMBD7UC4-Be12B01Q.cjs} +1 -1
  45. package/dist/{chunk-QN33PNHL-D0hZD6ce.cjs → chunk-QN33PNHL-B65aZfT8.cjs} +1 -1
  46. package/dist/{chunk-QN33PNHL-eCpJSQLd.js → chunk-QN33PNHL-qSV2Zj2E.js} +1 -1
  47. package/dist/{chunk-QZHKN3VN-0xh2Brzo.js → chunk-QZHKN3VN-Dcw61eWf.js} +1 -1
  48. package/dist/{chunk-QZHKN3VN-DPT45Qxb.cjs → chunk-QZHKN3VN-V8GIXVhC.cjs} +1 -1
  49. package/dist/{chunk-TZMSLE5B-B0DNnH2K.cjs → chunk-TZMSLE5B-BUsuXR8P.cjs} +1 -1
  50. package/dist/{chunk-TZMSLE5B-v44khzET.js → chunk-TZMSLE5B-De8BBIp6.js} +1 -1
  51. package/dist/{classDiagram-v2-WZHVMYZB-DZwYP3Mp.cjs → classDiagram-2ON5EDUG-DD8PWOat.cjs} +1 -1
  52. package/dist/{classDiagram-v2-WZHVMYZB-CatlwrWr.js → classDiagram-2ON5EDUG-DYXMSnp5.js} +2 -2
  53. package/dist/{classDiagram-2ON5EDUG-DZwYP3Mp.cjs → classDiagram-v2-WZHVMYZB-DD8PWOat.cjs} +1 -1
  54. package/dist/{classDiagram-2ON5EDUG-CatlwrWr.js → classDiagram-v2-WZHVMYZB-DYXMSnp5.js} +2 -2
  55. package/dist/{cose-bilkent-S5V4N54A-oJ7CCCne.cjs → cose-bilkent-S5V4N54A-BzynRFve.cjs} +1 -1
  56. package/dist/{cose-bilkent-S5V4N54A-CdqaV_In.js → cose-bilkent-S5V4N54A-C0LrMYq9.js} +2 -2
  57. package/dist/{dagre-6UL2VRFP-DwJsczXN.cjs → dagre-6UL2VRFP-CJe6baLS.cjs} +1 -1
  58. package/dist/{dagre-6UL2VRFP-ylnuUwh7.js → dagre-6UL2VRFP-DK7rwVEg.js} +1 -1
  59. package/dist/{delete-page-D8gUlElz.js → delete-page-BtWRzpTh.js} +1 -1
  60. package/dist/{delete-page-CSuwBSa6.cjs → delete-page-CecAr8Ev.cjs} +1 -1
  61. package/dist/{diagram-PSM6KHXK-me6JcFi2.js → diagram-PSM6KHXK-C_A00ng9.js} +4 -4
  62. package/dist/{diagram-PSM6KHXK-DPPOo04u.cjs → diagram-PSM6KHXK-X4v5dsQ4.cjs} +1 -1
  63. package/dist/{diagram-QEK2KX5R-atRnaXRv.cjs → diagram-QEK2KX5R-rhfU6qwd.cjs} +1 -1
  64. package/dist/{diagram-QEK2KX5R-CfDWc-r0.js → diagram-QEK2KX5R-tTChUtDg.js} +3 -3
  65. package/dist/{diagram-S2PKOQOG-DvQBNtA7.js → diagram-S2PKOQOG-CJixlBq7.js} +3 -3
  66. package/dist/{diagram-S2PKOQOG-BzM_Yydz.cjs → diagram-S2PKOQOG-XyZUZk_b.cjs} +1 -1
  67. package/dist/{digital-asset-manager-C-tiZy6C.js → digital-asset-manager-CyBlpHrq.js} +1 -1
  68. package/dist/{digital-asset-manager-B1NMros3.cjs → digital-asset-manager-Y8YMABE1.cjs} +1 -1
  69. package/dist/{duplicate-page-BgR_Z5mB.js → duplicate-page-3Dv56tPR.js} +2 -2
  70. package/dist/{duplicate-page-DfsShaR3.cjs → duplicate-page-nGQAYVQc.cjs} +1 -1
  71. package/dist/{dynamic-page-selector-B9LvdmAM.cjs → dynamic-page-selector-B9XaZMxt.cjs} +1 -1
  72. package/dist/{dynamic-page-selector-B_Il05Tb.js → dynamic-page-selector-BapENUmp.js} +1 -1
  73. package/dist/{erDiagram-Q2GNP2WA-BvcqZzam.js → erDiagram-Q2GNP2WA-B1QcX93p.js} +4 -4
  74. package/dist/{erDiagram-Q2GNP2WA-CIz-zXL5.cjs → erDiagram-Q2GNP2WA-Up8_IT91.cjs} +1 -1
  75. package/dist/{flowDiagram-NV44I4VS-H3UO6GU6.cjs → flowDiagram-NV44I4VS-BJffdKk6.cjs} +1 -1
  76. package/dist/{flowDiagram-NV44I4VS-DNDFiS4P.js → flowDiagram-NV44I4VS-Dq0-N_i3.js} +5 -5
  77. package/dist/{ganttDiagram-LVOFAZNH-3uLir5Ok.cjs → ganttDiagram-LVOFAZNH-CndRZUwp.cjs} +1 -1
  78. package/dist/{ganttDiagram-LVOFAZNH-CuEk_EPv.js → ganttDiagram-LVOFAZNH-DCuouHg6.js} +3 -3
  79. package/dist/{gitGraph-F6HP7TQM-DnzvXoTf.cjs → gitGraph-F6HP7TQM-1lOuaCHS.cjs} +1 -1
  80. package/dist/{gitGraph-F6HP7TQM-BNgutOCt.js → gitGraph-F6HP7TQM-Bwgh2Tgj.js} +1 -1
  81. package/dist/{gitGraphDiagram-NY62KEGX-DJ--wipu.js → gitGraphDiagram-NY62KEGX-BFpRv9B4.js} +4 -4
  82. package/dist/{gitGraphDiagram-NY62KEGX-CpjW-tAs.cjs → gitGraphDiagram-NY62KEGX-Cc8RVspd.cjs} +1 -1
  83. package/dist/{index-D_4YaLhN.cjs → index-C1bimRWu.cjs} +2 -2
  84. package/dist/{index-CSOKPmkj.js → index-C_34q9jG.js} +17 -17
  85. package/dist/index.cjs +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/{info-NVLQJR56-nlYJye66.cjs → info-NVLQJR56-C3piIB8L.cjs} +1 -1
  88. package/dist/info-NVLQJR56-DxpWS9Ek.js +5 -0
  89. package/dist/{infoDiagram-ER5ION4S-BYBSnMk9.cjs → infoDiagram-ER5ION4S-DqXS6eRb.cjs} +1 -1
  90. package/dist/{infoDiagram-ER5ION4S-D1ovR6Sb.js → infoDiagram-ER5ION4S-iBX13SKY.js} +2 -2
  91. package/dist/{journeyDiagram-XKPGCS4Q-aab6wkCY.js → journeyDiagram-XKPGCS4Q-CIELmZlO.js} +4 -4
  92. package/dist/{journeyDiagram-XKPGCS4Q-D-YRkdmZ.cjs → journeyDiagram-XKPGCS4Q-CJX0XVNj.cjs} +1 -1
  93. package/dist/{json-diff-viewer-BafhQd3C.cjs → json-diff-viewer-B9kQEwcr.cjs} +1 -1
  94. package/dist/{json-diff-viewer-eh2Twply.js → json-diff-viewer-D2tCblUU.js} +1 -1
  95. package/dist/{kanban-definition-3W4ZIXB7-D_bnY8Es.cjs → kanban-definition-3W4ZIXB7-DnhdFt_Y.cjs} +1 -1
  96. package/dist/{kanban-definition-3W4ZIXB7-BDK6FtYy.js → kanban-definition-3W4ZIXB7-WK7l1gdb.js} +2 -2
  97. package/dist/{lang-panel-koRXBdpN.cjs → lang-panel-ClCAoE4L.cjs} +1 -1
  98. package/dist/{lang-panel-Dha1mI9s.js → lang-panel-CsA6jzez.js} +2 -2
  99. package/dist/{linear-CBvDLesx.cjs → linear-CdbmJ0kA.cjs} +1 -1
  100. package/dist/{linear-DmFX6iHR.js → linear-CebAae2s.js} +1 -1
  101. package/dist/{mark-as-template-DojgcJFD.js → mark-as-template-BsOhlLYx.js} +1 -1
  102. package/dist/{mark-as-template-BHkftF1C.cjs → mark-as-template-DUeGBAgn.cjs} +1 -1
  103. package/dist/{mermaid-parser.core-Df9eyFSv.cjs → mermaid-parser.core-DKJdj2_U.cjs} +2 -2
  104. package/dist/{mermaid-parser.core-Crve7Cv1.js → mermaid-parser.core-GitSl6co.js} +9 -9
  105. package/dist/{mermaid.core-e6RNUZK7.js → mermaid.core-3NhAXOzj.js} +31 -31
  106. package/dist/{mermaid.core-DY8gIrXk.cjs → mermaid.core-Cop_RRH4.cjs} +4 -4
  107. package/dist/{mindmap-definition-VGOIOE7T-BqZKJ_7z.js → mindmap-definition-VGOIOE7T-BOk1rAbB.js} +3 -3
  108. package/dist/{mindmap-definition-VGOIOE7T-CFYCEGsR.cjs → mindmap-definition-VGOIOE7T-cJsasSc0.cjs} +1 -1
  109. package/dist/{no-language-page-content-ZlibO6-a.js → no-language-page-content-DveHrqZF.js} +1 -1
  110. package/dist/{no-language-page-content-BjlCydsa.cjs → no-language-page-content-KLiCVKWw.cjs} +1 -1
  111. package/dist/{packet-BFZMPI3H-CmnL1d8H.cjs → packet-BFZMPI3H-B0uDu6gg.cjs} +1 -1
  112. package/dist/{packet-BFZMPI3H-BNOgRfy4.js → packet-BFZMPI3H-tS-CKRal.js} +1 -1
  113. package/dist/{page-creator-CYxW-uMk.js → page-creator-Du1tv5PL.js} +2 -2
  114. package/dist/{page-creator-D-HTXuwL.cjs → page-creator-I5z6OA-y.cjs} +1 -1
  115. package/dist/{page-lock-request-DIqND4Zp.js → page-lock-request-C_FjXr4-.js} +1 -1
  116. package/dist/{page-lock-request-ggTN32LL.cjs → page-lock-request-DSCZ2b9Y.cjs} +1 -1
  117. package/dist/{page-locked-by-dialog-Dv1QMUs2.js → page-locked-by-dialog-DAJlxcUt.js} +1 -1
  118. package/dist/{page-locked-by-dialog-DF_r3NKB.cjs → page-locked-by-dialog-Daefw0-2.cjs} +1 -1
  119. package/dist/{page-manager-new-iuNdn54Y.js → page-manager-new-BNk_0XVK.js} +2 -2
  120. package/dist/{page-manager-new-B7nEY5DJ.cjs → page-manager-new-DmA0Ka0c.cjs} +1 -1
  121. package/dist/{page-manager-search-and-filter-BuQLf3EG.cjs → page-manager-search-and-filter-DkR8sFPh.cjs} +1 -1
  122. package/dist/{page-manager-search-and-filter-Dvt-nBOL.js → page-manager-search-and-filter-heV_U9x0.js} +1 -1
  123. package/dist/{page-revisions-content-CR_65Pri.cjs → page-revisions-content-BIhjzS21.cjs} +1 -1
  124. package/dist/{page-revisions-content-DH30uwKy.js → page-revisions-content-BVg59skx.js} +2 -2
  125. package/dist/pie-7BOR55EZ-CcDzfu0_.js +5 -0
  126. package/dist/{pie-7BOR55EZ-CM2pRchz.cjs → pie-7BOR55EZ-CqYqIXXG.cjs} +1 -1
  127. package/dist/{pieDiagram-ADFJNKIX-DhRe-2Yk.js → pieDiagram-ADFJNKIX-CFfE-HG7.js} +4 -4
  128. package/dist/{pieDiagram-ADFJNKIX-C_B1s9Ov.cjs → pieDiagram-ADFJNKIX-DWVdC3zW.cjs} +1 -1
  129. package/dist/{publish-pages-content-fwqyxl_3.js → publish-pages-content-BhJ_uRxQ.js} +2 -2
  130. package/dist/{publish-pages-content-DOniOjSV.cjs → publish-pages-content-CKydxoZ_.cjs} +1 -1
  131. package/dist/{quadrantDiagram-AYHSOK5B-DSaDCScU.js → quadrantDiagram-AYHSOK5B-6xSOcCxL.js} +2 -2
  132. package/dist/{quadrantDiagram-AYHSOK5B-CrS56DWV.cjs → quadrantDiagram-AYHSOK5B-J0R9fpox.cjs} +1 -1
  133. package/dist/radar-NHE76QYJ-C4G7hzu6.js +5 -0
  134. package/dist/{radar-NHE76QYJ-CPX8AaYO.cjs → radar-NHE76QYJ-EznHmPEg.cjs} +1 -1
  135. package/dist/{requirementDiagram-UZGBJVZJ-D60OatrS.cjs → requirementDiagram-UZGBJVZJ-DXq0f3Op.cjs} +1 -1
  136. package/dist/{requirementDiagram-UZGBJVZJ-CbpHc5TO.js → requirementDiagram-UZGBJVZJ-p2d3AnQ8.js} +3 -3
  137. package/dist/{sankeyDiagram-TZEHDZUN-DklD-Q91.cjs → sankeyDiagram-TZEHDZUN-CLBuuob-.cjs} +1 -1
  138. package/dist/{sankeyDiagram-TZEHDZUN-AFuyaZMZ.js → sankeyDiagram-TZEHDZUN-CbASga1e.js} +1 -1
  139. package/dist/{save-to-lib-DKP-iiLU.js → save-to-lib-Byfa7tCG.js} +1 -1
  140. package/dist/{save-to-lib-DmZbKkm9.cjs → save-to-lib-C3mx8iXu.cjs} +1 -1
  141. package/dist/{selected-block-display-BPkRbRtv.js → selected-block-display-CZ3zwgqL.js} +2 -2
  142. package/dist/{selected-block-display-CMhOKq0c.cjs → selected-block-display-GwQBADhp.cjs} +2 -2
  143. package/dist/{seo-panel-D1FyS42r.js → seo-panel-CrpYigIp.js} +1 -1
  144. package/dist/{seo-panel-l-VdkTzp.cjs → seo-panel-DxaEiunO.cjs} +1 -1
  145. package/dist/{sequenceDiagram-WL72ISMW-p_o77zn1.js → sequenceDiagram-WL72ISMW-3T2mzAhA.js} +3 -3
  146. package/dist/{sequenceDiagram-WL72ISMW-CotOH2Xj.cjs → sequenceDiagram-WL72ISMW-DmS_WEPR.cjs} +1 -1
  147. package/dist/server.cjs +1 -1
  148. package/dist/server.js +1 -1
  149. package/dist/{shared-json-ld-0VORoKPu.cjs → shared-json-ld-CcUhox6j.cjs} +1 -1
  150. package/dist/{shared-json-ld-jn36kQ1J.js → shared-json-ld-DczSLaqw.js} +1 -1
  151. package/dist/{slug-input-DPMG1pMZ.js → slug-input-CjagPxIn.js} +1 -1
  152. package/dist/{slug-input-CPHwulQv.cjs → slug-input-CsniBgYf.cjs} +1 -1
  153. package/dist/{stateDiagram-FKZM4ZOC-B1pfSzZB.cjs → stateDiagram-FKZM4ZOC-BmMX9umD.cjs} +1 -1
  154. package/dist/{stateDiagram-FKZM4ZOC-Ch8gd7OX.js → stateDiagram-FKZM4ZOC-D9lkyJcL.js} +2 -2
  155. package/dist/{stateDiagram-v2-4FDKWEC3-DCj4svbU.cjs → stateDiagram-v2-4FDKWEC3-BwQkMtRv.cjs} +1 -1
  156. package/dist/{stateDiagram-v2-4FDKWEC3-BDxmTUgh.js → stateDiagram-v2-4FDKWEC3-D0yq-_gB.js} +2 -2
  157. package/dist/{theme-panel-footer-DsZ67xQ8.cjs → theme-panel-footer-BYI0_a19.cjs} +1 -1
  158. package/dist/{theme-panel-footer-XREndTvO.js → theme-panel-footer-C-uSbeOf.js} +1 -1
  159. package/dist/{timeline-definition-IT6M3QCI-CK1EW7lG.cjs → timeline-definition-IT6M3QCI-Bi9IiYMF.cjs} +1 -1
  160. package/dist/{timeline-definition-IT6M3QCI-CmX-2kfr.js → timeline-definition-IT6M3QCI-LtkAohDp.js} +2 -2
  161. package/dist/{treemap-KMMF4GRG-D5Rm845j.cjs → treemap-KMMF4GRG-DAuFMsAI.cjs} +1 -1
  162. package/dist/{treemap-KMMF4GRG-B51FyMCU.js → treemap-KMMF4GRG-vy1iI8-N.js} +1 -1
  163. package/dist/{unmark-as-template-VHopisw3.js → unmark-as-template-CGKkAZPZ.js} +1 -1
  164. package/dist/{unmark-as-template-BB_2lvTh.cjs → unmark-as-template-GuUssCYI.cjs} +1 -1
  165. package/dist/{unpublish-page-DJKgb2OG.cjs → unpublish-page-D67IrGmd.cjs} +1 -1
  166. package/dist/{unpublish-page-Cq5OwCf-.js → unpublish-page-ow8e1CXO.js} +1 -1
  167. package/dist/{web-preview-CGX6_m7_.cjs → web-preview-Dm8A9E8S.cjs} +1 -1
  168. package/dist/{web-preview-BEYsnCo4.js → web-preview-NCfHy3pB.js} +1 -1
  169. package/dist/{xychartDiagram-PRI3JC2R-BXSS1azt.cjs → xychartDiagram-PRI3JC2R-d5V8_6ka.cjs} +1 -1
  170. package/dist/{xychartDiagram-PRI3JC2R-vt3IdmK_.js → xychartDiagram-PRI3JC2R-ggiHJXU7.js} +2 -2
  171. package/package.json +12 -12
  172. package/dist/ai-panel-content-Bi18WMi2.cjs +0 -1
  173. package/dist/ai-panel-default-lang-B6tYYmxI.cjs +0 -3
  174. package/dist/ai-panel-other-lang-B0umwiEm.cjs +0 -1
  175. package/dist/info-NVLQJR56-cQ8VboSE.js +0 -5
  176. package/dist/pie-7BOR55EZ-B4yrare5.js +0 -5
  177. package/dist/radar-NHE76QYJ-CN3oBECV.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./mermaid.core-DY8gIrXk.cjs"),se=require("./chunk-QN33PNHL-D0hZD6ce.cjs"),ie=require("./chunk-4BX2VUAB-DOrHz66s.cjs"),oe=require("./mermaid-parser.core-Df9eyFSv.cjs"),I=require("./defaultLocale-DIVzfLaQ.cjs"),U=require("./ordinal-CagbB1m8.cjs");function ce(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function de(){return this.eachAfter(ce)}function ue(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function he(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(t,a){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++m,this);return this}function fe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function ge(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function me(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ye(t){for(var a=this,l=Se(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Se(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function ve(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function xe(){return Array.from(this)}function be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function we(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ce(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Le)):a===void 0&&(a=Te);for(var l=new j(t),n,o=[l],s,d,h,m;n=o.pop();)if((d=a(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return Q(this).eachBefore($e)}function Te(t){return t.children}function Le(t){return Array.isArray(t)?t[1]:null}function $e(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ae(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=Q.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Ne(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Me(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(n-a)/t.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function Fe(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(o-l)/t.value;++h<m;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(t,a,l,n,o,s){for(var d=[],h=a.children,m,c,p=0,w=0,r=h.length,b,v,x=a.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*t),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=function t(a){function l(n,o,s,d,h){Ve(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(ze);function Be(){var t=Pe,a=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],a&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),t(r,v,x,f,y))}return p.round=function(r){return arguments.length?(a=!!r,p):a},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(t=ke(r),p):t},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var D,J=(D=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(D,"TreeMapDB"),D);function K(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}u.__name(K,"buildHierarchy");var De=u.__name((t,a)=>{ie.populateCommonDb(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=K(l),o=u.__name((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(t=>t.name?String(t.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async t=>{var a;try{const l=oe.parse,n=await l("treemap",t);u.log.debug("Treemap AST:",n);const o=(a=ee.parser)==null?void 0:a.yy;if(!(o instanceof J))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");De(n,o)}catch(l){throw u.log.error("Error parsing treemap:",l),l}},"parse")},Ee=10,B=10,G=25,We=u.__name((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(a),r=s.nodeWidth?s.nodeWidth*B:960,b=s.nodeHeight?s.nodeHeight*B:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=U.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=U.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=Be().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${a}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),He=u.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:t}={})=>{const a=u.cleanAndMerge(qe,t);return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./mermaid.core-Cop_RRH4.cjs"),se=require("./chunk-QN33PNHL-B65aZfT8.cjs"),ie=require("./chunk-4BX2VUAB-D0Nkkvke.cjs"),oe=require("./mermaid-parser.core-DKJdj2_U.cjs"),I=require("./defaultLocale-DIVzfLaQ.cjs"),U=require("./ordinal-CagbB1m8.cjs");function ce(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function de(){return this.eachAfter(ce)}function ue(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function he(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function pe(t,a){for(var l=this,n=[l],o=[],s,d,h,m=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++m,this);return this}function fe(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function ge(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function me(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ye(t){for(var a=this,l=Se(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Se(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function ve(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function xe(){return Array.from(this)}function be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function we(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ce(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Le)):a===void 0&&(a=Te);for(var l=new j(t),n,o=[l],s,d,h,m;n=o.pop();)if((d=a(n.data))&&(m=(d=Array.from(d)).length))for(n.children=d,h=m-1;h>=0;--h)o.push(s=d[h]=new j(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ae)}function _e(){return Q(this).eachBefore($e)}function Te(t){return t.children}function Le(t){return Array.isArray(t)?t[1]:null}function $e(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ae(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function j(t){this.data=t,this.depth=this.height=0,this.parent=null}j.prototype=Q.prototype={constructor:j,count:de,each:ue,eachAfter:pe,eachBefore:he,find:fe,sum:ge,sort:me,path:ye,ancestors:ve,descendants:xe,leaves:be,links:we,copy:_e,[Symbol.iterator]:Ce};function ke(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function O(t){return function(){return t}}function Ne(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Me(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(n-a)/t.value;++h<m;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function Fe(t,a,l,n,o){for(var s=t.children,d,h=-1,m=s.length,c=t.value&&(o-l)/t.value;++h<m;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var ze=(1+Math.sqrt(5))/2;function Ve(t,a,l,n,o,s){for(var d=[],h=a.children,m,c,p=0,w=0,r=h.length,b,v,x=a.value,f,y,N,k,V,R,M;p<r;){b=o-l,v=s-n;do f=h[w++].value;while(!f&&w<r);for(y=N=f,R=Math.max(v/b,b/v)/(x*t),M=f*f*R,V=Math.max(N/M,M/y);w<r;++w){if(f+=c=h[w].value,c<y&&(y=c),c>N&&(N=c),M=f*f*R,k=Math.max(N/M,M/y),k>V){f-=c;break}V=k}d.push(m={value:f,dice:b<v,children:h.slice(p,w)}),m.dice?Me(m,l,n,o,x?n+=v*f/x:s):Fe(m,l,n,x?l+=b*f/x:o,s),x-=f,p=w}return d}const Pe=function t(a){function l(n,o,s,d,h){Ve(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(ze);function Be(){var t=Pe,a=!1,l=1,n=1,o=[0],s=q,d=q,h=q,m=q,c=q;function p(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(w),o=[0],a&&r.eachBefore(Ne),r}function w(r){var b=o[r.depth],v=r.x0+b,x=r.y0+b,f=r.x1-b,y=r.y1-b;f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),r.x0=v,r.y0=x,r.x1=f,r.y1=y,r.children&&(b=o[r.depth+1]=s(r)/2,v+=c(r)-b,x+=d(r)-b,f-=h(r)-b,y-=m(r)-b,f<v&&(v=f=(v+f)/2),y<x&&(x=y=(x+y)/2),t(r,v,x,f,y))}return p.round=function(r){return arguments.length?(a=!!r,p):a},p.size=function(r){return arguments.length?(l=+r[0],n=+r[1],p):[l,n]},p.tile=function(r){return arguments.length?(t=ke(r),p):t},p.padding=function(r){return arguments.length?p.paddingInner(r).paddingOuter(r):p.paddingInner()},p.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:O(+r),p):s},p.paddingOuter=function(r){return arguments.length?p.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):p.paddingTop()},p.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:O(+r),p):d},p.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:O(+r),p):h},p.paddingBottom=function(r){return arguments.length?(m=typeof r=="function"?r:O(+r),p):m},p.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:O(+r),p):c},p}var D,J=(D=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=u.setAccTitle,this.getAccTitle=u.getAccTitle,this.setDiagramTitle=u.setDiagramTitle,this.getDiagramTitle=u.getDiagramTitle,this.getAccDescription=u.getAccDescription,this.setAccDescription=u.setAccDescription}getNodes(){return this.nodes}getConfig(){const a=u.defaultConfig_default,l=u.getConfig();return u.cleanAndMerge({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{u.isLabelStyle(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){u.clear(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},u.__name(D,"TreeMapDB"),D);function K(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(o.cssCompiledStyles=[n.cssCompiledStyles]),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}u.__name(K,"buildHierarchy");var De=u.__name((t,a)=>{ie.populateCommonDb(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,m=Re(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],p=c.length>0?c.join(";"):void 0,w={level:h,name:m,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};l.push(w)}const n=K(l),o=u.__name((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),Re=u.__name(t=>t.name?String(t.name):"","getItemName"),ee={parser:{yy:void 0},parse:u.__name(async t=>{var a;try{const l=oe.parse,n=await l("treemap",t);u.log.debug("Treemap AST:",n);const o=(a=ee.parser)==null?void 0:a.yy;if(!(o instanceof J))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");De(n,o)}catch(l){throw u.log.error("Error parsing treemap:",l),l}},"parse")},Ee=10,B=10,G=25,We=u.__name((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??Ee,h=o.getDiagramTitle(),m=o.getRoot(),{themeVariables:c}=u.getConfig();if(!m)return;const p=h?30:0,w=u.selectSvgElement(a),r=s.nodeWidth?s.nodeWidth*B:960,b=s.nodeHeight?s.nodeHeight*B:500,v=r,x=b+p;w.attr("viewBox",`0 0 ${v} ${x}`),u.configureSvgSize(w,x,v,s.useMaxWidth);let f;try{const e=s.valueFormat||",";if(e==="$0,0")f=u.__name(i=>"$"+I.format(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),g=i?i[0]:"";f=u.__name(C=>"$"+I.format(","+g)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);f=u.__name(g=>"$"+I.format(i||"")(g),"valueFormat")}else f=I.format(e)}catch(e){u.log.error("Error creating format function:",e),f=I.format(",")}const y=U.ordinal().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=U.ordinal().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=U.ordinal().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&w.append("text").attr("x",v/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=w.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=Q(m).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),Z=Be().size([r,b]).paddingTop(e=>e.children&&e.children.length>0?G+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(R),te=Z.descendants().filter(e=>e.children&&e.children.length>0),E=V.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),E.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",G),E.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),E.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=u.select(this),g=e.data.name;i.text(g);const C=e.x1-e.x0,L=6;let $;s.showValues!==!1&&e.value?$=C-10-30-10-L:$=C-L-6;const A=Math.max(15,$),S=i.node();if(S.getComputedTextLength()>A){const _="...";let T=g;for(;T.length>0;){if(T=g.substring(0,T.length-1),T.length===0){i.text(_),S.getComputedTextLength()>A&&i.text("");break}if(i.text(T+_),S.getComputedTextLength()<=A)break}}}),s.showValues!==!1&&E.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?f(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")});const ae=Z.leaves(),X=V.selectAll(".treemapLeafGroup").data(ae).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);X.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),X.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),X.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",g=u.styles2String({cssCompiledStyles:e.data.cssCompiledStyles});return i+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=u.select(this),g=e.x1-e.x0,C=e.y1-e.y0,L=i.node(),$=4,P=g-2*$,A=C-2*$;if(P<10||A<10){i.style("display","none");return}let S=parseInt(i.style("font-size"),10);const F=8,_=28,T=.6,z=6,W=2;for(;L.getComputedTextLength()>P&&S>F;)S--,i.style("font-size",`${S}px`);let H=Math.max(z,Math.min(_,Math.round(S*T))),Y=S+W+H;for(;Y>A&&S>F&&(S--,H=Math.max(z,Math.min(_,Math.round(S*T))),!(H<z&&S===F));)i.style("font-size",`${S}px`),Y=S+W+H;i.style("font-size",`${S}px`),(L.getComputedTextLength()>P||S<F||A<S)&&i.style("display","none")}),s.showValues!==!1&&X.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const g="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=u.styles2String({cssCompiledStyles:i.data.cssCompiledStyles});return g+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,g)=>`url(#clip-${a}-${g})`).text(i=>i.value?f(i.value):"").each(function(i){const g=u.select(this),C=this.parentNode;if(!C){g.style("display","none");return}const L=u.select(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){g.style("display","none");return}const $=parseFloat(L.style("font-size")),P=28,A=.6,S=6,F=2,_=Math.max(S,Math.min(P,Math.round($*A)));g.style("font-size",`${_}px`);const z=(i.y1-i.y0)/2+$/2+F;g.attr("y",z);const W=i.x1-i.x0,le=i.y1-i.y0-4,re=W-2*4;g.node().getComputedTextLength()>re||z+_>le||_<S?g.style("display","none"):g.style("display",null)});const ne=s.diagramPadding??8;se.setupViewPortForSVG(w,ne,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),He=u.__name(function(t,a){return a.db.getClasses()},"getClasses"),Ie={draw:We,getClasses:He},qe={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},Oe=u.__name(({treemap:t}={})=>{const a=u.cleanAndMerge(qe,t);return`
2
2
  .treemapNode.section {
3
3
  stroke: ${a.sectionStrokeColor};
4
4
  stroke-width: ${a.sectionStrokeWidth};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./mermaid.core-DY8gIrXk.cjs"),L=require("./chunk-4BX2VUAB-DOrHz66s.cjs"),O=require("./mermaid-parser.core-Df9eyFSv.cjs");var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y={axes:[],curves:[],options:h},p=structuredClone(y),S=s.defaultConfig_default.radar,k=s.__name(()=>s.cleanAndMerge({...S,...s.getConfig().radar}),"getConfig"),f=s.__name(()=>p.axes,"getAxes"),D=s.__name(()=>p.curves,"getCurves"),R=s.__name(()=>p.options,"getOptions"),I=s.__name(a=>{p.axes=a.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),E=s.__name(a=>{p.curves=a.map(e=>({name:e.name,label:e.label??e.name,entries:F(e.entries)}))},"setCurves"),F=s.__name(a=>{if(a[0].axis==null)return a.map(t=>t.value);const e=f();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(t=>{const r=a.find(n=>{var o;return((o=n.axis)==null?void 0:o.$refText)===t.name});if(r===void 0)throw new Error("Missing entry for axis "+t.label);return r.value})},"computeCurveEntries"),P=s.__name(a=>{var t,r,n,o,l;const e=a.reduce((i,c)=>(i[c.name]=c,i),{});p.options={showLegend:((t=e.showLegend)==null?void 0:t.value)??h.showLegend,ticks:((r=e.ticks)==null?void 0:r.value)??h.ticks,max:((n=e.max)==null?void 0:n.value)??h.max,min:((o=e.min)==null?void 0:o.value)??h.min,graticule:((l=e.graticule)==null?void 0:l.value)??h.graticule}},"setOptions"),G=s.__name(()=>{s.clear(),p=structuredClone(y)},"clear"),_={getAxes:f,getCurves:D,getOptions:R,setAxes:I,setCurves:E,setOptions:P,getConfig:k,clear:G,setAccTitle:s.setAccTitle,getAccTitle:s.getAccTitle,setDiagramTitle:s.setDiagramTitle,getDiagramTitle:s.getDiagramTitle,getAccDescription:s.getAccDescription,setAccDescription:s.setAccDescription},z=s.__name(a=>{L.populateCommonDb(a,_);const{axes:e,curves:t,options:r}=a;_.setAxes(e),_.setCurves(t),_.setOptions(r)},"populate"),B={parse:s.__name(async a=>{const e=await O.parse("radar",a);s.log.debug(e),z(e)},"parse")},V=s.__name((a,e,t,r)=>{const n=r.db,o=n.getAxes(),l=n.getCurves(),i=n.getOptions(),c=n.getConfig(),d=n.getDiagramTitle(),u=s.selectSvgElement(e),m=W(u,c),g=i.max??Math.max(...l.map($=>Math.max(...$.entries))),x=i.min,v=Math.min(c.width,c.height)/2;j(m,o,v,i.ticks,i.graticule),q(m,o,v,c),C(m,o,l,x,g,i.graticule,c),A(m,l,i.showLegend,c),m.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),W=s.__name((a,e)=>{const t=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return a.attr("viewbox",`0 0 ${t} ${r}`).attr("width",t).attr("height",r),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),j=s.__name((a,e,t,r,n)=>{if(n==="circle")for(let o=0;o<r;o++){const l=t*(o+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(n==="polygon"){const o=e.length;for(let l=0;l<r;l++){const i=t*(l+1)/r,c=e.map((d,u)=>{const m=2*u*Math.PI/o-Math.PI/2,g=i*Math.cos(m),x=i*Math.sin(m);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),q=s.__name((a,e,t,r)=>{const n=e.length;for(let o=0;o<n;o++){const l=e[o].label,i=2*o*Math.PI/n-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",t*r.axisScaleFactor*Math.cos(i)).attr("y2",t*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",t*r.axisLabelFactor*Math.cos(i)).attr("y",t*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,e,t,r,n,o,l){const i=e.length,c=Math.min(l.width,l.height)/2;t.forEach((d,u)=>{if(d.entries.length!==i)return;const m=d.entries.map((g,x)=>{const v=2*Math.PI*x/i-Math.PI/2,$=w(g,r,n,c),M=$*Math.cos(v),T=$*Math.sin(v);return{x:M,y:T}});o==="circle"?a.append("path").attr("d",b(m,l.curveTension)).attr("class",`radarCurve-${u}`):o==="polygon"&&a.append("polygon").attr("points",m.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${u}`)})}s.__name(C,"drawCurves");function w(a,e,t,r){const n=Math.min(Math.max(a,e),t);return r*(n-e)/(t-e)}s.__name(w,"relativeRadius");function b(a,e){const t=a.length;let r=`M${a[0].x},${a[0].y}`;for(let n=0;n<t;n++){const o=a[(n-1+t)%t],l=a[n],i=a[(n+1)%t],c=a[(n+2)%t],d={x:l.x+(i.x-o.x)*e,y:l.y+(i.y-o.y)*e},u={x:i.x-(c.x-l.x)*e,y:i.y-(c.y-l.y)*e};r+=` C${d.x},${d.y} ${u.x},${u.y} ${i.x},${i.y}`}return`${r} Z`}s.__name(b,"closedRoundCurve");function A(a,e,t,r){if(!t)return;const n=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,l=20;e.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${n}, ${o+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}s.__name(A,"drawLegend");var H={draw:V},U=s.__name((a,e)=>{let t="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const n=a[`cScale${r}`];t+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./mermaid.core-Cop_RRH4.cjs"),L=require("./chunk-4BX2VUAB-D0Nkkvke.cjs"),O=require("./mermaid-parser.core-DKJdj2_U.cjs");var h={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y={axes:[],curves:[],options:h},p=structuredClone(y),S=s.defaultConfig_default.radar,k=s.__name(()=>s.cleanAndMerge({...S,...s.getConfig().radar}),"getConfig"),f=s.__name(()=>p.axes,"getAxes"),D=s.__name(()=>p.curves,"getCurves"),R=s.__name(()=>p.options,"getOptions"),I=s.__name(a=>{p.axes=a.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),E=s.__name(a=>{p.curves=a.map(e=>({name:e.name,label:e.label??e.name,entries:F(e.entries)}))},"setCurves"),F=s.__name(a=>{if(a[0].axis==null)return a.map(t=>t.value);const e=f();if(e.length===0)throw new Error("Axes must be populated before curves for reference entries");return e.map(t=>{const r=a.find(n=>{var o;return((o=n.axis)==null?void 0:o.$refText)===t.name});if(r===void 0)throw new Error("Missing entry for axis "+t.label);return r.value})},"computeCurveEntries"),P=s.__name(a=>{var t,r,n,o,l;const e=a.reduce((i,c)=>(i[c.name]=c,i),{});p.options={showLegend:((t=e.showLegend)==null?void 0:t.value)??h.showLegend,ticks:((r=e.ticks)==null?void 0:r.value)??h.ticks,max:((n=e.max)==null?void 0:n.value)??h.max,min:((o=e.min)==null?void 0:o.value)??h.min,graticule:((l=e.graticule)==null?void 0:l.value)??h.graticule}},"setOptions"),G=s.__name(()=>{s.clear(),p=structuredClone(y)},"clear"),_={getAxes:f,getCurves:D,getOptions:R,setAxes:I,setCurves:E,setOptions:P,getConfig:k,clear:G,setAccTitle:s.setAccTitle,getAccTitle:s.getAccTitle,setDiagramTitle:s.setDiagramTitle,getDiagramTitle:s.getDiagramTitle,getAccDescription:s.getAccDescription,setAccDescription:s.setAccDescription},z=s.__name(a=>{L.populateCommonDb(a,_);const{axes:e,curves:t,options:r}=a;_.setAxes(e),_.setCurves(t),_.setOptions(r)},"populate"),B={parse:s.__name(async a=>{const e=await O.parse("radar",a);s.log.debug(e),z(e)},"parse")},V=s.__name((a,e,t,r)=>{const n=r.db,o=n.getAxes(),l=n.getCurves(),i=n.getOptions(),c=n.getConfig(),d=n.getDiagramTitle(),u=s.selectSvgElement(e),m=W(u,c),g=i.max??Math.max(...l.map($=>Math.max(...$.entries))),x=i.min,v=Math.min(c.width,c.height)/2;j(m,o,v,i.ticks,i.graticule),q(m,o,v,c),C(m,o,l,x,g,i.graticule,c),A(m,l,i.showLegend,c),m.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),W=s.__name((a,e)=>{const t=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};return a.attr("viewbox",`0 0 ${t} ${r}`).attr("width",t).attr("height",r),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),j=s.__name((a,e,t,r,n)=>{if(n==="circle")for(let o=0;o<r;o++){const l=t*(o+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(n==="polygon"){const o=e.length;for(let l=0;l<r;l++){const i=t*(l+1)/r,c=e.map((d,u)=>{const m=2*u*Math.PI/o-Math.PI/2,g=i*Math.cos(m),x=i*Math.sin(m);return`${g},${x}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),q=s.__name((a,e,t,r)=>{const n=e.length;for(let o=0;o<n;o++){const l=e[o].label,i=2*o*Math.PI/n-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",t*r.axisScaleFactor*Math.cos(i)).attr("y2",t*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",t*r.axisLabelFactor*Math.cos(i)).attr("y",t*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,e,t,r,n,o,l){const i=e.length,c=Math.min(l.width,l.height)/2;t.forEach((d,u)=>{if(d.entries.length!==i)return;const m=d.entries.map((g,x)=>{const v=2*Math.PI*x/i-Math.PI/2,$=w(g,r,n,c),M=$*Math.cos(v),T=$*Math.sin(v);return{x:M,y:T}});o==="circle"?a.append("path").attr("d",b(m,l.curveTension)).attr("class",`radarCurve-${u}`):o==="polygon"&&a.append("polygon").attr("points",m.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${u}`)})}s.__name(C,"drawCurves");function w(a,e,t,r){const n=Math.min(Math.max(a,e),t);return r*(n-e)/(t-e)}s.__name(w,"relativeRadius");function b(a,e){const t=a.length;let r=`M${a[0].x},${a[0].y}`;for(let n=0;n<t;n++){const o=a[(n-1+t)%t],l=a[n],i=a[(n+1)%t],c=a[(n+2)%t],d={x:l.x+(i.x-o.x)*e,y:l.y+(i.y-o.y)*e},u={x:i.x-(c.x-l.x)*e,y:i.y-(c.y-l.y)*e};r+=` C${d.x},${d.y} ${u.x},${u.y} ${i.x},${i.y}`}return`${r} Z`}s.__name(b,"closedRoundCurve");function A(a,e,t,r){if(!t)return;const n=(r.width/2+r.marginRight)*3/4,o=-(r.height/2+r.marginTop)*3/4,l=20;e.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${n}, ${o+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}s.__name(A,"drawLegend");var H={draw:V},U=s.__name((a,e)=>{let t="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const n=a[`cScale${r}`];t+=`
2
2
  .radarCurve-${r} {
3
3
  color: ${n};
4
4
  fill: ${n};
@@ -1,6 +1,6 @@
1
- import { E as k, _ as l, s as R, g as E, o as F, p as I, b as _, c as D, l as G, F as y, G as C, v as P, K as z, a1 as V } from "./mermaid.core-e6RNUZK7.js";
2
- import { p as W } from "./chunk-4BX2VUAB-DcXzX0k2.js";
3
- import { p as B } from "./mermaid-parser.core-Crve7Cv1.js";
1
+ import { E as k, _ as l, s as R, g as E, o as F, p as I, b as _, c as D, l as G, F as y, G as C, v as P, K as z, a1 as V } from "./mermaid.core-3NhAXOzj.js";
2
+ import { p as W } from "./chunk-4BX2VUAB-kRXCJxGQ.js";
3
+ import { p as B } from "./mermaid-parser.core-GitSl6co.js";
4
4
  var x = {
5
5
  showLegend: !0,
6
6
  ticks: 5,
@@ -1,6 +1,6 @@
1
- import { E as B, s as C, g as S, o as D, p as T, b as E, c as F, _ as b, F as m, G as P, v as z, l as w, K as A, k as W } from "./mermaid.core-e6RNUZK7.js";
2
- import { p as _ } from "./chunk-4BX2VUAB-DcXzX0k2.js";
3
- import { p as N } from "./mermaid-parser.core-Crve7Cv1.js";
1
+ import { E as B, s as C, g as S, o as D, p as T, b as E, c as F, _ as b, F as m, G as P, v as z, l as w, K as A, k as W } from "./mermaid.core-3NhAXOzj.js";
2
+ import { p as _ } from "./chunk-4BX2VUAB-kRXCJxGQ.js";
3
+ import { p as N } from "./mermaid-parser.core-GitSl6co.js";
4
4
  var L = B.packet, u, v = (u = class {
5
5
  constructor() {
6
6
  this.packet = [], this.setAccTitle = C, this.getAccTitle = S, this.setDiagramTitle = D, this.getDiagramTitle = T, this.getAccDescription = E, this.setAccDescription = F;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./mermaid.core-DY8gIrXk.cjs"),x=require("./chunk-4BX2VUAB-DOrHz66s.cjs"),B=require("./mermaid-parser.core-Df9eyFSv.cjs");var $=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...$,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{x.populateCommonDb(e,t);let i=-1,o=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??(r=i+1),r!==i+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${i+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??(n=r+(p??1)-1),p??(p=n-r+1),i=n,a.log.debug(`Packet block ${r} - ${i} with label ${d}`);o.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(o.push(g),g.end+1===l*c&&(t.pushWord(o),o=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(o)},"populate"),S=a.__name((e,t,i)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*i)return[e,void 0];const o=t*i-1,l=t*i;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{var o;const t=await B.parse("packet",e),i=(o=w.parser)==null?void 0:o.yy;if(!(i instanceof m))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.log.debug(t),_(t,i)},"parse")},P=a.__name((e,t,i,o)=>{const l=o.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,y]of g.entries())T(u,y,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),T=a.__name((e,t,i,{rowHeight:o,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=i*(o+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",o).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:P},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,e);return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./mermaid.core-Cop_RRH4.cjs"),x=require("./chunk-4BX2VUAB-D0Nkkvke.cjs"),B=require("./mermaid-parser.core-DKJdj2_U.cjs");var $=a.defaultConfig_default.packet,b,m=(b=class{constructor(){this.packet=[],this.setAccTitle=a.setAccTitle,this.getAccTitle=a.getAccTitle,this.setDiagramTitle=a.setDiagramTitle,this.getDiagramTitle=a.getDiagramTitle,this.getAccDescription=a.getAccDescription,this.setAccDescription=a.setAccDescription}getConfig(){const t=a.cleanAndMerge({...$,...a.getConfig().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){a.clear(),this.packet=[]}},a.__name(b,"PacketDB"),b),C=1e4,_=a.__name((e,t)=>{x.populateCommonDb(e,t);let i=-1,o=[],l=1;const{bitsPerRow:c}=t.getConfig();for(let{start:r,end:n,bits:p,label:d}of e.blocks){if(r!==void 0&&n!==void 0&&n<r)throw new Error(`Packet block ${r} - ${n} is invalid. End must be greater than start.`);if(r??(r=i+1),r!==i+1)throw new Error(`Packet block ${r} - ${n??r} is not contiguous. It should start from ${i+1}.`);if(p===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(n??(n=r+(p??1)-1),p??(p=n-r+1),i=n,a.log.debug(`Packet block ${r} - ${i} with label ${d}`);o.length<=c+1&&t.getPacket().length<C;){const[g,s]=S({start:r,end:n,bits:p,label:d},l,c);if(o.push(g),g.end+1===l*c&&(t.pushWord(o),o=[],l++),!s)break;({start:r,end:n,bits:p,label:d}=s)}}t.pushWord(o)},"populate"),S=a.__name((e,t,i)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*i)return[e,void 0];const o=t*i-1,l=t*i;return[{start:e.start,end:o,label:e.label,bits:o-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),w={parser:{yy:void 0},parse:a.__name(async e=>{var o;const t=await B.parse("packet",e),i=(o=w.parser)==null?void 0:o.yy;if(!(i instanceof m))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");a.log.debug(t),_(t,i)},"parse")},P=a.__name((e,t,i,o)=>{const l=o.db,c=l.getConfig(),{rowHeight:r,paddingY:n,bitWidth:p,bitsPerRow:d}=c,g=l.getPacket(),s=l.getDiagramTitle(),k=r+n,h=k*(g.length+1)-(s?0:r),f=p*d+2,u=a.selectSvgElement(t);u.attr("viewbox",`0 0 ${f} ${h}`),a.configureSvgSize(u,h,f,c.useMaxWidth);for(const[v,y]of g.entries())T(u,y,v,c);u.append("text").text(s).attr("x",f/2).attr("y",h-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),T=a.__name((e,t,i,{rowHeight:o,paddingX:l,paddingY:c,bitWidth:r,bitsPerRow:n,showBits:p})=>{const d=e.append("g"),g=i*(o+c)+c;for(const s of t){const k=s.start%n*r+1,h=(s.end-s.start+1)*r-l;if(d.append("rect").attr("x",k).attr("y",g).attr("width",h).attr("height",o).attr("class","packetBlock"),d.append("text").attr("x",k+h/2).attr("y",g+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!p)continue;const f=s.end===s.start,u=g-2;d.append("text").attr("x",k+(f?h/2:0)).attr("y",u).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",f?"middle":"start").text(s.start),f||d.append("text").attr("x",k+h).attr("y",u).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),D={draw:P},A={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},z=a.__name(({packet:e}={})=>{const t=a.cleanAndMerge(A,e);return`
2
2
  .packetByte {
3
3
  font-size: ${t.byteFontSize};
4
4
  }
@@ -5,7 +5,7 @@ import { find as Ge, merge as Oe, pick as Y, first as Be, isEmpty as Ke } from "
5
5
  import { ChevronLeft as he, ChevronRight as Qe, Loader as B, AlertCircle as Re, Copy as fe, Pencil as We, Link as Ve, Search as He, RefreshCwIcon as Xe, Archive as Ze, Film as Je, ImageIcon as Ye, Edit as et, Trash2 as tt, Check as it, Upload as lt, AlertTriangle as at } from "lucide-react";
6
6
  import pe, { useState as y, useMemo as ge, useEffect as O, useCallback as M, Suspense as rt } from "react";
7
7
  import { useDropzone as nt } from "react-dropzone";
8
- import { aM as K, am as Q, A as b, aN as st } from "./index-CSOKPmkj.js";
8
+ import { aM as K, am as Q, A as b, aN as st } from "./index-C_34q9jG.js";
9
9
  import { toast as A } from "sonner";
10
10
  import { f as ct, c as ot } from "./image-compression-DsZ1oqpb.js";
11
11
  import { useQueryClient as te, useMutation as ie, useQuery as xe } from "@tanstack/react-query";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),M=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),F=require("lodash-es"),f=require("lucide-react"),u=require("react"),fe=require("react-dropzone"),g=require("./index-D_4YaLhN.cjs"),w=require("sonner"),Y=require("./image-compression-DZ9WMmyn.cjs"),z=require("@tanstack/react-query"),pe=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>{const o=i.map(async l=>x(n,{action:g.ACTIONS.UPLOAD_ASSET,data:l}));return await Promise.all(o)},onSuccess:i=>{var o;if(i!=null&&i.some(s=>s.error))throw new Error(((o=i==null?void 0:i.find(s=>s.error))==null?void 0:o.error)||"Failed to upload asset");{r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]});const s=i==null?void 0:i.length;w.toast.success(`${s===1?"Asset":s+" Assets"} uploaded successfully`)}},onError:()=>{w.toast.error("Failed to upload asset")}})},ge=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>x(n,{action:g.ACTIONS.DELETE_ASSET,data:{id:i}}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]}),w.toast.success("Asset deleted successfully")},onError:()=>{w.toast.error("Failed to delete asset")}})},je=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>x(n,{action:g.ACTIONS.UPDATE_ASSET,data:i}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]}),i!=null&&i.id&&r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSET,i.id]}),w.toast.success("Asset updated successfully")},onError:()=>{w.toast.error("Failed to update asset")}})};function ve({currentPage:n,totalPages:r,onPageChange:x,pageRangeDisplayed:i=3,showPageInput:o=!0,className:s=""}){const[l,E]=u.useState(String(n)),N=u.useMemo(()=>{const c=Math.floor(i/2);let m=Math.max(1,n-c),d=Math.min(r,n+c);d-m+1<i&&(m===1?d=Math.min(r,m+i-1):d===r&&(m=Math.max(1,d-i+1)));const p=[];m>1&&(p.push(1),m>2&&p.push("..."));for(let y=m;y<=d;y++)p.push(y);return d<r&&(d<r-1&&p.push("..."),p.push(r)),p},[n,r,i]),v=c=>{c!==n&&c>=1&&c<=r&&(x(c),E(String(c)))},j=()=>{n>1&&v(n-1)},b=()=>{n<r&&v(n+1)},C=()=>{const c=Number(l);!isNaN(c)&&c>=1&&c<=r&&v(c)},A=c=>{c.key==="Enter"&&C()};return r<=1?null:e.jsxs("div",{className:`flex flex-wrap items-center justify-center gap-3 ${s}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:j,disabled:n===1,className:"px-2 py-1 text-sm hover:bg-gray-50",children:[e.jsx(f.ChevronLeft,{className:" h-4 w-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-2",children:N.map((c,m)=>{if(c==="...")return e.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${m}`);const d=c,p=d===n;return e.jsx(a.Button,{variant:p?"default":"outline",size:"sm",onClick:()=>v(d),className:p?"border-blue-600 bg-blue-600 px-3 py-1 text-sm text-white":"border px-3 py-1 text-sm hover:bg-gray-50 hover:text-black",children:d},d)})}),e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:b,disabled:n===r,className:"px-2 py-1 text-sm hover:bg-gray-50",children:["Next",e.jsx(f.ChevronRight,{className:" h-4 w-4"})]})]}),o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Go to"}),e.jsx(a.Input,{type:"number",min:1,max:r,value:l,onChange:c=>{const m=c.target.value.replace(/[^\d]/g,"");E(m)},onKeyDown:A,className:"h-8 w-16 px-2 py-1"}),e.jsx(a.Button,{variant:"outline",size:"sm",onClick:C,disabled:l===""||Number(l)<1||Number(l)>r,children:"Go"})]})]})}const ye=(n={})=>{const r=g.useAssetsApiUrl(),x=g.useFetch(),{search:i,page:o=1,limit:s=30}=n;return z.useQuery({queryKey:[g.ACTIONS.GET_ASSETS,i,o,s],queryFn:async()=>{const l=await x(r,{action:g.ACTIONS.GET_ASSETS,data:{search:i,page:o,limit:s}});return l.page=o,l.limit=s,l},staleTime:1/0,retry:1})},Ne=n=>{const r=g.useAssetsApiUrl(),x=g.useFetch();return z.useQuery({queryKey:[g.ACTIONS.GET_ASSET,n],queryFn:async()=>n?await x(r,{action:g.ACTIONS.GET_ASSET,data:{id:n}}):null,staleTime:1/0,retry:1})};function be(n){const r=isNaN(n)?0:typeof n=="number"?n:parseInt(n);return r?r<1024?`${r.toFixed(2)} B`:r<1024*1024?`${(r/1024).toFixed(2)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`:"0 B"}function Z(n){if(!n)return"N/A";const r=new Date(n);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}function J(n,r){let x=n,i=r==null?void 0:r.description;return(!i||typeof i!="string")&&(i=""),(!x||typeof x!="string")&&(x=""),x!==i}const we=({assetId:n,onBack:r,onEdit:x,onSave:i,isSaving:o})=>{var c,m;const{t:s}=M.useTranslation(),{data:l,isLoading:E,isError:N}=Ne(n||""),[v,j]=u.useState(""),[b,C]=u.useState(!1);u.useEffect(()=>{const d=new Image;return d.src=(l==null?void 0:l.url)||"",d.onload=()=>C(!0),()=>{d.onload=null}},[l]);const A=async(d,p)=>{try{await navigator.clipboard.writeText(d),w.toast.success(s("{{type}} copied to clipboard",{type:p}))}catch(y){w.toast.error(s("Failed to copy {{type}}",{type:p}),{description:y==null?void 0:y.message})}};return u.useEffect(()=>{l!=null&&l.description&&j(l.description)},[l]),E||!b?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}):N||!(l!=null&&l.id)?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md mx-auto p-6",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(f.AlertCircle,{className:"h-12 w-12 text-gray-400"})}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:s("No Asset Found")}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:s(N?"There was an error loading the asset. Please try again later.":"The asset you're looking for doesn't exist or has been removed.")}),e.jsxs("div",{className:"flex justify-center gap-4",children:[e.jsx(a.Button,{variant:"outline",onClick:r,children:s("Back to Assets")}),N&&e.jsx(a.Button,{variant:"default",onClick:()=>window.location.reload(),children:s("Try Again")})]})]})}):e.jsxs("div",{className:"flex-1 flex flex-col gap-y-4 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:r,disabled:o,children:[e.jsx(f.ChevronLeft,{className:"h-4 w-4"}),s("Back to Assets")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a.Button,{variant:"outline",onClick:r,disabled:o,children:s("Cancel")}),e.jsxs(a.Button,{variant:"outline",onClick:()=>A(l.url,s("Asset URL")),disabled:o,children:[e.jsx(f.Copy,{className:"h-4 w-4 mr-2"}),s("Copy URL")]}),e.jsxs(a.Button,{variant:"default",onClick:()=>x(l),disabled:o,children:[e.jsx(f.Pencil,{className:"h-4 w-4"}),s("Edit Image")]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 items-start gap-6 flex-1 overflow-hidden",children:[e.jsx("div",{className:"relative h-[calc(80vh-200px)] w-full flex items-start justify-center",children:e.jsx("img",{src:l.url,alt:l.name,className:"w-full h-full object-contain rounded-lg max-h-max max-w-max"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-3 border rounded-md pt-2 bg-gray-100",children:[e.jsx(a.Label,{className:"w-full text-center",children:s("Details")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 text-sm border rounded-md p-2 bg-white",children:[{label:s("File Name"),value:l.name},{label:s("Type"),value:l.type,capitalize:!0},{label:s("Format"),value:((c=l.metadata)==null?void 0:c.format)||l.type,capitalize:!0},{label:s("Size"),value:be(l.size)},{label:s("Dimensions"),value:`${l.width||0} × ${l.height||0}`},{label:s("Created"),value:Z(l.createdAt)},{label:s("Updated"),value:Z(((m=l.metadata)==null?void 0:m.updatedAt)||(l==null?void 0:l.updatedAt)||l.createdAt)},{label:s("URL"),value:l.url,copyable:!0}].map(d=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a.Label,{className:"w-max text-left px-2 w-1/4 font-normal text-gray-700",children:d.label}),":",e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900"+(d.capitalize?" capitalize":""),children:d.value}),d.copyable&&e.jsx(a.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>A(d.value,d.label),children:e.jsx(f.Link,{className:"h-3 w-3"})})]})]},d.label))})]}),l.usedOn&&l.usedOn.length>0&&e.jsxs("div",{className:"grid gap-3",children:[e.jsx(a.Label,{children:s("Used On")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 text-sm border rounded-md p-2",children:l.usedOn.map((d,p)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900",children:d.name}),e.jsxs("div",{className:"text-gray-500",children:["(",d.slug,")"]})]},p))})]}),e.jsxs("div",{className:"grid gap-3 border rounded-md pt-2 bg-gray-100 relative",children:[e.jsx(a.Label,{className:"w-full text-center",children:s("Description")}),e.jsx(a.Textarea,{id:"description",value:v,placeholder:s("Enter a description for the asset"),onChange:d=>j(d.target.value),rows:3,disabled:o,className:"hover:border-black/40 bg-white"}),e.jsx("div",{className:"flex justify-end items-start absolute top-1.5 right-2",children:e.jsx("button",{type:"button",onClick:()=>i(v),disabled:o||!J(v,l),className:`py-0 bg-blue-500 text-white px-3 py-0.5 rounded-md text-sm ${o||!J(v,l)?"opacity-50 cursor-not-allowed":""}`,children:o?e.jsxs(e.Fragment,{children:[e.jsx(f.Loader,{className:"h-4 w-4 mr-2 animate-spin"}),s("Saving...")]}):s("Save")})})]})]})]})]})},Ce=u.lazy(()=>Promise.resolve().then(()=>require("./image-editor-EmBN_Nn_.cjs"))),Ae=25*1024*1024,Se=({isUpdatingAsset:n,allowedTypes:r,uploadAssets:x,isUploadingAsset:i,onUploaded:o})=>{const{t:s}=M.useTranslation(),[l,E]=u.useState(()=>{const c=localStorage.getItem("chai_optimize_images");return c!==null?c==="true":!0});u.useEffect(()=>{localStorage.setItem("chai_optimize_images",l.toString())},[l]);const N=n||i,v=u.useCallback(async c=>{try{const m=c;if(!m.every(S=>S.type.startsWith("image/")))return w.toast.error(s("Invalid file type. Please upload a valid file.")),Promise.reject(new Error("Invalid file type"));const d=m.map(async S=>{let U=S;return S.type.startsWith("image/")&&(U=await Y.compressImageIfNeeded(S)),new Promise((_,B)=>{const L=new FileReader;L.readAsDataURL(U),L.onload=async()=>{_({file:L.result,folderId:void 0,name:S.name,optimize:l})},L.onerror=()=>B(null)})}),p=await Promise.all(d),y=await x(p);return(y==null?void 0:y.length)===1&&o(y[0]),y}catch(m){return Promise.reject(m)}},[x,l,o,s]),j=c=>{const m=[];let d=0;return c.forEach(p=>{p.size>Ae?d++:m.push(p)}),d>0&&w.toast.error(`${d===1&&c.length===1?s("File"):d+s(d===1?" file":" files")} ${s("exceed the maximum size limit of 10MB.")}`),F.isEmpty(m)?[]:v(m)},{getRootProps:b,getInputProps:C,isDragActive:A}=fe.useDropzone({onDrop:j,accept:{"image/*":r.includes("image")?[]:[]},disabled:n||i,multiple:!0});return e.jsx("div",{className:`flex h-[60px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-slate-300 p-0 py-2 hover:border-black/50 ${N?"pointer-events-none bg-gray-100 opacity-90":"bg-gray-100 hover:border-black/50 hover:bg-gray-100"}`,children:e.jsxs("div",{...b(),className:M.mergeClasses("flex h-max w-full cursor-pointer flex-col justify-center rounded-lg text-center",N?"items-start":"items-center",A?"border-primary bg-primary/5":"border-muted-foreground/20"),children:[e.jsx("input",{...C()}),N?e.jsx("div",{className:"flex flex-col items-center px-6",children:e.jsxs("div",{className:"flex items-center justify-center gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full bg-indigo-100 p-2",children:e.jsx(f.Loader,{className:"h-4 w-4 animate-spin text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-medium",children:s(n?"Updating file...":"Uploading file...")}),e.jsxs("div",{className:"text-xs font-light text-muted-foreground",children:[s("Please wait while we")," ",s(n?"update":"upload")," ",s("your file...")]})]})]})}):e.jsxs("div",{className:"flex w-full items-center justify-between px-6",children:[e.jsx("div",{className:"flex flex-col items-center",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full border border-indigo-500 bg-indigo-100 p-2",children:e.jsx(f.Upload,{className:"h-4 w-4 text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"font-medium",children:[s("Drop your file here or")," ",e.jsx("span",{className:"cursor-pointer text-indigo-500 hover:underline",children:s("browse")})]}),e.jsx("div",{className:"text-xs font-light text-muted-foreground",children:e.jsxs("span",{className:"",children:[s("Accepted file types:")," ",e.jsx("span",{className:"capitalize text-indigo-400",children:r.join(", ")})]})})]})]})}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs",children:[s("Optimization:")," "," ",e.jsx("span",{className:l?"text-indigo-600":"text-gray-400",children:s(l?"On":"Off")})]}),e.jsx(a.Switch,{checked:l,onCheckedChange:c=>{E(c)},onClick:c=>{c.stopPropagation()},className:"data-[state=checked]:bg-indigo-500"})]}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx("span",{className:`flex cursor-help items-center text-amber-500 ${l?"invisible":""}`,children:e.jsx(f.AlertTriangle,{className:"mr-1 h-4 w-4"})})}),e.jsx(a.TooltipContent,{side:"top",children:e.jsx("p",{className:"text-xs text-white",children:s("Warning: Unoptimized images may affect performance and page load times")})})]})})]})]})]})})};function Te({close:n,onSelect:r,mode:x="image",assetId:i}){const{t:o}=M.useTranslation(),s=!1,l=10,E=u.useMemo(()=>[x],[x]),[N,v]=u.useState(null),[j,b]=u.useState(null),[C,A]=u.useState(null),[c,m]=u.useState({show:!1,file:""}),[d,p]=u.useState(!1),[y,S]=u.useState(i?"details":"grid"),[U,_]=u.useState(""),[B,L]=u.useState(""),[P,Q]=u.useState(1),[R]=u.useState(30),[T,G]=u.useState([]);u.useEffect(()=>{i&&(v(i),S("details"))},[i]),u.useEffect(()=>{const t=setTimeout(()=>{_(B),Q(1)},300);return()=>clearTimeout(t)},[B]);const{data:q,isLoading:$,refetch:ee}=ye({search:U.toLowerCase().trim(),page:P,limit:R}),D=(q==null?void 0:q.assets)||[],te=(q==null?void 0:q.total)||0,I=Math.ceil(te/R);u.useEffect(()=>{$||I<=0||Q(t=>t>I?I:t<1?1:t)},[$,I]);const se=(D==null?void 0:D.length)>0,{mutate:ie}=ge(),{mutateAsync:K,isPending:le}=pe(),{mutateAsync:W,isPending:ae}=je(),V=u.useCallback(t=>{const h=Math.min(Math.max(1,t),Math.max(1,I));h!==P&&Q(h)},[I,P]),re=t=>{L(t.target.value)},ne=u.useCallback(t=>{G(h=>F.find(h,{id:t.id})?[]:[t])},[s]),oe=u.useCallback(()=>{G([])},[]),H=t=>{(t==null?void 0:t.length)!==0&&(r(F.pick(F.first(t||T),["id","url","width","height","description"])),n())},ce=async t=>{b(t)},de=async()=>{j&&(A(j==null?void 0:j.id),await ie(j.id,{onSuccess:()=>{A(null),b(null)},onError:()=>{A(null)}}),b(null))},ue=t=>{v(t.id),S("details")},me=async(t,h)=>{try{const O=localStorage.getItem("chai_optimize_images")!=="false";if(h){const k=await K([{file:t,folderId:void 0,name:c.name||"",optimize:O}]);if((k==null?void 0:k.length)>0){const X=k[0];r({...F.pick(X,["id","width","height","description"]),url:X.url})}}else{const k=await W({id:c.id||"",file:t});k&&r({...F.pick(k,["id","width","height","description"]),url:k.url})}m({show:!1,file:""}),n()}catch(O){console.error(o("Error saving edited image:"),O)}},he=u.useCallback(t=>{G([t])},[]),xe=u.useCallback(t=>{V(t)},[V]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-[80vh] max-h-[1232px] w-[80vw] max-w-[1232px] flex-col space-y-4",children:[e.jsx("h1",{className:"text-lg font-medium",children:o("Digital Asset Manager")}),y==="grid"?e.jsxs(e.Fragment,{children:[e.jsx(Se,{maxFileSize:l,allowedTypes:E,uploadAssets:K,isUpdatingAsset:ae,isUploadingAsset:le,onUploaded:he}),e.jsxs("div",{className:"relative flex flex-1 flex-col gap-y-3 overflow-hidden rounded-lg border p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"relative w-1/2",children:[e.jsx(f.Search,{strokeWidth:3,className:`absolute left-2 top-2.5 h-4 w-4 text-muted-foreground ${B.length>0?"text-indigo-800":""}`}),e.jsx(a.Input,{placeholder:o("Search assets..."),onChange:re,value:B,className:"pl-8"})]}),e.jsxs("div",{className:"flex items-center gap-x-2",children:[T.length>0?e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[T.length>0&&e.jsx(e.Fragment,{children:e.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>oe(),title:o("Clear selection"),children:o("Clear")})}),e.jsx(a.Button,{size:"sm",onClick:()=>H(T),disabled:T.length===0,children:o("Select Asset")})]})}):null,e.jsx(a.Button,{variant:"ghost",size:"icon",onClick:()=>ee(),children:e.jsx(f.RefreshCwIcon,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pb-[66px]",children:$?e.jsxs("div",{className:"columns-1 gap-3 space-y-3 sm:columns-3 md:columns-5",children:[e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"})]}):!$&&!se?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center rounded-lg border",children:[e.jsx("div",{className:"text-muted-foreground",children:e.jsx(f.Archive,{className:"h-9 w-9 text-indigo-500"})}),e.jsx("div",{className:"text-lg text-muted-foreground",children:o("No assets found")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:U.length>0?o("No assets found for your search: {{query}}",{query:U}):o("Start uploading assets to get started")}),e.jsx("br",{})]}):e.jsx("div",{className:"flex flex-wrap gap-3 p-1",children:D==null?void 0:D.map(t=>e.jsxs("div",{className:M.mergeClasses("group relative flex max-h-[180px] max-w-[180px] cursor-pointer flex-col justify-between overflow-hidden rounded-lg border-2 transition-all",T.some(h=>h.id===t.id)?"border-blue-500":"hover:border-black/90",C&&(j==null?void 0:j.id)===t.id?"pointer-events-none opacity-50":"",C===t.id?"pointer-events-none opacity-50":""),onClick:()=>ne(t),onDoubleClick:()=>H([t]),children:[e.jsxs("div",{className:"aspect-square relative overflow-hidden",children:[C===t.id?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin text-white"})}):null,t.type==="image"?e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:`h-full min-h-[80px] w-full object-contain ${T.some(h=>h.id===t.id)?"":"group-hover:blur group-hover:contrast-50"}`}):e.jsxs("div",{className:"flex h-full items-center justify-center",children:[e.jsx(f.Film,{className:"h-12 w-12 text-muted-foreground"}),t.thumbnailUrl&&e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:"absolute inset-0 h-full w-full object-cover"})]})]}),e.jsxs("div",{className:"flex items-end justify-between border-t-[1px] border-black/10 bg-white px-2 py-1",children:[e.jsx("div",{className:"truncate text-xs leading-tight",title:t.name,children:t.name}),e.jsx("div",{className:"flex items-center justify-between whitespace-nowrap text-[9px] font-light text-muted-foreground",children:e.jsx("span",{children:Y.formatFileSize((t==null?void 0:t.size)||0)})})]}),!T.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:e.jsxs("div",{className:"grid grid-cols-4 gap-2 p-2",children:[e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),ue(t)},children:e.jsx(f.ImageIcon,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("View Details")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),navigator.clipboard.writeText(t.url),w.toast.success(o("Asset URL copied to clipboard"))},children:e.jsx(f.Copy,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Copy URL")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),m({id:t.id,show:!0,file:t.url,name:t.name})},children:e.jsx(f.Edit,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Edit Image")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"destructive",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),ce(t)},children:e.jsx(f.Trash2,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Delete Asset")})})]})})]})}),T.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute right-1 top-1 h-max rounded-full border border-white bg-blue-500 p-1",children:e.jsx(f.Check,{className:"h-3 w-3 text-white",strokeWidth:5})})]},t.id))})}),I>1&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t bg-white p-4",children:e.jsx(g.ErrorBoundary,{fallback:e.jsx("div",{className:"text-red-500",children:o("Error loading pagination")}),children:e.jsx(ve,{currentPage:P,totalPages:I,onPageChange:xe,pageRangeDisplayed:3,showPageInput:!0})})})]})]}):e.jsx(we,{assetId:N||i||"",onBack:()=>{S("grid"),v(null)},onEdit:t=>{m({id:t.id,show:!0,file:t.url,name:t.name})},onSave:async t=>{if(N){p(!0);try{const h=D.find(O=>O.id===N);h&&await W(F.merge(h,{description:t}))}finally{p(!1)}}},isSaving:d})]}),c.show&&e.jsx(u.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}),children:e.jsx(Ce,{imageUrl:c.file,onSave:me,onClose:()=>m({show:!1,file:""}),defaultSavedImageName:c.name,isEditing:!!c.id})}),j&&e.jsx(a.Dialog,{open:!!j,onOpenChange:()=>b(null),children:e.jsxs(a.DialogContent,{children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:o("Delete Asset")}),e.jsx(a.DialogDescription,{children:o('Are you sure you want to delete "{{name}}"? This action cannot be undone.',{name:j.name})})]}),e.jsxs(a.DialogFooter,{className:"gap-2 sm:gap-0",children:[e.jsx(a.Button,{variant:"outline",onClick:()=>b(null),children:o("Cancel")}),e.jsx(a.Button,{variant:"destructive",onClick:de,children:o("Delete")})]})]})})]})}exports.default=Te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),M=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),F=require("lodash-es"),f=require("lucide-react"),u=require("react"),fe=require("react-dropzone"),g=require("./index-C1bimRWu.cjs"),w=require("sonner"),Y=require("./image-compression-DZ9WMmyn.cjs"),z=require("@tanstack/react-query"),pe=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>{const o=i.map(async l=>x(n,{action:g.ACTIONS.UPLOAD_ASSET,data:l}));return await Promise.all(o)},onSuccess:i=>{var o;if(i!=null&&i.some(s=>s.error))throw new Error(((o=i==null?void 0:i.find(s=>s.error))==null?void 0:o.error)||"Failed to upload asset");{r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]});const s=i==null?void 0:i.length;w.toast.success(`${s===1?"Asset":s+" Assets"} uploaded successfully`)}},onError:()=>{w.toast.error("Failed to upload asset")}})},ge=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>x(n,{action:g.ACTIONS.DELETE_ASSET,data:{id:i}}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]}),w.toast.success("Asset deleted successfully")},onError:()=>{w.toast.error("Failed to delete asset")}})},je=()=>{const n=g.useAssetsApiUrl(),r=z.useQueryClient(),x=g.useFetch();return z.useMutation({mutationFn:async i=>x(n,{action:g.ACTIONS.UPDATE_ASSET,data:i}),onSuccess:i=>{if(i!=null&&i.error)throw new Error(i==null?void 0:i.error);r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSETS]}),i!=null&&i.id&&r.invalidateQueries({queryKey:[g.ACTIONS.GET_ASSET,i.id]}),w.toast.success("Asset updated successfully")},onError:()=>{w.toast.error("Failed to update asset")}})};function ve({currentPage:n,totalPages:r,onPageChange:x,pageRangeDisplayed:i=3,showPageInput:o=!0,className:s=""}){const[l,E]=u.useState(String(n)),N=u.useMemo(()=>{const c=Math.floor(i/2);let m=Math.max(1,n-c),d=Math.min(r,n+c);d-m+1<i&&(m===1?d=Math.min(r,m+i-1):d===r&&(m=Math.max(1,d-i+1)));const p=[];m>1&&(p.push(1),m>2&&p.push("..."));for(let y=m;y<=d;y++)p.push(y);return d<r&&(d<r-1&&p.push("..."),p.push(r)),p},[n,r,i]),v=c=>{c!==n&&c>=1&&c<=r&&(x(c),E(String(c)))},j=()=>{n>1&&v(n-1)},b=()=>{n<r&&v(n+1)},C=()=>{const c=Number(l);!isNaN(c)&&c>=1&&c<=r&&v(c)},A=c=>{c.key==="Enter"&&C()};return r<=1?null:e.jsxs("div",{className:`flex flex-wrap items-center justify-center gap-3 ${s}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:j,disabled:n===1,className:"px-2 py-1 text-sm hover:bg-gray-50",children:[e.jsx(f.ChevronLeft,{className:" h-4 w-4"}),"Previous"]}),e.jsx("div",{className:"flex items-center gap-2",children:N.map((c,m)=>{if(c==="...")return e.jsx("span",{className:"px-2 text-muted-foreground",children:"..."},`ellipsis-${m}`);const d=c,p=d===n;return e.jsx(a.Button,{variant:p?"default":"outline",size:"sm",onClick:()=>v(d),className:p?"border-blue-600 bg-blue-600 px-3 py-1 text-sm text-white":"border px-3 py-1 text-sm hover:bg-gray-50 hover:text-black",children:d},d)})}),e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:b,disabled:n===r,className:"px-2 py-1 text-sm hover:bg-gray-50",children:["Next",e.jsx(f.ChevronRight,{className:" h-4 w-4"})]})]}),o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Go to"}),e.jsx(a.Input,{type:"number",min:1,max:r,value:l,onChange:c=>{const m=c.target.value.replace(/[^\d]/g,"");E(m)},onKeyDown:A,className:"h-8 w-16 px-2 py-1"}),e.jsx(a.Button,{variant:"outline",size:"sm",onClick:C,disabled:l===""||Number(l)<1||Number(l)>r,children:"Go"})]})]})}const ye=(n={})=>{const r=g.useAssetsApiUrl(),x=g.useFetch(),{search:i,page:o=1,limit:s=30}=n;return z.useQuery({queryKey:[g.ACTIONS.GET_ASSETS,i,o,s],queryFn:async()=>{const l=await x(r,{action:g.ACTIONS.GET_ASSETS,data:{search:i,page:o,limit:s}});return l.page=o,l.limit=s,l},staleTime:1/0,retry:1})},Ne=n=>{const r=g.useAssetsApiUrl(),x=g.useFetch();return z.useQuery({queryKey:[g.ACTIONS.GET_ASSET,n],queryFn:async()=>n?await x(r,{action:g.ACTIONS.GET_ASSET,data:{id:n}}):null,staleTime:1/0,retry:1})};function be(n){const r=isNaN(n)?0:typeof n=="number"?n:parseInt(n);return r?r<1024?`${r.toFixed(2)} B`:r<1024*1024?`${(r/1024).toFixed(2)} KB`:`${(r/(1024*1024)).toFixed(2)} MB`:"0 B"}function Z(n){if(!n)return"N/A";const r=new Date(n);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r)}function J(n,r){let x=n,i=r==null?void 0:r.description;return(!i||typeof i!="string")&&(i=""),(!x||typeof x!="string")&&(x=""),x!==i}const we=({assetId:n,onBack:r,onEdit:x,onSave:i,isSaving:o})=>{var c,m;const{t:s}=M.useTranslation(),{data:l,isLoading:E,isError:N}=Ne(n||""),[v,j]=u.useState(""),[b,C]=u.useState(!1);u.useEffect(()=>{const d=new Image;return d.src=(l==null?void 0:l.url)||"",d.onload=()=>C(!0),()=>{d.onload=null}},[l]);const A=async(d,p)=>{try{await navigator.clipboard.writeText(d),w.toast.success(s("{{type}} copied to clipboard",{type:p}))}catch(y){w.toast.error(s("Failed to copy {{type}}",{type:p}),{description:y==null?void 0:y.message})}};return u.useEffect(()=>{l!=null&&l.description&&j(l.description)},[l]),E||!b?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}):N||!(l!=null&&l.id)?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center max-w-md mx-auto p-6",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(f.AlertCircle,{className:"h-12 w-12 text-gray-400"})}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:s("No Asset Found")}),e.jsx("p",{className:"text-sm text-gray-500 mb-6",children:s(N?"There was an error loading the asset. Please try again later.":"The asset you're looking for doesn't exist or has been removed.")}),e.jsxs("div",{className:"flex justify-center gap-4",children:[e.jsx(a.Button,{variant:"outline",onClick:r,children:s("Back to Assets")}),N&&e.jsx(a.Button,{variant:"default",onClick:()=>window.location.reload(),children:s("Try Again")})]})]})}):e.jsxs("div",{className:"flex-1 flex flex-col gap-y-4 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(a.Button,{variant:"outline",size:"sm",onClick:r,disabled:o,children:[e.jsx(f.ChevronLeft,{className:"h-4 w-4"}),s("Back to Assets")]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(a.Button,{variant:"outline",onClick:r,disabled:o,children:s("Cancel")}),e.jsxs(a.Button,{variant:"outline",onClick:()=>A(l.url,s("Asset URL")),disabled:o,children:[e.jsx(f.Copy,{className:"h-4 w-4 mr-2"}),s("Copy URL")]}),e.jsxs(a.Button,{variant:"default",onClick:()=>x(l),disabled:o,children:[e.jsx(f.Pencil,{className:"h-4 w-4"}),s("Edit Image")]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 items-start gap-6 flex-1 overflow-hidden",children:[e.jsx("div",{className:"relative h-[calc(80vh-200px)] w-full flex items-start justify-center",children:e.jsx("img",{src:l.url,alt:l.name,className:"w-full h-full object-contain rounded-lg max-h-max max-w-max"})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-3 border rounded-md pt-2 bg-gray-100",children:[e.jsx(a.Label,{className:"w-full text-center",children:s("Details")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 text-sm border rounded-md p-2 bg-white",children:[{label:s("File Name"),value:l.name},{label:s("Type"),value:l.type,capitalize:!0},{label:s("Format"),value:((c=l.metadata)==null?void 0:c.format)||l.type,capitalize:!0},{label:s("Size"),value:be(l.size)},{label:s("Dimensions"),value:`${l.width||0} × ${l.height||0}`},{label:s("Created"),value:Z(l.createdAt)},{label:s("Updated"),value:Z(((m=l.metadata)==null?void 0:m.updatedAt)||(l==null?void 0:l.updatedAt)||l.createdAt)},{label:s("URL"),value:l.url,copyable:!0}].map(d=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a.Label,{className:"w-max text-left px-2 w-1/4 font-normal text-gray-700",children:d.label}),":",e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900"+(d.capitalize?" capitalize":""),children:d.value}),d.copyable&&e.jsx(a.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>A(d.value,d.label),children:e.jsx(f.Link,{className:"h-3 w-3"})})]})]},d.label))})]}),l.usedOn&&l.usedOn.length>0&&e.jsxs("div",{className:"grid gap-3",children:[e.jsx(a.Label,{children:s("Used On")}),e.jsx("div",{className:"grid grid-cols-1 gap-2 text-sm border rounded-md p-2",children:l.usedOn.map((d,p)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-max text-left font-medium text-gray-900",children:d.name}),e.jsxs("div",{className:"text-gray-500",children:["(",d.slug,")"]})]},p))})]}),e.jsxs("div",{className:"grid gap-3 border rounded-md pt-2 bg-gray-100 relative",children:[e.jsx(a.Label,{className:"w-full text-center",children:s("Description")}),e.jsx(a.Textarea,{id:"description",value:v,placeholder:s("Enter a description for the asset"),onChange:d=>j(d.target.value),rows:3,disabled:o,className:"hover:border-black/40 bg-white"}),e.jsx("div",{className:"flex justify-end items-start absolute top-1.5 right-2",children:e.jsx("button",{type:"button",onClick:()=>i(v),disabled:o||!J(v,l),className:`py-0 bg-blue-500 text-white px-3 py-0.5 rounded-md text-sm ${o||!J(v,l)?"opacity-50 cursor-not-allowed":""}`,children:o?e.jsxs(e.Fragment,{children:[e.jsx(f.Loader,{className:"h-4 w-4 mr-2 animate-spin"}),s("Saving...")]}):s("Save")})})]})]})]})]})},Ce=u.lazy(()=>Promise.resolve().then(()=>require("./image-editor-EmBN_Nn_.cjs"))),Ae=25*1024*1024,Se=({isUpdatingAsset:n,allowedTypes:r,uploadAssets:x,isUploadingAsset:i,onUploaded:o})=>{const{t:s}=M.useTranslation(),[l,E]=u.useState(()=>{const c=localStorage.getItem("chai_optimize_images");return c!==null?c==="true":!0});u.useEffect(()=>{localStorage.setItem("chai_optimize_images",l.toString())},[l]);const N=n||i,v=u.useCallback(async c=>{try{const m=c;if(!m.every(S=>S.type.startsWith("image/")))return w.toast.error(s("Invalid file type. Please upload a valid file.")),Promise.reject(new Error("Invalid file type"));const d=m.map(async S=>{let U=S;return S.type.startsWith("image/")&&(U=await Y.compressImageIfNeeded(S)),new Promise((_,B)=>{const L=new FileReader;L.readAsDataURL(U),L.onload=async()=>{_({file:L.result,folderId:void 0,name:S.name,optimize:l})},L.onerror=()=>B(null)})}),p=await Promise.all(d),y=await x(p);return(y==null?void 0:y.length)===1&&o(y[0]),y}catch(m){return Promise.reject(m)}},[x,l,o,s]),j=c=>{const m=[];let d=0;return c.forEach(p=>{p.size>Ae?d++:m.push(p)}),d>0&&w.toast.error(`${d===1&&c.length===1?s("File"):d+s(d===1?" file":" files")} ${s("exceed the maximum size limit of 10MB.")}`),F.isEmpty(m)?[]:v(m)},{getRootProps:b,getInputProps:C,isDragActive:A}=fe.useDropzone({onDrop:j,accept:{"image/*":r.includes("image")?[]:[]},disabled:n||i,multiple:!0});return e.jsx("div",{className:`flex h-[60px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed border-slate-300 p-0 py-2 hover:border-black/50 ${N?"pointer-events-none bg-gray-100 opacity-90":"bg-gray-100 hover:border-black/50 hover:bg-gray-100"}`,children:e.jsxs("div",{...b(),className:M.mergeClasses("flex h-max w-full cursor-pointer flex-col justify-center rounded-lg text-center",N?"items-start":"items-center",A?"border-primary bg-primary/5":"border-muted-foreground/20"),children:[e.jsx("input",{...C()}),N?e.jsx("div",{className:"flex flex-col items-center px-6",children:e.jsxs("div",{className:"flex items-center justify-center gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full bg-indigo-100 p-2",children:e.jsx(f.Loader,{className:"h-4 w-4 animate-spin text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-medium",children:s(n?"Updating file...":"Uploading file...")}),e.jsxs("div",{className:"text-xs font-light text-muted-foreground",children:[s("Please wait while we")," ",s(n?"update":"upload")," ",s("your file...")]})]})]})}):e.jsxs("div",{className:"flex w-full items-center justify-between px-6",children:[e.jsx("div",{className:"flex flex-col items-center",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 leading-tight",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full border border-indigo-500 bg-indigo-100 p-2",children:e.jsx(f.Upload,{className:"h-4 w-4 text-indigo-500"})}),e.jsxs("div",{className:"text-left",children:[e.jsxs("div",{className:"font-medium",children:[s("Drop your file here or")," ",e.jsx("span",{className:"cursor-pointer text-indigo-500 hover:underline",children:s("browse")})]}),e.jsx("div",{className:"text-xs font-light text-muted-foreground",children:e.jsxs("span",{className:"",children:[s("Accepted file types:")," ",e.jsx("span",{className:"capitalize text-indigo-400",children:r.join(", ")})]})})]})]})}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs",children:[s("Optimization:")," "," ",e.jsx("span",{className:l?"text-indigo-600":"text-gray-400",children:s(l?"On":"Off")})]}),e.jsx(a.Switch,{checked:l,onCheckedChange:c=>{E(c)},onClick:c=>{c.stopPropagation()},className:"data-[state=checked]:bg-indigo-500"})]}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx("span",{className:`flex cursor-help items-center text-amber-500 ${l?"invisible":""}`,children:e.jsx(f.AlertTriangle,{className:"mr-1 h-4 w-4"})})}),e.jsx(a.TooltipContent,{side:"top",children:e.jsx("p",{className:"text-xs text-white",children:s("Warning: Unoptimized images may affect performance and page load times")})})]})})]})]})]})})};function Te({close:n,onSelect:r,mode:x="image",assetId:i}){const{t:o}=M.useTranslation(),s=!1,l=10,E=u.useMemo(()=>[x],[x]),[N,v]=u.useState(null),[j,b]=u.useState(null),[C,A]=u.useState(null),[c,m]=u.useState({show:!1,file:""}),[d,p]=u.useState(!1),[y,S]=u.useState(i?"details":"grid"),[U,_]=u.useState(""),[B,L]=u.useState(""),[P,Q]=u.useState(1),[R]=u.useState(30),[T,G]=u.useState([]);u.useEffect(()=>{i&&(v(i),S("details"))},[i]),u.useEffect(()=>{const t=setTimeout(()=>{_(B),Q(1)},300);return()=>clearTimeout(t)},[B]);const{data:q,isLoading:$,refetch:ee}=ye({search:U.toLowerCase().trim(),page:P,limit:R}),D=(q==null?void 0:q.assets)||[],te=(q==null?void 0:q.total)||0,I=Math.ceil(te/R);u.useEffect(()=>{$||I<=0||Q(t=>t>I?I:t<1?1:t)},[$,I]);const se=(D==null?void 0:D.length)>0,{mutate:ie}=ge(),{mutateAsync:K,isPending:le}=pe(),{mutateAsync:W,isPending:ae}=je(),V=u.useCallback(t=>{const h=Math.min(Math.max(1,t),Math.max(1,I));h!==P&&Q(h)},[I,P]),re=t=>{L(t.target.value)},ne=u.useCallback(t=>{G(h=>F.find(h,{id:t.id})?[]:[t])},[s]),oe=u.useCallback(()=>{G([])},[]),H=t=>{(t==null?void 0:t.length)!==0&&(r(F.pick(F.first(t||T),["id","url","width","height","description"])),n())},ce=async t=>{b(t)},de=async()=>{j&&(A(j==null?void 0:j.id),await ie(j.id,{onSuccess:()=>{A(null),b(null)},onError:()=>{A(null)}}),b(null))},ue=t=>{v(t.id),S("details")},me=async(t,h)=>{try{const O=localStorage.getItem("chai_optimize_images")!=="false";if(h){const k=await K([{file:t,folderId:void 0,name:c.name||"",optimize:O}]);if((k==null?void 0:k.length)>0){const X=k[0];r({...F.pick(X,["id","width","height","description"]),url:X.url})}}else{const k=await W({id:c.id||"",file:t});k&&r({...F.pick(k,["id","width","height","description"]),url:k.url})}m({show:!1,file:""}),n()}catch(O){console.error(o("Error saving edited image:"),O)}},he=u.useCallback(t=>{G([t])},[]),xe=u.useCallback(t=>{V(t)},[V]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-[80vh] max-h-[1232px] w-[80vw] max-w-[1232px] flex-col space-y-4",children:[e.jsx("h1",{className:"text-lg font-medium",children:o("Digital Asset Manager")}),y==="grid"?e.jsxs(e.Fragment,{children:[e.jsx(Se,{maxFileSize:l,allowedTypes:E,uploadAssets:K,isUpdatingAsset:ae,isUploadingAsset:le,onUploaded:he}),e.jsxs("div",{className:"relative flex flex-1 flex-col gap-y-3 overflow-hidden rounded-lg border p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"relative w-1/2",children:[e.jsx(f.Search,{strokeWidth:3,className:`absolute left-2 top-2.5 h-4 w-4 text-muted-foreground ${B.length>0?"text-indigo-800":""}`}),e.jsx(a.Input,{placeholder:o("Search assets..."),onChange:re,value:B,className:"pl-8"})]}),e.jsxs("div",{className:"flex items-center gap-x-2",children:[T.length>0?e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[T.length>0&&e.jsx(e.Fragment,{children:e.jsx(a.Button,{variant:"outline",size:"sm",onClick:()=>oe(),title:o("Clear selection"),children:o("Clear")})}),e.jsx(a.Button,{size:"sm",onClick:()=>H(T),disabled:T.length===0,children:o("Select Asset")})]})}):null,e.jsx(a.Button,{variant:"ghost",size:"icon",onClick:()=>ee(),children:e.jsx(f.RefreshCwIcon,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto pb-[66px]",children:$?e.jsxs("div",{className:"columns-1 gap-3 space-y-3 sm:columns-3 md:columns-5",children:[e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-64 w-full animate-pulse rounded bg-gray-200"})]}):!$&&!se?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center rounded-lg border",children:[e.jsx("div",{className:"text-muted-foreground",children:e.jsx(f.Archive,{className:"h-9 w-9 text-indigo-500"})}),e.jsx("div",{className:"text-lg text-muted-foreground",children:o("No assets found")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:U.length>0?o("No assets found for your search: {{query}}",{query:U}):o("Start uploading assets to get started")}),e.jsx("br",{})]}):e.jsx("div",{className:"flex flex-wrap gap-3 p-1",children:D==null?void 0:D.map(t=>e.jsxs("div",{className:M.mergeClasses("group relative flex max-h-[180px] max-w-[180px] cursor-pointer flex-col justify-between overflow-hidden rounded-lg border-2 transition-all",T.some(h=>h.id===t.id)?"border-blue-500":"hover:border-black/90",C&&(j==null?void 0:j.id)===t.id?"pointer-events-none opacity-50":"",C===t.id?"pointer-events-none opacity-50":""),onClick:()=>ne(t),onDoubleClick:()=>H([t]),children:[e.jsxs("div",{className:"aspect-square relative overflow-hidden",children:[C===t.id?e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin text-white"})}):null,t.type==="image"?e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:`h-full min-h-[80px] w-full object-contain ${T.some(h=>h.id===t.id)?"":"group-hover:blur group-hover:contrast-50"}`}):e.jsxs("div",{className:"flex h-full items-center justify-center",children:[e.jsx(f.Film,{className:"h-12 w-12 text-muted-foreground"}),t.thumbnailUrl&&e.jsx("img",{src:`${t.thumbnailUrl||"/placeholder.svg"}?v=${(t==null?void 0:t.updatedAt)||t.createdAt}`,alt:t.name,className:"absolute inset-0 h-full w-full object-cover"})]})]}),e.jsxs("div",{className:"flex items-end justify-between border-t-[1px] border-black/10 bg-white px-2 py-1",children:[e.jsx("div",{className:"truncate text-xs leading-tight",title:t.name,children:t.name}),e.jsx("div",{className:"flex items-center justify-between whitespace-nowrap text-[9px] font-light text-muted-foreground",children:e.jsx("span",{children:Y.formatFileSize((t==null?void 0:t.size)||0)})})]}),!T.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",children:e.jsxs("div",{className:"grid grid-cols-4 gap-2 p-2",children:[e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),ue(t)},children:e.jsx(f.ImageIcon,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("View Details")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),navigator.clipboard.writeText(t.url),w.toast.success(o("Asset URL copied to clipboard"))},children:e.jsx(f.Copy,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Copy URL")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"secondary",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),m({id:t.id,show:!0,file:t.url,name:t.name})},children:e.jsx(f.Edit,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Edit Image")})})]})}),e.jsx(a.TooltipProvider,{children:e.jsxs(a.Tooltip,{children:[e.jsx(a.TooltipTrigger,{asChild:!0,children:e.jsx(a.Button,{variant:"destructive",size:"icon",className:"h-8 w-8 rounded-full",onClick:h=>{h.stopPropagation(),ce(t)},children:e.jsx(f.Trash2,{className:"h-4 w-4"})})}),e.jsx(a.TooltipContent,{children:e.jsx("p",{children:o("Delete Asset")})})]})})]})}),T.some(h=>h.id===t.id)&&e.jsx("div",{className:"absolute right-1 top-1 h-max rounded-full border border-white bg-blue-500 p-1",children:e.jsx(f.Check,{className:"h-3 w-3 text-white",strokeWidth:5})})]},t.id))})}),I>1&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t bg-white p-4",children:e.jsx(g.ErrorBoundary,{fallback:e.jsx("div",{className:"text-red-500",children:o("Error loading pagination")}),children:e.jsx(ve,{currentPage:P,totalPages:I,onPageChange:xe,pageRangeDisplayed:3,showPageInput:!0})})})]})]}):e.jsx(we,{assetId:N||i||"",onBack:()=>{S("grid"),v(null)},onEdit:t=>{m({id:t.id,show:!0,file:t.url,name:t.name})},onSave:async t=>{if(N){p(!0);try{const h=D.find(O=>O.id===N);h&&await W(F.merge(h,{description:t}))}finally{p(!1)}}},isSaving:d})]}),c.show&&e.jsx(u.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx(f.Loader,{className:"h-8 w-8 animate-spin"})}),children:e.jsx(Ce,{imageUrl:c.file,onSave:me,onClose:()=>m({show:!1,file:""}),defaultSavedImageName:c.name,isEditing:!!c.id})}),j&&e.jsx(a.Dialog,{open:!!j,onOpenChange:()=>b(null),children:e.jsxs(a.DialogContent,{children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:o("Delete Asset")}),e.jsx(a.DialogDescription,{children:o('Are you sure you want to delete "{{name}}"? This action cannot be undone.',{name:j.name})})]}),e.jsxs(a.DialogFooter,{className:"gap-2 sm:gap-0",children:[e.jsx(a.Button,{variant:"outline",onClick:()=>b(null),children:o("Cancel")}),e.jsx(a.Button,{variant:"destructive",onClick:de,children:o("Delete")})]})]})})]})}exports.default=Te;
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import { al as C, am as A, A as T, an as w } from "./index-CSOKPmkj.js";
2
+ import { al as C, am as A, A as T, an as w } from "./index-C_34q9jG.js";
3
3
  import { useQueryClient as F, useMutation as _ } from "@tanstack/react-query";
4
4
  import { toast as v } from "sonner";
5
5
  import { useTranslation as q } from "@chaibuilder/sdk";
@@ -7,7 +7,7 @@ import { Dialog as G, DialogContent as L, DialogHeader as U, DialogTitle as j, D
7
7
  import { isEmpty as M, initial as Q } from "lodash-es";
8
8
  import { AlertCircle as V } from "lucide-react";
9
9
  import { useState as p } from "react";
10
- import { S as k } from "./slug-input-DPMG1pMZ.js";
10
+ import { S as k } from "./slug-input-CjagPxIn.js";
11
11
  const H = () => {
12
12
  const s = C(), o = F(), g = A();
13
13
  return _({
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./index-D_4YaLhN.cjs"),N=require("@tanstack/react-query"),v=require("sonner"),E=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),P=require("lodash-es"),C=require("lucide-react"),g=require("react"),A=require("./slug-input-CPHwulQv.cjs"),T=()=>{const t=p.useApiUrl(),u=N.useQueryClient(),h=p.useFetch();return N.useMutation({mutationFn:async({pageId:s,name:x,slug:r})=>{const o={pageId:s,name:x};return r&&(o.slug=r),await h(t,{action:"DUPLICATE_PAGE",data:o})},onSuccess:()=>{u.invalidateQueries({queryKey:[p.ACTIONS.GET_WEBSITE_PAGES]}),v.toast.success("Page duplicated successfully")},onError:s=>{v.toast.error("Failed to duplicate page",{description:s.message||"An error occurred while duplicating the page"})}})},w=({page:t,onClose:u,closePanel:h=()=>{}})=>{const{t:s}=E.useTranslation(),{mutate:x,isPending:r}=T(),[o,i]=g.useState(null),[d,D]=g.useState(`${t.name} (Copy)`),b=p.useChangePage(),n=P.isEmpty(t.slug),[m,I]=g.useState(n?"":`${t.slug.split("/").pop()}-copy`),f=n?"":P.initial(t.slug.split("/")).join("/"),[y,j]=g.useState(!1),q=l=>{if(l.preventDefault(),!d.trim()){i(s("Name is required"));return}if(!n&&!m.trim()){i(s("Slug is required"));return}i(null),j(!0);const S={pageId:t.id,name:d};n||(S.slug=`${f}/${m}`),x(S,{onSuccess:c=>{j(!1),u(),b(c.id,h)},onError:c=>{j(!1),c.code==="SLUG_EXISTS"?i(s("A page with this slug already exists. Please choose a different slug.")):c.code==="INVALID_SLUG"?i(s("The slug format is invalid. Please use only lowercase letters, numbers, and hyphens.")):c.code==="PERMISSION_DENIED"?i(s("You don't have permission to duplicate this page.")):i(c.message||s("Failed to duplicate page. Please try again later."))}})};return e.jsx(a.Dialog,{open:!!t,onOpenChange:u,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:s("Duplicate Page")}),e.jsx(a.DialogDescription,{children:s("Create a copy of the page with a new name and slug")})]}),e.jsxs("div",{className:"mb-4 rounded-md bg-gray-50 p-3",children:[e.jsxs("h3",{className:"mb-1 text-sm font-medium",children:[s("Duplicating:"),":"]}),e.jsxs("div",{className:"flex flex-col gap-1 text-sm text-gray-700",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Name"),":"]})," ",t.name]}),!n&&e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Slug"),":"]})," ",t.slug]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Type"),":"]})," ",t.pageType]})]})]}),e.jsxs("form",{onSubmit:q,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"name",className:"text-sm",children:s("Name")}),e.jsx(a.Input,{id:"name",value:d,onChange:l=>D(l.target.value),required:!0})]}),!n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"slug",className:"text-sm",children:s("Slug")}),e.jsx(A.SlugInput,{value:m,onChange:l=>I(l),parentSlug:f,onValidationChange:l=>{i(l?null:s("Invalid slug"))}})]}),o&&e.jsxs(a.Alert,{variant:"destructive",className:"py-2",children:[e.jsx(C.AlertCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:o})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(a.Button,{type:"button",variant:"outline",onClick:u,disabled:r,children:s("Cancel")}),e.jsx(a.Button,{type:"submit",disabled:!d.trim()||!n&&!m.trim()||r||y,children:s(r||y?"Duplicating...":"Duplicate")})]})]})]})})};exports.default=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("./index-C1bimRWu.cjs"),N=require("@tanstack/react-query"),v=require("sonner"),E=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),P=require("lodash-es"),C=require("lucide-react"),g=require("react"),A=require("./slug-input-CsniBgYf.cjs"),T=()=>{const t=p.useApiUrl(),u=N.useQueryClient(),h=p.useFetch();return N.useMutation({mutationFn:async({pageId:s,name:x,slug:r})=>{const o={pageId:s,name:x};return r&&(o.slug=r),await h(t,{action:"DUPLICATE_PAGE",data:o})},onSuccess:()=>{u.invalidateQueries({queryKey:[p.ACTIONS.GET_WEBSITE_PAGES]}),v.toast.success("Page duplicated successfully")},onError:s=>{v.toast.error("Failed to duplicate page",{description:s.message||"An error occurred while duplicating the page"})}})},w=({page:t,onClose:u,closePanel:h=()=>{}})=>{const{t:s}=E.useTranslation(),{mutate:x,isPending:r}=T(),[o,i]=g.useState(null),[d,D]=g.useState(`${t.name} (Copy)`),b=p.useChangePage(),n=P.isEmpty(t.slug),[m,I]=g.useState(n?"":`${t.slug.split("/").pop()}-copy`),f=n?"":P.initial(t.slug.split("/")).join("/"),[y,j]=g.useState(!1),q=l=>{if(l.preventDefault(),!d.trim()){i(s("Name is required"));return}if(!n&&!m.trim()){i(s("Slug is required"));return}i(null),j(!0);const S={pageId:t.id,name:d};n||(S.slug=`${f}/${m}`),x(S,{onSuccess:c=>{j(!1),u(),b(c.id,h)},onError:c=>{j(!1),c.code==="SLUG_EXISTS"?i(s("A page with this slug already exists. Please choose a different slug.")):c.code==="INVALID_SLUG"?i(s("The slug format is invalid. Please use only lowercase letters, numbers, and hyphens.")):c.code==="PERMISSION_DENIED"?i(s("You don't have permission to duplicate this page.")):i(c.message||s("Failed to duplicate page. Please try again later."))}})};return e.jsx(a.Dialog,{open:!!t,onOpenChange:u,children:e.jsxs(a.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(a.DialogHeader,{children:[e.jsx(a.DialogTitle,{children:s("Duplicate Page")}),e.jsx(a.DialogDescription,{children:s("Create a copy of the page with a new name and slug")})]}),e.jsxs("div",{className:"mb-4 rounded-md bg-gray-50 p-3",children:[e.jsxs("h3",{className:"mb-1 text-sm font-medium",children:[s("Duplicating:"),":"]}),e.jsxs("div",{className:"flex flex-col gap-1 text-sm text-gray-700",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Name"),":"]})," ",t.name]}),!n&&e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Slug"),":"]})," ",t.slug]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[s("Type"),":"]})," ",t.pageType]})]})]}),e.jsxs("form",{onSubmit:q,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"name",className:"text-sm",children:s("Name")}),e.jsx(a.Input,{id:"name",value:d,onChange:l=>D(l.target.value),required:!0})]}),!n&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(a.Label,{htmlFor:"slug",className:"text-sm",children:s("Slug")}),e.jsx(A.SlugInput,{value:m,onChange:l=>I(l),parentSlug:f,onValidationChange:l=>{i(l?null:s("Invalid slug"))}})]}),o&&e.jsxs(a.Alert,{variant:"destructive",className:"py-2",children:[e.jsx(C.AlertCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:o})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(a.Button,{type:"button",variant:"outline",onClick:u,disabled:r,children:s("Cancel")}),e.jsx(a.Button,{type:"submit",disabled:!d.trim()||!n&&!m.trim()||r||y,children:s(r||y?"Duplicating...":"Duplicate")})]})]})]})})};exports.default=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),h=require("lodash-es"),p=require("lucide-react"),d=require("react"),g=require("./index-D_4YaLhN.cjs"),f=({isDefaultLang:r,searchQuery:l,setSearchQuery:c})=>e.jsx(a.Input,{type:"text",autoFocus:!0,value:r?l:"",onChange:s=>c(s.target.value),placeholder:r?"Search pages...":"To search select default language",disabled:!r,onKeyDown:s=>s.stopPropagation()}),m=({dynamicPage:r,setDynamicPage:l,searchQuery:c,setSearchQuery:s,dynamicPages:n})=>{const{selectedLang:o,fallbackLang:i}=x.useLanguages(),u=(o==null?void 0:o.length)===0;return e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"ghost",className:"w-max focus:outline-none focus:ring-0 border-[0px] rounded-md py-1 text-sm h-max border border-gray-200 hover:bg-gray-100 pl-4",children:[r?h.get(r,"name"):"Select Page",e.jsx(p.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-96 divide-y shadow-xl p-0 max-h-[75vh]",children:[e.jsx("div",{className:"p-1.5 bg-gray-50/30",children:e.jsx(f,{isDefaultLang:u,searchQuery:c,setSearchQuery:s})}),(n==null?void 0:n.length)===0?e.jsx("div",{className:"h-24 text-xs flex items-center justify-center",children:"No pages found"}):n==null?void 0:n.map(t=>e.jsx(a.DropdownMenuItem,{onClick:()=>l(t),disabled:u?i!==t.lang:o!==t.lang,className:`flex flex-col justify-start cursor-pointer overflow-x-auto whitespace-nowrap no-scrollbar ${t.id===(r==null?void 0:r.id)?"bg-blue-50":"hover:bg-gray-50"}`,children:e.jsx("div",{className:"w-full text-xs whitespace-nowrap px-2 py-[2px]",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsx("span",{className:"font-mono font-medium text-gray-500 text-xs rounded-full px-2 py-[1px] border border-gray-300 truncate",children:t.slug})]})})},t.id))]})]})},j=()=>{const{dynamicPage:r,dynamicPages:l,allLangPages:c,selectedLang:s,searchQuery:n,updateDynamicPage:o,updateSearchQuery:i,onChangeLanguage:u}=g.useDynamicPageSelector(),t=d.useRef(void 0);return d.useEffect(()=>{t.current!==s&&r&&(u(),t.current=s)},[s,l]),e.jsx("div",{className:"relative",children:e.jsx(m,{dynamicPage:r,setDynamicPage:o,searchQuery:n,setSearchQuery:i,dynamicPages:c})})};exports.default=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("@chaibuilder/sdk"),a=require("@chaibuilder/sdk/ui"),h=require("lodash-es"),p=require("lucide-react"),d=require("react"),g=require("./index-C1bimRWu.cjs"),f=({isDefaultLang:r,searchQuery:l,setSearchQuery:c})=>e.jsx(a.Input,{type:"text",autoFocus:!0,value:r?l:"",onChange:s=>c(s.target.value),placeholder:r?"Search pages...":"To search select default language",disabled:!r,onKeyDown:s=>s.stopPropagation()}),m=({dynamicPage:r,setDynamicPage:l,searchQuery:c,setSearchQuery:s,dynamicPages:n})=>{const{selectedLang:o,fallbackLang:i}=x.useLanguages(),u=(o==null?void 0:o.length)===0;return e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(a.Button,{variant:"ghost",className:"w-max focus:outline-none focus:ring-0 border-[0px] rounded-md py-1 text-sm h-max border border-gray-200 hover:bg-gray-100 pl-4",children:[r?h.get(r,"name"):"Select Page",e.jsx(p.ChevronDown,{className:"ml-2 h-4 w-4"})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-96 divide-y shadow-xl p-0 max-h-[75vh]",children:[e.jsx("div",{className:"p-1.5 bg-gray-50/30",children:e.jsx(f,{isDefaultLang:u,searchQuery:c,setSearchQuery:s})}),(n==null?void 0:n.length)===0?e.jsx("div",{className:"h-24 text-xs flex items-center justify-center",children:"No pages found"}):n==null?void 0:n.map(t=>e.jsx(a.DropdownMenuItem,{onClick:()=>l(t),disabled:u?i!==t.lang:o!==t.lang,className:`flex flex-col justify-start cursor-pointer overflow-x-auto whitespace-nowrap no-scrollbar ${t.id===(r==null?void 0:r.id)?"bg-blue-50":"hover:bg-gray-50"}`,children:e.jsx("div",{className:"w-full text-xs whitespace-nowrap px-2 py-[2px]",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsx("span",{className:"font-mono font-medium text-gray-500 text-xs rounded-full px-2 py-[1px] border border-gray-300 truncate",children:t.slug})]})})},t.id))]})]})},j=()=>{const{dynamicPage:r,dynamicPages:l,allLangPages:c,selectedLang:s,searchQuery:n,updateDynamicPage:o,updateSearchQuery:i,onChangeLanguage:u}=g.useDynamicPageSelector(),t=d.useRef(void 0);return d.useEffect(()=>{t.current!==s&&r&&(u(),t.current=s)},[s,l]),e.jsx("div",{className:"relative",children:e.jsx(m,{dynamicPage:r,setDynamicPage:o,searchQuery:n,setSearchQuery:i,dynamicPages:c})})};exports.default=j;
@@ -4,7 +4,7 @@ import { DropdownMenu as h, DropdownMenuTrigger as p, Button as m, DropdownMenuC
4
4
  import { get as v } from "lodash-es";
5
5
  import { ChevronDown as w } from "lucide-react";
6
6
  import { useRef as b, useEffect as N } from "react";
7
- import { k as y } from "./index-CSOKPmkj.js";
7
+ import { k as y } from "./index-C_34q9jG.js";
8
8
  const D = ({
9
9
  isDefaultLang: e,
10
10
  searchQuery: l,
@@ -1,7 +1,7 @@
1
- import { g as Dt } from "./chunk-55IACEB6-yEIZuruo.js";
2
- import { s as wt } from "./chunk-QN33PNHL-eCpJSQLd.js";
3
- import { _ as u, s as Vt, g as Lt, c as Mt, b as Bt, o as Ft, p as Yt, d as tt, l as D, v as Pt, t as zt, D as Gt, z as Kt, A as Zt, j as Ut, u as jt, B as Wt } from "./mermaid.core-e6RNUZK7.js";
4
- import { c as Qt } from "./channel-DMpDH8Tt.js";
1
+ import { g as Dt } from "./chunk-55IACEB6-xzVewFKl.js";
2
+ import { s as wt } from "./chunk-QN33PNHL-qSV2Zj2E.js";
3
+ import { _ as u, s as Vt, g as Lt, c as Mt, b as Bt, o as Ft, p as Yt, d as tt, l as D, v as Pt, t as zt, D as Gt, z as Kt, A as Zt, j as Ut, u as jt, B as Wt } from "./mermaid.core-3NhAXOzj.js";
4
+ import { c as Qt } from "./channel-Cdlcq82Q.js";
5
5
  var dt = function() {
6
6
  var s = /* @__PURE__ */ u(function(R, n, a, c) {
7
7
  for (a = a || {}, c = R.length; c--; a[R[c]] = n) ;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ct=require("./chunk-55IACEB6-MgFQOjd_.cjs"),vt=require("./chunk-QN33PNHL-D0hZD6ce.cjs"),a=require("./mermaid.core-DY8gIrXk.cjs"),Dt=require("./channel-DshxF_w-.cjs");var ht=function(){var s=a.__name(function(R,r,c,l){for(c=c||{},l=R.length;l--;c[R[l]]=r);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],u=[1,10],d=[1,11],h=[1,12],o=[1,13],y=[1,20],f=[1,21],k=[1,22],w=[1,23],K=[1,24],S=[1,19],$=[1,25],Z=[1,26],T=[1,18],L=[1,33],tt=[1,34],et=[1,35],st=[1,36],it=[1,37],ut=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],O=[1,42],N=[1,43],V=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],A=[1,58],P=[1,62],Y=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],dt=[63,64,65,66,67],_t=[1,81],pt=[1,80],yt=[1,78],ft=[1,79],gt=[6,10,42,47],C=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],q=[1,87],z=[19,56],mt=[1,98],bt=[1,97],nt=[19,56,58,60],rt={trace:a.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:a.__name(function(r,c,l,n,_,t,G){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:n.addEntity(t[e-4]),n.addEntity(t[e-2]),n.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:n.addEntity(t[e-8]),n.addEntity(t[e-4]),n.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),n.setClass([t[e-8]],t[e-6]),n.setClass([t[e-4]],t[e-2]);break;case 10:n.addEntity(t[e-6]),n.addEntity(t[e-2]),n.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),n.setClass([t[e-6]],t[e-4]);break;case 11:n.addEntity(t[e-6]),n.addEntity(t[e-4]),n.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),n.setClass([t[e-4]],t[e-2]);break;case 12:n.addEntity(t[e-3]),n.addAttributes(t[e-3],t[e-1]);break;case 13:n.addEntity(t[e-5]),n.addAttributes(t[e-5],t[e-1]),n.setClass([t[e-5]],t[e-3]);break;case 14:n.addEntity(t[e-2]);break;case 15:n.addEntity(t[e-4]),n.setClass([t[e-4]],t[e-2]);break;case 16:n.addEntity(t[e]);break;case 17:n.addEntity(t[e-2]),n.setClass([t[e-2]],t[e]);break;case 18:n.addEntity(t[e-6],t[e-4]),n.addAttributes(t[e-6],t[e-1]);break;case 19:n.addEntity(t[e-8],t[e-6]),n.addAttributes(t[e-8],t[e-1]),n.setClass([t[e-8]],t[e-3]);break;case 20:n.addEntity(t[e-5],t[e-3]);break;case 21:n.addEntity(t[e-7],t[e-5]),n.setClass([t[e-7]],t[e-2]);break;case 22:n.addEntity(t[e-3],t[e-1]);break;case 23:n.addEntity(t[e-5],t[e-3]),n.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=t[e-3],n.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 56:case 64:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],n.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],n.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 76:case 77:this.$=t[e].replace(/"/g,"");break;case 55:case 78:this.$=t[e];break;case 57:t[e].push(t[e-1]),this.$=t[e];break;case 58:this.$={type:t[e-1],name:t[e]};break;case 59:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 60:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 61:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 62:case 63:case 66:this.$=t[e];break;case 65:t[e-2].push(t[e]),this.$=t[e-2];break;case 67:this.$=t[e].replace(/"/g,"");break;case 68:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:u,24:d,26:h,28:o,29:14,30:15,31:16,32:17,33:y,34:f,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:27,11:9,22:u,24:d,26:h,28:o,29:14,30:15,31:16,32:17,33:y,34:f,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:L,64:tt,65:et,66:st,67:it}),{23:[1,38]},{25:[1,39]},{27:[1,40]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(ut,[2,54]),s(ut,[2,55]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:41,40:O,41:N},{16:44,40:O,41:N},{16:45,40:O,41:N},s(i,[2,4]),{11:46,40:S,50:T},{16:47,40:O,41:N},{18:48,19:[1,49],51:50,52:51,56:V},{11:53,40:S,50:T},{62:54,68:[1,55],69:[1,56]},s(M,[2,69]),s(M,[2,70]),s(M,[2,71]),s(M,[2,72]),s(M,[2,73]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:B,38:57,41:F,42:A,45:59,46:60,48:P,49:Y},s(U,[2,37]),s(U,[2,38]),{16:65,40:O,41:N,42:A},{13:B,38:66,41:F,42:A,45:59,46:60,48:P,49:Y},{13:[1,67],15:[1,68]},s(i,[2,17],{61:32,12:69,17:[1,70],42:A,63:L,64:tt,65:et,66:st,67:it}),{19:[1,71]},s(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:V},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:L,64:tt,65:et,66:st,67:it},s(dt,[2,74]),s(dt,[2,75]),{6:_t,10:pt,39:77,42:yt,47:ft},{40:[1,82],41:[1,83]},s(gt,[2,43],{46:84,13:B,41:F,48:P,49:Y}),s(C,[2,45]),s(C,[2,50]),s(C,[2,51]),s(C,[2,52]),s(C,[2,53]),s(i,[2,41],{42:A}),{6:_t,10:pt,39:85,42:yt,47:ft},{14:86,40:j,50:W,70:q},{16:90,40:O,41:N},{11:91,40:S,50:T},{18:92,19:[1,93],51:50,52:51,56:V},s(i,[2,12]),{19:[2,57]},s(z,[2,58],{54:94,55:95,57:96,59:mt,60:bt}),s([19,56,59,60],[2,63]),s(i,[2,22],{15:[1,100],17:[1,99]}),s([40,50],[2,68]),s(i,[2,36]),{13:B,41:F,45:101,46:60,48:P,49:Y},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(U,[2,39]),s(U,[2,40]),s(C,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,76]),s(i,[2,77]),s(i,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},s(i,[2,15]),s(z,[2,59],{55:106,58:[1,107],60:bt}),s(z,[2,60]),s(nt,[2,64]),s(z,[2,67]),s(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:V},{16:110,40:O,41:N},s(gt,[2,44],{46:84,13:B,41:F,48:P,49:Y}),{14:111,40:j,50:W,70:q},{16:112,40:O,41:N},{14:113,40:j,50:W,70:q},s(i,[2,13]),s(z,[2,61]),{57:114,59:mt},{19:[1,115]},s(i,[2,20]),s(i,[2,23],{17:[1,116],42:A}),s(i,[2,11]),{13:[1,117],42:A},s(i,[2,10]),s(nt,[2,65]),s(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:V},{14:120,40:j,50:W,70:q},{19:[1,121]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:a.__name(function(r,c){if(c.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=c,l}},"parseError"),parse:a.__name(function(r){var c=this,l=[0],n=[],_=[null],t=[],G=this.table,e="",X=0,kt=0,At=2,Et=1,Rt=t.slice.call(arguments,1),p=Object.create(this.lexer),I={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&(I.yy[at]=this.yy[at]);p.setInput(r,I.yy),I.yy.lexer=p,I.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var ct=p.yylloc;t.push(ct);var It=p.options&&p.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(m){l.length=l.length-2*m,_.length=_.length-m,t.length=t.length-m}a.__name(xt,"popStack");function St(){var m;return m=n.pop()||p.lex()||Et,typeof m!="number"&&(m instanceof Array&&(n=m,m=n.pop()),m=c.symbols_[m]||m),m}a.__name(St,"lex");for(var g,x,b,lt,v={},H,E,Tt,J;;){if(x=l[l.length-1],this.defaultActions[x]?b=this.defaultActions[x]:((g===null||typeof g>"u")&&(g=St()),b=G[x]&&G[x][g]),typeof b>"u"||!b.length||!b[0]){var ot="";J=[];for(H in G[x])this.terminals_[H]&&H>At&&J.push("'"+this.terminals_[H]+"'");p.showPosition?ot="Parse error on line "+(X+1)+`:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ct=require("./chunk-55IACEB6-Ya_-e5Gj.cjs"),vt=require("./chunk-QN33PNHL-B65aZfT8.cjs"),a=require("./mermaid.core-Cop_RRH4.cjs"),Dt=require("./channel-D8SQrHOQ.cjs");var ht=function(){var s=a.__name(function(R,r,c,l){for(c=c||{},l=R.length;l--;c[R[l]]=r);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],u=[1,10],d=[1,11],h=[1,12],o=[1,13],y=[1,20],f=[1,21],k=[1,22],w=[1,23],K=[1,24],S=[1,19],$=[1,25],Z=[1,26],T=[1,18],L=[1,33],tt=[1,34],et=[1,35],st=[1,36],it=[1,37],ut=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],O=[1,42],N=[1,43],V=[1,52],M=[40,50,68,69],B=[1,63],F=[1,61],A=[1,58],P=[1,62],Y=[1,64],U=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],dt=[63,64,65,66,67],_t=[1,81],pt=[1,80],yt=[1,78],ft=[1,79],gt=[6,10,42,47],C=[6,10,13,41,42,47,48,49],j=[1,89],W=[1,88],q=[1,87],z=[19,56],mt=[1,98],bt=[1,97],nt=[19,56,58,60],rt={trace:a.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:a.__name(function(r,c,l,n,_,t,G){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:n.addEntity(t[e-4]),n.addEntity(t[e-2]),n.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:n.addEntity(t[e-8]),n.addEntity(t[e-4]),n.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),n.setClass([t[e-8]],t[e-6]),n.setClass([t[e-4]],t[e-2]);break;case 10:n.addEntity(t[e-6]),n.addEntity(t[e-2]),n.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),n.setClass([t[e-6]],t[e-4]);break;case 11:n.addEntity(t[e-6]),n.addEntity(t[e-4]),n.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),n.setClass([t[e-4]],t[e-2]);break;case 12:n.addEntity(t[e-3]),n.addAttributes(t[e-3],t[e-1]);break;case 13:n.addEntity(t[e-5]),n.addAttributes(t[e-5],t[e-1]),n.setClass([t[e-5]],t[e-3]);break;case 14:n.addEntity(t[e-2]);break;case 15:n.addEntity(t[e-4]),n.setClass([t[e-4]],t[e-2]);break;case 16:n.addEntity(t[e]);break;case 17:n.addEntity(t[e-2]),n.setClass([t[e-2]],t[e]);break;case 18:n.addEntity(t[e-6],t[e-4]),n.addAttributes(t[e-6],t[e-1]);break;case 19:n.addEntity(t[e-8],t[e-6]),n.addAttributes(t[e-8],t[e-1]),n.setClass([t[e-8]],t[e-3]);break;case 20:n.addEntity(t[e-5],t[e-3]);break;case 21:n.addEntity(t[e-7],t[e-5]),n.setClass([t[e-7]],t[e-2]);break;case 22:n.addEntity(t[e-3],t[e-1]);break;case 23:n.addEntity(t[e-5],t[e-3]),n.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),n.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),n.setAccDescription(this.$);break;case 32:n.setDirection("TB");break;case 33:n.setDirection("BT");break;case 34:n.setDirection("RL");break;case 35:n.setDirection("LR");break;case 36:this.$=t[e-3],n.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 56:case 64:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],n.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],n.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 76:case 77:this.$=t[e].replace(/"/g,"");break;case 55:case 78:this.$=t[e];break;case 57:t[e].push(t[e-1]),this.$=t[e];break;case 58:this.$={type:t[e-1],name:t[e]};break;case 59:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 60:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 61:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 62:case 63:case 66:this.$=t[e];break;case 65:t[e-2].push(t[e]),this.$=t[e-2];break;case 67:this.$=t[e].replace(/"/g,"");break;case 68:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 69:this.$=n.Cardinality.ZERO_OR_ONE;break;case 70:this.$=n.Cardinality.ZERO_OR_MORE;break;case 71:this.$=n.Cardinality.ONE_OR_MORE;break;case 72:this.$=n.Cardinality.ONLY_ONE;break;case 73:this.$=n.Cardinality.MD_PARENT;break;case 74:this.$=n.Identification.NON_IDENTIFYING;break;case 75:this.$=n.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:u,24:d,26:h,28:o,29:14,30:15,31:16,32:17,33:y,34:f,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:27,11:9,22:u,24:d,26:h,28:o,29:14,30:15,31:16,32:17,33:y,34:f,35:k,36:w,37:K,40:S,43:$,44:Z,50:T},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:L,64:tt,65:et,66:st,67:it}),{23:[1,38]},{25:[1,39]},{27:[1,40]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(ut,[2,54]),s(ut,[2,55]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:41,40:O,41:N},{16:44,40:O,41:N},{16:45,40:O,41:N},s(i,[2,4]),{11:46,40:S,50:T},{16:47,40:O,41:N},{18:48,19:[1,49],51:50,52:51,56:V},{11:53,40:S,50:T},{62:54,68:[1,55],69:[1,56]},s(M,[2,69]),s(M,[2,70]),s(M,[2,71]),s(M,[2,72]),s(M,[2,73]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:B,38:57,41:F,42:A,45:59,46:60,48:P,49:Y},s(U,[2,37]),s(U,[2,38]),{16:65,40:O,41:N,42:A},{13:B,38:66,41:F,42:A,45:59,46:60,48:P,49:Y},{13:[1,67],15:[1,68]},s(i,[2,17],{61:32,12:69,17:[1,70],42:A,63:L,64:tt,65:et,66:st,67:it}),{19:[1,71]},s(i,[2,14]),{18:72,19:[2,56],51:50,52:51,56:V},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:L,64:tt,65:et,66:st,67:it},s(dt,[2,74]),s(dt,[2,75]),{6:_t,10:pt,39:77,42:yt,47:ft},{40:[1,82],41:[1,83]},s(gt,[2,43],{46:84,13:B,41:F,48:P,49:Y}),s(C,[2,45]),s(C,[2,50]),s(C,[2,51]),s(C,[2,52]),s(C,[2,53]),s(i,[2,41],{42:A}),{6:_t,10:pt,39:85,42:yt,47:ft},{14:86,40:j,50:W,70:q},{16:90,40:O,41:N},{11:91,40:S,50:T},{18:92,19:[1,93],51:50,52:51,56:V},s(i,[2,12]),{19:[2,57]},s(z,[2,58],{54:94,55:95,57:96,59:mt,60:bt}),s([19,56,59,60],[2,63]),s(i,[2,22],{15:[1,100],17:[1,99]}),s([40,50],[2,68]),s(i,[2,36]),{13:B,41:F,45:101,46:60,48:P,49:Y},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(U,[2,39]),s(U,[2,40]),s(C,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,76]),s(i,[2,77]),s(i,[2,78]),{13:[1,102],42:A},{13:[1,104],15:[1,103]},{19:[1,105]},s(i,[2,15]),s(z,[2,59],{55:106,58:[1,107],60:bt}),s(z,[2,60]),s(nt,[2,64]),s(z,[2,67]),s(nt,[2,66]),{18:108,19:[1,109],51:50,52:51,56:V},{16:110,40:O,41:N},s(gt,[2,44],{46:84,13:B,41:F,48:P,49:Y}),{14:111,40:j,50:W,70:q},{16:112,40:O,41:N},{14:113,40:j,50:W,70:q},s(i,[2,13]),s(z,[2,61]),{57:114,59:mt},{19:[1,115]},s(i,[2,20]),s(i,[2,23],{17:[1,116],42:A}),s(i,[2,11]),{13:[1,117],42:A},s(i,[2,10]),s(nt,[2,65]),s(i,[2,18]),{18:118,19:[1,119],51:50,52:51,56:V},{14:120,40:j,50:W,70:q},{19:[1,121]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:a.__name(function(r,c){if(c.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=c,l}},"parseError"),parse:a.__name(function(r){var c=this,l=[0],n=[],_=[null],t=[],G=this.table,e="",X=0,kt=0,At=2,Et=1,Rt=t.slice.call(arguments,1),p=Object.create(this.lexer),I={yy:{}};for(var at in this.yy)Object.prototype.hasOwnProperty.call(this.yy,at)&&(I.yy[at]=this.yy[at]);p.setInput(r,I.yy),I.yy.lexer=p,I.yy.parser=this,typeof p.yylloc>"u"&&(p.yylloc={});var ct=p.yylloc;t.push(ct);var It=p.options&&p.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(m){l.length=l.length-2*m,_.length=_.length-m,t.length=t.length-m}a.__name(xt,"popStack");function St(){var m;return m=n.pop()||p.lex()||Et,typeof m!="number"&&(m instanceof Array&&(n=m,m=n.pop()),m=c.symbols_[m]||m),m}a.__name(St,"lex");for(var g,x,b,lt,v={},H,E,Tt,J;;){if(x=l[l.length-1],this.defaultActions[x]?b=this.defaultActions[x]:((g===null||typeof g>"u")&&(g=St()),b=G[x]&&G[x][g]),typeof b>"u"||!b.length||!b[0]){var ot="";J=[];for(H in G[x])this.terminals_[H]&&H>At&&J.push("'"+this.terminals_[H]+"'");p.showPosition?ot="Parse error on line "+(X+1)+`:
2
2
  `+p.showPosition()+`
3
3
  Expecting `+J.join(", ")+", got '"+(this.terminals_[g]||g)+"'":ot="Parse error on line "+(X+1)+": Unexpected "+(g==Et?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(ot,{text:p.match,token:this.terminals_[g]||g,line:p.yylineno,loc:ct,expected:J})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+g);switch(b[0]){case 1:l.push(g),_.push(p.yytext),t.push(p.yylloc),l.push(b[1]),g=null,kt=p.yyleng,e=p.yytext,X=p.yylineno,ct=p.yylloc;break;case 2:if(E=this.productions_[b[1]][1],v.$=_[_.length-E],v._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},It&&(v._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(v,[e,kt,X,I.yy,b[1],_,t].concat(Rt)),typeof lt<"u")return lt;E&&(l=l.slice(0,-1*E*2),_=_.slice(0,-1*E),t=t.slice(0,-1*E)),l.push(this.productions_[b[1]][0]),_.push(v.$),t.push(v._$),Tt=G[l[l.length-2]][l[l.length-1]],l.push(Tt);break;case 3:return!0}}return!0},"parse")},Nt=function(){var R={EOF:1,parseError:a.__name(function(c,l){if(this.yy.parser)this.yy.parser.parseError(c,l);else throw new Error(c)},"parseError"),setInput:a.__name(function(r,c){return this.yy=c||this.yy||{},this._input=r,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:a.__name(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var c=r.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a.__name(function(r){var c=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var n=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),l.length-1&&(this.yylineno-=l.length-1);var _=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:l?(l.length===n.length?this.yylloc.first_column:0)+n[n.length-l.length].length-l[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:a.__name(function(){return this._more=!0,this},"more"),reject:a.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a.__name(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a.__name(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a.__name(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a.__name(function(){var r=this.pastInput(),c=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ut=require("./chunk-FMBD7UC4-DeDzgDPq.cjs"),c=require("./mermaid.core-DY8gIrXk.cjs"),Wt=require("./chunk-55IACEB6-MgFQOjd_.cjs"),jt=require("./chunk-QN33PNHL-D0hZD6ce.cjs"),zt=require("./channel-DshxF_w-.cjs");var qt="flowchart-",Re,Kt=(Re=class{constructor(){this.vertexCounter=0,this.config=c.getConfig2(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=c.setAccTitle,this.setAccDescription=c.setAccDescription,this.setDiagramTitle=c.setDiagramTitle,this.getAccTitle=c.getAccTitle,this.getAccDescription=c.getAccDescription,this.getDiagramTitle=c.getDiagramTitle,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return c.common_default.sanitizeText(i,this.config)}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return n.domId;return i}addVertex(i,n,a,u,l,g,h={},k){var L,_;if(!i||i.trim().length===0)return;let r;if(k!==void 0){let p;k.includes(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ut=require("./chunk-FMBD7UC4-Be12B01Q.cjs"),c=require("./mermaid.core-Cop_RRH4.cjs"),Wt=require("./chunk-55IACEB6-Ya_-e5Gj.cjs"),jt=require("./chunk-QN33PNHL-B65aZfT8.cjs"),zt=require("./channel-D8SQrHOQ.cjs");var qt="flowchart-",Re,Kt=(Re=class{constructor(){this.vertexCounter=0,this.config=c.getConfig2(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=c.setAccTitle,this.setAccDescription=c.setAccDescription,this.setDiagramTitle=c.setDiagramTitle,this.getAccTitle=c.getAccTitle,this.getAccDescription=c.getAccDescription,this.getDiagramTitle=c.getDiagramTitle,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return c.common_default.sanitizeText(i,this.config)}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return n.domId;return i}addVertex(i,n,a,u,l,g,h={},k){var L,_;if(!i||i.trim().length===0)return;let r;if(k!==void 0){let p;k.includes(`
2
2
  `)?p=k+`
3
3
  `:p=`{
4
4
  `+k+`
@@ -1,8 +1,8 @@
1
- import { g as qt } from "./chunk-FMBD7UC4-DsnO3YB7.js";
2
- import { d as b1, s as Ht, c as Xt, o as Qt, g as Jt, b as Zt, p as $t, _ as m, e as te, q as ee, J as se, r as ie, l as t1, t as st, u as it, j as S1, v as re, x as ae, y as Ot, z as ne, A as ue, B as oe } from "./mermaid.core-e6RNUZK7.js";
3
- import { g as le } from "./chunk-55IACEB6-yEIZuruo.js";
4
- import { s as ce } from "./chunk-QN33PNHL-eCpJSQLd.js";
5
- import { c as he } from "./channel-DMpDH8Tt.js";
1
+ import { g as qt } from "./chunk-FMBD7UC4-9Wx_99-Q.js";
2
+ import { d as b1, s as Ht, c as Xt, o as Qt, g as Jt, b as Zt, p as $t, _ as m, e as te, q as ee, J as se, r as ie, l as t1, t as st, u as it, j as S1, v as re, x as ae, y as Ot, z as ne, A as ue, B as oe } from "./mermaid.core-3NhAXOzj.js";
3
+ import { g as le } from "./chunk-55IACEB6-xzVewFKl.js";
4
+ import { s as ce } from "./chunk-QN33PNHL-qSV2Zj2E.js";
5
+ import { c as he } from "./channel-Cdlcq82Q.js";
6
6
  var de = "flowchart-", P1, pe = (P1 = class {
7
7
  // cspell:ignore funs
8
8
  constructor() {